/* 阿桥 — interface styles.
 *
 * Built from the UX Pilot mockup's visual language (sky-blue brand, card-based,
 * generous whitespace) but hand-written rather than pulled from a CDN. The
 * mockup loads Tailwind, Font Awesome and Google Fonts over the network; this
 * binary serves every byte it needs, which is what makes it deployable on a
 * closed network at a service window. Same look, no requests.
 *
 * Two constraints the mockup does not have to carry:
 *   - It stays readable at 150% text size, because "large text" is a delivery
 *     mode the agent itself can switch on, not a browser afterthought.
 *   - Colour never carries meaning alone. Every state that matters also has a
 *     label — a window terminal in daylight loses hue before it loses text.
 */

:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

:root {

  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;

  --brand: #0284c7;
  --brand-hover: #0369a1;
  --brand-soft: #f0f9ff;
  --brand-border: #e0f2fe;
  --brand-ink: #ffffff;

  --ink-900: #0f172a;
  --ink-700: #1e293b;
  --ink-500: #64748b;
  --ink-400: #94a3b8;

  --ok: #059669; --ok-soft: #ecfdf5; --ok-border: #d1fae5;
  --warn: #b45309; --warn-soft: #fffbeb; --warn-border: #fde68a;
  --stop: #dc2626; --stop-soft: #fef2f2; --stop-border: #fecaca;

  --av-bg: #e0f2fe; --av-glow: #ffffff; --av-ink: #0284c7; --av-water: #7dd3fc;

  --r-xs: 8px; --r-sm: 12px; --r: 16px; --r-lg: 22px;
  --fs: 15px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 4px 14px rgba(15, 23, 42, .07);
}

/* Dark tokens live in one block, applied twice: once for the OS preference (only
   when the reader has not explicitly chosen light) and once for an explicit dark
   choice. Defining a colour ONLY inside a media query is how a theme toggle ends
   up half-working. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1017;
    --surface: #111823;
    --surface-2: #161f2c;
    --line: #24303f;
    --line-soft: #1b2532;

    --brand: #38bdf8;
    --brand-hover: #7dd3fc;
    --brand-soft: #10202e;
    --brand-border: #1c3a4f;
    --brand-ink: #06131d;

    --ink-900: #e8eef6;
    --ink-700: #cdd7e3;
    --ink-500: #93a1b3;
    --ink-400: #6c7c90;

    --ok: #34d399; --ok-soft: #0e2a20; --ok-border: #1c4636;
    --warn: #fbbf24; --warn-soft: #2a2110; --warn-border: #4a3a12;
    --stop: #f87171; --stop-soft: #2b1414; --stop-border: #4d2020;

    --av-bg: #14293b; --av-glow: #1b3448; --av-ink: #7dd3fc; --av-water: #3c5f7d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 6px 18px rgba(0, 0, 0, .45);
  }
}

:root[data-theme="dark"] {
  --bg: #0b1017;
  --surface: #111823;
  --surface-2: #161f2c;
  --line: #24303f;
  --line-soft: #1b2532;

  --brand: #38bdf8;
  --brand-hover: #7dd3fc;
  --brand-soft: #10202e;
  --brand-border: #1c3a4f;
  --brand-ink: #06131d;

  --ink-900: #e8eef6;
  --ink-700: #cdd7e3;
  --ink-500: #93a1b3;
  --ink-400: #6c7c90;

  --ok: #34d399; --ok-soft: #0e2a20; --ok-border: #1c4636;
  --warn: #fbbf24; --warn-soft: #2a2110; --warn-border: #4a3a12;
  --stop: #f87171; --stop-soft: #2b1414; --stop-border: #4d2020;

  --av-bg: #14293b; --av-glow: #1b3448; --av-ink: #7dd3fc; --av-water: #3c5f7d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 6px 18px rgba(0, 0, 0, .45);
}

body.large-text { --fs: 19px; }

* { box-sizing: border-box; }

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  background: var(--bg);
  color: var(--ink-700);
  font: var(--fs)/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.skip { position: absolute; left: -9999px; top: 0; padding: 10px 16px; z-index: 100;
        background: var(--brand); color: var(--brand-ink); }
.skip:focus { left: 0; }

button, select, textarea, input { font: inherit; color: inherit; }

/* icons are inline SVG injected by app.js */
.ico { display: inline-flex; width: 1em; height: 1em; flex: 0 0 auto; }
.ico svg { width: 100%; height: 100%; display: block; }

/* ── sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  width: 260px; flex: 0 0 auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px;
         border-bottom: 1px solid var(--line-soft); }
.brand-mark { width: 40px; height: 40px; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-text h1 { margin: 0; font-size: 1.05em; font-weight: 700; color: var(--ink-900); line-height: 1.25; }
.brand-text p { margin: 1px 0 0; font-size: .72em; color: var(--ink-400); letter-spacing: .02em; }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 16px 8px; min-height: 0; }
.rail-label {
  margin: 0 0 8px; padding: 0 10px;
  font-size: .7em; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-400);
}
.session-list { display: flex; flex-direction: column; gap: 2px; }
.session {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent;
  color: var(--ink-500); font-size: .87em; text-align: left; cursor: pointer;
}
.session:hover { background: var(--surface-2); }
.session.is-active { background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand); font-weight: 600; }
.session .ico { font-size: .95em; }
.session span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-foot { padding: 14px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; }
.setting {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 8px; font-size: .8em; color: var(--ink-500);
}
.setting select {
  border: 0; background: transparent; color: var(--ink-700);
  text-align: right; padding: 2px 0; cursor: pointer; max-width: 62%;
}
.setting select:focus-visible { outline: 2px solid var(--brand); border-radius: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-700);
  font-size: .87em; font-weight: 500;
}
.btn:hover { background: var(--surface-2); border-color: var(--brand-border); }
.btn-block { width: 100%; margin-top: 4px; }

/* ── workspace ─────────────────────────────────────────────────────────── */
.workspace { flex: 1; display: flex; min-width: 0; }
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--surface); }

.chat-head {
  height: 60px; flex: 0 0 auto;
  padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: .84em; color: var(--ink-400); min-width: 0; }
.crumb-chip { background: var(--surface-2); color: var(--ink-500); padding: 3px 9px; border-radius: 6px; }
.crumb-now { color: var(--ink-700); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-actions { display: flex; align-items: center; gap: 12px; }
.flag {
  font-size: .72em; padding: 3px 9px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border);
}
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-xs); cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--ink-400);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.05em;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink-700); }
.icon-btn[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand); }

/* ── transcript ────────────────────────────────────────────────────────── */
.transcript { flex: 1; overflow-y: auto; padding: 30px 24px 12px; min-height: 0; }
.transcript > * { max-width: 760px; margin: 0 auto 22px; }

.turn { display: flex; gap: 14px; }
.turn-user { flex-direction: row-reverse; }
.turn-avatar { width: 34px; height: 34px; flex: 0 0 auto; }
.turn-avatar.user {
  border-radius: 50%; background: var(--ink-900); color: var(--surface);
  display: flex; align-items: center; justify-content: center; font-size: .8em;
}
.bubble {
  max-width: 80%; padding: 14px 18px; border-radius: var(--r);
  font-size: 1em; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere;
}
.bubble-agent { background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--ink-900); }
.bubble-agent.is-blocked { border-color: var(--stop-border); background: var(--stop-soft); }
.bubble-user { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.bubble-greeting { background: var(--brand-soft); border-color: var(--brand-border); }

/* Shown until the first text delta arrives. DeepSeek can think for a long time
   before it says anything, and an empty bubble for thirty seconds reads as a
   failure — which is exactly what it was reported as. */
.typing { display: inline-flex; gap: 5px; align-items: center; padding: 3px 0; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-400);
  animation: typing-blink 1.4s infinite both;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes typing-blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: .6 } }
.turn-body { min-width: 0; flex: 1; }
.turn-user .turn-body { display: flex; justify-content: flex-end; }

/* routed-intent pill, centred */
.route-pill { display: flex; justify-content: center; }
.route-pill span {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 14px; border-radius: 999px; font-size: .78em; font-weight: 500;
  background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-border);
}
.route-pill button {
  border: 0; background: transparent; color: inherit; cursor: pointer;
  font-size: .95em; opacity: .7; padding: 0 0 0 4px;
}
.route-pill button:hover { opacity: 1; text-decoration: underline; }

.thinking { font-size: .84em; color: var(--ink-400); font-style: italic; padding-left: 48px; }

/* ── result cards ──────────────────────────────────────────────────────── */
.results { display: flex; flex-direction: column; gap: 12px; padding-left: 48px; }
.ocard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm);
}
.ocard:hover { box-shadow: var(--shadow); }
.ocard-body { padding: 16px 18px; }
.ocard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.ocard-title { margin: 0; font-size: 1em; font-weight: 700; color: var(--ink-900); }
.ocard-id { font-family: var(--mono); font-size: .72em; color: var(--ink-400); margin-left: 6px; font-weight: 400; }
.pill {
  flex: 0 0 auto; padding: 3px 9px; border-radius: 6px;
  font-size: .7em; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-500); border: 1px solid var(--line);
}
.pill-free { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.pill-pay { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-border); }
.ocard-sum { margin: 0 0 12px; font-size: .86em; color: var(--ink-500); line-height: 1.6; }
.ocard-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; font-size: .8em; }
.fact { display: flex; align-items: flex-start; gap: 7px; color: var(--ink-700); }
.fact .ico { color: var(--brand); margin-top: 3px; }
.ocard-foot {
  background: var(--surface-2); border-top: 1px solid var(--line-soft);
  padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ocard-need { font-size: .76em; color: var(--ink-400); }
.ocard-more {
  border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  font-size: .8em; font-weight: 700; color: var(--brand);
  display: inline-flex; align-items: center; gap: 4px;
}
.ocard-more:hover { color: var(--brand-hover); }
.ocard-detail { padding: 0 18px 16px; border-top: 1px solid var(--line-soft); }
.ocard-detail[hidden] { display: none; }

.crit { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .84em; }
.crit:last-child { border-bottom: 0; }
.crit-status { flex: 0 0 auto; padding: 2px 8px; border-radius: 6px; font-size: .82em; font-weight: 600; height: fit-content; }
.status-possibly_met { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); }
.status-unknown { background: var(--surface-2); color: var(--ink-500); border: 1px solid var(--line); }
.crit-text { min-width: 0; }
.crit-proof { display: block; margin-top: 3px; font-size: .86em; color: var(--ink-400); }
.decision-note {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--r-xs);
  background: var(--brand-soft); border: 1px solid var(--brand-border);
  font-size: .8em; color: var(--ink-700);
}

.gap-table { width: 100%; border-collapse: collapse; font-size: .8em; }
.gap-table th, .gap-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.gap-table th { color: var(--ink-400); font-weight: 600; }
.gap-table td:not(:first-child), .gap-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

/* ── notices, decisions ────────────────────────────────────────────────── */
.notice {
  padding: 12px 16px; border-radius: var(--r-sm); font-size: .85em;
  background: var(--surface); border: 1px solid var(--line); border-left-width: 4px;
  margin-left: 48px;
}
.notice-title { display: block; font-weight: 700; margin-bottom: 3px; color: var(--ink-900); }
.notice-advisory { border-left-color: var(--ink-400); }
.notice-repair { border-left-color: var(--warn); }
.notice-block { border-left-color: var(--stop); background: var(--stop-soft); }
.notice-detail { margin-top: 6px; font-family: var(--mono); font-size: .88em; color: var(--ink-500); }

.decide {
  margin-left: 48px; padding: 18px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--warn-border); box-shadow: var(--shadow-sm);
}
.decide h3 { margin: 0 0 6px; font-size: .95em; color: var(--ink-900); }
.decide p { margin: 0 0 10px; font-size: .85em; color: var(--ink-500); }
.decide pre {
  margin: 0 0 12px; padding: 12px; border-radius: var(--r-xs); background: var(--surface-2);
  font-family: var(--mono); font-size: .78em; overflow-x: auto; white-space: pre-wrap;
}
.decide-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.decide.is-done { border-color: var(--line); opacity: .75; }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

/* ── the technical section, collapsed by default ───────────────────────── */
.tech { margin-left: 48px; }
.tech > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: .75em; color: var(--ink-400); padding: 4px 0;
}
.tech > summary::-webkit-details-marker { display: none; }
.tech > summary::before { content: "›"; font-size: 1.3em; line-height: 1; transition: transform .12s ease; }
.tech[open] > summary::before { transform: rotate(90deg); }
.tech > summary:hover { color: var(--ink-700); }
.tech-body {
  margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); overflow: hidden;
}
.tech-item { border-bottom: 1px solid var(--line); }
.tech-item:last-child { border-bottom: 0; }
.tech-item > summary {
  cursor: pointer; padding: 8px 12px; font-size: .76em; color: var(--ink-500);
  font-family: var(--mono); list-style: none;
}
.tech-item > summary::-webkit-details-marker { display: none; }
.tech-item[data-error="1"] > summary { color: var(--stop); }
.tech-item pre {
  margin: 0; padding: 10px 12px; background: var(--surface);
  font-family: var(--mono); font-size: .72em; overflow-x: auto; max-height: 260px;
}
.trace-row {
  display: flex; gap: 8px; padding: 3px 12px;
  font-family: var(--mono); font-size: .68em; color: var(--ink-400);
  border-bottom: 1px solid var(--line-soft);
}
.trace-row:last-child { border-bottom: 0; }
.trace-row.level-warn { color: var(--warn); }
.trace-row.level-error { color: var(--stop); }
.trace-row span:last-child { flex: 1; overflow-wrap: anywhere; }

/* ── composer ──────────────────────────────────────────────────────────── */
.composer { flex: 0 0 auto; padding: 8px 24px 20px; }
.turn-group { display: flex; flex-direction: column; gap: 16px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; padding-left: 48px; }
.suggest button {
  padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--brand-border); background: var(--brand-soft);
  color: var(--brand); font-size: .82em; font-weight: 500;
}
.suggest button:hover { background: var(--brand-border); }

.input-shell {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 10px;
  padding: 8px 10px 8px 18px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line);
}
.input-shell:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.input-shell textarea {
  flex: 1; border: 0; background: transparent; resize: none; outline: none;
  padding: 9px 0; max-height: 160px; line-height: 1.6;
}
.input-shell textarea::placeholder { color: var(--ink-400); }
.input-actions { display: flex; align-items: center; gap: 6px; padding-bottom: 2px; }
.btn-send {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent);
}
.btn-send:hover { background: var(--brand-hover); }
.btn-send:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.composer-foot {
  max-width: 760px; margin: 14px auto 0;
  display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap;
  font-size: .78em; color: var(--ink-400);
}
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.check:hover span { color: var(--ink-700); }
.status { margin-left: auto; }
.status.is-busy::before { content: "● "; color: var(--brand); }

/* ── overview ──────────────────────────────────────────────────────────── */
.overview {
  width: 320px; flex: 0 0 auto; overflow-y: auto;
  background: var(--bg); border-left: 1px solid var(--line); padding: 24px 20px 32px;
}
.overview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.overview-head h2 { margin: 0; font-size: 1.1em; font-weight: 700; color: var(--ink-900); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: .87em; font-weight: 700; color: var(--ink-900); }
.card-note { font-size: .75em; color: var(--ink-400); }
.link-danger { border: 0; background: transparent; cursor: pointer; font-size: .74em; color: var(--stop); }
.link-danger:hover { text-decoration: underline; }

.task { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.task:last-child { border-bottom: 0; }
.task-ico {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: var(--r-xs);
  display: flex; align-items: center; justify-content: center; font-size: .95em;
  background: var(--brand-soft); color: var(--brand);
}
.task-ico.is-blocked { background: var(--stop-soft); color: var(--stop); }
.task-ico.is-done { background: var(--ok-soft); color: var(--ok); }
.task-main { min-width: 0; flex: 1; }
.task-title { font-size: .82em; font-weight: 600; color: var(--ink-900); line-height: 1.45; }
.task-meta { font-size: .72em; color: var(--ink-400); margin-top: 2px; }
.task-meta .blocked { color: var(--stop); font-weight: 600; }

.record { padding: 10px 12px; border-radius: var(--r-xs); background: var(--surface-2);
          border: 1px solid var(--line-soft); font-size: .78em; margin-bottom: 8px; }
.record:last-child { margin-bottom: 0; }
.record-k { color: var(--ink-400); font-size: .92em; }
.record-v { color: var(--ink-900); font-weight: 500; margin-top: 2px; overflow-wrap: anywhere; }
.record-q { color: var(--ink-500); font-style: italic; margin-top: 4px; font-size: .92em; }

.consent-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
               padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: .78em; }
.consent-row:last-child { border-bottom: 0; }
.consent-state { font-size: .9em; font-weight: 600; }
.consent-yes { color: var(--ok); }
.consent-no { color: var(--ink-400); }

.empty { color: var(--ink-400); font-size: .8em; line-height: 1.6; }

/* ── mascot ────────────────────────────────────────────────────────────── */
.mascot {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 6px 12px 22px;
}
.mascot-art { position: relative; width: 140px; height: 140px; }
.mascot-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  /* The art is a light-line drawing, so it needs a touch of separation from a
     dark panel; on a light one the shadow is invisible anyway. */
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, .18));
}
.mascot.is-thinking .mascot-img { animation: mascot-breathe 2.4s ease-in-out infinite; }
@keyframes mascot-breathe {
  0%, 100% { transform: translateY(0) }
  50%      { transform: translateY(-5px) }
}
@media (prefers-reduced-motion: reduce) {
  .mascot.is-thinking .mascot-img { animation: none; }
}
/* Badge pinned to the art, as in the mockup, so it never lands on the face. */
.mascot-tag {
  position: absolute; top: -6px; right: -14px;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--brand); color: var(--brand-ink); font-size: .68em; box-shadow: var(--shadow-sm);
}
.mascot-line { margin: 14px 0 0; font-size: .8em; line-height: 1.7; color: var(--ink-500); font-style: italic; }

/* ── 阿桥 ──────────────────────────────────────────────────────────────── */
.oba-avatar { width: 100%; height: 100%; display: block; }
.av-bg { fill: var(--av-bg); }
.av-glow { fill: var(--av-glow); opacity: .55; }
.av-ink { fill: var(--av-ink); }
.av-line { fill: none; stroke: var(--av-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.av-thin { stroke: var(--av-water); stroke-width: 1.8; }
.av-water { opacity: .8; }
.av-mouth { transition: d .18s ease; }
.av-walker { fill: var(--av-ink); opacity: 0; }
.av-ears { opacity: 0; stroke: var(--av-ink); }

.mood-thinking .av-walker { opacity: 1; animation: av-walk 1.9s ease-in-out infinite; }
@keyframes av-walk {
  0% { transform: translateX(0); opacity: 0 }
  12% { opacity: 1 } 88% { opacity: 1 }
  100% { transform: translateX(22px); opacity: 0 }
}
.mood-listening .av-ears { opacity: 1; animation: av-listen 1.4s ease-in-out infinite; }
@keyframes av-listen { 0%,100% { opacity: .35 } 50% { opacity: 1 } }

/* It does not smile while refusing; the arch flattens instead. The ink stays its
   normal colour — greying the mark reads as "broken", and it is not broken. */
.mood-serious .av-bg { fill: var(--surface-2); }
.mood-serious .av-glow { opacity: .3; }

@media (prefers-reduced-motion: reduce) {
  .mood-thinking .av-walker { opacity: 1; animation: none; transform: translateX(12px); }
  .mood-listening .av-ears { opacity: 1; animation: none; }
  .ocard, .btn, .icon-btn { transition: none; }
}

/* ── narrow ────────────────────────────────────────────────────────────── */
@media (max-width: 1180px) { .overview { display: none; } }
@media (max-width: 900px) {
  body { overflow: auto; height: auto; flex-direction: column; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-scroll { max-height: 180px; }
  .chat { min-height: 78vh; }
  .transcript, .notice, .decide, .tech, .results, .thinking { padding-left: 0; margin-left: 0; }
  .bubble { max-width: 100%; }
}
