/* ============================================================
   COMMELO Pulse — "Deep-dark premium" design system.
   Ported from design/mockup-a.html into the real app. Fonts are
   self-hosted (see @font-face below); no runtime CDN references.
   ============================================================ */

/* ---------- self-hosted variable fonts ---------- */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --red:        #B91C1C;
  --red-dark:   #991B1B;
  --red-soft:   rgba(185, 28, 28, .14);
  --red-line:   rgba(185, 28, 28, .35);

  --black:      #0D0D0D;
  --surface-1:  #121212;
  --surface-2:  #171717;
  --surface-3:  #1c1c1c;
  --surface-4:  #202020;

  --line:       #262626;
  --line-strong:#333333;

  --white:      #f6f5f4;
  --fg:         #e7e5e3;
  --muted:      #9a9794;
  --muted-2:    #6a6864;
  --faint:      #4d4b48;

  --ok:         #7fb894;   --ok-bg:      rgba(127,184,148,.10);  --ok-line: rgba(127,184,148,.30);
  --risk-c:     #d1a24a;   --risk-bg:    rgba(209,162,74,.11);   --risk-line: rgba(209,162,74,.32);
  --block:      #d1655c;   --block-bg:   rgba(209,101,92,.12);   --block-line: rgba(209,101,92,.34);
  --done:       #8f8c88;   --done-bg:    rgba(143,140,136,.10);  --done-line: rgba(143,140,136,.28);

  --syn-key:    #b9b6b2;
  --syn-str:    #86c9a4;
  --syn-num:    #d1a24a;
  --syn-null:   #b96b66;
  --syn-punc:   #6a6864;

  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 24px 60px -20px rgba(0,0,0,.75), 0 2px 0 rgba(255,255,255,.02) inset;
  --ease:       cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--black);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1100px 620px at 82% -8%, rgba(185,28,28,.09), transparent 60%),
    radial-gradient(900px 700px at -10% 8%, rgba(153,27,27,.06), transparent 55%),
    radial-gradient(1200px 900px at 50% 128%, rgba(185,28,28,.05), transparent 60%);
  background-attachment: fixed;
}
h1,h2,h3,h4 { font-family: "Outfit", sans-serif; font-weight: 600; letter-spacing: -.01em; margin: 0; color: var(--white); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   LOGO + WORDMARK
   ============================================================ */
.brandlock { display: inline-flex; align-items: center; gap: 12px; }
.logo-mark { display: block; flex: none; }
.logo-mark .ring { animation: spin 60s linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .logo-mark .ring { animation: none; } }

.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark .co {
  font-family: "Outfit", sans-serif; font-weight: 700;
  letter-spacing: .18em; color: var(--white);
  font-size: 14px;
}
.wordmark .pulse {
  font-family: "Outfit", sans-serif; font-weight: 400;
  letter-spacing: .30em; text-transform: uppercase;
  font-size: 9.5px; margin-top: 5px; color: var(--red);
  padding-left: 1px;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 40px 20px;
}
.login-shell {
  width: 100%; max-width: 980px;
  display: grid; grid-template-columns: 1.05fr .95fr;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-1);
  box-shadow: var(--shadow);
}
.login-hero {
  position: relative;
  padding: 54px 52px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(600px 340px at 20% 0%, rgba(185,28,28,.16), transparent 60%),
    linear-gradient(180deg, #101010, #0c0c0c);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.login-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(560px 460px at 30% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}
.login-hero .top, .login-hero .mid, .login-hero .bot { position: relative; z-index: 1; }
.login-hero .headline {
  font-family: "Outfit", sans-serif; font-weight: 300;
  font-size: 33px; line-height: 1.18; letter-spacing: -.015em;
  color: var(--white); margin-top: 30px; max-width: 15ch;
}
.login-hero .headline b { font-weight: 600; color: #fff; }
.login-hero .tagline {
  margin-top: 18px; color: var(--muted); font-size: 14.5px; max-width: 34ch;
}
.login-hero .tagline .em { color: var(--red); font-weight: 500; }
.hero-feats { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.hero-feat { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 13.5px; }
.hero-feat svg { flex: none; color: var(--red); }
.hero-feat b { color: var(--fg); font-weight: 500; }

.login-panel {
  padding: 54px 52px;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--surface-1);
}
.login-panel .kicker {
  font-family: "Outfit", sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2);
}
.login-panel h1 { font-size: 25px; font-weight: 600; margin-top: 10px; }
.login-panel .lead { color: var(--muted); margin-top: 8px; font-size: 14px; }

.form-error {
  margin-top: 18px; display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--block-line); background: var(--block-bg);
  color: var(--block); font-size: 13px;
}
.form-error svg { flex: none; }

.field { margin-top: 20px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 500; color: var(--muted);
  margin-bottom: 8px; letter-spacing: .01em;
}
.input {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px; height: 46px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.input:focus-within { border-color: var(--red-line); box-shadow: 0 0 0 3px var(--red-soft); background: var(--surface-4); }
.input svg { color: var(--muted-2); flex: none; }
.input input {
  all: unset; flex: 1; color: var(--white); font-family: "Inter"; font-size: 14.5px;
  letter-spacing: .01em;
}
.input input::placeholder { color: var(--faint); }
.input .ghost { color: var(--faint); font-size: 12px; user-select: none; cursor: pointer; }

.btn-primary {
  margin-top: 26px; width: 100%; height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--red); color: #fff;
  font-family: "Outfit", sans-serif; font-weight: 600; font-size: 15px; letter-spacing: .01em;
  border: 1px solid #c8302f; border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 12px 30px -12px rgba(185,28,28,.7), 0 1px 0 rgba(255,255,255,.14) inset;
  transition: transform .12s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.btn-primary:hover { background: #cf2321; transform: translateY(-1px); box-shadow: 0 18px 40px -14px rgba(185,28,28,.85), 0 1px 0 rgba(255,255,255,.18) inset; }
.btn-primary:active { transform: translateY(0); }

.login-note {
  margin-top: 20px; display: flex; align-items: flex-start; gap: 9px;
  color: var(--muted-2); font-size: 12.5px;
  padding-top: 18px; border-top: 1px solid var(--line);
}
.login-note svg { color: var(--muted-2); flex: none; margin-top: 2px; }
.cred-hint { color: var(--faint); }
.cred-hint code { color: var(--muted); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 11.5px; }

/* ============================================================
   APP SHELL — full-height chat window
   ============================================================ */
.app {
  height: 100vh;
  overflow: hidden;
  background: transparent;
  display: grid;
  grid-template-rows: auto 1fr;
}

/* header */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #131313, #101010);
}
.app-header .right { display: flex; align-items: center; gap: 14px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 6px 5px 5px; border-radius: 100px;
  border: 1px solid var(--line-strong); background: var(--surface-2);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #b91c1c, #7f1516);
  color: #fff; font-family: "Outfit"; font-weight: 600; font-size: 12.5px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; padding-right: 4px; }
.user-meta .nm { font-size: 12.5px; font-weight: 500; color: var(--fg); }
.user-meta .rl { font-size: 10.5px; color: var(--muted-2); }
.logout {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: transparent;
  color: var(--muted); font-size: 12.5px; font-family: "Inter"; font-weight: 500; cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.logout:hover { color: var(--fg); border-color: #444; background: var(--surface-3); }

/* body split */
.app-body { display: grid; grid-template-columns: 264px 1fr; min-height: 0; }

/* sidebar */
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  display: flex; flex-direction: column; min-height: 0;
}
.new-chat-form { margin: 16px 16px 12px; display: block; }
.new-chat {
  width: 100%; height: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid var(--red-line); background: var(--red-soft);
  color: #f0c9c8; font-family: "Outfit"; font-weight: 600; font-size: 13.5px;
  border-radius: 10px; cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.new-chat:hover { background: rgba(185,28,28,.22); color: #fff; border-color: var(--red); }
.side-label {
  padding: 8px 20px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted-2);
  font-family: "Outfit";
}
.sessions { display: flex; flex-direction: column; gap: 3px; padding: 2px 10px; overflow-y: auto; }
.session {
  position: relative;
  display: block; padding: 10px 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.session:hover { background: var(--surface-3); }
.session.active { background: var(--surface-3); border-color: var(--line-strong); }
.session .st { display: flex; align-items: center; gap: 8px; }
.session .st .bar { width: 2px; height: 13px; border-radius: 2px; background: transparent; flex: none; }
.session.active .st .bar { background: var(--red); }
.session .ttl { font-size: 13px; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session .mt { margin-top: 4px; margin-left: 10px; font-size: 11px; color: var(--muted-2); }
.session:not(.active) .ttl { color: var(--muted); font-weight: 400; }

.session-del {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 24px; height: 24px; padding: 0; border-radius: 6px;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid transparent; background: transparent;
  color: var(--muted-2); opacity: 0;
  transition: opacity .14s var(--ease), color .14s var(--ease), background .14s var(--ease), border-color .14s var(--ease);
}
.session:hover .session-del { opacity: 1; }
.session-del:hover { color: var(--block); border-color: var(--block-line); background: var(--block-bg); }

.side-empty { padding: 10px 20px; color: var(--muted-2); font-size: 12px; }

.side-foot {
  margin-top: auto; padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 9px;
  color: var(--muted-2); font-size: 11px;
}
.side-foot .live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); flex: none; }

/* main chat pane */
.chat-main { display: grid; grid-template-rows: 1fr auto; min-height: 0; background: var(--surface-1); }
.transcript { overflow-y: auto; padding: 26px 32px 20px; }
.thread-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 18px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.thread-head .t { font-family: "Outfit"; font-weight: 600; font-size: 15px; color: var(--white); }
.thread-head .meta { font-size: 11.5px; color: var(--muted-2); display: flex; gap: 14px; }
.thread-head .meta span { display: inline-flex; align-items: center; gap: 6px; }

/* empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; height: 100%; padding: 40px; gap: 14px; color: var(--muted);
}
.empty-state .es-mark { opacity: .9; }
.empty-state h1 { font-size: 22px; }
.empty-state p { max-width: 44ch; font-size: 14px; color: var(--muted); }
.empty-state .es-cta {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 20px;
  border: 1px solid var(--red-line); background: var(--red-soft);
  color: #f0c9c8; font-family: "Outfit"; font-weight: 600; font-size: 14px;
  border-radius: 10px; cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.empty-state .es-cta:hover { background: rgba(185,28,28,.22); color: #fff; border-color: var(--red); }

.turn { display: flex; gap: 14px; padding: 20px 0; }
.turn + .turn { border-top: 1px solid rgba(255,255,255,.035); }
.turn .ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; margin-top: 1px; }
.turn.user .ico { background: var(--surface-4); border: 1px solid var(--line-strong); color: var(--muted); font-family: "Outfit"; font-weight: 600; font-size: 12px; }
.turn.bot .ico { background: linear-gradient(150deg, #1b1010, #241012); border: 1px solid var(--red-line); }
.turn .body { flex: 1; min-width: 0; }
.turn .who { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); font-family: "Outfit"; margin-bottom: 7px; }
.turn.user .qtext { font-size: 16.5px; color: var(--white); font-family: "Outfit"; font-weight: 500; letter-spacing: -.005em; }

/* assistant answer typography */
.answer .lead { font-size: 15.5px; color: var(--fg); }
.answer p { font-size: 15px; color: var(--fg); }
.answer p + p { margin-top: 12px; }
.answer .lead b, .answer p b { color: var(--white); font-weight: 600; }
.answer ul { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.answer li { position: relative; padding-left: 20px; color: var(--fg); font-size: 14.5px; line-height: 1.6; }
.answer li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 2px; background: var(--red); transform: rotate(45deg); opacity: .85; }
.answer li b { color: var(--white); font-weight: 600; }
.answer i, .answer em { color: var(--muted); font-style: italic; }

.answer.error .lead { color: var(--block); }

/* ---------- STATUS CHIPS ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 8px; border-radius: 100px;
  font-family: "Outfit", sans-serif; font-size: 11.5px; font-weight: 500; letter-spacing: .01em;
  border: 1px solid; white-space: nowrap;
}
.chip .d { width: 6px; height: 6px; border-radius: 50%; }
.chip.on_track { color: var(--ok);    background: var(--ok-bg);    border-color: var(--ok-line); }
.chip.on_track .d { background: var(--ok); }
.chip.at_risk  { color: var(--risk-c); background: var(--risk-bg); border-color: var(--risk-line); }
.chip.at_risk .d { background: var(--risk-c); }
.chip.blocked  { color: var(--block);  background: var(--block-bg);  border-color: var(--block-line); }
.chip.blocked .d { background: var(--block); }
.chip.done     { color: var(--done);   background: var(--done-bg);   border-color: var(--done-line); }
.chip.done .d  { background: var(--done); }

/* ============================================================
   RETRIEVED-RECORDS DETAILS PANEL
   ============================================================ */
details.retrieved {
  margin-top: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(520px 200px at 100% 0%, rgba(185,28,28,.06), transparent 70%),
    var(--surface-2);
  overflow: hidden;
}
details.retrieved > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  user-select: none;
  transition: background .14s var(--ease);
}
details.retrieved > summary::-webkit-details-marker { display: none; }
details.retrieved > summary:hover { background: rgba(255,255,255,.02); }
.sum-ico {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--red-soft); border: 1px solid var(--red-line); color: #e88a86;
}
.sum-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sum-text .l1 { font-family: "Outfit"; font-weight: 600; font-size: 13.5px; color: var(--white); }
.sum-text .l1 span { color: var(--red); }
.sum-text .l2 { font-size: 11.5px; color: var(--muted-2); font-family: ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-chev { color: var(--muted-2); transition: transform .2s var(--ease); flex: none; }
details.retrieved[open] .sum-chev { transform: rotate(180deg); }
.sum-badge {
  font-family: "Outfit"; font-size: 11px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 100px; padding: 3px 10px; background: var(--surface-3);
  flex: none; white-space: nowrap;
}

.retrieved-inner { border-top: 1px solid var(--line); padding: 18px; display: grid; gap: 18px; }
.panel-block .pb-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px;
}
.pb-title { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); font-family: "Outfit"; display: flex; align-items: center; gap: 8px; }
.pb-title svg { color: var(--red); }

/* filter JSON */
.json {
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 16px;
  font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, monospace;
  font-size: 12.5px; line-height: 1.85;
  overflow-x: auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.json .ln { display: block; white-space: pre; }
.json .k { color: var(--syn-key); }
.json .s { color: var(--syn-str); }
.json .n { color: var(--syn-num); }
.json .nl { color: var(--syn-null); font-style: italic; }
.json .b  { color: var(--syn-num); }
.json .p  { color: var(--syn-punc); }

/* rows table */
.rows {
  width: 100%; border-collapse: collapse;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  font-size: 12.5px;
}
.rows thead th {
  text-align: left; padding: 9px 13px;
  font-family: "Outfit"; font-weight: 600; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2); background: var(--surface-3); border-bottom: 1px solid var(--line);
}
.rows tbody td { padding: 11px 13px; border-bottom: 1px solid rgba(255,255,255,.04); color: var(--muted); vertical-align: middle; }
.rows tbody tr:last-child td { border-bottom: none; }
.rows tbody tr:hover td { background: rgba(255,255,255,.018); }
.rows td.person { color: var(--fg); font-weight: 500; white-space: nowrap; }
.rows td.team   { color: var(--muted); }
.rows td.week   { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; white-space: nowrap; }
.rows td.focus  { color: var(--muted); max-width: 380px; }
.rows td.week .cur { color: var(--red); font-weight: 600; }

.panel-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: 4px; font-size: 11.5px; color: var(--muted-2);
}
.panel-foot .tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-1); border-radius: 6px; padding: 3px 9px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.panel-foot .tag svg { color: var(--ok); }
.panel-foot .sep { color: var(--faint); }
.panel-foot .meta-num { color: var(--muted); }

details.retrieved.mini > summary { padding: 11px 15px; }
details.retrieved.mini .sum-text .l1 { font-size: 12.5px; }

/* ============================================================
   THINKING / HTMX INDICATOR
   ============================================================ */
.thinking {
  display: none; align-items: center; gap: 12px;
  padding: 14px 32px; border-top: 1px solid rgba(255,255,255,.035);
  color: var(--muted); font-size: 13.5px;
  background: var(--surface-1);
}
.thinking.htmx-request { display: flex; }
.thinking .ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(150deg, #1b1010, #241012); border: 1px solid var(--red-line); }
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--red); animation: sp .7s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }
.thinking .steps { display: inline-flex; gap: 7px; margin-left: 4px; }
.thinking .steps b { color: var(--fg); font-weight: 500; }
.thinking .muted { color: var(--muted-2); }

/* input bar */
.composer {
  border-top: 1px solid var(--line);
  padding: 16px 24px 18px;
  background: linear-gradient(180deg, #111111, #0e0e0e);
}
.composer .box {
  display: flex; align-items: flex-end; gap: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 13px; padding: 10px 10px 10px 16px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.composer .box:focus-within { border-color: var(--red-line); box-shadow: 0 0 0 3px var(--red-soft); }
.composer textarea {
  all: unset; flex: 1; color: var(--white); font-family: "Inter"; font-size: 14.5px; line-height: 1.5;
  min-height: 24px; max-height: 160px; padding: 4px 0;
}
.composer textarea::placeholder { color: var(--faint); }
.send {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; cursor: pointer;
  background: var(--red); border: 1px solid #c8302f; color: #fff;
  box-shadow: 0 8px 20px -8px rgba(185,28,28,.75), 0 1px 0 rgba(255,255,255,.16) inset;
  transition: background .16s var(--ease), transform .12s var(--ease), opacity .16s var(--ease);
}
.send:hover { background: #cf2321; transform: translateY(-1px); }
.send:disabled { opacity: .5; cursor: default; transform: none; }
.composer form.htmx-request .send { opacity: .5; pointer-events: none; transform: none; }
.composer .hint {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; font-size: 11px; color: var(--muted-2);
}
.composer .hint .kbd { font-family: ui-monospace, Menlo, monospace; color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.composer .hint .r { display: inline-flex; align-items: center; gap: 8px; }
.composer .hint .live { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; flex: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .login-shell { grid-template-columns: 1fr; min-height: 0; max-width: 460px; }
  .login-hero { border-right: none; border-bottom: 1px solid var(--line); padding: 40px 34px; }
  .login-panel { padding: 40px 34px; }
  .login-hero .headline { font-size: 27px; }
  .app-body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .transcript { padding: 20px 18px; }
  .rows td.focus { max-width: 200px; }
  .thread-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}
