:root {
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --soft-blue: #eaf3ff;
  --ink-deep: #0a1317;
  --ink: #1c1e21;
  --muted: #60666d;
  --muted-2: #636a72;
  --cobalt: #0064e0;
  --cobalt-deep: #0457cb;
  --hairline: #d9dee4;
  --hairline-strong: #c5cbd2;
  --green: #087247;
  --red: #c94b4b;
  --amber: #875307;
  --panel-radius: 14px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(10, 19, 23, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 19, 23, .018) 1px, transparent 1px),
    var(--canvas);
  background-size: 24px 24px;
  color: var(--ink);
  font-family:
    Inter,
    "SF Pro Text",
    "PingFang TC",
    "Noto Sans TC",
    system-ui,
    sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgba(0, 100, 224, .48);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ink-deep);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  min-height: 52px;
  padding: 0 16px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
}

.app-header__brand,
.app-header__brand > div,
.header-actions,
.app-nav,
.terminal-heading,
.terminal-heading__actions,
.panel-kicker,
.panel-header,
.active-identity,
.chat-actions,
.research-rail__heading,
.terminal-footer {
  display: flex;
  align-items: center;
}

.app-header__brand {
  gap: 9px;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink-deep);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.app-header__brand > div {
  gap: 8px;
}

.app-header__brand strong {
  color: var(--ink-deep);
  font-size: 14px;
  letter-spacing: -.03em;
}

.app-header__brand span {
  padding-left: 8px;
  border-left: 1px solid var(--hairline);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-nav {
  height: 34px;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface-soft);
}

.app-nav a {
  min-width: 62px;
  padding: 6px 11px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-align: center;
  text-decoration: none;
}

.app-nav a:hover,
.app-nav a.is-active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(10, 19, 23, .08);
  color: var(--ink-deep);
}

.header-actions {
  justify-content: flex-end;
  gap: 7px;
}

.system-state,
.paper-state,
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}

.system-state {
  color: var(--green);
}

.system-state i,
.live-chip i,
.terminal-footer i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(15, 153, 96, .1);
}

.paper-state {
  padding: 5px 8px;
  background: var(--soft-blue);
  color: var(--cobalt-deep);
}

.icon-button,
.avatar-button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--hairline-strong);
  background: var(--surface-soft);
}

.avatar-button {
  border: 0;
  border-radius: 50%;
  background: var(--ink-deep);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.market-tape {
  display: flex;
  min-height: 30px;
  padding: 0 16px;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--hairline);
  background: var(--ink-deep);
  color: rgba(255, 255, 255, .74);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  letter-spacing: .02em;
  scrollbar-width: none;
}

.market-tape::-webkit-scrollbar,
.analyst-roster::-webkit-scrollbar {
  display: none;
}

.market-tape > span {
  flex: 0 0 auto;
}

.market-tape b {
  margin-right: 5px;
  color: #fff;
}

.market-tape i {
  margin-left: 4px;
  font-style: normal;
}

.market-tape .up {
  color: #74d8ac;
}

.market-tape .down {
  color: #ff9696;
}

.market-tape .flat {
  color: #ffd17c;
}

.market-tape__label {
  color: #99c8ff;
  font-weight: 800;
}

.market-tape__note {
  margin-left: auto;
  color: rgba(255, 255, 255, .42);
}

.terminal-shell {
  width: min(calc(100% - 28px), 1440px);
  margin: 0 auto;
  padding: 10px 0 12px;
}

.terminal-heading {
  min-height: 38px;
  justify-content: space-between;
  gap: 16px;
}

.terminal-heading p,
.panel-header p,
.active-identity p {
  margin: 0 0 2px;
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
}

.terminal-heading h1,
.panel-header h2,
.active-identity h2 {
  margin: 0;
  color: var(--ink-deep);
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -.04em;
  line-height: 1.1;
}

.terminal-heading__actions {
  gap: 6px;
}

.terminal-heading__actions button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.terminal-heading__actions button:hover {
  border-color: #9ea6af;
  color: var(--ink);
}

.terminal-heading__actions time {
  margin-left: 5px;
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
}

.analyst-roster-panel,
.terminal-panel {
  border: 1px solid var(--hairline);
  border-radius: var(--panel-radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 2px rgba(10, 19, 23, .03);
}

.analyst-roster-panel {
  margin-top: 7px;
  padding: 8px 9px 9px;
}

.panel-kicker {
  min-height: 18px;
  gap: 7px;
}

.panel-kicker h2 {
  margin: 0;
  color: var(--ink-deep);
  font-size: 10px;
  font-weight: 800;
}

.panel-kicker > span {
  margin-right: auto;
  color: var(--muted-2);
  font-size: 9px;
}

.panel-kicker kbd {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: none;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
}

.analyst-roster {
  display: grid;
  grid-template-columns: repeat(9, minmax(94px, 1fr));
  gap: 5px;
  margin-top: 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.analyst-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 111px;
  padding: 7px 6px 6px;
  justify-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: center;
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease;
}

.analyst-card:hover {
  background: var(--surface-soft);
  border-color: var(--hairline);
}

.analyst-card.is-active {
  border-color: rgba(0, 100, 224, .46);
  background: var(--soft-blue);
  box-shadow: 0 0 0 1px rgba(0, 100, 224, .12) inset;
}

.analyst-card__portrait {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  margin-bottom: 4px;
}

.analyst-card__portrait img {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--hairline);
}

.analyst-card.is-active .analyst-card__portrait img {
  box-shadow:
    0 0 0 2px var(--cobalt),
    0 0 0 5px rgba(0, 100, 224, .12);
}

.analyst-card__portrait i {
  position: absolute;
  right: 2px;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--green);
}

.analyst-card strong {
  color: var(--ink-deep);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
}

.analyst-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.2;
}

.analyst-card__signal {
  margin-top: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 7px;
  font-weight: 700;
}

.analyst-card__availability {
  margin-top: 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}

.analyst-card.is-data-gap .analyst-card__availability {
  color: var(--amber);
}

.analyst-card.is-active .analyst-card__signal {
  background: rgba(0, 100, 224, .1);
  color: var(--cobalt-deep);
}

.workbench-grid {
  display: grid;
  grid-template-columns: 252px minmax(430px, 1fr) 326px;
  min-height: 510px;
  margin-top: 8px;
  gap: 8px;
  outline: none;
}

.terminal-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  min-height: 48px;
  padding: 8px 10px;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--hairline);
}

.active-identity {
  min-width: 0;
  gap: 8px;
}

.active-identity img {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--hairline);
}

.active-identity h2,
.panel-header h2 {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-chip {
  padding: 4px 6px;
  background: #e8f7ef;
  color: var(--green);
}

.segment-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 7px 8px 0;
  gap: 2px;
}

.segment-tabs button,
.stream-tabs button {
  min-height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}

.segment-tabs button:hover,
.segment-tabs button.is-active {
  background: var(--soft-blue);
  color: var(--cobalt-deep);
}

.strategy-content {
  min-height: 226px;
  padding: 12px 10px 8px;
}

.strategy-summary {
  min-height: 51px;
  margin: 0 0 10px;
  color: var(--ink-deep);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.55;
}

.strategy-specs {
  margin: 0;
}

.strategy-specs > div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 31px;
  padding: 7px 0;
  align-items: start;
  gap: 6px;
  border-top: 1px solid #edf0f3;
}

.strategy-specs dt,
.strategy-specs dd,
.compact-stats dt,
.compact-stats dd,
.metric-strip dt,
.metric-strip dd {
  margin: 0;
}

.strategy-specs dt {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
}

.strategy-specs dd {
  color: var(--ink);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.45;
}

.evidence-block {
  margin: 0 9px;
  padding: 9px;
  border: 1px solid #dbe8f8;
  border-radius: 9px;
  background: var(--soft-blue);
}

.evidence-block > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.evidence-block strong {
  color: var(--cobalt-deep);
  font-size: 15px;
}

.evidence-meter {
  height: 4px;
  margin: 6px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 100, 224, .14);
}

.evidence-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cobalt);
  transition: width 160ms ease;
}

.evidence-block small {
  color: var(--muted-2);
  font-size: 7px;
}

.compact-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 9px 9px 0;
  border-top: 1px solid var(--hairline);
}

.compact-stats > div {
  padding: 9px 4px;
  border-right: 1px solid var(--hairline);
  text-align: center;
}

.compact-stats > div:last-child {
  border-right: 0;
}

.compact-stats dt {
  color: var(--muted-2);
  font-size: 7px;
}

.compact-stats dd {
  margin-top: 4px;
  color: var(--ink-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
}

.signal-header {
  min-height: 48px;
}

.workspace-search {
  display: flex;
  width: min(220px, 45%);
  height: 28px;
  padding: 0 8px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted-2);
}

.workspace-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 9px;
}

.workspace-search:focus-within {
  border-color: rgba(0, 100, 224, .48);
  box-shadow: 0 0 0 2px rgba(0, 100, 224, .08);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-soft);
}

.metric-strip > div {
  min-height: 58px;
  padding: 8px 9px;
  border-right: 1px solid var(--hairline);
}

.metric-strip > div:last-child {
  border-right: 0;
}

.metric-strip dt {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 700;
}

.metric-strip dd {
  margin-top: 2px;
  color: var(--ink-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.metric-strip .paper-copy {
  color: var(--cobalt-deep);
  font-size: 13px;
}

.metric-strip span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 7px;
}

.metric-strip .metric-up {
  color: var(--green);
}

.stream-tabs {
  display: flex;
  min-height: 34px;
  padding: 3px 7px;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--hairline);
}

.stream-tabs button {
  position: relative;
}

.stream-tabs button.is-active {
  color: var(--ink-deep);
}

.stream-tabs button.is-active::after {
  position: absolute;
  right: 6px;
  bottom: -3px;
  left: 6px;
  height: 2px;
  background: var(--cobalt);
  content: "";
}

.stream-tabs b {
  margin-left: 3px;
  color: var(--muted-2);
  font-size: 7px;
}

.stream-filter {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 7px;
}

.stream-table-wrap {
  min-height: 194px;
  overflow: auto;
}

.stream-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.stream-table th,
.stream-table td {
  height: 31px;
  padding: 0 7px;
  overflow: hidden;
  border-bottom: 1px solid #edf0f3;
  font-size: 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 26px;
  background: var(--surface-soft);
  color: var(--muted-2);
  font-weight: 750;
}

.stream-table th:nth-child(1) {
  width: 48px;
}

.stream-table th:nth-child(3) {
  width: 100px;
}

.stream-table th:nth-child(4) {
  width: 58px;
}

.stream-table th:nth-child(5) {
  width: 72px;
}

.stream-table td:first-child,
.stream-table td:nth-child(4) {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.stream-table td strong {
  color: var(--ink-deep);
  font-size: 8px;
}

.condition-chip,
.status-chip {
  display: inline-flex;
  padding: 3px 5px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 800;
}

.condition-chip {
  background: #eef1f4;
  color: var(--muted);
}

.condition-chip.is-met {
  background: #e7f6ee;
  color: var(--green);
}

.status-chip {
  background: var(--soft-blue);
  color: var(--cobalt-deep);
}

.status-chip.is-watch {
  background: #fbf2df;
  color: var(--amber);
}

.research-rail {
  border-top: 1px solid var(--hairline);
}

.research-rail__heading {
  min-height: 28px;
  padding: 0 8px;
  justify-content: space-between;
  gap: 8px;
}

.research-rail__heading strong {
  color: var(--ink-deep);
  font-size: 9px;
}

.research-rail__heading span {
  color: var(--muted-2);
  font-size: 7px;
}

.research-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 0 7px 7px;
}

.research-item {
  min-width: 0;
  min-height: 69px;
  padding: 7px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.research-item:hover {
  border-color: rgba(0, 100, 224, .45);
  background: var(--soft-blue);
}

.research-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: var(--muted-2);
  font-size: 6px;
  font-weight: 750;
}

.research-item h3 {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink-deep);
  font-size: 8px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.research-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 6px;
}

.research-empty {
  min-height: 76px;
  padding: 18px 10px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.research-empty button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cobalt-deep);
  cursor: pointer;
  font-size: inherit;
  font-weight: 750;
}

.analyst-chat {
  display: grid;
  grid-template-rows: auto minmax(218px, 1fr) auto auto auto;
  min-height: 510px;
}

.chat-header {
  position: relative;
}

.chat-actions {
  gap: 5px;
}

.chat-actions .icon-button {
  width: 27px;
  height: 27px;
  font-size: 9px;
  letter-spacing: 1px;
}

.chat-menu {
  position: absolute;
  top: 42px;
  right: 8px;
  z-index: 8;
  width: 156px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(10, 19, 23, .14);
}

.chat-menu button {
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  text-align: left;
}

.chat-menu button:hover {
  background: var(--surface-soft);
}

.chat-messages {
  min-height: 0;
  padding: 8px 9px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 6%, rgba(0, 100, 224, .045), transparent 32%),
    #fbfcfd;
}

.chat-date {
  display: flex;
  margin-bottom: 8px;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 7px;
}

.chat-date::before,
.chat-date::after {
  height: 1px;
  flex: 1;
  background: #e9edf1;
  content: "";
}

.message {
  display: flex;
  margin-bottom: 9px;
  align-items: flex-start;
  gap: 6px;
}

.message > img {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.message > div {
  max-width: calc(100% - 32px);
}

.message p {
  margin: 0;
  padding: 8px 9px;
  border: 1px solid var(--hairline);
  border-radius: 3px 10px 10px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 9px;
  line-height: 1.55;
}

.message time {
  display: block;
  margin: 3px 2px 0;
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 6px;
}

.message--user {
  justify-content: flex-end;
}

.message--user > div {
  max-width: 84%;
}

.message--user p {
  border-color: var(--cobalt);
  border-radius: 10px 3px 10px 10px;
  background: var(--cobalt);
  color: #fff;
}

.message--user time {
  text-align: right;
}

.chat-context {
  margin: 6px 0 9px 30px;
  padding: 8px;
  border: 1px dashed var(--hairline-strong);
  border-radius: 8px;
  background: rgba(244, 246, 248, .72);
}

.chat-context > span {
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .08em;
}

.chat-context dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 6px 0 0;
}

.chat-context dl > div {
  padding-right: 5px;
  border-right: 1px solid var(--hairline);
}

.chat-context dl > div:last-child {
  border-right: 0;
}

.chat-context dt,
.chat-context dd {
  margin: 0;
}

.chat-context dt {
  color: var(--muted-2);
  font-size: 6px;
}

.chat-context dd {
  margin-top: 3px;
  color: var(--ink-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 7px;
  font-weight: 750;
}

.prompt-chips {
  display: flex;
  padding: 6px 8px 2px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.prompt-chips button {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 7px;
  font-weight: 700;
}

.prompt-chips button:hover {
  border-color: rgba(0, 100, 224, .45);
  color: var(--cobalt-deep);
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  min-height: 43px;
  margin: 5px 8px 0;
  padding: 4px;
  align-items: end;
  gap: 4px;
  border: 1px solid var(--hairline-strong);
  border-radius: 9px;
  background: #fff;
}

.chat-composer:focus-within {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 2px rgba(0, 100, 224, .08);
}

.chat-composer textarea {
  width: 100%;
  max-height: 68px;
  min-height: 31px;
  padding: 7px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 9px;
  line-height: 1.45;
}

.chat-composer button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: var(--ink-deep);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.chat-composer button:hover {
  background: var(--cobalt-deep);
}

.chat-disclaimer {
  margin: 5px 8px 7px;
  color: var(--muted-2);
  font-size: 6px;
  text-align: center;
}

.terminal-footer {
  min-height: 25px;
  padding: 0 14px;
  gap: 18px;
  border-top: 1px solid var(--hairline);
  background: #fff;
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 7px;
  letter-spacing: .04em;
}

.terminal-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.terminal-footer > span:first-child {
  color: var(--green);
}

.terminal-footer__right {
  margin-left: auto;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 200;
  max-width: 320px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px;
  background: var(--ink-deep);
  box-shadow: 0 10px 30px rgba(10, 19, 23, .2);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .workbench-grid {
    grid-template-columns: 230px minmax(390px, 1fr) 292px;
  }

  .header-actions .system-state,
  .header-actions .paper-state {
    display: none;
  }
}

@media (max-width: 940px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .app-nav {
    display: none;
  }

  .workbench-grid {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .analyst-chat {
    grid-column: 1 / -1;
    min-height: 420px;
  }

  .analyst-roster {
    grid-template-columns: repeat(9, 96px);
  }
}

@media (max-width: 700px) {
  .app-header {
    min-height: 48px;
    padding-inline: 10px;
  }

  .app-header__brand span,
  .header-actions .icon-button {
    display: none;
  }

  .market-tape {
    padding-inline: 10px;
    gap: 14px;
  }

  .market-tape__note {
    margin-left: 0;
  }

  .terminal-shell {
    width: calc(100% - 16px);
    padding-top: 7px;
  }

  .terminal-heading {
    min-height: 34px;
  }

  .terminal-heading h1 {
    font-size: 17px;
  }

  .terminal-heading__actions button,
  .terminal-heading__actions time {
    display: none;
  }

  .terminal-heading__actions button:first-child {
    display: block;
    padding: 0 8px;
    font-size: 8px;
  }

  .analyst-roster-panel {
    padding-inline: 5px;
  }

  .analyst-roster {
    grid-template-columns: repeat(9, 84px);
    margin-right: -5px;
    margin-left: -5px;
    padding-inline: 5px;
  }

  .analyst-card {
    min-height: 104px;
  }

  .analyst-card__portrait {
    width: 54px;
    height: 54px;
  }

  .workbench-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .strategy-panel,
  .signal-workspace,
  .analyst-chat {
    min-height: 0;
  }

  .strategy-content {
    min-height: 0;
  }

  .signal-workspace {
    grid-row: 3;
  }

  .analyst-chat {
    grid-row: 2;
    min-height: 340px;
  }

  .workspace-search {
    width: 46%;
  }

  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-strip > div:nth-child(2) {
    border-right: 0;
  }

  .metric-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--hairline);
  }

  .stream-tabs {
    overflow-x: auto;
  }

  .stream-tabs button,
  .stream-filter {
    flex: 0 0 auto;
  }

  .stream-table-wrap {
    overflow-x: auto;
  }

  .stream-table {
    min-width: 560px;
  }

  .research-list {
    grid-template-columns: 1fr;
  }

  .analyst-chat {
    grid-template-rows: auto minmax(168px, 1fr) auto auto auto;
  }

  .terminal-footer {
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .terminal-footer__right {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Atlas runtime layout wins after the legacy 0.3 compatibility layer. */

.terminal-shell {
  grid-template-rows: 44px auto auto auto minmax(0, 1fr);
  gap: 7px;
}

.signal-workspace {
  grid-template-rows: auto auto auto auto minmax(158px, 1fr) auto;
}

.evidence-table {
  min-width: 920px;
}

.evidence-table th:nth-child(1) { width: 48px; }
.evidence-table th:nth-child(2) { width: 175px; }
.evidence-table th:nth-child(3) { width: 125px; }
.evidence-table th:nth-child(4) { width: 88px; }
.evidence-table th:nth-child(5) { width: 74px; }
.evidence-table th:nth-child(6) { width: 90px; }
.evidence-table th:nth-child(7) { width: 138px; }
.evidence-table th:nth-child(8) { width: 112px; }

.workbench-grid[data-mode="compare"] .evidence-controls {
  display: none;
}

.workbench-grid[data-mode="compare"] .signal-workspace {
  grid-template-rows: auto minmax(0, 1fr);
}

@media (max-width: 1279px) {
  .terminal-shell {
    grid-template-rows: auto auto auto auto auto;
  }
}

@media (max-width: 700px) {
  .stream-table.evidence-table {
    min-width: 1060px;
  }
}

/* Evidence rows carry their lens, status, and bounded rationale inline. */

.evidence-table {
  min-width: 1060px;
}

.evidence-table th:nth-child(7) {
  width: 270px;
}

.record-evidence {
  vertical-align: middle;
}

.record-evidence > * {
  display: block;
  max-width: 250px;
}

.record-evidence .status-chip {
  display: inline-flex;
  width: fit-content;
}

.record-evidence__meta {
  margin-top: 4px;
  color: var(--cobalt-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .025em;
}

.record-evidence__reason {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-source {
  margin: 0 0 8px;
  padding: 7px 8px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-source b {
  color: var(--cobalt-deep);
}

body[data-runtime-state="loading"] .analyst-card {
  transition: none;
}

/* Analyst Atlas 1.0 — evidence-first runtime */

.terminal-shell {
  grid-template-rows: 44px auto auto auto minmax(0, 1fr);
  gap: 7px;
}

.date-control {
  display: inline-flex;
  height: 34px;
  padding: 3px 3px 3px 9px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: #fff;
  color: var(--muted-2);
  font-size: var(--font-meta);
  font-weight: 750;
  white-space: nowrap;
}

.date-control select {
  height: 26px;
  min-width: 118px;
  padding: 0 25px 0 8px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink-deep);
  cursor: pointer;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
}

.date-control select:disabled {
  cursor: wait;
  opacity: .56;
}

.runtime-status {
  position: relative;
  display: grid;
  min-height: 38px;
  padding: 7px 10px;
  grid-template-columns: 24px minmax(0, 1fr) minmax(100px, 230px) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid #cfe0f3;
  border-radius: 10px;
  background:
    linear-gradient(100deg, rgba(0, 100, 224, .055), transparent 58%),
    rgba(255, 255, 255, .97);
  box-shadow: 0 1px 2px rgba(10, 19, 23, .025);
}

.runtime-status__mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(0, 100, 224, .25);
  border-radius: 50%;
  background: var(--soft-blue);
}

.runtime-status__mark span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cobalt);
  box-shadow: 0 0 0 4px rgba(0, 100, 224, .09);
}

.runtime-status__copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.runtime-status__copy strong {
  flex: 0 0 auto;
  color: var(--ink-deep);
  font-size: 12px;
}

.runtime-status__copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-meta);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-status__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.runtime-status__actions button,
.runtime-status__actions a {
  min-height: 27px;
  padding: 5px 9px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.runtime-status__actions button:hover,
.runtime-status__actions a:hover {
  border-color: rgba(0, 100, 224, .4);
  color: var(--cobalt-deep);
}

.loading-skeleton {
  display: grid;
  gap: 4px;
}

.loading-skeleton i {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf3;
}

.loading-skeleton i::after {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(0, 100, 224, .25), transparent);
  content: "";
  animation: atlas-loading 1.2s ease-in-out infinite;
}

.loading-skeleton i:nth-child(2) {
  width: 78%;
}

.loading-skeleton i:nth-child(3) {
  width: 58%;
}

@keyframes atlas-loading {
  from { transform: translateX(-100%); }
  to { transform: translateX(240%); }
}

body[data-runtime-state="ready"] .runtime-status {
  min-height: 32px;
  padding-block: 4px;
  border-color: #cde8dc;
  background: linear-gradient(100deg, rgba(8, 114, 71, .06), transparent 58%), #fff;
}

body[data-runtime-state="ready"] .runtime-status__mark {
  border-color: rgba(8, 114, 71, .24);
  background: #e8f7ef;
}

body[data-runtime-state="ready"] .runtime-status__mark span {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(8, 114, 71, .09);
}

body[data-runtime-state="ready"] .runtime-status__actions,
body[data-runtime-state="ready"] .loading-skeleton {
  display: none;
}

body[data-runtime-state="unavailable"] .runtime-status,
body[data-runtime-state="offline"] .runtime-status {
  border-color: #ead9b6;
  background: linear-gradient(100deg, rgba(135, 83, 7, .07), transparent 58%), #fff;
}

body[data-runtime-state="unavailable"] .runtime-status__mark,
body[data-runtime-state="offline"] .runtime-status__mark {
  border-color: rgba(135, 83, 7, .25);
  background: #fff7e6;
}

body[data-runtime-state="unavailable"] .runtime-status__mark span,
body[data-runtime-state="offline"] .runtime-status__mark span {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(135, 83, 7, .09);
}

body[data-runtime-state="error"] .runtime-status {
  border-color: #efcaca;
  background: linear-gradient(100deg, rgba(201, 75, 75, .07), transparent 58%), #fff;
}

body[data-runtime-state="error"] .runtime-status__mark {
  border-color: rgba(201, 75, 75, .25);
  background: #fff0f0;
}

body[data-runtime-state="error"] .runtime-status__mark span {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(201, 75, 75, .09);
}

.system-state[data-state="error"] {
  color: var(--red);
}

.system-state[data-state="offline"],
.system-state[data-state="unavailable"] {
  color: var(--amber);
}

.provenance-strip {
  position: relative;
  z-index: 25;
  display: grid;
  min-height: 34px;
  padding: 4px 7px 4px 10px;
  grid-template-columns: repeat(3, minmax(130px, auto)) 1fr auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: rgba(248, 250, 252, .97);
}

.provenance-strip > div:not(.provenance-strip__detail) {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.provenance-strip > div > span,
.provenance-strip > div > strong {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: var(--font-meta);
}

.provenance-strip > div > span {
  color: var(--muted-2);
  font-weight: 700;
}

.provenance-strip > div > strong {
  color: var(--ink-deep);
}

.provenance-strip > button {
  grid-column: 5;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.provenance-strip__detail {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  width: min(560px, calc(100vw - 24px));
  padding: 9px 11px;
  border: 1px solid var(--hairline-strong);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(10, 19, 23, .13);
}

.provenance-strip__detail p {
  display: grid;
  margin: 0;
  padding: 5px 0;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 8px;
  border-bottom: 1px solid #edf0f3;
  color: var(--muted);
  font-size: 11px;
}

.provenance-strip__detail p:last-child {
  border-bottom: 0;
}

.provenance-strip__detail code,
.provenance-strip__detail span {
  overflow: hidden;
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-has-artifact="false"] .workbench-grid {
  filter: grayscale(.45);
  opacity: .58;
  pointer-events: none;
}

body[data-has-artifact="false"] .analyst-roster-panel {
  opacity: .72;
}

.analyst-card:disabled {
  cursor: wait;
}

.analyst-card.is-data-gap .analyst-card__portrait i {
  background: var(--amber);
}

.analyst-card.is-data-gap .analyst-card__signal {
  background: #fff4dd;
  color: var(--amber);
}

.live-chip.is-gap {
  background: #fff4dd;
  color: var(--amber);
}

.signal-workspace {
  grid-template-rows: auto auto auto auto minmax(158px, 1fr) auto;
}

.workspace-search kbd {
  margin-left: auto;
  padding: 2px 4px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: #fff;
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  box-shadow: none;
}

.evidence-controls {
  display: grid;
  min-height: 57px;
  padding: 6px 9px;
  grid-template-columns: repeat(4, minmax(92px, 1fr)) auto auto auto;
  align-items: end;
  gap: 6px;
  border-bottom: 1px solid var(--hairline);
  background: #fbfcfd;
}

.evidence-controls > label:not(.saved-filter) {
  display: grid;
  gap: 3px;
}

.evidence-controls label > span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 750;
}

.evidence-controls select {
  width: 100%;
  height: 29px;
  min-width: 0;
  padding: 0 24px 0 7px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.saved-filter {
  display: flex;
  min-height: 29px;
  padding: 0 8px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.saved-filter input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--cobalt);
}

.saved-filter > span {
  color: var(--ink) !important;
  font-size: 10px !important;
}

.clear-filter {
  min-height: 29px;
  padding: 0 8px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.clear-filter:hover {
  border-color: rgba(0, 100, 224, .4);
  color: var(--cobalt-deep);
}

.evidence-controls output {
  min-width: 48px;
  padding-bottom: 7px;
  color: var(--cobalt-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.stream-context {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.stream-context b {
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--soft-blue);
  color: var(--cobalt-deep);
}

.stream-context span {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: var(--font-meta);
}

.evidence-table {
  min-width: 920px;
}

.evidence-table th,
.evidence-table td {
  padding-inline: 8px;
}

.evidence-table th:nth-child(1) { width: 48px; }
.evidence-table th:nth-child(2) { width: 175px; }
.evidence-table th:nth-child(3) { width: 125px; }
.evidence-table th:nth-child(4) { width: 88px; }
.evidence-table th:nth-child(5) { width: 74px; }
.evidence-table th:nth-child(6) { width: 90px; }
.evidence-table th:nth-child(7) { width: 138px; }
.evidence-table th:nth-child(8) { width: 112px; }

.evidence-row {
  cursor: pointer;
}

.evidence-row:hover td,
.evidence-row:focus-visible td {
  background: #f5f9fe;
}

.save-evidence {
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
  color: var(--cobalt-deep);
  cursor: pointer;
  font-size: 15px;
}

.save-evidence:hover {
  border-color: rgba(0, 100, 224, .45);
  background: var(--soft-blue);
}

.record-open {
  display: grid;
  width: 100%;
  padding: 0;
  gap: 2px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.record-open strong {
  color: var(--ink-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
}

.record-open span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.numeric {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.change-up {
  color: var(--green) !important;
}

.change-down {
  color: var(--red) !important;
}

.change-flat {
  color: var(--muted) !important;
}

.record-source {
  color: var(--muted-2);
  font-size: 9px !important;
}

.record-source code,
.record-source span {
  display: block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.record-source code {
  color: var(--ink);
}

.status-chip.status-review,
.status-chip.status-data-gap {
  background: #fff4dd;
  color: var(--amber);
}

.status-chip.status-proxy {
  background: #f1eef9;
  color: #655289;
}

.evidence-empty {
  display: grid;
  min-height: 150px;
  padding: 24px;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.evidence-empty strong {
  color: var(--ink-deep);
  font-size: 13px;
}

.evidence-empty p {
  max-width: 520px;
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
}

.evidence-empty button {
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid rgba(0, 100, 224, .35);
  border-radius: 6px;
  background: var(--soft-blue);
  color: var(--cobalt-deep);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.research-list:empty::after {
  display: block;
  padding: 11px;
  border: 1px dashed var(--hairline);
  border-radius: 7px;
  color: var(--muted);
  content: "沒有可列出的 evidence；不會補上示範紀錄。";
  font-size: 11px;
}

.research-item .change-up,
.research-item .change-down,
.research-item .change-flat {
  background: transparent;
}

.compare-signals > button {
  display: grid;
  width: 100%;
  min-height: var(--table-row-height);
  padding: 7px 0;
  grid-template-columns: 58px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid #edf0f3;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: var(--font-data);
  text-align: left;
}

.compare-signals > button:hover {
  background: var(--surface-soft);
}

.compare-signals > button > span {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-meta);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-signals > button > b {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-align: right;
}

.compare-data-gap {
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid #ead9b6;
  border-radius: 7px;
  background: #fffaf0;
  color: var(--amber);
  font-size: 11px;
  line-height: 1.5;
}

.message p {
  white-space: pre-line;
}

.evidence-drawer {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(460px, calc(100vw - 20px));
}

.evidence-drawer__backdrop {
  grid-column: 1 / -1;
  grid-row: 1;
  border: 0;
  background: rgba(10, 19, 23, .38);
  cursor: default;
  opacity: 0;
  transition: opacity 160ms ease;
}

.evidence-drawer > [data-drawer-dialog] {
  display: grid;
  min-width: 0;
  height: 100dvh;
  grid-column: 2;
  grid-row: 1;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--hairline-strong);
  background: #fff;
  box-shadow: -18px 0 48px rgba(10, 19, 23, .16);
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.evidence-drawer.is-open .evidence-drawer__backdrop {
  opacity: 1;
}

.evidence-drawer.is-open > aside {
  transform: translateX(0);
}

.evidence-drawer.is-open > [data-drawer-dialog] {
  transform: translateX(0);
}

.evidence-drawer > [data-drawer-dialog] > header {
  display: flex;
  min-height: 66px;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--hairline);
}

.evidence-drawer header p,
.evidence-drawer header h2 {
  margin: 0;
}

.evidence-drawer header p {
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
}

.evidence-drawer header h2 {
  margin-top: 3px;
  color: var(--ink-deep);
  font-size: 17px;
}

.evidence-drawer header button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.evidence-drawer__body {
  padding: 14px;
  overflow-y: auto;
}

.drawer-quote {
  display: grid;
  padding: 14px;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 3px 10px;
  border: 1px solid #cfe0f3;
  border-radius: 10px;
  background:
    linear-gradient(120deg, rgba(0, 100, 224, .08), transparent 70%),
    #f8fbff;
}

.drawer-quote strong {
  color: var(--ink-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 24px;
}

.drawer-quote > span {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 15px;
  font-weight: 800;
}

.drawer-quote p {
  margin: 0;
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.drawer-facts {
  display: grid;
  margin: 12px 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}

.drawer-facts > div {
  min-height: 57px;
  padding: 9px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.drawer-facts dt,
.drawer-facts dd {
  margin: 0;
}

.drawer-facts dt,
.evidence-drawer__body section > span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
}

.drawer-facts dd {
  margin-top: 5px;
  color: var(--ink-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.evidence-drawer__body section {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-soft);
}

.evidence-drawer__body section p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.58;
}

.evidence-drawer__body .drawer-limitation {
  border-color: #ead9b6;
  background: #fffaf0;
}

.drawer-locator dl {
  display: grid;
  margin: 8px 0 0;
  gap: 6px;
}

.drawer-locator dl > div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
}

.drawer-locator dt,
.drawer-locator dd {
  min-width: 0;
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
}

.drawer-locator dt {
  color: var(--muted-2);
  font-weight: 800;
}

.drawer-locator code {
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.source-fields {
  display: flex;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 5px;
}

.source-fields code {
  max-width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  background: #fff;
  color: var(--cobalt-deep);
  font-size: 10px;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.evidence-drawer > [data-drawer-dialog] > footer {
  display: flex;
  min-height: 62px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--hairline);
  background: #fff;
}

.evidence-drawer footer span {
  color: var(--muted);
  font-size: 10px;
}

.evidence-drawer footer button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--cobalt);
  border-radius: 7px;
  background: var(--cobalt);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.evidence-drawer footer .drawer-actions {
  display: flex;
  gap: 7px;
}

.evidence-drawer footer .drawer-copy,
.evidence-drawer footer .drawer-receipt {
  border-color: var(--hairline-strong);
  background: #fff;
  color: var(--cobalt-deep);
}

.evidence-locator-notice {
  margin: -4px 0 10px;
  padding: 9px 12px;
  border: 1px solid #e2c276;
  border-left: 3px solid #b47a00;
  background: #fff9e9;
  color: #674600;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

body.has-open-drawer {
  overflow: hidden;
}

.workbench-grid[data-mode="compare"] .evidence-controls {
  display: none;
}

.workbench-grid[data-mode="compare"] .signal-workspace {
  grid-template-rows: auto minmax(0, 1fr);
}

@media (max-width: 1279px) {
  .terminal-shell {
    grid-template-rows: auto auto auto auto auto;
  }

  .runtime-status {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .loading-skeleton {
    display: none;
  }

  .provenance-strip {
    grid-template-columns: repeat(3, minmax(0, auto)) 1fr auto;
  }
}

@media (max-width: 900px) {
  .terminal-heading__actions {
    flex-wrap: nowrap;
  }

  .runtime-status {
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }

  .runtime-status__copy {
    display: grid;
    gap: 2px;
  }

  .runtime-status__copy span {
    white-space: normal;
  }

  .provenance-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  }

  .provenance-strip > button {
    grid-column: 4;
  }

  .evidence-controls {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
    overflow-x: auto;
  }

  .saved-filter,
  .clear-filter,
  .evidence-controls output {
    align-self: end;
  }
}

@media (max-width: 700px) {
  .evidence-drawer__backdrop,
  .evidence-drawer > [data-drawer-dialog] {
    transition: none;
  }

  .evidence-drawer footer .drawer-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .evidence-drawer footer .drawer-actions button {
    width: 100%;
    white-space: normal;
  }

  .date-control {
    flex: 0 0 auto;
  }

  .date-control > span {
    display: none;
  }

  .date-control select {
    min-width: 105px;
  }

  .runtime-status {
    min-height: 58px;
    padding: 8px;
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .runtime-status__actions {
    grid-column: 1 / -1;
    padding-left: 31px;
  }

  body[data-runtime-state="ready"] .runtime-status__actions {
    display: none;
  }

  .provenance-strip {
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .provenance-strip > div:not(.provenance-strip__detail) {
    display: grid;
    gap: 2px;
  }

  .provenance-strip > button {
    grid-column: 1 / -1;
  }

  .provenance-strip__detail {
    right: auto;
    left: 0;
  }

  .provenance-strip__detail p {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .provenance-strip__detail p span {
    grid-column: 2;
  }

  .signal-header {
    min-height: 104px;
  }

  .evidence-controls {
    display: flex;
    min-height: 58px;
    align-items: flex-end;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .evidence-controls > label:not(.saved-filter) {
    min-width: 112px;
  }

  .saved-filter,
  .clear-filter {
    flex: 0 0 auto;
  }

  .evidence-controls output {
    flex: 0 0 auto;
    padding-bottom: 7px;
  }

  .evidence-drawer {
    grid-template-columns: 1fr;
  }

  .evidence-drawer > [data-drawer-dialog] {
    grid-column: 1;
    width: min(100%, 460px);
    justify-self: end;
  }

  .evidence-drawer > [data-drawer-dialog] > footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .drawer-facts {
    grid-template-columns: 1fr;
  }
}

/* Analyst Terminal 0.3 — fluid, readable, user-adjustable workspace */

:root {
  --font-body: 14px;
  --font-data: 13px;
  --font-meta: 12px;
  --control-height: 32px;
  --table-row-height: 38px;
  --strategy-width: 300px;
  --chat-width: 380px;
  --workspace-gap: 8px;
}

body {
  display: grid;
  height: 100dvh;
  min-height: 100dvh;
  grid-template-rows: 52px 30px minmax(0, 1fr) 28px;
  overflow: hidden;
  font-size: var(--font-body);
}

body[data-density="compact"] {
  --font-body: 13px;
  --font-data: 12px;
  --font-meta: 11px;
  --control-height: 30px;
  --table-row-height: 32px;
}

body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.app-header {
  position: relative;
  height: 52px;
  min-height: 0;
}

.app-header__brand span,
.system-state,
.paper-state,
.live-chip,
.market-tape,
.terminal-footer {
  font-size: var(--font-meta);
}

.avatar-button {
  font-size: 11px;
}

.app-nav a {
  min-height: 28px;
  font-size: 12px;
}

.market-tape {
  min-height: 0;
  font-size: var(--font-meta);
}

.market-tape__note {
  color: rgba(255, 255, 255, .68);
}

.terminal-shell {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 8px 12px 10px;
  grid-template-rows: 44px auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.terminal-heading {
  min-width: 0;
  min-height: 44px;
}

.terminal-heading__title {
  min-width: max-content;
}

.terminal-heading p,
.panel-header p,
.active-identity p {
  font-size: var(--font-meta);
}

.terminal-heading h1 {
  font-size: 22px;
}

.terminal-heading__actions {
  min-width: 0;
  justify-content: flex-end;
  gap: 8px;
}

.workspace-mode-switcher,
.density-switcher {
  display: inline-flex;
  min-width: max-content;
  height: 34px;
  padding: 3px;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: #eef1f4;
}

.terminal-heading__actions .workspace-mode-switcher button,
.terminal-heading__actions .density-switcher button {
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.terminal-heading__actions .workspace-mode-switcher button:hover,
.terminal-heading__actions .workspace-mode-switcher button.is-active,
.terminal-heading__actions .density-switcher button:hover,
.terminal-heading__actions .density-switcher button.is-active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(10, 19, 23, .08);
  color: var(--ink-deep);
}

.terminal-heading__actions .workspace-mode-switcher button.is-active {
  color: var(--cobalt-deep);
}

.terminal-heading__actions .heading-icon-button {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  place-items: center;
  border-radius: 8px;
  font-size: 16px;
}

.terminal-heading__actions time {
  margin-left: 0;
  font-size: var(--font-meta);
}

.analyst-roster-panel {
  min-width: 0;
  margin-top: 0;
  padding: 8px 10px 10px;
  transition:
    background-color 180ms ease,
    padding 180ms ease;
}

.panel-kicker {
  min-height: 24px;
}

.panel-kicker h2 {
  font-size: 12px;
}

.panel-kicker > span,
.panel-kicker kbd {
  font-size: var(--font-meta);
}

.panel-kicker kbd {
  width: 22px;
  height: 22px;
}

.panel-kicker > button {
  display: inline-flex;
  min-height: 28px;
  padding: 0 8px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.panel-kicker > button:hover {
  border-color: rgba(0, 100, 224, .4);
  color: var(--cobalt-deep);
}

.analyst-roster {
  grid-template-columns: repeat(9, minmax(110px, 1fr));
  gap: 7px;
  margin-top: 7px;
}

.analyst-card {
  min-height: 116px;
  padding: 8px 7px 7px;
  border-radius: 9px;
}

.analyst-card__portrait {
  width: 58px;
  height: 58px;
}

.analyst-card strong {
  font-size: 13px;
}

.analyst-card small {
  font-size: 11px;
}

.analyst-card__signal {
  min-height: 20px;
  padding: 3px 7px;
  font-size: 11px;
}

.analyst-roster-panel.is-condensed {
  padding-block: 6px 7px;
}

.analyst-roster-panel.is-condensed .analyst-roster {
  grid-template-columns: repeat(9, minmax(92px, 1fr));
  margin-top: 4px;
}

.analyst-roster-panel.is-condensed .analyst-card {
  min-height: 60px;
  padding: 6px 7px;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: start;
  gap: 8px;
  text-align: left;
}

.analyst-roster-panel.is-condensed .analyst-card__portrait {
  width: 42px;
  height: 42px;
  margin: 0;
  grid-row: 1;
}

.analyst-roster-panel.is-condensed .analyst-card strong {
  font-size: 12px;
}

.analyst-roster-panel.is-condensed .analyst-card small,
.analyst-roster-panel.is-condensed .analyst-card__availability,
.analyst-roster-panel.is-condensed .analyst-card__signal {
  display: none;
}

.workbench-grid {
  display: grid;
  height: 100%;
  min-height: 0;
  margin-top: 0;
  grid-template-columns:
    var(--strategy-width)
    var(--workspace-gap)
    minmax(520px, 1fr)
    var(--workspace-gap)
    var(--chat-width);
  gap: 0;
  transition: grid-template-columns 180ms ease;
}

.terminal-panel {
  height: 100%;
  min-height: 0;
  border-radius: 12px;
}

.panel-resizer {
  position: relative;
  min-width: var(--workspace-gap);
  cursor: col-resize;
  touch-action: none;
}

.panel-resizer::after {
  position: absolute;
  top: 50%;
  bottom: auto;
  left: 50%;
  width: 2px;
  height: 48px;
  border-radius: 999px;
  background: var(--hairline-strong);
  content: "";
  opacity: .45;
  transform: translate(-50%, -50%);
  transition:
    height 160ms ease,
    background-color 160ms ease,
    opacity 160ms ease;
}

.panel-resizer:hover::after,
.panel-resizer:focus-visible::after {
  height: 76px;
  background: var(--cobalt);
  opacity: 1;
}

.panel-header {
  min-height: 54px;
  padding: 9px 12px;
}

.panel-header h2,
.active-identity h2 {
  font-size: 15px;
}

.active-identity img {
  width: 34px;
  height: 34px;
}

.panel-header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-chip {
  min-height: 26px;
  padding: 5px 8px;
}

.panel-toggle {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.panel-toggle:hover {
  border-color: rgba(0, 100, 224, .4);
  color: var(--cobalt-deep);
}

.panel-toggle:active {
  transform: scale(.96);
}

.strategy-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.strategy-panel .panel-header {
  position: sticky;
  top: 0;
  z-index: 5;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

.segment-tabs {
  padding: 8px 10px 0;
  gap: 4px;
}

.segment-tabs button,
.stream-tabs button {
  min-height: var(--control-height);
  padding-inline: 8px;
  font-size: 12px;
}

.strategy-content {
  min-height: 0;
  padding: 14px 12px 10px;
}

.strategy-summary {
  min-height: 0;
  margin-bottom: 12px;
  font-size: var(--font-body);
  line-height: 1.55;
  text-wrap: pretty;
}

.strategy-specs > div {
  min-height: 38px;
  padding: 9px 0;
  grid-template-columns: 58px minmax(0, 1fr);
}

.strategy-specs dt,
.compact-stats dt,
.metric-strip .metric-label {
  font-size: var(--font-meta);
}

.strategy-specs dd {
  font-size: var(--font-data);
  line-height: 1.4;
}

.evidence-block {
  margin: 0 11px;
  padding: 11px;
}

.evidence-block > div:first-child {
  font-size: 12px;
}

.evidence-block strong {
  font-size: 18px;
}

.evidence-block small {
  font-size: var(--font-meta);
}

.compact-stats {
  margin: 10px 11px 0;
}

.compact-stats > div {
  padding: 10px 4px;
}

.compact-stats dd {
  font-size: var(--font-data);
}

.signal-workspace {
  display: grid;
  grid-template-rows: auto auto auto minmax(148px, 1fr) auto;
}

.workspace-search {
  width: min(300px, 46%);
  height: 34px;
  padding-inline: 10px;
}

.workspace-search input {
  height: 100%;
  font-size: var(--font-data);
}

.metric-strip > div {
  min-height: 68px;
  padding: 9px 11px;
}

.metric-strip .metric-label,
.metric-strip .metric-value {
  display: block;
}

.metric-strip .metric-label {
  color: var(--muted-2);
  font-weight: 700;
}

.metric-strip .metric-value {
  margin-top: 2px;
  color: var(--ink-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.metric-strip .paper-copy {
  font-size: 15px;
}

.metric-strip span {
  font-size: var(--font-meta);
}

.stream-tabs {
  min-height: 40px;
  padding: 3px 9px;
}

.stream-tabs b,
.stream-filter {
  font-size: var(--font-meta);
}

.stream-table-wrap {
  min-height: 0;
  overflow: auto;
}

.stream-table th,
.stream-table td {
  height: var(--table-row-height);
  padding: 0 10px;
  font-size: var(--font-data);
}

.stream-table th {
  height: 32px;
  font-size: var(--font-meta);
}

.stream-table th:nth-child(1) {
  width: 72px;
}

.stream-table th:nth-child(3) {
  width: 116px;
}

.stream-table th:nth-child(4) {
  width: 62px;
}

.stream-table th:nth-child(5) {
  width: 112px;
}

.stream-table td strong {
  font-size: var(--font-data);
}

.condition-chip,
.status-chip {
  min-height: 23px;
  padding: 4px 7px;
  align-items: center;
  font-size: var(--font-meta);
}

.research-rail__heading {
  min-height: 36px;
  padding-inline: 10px;
}

.research-rail__heading strong {
  font-size: 12px;
}

.research-rail__heading span {
  font-size: var(--font-meta);
}

.research-list {
  gap: 7px;
  padding: 0 9px 9px;
}

.research-item {
  min-height: 92px;
  padding: 9px;
}

.research-item__meta,
.research-item p {
  font-size: var(--font-meta);
}

.research-item h3 {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.4;
}

.research-empty {
  font-size: var(--font-data);
}

.analyst-chat {
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  min-height: 0;
}

.chat-actions .icon-button {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.chat-menu {
  top: 48px;
  width: 184px;
}

.chat-menu button {
  min-height: 34px;
  padding: 8px 9px;
  font-size: 12px;
}

.chat-messages {
  padding: 10px 11px;
}

.chat-date,
.message time {
  font-size: var(--font-meta);
}

.message {
  margin-bottom: 11px;
  gap: 8px;
}

.message > img {
  width: 28px;
  height: 28px;
}

.message > div {
  max-width: calc(100% - 36px);
}

.message p {
  padding: 9px 10px;
  font-size: var(--font-data);
  line-height: 1.55;
}

.chat-context {
  margin-left: 36px;
  padding: 10px;
}

.chat-context > span,
.chat-context dt,
.chat-context dd {
  font-size: var(--font-meta);
}

.prompt-chips {
  padding: 7px 9px 2px;
  gap: 6px;
}

.prompt-chips button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 11px;
}

.chat-composer {
  min-height: 50px;
  grid-template-columns: minmax(0, 1fr) 36px;
}

.chat-composer textarea {
  min-height: 36px;
  font-size: var(--font-body);
}

.chat-composer button {
  width: 34px;
  height: 34px;
}

.chat-disclaimer {
  margin-block: 6px 8px;
  font-size: var(--font-meta);
}

.terminal-footer {
  min-height: 0;
  font-size: var(--font-meta);
}

.terminal-footer b {
  color: var(--ink);
  font-weight: 800;
}

.toast {
  padding: 11px 13px;
  font-size: 12px;
}

.workbench-grid.is-strategy-collapsed {
  --strategy-width: 52px !important;
}

.workbench-grid.is-chat-collapsed {
  --chat-width: 52px !important;
}

.workbench-grid[data-mode="chat"]:not(.is-chat-collapsed) {
  --chat-width: min(520px, 32vw) !important;
}

.is-strategy-collapsed [data-resizer="strategy"],
.is-chat-collapsed [data-resizer="chat"] {
  pointer-events: none;
}

.is-strategy-collapsed [data-resizer="strategy"]::after,
.is-chat-collapsed [data-resizer="chat"]::after {
  opacity: 0;
}

.is-strategy-collapsed .strategy-panel > :not(.panel-header),
.is-chat-collapsed .analyst-chat > :not(.panel-header) {
  display: none;
}

.is-strategy-collapsed .strategy-panel .panel-header,
.is-chat-collapsed .analyst-chat .panel-header {
  height: 100%;
  padding: 10px 7px;
  flex-direction: column;
  justify-content: flex-start;
  border-bottom: 0;
}

.is-strategy-collapsed .strategy-panel .active-identity,
.is-chat-collapsed .analyst-chat .active-identity {
  flex-direction: column;
}

.is-strategy-collapsed .strategy-panel .active-identity > div,
.is-chat-collapsed .analyst-chat .active-identity > div,
.is-strategy-collapsed .strategy-panel .live-chip,
.is-chat-collapsed .analyst-chat .paper-state,
.is-chat-collapsed .analyst-chat [data-chat-menu-button] {
  display: none;
}

.is-strategy-collapsed .strategy-panel .panel-header__actions,
.is-chat-collapsed .analyst-chat .chat-actions {
  margin-top: auto;
}

.compare-workspace {
  display: none;
  min-height: 0;
  padding: 12px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 100, 224, .055), transparent 42%),
    #fbfcfd;
}

.workbench-grid[data-mode="compare"] .signal-workspace {
  grid-template-rows: auto minmax(0, 1fr);
}

.workbench-grid[data-mode="compare"] .signal-workspace > .metric-strip,
.workbench-grid[data-mode="compare"] .signal-workspace > .stream-tabs,
.workbench-grid[data-mode="compare"] .signal-workspace > .stream-table-wrap,
.workbench-grid[data-mode="compare"] .signal-workspace > .research-rail,
.workbench-grid[data-mode="compare"] .workspace-search {
  display: none;
}

.workbench-grid[data-mode="compare"] .compare-workspace {
  display: grid;
}

.compare-workspace__header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.compare-workspace__header p,
.compare-card header p {
  margin: 0;
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: var(--font-meta);
  font-weight: 800;
  letter-spacing: .08em;
}

.compare-workspace__header h3 {
  margin: 3px 0 0;
  color: var(--ink-deep);
  font-size: 17px;
}

.compare-workspace__header label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compare-workspace__header select {
  min-width: 150px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.compare-grid {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compare-card {
  min-width: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
}

.compare-card header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.compare-card header img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--hairline);
}

.compare-card header > div > span {
  color: var(--cobalt-deep);
  font-size: var(--font-meta);
  font-weight: 800;
}

.compare-card h4 {
  margin: 2px 0;
  color: var(--ink-deep);
  font-size: 16px;
}

.compare-card header > strong {
  color: var(--cobalt-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 22px;
}

.compare-card__summary {
  margin: 14px 0;
  color: var(--ink);
  font-size: var(--font-body);
  font-weight: 600;
  line-height: 1.55;
}

.compare-kpis {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}

.compare-kpis > div {
  min-height: 58px;
  padding: 9px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.compare-kpis dt,
.compare-kpis dd {
  margin: 0;
}

.compare-kpis dt {
  color: var(--muted-2);
  font-size: var(--font-meta);
}

.compare-kpis dd {
  margin-top: 5px;
  color: var(--ink-deep);
  font-size: var(--font-data);
  font-weight: 750;
}

.compare-signals {
  margin-top: 14px;
}

.compare-signals > span {
  color: var(--muted-2);
  font-size: var(--font-meta);
  font-weight: 800;
}

.compare-signals > div {
  display: grid;
  min-height: var(--table-row-height);
  padding: 7px 0;
  grid-template-columns: minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #edf0f3;
  font-size: var(--font-data);
}

.compare-signals > div > span {
  color: var(--muted);
  font-size: var(--font-meta);
}

.compare-signals > div > b {
  color: var(--green);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-align: right;
}

.compare-note {
  margin: 0;
  color: var(--muted-2);
  font-size: var(--font-meta);
  text-align: center;
}

body[data-density="compact"] .terminal-shell {
  padding-block: 6px 8px;
  grid-template-rows: 40px auto minmax(0, 1fr);
  gap: 6px;
}

body[data-density="compact"] .analyst-roster-panel {
  padding-block: 6px 7px;
}

body[data-density="compact"] .analyst-card {
  min-height: 104px;
}

body[data-density="compact"] .analyst-roster-panel.is-condensed .analyst-card {
  min-height: 54px;
}

body[data-density="compact"] .analyst-roster-panel.is-condensed .analyst-card__portrait {
  width: 38px;
  height: 38px;
}

body[data-density="compact"] .panel-header {
  min-height: 48px;
  padding-block: 7px;
}

body[data-density="compact"] .metric-strip > div {
  min-height: 58px;
  padding-block: 7px;
}

body[data-density="compact"] .research-item {
  min-height: 78px;
  padding: 8px;
}

@media (min-width: 1680px) {
  :root {
    --strategy-width: 320px;
    --chat-width: 400px;
  }

  .terminal-shell {
    padding-inline: 16px;
  }

  .analyst-roster {
    gap: 9px;
  }

  .research-item {
    min-height: 98px;
  }
}

@media (max-width: 1279px) {
  body {
    overflow: hidden;
  }

  .terminal-shell {
    grid-template-rows: auto auto auto;
    overflow-y: auto;
  }

  .terminal-heading {
    min-height: 44px;
  }

  .terminal-heading__actions {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .workbench-grid,
  .workbench-grid.is-strategy-collapsed,
  .workbench-grid.is-chat-collapsed,
  .workbench-grid[data-mode="chat"]:not(.is-chat-collapsed) {
    height: auto;
    min-height: 680px;
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
    gap: 8px;
  }

  .panel-resizer {
    display: none;
  }

  .strategy-panel,
  .signal-workspace {
    min-height: 620px;
  }

  .analyst-chat {
    min-height: 460px;
    grid-column: 1 / -1;
  }

  .is-strategy-collapsed .strategy-panel,
  .is-chat-collapsed .analyst-chat {
    display: none;
  }

  .is-strategy-collapsed .signal-workspace {
    grid-column: 1 / -1;
  }

  .workbench-grid[data-mode="chat"] .signal-workspace {
    display: none;
  }

  .workbench-grid[data-mode="chat"] .analyst-chat {
    display: grid;
  }

  .workbench-grid[data-mode="compare"] .signal-workspace {
    display: grid;
    min-height: 620px;
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  body {
    grid-template-rows: 48px 30px minmax(0, 1fr) 28px;
  }

  .app-header {
    height: 48px;
  }

  .terminal-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .terminal-heading__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .terminal-shell {
    padding: 8px;
  }

  .analyst-roster {
    grid-template-columns: repeat(9, 112px);
  }

  .analyst-roster-panel.is-condensed .analyst-roster {
    grid-template-columns: repeat(9, 98px);
  }

  .workbench-grid,
  .workbench-grid.is-strategy-collapsed,
  .workbench-grid.is-chat-collapsed,
  .workbench-grid[data-mode="chat"]:not(.is-chat-collapsed) {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .strategy-panel,
  .signal-workspace,
  .analyst-chat {
    min-height: 540px;
    grid-column: 1;
  }

  .workbench-grid[data-mode="research"] .strategy-panel,
  .workbench-grid[data-mode="research"] .analyst-chat,
  .workbench-grid[data-mode="chat"] .strategy-panel,
  .workbench-grid[data-mode="chat"] .signal-workspace,
  .workbench-grid[data-mode="compare"] .strategy-panel,
  .workbench-grid[data-mode="compare"] .analyst-chat {
    display: none;
  }

  .workbench-grid[data-mode="research"] .signal-workspace,
  .workbench-grid[data-mode="chat"] .analyst-chat,
  .workbench-grid[data-mode="compare"] .signal-workspace {
    display: grid;
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .terminal-shell {
    width: 100%;
  }

  .terminal-heading h1 {
    font-size: 20px;
  }

  .terminal-heading__actions {
    display: flex;
  }

  .terminal-heading__actions .workspace-mode-switcher button,
  .terminal-heading__actions .density-switcher button {
    display: block;
    min-width: 48px;
    min-height: 44px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .terminal-heading__actions .heading-icon-button {
    display: grid;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }

  .terminal-heading__actions time {
    display: none;
  }

  .panel-kicker kbd {
    display: none;
  }

  .panel-kicker > button {
    margin-left: auto;
  }

  .analyst-roster {
    margin-inline: -5px;
    padding-inline: 5px;
  }

  .analyst-card {
    min-height: 112px;
  }

  .analyst-roster-panel.is-condensed .analyst-card {
    min-height: 58px;
  }

  .signal-header {
    min-height: 104px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .workspace-search {
    flex: 0 0 34px;
    width: 100%;
  }

  .metric-strip > div {
    min-height: 64px;
  }

  .stream-table {
    min-width: 660px;
  }

  .research-list {
    grid-template-columns: 1fr;
  }

  .compare-workspace {
    padding: 10px;
  }

  .compare-workspace__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .compare-workspace__header label,
  .compare-workspace__header select {
    width: 100%;
  }

  .terminal-footer {
    min-height: 28px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Atlas runtime layout wins after the legacy 0.3 compatibility layer. */

.terminal-shell {
  grid-template-rows: 44px auto auto auto minmax(0, 1fr);
  gap: 7px;
}

.signal-workspace {
  grid-template-rows: auto auto auto auto minmax(158px, 1fr) auto;
}

.evidence-table {
  min-width: 920px;
}

.evidence-table th:nth-child(1) { width: 48px; }
.evidence-table th:nth-child(2) { width: 175px; }
.evidence-table th:nth-child(3) { width: 125px; }
.evidence-table th:nth-child(4) { width: 88px; }
.evidence-table th:nth-child(5) { width: 74px; }
.evidence-table th:nth-child(6) { width: 90px; }
.evidence-table th:nth-child(7) { width: 138px; }
.evidence-table th:nth-child(8) { width: 112px; }

.workbench-grid[data-mode="compare"] .evidence-controls {
  display: none;
}

.workbench-grid[data-mode="compare"] .signal-workspace {
  grid-template-rows: auto minmax(0, 1fr);
}

@media (max-width: 1279px) {
  .terminal-shell {
    grid-template-rows: auto auto auto auto auto;
  }
}

.evidence-pagination {
  position: sticky;
  bottom: 0;
  left: 0;
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: 48px;
  padding: 7px 10px;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--hairline);
  background: rgba(251, 252, 253, .96);
  box-shadow: 0 -8px 18px rgba(18, 28, 34, .05);
  backdrop-filter: blur(8px);
}

.noscript-status {
  display: flex;
  min-height: 52px;
  padding: 10px 16px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid #e3b85f;
  background: #fff4dd;
  color: #684a0e;
  font-size: var(--font-data);
  line-height: 1.45;
  text-align: center;
}

.noscript-status strong,
.noscript-status span {
  display: inline;
}

.noscript-status a {
  color: var(--cobalt-deep);
  font-weight: 750;
}

.evidence-pagination[hidden] {
  display: none;
}

.evidence-pagination output {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: var(--font-meta);
  font-weight: 750;
}

.evidence-pagination button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(0, 100, 224, .35);
  border-radius: 6px;
  background: var(--soft-blue);
  color: var(--cobalt-deep);
  cursor: pointer;
  font-size: var(--font-data);
  font-weight: 750;
}

.evidence-pagination button:hover {
  border-color: var(--cobalt);
  background: #e8f1ff;
}

.avatar-button.is-active {
  outline: 2px solid rgba(0, 100, 224, .35);
  outline-offset: 2px;
}

.chat-messages:focus-visible,
.evidence-pagination button:focus-visible,
.avatar-button:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: -2px;
}

@media (max-width: 700px) {
  .stream-table.evidence-table {
    min-width: 920px;
  }
}

/* Exact-date lens mission: the selected analyst's scope and next action. */

.terminal-shell {
  grid-template-rows: 44px auto auto auto auto minmax(0, 1fr);
}

.lens-mission {
  display: grid;
  min-width: 0;
  padding: 14px 16px;
  grid-template-columns: minmax(220px, 1fr) minmax(420px, 2fr) minmax(210px, auto);
  align-items: center;
  gap: 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--panel-radius);
  background: var(--surface);
}

.lens-mission[data-state="data-gap"] {
  border-color: rgba(135, 83, 7, .42);
  background: #fffdf8;
}

.lens-mission__identity,
.lens-mission__contract,
.lens-mission__contract > div,
.lens-mission__action {
  min-width: 0;
}

.lens-mission__identity > p:first-child {
  display: flex;
  margin: 0 0 5px;
  align-items: center;
  gap: 8px;
  color: var(--cobalt-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
}

.lens-mission__identity > p:first-child span + span {
  padding-left: 8px;
  border-left: 1px solid var(--hairline);
  color: var(--muted-2);
  letter-spacing: 0;
}

.lens-mission__identity h2 {
  margin: 0;
  color: var(--ink-deep);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.025em;
}

.lens-mission__identity > p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.lens-mission__contract {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lens-mission__contract > div {
  min-height: 70px;
  padding: 4px 13px;
  border-left: 1px solid rgba(28, 30, 33, .1);
}

.lens-mission__contract dt,
.lens-mission__contract dd {
  margin: 0;
}

.lens-mission__contract dt {
  color: var(--ink-deep);
  font-size: 10px;
  font-weight: 750;
}

.lens-mission__contract dd {
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.lens-mission__action {
  display: grid;
  justify-items: stretch;
  gap: 6px;
}

.lens-mission__state {
  color: var(--green);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-align: right;
}

.lens-mission[data-state="data-gap"] .lens-mission__state {
  color: var(--amber);
}

.lens-mission__action button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--cobalt);
  border-radius: 8px;
  background: var(--cobalt);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
}

.lens-mission__action button:hover:not(:disabled) {
  border-color: var(--cobalt-deep);
  background: var(--cobalt-deep);
}

.lens-mission__action button:disabled {
  border-color: var(--hairline);
  background: var(--surface-soft);
  color: var(--muted-2);
  cursor: not-allowed;
}

.lens-mission__action p {
  margin: 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.4;
  text-align: right;
}

@media (max-width: 1100px) {
  .lens-mission {
    grid-template-columns: minmax(0, 1fr) minmax(210px, auto);
  }

  .lens-mission__contract {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .lens-mission__contract > div:first-child {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 700px) {
  .workspace-search input {
    font-size: 16px;
  }

  .lens-mission {
    padding: 14px;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .lens-mission__identity h2 {
    font-size: 18px;
  }

  .lens-mission__identity > p:last-child,
  .lens-mission__contract dd {
    font-size: 16px;
  }

  .lens-mission__contract {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .lens-mission__contract > div,
  .lens-mission__contract > div:first-child {
    min-height: 0;
    padding: 12px 0;
    border-top: 1px solid rgba(28, 30, 33, .1);
    border-left: 0;
  }

  .lens-mission__contract dt {
    font-size: 13px;
  }

  .lens-mission__action {
    justify-items: stretch;
  }

  .lens-mission__state,
  .lens-mission__action p {
    font-size: 12px;
    text-align: left;
  }

  .lens-mission__action button {
    min-height: 44px;
    font-size: 14px;
  }
}
