:root {
  color-scheme: dark;
  --bg: #07101b;
  --panel: rgba(13, 25, 39, 0.92);
  --panel-solid: #0f1b2a;
  --panel-soft: #142236;
  --panel-raised: #192b42;
  --line: #2b4058;
  --line-soft: #20334a;
  --text: #f4f7fb;
  --muted: #b9c6d5;
  --subtle: #8395aa;
  --coral: #f47b61;
  --coral-deep: #c55039;
  --coral-soft: rgba(244, 123, 97, 0.13);
  --cyan: #60d8e7;
  --cyan-soft: rgba(96, 216, 231, 0.13);
  --green: #8be0a8;
  --amber: #f1c979;
  --violet: #b9a1ff;
  --on-accent: #07101b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #eaf0f6;
    --panel: rgba(255, 255, 255, 0.94);
    --panel-solid: #ffffff;
    --panel-soft: #f4f7fb;
    --panel-raised: #eaf0f6;
    --line: #bfccda;
    --line-soft: #d5dfe9;
    --text: #17212f;
    --muted: #4f6073;
    --subtle: #64768b;
    --coral: #b94f39;
    --coral-deep: #963b29;
    --coral-soft: rgba(185, 79, 57, 0.1);
    --cyan: #137686;
    --cyan-soft: rgba(19, 118, 134, 0.09);
    --green: #28794c;
    --amber: #8a651e;
    --violet: #6c55b5;
    --on-accent: #ffffff;
    --shadow: 0 20px 60px rgba(31, 52, 74, 0.16);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07101b;
  --panel: rgba(13, 25, 39, 0.92);
  --panel-solid: #0f1b2a;
  --panel-soft: #142236;
  --panel-raised: #192b42;
  --line: #2b4058;
  --line-soft: #20334a;
  --text: #f4f7fb;
  --muted: #b9c6d5;
  --subtle: #8395aa;
  --coral: #f47b61;
  --coral-deep: #c55039;
  --coral-soft: rgba(244, 123, 97, 0.13);
  --cyan: #60d8e7;
  --cyan-soft: rgba(96, 216, 231, 0.13);
  --green: #8be0a8;
  --amber: #f1c979;
  --violet: #b9a1ff;
  --on-accent: #07101b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eaf0f6;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-solid: #ffffff;
  --panel-soft: #f4f7fb;
  --panel-raised: #eaf0f6;
  --line: #bfccda;
  --line-soft: #d5dfe9;
  --text: #17212f;
  --muted: #4f6073;
  --subtle: #64768b;
  --coral: #b94f39;
  --coral-deep: #963b29;
  --coral-soft: rgba(185, 79, 57, 0.1);
  --cyan: #137686;
  --cyan-soft: rgba(19, 118, 134, 0.09);
  --green: #28794c;
  --amber: #8a651e;
  --violet: #6c55b5;
  --on-accent: #ffffff;
  --shadow: 0 20px 60px rgba(31, 52, 74, 0.16);
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button, textarea, select { color: inherit; font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .5; }

.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .16; }
.ambient i:nth-child(1) { width: 520px; height: 520px; background: var(--cyan); left: 22%; top: -310px; animation: drift-a 16s ease-in-out infinite; }
.ambient i:nth-child(2) { width: 430px; height: 430px; background: var(--coral); right: -260px; top: 28%; animation: drift-b 20s ease-in-out infinite; }
.ambient i:nth-child(3) { width: 360px; height: 360px; background: var(--violet); left: -230px; bottom: -210px; animation: drift-b 18s ease-in-out infinite reverse; }

.app-shell { position: relative; display: flex; flex-direction: column; height: 100dvh; min-height: 650px; }
.topbar { height: 70px; min-height: 70px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 0 22px; border-bottom: 1px solid var(--line-soft); background: color-mix(in srgb, var(--panel-solid) 88%, transparent); backdrop-filter: blur(22px); z-index: 3; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 0 28px var(--cyan-soft); }
.brand div { display: flex; flex-direction: column; }
.brand strong { font-size: 17px; letter-spacing: -.2px; }
.brand strong span { padding: 0 3px; color: var(--subtle); }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .7px; }
.live-core { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; letter-spacing: .8px; white-space: nowrap; }
.live-core b { color: var(--text); font-size: 11px; }
.live-core i { width: 1px; height: 14px; background: var(--line); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 13%, transparent), 0 0 18px var(--green); animation: pulse-dot 2.4s ease-in-out infinite; }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 7px; }
.icon-button, .quiet-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 11px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); }
.icon-button { width: 36px; padding: 0; font-size: 17px; }
.quiet-button:hover, .icon-button:hover { color: var(--text); border-color: var(--line); background: var(--panel-raised); }
.ceo-pill { display: grid; place-items: center; height: 38px; padding: 0 11px; margin-left: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-raised); color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: 1px; }

.story-bar { height: 62px; min-height: 62px; display: grid; grid-template-columns: 260px 1fr 140px; align-items: center; gap: 18px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); background: color-mix(in srgb, var(--panel-solid) 74%, transparent); }
.story-bar > div:first-child { display: flex; align-items: center; gap: 12px; }
.story-index { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid var(--coral); border-radius: 10px; color: var(--coral); font: 700 12px/1 ui-monospace, monospace; background: var(--coral-soft); }
.story-bar small { color: var(--subtle); font-size: 9px; letter-spacing: 1.4px; }
.story-bar b { display: block; margin-top: 3px; font-size: 12px; }
.story-track { display: flex; align-items: center; min-width: 0; }
.story-track span { position: relative; flex: 1; height: 4px; background: var(--line); }
.story-track span:first-child { border-radius: 4px 0 0 4px; }
.story-track span:last-child { border-radius: 0 4px 4px 0; }
.story-track span::before { content: attr(data-label); position: absolute; left: 50%; top: -18px; transform: translateX(-50%); color: var(--subtle); font-size: 9px; white-space: nowrap; }
.story-track span.done, .story-track span.active { background: var(--coral); box-shadow: 0 0 16px var(--coral-soft); }
.story-track span.active::before { color: var(--coral); font-weight: 700; }
.story-progress { width: 100%; height: 5px; border-radius: 5px; overflow: hidden; background: var(--line); }
.story-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--coral), var(--cyan)); transition: width .5s ease; }

.workspace { display: grid; grid-template-columns: clamp(235px, 16vw, 290px) minmax(620px, 1fr) clamp(300px, 20vw, 370px); gap: 10px; min-height: 0; flex: 1; padding: 10px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); backdrop-filter: blur(20px); box-shadow: 0 8px 28px rgba(0,0,0,.08); overflow: hidden; }
.panel-title { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-title small, .council-head small { color: var(--coral); font-size: 9px; font-weight: 700; letter-spacing: 1.3px; }
.panel-title h2 { margin: 4px 0 0; font-size: 18px; }
.panel-title > span { display: grid; place-items: center; min-width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; }

.sidebar { display: flex; flex-direction: column; }
.scenario-list { padding: 10px; }
.scenario { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 12px 10px; margin-bottom: 7px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; }
.scenario:hover { background: var(--panel-raised); color: var(--text); }
.scenario.active { color: var(--text); border-color: color-mix(in srgb, var(--coral) 48%, var(--line)); background: var(--coral-soft); box-shadow: inset 3px 0 var(--coral); }
.scenario-no { color: var(--coral); font: 700 10px/1 ui-monospace, monospace; }
.scenario b, .scenario small { display: block; }
.scenario b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.scenario small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.scenario i { font-style: normal; color: var(--subtle); }

.flow-list { padding: 5px 16px; min-height: 0; overflow: auto; }
.section-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.section-label b { color: var(--cyan); font: 600 10px/1 ui-monospace, monospace; }
.flow-list ol { list-style: none; padding: 10px 0 0; margin: 0; }
.flow-list li { position: relative; display: flex; align-items: center; gap: 10px; min-height: 35px; color: var(--subtle); font-size: 11px; }
.flow-list li:not(:last-child)::after { content: ''; position: absolute; left: 10px; top: 27px; width: 1px; height: 16px; background: var(--line); }
.flow-list li span { display: grid; place-items: center; width: 21px; height: 21px; flex: none; border: 1px solid var(--line); border-radius: 50%; font: 600 9px/1 ui-monospace, monospace; }
.flow-list li > i { flex: 1; min-width: 0; overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.flow-list li > b { flex: none; color: var(--subtle); font-size: 9px; font-weight: 500; }
.flow-list li.active { color: var(--text); font-weight: 600; }
.flow-list li.active span { color: var(--on-accent); background: var(--coral); border-color: var(--coral); box-shadow: 0 0 16px var(--coral-soft); }
.flow-list li.active > b { color: var(--coral); }
.flow-list li.done { color: var(--muted); }
.flow-list li.done span { color: var(--green); border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.flow-list li.done > b { color: var(--green); }
.demo-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: auto 12px 12px; border: 1px solid var(--line-soft); border-radius: 11px; overflow: hidden; background: var(--line-soft); }
.demo-facts div { padding: 11px 5px; text-align: center; background: var(--panel-soft); }
.demo-facts b, .demo-facts span { display: block; }
.demo-facts b { color: var(--text); font-size: 18px; }
.demo-facts span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.isolation-card { display: flex; align-items: center; gap: 9px; margin: 0 12px 12px; padding: 11px; border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--green) 8%, var(--panel)); }
.isolation-card > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: var(--on-accent); background: var(--green); font-weight: 800; }
.isolation-card b, .isolation-card small { display: block; }
.isolation-card b { font-size: 11px; }
.isolation-card small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.main-stage { display: grid; grid-template-rows: 126px minmax(0,1fr); gap: 10px; min-width: 0; min-height: 0; }
.council { padding: 10px 12px; }
.council-head { display: flex; align-items: center; justify-content: space-between; height: 27px; padding: 0 2px 7px; }
.council-head b { margin-left: 8px; font-size: 13px; }
.council-head p { margin: 0; color: var(--muted); font-size: 10px; }
.council-head p span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.expert-grid { display: grid; grid-template-columns: repeat(7,minmax(105px,1fr)); gap: 7px; }
.expert-card { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; height: 78px; padding: 9px; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--panel-soft); transition: transform .25s, border-color .25s, background .25s, box-shadow .25s; }
.expert-card img { width: 43px; height: 52px; flex: none; border-radius: 10px; object-fit: cover; border: 1px solid color-mix(in srgb, var(--agent) 45%, var(--line)); }
.expert-card div { min-width: 0; }
.expert-card b, .expert-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expert-card b { font-size: 12px; }
.expert-card small { display: block; max-width: 110px; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.expert-card > span { position: absolute; right: 8px; bottom: 7px; max-width: 46px; color: var(--muted); font-size: 8px; }
.expert-card::after { content: ''; position: absolute; right: 7px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); }
.expert-card.speaking { transform: translateY(-3px); border-color: var(--agent); background: color-mix(in srgb, var(--agent) 11%, var(--panel-soft)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--agent) 22%, transparent), 0 8px 26px color-mix(in srgb, var(--agent) 20%, transparent); }
.expert-card.speaking::after { background: var(--agent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--agent) 14%, transparent), 0 0 16px var(--agent); animation: pulse-dot 1s ease-in-out infinite; }
.expert-card.speaking img { animation: speaker-breathe 1.4s ease-in-out infinite; }
.expert-card.done::after, .expert-card.participated::after { background: var(--green); }

.discussion { display: flex; flex-direction: column; min-height: 0; }
.discussion-head { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 17px 11px; border-bottom: 1px solid var(--line-soft); }
.discussion-head small { color: var(--muted); font-size: 9px; letter-spacing: 1px; }
.discussion-head small span { color: var(--coral); font-weight: 700; }
.discussion-head h1 { max-width: 900px; margin: 6px 0 0; overflow: hidden; color: var(--text); font-size: 18px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.discussion-status { display: flex; align-items: center; gap: 8px; flex: none; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 10px; background: var(--panel-soft); }
.discussion-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--subtle); }
.discussion-status.running span { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: pulse-dot 1s infinite; }
.discussion-status.done span { background: var(--green); }
.round-tabs { display: flex; align-items: center; gap: 5px; min-height: 42px; padding: 6px 12px; border-bottom: 1px solid var(--line-soft); overflow: auto; }
.round-tabs button { padding: 6px 10px; border: 1px solid var(--line-soft); border-radius: 7px; color: var(--muted); background: transparent; font-size: 10px; white-space: nowrap; }
.round-tabs button:hover { color: var(--text); background: var(--panel-raised); }
.round-tabs button.active { color: var(--coral); border-color: color-mix(in srgb, var(--coral) 50%, var(--line)); background: var(--coral-soft); }
.conversation { position: relative; flex: 1; min-height: 0; padding: 18px; overflow: auto; scroll-behavior: smooth; }
.conversation::before { content: ''; position: fixed; pointer-events: none; width: 330px; height: 220px; left: 46%; top: 33%; border-radius: 50%; background: var(--cyan-soft); filter: blur(100px); opacity: .22; }
.welcome { min-height: 100%; display: grid; place-items: center; align-content: center; max-width: 650px; margin: 0 auto; text-align: center; }
.neural-orbit { position: relative; width: 85px; height: 85px; display: grid; place-items: center; margin-bottom: 18px; }
.neural-orbit img { width: 54px; height: 54px; border-radius: 15px; box-shadow: 0 0 35px var(--cyan-soft); z-index: 1; }
.neural-orbit::before, .neural-orbit::after { content: ''; position: absolute; inset: 2px; border: 1px solid color-mix(in srgb,var(--cyan) 38%,transparent); border-radius: 50%; animation: orbit-spin 8s linear infinite; }
.neural-orbit::after { inset: 13px; border-color: color-mix(in srgb,var(--coral) 45%,transparent); animation-direction: reverse; animation-duration: 5s; }
.neural-orbit i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.neural-orbit i:nth-child(2) { top: 3px; left: 50%; }
.neural-orbit i:nth-child(3) { bottom: 12px; left: 6px; background: var(--coral); }
.neural-orbit i:nth-child(4) { right: 5px; bottom: 17px; background: var(--violet); }
.welcome > small { color: var(--coral); font-size: 10px; font-weight: 700; letter-spacing: 2px; }
.welcome h2 { margin: 13px 0; font-size: clamp(27px,2.1vw,38px); line-height: 1.45; letter-spacing: .2px; }
.welcome p { max-width: 620px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.promise-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; color: var(--muted); font-size: 10px; }
.promise-row i { width: 22px; height: 1px; background: var(--line); }

.message { --agent: var(--cyan); display: grid; grid-template-columns: 39px minmax(0,1fr); gap: 11px; max-width: 100%; margin: 0 auto 15px; animation: message-in .42s cubic-bezier(.16,1,.3,1) both; }
.message > img, .message-avatar { width: 39px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid color-mix(in srgb,var(--agent) 45%,var(--line)); }
.message-avatar { display: grid; place-items: center; color: var(--coral); background: var(--coral-soft); font-weight: 800; }
.message-card { padding: 13px 15px; border: 1px solid color-mix(in srgb,var(--agent) 26%,var(--line)); border-radius: 4px 15px 15px 15px; background: color-mix(in srgb,var(--agent) 7%,var(--panel-soft)); }
.message-header { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.message-header b { font-size: 12px; }
.message-header span { padding: 2px 6px; border-radius: 4px; color: var(--agent); background: color-mix(in srgb,var(--agent) 10%,transparent); font-size: 9px; }
.message-header time { margin-left: auto; color: var(--subtle); font-size: 9px; }
.message-card p { margin: 0; color: var(--text); font-size: 13px; line-height: 1.68; }
.message-card p strong { color: var(--text); font-weight: 750; text-decoration: underline; text-decoration-color: var(--agent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.message.system { grid-template-columns: 39px minmax(0,1fr); }
.message.system .message-card { background: var(--panel-raised); }
.message.ceo .message-card { background: var(--coral-soft); border-color: color-mix(in srgb,var(--coral) 45%,var(--line)); }
.message.ceo { --agent: var(--coral); }
.source-receipt { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.source-receipt span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--panel-solid); font-size: 9px; }

.attachment-row { display: flex; gap: 6px; min-height: 0; overflow: hidden; }
.attachment-row:not(:empty) { padding-bottom: 7px; }
.attachment-chip { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--panel-soft); font-size: 9px; animation: chip-in .3s ease-out both; }
.attachment-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.composer-wrap { flex: none; padding: 9px 12px 7px; border-top: 1px solid var(--line-soft); background: color-mix(in srgb,var(--panel-solid) 93%,transparent); }
.composer { padding: 9px 11px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.composer-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.composer-label > span { color: var(--coral); }
.composer-label b { color: var(--text); }
.composer-label small { margin-left: auto; color: var(--subtle); }
.composer textarea { display: block; width: 100%; height: 48px; min-height: 48px; resize: none; padding: 7px 0 3px; border: 0; outline: 0; color: var(--text); -webkit-text-fill-color: var(--text); background: transparent; font-size: 13px; line-height: 1.55; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-actions > div { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.composer-actions > div button { width: 27px; height: 27px; border-radius: 7px; color: var(--muted); background: transparent; }
.composer-actions > div button:hover { color: var(--text); background: var(--panel-raised); }
.primary-button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; color: var(--on-accent); background: var(--coral); box-shadow: 0 7px 20px var(--coral-soft); font-size: 11px; font-weight: 700; }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.playback { display: flex; align-items: center; gap: 4px; min-height: 27px; padding-top: 5px; color: var(--subtle); font-size: 9px; }
.playback button, .playback select { height: 23px; padding: 0 7px; border: 1px solid var(--line-soft); border-radius: 6px; color: var(--muted); background: var(--panel-soft); font-size: 9px; }
.playback label { display: flex; align-items: center; gap: 5px; margin-left: 4px; }
.playback > span { margin-left: auto; }

.insights { display: flex; flex-direction: column; min-height: 0; }
.insights-title { min-height: 75px; }
.radar { border: 0 !important; color: var(--cyan) !important; font-size: 22px !important; animation: radar 3s linear infinite; }
.insight-tabs { display: grid; grid-template-columns: 1fr 1fr; min-height: 43px; border-bottom: 1px solid var(--line-soft); }
.insight-tabs button { position: relative; color: var(--muted); background: transparent; font-size: 11px; }
.insight-tabs button::after { content: ''; position: absolute; left: 15%; right: 15%; bottom: 0; height: 2px; background: transparent; }
.insight-tabs button.active { color: var(--coral); }
.insight-tabs button.active::after { background: var(--coral); box-shadow: 0 0 10px var(--coral-soft); }
.insight-tabs button span { margin-left: 3px; padding: 1px 5px; border-radius: 5px; color: var(--text); background: var(--panel-raised); font: 700 9px/1 ui-monospace,monospace; }
.insight-scroll { flex: 1; min-height: 0; padding: 14px; overflow: auto; }
.insight-hero { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.insight-hero > span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; color: var(--cyan); background: var(--cyan-soft); }
.insight-hero b, .insight-hero small { display: block; }
.insight-hero b { font-size: 13px; }
.insight-hero small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.insight-note { margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.source-card, .decision-card, .action-card { position: relative; padding: 11px; margin-bottom: 8px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel-soft); animation: card-in .36s ease-out both; }
.source-card::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; background: var(--source,var(--cyan)); }
.source-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.source-card header b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.source-card header span { flex: none; color: var(--green); font-size: 10px; }
.source-card p, .decision-card p, .action-card p { margin: 7px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.source-card footer { display: flex; justify-content: space-between; margin-top: 7px; color: var(--subtle); font-size: 9px; }
.packet-card { padding: 12px; margin-bottom: 10px; border: 1px solid color-mix(in srgb,var(--cyan) 35%,var(--line)); border-radius: 10px; background: var(--cyan-soft); }
.packet-card b { display: block; color: var(--cyan); font-size: 11px; }
.packet-card p { margin: 6px 0 0; color: var(--text); font-size: 10.5px; line-height: 1.7; }
.empty-insight { display: grid; place-items: center; min-height: 210px; padding: 25px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.empty-insight span { font-size: 34px; color: var(--cyan); }
.empty-insight b { display: block; margin-top: 12px; font-size: 13px; }
.empty-insight p { max-width: 230px; margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.decision-summary { padding: 13px; margin-bottom: 10px; border: 1px solid color-mix(in srgb,var(--coral) 42%,var(--line)); border-radius: 11px; background: var(--coral-soft); }
.decision-summary small { color: var(--coral); font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.decision-summary h3 { margin: 7px 0; font-size: 14px; line-height: 1.5; }
.decision-summary p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.decision-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 10px; }
.decision-metrics div { padding: 9px 4px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel-soft); text-align: center; }
.decision-metrics b, .decision-metrics span { display: block; }
.decision-metrics b { font-size: 16px; }
.decision-metrics span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.action-card { display: grid; grid-template-columns: 22px 1fr; gap: 8px; }
.action-card > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: var(--cyan); background: var(--cyan-soft); font-size: 9px; }
.action-card b { font-size: 10px; }
.action-card p { grid-column: 2; margin-top: -1px; }
.archive-footer { flex: none; padding: 9px 13px; border-top: 1px solid var(--line-soft); background: var(--panel-solid); }
.archive-footer div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 6px; min-height: 24px; }
.archive-footer b { font-size: 10px; }
.archive-footer small { color: var(--muted); font-size: 9px; }
.archive-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); }
.archive-dot.done { background: var(--green); box-shadow: 0 0 9px var(--green); }
.tg-plane { color: var(--cyan); font-size: 10px; transform: rotate(-25deg); }

.phone-dock { position: fixed; right: 22px; bottom: 20px; z-index: 10; width: 294px; transform: translateX(calc(100% + 45px)); opacity: 0; transition: transform .5s cubic-bezier(.16,1,.3,1), opacity .35s; pointer-events: none; }
.phone-dock.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.phone-label { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 7px 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: var(--panel-solid); box-shadow: var(--shadow); font-size: 9px; }
.phone-label span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.phone { position: relative; height: min(610px,calc(100dvh - 125px)); min-height: 500px; padding: 7px; border: 1px solid #5b6c7e; border-radius: 35px; background: #05090e; box-shadow: 0 30px 90px rgba(0,0,0,.56), 0 0 0 3px rgba(255,255,255,.06); overflow: hidden; }
.phone::before { content: ''; position: absolute; left: 50%; top: 9px; z-index: 4; width: 78px; height: 20px; transform: translateX(-50%); border-radius: 16px; background: #05090e; }
.phone-top { position: relative; z-index: 3; height: 27px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; color: #d7e2eb; background: #172b3a; font-size: 8px; }
.phone-top i { width: 55px; }
.phone header { height: 48px; display: grid; grid-template-columns: 24px 33px 1fr auto; align-items: center; gap: 6px; padding: 0 8px; color: #edf5fb; background: #172b3a; border-bottom: 1px solid #28485d; }
.phone header button { color: #9edcf1; background: transparent; font-size: 21px; }
.phone header img { width: 31px; height: 31px; border-radius: 50%; }
.phone header b, .phone header small { display: block; }
.phone header b { font-size: 10px; }
.phone header small { margin-top: 2px; color: #94b8c7; font-size: 7px; }
.phone header > span { font-size: 12px; }
.phone-chat { height: calc(100% - 111px); padding: 9px 8px 20px; overflow: auto; scroll-behavior: smooth; background: radial-gradient(circle at 20% 10%,#244d5b 0,#17323e 31%,#102733 100%); }
.tg-day { width: max-content; margin: 0 auto 7px; padding: 3px 7px; border-radius: 8px; color: #dcebf1; background: rgba(20,37,48,.65); font-size: 7px; }
.tg-message { position: relative; width: 89%; margin: 0 auto 7px 0; padding: 7px 8px 12px; border-radius: 5px 12px 12px 12px; color: #eaf1f4; background: #213b49; box-shadow: 0 2px 5px rgba(0,0,0,.14); animation: message-in .32s ease-out both; }
.tg-message.mine { margin-left: auto; margin-right: 0; border-radius: 12px 5px 12px 12px; background: #2f6258; }
.tg-message.expert { border-left: 2px solid var(--agent,var(--cyan)); }
.tg-message b { display: block; margin-bottom: 3px; color: #7dd6f0; font-size: 8px; }
.tg-message.expert b { color: var(--agent,var(--cyan)); }
.tg-message p { margin: 0; font-size: 8px; line-height: 1.45; }
.tg-message time { position: absolute; right: 6px; bottom: 3px; color: #9bb1ba; font-size: 6px; }
.tg-message.mine time { color: #a5c6bf; }
.tg-message .tg-check { color: #63ccff; }
.phone-compose { position: absolute; left: 7px; right: 7px; bottom: 17px; height: 37px; display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; padding: 0 8px; color: #91aebc; background: #162a36; border-top: 1px solid #294350; }
.phone-compose p { font-size: 8px; }
.phone-compose b { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #fff; background: #4da7cb; }
.home-bar { position: absolute; left: 50%; bottom: 6px; width: 85px; height: 3px; transform: translateX(-50%); border-radius: 3px; background: #d3d9dc; opacity: .7; }
.phone-dock.syncing .phone { box-shadow: 0 30px 90px rgba(0,0,0,.56), 0 0 0 2px var(--cyan), 0 0 35px var(--cyan-soft); }

.demo-toast { position: fixed; left: 50%; top: 82px; z-index: 30; max-width: 540px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--panel-solid); box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translate(-50%,-12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.demo-toast.show { opacity: 1; transform: translate(-50%,0); }

@keyframes pulse-dot { 50% { opacity: .5; transform: scale(.78); } }
@keyframes speaker-breathe { 50% { transform: scale(1.04); box-shadow: 0 0 18px color-mix(in srgb,var(--agent) 45%,transparent); } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes radar { to { transform: rotate(360deg); } }
@keyframes drift-a { 50% { transform: translate(70px,80px) scale(1.15); } }
@keyframes drift-b { 50% { transform: translate(-50px,-50px) scale(.85); } }
@keyframes message-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes chip-in { from { opacity: 0; transform: translateX(-10px); } }
@keyframes card-in { from { opacity: 0; transform: translateX(10px); } }

@media (min-width: 1900px) {
  body { font-size: 16px; }
  .workspace { grid-template-columns: 295px minmax(760px,1fr) 390px; }
  .main-stage { grid-template-rows: 136px minmax(0,1fr); }
  .expert-card { height: 87px; }
  .message-card p { font-size: 14px; }
  .phone-dock { width: 315px; }
}

@media (min-width: 2400px) {
  body { font-size: 17px; }
  .workspace { grid-template-columns: 360px minmax(900px,1fr) 470px; gap: 14px; padding: 14px; }
  .main-stage { grid-template-rows: 145px minmax(0,1fr); gap: 14px; }
  .expert-card { height: 94px; padding: 11px; }
  .expert-card img { width: 51px; height: 62px; }
  .expert-card b { font-size: 14px; }
  .expert-card small { max-width: 150px; font-size: 11px; }
  .discussion-head h1 { font-size: 21px; }
  .message-card p { font-size: 15px; line-height: 1.75; }
  .message-header b { font-size: 14px; }
  .source-card header b { font-size: 14px; }
  .source-card p, .decision-card p, .action-card p, .packet-card p { font-size: 12px; }
  .insight-note { font-size: 12px; }
  .phone-dock { width: 330px; }
}

@media (max-width: 1300px) {
  .workspace { grid-template-columns: 215px minmax(550px,1fr) 285px; gap: 7px; padding: 7px; }
  .expert-grid { overflow-x: auto; grid-template-columns: repeat(7,132px); }
  .live-core { display: none; }
  .topbar { grid-template-columns: 1fr 1fr; }
  .story-bar { grid-template-columns: 210px 1fr 100px; }
  .scenario small { display: none; }
  .phone-dock { width: 275px; right: 12px; bottom: 12px; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100dvh; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar, .insights { min-height: 420px; }
  .main-stage { min-height: 900px; }
  .phone-dock { position: fixed; }
  .story-bar { grid-template-columns: 1fr; height: auto; padding: 10px 15px; }
  .story-track, .story-progress { display: none; }
}

@media (max-width: 640px) {
  .topbar { height: auto; min-height: 62px; padding: 8px 12px; }
  .brand img { width: 38px; height: 38px; }
  .brand strong { font-size: 14px; }
  .quiet-button span { display: none; }
  .quiet-button { padding: 0 7px; font-size: 10px; }
  .ceo-pill { display: none; }
  .main-stage { min-height: 850px; grid-template-rows: 120px minmax(0,1fr); }
  .expert-grid { grid-template-columns: repeat(7,120px); }
  .discussion-head h1 { font-size: 15px; white-space: normal; }
  .discussion-status { display: none; }
  .composer-label small, .playback > span { display: none; }
  .phone-dock { left: 8px; right: 8px; width: auto; }
  .phone { max-width: 315px; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
