/* Canal Pensées — frontend styles. Mockup figgé Florian 2026-05-10. */
:root {
  --bg: #FAFAFA;
  --txt: #1A1A1A;
  --muted: #8A8A8E;
  --line: #ECECEC;
  --bg-chat: #EEEDFE;
  --fg-chat: #26215C;
  --bg-cc: #E1F5EE;
  --fg-cc: #04342C;
  --green: #1D9E75;
  --red: #C0392B;
  --orange: #C56A4F;
  --hdr-h: 56px;
  --ftr-h: 32px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--hdr-h);
  padding-bottom: calc(var(--ftr-h) + env(safe-area-inset-bottom));
}
.hdr {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.hdr-inner {
  max-width: 380px;
  margin: 0 auto;
  padding: 8px 12px;
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EEEDFE 0%, #E1F5EE 100%);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}
.hdr-text { min-width: 0; flex: 1; }
.title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subtitle {
  margin: 1px 0 0 0;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.thread {
  flex: 1;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 12px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bubble-block {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}
.bubble-block.from-chat { align-items: flex-start; }
.bubble-block.from-cc { align-items: flex-end; }
.author {
  font-size: 11px;
  color: var(--muted);
  padding: 0 8px;
  margin-bottom: 4px;
}
.bubble {
  max-width: 78%;
  min-width: 0;
  padding: 8px 12px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.4;
  margin-top: 2px;
  animation: slide-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bubble.chat {
  background: var(--bg-chat);
  color: var(--fg-chat);
  border-radius: 18px 18px 18px 4px;
}
.bubble.cc {
  background: var(--bg-cc);
  color: var(--fg-cc);
  border-radius: 18px 18px 4px 18px;
}
.bubble + .bubble {
  margin-top: 2px;
}
.bubble-block.from-chat .bubble:not(:first-of-type) { border-top-left-radius: 4px; }
.bubble-block.from-chat .bubble:not(:last-of-type) { border-bottom-left-radius: 4px; }
.bubble-block.from-cc .bubble:not(:first-of-type) { border-top-right-radius: 4px; }
.bubble-block.from-cc .bubble:not(:last-of-type) { border-bottom-right-radius: 4px; }
.bubble h1, .bubble h2, .bubble h3 { font-size: 14px; font-weight: 600; margin: 6px 0 2px; }
.bubble p { margin: 0 0 4px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 4px 0; padding-left: 20px; }
.bubble code {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
}
.bubble pre {
  background: rgba(0, 0, 0, 0.06);
  padding: 6px 8px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 4px 0;
  font-size: 12px;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble pre code { background: transparent; padding: 0; }
.bubble a { color: inherit; text-decoration: underline; }
.timestamp {
  font-size: 10px;
  color: var(--muted);
  padding: 0 8px;
  margin-top: 4px;
}
.bubble-block.from-chat .timestamp { align-self: flex-start; }
.bubble-block.from-cc .timestamp { align-self: flex-end; }
.typing {
  display: inline-flex;
  gap: 3px;
  padding: 10px 14px;
  background: var(--bg-cc);
  border-radius: 18px 18px 4px 18px;
  margin-top: 2px;
  align-self: flex-end;
}
.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-cc);
  opacity: 0.45;
  animation: typing 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--ftr-h) + 8px + env(safe-area-inset-bottom));
  max-width: 356px;
  margin: 0 auto;
  background: rgba(192, 106, 79, 0.95);
  color: #fff;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.banner.error { background: rgba(192, 57, 43, 0.95); }
.ftr {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--ftr-h);
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 32px 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0F11;
    --txt: #ECECEE;
    --muted: #8E8E93;
    --line: #1F1F22;
  }
  .hdr, .ftr { background: rgba(15, 15, 17, 0.92); }
  .bubble code, .bubble pre { background: rgba(255, 255, 255, 0.08); }
}
