:root {
  color-scheme: only light;
  --ink: #17332e;
  --muted: #697b75;
  --soft: #39554d;
  --line: rgba(55, 96, 85, 0.18);
  --line-strong: rgba(29, 132, 113, 0.38);
  --surface: rgba(255, 255, 250, 0.9);
  --surface-alt: rgba(246, 252, 247, 0.94);
  --nav: rgba(250, 253, 247, 0.96);
  --cyan: #168f86;
  --teal: #2aa879;
  --green: #4f8f5f;
  --amber: #c47d1f;
  --red: #cf5b4f;
  --violet: #7467c9;
  --blue: #3b82b8;
  --shadow: 0 18px 55px rgba(61, 93, 79, 0.14);
  --shadow-hover: 0 22px 58px rgba(40, 109, 92, 0.2);
  --paper: #fbfcf6;
  --glow: rgba(42, 168, 121, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, #edf6ed 0%, #f8fbf2 40%, #eef7fa 72%, #f6f1ec 100%),
    #f8fbf2;
  min-height: 100vh;
}

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

button,
a,
input,
select,
textarea,
.panel,
.metric,
.feed-item,
.live-row,
.theme-item,
.asset-card,
.roadmap-card,
.priority-card,
.risk-cell,
.data-grid > div,
.rule,
.etf-dimension-grid article,
.etf-source-grid div,
.diligence-grid article {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(40, 119, 103, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 119, 103, 0.05) 1px, transparent 1px),
    linear-gradient(120deg, rgba(255, 255, 255, 0.45), transparent 46%);
  background-size: 38px 38px, 38px 38px, auto;
  opacity: 0.9;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  position: relative;
}

.sidebar {
  background: linear-gradient(180deg, var(--nav), rgba(242, 250, 241, 0.94));
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 12px 0 34px rgba(74, 108, 89, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 7px;
  color: #f8fffb;
  background: linear-gradient(135deg, #0e8b81, #57ad69);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0;
  box-shadow: 0 12px 26px rgba(35, 131, 103, 0.22);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand span,
.panel-label {
  font-size: 12px;
  color: var(--muted);
}

.system-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.system-status span {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--soft);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.62);
}

.system-status i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(79, 143, 95, 0.44);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-section {
  margin: 12px 10px 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  color: var(--soft);
  background: transparent;
  text-align: left;
  display: grid;
  grid-template-columns: 6px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line-strong);
  background: linear-gradient(90deg, rgba(42, 168, 121, 0.14), rgba(59, 130, 184, 0.08));
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(37, 118, 99, 0.11);
  transform: translateX(2px);
}

.nav-rail {
  width: 4px;
  height: 28px;
  border-radius: 99px;
  background: rgba(105, 123, 117, 0.28);
}

.nav-item.active .nav-rail {
  background: var(--cyan);
  box-shadow: 0 0 15px rgba(22, 143, 134, 0.34);
}

.nav-item b,
.nav-item small {
  display: block;
}

.nav-item b {
  font-size: 14px;
}

.nav-item small {
  margin-top: 2px;
  color: var(--muted);
}

.sidebar-panel {
  margin-top: auto;
  border: 1px solid rgba(196, 125, 31, 0.25);
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 247, 222, 0.68);
}

.sidebar-panel p {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--soft);
}

.main {
  min-width: 0;
  padding: 22px 26px 36px;
}

.topbar,
.view-head,
.panel-header,
.top-actions,
.segmented,
.toggle-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  letter-spacing: 0;
}

h1 span,
h2 span,
h3 span {
  color: var(--muted);
  font-weight: 600;
}

h2 {
  margin-bottom: 5px;
  font-size: 23px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.top-actions {
  gap: 10px;
}

.language-toggle {
  flex: 0 0 auto;
  min-width: 72px;
  height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(74, 108, 89, 0.08);
}

.language-toggle:hover {
  border-color: var(--cyan);
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(40, 109, 92, 0.16);
}

.language-glyph {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  background: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

[data-language-counterpart] {
  display: none !important;
}

.search-box {
  display: grid;
  grid-template-columns: 12px minmax(250px, 380px);
  align-items: center;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  height: 44px;
  box-shadow: 0 10px 26px rgba(74, 108, 89, 0.08);
}

.search-box span {
  width: 8px;
  height: 8px;
  border: 1px solid var(--cyan);
  border-radius: 999px;
  box-shadow: 8px 8px 0 -5px var(--cyan);
}

.search-box input {
  border: 0;
  outline: 0;
  min-width: 0;
  background: transparent;
  color: var(--ink);
}

.search-box input::placeholder {
  color: #82908a;
}

.primary-action,
.icon-btn {
  border: 0;
  cursor: pointer;
}

.primary-action {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, #128f82, #59b66a);
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(43, 142, 104, 0.22);
}

.primary-action:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(43, 142, 104, 0.28);
}

.primary-action:active,
.nav-item:active,
.feed-item:active,
.live-row:active,
.icon-btn:active,
.segmented button:active {
  transform: translateY(0) scale(0.99);
}

.market-tape {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.market-tape div {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 7px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
}

.market-tape span {
  color: var(--muted);
  font-size: 12px;
}

.market-tape strong {
  color: var(--green);
  font-size: 12px;
}

.market-tape div:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(53, 114, 91, 0.1);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-head {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.view-head p {
  color: var(--muted);
  margin-bottom: 2px;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--cyan) !important;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
}

.date-chip,
.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22, 143, 134, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(22, 143, 134, 0.24);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.date-chip {
  display: block;
  line-height: 1.35;
  text-align: right;
}

.date-chip span {
  color: var(--soft);
  font-weight: 650;
}

.research-brief {
  margin-bottom: 14px;
  border: 1px solid rgba(22, 143, 134, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 250, 0.78);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.brief-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 17px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.brief-header h3 {
  font-size: 18px;
}

.brief-header h3 span {
  color: var(--muted);
  font-weight: 600;
}

.brief-count {
  color: var(--soft);
  font-size: 12px;
  white-space: nowrap;
}

.brief-list {
  display: grid;
}

.brief-item {
  display: grid;
  grid-template-columns: 78px 64px minmax(0, 1fr) minmax(145px, 0.5fr) 95px;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  transition: background-color 180ms ease;
}

.brief-item:last-child {
  border-bottom: 0;
}

.brief-item:hover,
.brief-item.active {
  background: rgba(237, 248, 241, 0.72);
}

.brief-time strong,
.brief-time span,
.brief-signal small,
.brief-next strong,
.brief-next span {
  display: block;
}

.brief-time strong {
  color: var(--ink);
  font-size: 14px;
}

.brief-time span,
.brief-signal small,
.brief-next strong,
.brief-next span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.brief-signal {
  width: 52px;
  min-height: 46px;
  display: grid;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--cyan);
  background: rgba(237, 249, 245, 0.84);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.brief-signal.risk {
  color: var(--red);
  background: rgba(255, 244, 241, 0.9);
}

.brief-signal.macro {
  color: var(--blue);
  background: rgba(240, 248, 253, 0.9);
}

.brief-company {
  margin: 0 0 4px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.brief-company span {
  color: var(--muted);
  font-weight: 600;
}

.brief-copy h4 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.brief-copy > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.brief-next {
  padding-left: 14px;
  border-left: 2px solid rgba(22, 143, 134, 0.24);
}

.brief-next strong {
  color: var(--cyan);
  font-weight: 850;
}

.evidence-btn,
.text-action {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.evidence-btn {
  min-height: 46px;
  padding: 7px;
  line-height: 1.2;
}

.evidence-btn small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.evidence-btn:hover,
.text-action:hover {
  border-color: var(--line-strong);
  background: rgba(236, 249, 243, 0.92);
}

.research-lens {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(390px, 0.7fr);
  gap: 14px;
  margin-bottom: 14px;
}

.evidence-panel,
.timeline-panel,
.research-rules {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 250, 0.76);
}

.evidence-panel {
  padding: 16px 18px;
}

.evidence-panel-head,
.timeline-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.evidence-panel-head > span:last-child,
.timeline-title span {
  color: var(--muted);
  font-size: 12px;
}

.evidence-panel blockquote {
  margin: 15px 0 8px;
  padding-left: 14px;
  border-left: 3px solid var(--teal);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.evidence-panel p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.text-action {
  min-height: 32px;
  padding: 0 10px;
}

.timeline-panel {
  padding: 16px 18px;
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 30px;
  position: relative;
}

.timeline-track::before {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.timeline-track > div {
  position: relative;
  padding-top: 19px;
}

.timeline-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 13px;
  height: 13px;
  border: 3px solid #f8fbf2;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 1px rgba(22, 143, 134, 0.4);
}

.timeline-dot.market { background: var(--green); }
.timeline-dot.macro { background: var(--blue); }
.timeline-dot.pending { background: var(--amber); }

.timeline-track strong,
.timeline-track p {
  display: block;
  margin: 0;
  font-size: 11px;
}

.timeline-track strong { color: var(--soft); }
.timeline-track p { margin-top: 4px; color: var(--muted); line-height: 1.35; }

.research-rules {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(255, 248, 231, 0.72);
  border-color: rgba(196, 125, 31, 0.25);
}

.research-rules strong {
  color: var(--amber);
  font-size: 12px;
  white-space: nowrap;
}

.research-rules span {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.strategy-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.strategy-strip > div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(22, 143, 134, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(42, 168, 121, 0.1), rgba(59, 130, 184, 0.055));
}

.strategy-strip > div:hover,
.metric:hover,
.panel:hover,
.theme-item:hover,
.asset-card:hover,
.roadmap-card:hover,
.priority-card:hover,
.risk-cell:hover,
.data-grid > div:hover,
.rule:hover,
.etf-dimension-grid article:hover,
.etf-source-grid div:hover,
.diligence-grid article:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.strategy-strip strong,
.strategy-strip span {
  display: block;
}

.strategy-strip span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.metric,
.panel,
.theme-item,
.data-grid > div,
.risk-cell,
.rule {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(18px);
}

.metric {
  padding: 14px;
}

.metric span,
.metric small,
.snapshot span,
.theme-item span,
.data-grid span,
.risk-cell span,
.rule span {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 5px 0;
  font-size: 29px;
  color: var(--ink);
}

.live-data-panel {
  margin-bottom: 14px;
}

.live-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.live-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.live-data-note {
  min-height: 54px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  align-content: center;
  border: 1px solid rgba(22, 143, 134, 0.16);
  border-radius: 8px;
  background: rgba(245, 252, 246, 0.72);
}

.live-data-note strong,
.live-data-note span {
  display: block;
}

.live-data-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.live-data-grid article {
  min-height: 220px;
  padding: 14px;
  border: 1px solid rgba(22, 143, 134, 0.16);
  border-radius: 8px;
  background: rgba(245, 252, 246, 0.72);
}

.live-card-head,
.live-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.live-card-head {
  align-items: center;
  margin-bottom: 10px;
}

.live-card-head span,
.source-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(79, 143, 95, 0.32);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.live-list {
  display: grid;
  gap: 9px;
}

.live-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.live-row {
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.live-row:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(54, 109, 88, 0.12);
  transform: translateY(-1px);
}

.live-row strong,
.live-row span,
.live-row small,
.live-row a {
  display: block;
}

.live-row span,
.live-row small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.live-row a {
  color: var(--cyan);
  text-decoration: none;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(330px, 0.8fr);
  gap: 14px;
}

.panel {
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel.wide {
  grid-row: span 2;
}

.panel-header {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.segmented {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.segmented button,
.icon-btn {
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  min-height: 30px;
}

.segmented button {
  border: 0;
  padding: 0 9px;
  cursor: pointer;
}

.segmented button:hover,
.icon-btn:hover {
  color: var(--ink);
  background: rgba(42, 168, 121, 0.1);
  border-color: var(--line-strong);
}

.segmented .selected {
  background: rgba(22, 143, 134, 0.12);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(22, 143, 134, 0.1);
}

.icon-btn {
  min-width: 44px;
  border: 1px solid var(--line);
}

.feed-list {
  display: grid;
  gap: 10px;
}

.feed-item {
  display: grid;
  grid-template-columns: 78px 1fr 86px;
  gap: 14px;
  align-items: start;
  padding: 13px;
  border: 1px solid rgba(22, 143, 134, 0.14);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.84), rgba(239, 250, 244, 0.72));
  cursor: pointer;
}

.feed-item:hover {
  border-color: var(--line-strong);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(231, 247, 240, 0.92));
  box-shadow: 0 14px 32px rgba(45, 111, 90, 0.14);
  transform: translateY(-1px);
}

.feed-type {
  font-size: 12px;
  font-weight: 800;
  color: var(--cyan);
}

.feed-type b,
.feed-type small,
.impact span {
  display: block;
}

.feed-type small,
.impact span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.feed-copy strong {
  display: block;
  margin-bottom: 3px;
}

.feed-copy em {
  display: block;
  margin-bottom: 7px;
  color: var(--soft);
  font-size: 13px;
  font-style: normal;
}

.feed-copy p {
  margin-bottom: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.feed-sources {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.feed-sources span {
  font-size: 11px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
}

.impact {
  justify-self: end;
  font-size: 13px;
  font-weight: 900;
  color: var(--amber);
  text-align: right;
}

.impact.high {
  color: var(--red);
}

.impact.low {
  color: var(--green);
}

.radar-wrap {
  display: grid;
  place-items: center;
  min-height: 172px;
}

.radar {
  width: 100%;
  max-width: 280px;
}

.radar polyline {
  fill: none;
  stroke: rgba(105, 123, 117, 0.36);
}

.radar polygon {
  fill: rgba(22, 143, 134, 0.15);
  stroke: var(--cyan);
  stroke-width: 2;
}

.radar text {
  font-size: 12px;
  fill: var(--muted);
}

.risk-list {
  padding-left: 0;
  list-style: none;
  margin: 10px 0 0;
  display: grid;
  gap: 9px;
}

.risk-list li {
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.severity {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
}

.severity.medium {
  background: var(--amber);
}

.severity.high {
  background: var(--red);
}

.snapshot {
  display: grid;
  gap: 10px;
}

.snapshot div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.sparkline {
  width: 100%;
  margin-top: 12px;
}

.sparkline path {
  fill: none;
  stroke: var(--teal);
  stroke-width: 4;
}

.sparkline line {
  stroke: rgba(105, 123, 117, 0.32);
}

.two-column,
.research-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
}

.tool-panel,
.result-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

label {
  display: grid;
  gap: 6px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus,
.search-box:focus-within {
  outline: 0;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(42, 168, 121, 0.12);
  background: #ffffff;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

.toggle-row {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
}

.toggle-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--soft);
}

.toggle-row input {
  width: auto;
}

.analysis-block {
  border-left: 4px solid var(--cyan);
  background: rgba(22, 143, 134, 0.07);
  padding: 12px;
  border-radius: 0 8px 8px 0;
}

.analysis-block p {
  margin: 8px 0 0;
  color: var(--muted);
}

.status-tag.warning {
  background: rgba(196, 125, 31, 0.1);
  color: var(--amber);
  border-color: rgba(196, 125, 31, 0.28);
}

.citation-list {
  display: grid;
  gap: 8px;
}

.citation-list a {
  color: var(--cyan);
  text-decoration: none;
}

.prototype-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(196, 125, 31, 0.28);
  border-radius: 8px;
  background: rgba(255, 248, 231, 0.82);
}

.prototype-status strong {
  color: var(--amber);
  font-size: 12px;
  white-space: nowrap;
}

.prototype-status span,
.citation-placeholder {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
}

.demo-pill {
  color: var(--amber) !important;
  border-color: rgba(196, 125, 31, 0.34) !important;
  background: rgba(255, 248, 231, 0.88);
}

.citation-placeholder {
  display: block;
  padding: 8px 10px;
  border-left: 3px solid rgba(196, 125, 31, 0.42);
  background: rgba(255, 248, 231, 0.58);
}

.research-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
}

.research-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.research-table div {
  display: grid;
  grid-template-columns: 190px 1fr;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
}

.research-table div:last-child {
  border-bottom: 0;
}

.research-table strong,
.research-table span {
  padding: 12px;
}

.research-table strong {
  background: rgba(22, 143, 134, 0.06);
}

.research-table span {
  color: var(--muted);
}

.theme-board,
.asset-split,
.etf-dimension-grid,
.etf-source-grid,
.diligence-grid,
.data-grid,
.risk-matrix,
.compliance-grid,
.data-priority,
.readiness-grid,
.time-grid,
.source-grade-grid,
.red-flag-grid,
.regional-grid,
.roadmap-grid,
.kpi-grid,
.pipeline {
  display: grid;
  gap: 12px;
}

.theme-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.theme-item {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.theme-item meter {
  width: 100%;
  height: 12px;
}

.asset-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.asset-card {
  min-height: 286px;
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 250, 0.96), rgba(241, 250, 244, 0.8));
}

.asset-card .status-tag {
  width: max-content;
}

.asset-card h3 {
  font-size: 18px;
}

.asset-card p {
  color: var(--soft);
  line-height: 1.58;
  margin-bottom: 0;
}

.etf-card {
  border-color: rgba(59, 130, 184, 0.22);
  background:
    linear-gradient(145deg, rgba(230, 246, 252, 0.92), rgba(255, 255, 250, 0.86)),
    var(--surface);
}

.compare-card {
  border-color: rgba(79, 143, 95, 0.24);
  background:
    linear-gradient(145deg, rgba(235, 248, 235, 0.92), rgba(255, 255, 250, 0.86)),
    var(--surface);
}

.mini-ledger {
  display: grid;
  gap: 10px;
}

.mini-ledger div {
  min-height: 78px;
  padding: 10px 0 0;
  border-top: 1px solid rgba(55, 96, 85, 0.14);
}

.mini-ledger strong,
.mini-ledger span {
  display: block;
}

.mini-ledger strong {
  color: var(--cyan);
}

.mini-ledger span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.etf-live-panel {
  margin-bottom: 12px;
}

.etf-dimension-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
}

.etf-source-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

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

.etf-dimension-grid article,
.etf-source-grid div,
.diligence-grid article {
  min-height: 128px;
  padding: 14px;
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.etf-dimension-grid article {
  min-height: 152px;
  border-color: rgba(116, 103, 201, 0.18);
  background: rgba(243, 241, 255, 0.68);
}

.etf-dimension-grid article > span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.etf-dimension-grid article small {
  color: var(--muted);
  line-height: 1.45;
}

.etf-source-grid div {
  border-color: rgba(22, 143, 134, 0.16);
  background: rgba(238, 250, 246, 0.72);
}

.diligence-grid article {
  border-color: rgba(196, 125, 31, 0.22);
  background: rgba(255, 248, 230, 0.78);
}

.etf-source-grid span,
.diligence-grid span {
  color: var(--muted);
  line-height: 1.48;
}

.risk-matrix,
.data-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.data-priority {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.priority-card {
  padding: 15px;
  min-height: 132px;
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.priority-card strong,
.priority-card span,
.priority-card small {
  display: block;
}

.priority-card span,
.priority-card small {
  color: var(--muted);
  line-height: 1.45;
}

.priority-card.first {
  border-color: rgba(79, 143, 95, 0.3);
}

.priority-card.second {
  border-color: rgba(22, 143, 134, 0.28);
}

.priority-card.third {
  border-color: rgba(196, 125, 31, 0.3);
}

.readiness-grid,
.time-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
}

.readiness-grid article,
.time-grid div,
.source-grade-grid article,
.red-flag-grid div,
.regional-grid div {
  min-height: 118px;
  padding: 14px;
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.readiness-grid b,
.time-grid strong,
.source-grade-grid strong,
.red-flag-grid strong,
.regional-grid strong {
  color: var(--ink);
}

.readiness-grid span,
.time-grid span,
.source-grade-grid span,
.red-flag-grid span,
.regional-grid span {
  color: var(--muted);
  line-height: 1.45;
}

.data-map-canvas {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 0.78fr) minmax(260px, 1fr);
  gap: 34px;
  margin-top: 14px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(22, 143, 134, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(rgba(40, 119, 103, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 119, 103, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 250, 0.9), rgba(238, 250, 246, 0.76));
  background-size: 32px 32px, 32px 32px, auto;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-column,
.map-spine {
  position: relative;
  z-index: 2;
}

.map-column {
  display: grid;
  gap: 12px;
}

.map-region {
  padding: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 250, 0.78);
  box-shadow: 0 12px 28px rgba(61, 93, 79, 0.08);
}

.map-region.official {
  border-color: rgba(79, 143, 95, 0.24);
  background: rgba(240, 249, 238, 0.78);
}

.map-region.market {
  border-color: rgba(22, 143, 134, 0.2);
  background: rgba(238, 250, 246, 0.78);
}

.map-region.digital {
  border-color: rgba(59, 130, 184, 0.2);
  background: rgba(239, 248, 253, 0.78);
}

.map-region.product {
  min-height: 100%;
  align-content: center;
  border-color: rgba(116, 103, 201, 0.2);
  background: rgba(245, 243, 255, 0.76);
}

.map-label {
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(22, 143, 134, 0.1);
  border: 1px solid rgba(22, 143, 134, 0.18);
  font-size: 11px;
  font-weight: 900;
}

.map-node {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: grid;
  gap: 4px;
  align-content: center;
  text-align: left;
  padding: 9px 12px 9px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(61, 93, 79, 0.07);
}

.map-node::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: var(--cyan);
  opacity: 0.58;
}

.map-node strong,
.map-node small {
  display: block;
}

.map-node strong {
  font-size: 13px;
}

.map-node small {
  color: var(--muted);
  line-height: 1.35;
  font-size: 12px;
}

.map-node:hover,
.map-node.selected {
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.map-node.selected::after {
  content: "Selected";
  position: absolute;
  right: 10px;
  top: 9px;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.map-node.grade-a::before {
  background: var(--green);
}

.map-node.grade-b::before,
.map-node.product-node::before {
  background: var(--cyan);
}

.map-node.grade-c::before {
  background: var(--amber);
}

.map-spine {
  display: grid;
  gap: 12px;
  align-content: center;
}

.map-spine::before {
  content: "";
  position: absolute;
  top: 34px;
  bottom: 34px;
  left: 50%;
  width: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(79, 143, 95, 0.34), rgba(22, 143, 134, 0.52), rgba(116, 103, 201, 0.34));
}

.map-stage {
  position: relative;
  min-height: 72px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 12px;
  border: 1px solid rgba(22, 143, 134, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 250, 0.94);
  text-align: center;
  box-shadow: 0 12px 24px rgba(61, 93, 79, 0.09);
}

.map-stage b,
.map-stage span {
  display: block;
}

.map-stage b {
  color: var(--cyan);
}

.map-stage span {
  color: var(--muted);
  line-height: 1.35;
  font-size: 11px;
}

.map-stage.active {
  border-color: rgba(79, 143, 95, 0.36);
  background: rgba(240, 249, 238, 0.96);
}

.map-stage.audit {
  border-color: rgba(116, 103, 201, 0.26);
  background: rgba(245, 243, 255, 0.9);
}

.map-route {
  position: absolute;
  z-index: 1;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(22, 143, 134, 0), rgba(22, 143, 134, 0.42), rgba(116, 103, 201, 0));
  transform: translateY(-50%);
}

.map-route::before,
.map-route::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--cyan);
  transform: translateY(-50%);
  box-shadow: 0 0 0 5px rgba(22, 143, 134, 0.1);
}

.map-route::before {
  left: 0;
}

.map-route::after {
  right: 0;
}

.route-source {
  left: calc(33.333% - 20px);
  width: 78px;
}

.route-output {
  right: calc(33.333% - 20px);
  width: 78px;
}

.source-grade-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.source-grade-grid .grade-a {
  border-color: rgba(79, 143, 95, 0.34);
}

.source-grade-grid .grade-b {
  border-color: rgba(22, 143, 134, 0.32);
}

.source-grade-grid .grade-c {
  border-color: rgba(196, 125, 31, 0.36);
}

.source-grade-grid .grade-d {
  border-color: rgba(207, 91, 79, 0.34);
}

.red-flag-grid,
.regional-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.red-flag-grid div {
  border-color: rgba(207, 91, 79, 0.24);
  background: rgba(255, 239, 235, 0.72);
}

.regional-grid div {
  border-color: rgba(116, 103, 201, 0.18);
  background: rgba(243, 241, 255, 0.68);
}

.pipeline {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 12px;
}

.pipeline div {
  position: relative;
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgba(22, 143, 134, 0.18);
  border-radius: 8px;
  background: rgba(238, 250, 246, 0.72);
}

.pipeline b,
.pipeline span {
  display: block;
}

.pipeline b {
  color: var(--cyan);
}

.pipeline span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

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

.roadmap-card {
  min-height: 214px;
  padding: 16px;
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.roadmap-card.active {
  border-color: rgba(22, 143, 134, 0.34);
  background: linear-gradient(180deg, rgba(232, 249, 243, 0.94), rgba(255, 255, 250, 0.88));
}

.roadmap-card span,
.roadmap-card small {
  color: var(--muted);
  line-height: 1.45;
}

.roadmap-card p {
  margin-bottom: 0;
  color: var(--soft);
  line-height: 1.55;
}

.kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.kpi-grid > div {
  min-height: 96px;
  padding: 14px;
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid rgba(79, 143, 95, 0.2);
  border-radius: 8px;
  background: rgba(240, 249, 238, 0.72);
}

.kpi-grid span {
  color: var(--muted);
  line-height: 1.45;
}

.risk-cell,
.data-grid > div,
.rule {
  padding: 14px;
  min-height: 108px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.risk-cell.high {
  border-color: rgba(207, 91, 79, 0.34);
  background: rgba(255, 239, 235, 0.82);
}

.risk-cell.medium {
  border-color: rgba(196, 125, 31, 0.34);
  background: rgba(255, 248, 230, 0.82);
}

.risk-cell.low {
  border-color: rgba(79, 143, 95, 0.32);
  background: rgba(240, 249, 238, 0.82);
}

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

.rule.allow {
  border-color: rgba(79, 143, 95, 0.32);
}

.rule.block {
  border-color: rgba(207, 91, 79, 0.34);
}

.rule.audit {
  border-color: rgba(22, 143, 134, 0.32);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-panel {
    margin-top: 0;
  }

  .data-map-canvas {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .map-spine {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-content: stretch;
  }

  .map-spine::before,
  .map-route {
    display: none;
  }

  .map-stage {
    min-height: 118px;
  }

  .market-tape,
  .research-lens,
  .strategy-strip,
  .metric-strip,
  .live-controls,
  .live-data-grid,
  .workspace-grid,
  .two-column,
  .research-layout,
  .theme-board,
  .asset-split,
  .etf-dimension-grid,
  .etf-source-grid,
  .diligence-grid,
  .risk-matrix,
  .data-grid,
  .data-priority,
  .readiness-grid,
  .time-grid,
  .source-grade-grid,
  .red-flag-grid,
  .regional-grid,
  .pipeline,
  .roadmap-grid,
  .kpi-grid,
  .compliance-grid {
    grid-template-columns: 1fr 1fr;
  }

  .panel.wide {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  .brief-item {
    grid-template-columns: 68px 58px minmax(0, 1fr) 124px 86px;
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 12px;
    min-width: 0;
    max-width: 100vw;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 28px rgba(61, 93, 79, 0.13);
    overflow: hidden;
  }

  .app-shell,
  .main,
  .topbar,
  .view,
  .panel {
    min-width: 0;
    max-width: 100%;
  }

  .brand {
    min-height: 42px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .system-status {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .system-status span {
    min-height: 24px;
    font-size: 10px;
  }

  .sidebar-panel {
    display: none;
  }

  .topbar,
  .view-head,
  .top-actions,
  .panel-header,
  .live-card-head,
  .brief-header {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 21px;
    line-height: 1.15;
  }

  h2 {
    font-size: 20px;
    line-height: 1.2;
  }

  h3 {
    line-height: 1.3;
  }

  .search-box {
    width: 100%;
    grid-template-columns: 12px 1fr;
    height: 40px;
  }

  .primary-action,
  .top-actions,
  .search-box,
  .top-actions .primary-action {
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
  }

  .top-actions .language-toggle {
    width: 72px;
    min-width: 72px;
    height: 40px;
  }

  .top-actions .search-box {
    grid-column: 2;
  }

  .top-actions .action-stack {
    grid-column: 1 / -1;
  }

  .primary-action {
    min-height: 40px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 10px;
  }

  .market-tape {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    margin-bottom: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

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

  .market-tape div {
    flex: 0 0 154px;
    min-height: 50px;
    padding: 8px 10px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
  }

  .data-map-canvas {
    min-height: 0;
    padding: 12px;
    gap: 12px;
    background-size: 28px 28px, 28px 28px, auto;
  }

  .map-column,
  .map-spine {
    gap: 10px;
  }

  .map-region {
    padding: 11px;
  }

  .map-spine {
    grid-template-columns: 1fr;
  }

  .map-stage,
  .map-node {
    min-height: 76px;
  }

  .map-node.selected::after {
    position: static;
    width: max-content;
    margin-top: 3px;
  }

  .strategy-strip,
  .research-lens,
  .metric-strip,
  .live-controls,
  .live-data-grid,
  .workspace-grid,
  .two-column,
  .research-layout,
  .theme-board,
  .asset-split,
  .etf-dimension-grid,
  .etf-source-grid,
  .diligence-grid,
  .risk-matrix,
  .data-grid,
  .data-priority,
  .readiness-grid,
  .time-grid,
  .source-grade-grid,
  .red-flag-grid,
  .regional-grid,
  .pipeline,
  .roadmap-grid,
  .kpi-grid,
  .compliance-grid {
    grid-template-columns: 1fr;
  }

  .nav-section {
    display: none;
  }

  .date-chip {
    width: 100%;
    text-align: left;
    white-space: normal;
  }

  .research-brief {
    margin-left: -1px;
    margin-right: -1px;
  }

  .brief-header {
    align-items: flex-start;
    padding: 14px;
  }

  .brief-count {
    white-space: normal;
  }

  .brief-item {
    grid-template-columns: 54px 1fr 76px;
    align-items: start;
    gap: 10px;
    padding: 14px;
  }

  .brief-time {
    grid-column: 1;
    grid-row: 1;
  }

  .brief-signal {
    grid-column: 1;
    grid-row: 2;
    width: 46px;
    min-height: 42px;
    font-size: 11px;
  }

  .brief-copy {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .brief-copy h4 {
    font-size: 14px;
  }

  .brief-next {
    grid-column: 2 / -1;
    grid-row: 3;
    margin-top: 2px;
  }

  .evidence-btn {
    grid-column: 3;
    grid-row: 1 / span 2;
    min-width: 70px;
  }

  .evidence-panel,
  .timeline-panel {
    padding: 14px;
  }

  .timeline-track {
    margin-top: 24px;
  }

  .research-rules {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .nav-list {
    display: flex;
    grid-template-columns: none;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 114px;
    min-height: 48px;
    grid-template-columns: 1fr;
    gap: 0;
    text-align: center;
    justify-items: center;
    padding: 7px 8px;
  }

  .nav-rail {
    display: none;
  }

  .nav-item b {
    font-size: 12px;
  }

  .nav-item small {
    font-size: 10px;
  }

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

  .metric {
    min-height: 114px;
  }

  .segmented {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .segmented::-webkit-scrollbar {
    display: none;
  }

  .segmented button {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .live-row {
    flex-direction: column;
  }

  .live-row > div:last-child {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .feed-item {
    grid-template-columns: 1fr;
  }

  .impact {
    justify-self: start;
    text-align: left;
  }

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

@media (max-width: 480px) {
  .sidebar {
    gap: 8px;
  }

  .system-status {
    display: none;
  }
}

/* Refined daily-workspace visual layer */
:root {
  --ink: #16342d;
  --muted: #718078;
  --soft: #3f5a50;
  --line: rgba(34, 75, 61, 0.14);
  --line-strong: rgba(25, 112, 88, 0.34);
  --surface: rgba(255, 255, 252, 0.96);
  --surface-alt: rgba(246, 249, 245, 0.98);
  --nav: rgba(249, 251, 247, 0.98);
  --cyan: #167d70;
  --teal: #24936d;
  --green: #4e8359;
  --amber: #b87521;
  --red: #c9584d;
  --blue: #3e78a2;
  --shadow: 0 10px 30px rgba(42, 70, 57, 0.08);
  --shadow-hover: 0 16px 36px rgba(35, 80, 64, 0.12);
}

body {
  background: #f3f6f2;
}

.ambient {
  background-image:
    linear-gradient(rgba(38, 98, 78, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 98, 78, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.72;
}

.sidebar {
  background: rgba(249, 251, 247, 0.96);
  box-shadow: 8px 0 24px rgba(53, 78, 66, 0.05);
}

.brand-mark {
  border-color: rgba(255, 255, 255, 0.72);
  background: #1c775e;
  box-shadow: 0 8px 20px rgba(28, 119, 94, 0.18);
}

.system-status span {
  background: rgba(255, 255, 255, 0.82);
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(25, 112, 88, 0.24);
  background: #e9f2ec;
  box-shadow: 0 8px 18px rgba(40, 83, 65, 0.07);
  transform: translateX(2px);
}

.nav-item.active {
  color: #102f27;
}

.nav-item.active .nav-rail {
  background: #167d70;
  box-shadow: 0 0 0 4px rgba(22, 125, 112, 0.1);
}

.sidebar-panel {
  background: #fff9eb;
}

.topbar {
  padding-bottom: 4px;
}

.eyebrow,
.section-kicker {
  color: #167d70;
}

h1 {
  color: #122f27;
  font-size: 32px;
  line-height: 1.12;
}

h1 span {
  color: #60736b;
}

.top-actions {
  align-items: flex-start;
}

.action-stack {
  display: grid;
  justify-items: stretch;
  gap: 5px;
}

.action-stack small {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.search-box {
  min-width: min(390px, 34vw);
  border-color: rgba(34, 75, 61, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(48, 76, 63, 0.06);
}

.search-box:focus-within {
  border-color: rgba(22, 125, 112, 0.58);
  box-shadow: 0 0 0 3px rgba(22, 125, 112, 0.1), 0 10px 24px rgba(48, 76, 63, 0.08);
}

.primary-action {
  min-width: 176px;
  background: #187d63;
  box-shadow: 0 9px 22px rgba(24, 125, 99, 0.2);
}

.primary-action:hover {
  background: #126d56;
  box-shadow: 0 12px 28px rgba(24, 125, 99, 0.24);
}

.primary-action:disabled {
  cursor: progress;
  opacity: 0.76;
}

.primary-action.is-loading {
  animation: action-pulse 900ms ease-in-out infinite alternate;
}

.primary-action.is-complete {
  background: #416f4b;
}

.market-tape {
  gap: 7px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(34, 75, 61, 0.1);
}

.market-tape div {
  min-height: 48px;
  border-color: rgba(34, 75, 61, 0.12);
  background: rgba(255, 255, 252, 0.9);
  box-shadow: 0 4px 14px rgba(44, 76, 61, 0.04);
}

.market-tape strong {
  color: #3d7750;
}

.view.active {
  animation: view-enter 260ms ease-out both;
}

.view-head {
  margin-bottom: 18px;
}

.view-head > div:first-child {
  max-width: 780px;
}

.date-chip {
  padding: 8px 13px;
  border-radius: 7px;
  background: #e8f2ed;
  box-shadow: inset 3px 0 0 #21836d;
}

.research-brief {
  border-color: rgba(34, 75, 61, 0.15);
  background: #fffefb;
  box-shadow: 0 14px 38px rgba(40, 70, 57, 0.09);
}

.brief-header {
  background: #f8faf6;
}

.brief-item {
  position: relative;
  background: rgba(255, 255, 252, 0.84);
  cursor: default;
}

.brief-item::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  content: "";
  transition: background-color 180ms ease, transform 180ms ease;
}

.brief-item:hover,
.brief-item.active {
  background: #f1f7f2;
}

.brief-item.active::before {
  background: #16806c;
}

.brief-item:hover .brief-copy h4,
.brief-item.active .brief-copy h4 {
  color: #0c5e4e;
}

.brief-signal {
  border-color: rgba(22, 125, 112, 0.2);
  background: #edf6f1;
}

.brief-signal.risk {
  border-color: rgba(201, 88, 77, 0.2);
  background: #fff3f0;
}

.brief-signal.macro {
  border-color: rgba(62, 120, 162, 0.2);
  background: #eef5f9;
}

.evidence-btn,
.text-action {
  background: #ffffff;
}

.evidence-btn:hover,
.evidence-btn[aria-expanded="true"],
.text-action:hover {
  border-color: rgba(22, 125, 112, 0.38);
  background: #eaf4ee;
  color: #0e6755;
}

.evidence-panel,
.timeline-panel {
  background: rgba(255, 255, 252, 0.95);
  box-shadow: 0 8px 24px rgba(42, 70, 57, 0.06);
}

.evidence-panel {
  box-shadow: inset 3px 0 0 rgba(22, 125, 112, 0.72), 0 8px 24px rgba(42, 70, 57, 0.06);
}

.evidence-panel blockquote {
  border-left: 0;
  padding-left: 0;
  font-size: 16px;
}

.metric,
.panel,
.theme-item,
.data-grid > div,
.risk-cell,
.rule {
  background: rgba(255, 255, 252, 0.96);
  backdrop-filter: none;
}

.metric:hover,
.panel:hover,
.theme-item:hover,
.asset-card:hover,
.roadmap-card:hover,
.priority-card:hover,
.risk-cell:hover,
.data-grid > div:hover,
.rule:hover,
.etf-dimension-grid article:hover,
.etf-source-grid div:hover,
.diligence-grid article:hover {
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(22, 125, 112, 0.18);
  outline-offset: 2px;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes action-pulse {
  from { box-shadow: 0 8px 20px rgba(24, 125, 99, 0.14); }
  to { box-shadow: 0 12px 28px rgba(24, 125, 99, 0.28); }
}

@media (max-width: 720px) {
  h1 {
    font-size: 23px;
  }

  .top-actions,
  .action-stack,
  .search-box,
  .primary-action {
    min-width: 0;
    width: 100%;
  }

  .action-stack small {
    text-align: left;
  }

  .market-tape {
    padding-bottom: 10px;
    border-bottom: 0;
  }

  .brief-item::before {
    top: 10px;
    bottom: 10px;
  }

  .evidence-panel blockquote {
    font-size: 15px;
  }
}

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

/* AI Quant Strategy Lab */
.market-tape {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.secondary-action {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid rgba(22, 125, 112, 0.28);
  border-radius: 7px;
  background: #edf5f0;
  color: #135e4c;
  cursor: pointer;
  font-weight: 800;
}

.secondary-action:hover {
  border-color: rgba(22, 125, 112, 0.48);
  background: #e3efe8;
}

.quant-head {
  align-items: flex-start;
}

.quant-scope {
  display: grid;
  gap: 3px;
  min-width: 220px;
  padding: 11px 14px;
  border-left: 3px solid #167d70;
  background: #e8f2ed;
}

.quant-scope strong {
  color: #174f40;
  font-size: 13px;
}

.quant-scope span {
  color: var(--muted);
  font-size: 11px;
}

.quant-builder {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(520px, 1.18fr);
  gap: 14px;
  align-items: start;
}

.quant-input-panel,
.quant-output-panel {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 252, 0.98);
  box-shadow: 0 12px 32px rgba(42, 70, 57, 0.07);
  padding: 17px;
}

.quant-output-panel {
  border-top: 3px solid #167d70;
}

.quant-panel-heading {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
}

.quant-panel-heading > span {
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  border: 1px solid rgba(22, 125, 112, 0.28);
  border-radius: 6px;
  background: #edf5f0;
  color: #167d70;
  font-size: 12px;
  font-weight: 900;
}

.quant-panel-heading h3 {
  color: var(--ink);
  font-size: 17px;
}

.quant-panel-heading h3 em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}

.quant-panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.strategy-prompt-label,
.quant-form-grid label {
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
}

#strategyPrompt {
  width: 100%;
  min-height: 118px;
  margin: 7px 0 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcf8;
  color: var(--ink);
  line-height: 1.65;
  padding: 12px;
}

.strategy-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.strategy-presets button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #3d6658;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 0 10px;
}

.strategy-presets button:hover,
.strategy-presets button.selected {
  border-color: rgba(22, 125, 112, 0.38);
  background: #eaf4ee;
  color: #0e6755;
}

.quant-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quant-form-grid label {
  display: grid;
  gap: 5px;
}

.quant-form-grid select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 9px;
}

.quant-guardrail-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 14px 0;
  padding: 11px;
  border: 1px solid rgba(184, 117, 33, 0.18);
  background: #fff9ec;
}

.quant-guardrail-options label {
  color: #5f6256;
  font-size: 10px;
  line-height: 1.35;
}

.quant-generate {
  width: 100%;
}

.quant-disclaimer {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.validation-scoreboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.validation-scoreboard > div {
  min-height: 76px;
  border: 1px solid rgba(22, 125, 112, 0.16);
  background: #eff6f1;
  padding: 9px;
}

.validation-scoreboard .warning-score {
  border-color: rgba(184, 117, 33, 0.2);
  background: #fff7e6;
}

.validation-scoreboard span,
.validation-scoreboard small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.validation-scoreboard strong {
  display: block;
  margin: 5px 0 1px;
  color: #17644f;
  font-size: 22px;
}

.warning-score strong {
  color: #a4681e;
}

.quant-result-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 9px;
}

.logic-card,
.metric-card,
.quant-code-wrap,
.quant-findings {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  background: #fbfcf8;
  padding: 12px;
}

.logic-card ol,
.quant-findings ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #435c53;
  font-size: 10px;
  line-height: 1.5;
}

.backtest-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.backtest-metrics div {
  border-left: 2px solid #92b8a4;
  padding-left: 8px;
}

.backtest-metrics span,
.metric-card > small {
  color: var(--muted);
  font-size: 9px;
}

.backtest-metrics strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 17px;
}

.metric-card > small {
  display: block;
  margin-top: 10px;
  line-height: 1.4;
}

.quant-code-wrap {
  margin-top: 9px;
  background: #132e27;
  color: #d9ece2;
}

.quant-code-wrap > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #a8c8b8;
  font-size: 10px;
  font-weight: 800;
}

.quant-code-wrap button {
  min-height: 28px;
  border: 1px solid #45685a;
  border-radius: 5px;
  background: #203f35;
  color: #d9ece2;
  cursor: pointer;
  padding: 0 9px;
}

.quant-code-wrap pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 8px 0 0;
  color: #ecf5f0;
  font-size: 10px;
  line-height: 1.5;
  white-space: pre;
}

.quant-findings {
  margin-top: 9px;
  border-left: 3px solid #b87521;
  background: #fffaf0;
}

.quant-findings strong {
  color: #79511d;
  font-size: 11px;
}

.quant-workflow {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-top: 14px;
}

.quant-workflow div {
  min-height: 74px;
  border-top: 2px solid #74aa91;
  background: #f7faf6;
  padding: 9px;
}

.quant-workflow span,
.quant-workflow small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.quant-workflow strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .market-tape {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quant-builder {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .quant-head,
  .quant-result-grid {
    grid-template-columns: 1fr;
  }

  .quant-scope {
    width: 100%;
  }

  .quant-input-panel,
  .quant-output-panel {
    width: 100%;
    padding: 13px;
  }

  .quant-form-grid,
  .quant-guardrail-options,
  .validation-scoreboard {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 420px) {
  .quant-form-grid,
  .quant-guardrail-options {
    grid-template-columns: 1fr;
  }

  .validation-scoreboard {
    gap: 5px;
  }

  .validation-scoreboard > div {
    min-height: 70px;
    padding: 7px;
  }

  .validation-scoreboard strong {
    font-size: 19px;
  }
}

/* Single-viewport research workbench */
body.workbench-ready {
  height: 100dvh;
  overflow: hidden;
}

body.workbench-ready .app-shell {
  height: 100dvh;
  min-height: 0;
  grid-template-columns: 232px minmax(0, 1fr);
  overflow: hidden;
}

body.workbench-ready .sidebar {
  height: 100dvh;
  min-height: 0;
  padding: 14px 12px;
  gap: 10px;
  overflow: hidden;
}

body.workbench-ready .brand {
  min-height: 44px;
}

body.workbench-ready .brand-mark {
  width: 38px;
  height: 38px;
}

body.workbench-ready .brand strong {
  font-size: 15px;
}

body.workbench-ready .system-status span {
  min-height: 24px;
  font-size: 9px;
}

body.workbench-ready .nav-list {
  min-height: 0;
  gap: 2px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

body.workbench-ready .nav-section {
  margin: 7px 8px 1px;
}

body.workbench-ready .nav-item {
  min-height: 38px;
  padding: 5px 8px;
}

body.workbench-ready .nav-rail {
  height: 22px;
}

body.workbench-ready .nav-item b {
  font-size: 12px;
}

body.workbench-ready .nav-item small,
body.workbench-ready .sidebar-panel,
body.workbench-ready .global-scope,
body.workbench-ready .app-footer,
body.workbench-ready .quant-lab-tabs {
  display: none;
}

body.workbench-ready .main {
  height: 100dvh;
  min-height: 0;
  padding: 13px 18px 14px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

body.workbench-ready .topbar {
  margin-bottom: 8px;
  gap: 16px;
}

body.workbench-ready .topbar h1 {
  font-size: 25px;
}

body.workbench-ready .eyebrow {
  margin-bottom: 3px;
  font-size: 10px;
}

body.workbench-ready .language-toggle,
body.workbench-ready .search-box,
body.workbench-ready .primary-action {
  height: 38px;
  min-height: 38px;
}

body.workbench-ready .action-stack {
  gap: 2px;
}

body.workbench-ready .market-tape {
  min-height: 0;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

body.workbench-ready .market-tape div {
  min-height: 40px;
  padding: 0 9px;
}

body.workbench-ready .view {
  min-height: 0;
  overflow: hidden;
}

body.workbench-ready .view.active {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

body.workbench-ready .view-head {
  min-height: 0;
  margin-bottom: 7px;
  gap: 12px;
}

body.workbench-ready .view-head h2 {
  margin-bottom: 0;
  font-size: 19px;
}

body.workbench-ready .view-head p:not(.section-kicker) {
  display: none;
}

body.workbench-ready .date-chip {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 10px;
}

.module-tabs {
  min-width: 0;
  min-height: 39px;
  display: flex;
  align-items: end;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid rgba(37, 81, 67, 0.16);
  scrollbar-width: none;
}

.module-tabs::-webkit-scrollbar {
  display: none;
}

.module-tabs button {
  position: relative;
  flex: 0 0 auto;
  min-width: 106px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: #5b6f67;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.module-tabs button:hover {
  color: #153f34;
  background: rgba(231, 242, 236, 0.72);
}

.module-tabs button.selected {
  border-color: rgba(30, 117, 94, 0.2);
  color: #ffffff;
  background: #187d63;
}

.module-stage {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding-top: 9px;
}

.module-page {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: none;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: contain;
  padding: 0 4px 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(36, 113, 91, 0.34) transparent;
}

.module-stage.has-overflow::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 74px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(243, 246, 242, 0), rgba(243, 246, 242, 0.96) 72%);
}

.module-page-expand {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 3;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(24, 125, 99, 0.28);
  border-radius: 6px;
  color: #ffffff;
  background: #187d63;
  box-shadow: 0 10px 24px rgba(24, 93, 73, 0.2);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.module-page-expand[hidden] {
  display: none;
}

.module-page.active {
  display: block;
  animation: view-enter 180ms ease-out both;
}

.module-page > :first-child {
  margin-top: 0;
}

.module-page > :last-child {
  margin-bottom: 0;
}

body.workbench-ready .module-page .market-cockpit,
body.workbench-ready .module-page .decision-dashboard,
body.workbench-ready .module-page .research-brief,
body.workbench-ready .module-page .research-lens,
body.workbench-ready .module-page .live-data-panel,
body.workbench-ready .module-page .workspace-grid,
body.workbench-ready .module-page .two-column,
body.workbench-ready .module-page .research-layout,
body.workbench-ready .module-page .quant-module-band,
body.workbench-ready .module-page .quant-builder,
body.workbench-ready .module-page .experiment-console,
body.workbench-ready .module-page .quant-workflow {
  margin-bottom: 10px;
}

body.workbench-ready #workspace .module-page[data-module-page-panel="market"] {
  display: none;
}

body.workbench-ready #workspace .module-page[data-module-page-panel="market"].active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

body.workbench-ready #workspace .module-page[data-module-page-panel="market"] .market-cockpit {
  min-height: 0;
  height: 100%;
}

body.workbench-ready #workspace .module-page[data-module-page-panel="priority"] .decision-dashboard {
  min-height: 100%;
}

body.workbench-ready #filings .two-column,
body.workbench-ready #company .research-layout,
body.workbench-ready #quant .quant-builder {
  min-height: 100%;
}

.context-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  pointer-events: none;
}

.context-drawer.open {
  visibility: visible;
  pointer-events: auto;
}

.context-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(19, 47, 39, 0.18);
  opacity: 0;
  cursor: default;
  transition: opacity 180ms ease;
}

.context-drawer.open .context-drawer-backdrop {
  opacity: 1;
}

.context-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(450px, 92vw);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid rgba(30, 93, 75, 0.2);
  background: #f8fbf8;
  box-shadow: -18px 0 50px rgba(22, 52, 43, 0.2);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.context-drawer.open .context-drawer-panel {
  transform: translateX(0);
}

.context-drawer-head {
  min-height: 70px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(30, 93, 75, 0.14);
}

.context-drawer-head h3 {
  margin-top: 4px;
  font-size: 18px;
}

.context-drawer-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(30, 93, 75, 0.18);
  border-radius: 6px;
  color: #234b40;
  background: #ffffff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.context-drawer-body {
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
}

.context-drawer-body > * {
  width: 100%;
  margin: 0;
}

.context-drawer-body .module-page {
  display: block;
  height: auto;
  overflow: visible;
  padding: 0;
  animation: none;
}

.context-drawer-body .text-action,
.context-drawer-body [data-priority-open] {
  display: none;
}

@media (max-width: 1120px) and (min-width: 721px) {
  body.workbench-ready .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  body.workbench-ready .sidebar {
    position: static;
  }

  body.workbench-ready .nav-list {
    display: block;
  }
}

@media (max-width: 720px) {
  body.workbench-ready .app-shell {
    display: block;
    height: 100dvh;
  }

  body.workbench-ready .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    width: 100%;
    height: 64px;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(35, 86, 70, 0.16);
    border-right: 0;
    border-bottom: 0;
    background: rgba(250, 252, 249, 0.97);
    box-shadow: 0 -10px 28px rgba(43, 73, 61, 0.12);
  }

  body.workbench-ready .sidebar .brand,
  body.workbench-ready .sidebar .system-status,
  body.workbench-ready .nav-section {
    display: none;
  }

  body.workbench-ready .nav-list {
    height: 54px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  body.workbench-ready .nav-list::-webkit-scrollbar {
    display: none;
  }

  body.workbench-ready .nav-item {
    flex: 0 0 76px;
    width: 76px;
    min-height: 48px;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 4px 6px;
    text-align: center;
    scroll-snap-align: center;
  }

  body.workbench-ready .nav-item:hover,
  body.workbench-ready .nav-item.active {
    transform: none;
  }

  body.workbench-ready .nav-item .nav-rail,
  body.workbench-ready .nav-item small {
    display: none;
  }

  body.workbench-ready .nav-item b {
    font-size: 11px;
    line-height: 1.15;
  }

  body.workbench-ready .main {
    width: 100%;
    height: calc(100dvh - 64px);
    padding: 9px 10px 8px;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  body.workbench-ready .topbar {
    margin-bottom: 6px;
    gap: 6px;
  }

  body.workbench-ready .topbar > div:first-child {
    display: none;
  }

  body.workbench-ready .top-actions {
    gap: 6px;
  }

  body.workbench-ready .top-actions .language-toggle,
  body.workbench-ready .top-actions .search-box,
  body.workbench-ready .top-actions .primary-action {
    height: 36px;
    min-height: 36px;
  }

  body.workbench-ready .top-actions .action-stack small {
    display: none;
  }

  body.workbench-ready .market-tape {
    margin-bottom: 6px;
    padding-bottom: 5px;
  }

  body.workbench-ready .market-tape div {
    flex-basis: 138px;
    min-height: 43px;
    padding: 5px 8px;
  }

  body.workbench-ready .view-head {
    min-height: 39px;
    margin-bottom: 4px;
    flex-direction: row;
    align-items: center;
  }

  body.workbench-ready .view-head h2 {
    font-size: 17px;
    line-height: 1.14;
  }

  body.workbench-ready .view-head h2 span {
    display: none;
  }

  body.workbench-ready .section-kicker {
    margin-bottom: 2px;
    font-size: 8px;
  }

  body.workbench-ready .date-chip {
    flex: 0 0 auto;
    min-height: 30px;
    max-width: 126px;
    padding: 4px 7px;
    font-size: 8px;
  }

  .module-tabs {
    min-height: 35px;
  }

  .module-tabs button {
    min-width: 88px;
    height: 32px;
    padding: 0 10px;
    font-size: 10px;
  }

  .module-stage {
    padding-top: 7px;
  }

  .module-page {
    padding-right: 2px;
    padding-bottom: 8px;
  }

  body.workbench-ready .prototype-status {
    padding: 7px 9px;
  }

  .context-drawer-panel {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(76dvh, 650px);
    border-top: 1px solid rgba(30, 93, 75, 0.2);
    border-left: 0;
    border-radius: 8px 8px 0 0;
    transform: translateY(102%);
  }

  .context-drawer.open .context-drawer-panel {
    transform: translateY(0);
  }

  .context-drawer-head {
    min-height: 58px;
    padding: 10px 12px;
  }

  .context-drawer-body {
    padding: 10px;
  }
}

/* Global Chinese market positioning */
.brand > div:last-child {
  min-width: 0;
}

.brand strong,
.brand span {
  overflow-wrap: anywhere;
}

.regional-note {
  padding-top: 8px;
  border-top: 1px solid rgba(184, 117, 33, 0.18);
}

h1 {
  max-width: 760px;
  font-size: 30px;
}

h1 span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
}

.global-scope {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(480px, 1.28fr);
  gap: 26px;
  align-items: center;
  margin: 0 -26px 22px;
  padding: 20px 26px;
  border-top: 1px solid rgba(34, 75, 61, 0.12);
  border-bottom: 1px solid rgba(34, 75, 61, 0.14);
  background: rgba(232, 242, 237, 0.72);
}

body[data-active-view]:not([data-active-view="workspace"]) .global-scope {
  display: none;
}

.scope-intro h2 {
  margin: 6px 0;
  color: #133b31;
  font-size: 20px;
}

.scope-intro p {
  margin: 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.scope-tag {
  color: #167d70;
  font-size: 10px;
  font-weight: 900;
}

.scope-control-wrap {
  min-width: 0;
}

.scope-segments {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(22, 125, 112, 0.22);
  border-radius: 6px 6px 0 0;
  background: rgba(255, 255, 255, 0.7);
}

.scope-segments button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid rgba(22, 125, 112, 0.16);
  background: transparent;
  color: #4b665d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.scope-segments button:last-child {
  border-right: 0;
}

.scope-segments button:hover,
.scope-segments button.active {
  background: #187d63;
  color: #ffffff;
}

.scope-detail {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(260px, 1.3fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 84px;
  padding: 13px 14px;
  border: 1px solid rgba(22, 125, 112, 0.22);
  border-top: 0;
  background: rgba(255, 255, 252, 0.94);
}

.scope-detail > div span,
.scope-meta {
  display: block;
  color: #167d70;
  font-size: 9px;
  font-weight: 900;
}

.scope-detail strong {
  display: block;
  margin-top: 4px;
  color: #173c32;
  font-size: 13px;
  line-height: 1.4;
}

.scope-detail p {
  margin: 0;
  color: #51685f;
  font-size: 11px;
  line-height: 1.55;
}

.scope-meta {
  max-width: 150px;
  color: var(--muted);
  line-height: 1.5;
  text-align: right;
}

.connector-scope-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 13px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.connector-scope-grid > div {
  min-height: 76px;
  padding: 10px;
  background: #fafcf9;
}

.connector-scope-grid > div.is-live {
  box-shadow: inset 0 3px 0 #21836d;
  background: #edf6f1;
}

.connector-scope-grid strong,
.connector-scope-grid span,
.connector-scope-grid small {
  display: block;
}

.connector-scope-grid strong {
  color: var(--ink);
  font-size: 12px;
}

.connector-scope-grid span {
  margin: 5px 0 2px;
  color: var(--soft);
  font-size: 10px;
}

.connector-scope-grid small {
  color: var(--muted);
  font-size: 9px;
}

.app-footer {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 30px -26px -36px;
  padding: 18px 26px;
  border-top: 1px solid var(--line);
  background: #e8f0ea;
}

.app-footer strong {
  color: #153e33;
  font-size: 13px;
}

.app-footer span,
.app-footer small {
  color: var(--muted);
  font-size: 10px;
}

.app-footer small {
  max-width: 340px;
  text-align: right;
}

@media (min-width: 721px) {
  .topbar > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar .top-actions {
    flex: 0 0 auto;
  }

  .topbar .search-box {
    width: 280px;
    min-width: 260px;
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .action-stack .primary-action {
    min-width: 150px;
    white-space: nowrap;
    font-size: 12px;
  }
}

@media (max-width: 1400px) and (min-width: 721px) {
  .market-tape div {
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-width: 1180px) {
  .global-scope {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .scope-detail {
    grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr);
  }

  .scope-meta {
    grid-column: 1 / -1;
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 720px) {
  h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  h1 span {
    font-size: 12px;
  }

  .global-scope {
    margin: 0 -12px 18px;
    gap: 10px;
    padding: 14px 12px;
  }

  .scope-intro h2 {
    font-size: 17px;
  }

  .scope-intro p {
    display: none;
  }

  .scope-segments {
    display: flex;
    overflow-x: auto;
    border-radius: 6px 6px 0 0;
    scrollbar-width: none;
  }

  .scope-segments::-webkit-scrollbar {
    display: none;
  }

  .scope-segments button {
    flex: 0 0 94px;
    min-height: 40px;
  }

  .scope-detail {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    padding: 10px 12px;
  }

  .scope-detail p,
  .scope-meta {
    display: none;
  }

  .connector-scope-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-footer {
    grid-template-columns: 1fr;
    gap: 5px;
    margin: 24px -12px -36px;
    padding: 16px 12px;
  }

  .app-footer small {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 420px) {
  .brand strong {
    font-size: 15px;
  }

  .brand span {
    font-size: 10px;
  }

  .connector-scope-grid {
    grid-template-columns: 1fr;
  }

  .prototype-status {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .prototype-status strong {
    white-space: normal;
  }
}

/* User-priority decision dashboard */
.decision-dashboard {
  margin: 18px -26px 24px;
  padding: 22px 26px 24px;
  border-top: 1px solid rgba(41, 91, 74, 0.14);
  border-bottom: 1px solid rgba(41, 91, 74, 0.16);
  background: #f1f6f1;
}

.decision-head,
.decision-pane-head,
.scenario-head,
.scenario-summary,
.scenario-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.decision-head h3,
.decision-pane h4,
.scenario-explorer h4 {
  margin: 3px 0 0;
  color: #143b31;
  letter-spacing: 0;
}

.decision-head h3 {
  font-size: 19px;
}

.decision-head > div:first-child > p:last-child {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.decision-market-filter,
.heat-mode,
.scenario-presets {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(36, 106, 87, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 252, 0.84);
}

.decision-market-filter button,
.heat-mode button,
.scenario-presets button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #597067;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.decision-market-filter button:hover,
.decision-market-filter button.selected,
.heat-mode button:hover,
.heat-mode button.selected,
.scenario-presets button:hover,
.scenario-presets button.selected {
  background: #187d63;
  color: #ffffff;
}

.decision-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 12px;
}

.decision-kpi {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  padding: 13px 14px;
  border: 1px solid rgba(46, 91, 77, 0.16);
  border-radius: 7px;
  background: #fffef9;
}

.decision-kpi::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: var(--kpi-tone, #27856d);
}

.decision-kpi.priority { --kpi-tone: #cb6a4e; }
.decision-kpi.evidence { --kpi-tone: #27856d; }
.decision-kpi.calendar { --kpi-tone: #b17a28; }
.decision-kpi.freshness { --kpi-tone: #4d74aa; }

.decision-kpi > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.decision-kpi span {
  color: #536a61;
  font-size: 11px;
  font-weight: 800;
}

.decision-kpi small,
.pane-label,
.research-only,
.queue-count {
  color: #6b7e76;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}

.decision-kpi small {
  padding: 2px 5px;
  border: 1px solid rgba(78, 107, 96, 0.2);
  border-radius: 4px;
  background: #f7faf6;
}

.decision-kpi strong {
  display: block;
  margin-top: 12px;
  color: #173f34;
  font-size: 25px;
  line-height: 1;
}

.decision-kpi p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.decision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(360px, 0.76fr);
  gap: 10px;
}

.decision-pane {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(44, 88, 74, 0.16);
  border-radius: 8px;
  background: #fffefb;
}

.decision-pane h4,
.scenario-explorer h4 {
  font-size: 14px;
}

.pane-label {
  display: block;
  color: #247c68;
}

.pane-intro,
.scenario-controls > p {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.market-heatmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.heat-cell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 94px;
  padding: 10px;
  border: 1px solid var(--cell-border, rgba(42, 89, 76, 0.16));
  border-radius: 6px;
  background: var(--cell-bg, #f8faf6);
  color: #173b32;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.heat-cell:hover,
.heat-cell.selected {
  border-color: #287f6b;
  box-shadow: inset 0 0 0 1px rgba(40, 127, 107, 0.18), 0 10px 22px rgba(50, 91, 77, 0.1);
  transform: translateY(-1px);
}

.heat-cell-market,
.heat-cell small {
  color: rgba(37, 68, 59, 0.72);
  font-size: 8px;
  font-weight: 900;
}

.heat-cell strong {
  align-self: end;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.25;
}

.heat-cell-value {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin-top: 9px;
}

.heat-cell-value b {
  font-size: 15px;
  line-height: 1;
}

.heat-cell-value small {
  max-width: 64px;
  text-align: right;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 24px;
  color: var(--muted);
  font-size: 9px;
}

.heatmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.heatmap-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.market-insight,
.priority-detail {
  min-height: 108px;
  padding: 12px;
  border-top: 1px solid rgba(44, 88, 74, 0.14);
  background: #fbfcf8;
}

.market-insight {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(240px, 1.3fr);
  gap: 16px;
}

.insight-title span,
.priority-detail span {
  display: block;
  color: #247c68;
  font-size: 9px;
  font-weight: 900;
}

.insight-title strong,
.priority-detail strong {
  display: block;
  margin-top: 4px;
  color: #163f34;
  font-size: 13px;
}

.insight-title small,
.market-insight p,
.priority-detail p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.insight-title small {
  display: block;
  margin-top: 5px;
}

.market-insight p,
.priority-detail p {
  margin: 0;
}

.insight-next {
  margin-top: 7px;
  color: #345d51;
  font-size: 10px;
  font-weight: 800;
}

.queue-count,
.research-only {
  padding: 4px 7px;
  border: 1px solid rgba(49, 95, 80, 0.16);
  border-radius: 5px;
  background: #f7faf6;
}

.priority-table-head,
.priority-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 56px;
  gap: 9px;
  align-items: center;
}

.priority-table-head {
  min-height: 27px;
  padding: 0 8px;
  color: #7b8a84;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.priority-table-head span:last-child {
  text-align: right;
}

.priority-list {
  display: grid;
  gap: 4px;
}

.priority-row {
  width: 100%;
  min-height: 61px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f8faf6;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.priority-row:hover,
.priority-row.selected {
  border-color: rgba(40, 127, 107, 0.35);
  background: #edf6f1;
}

.priority-rank {
  color: #8a9892;
  font-size: 10px;
  font-weight: 900;
}

.priority-name {
  min-width: 0;
}

.priority-name strong,
.priority-name small,
.priority-trigger {
  display: block;
}

.priority-name strong {
  overflow: hidden;
  color: #173d33;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-name small,
.priority-trigger {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.priority-trigger {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-score {
  text-align: right;
}

.priority-score strong,
.priority-score small {
  display: block;
}

.priority-score strong {
  color: #287f6b;
  font-size: 15px;
}

.priority-score small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.priority-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.priority-detail .text-action {
  min-height: 36px;
  white-space: nowrap;
}

.scenario-explorer {
  display: grid;
  grid-template-columns: minmax(400px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  margin-top: 10px;
  padding: 17px;
  border: 1px solid rgba(44, 88, 74, 0.16);
  border-radius: 8px;
  background: #fffef9;
}

.scenario-presets {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin-bottom: 12px;
}

.scenario-sliders {
  display: grid;
  gap: 10px;
}

.scenario-sliders label {
  display: grid;
  grid-template-columns: 120px 58px minmax(120px, 1fr);
  gap: 9px;
  align-items: center;
  color: #50675e;
  font-size: 10px;
  font-weight: 800;
}

.scenario-sliders output {
  color: #1d765f;
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.scenario-sliders input[type="range"] {
  width: 100%;
  accent-color: #1d8068;
  cursor: pointer;
}

.scenario-results {
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid rgba(44, 88, 74, 0.14);
}

.scenario-summary {
  align-items: flex-end;
}

.scenario-summary > span,
.scenario-summary strong,
.scenario-summary p {
  display: block;
}

.scenario-summary > span {
  color: #61736c;
  font-size: 9px;
  font-weight: 900;
}

.scenario-summary strong {
  margin-top: 3px;
  color: #173f34;
  font-size: 17px;
}

.scenario-summary p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: right;
}

.attention-bars {
  display: grid;
  gap: 8px;
  margin: 16px 0 13px;
}

.attention-bar {
  display: grid;
  grid-template-columns: 90px minmax(120px, 1fr) 32px;
  gap: 8px;
  align-items: center;
}

.attention-bar span,
.attention-bar b {
  color: #50675e;
  font-size: 9px;
}

.attention-bar b {
  color: #1c715d;
  text-align: right;
}

.attention-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8eee9;
}

.attention-track i {
  display: block;
  width: var(--attention, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--attention-color, #27856d);
  transition: width 220ms ease;
}

.scenario-foot {
  align-items: center;
  color: #486158;
  font-size: 9px;
}

.scenario-foot small {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .decision-head {
    align-items: flex-end;
  }

  .decision-grid,
  .scenario-explorer {
    grid-template-columns: 1fr;
  }

  .scenario-results {
    padding: 14px 0 0;
    border-top: 1px solid rgba(44, 88, 74, 0.14);
    border-left: 0;
  }
}

@media (max-width: 900px) {
  .decision-head {
    align-items: stretch;
    flex-direction: column;
  }

  .decision-market-filter {
    align-self: flex-start;
  }

  .decision-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .decision-dashboard {
    margin: 15px -12px 20px;
    padding: 16px 12px 18px;
  }

  .decision-head h3 {
    font-size: 17px;
  }

  .decision-market-filter,
  .heat-mode,
  .scenario-presets {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .decision-market-filter::-webkit-scrollbar,
  .heat-mode::-webkit-scrollbar,
  .scenario-presets::-webkit-scrollbar {
    display: none;
  }

  .decision-market-filter button,
  .heat-mode button,
  .scenario-presets button {
    flex: 0 0 auto;
    min-height: 36px;
  }

  .decision-kpi {
    min-height: 104px;
    padding: 11px 12px;
  }

  .decision-kpi strong {
    font-size: 22px;
  }

  .decision-pane,
  .scenario-explorer {
    padding: 13px;
  }

  .decision-pane-head,
  .scenario-head,
  .scenario-summary,
  .scenario-foot {
    gap: 8px;
  }

  .market-heatmap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heat-cell {
    min-height: 88px;
  }

  .market-insight,
  .priority-detail {
    grid-template-columns: 1fr;
  }

  .priority-detail .text-action {
    width: 100%;
  }

  .scenario-sliders label {
    grid-template-columns: minmax(88px, 1fr) 54px;
  }

  .scenario-sliders input[type="range"] {
    grid-column: 1 / -1;
  }

  .scenario-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .scenario-summary p {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 420px) {
  .decision-kpis {
    gap: 6px;
  }

  .decision-kpi {
    min-height: 100px;
  }

  .decision-kpi span {
    font-size: 10px;
  }

  .decision-kpi small {
    font-size: 8px;
  }

  .market-insight {
    min-height: 0;
  }

  .priority-table-head {
    display: none;
  }

  .priority-row {
    grid-template-columns: 24px minmax(0, 1fr) 48px;
  }

  .attention-bar {
    grid-template-columns: 74px minmax(80px, 1fr) 28px;
  }

  .scenario-foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Personal watchlist interaction */
.priority-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.priority-view-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(36, 106, 87, 0.18);
  border-radius: 7px;
  background: #f6f9f5;
}

.priority-view-tabs button,
.watchlist-add,
.watchlist-toggle,
.catalog-toggle,
.dialog-close {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.priority-view-tabs button {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 5px;
  background: transparent;
  color: #5b7068;
  font-size: 10px;
  font-weight: 850;
}

.priority-view-tabs button:hover,
.priority-view-tabs button.selected {
  background: #187d63;
  color: #ffffff;
}

.watchlist-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(32, 121, 95, 0.28);
  border-radius: 6px;
  background: #edf6f1;
  color: #176f5a;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.watchlist-add > span:first-child {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.watchlist-add:hover,
.watchlist-toggle:hover,
.catalog-toggle:hover {
  border-color: #1d7e66;
  background: #e2f1e9;
}

.priority-detail-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.watchlist-toggle {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(44, 104, 86, 0.22);
  border-radius: 6px;
  background: #f6f9f6;
  color: #426258;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.watchlist-toggle.is-watched {
  border-color: rgba(183, 112, 38, 0.25);
  background: #fff7e8;
  color: #96621f;
}

.watchlist-toggle:disabled {
  cursor: default;
  opacity: 0.72;
}

.watchlist-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 40px));
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(35, 91, 74, 0.24);
  border-radius: 8px;
  background: #fffef9;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(28, 67, 55, 0.24);
}

.watchlist-dialog::backdrop {
  background: rgba(26, 52, 44, 0.28);
  backdrop-filter: blur(3px);
}

.watchlist-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px 13px;
  border-bottom: 1px solid rgba(42, 88, 73, 0.14);
  background: #f1f6f1;
}

.watchlist-dialog-head h3 {
  margin: 4px 0 0;
  color: #153d32;
  font-size: 16px;
  letter-spacing: 0;
}

.dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(50, 94, 80, 0.2);
  border-radius: 6px;
  background: #fffefb;
  color: #50675f;
  font-size: 21px;
  line-height: 1;
}

.dialog-close:hover {
  background: #e8f2ec;
  color: #146d58;
}

.watchlist-search {
  display: grid;
  gap: 6px;
  padding: 14px 18px 10px;
  color: #536a61;
  font-size: 10px;
  font-weight: 850;
}

.watchlist-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(48, 98, 82, 0.22);
  border-radius: 6px;
  outline: none;
  background: #fbfcf8;
  color: var(--ink);
  font-size: 12px;
}

.watchlist-search input:focus {
  border-color: #22806a;
  box-shadow: 0 0 0 3px rgba(34, 128, 106, 0.1);
}

.watchlist-catalog {
  display: grid;
  gap: 5px;
  max-height: 430px;
  overflow-y: auto;
  padding: 2px 18px 12px;
}

.watchlist-catalog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 10px 11px;
  border: 1px solid rgba(47, 91, 77, 0.13);
  border-radius: 6px;
  background: #f8faf6;
}

.watchlist-catalog-row > div {
  min-width: 0;
}

.watchlist-catalog-row span,
.watchlist-catalog-row strong,
.watchlist-catalog-row small {
  display: block;
}

.watchlist-catalog-row span {
  color: #247c68;
  font-size: 8px;
  font-weight: 900;
}

.watchlist-catalog-row strong {
  margin-top: 3px;
  color: #173d33;
  font-size: 11px;
}

.watchlist-catalog-row small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-toggle {
  min-width: 70px;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid rgba(36, 112, 89, 0.24);
  border-radius: 6px;
  background: #eaf5ef;
  color: #176d58;
  font-size: 9px;
  font-weight: 900;
}

.catalog-toggle.is-watched {
  border-color: rgba(183, 112, 38, 0.23);
  background: #fff5e3;
  color: #94601d;
}

.watchlist-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.dialog-note {
  margin: 0;
  padding: 11px 18px 14px;
  border-top: 1px solid rgba(45, 90, 76, 0.12);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .priority-toolbar {
    align-items: stretch;
  }

  .priority-view-tabs {
    flex: 1 1 auto;
  }

  .priority-view-tabs button {
    flex: 1 1 50%;
  }

  .priority-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .priority-detail-actions > button {
    width: 100%;
  }

  .watchlist-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .watchlist-dialog-head,
  .watchlist-search {
    padding-right: 13px;
    padding-left: 13px;
  }

  .watchlist-catalog {
    padding-right: 13px;
    padding-left: 13px;
  }

  .dialog-note {
    padding-right: 13px;
    padding-left: 13px;
  }
}

@media (max-width: 420px) {
  .priority-toolbar {
    flex-direction: column;
  }

  .watchlist-add {
    width: 100%;
  }

  .watchlist-catalog-row {
    min-height: 68px;
  }

  .catalog-toggle {
    min-width: 62px;
  }
}

/* Quantitative visual language across research modules */
.module-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.module-kpi-grid > div {
  position: relative;
  min-width: 0;
  min-height: 82px;
  padding: 10px 11px;
  border: 1px solid rgba(46, 91, 77, 0.14);
  border-radius: 6px;
  background: #fffef9;
}

.module-kpi-grid span,
.module-kpi-grid strong,
.module-kpi-grid small {
  display: block;
}

.module-kpi-grid span {
  color: #61736c;
  font-size: 9px;
  font-weight: 850;
}

.module-kpi-grid strong {
  margin-top: 8px;
  color: #183f35;
  font-size: 19px;
  line-height: 1;
}

.module-kpi-grid small {
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: #7a8a83;
  font-size: 8px;
  font-weight: 800;
}

.quant-module-band {
  margin-top: 14px;
  padding: 16px;
  border-top: 1px solid rgba(42, 88, 73, 0.15);
  border-bottom: 1px solid rgba(42, 88, 73, 0.15);
  background: #f2f6f1;
}

.quant-band-head,
.mini-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.quant-band-head {
  margin-bottom: 12px;
}

.quant-band-head h3 {
  margin: 4px 0 0;
  color: #153d32;
  font-size: 14px;
  letter-spacing: 0;
}

.demo-boundary {
  padding: 4px 7px;
  border: 1px solid rgba(55, 100, 85, 0.17);
  border-radius: 5px;
  background: #fffef9;
  color: #6c7e77;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.filing-quant-preview {
  margin: 10px 0 13px;
  padding: 12px 0;
  border-top: 1px solid rgba(45, 90, 76, 0.13);
  border-bottom: 1px solid rgba(45, 90, 76, 0.13);
}

.filing-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filing-kpis > div {
  min-height: 70px;
  background: #f7faf6;
}

.filing-kpis strong {
  font-size: 17px;
}

.mini-chart-shell {
  min-width: 0;
  margin-top: 12px;
}

.mini-chart-head {
  align-items: center;
}

.mini-chart-head > div:first-child strong,
.mini-chart-head > div:first-child span {
  display: block;
}

.mini-chart-head > div:first-child strong {
  color: #284e43;
  font-size: 10px;
}

.mini-chart-head > div:first-child span {
  margin-top: 3px;
  color: #71827b;
  font-size: 8px;
}

.chart-tabs {
  display: inline-flex;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border: 1px solid rgba(44, 102, 84, 0.17);
  border-radius: 6px;
  background: #fffef9;
}

.chart-tabs button {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #65766f;
  cursor: pointer;
  font-size: 8px;
  font-weight: 850;
  white-space: nowrap;
}

.chart-tabs button:hover,
.chart-tabs button.selected {
  background: #1d8068;
  color: #ffffff;
}

.line-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 7px;
  overflow: visible;
}

.chart-gridline {
  stroke: rgba(53, 91, 78, 0.13);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-area {
  fill: rgba(45, 134, 109, 0.11);
}

.chart-line {
  fill: none;
  stroke: #26836b;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

#filingTrendDots circle {
  fill: #fffef9;
  stroke: #26836b;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-periods {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0;
  margin-top: -5px;
  color: #7b8a84;
  font-size: 7px;
  text-align: center;
}

.chart-footnote {
  margin: 8px 0 0;
  color: #75867f;
  font-size: 8px;
  line-height: 1.5;
}

.company-compare-band {
  margin-top: 12px;
}

.company-kpis {
  margin-bottom: 12px;
}

.peer-bar-chart {
  display: grid;
  gap: 9px;
  padding: 12px 0 3px;
}

.peer-bar-row {
  display: grid;
  grid-template-columns: 90px minmax(120px, 1fr) 58px;
  gap: 10px;
  align-items: center;
}

.peer-bar-row strong,
.peer-bar-row b {
  color: #486158;
  font-size: 9px;
}

.peer-bar-row b {
  color: #1a6f5b;
  text-align: right;
}

.peer-bar-row > span {
  height: 12px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(68, 98, 87, 0.1);
}

.peer-bar-row i {
  display: block;
  width: var(--peer);
  height: 100%;
  border-radius: inherit;
  background: var(--peer-color);
  transition: width 220ms ease;
}

.backtest-chart-shell {
  margin: 12px 0 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(44, 90, 75, 0.13);
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #6f8179;
  font-size: 7px;
}

.chart-legend span {
  width: 16px;
  height: 3px;
  border-radius: 2px;
}

.chart-legend span.strategy { background: #26836b; }
.chart-legend span.benchmark { background: #5378a9; }

.quant-equity-chart {
  margin-top: 4px;
}

.quant-equity-chart .benchmark-line {
  stroke: #5378a9;
  stroke-width: 2;
}

.oos-zone {
  fill: rgba(182, 122, 39, 0.1);
}

.oos-label {
  fill: #9a6b29;
  font-size: 9px;
  font-weight: 900;
}

.chart-periods.compact {
  margin-top: -2px;
}

.theme-scatter,
.risk-quadrant {
  position: relative;
  height: 250px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgba(45, 91, 76, 0.14);
  background: #fffef9;
}

.scatter-mid,
.quadrant-mid {
  position: absolute;
  display: block;
  background: rgba(48, 92, 77, 0.14);
}

.scatter-mid.vertical,
.quadrant-mid.vertical {
  top: 14px;
  bottom: 30px;
  left: 50%;
  width: 1px;
}

.scatter-mid.horizontal,
.quadrant-mid.horizontal {
  right: 20px;
  bottom: 50%;
  left: 32px;
  height: 1px;
}

.scatter-axis,
.quadrant-axis {
  position: absolute;
  z-index: 2;
  color: #7c8b85;
  font-size: 8px;
  font-weight: 850;
}

.scatter-axis.y,
.quadrant-axis.y {
  top: 10px;
  left: 10px;
}

.scatter-axis.x,
.quadrant-axis.x {
  right: 12px;
  bottom: 8px;
}

.scatter-dot,
.risk-point {
  position: absolute;
  left: var(--x);
  bottom: var(--y);
  z-index: 3;
  min-width: 86px;
  min-height: 38px;
  padding: 5px 7px;
  border: 1px solid rgba(35, 100, 80, 0.24);
  border-radius: 7px;
  background: #eaf5ef;
  color: #174d3f;
  cursor: pointer;
  text-align: left;
  transform: translate(-50%, 50%);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.scatter-dot:hover,
.scatter-dot:focus-visible,
.risk-point:hover,
.risk-point:focus-visible {
  z-index: 5;
  box-shadow: 0 8px 22px rgba(40, 89, 73, 0.16);
  transform: translate(-50%, 50%) scale(1.04);
}

.scatter-dot strong,
.scatter-dot span,
.risk-point b,
.risk-point small {
  display: block;
}

.scatter-dot strong,
.risk-point b {
  font-size: 9px;
}

.scatter-dot span,
.risk-point small {
  margin-top: 2px;
  color: #5f766d;
  font-size: 7px;
}

.scatter-dot.internet { background: #eef3fa; border-color: rgba(69, 106, 155, 0.24); }
.scatter-dot.broad { background: #fff6e7; border-color: rgba(171, 113, 35, 0.25); }
.scatter-dot.bond { background: #f2effa; border-color: rgba(111, 94, 174, 0.23); }

.etf-compare-table {
  overflow-x: auto;
  border: 1px solid rgba(44, 90, 75, 0.14);
  background: #fffef9;
}

.etf-compare-row {
  display: grid;
  grid-template-columns: 90px repeat(4, minmax(112px, 1fr));
  min-width: 620px;
  border-bottom: 1px solid rgba(44, 90, 75, 0.1);
}

.etf-compare-row:last-child {
  border-bottom: 0;
}

.etf-compare-row > * {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid rgba(44, 90, 75, 0.09);
}

.etf-compare-row > *:last-child {
  border-right: 0;
}

.etf-compare-row.header {
  background: #eaf2ed;
  color: #51685f;
  font-size: 8px;
  font-weight: 900;
}

.etf-compare-row > strong {
  color: #173f34;
  font-size: 10px;
}

.etf-compare-row > span b,
.etf-compare-row > span i {
  display: block;
}

.etf-compare-row > span b {
  color: #31594e;
  font-size: 9px;
}

.etf-compare-row > span i {
  position: relative;
  height: 5px;
  margin-top: 6px;
  border-radius: 3px;
  background: rgba(62, 96, 84, 0.1);
}

.etf-compare-row > span i::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value);
  border-radius: inherit;
  content: "";
  background: var(--bar);
}

.risk-quadrant {
  height: 270px;
}

.risk-point {
  min-width: 72px;
  background: #fff4e7;
  border-color: rgba(183, 105, 40, 0.25);
}

.risk-point.financial,
.risk-point.tracking {
  background: #fdecea;
  border-color: rgba(192, 78, 65, 0.28);
}

.risk-point.model { background: #eef3fa; border-color: rgba(69, 106, 155, 0.24); }
.risk-point.liquidity { background: #eaf5ef; border-color: rgba(35, 100, 80, 0.24); }

.coverage-bars {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(44, 90, 75, 0.14);
  background: #fffef9;
}

.coverage-bars > div {
  display: grid;
  grid-template-columns: 80px minmax(140px, 1fr) 42px 120px;
  gap: 10px;
  align-items: center;
}

.coverage-bars strong,
.coverage-bars b,
.coverage-bars small {
  font-size: 9px;
}

.coverage-bars strong { color: #385d52; }
.coverage-bars b { color: #1c6e59; text-align: right; }
.coverage-bars small { color: #778780; }

.coverage-bars > div > span {
  height: 9px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(61, 95, 83, 0.11);
}

.coverage-bars i {
  display: block;
  width: var(--coverage);
  height: 100%;
  border-radius: inherit;
  background: var(--tone);
}

.audit-run-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 170px;
  margin-top: 12px;
  padding: 18px 14px 10px;
  border: 1px solid rgba(44, 90, 75, 0.14);
  background: #fffef9;
}

.audit-run-chart > div {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 4px;
  align-items: end;
  height: 100%;
  text-align: center;
}

.audit-run-chart i {
  display: block;
  width: min(30px, 72%);
  height: var(--pass);
  margin: 0 auto;
  border-radius: 4px 4px 1px 1px;
  background: #2d866d;
}

.audit-run-chart b {
  color: #1d6f5a;
  font-size: 9px;
}

.audit-run-chart span {
  color: #7a8a83;
  font-size: 7px;
}

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

.gate-grid > div {
  min-width: 0;
  min-height: 118px;
  padding: 11px;
  border: 1px solid rgba(44, 90, 75, 0.14);
  background: #fffef9;
}

.gate-grid span,
.gate-grid strong,
.gate-grid i,
.gate-grid small {
  display: block;
}

.gate-grid span {
  color: #5d7169;
  font-size: 9px;
  font-weight: 850;
}

.gate-grid strong {
  margin-top: 9px;
  color: #173e33;
  font-size: 18px;
}

.gate-grid i,
.control-score-grid i {
  position: relative;
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(59, 94, 82, 0.1);
}

.gate-grid i b {
  display: block;
  width: var(--gate);
  height: 100%;
  background: #2d866d;
}

.gate-grid small {
  margin-top: 8px;
  color: #778780;
  font-size: 8px;
  line-height: 1.4;
}

.control-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.control-score-grid > div {
  min-height: 95px;
  padding: 11px;
  border: 1px solid rgba(44, 90, 75, 0.14);
  background: #fffef9;
}

.control-score-grid span,
.control-score-grid strong,
.control-score-grid i {
  display: block;
}

.control-score-grid span {
  color: #5f736b;
  font-size: 9px;
  font-weight: 850;
}

.control-score-grid strong {
  margin-top: 10px;
  color: #173f34;
  font-size: 18px;
}

.control-score-grid i b {
  display: block;
  width: var(--control);
  height: 100%;
  background: var(--tone);
}

@media (max-width: 1120px) {
  .gate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .quant-module-band {
    margin-right: -12px;
    margin-left: -12px;
    padding: 14px 12px;
  }

  .module-kpi-grid,
  .control-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quant-band-head,
  .mini-chart-head {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-tabs {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .chart-tabs::-webkit-scrollbar {
    display: none;
  }

  .chart-tabs button {
    flex: 1 0 auto;
    min-height: 34px;
  }

  .peer-bar-row {
    grid-template-columns: 72px minmax(90px, 1fr) 48px;
  }

  .theme-scatter,
  .risk-quadrant {
    height: 230px;
  }

  .scatter-dot,
  .risk-point {
    min-width: 68px;
    padding: 4px 5px;
  }

  .coverage-bars > div {
    grid-template-columns: 62px minmax(80px, 1fr) 38px;
  }

  .coverage-bars small {
    grid-column: 2 / -1;
  }

  .audit-run-chart {
    gap: 4px;
    height: 150px;
    padding-right: 8px;
    padding-left: 8px;
  }

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

@media (max-width: 420px) {
  .module-kpi-grid > div {
    min-height: 76px;
    padding: 9px;
  }

  .module-kpi-grid strong {
    font-size: 17px;
  }

  .chart-periods {
    font-size: 6px;
  }

  .theme-scatter,
  .risk-quadrant {
    height: 260px;
  }

  .scatter-dot,
  .risk-point {
    min-width: 60px;
  }

  .scatter-dot strong,
  .risk-point b {
    font-size: 8px;
  }

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

  .gate-grid > div {
    min-height: 108px;
  }
}

/* Quant-first terminal layout */

.quant-tape {
  grid-template-columns: 72px repeat(6, minmax(124px, 1fr));
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.quant-tape > div {
  min-height: 48px;
  padding: 6px 8px;
  border-radius: 5px;
  box-shadow: none;
}

.quant-tape .tape-status {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  border-color: rgba(31, 128, 107, 0.26);
  background: #e9f3ee;
}

.quant-tape .tape-status span,
.quant-tape .tape-status strong {
  font-size: 8px;
  line-height: 1.1;
}

.quant-tape .ticker-cell {
  display: grid;
  grid-template-columns: minmax(50px, 1fr) auto 40px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 7px;
  font-variant-numeric: tabular-nums;
}

.quant-tape .ticker-cell span {
  overflow: hidden;
  color: #526860;
  font-size: 8px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quant-tape .ticker-cell strong {
  color: #173e34;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.quant-tape .ticker-cell b {
  grid-column: 1 / 3;
  color: #2d866d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.quant-tape .ticker-cell.down b { color: #b95d54; }
.quant-tape .ticker-cell.rates b { color: #a46d26; }

.quant-tape .ticker-cell svg {
  grid-column: 3;
  grid-row: 1 / 3;
  width: 40px;
  height: 20px;
}

.quant-tape .ticker-cell polyline {
  fill: none;
  stroke: #2d866d;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.quant-tape .ticker-cell.down polyline { stroke: #b95d54; }
.quant-tape .ticker-cell.rates polyline { stroke: #a46d26; }

.market-cockpit {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(240px, 0.65fr);
  margin-bottom: 12px;
  border: 1px solid rgba(38, 83, 69, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 252, 0.92);
  box-shadow: 0 10px 26px rgba(41, 73, 59, 0.07);
  overflow: hidden;
}

.cockpit-chart-pane {
  min-width: 0;
  padding: 13px 15px 10px;
  border-right: 1px solid rgba(38, 83, 69, 0.13);
}

.cockpit-head,
.regime-head,
.market-chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cockpit-head h3,
.regime-head h3 {
  margin-top: 2px;
  color: #163f34;
  font-size: 14px;
}

.market-period-tabs {
  flex: 0 0 auto;
}

.market-period-tabs button {
  min-width: 38px;
  min-height: 29px;
}

.market-series-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 10px 0 5px;
}

.market-series-legend button {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid rgba(48, 89, 75, 0.13);
  border-radius: 5px;
  color: #65766f;
  background: #f8faf7;
  cursor: pointer;
  opacity: 0.52;
}

.market-series-legend button.selected {
  border-color: rgba(48, 89, 75, 0.25);
  background: #ffffff;
  opacity: 1;
}

.market-series-legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--series);
}

.market-series-legend span {
  overflow: hidden;
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-series-legend strong {
  color: #234c40;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.market-chart-shell {
  min-height: 0;
  border-top: 1px solid rgba(44, 86, 72, 0.1);
  border-bottom: 1px solid rgba(44, 86, 72, 0.1);
  background: linear-gradient(rgba(246, 249, 245, 0.64), rgba(255, 255, 252, 0.24));
}

.market-performance-chart {
  display: block;
  width: 100%;
  aspect-ratio: 720 / 250;
  min-height: 185px;
}

.market-performance-chart .chart-grid line,
.market-zero-line {
  stroke: rgba(52, 88, 75, 0.12);
  stroke-width: 1;
}

.market-zero-line {
  stroke: rgba(44, 89, 74, 0.28);
  stroke-dasharray: 4 4;
}

.market-axis-labels text {
  fill: #89958f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.market-series {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: opacity 160ms ease;
}

.market-series.a { stroke: #2d866d; }
.market-series.hk { stroke: #4a75a8; }
.market-series.us { stroke: #b67a27; }
.market-series.tw { stroke: #b65b62; }
.market-series.is-hidden { opacity: 0; }

.market-chart-foot {
  min-height: 30px;
  padding-top: 6px;
  color: #48675d;
  font-size: 9px;
  font-weight: 750;
}

.market-chart-foot small {
  color: #85918b;
  font-size: 8px;
}

.regime-pane {
  min-width: 0;
  padding: 13px 14px;
  background: #f8faf6;
}

.regime-head {
  align-items: flex-start;
}

.regime-score {
  width: 68px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at center, #f8faf6 56%, transparent 57%), conic-gradient(#2d866d 0 64%, #dfe7e1 64% 100%);
  text-align: center;
}

.regime-score strong,
.regime-score span {
  display: block;
}

.regime-score strong {
  color: #1c5f4f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
}

.regime-score span {
  color: #6a7c74;
  font-size: 7px;
  font-weight: 800;
}

.regime-metrics {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

.regime-metrics > div {
  display: grid;
  grid-template-columns: minmax(75px, 1fr) 38px;
  gap: 3px 7px;
  align-items: center;
}

.regime-metrics span,
.regime-metrics small {
  color: #64766e;
  font-size: 8px;
}

.regime-metrics b {
  color: #274f43;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-align: right;
}

.regime-metrics i {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 2px;
  background: #e2e9e4;
  overflow: hidden;
}

.regime-metrics em {
  display: block;
  width: var(--regime);
  height: 100%;
  background: var(--tone);
}

.regime-metrics small {
  grid-column: 1 / -1;
}

.regime-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid rgba(45, 87, 73, 0.14);
  color: #6d7d76;
  font-size: 8px;
}

.regime-footer strong {
  color: #a16a26;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.priority-table-head,
.priority-row {
  grid-template-columns: 22px minmax(90px, 1fr) 38px 40px 58px 44px;
  gap: 4px;
}

.priority-table-head span:nth-child(n + 3) {
  text-align: right;
}

.priority-row {
  min-width: 0;
  min-height: 54px;
  font-variant-numeric: tabular-nums;
}

.priority-list {
  min-width: 0;
}

.priority-move,
.priority-vol {
  color: #6f8078;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  text-align: right;
}

.priority-move.positive { color: #2d866d; }
.priority-move.negative { color: #b95d54; }

.priority-spark svg {
  display: block;
  width: 58px;
  height: 28px;
}

.priority-spark polyline {
  fill: none;
  stroke: #2d866d;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.priority-spark.negative polyline { stroke: #b95d54; }

.brief-item {
  grid-template-columns: 62px 50px minmax(190px, 1fr) minmax(196px, 0.58fr) minmax(120px, 0.36fr) 78px;
  gap: 10px;
  padding: 11px 13px;
}

.brief-quant {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  border: 1px solid rgba(43, 88, 73, 0.13);
  border-radius: 5px;
  background: #fbfcf9;
}

.brief-quant > span {
  min-width: 0;
  padding: 7px 6px;
  border-right: 1px solid rgba(43, 88, 73, 0.1);
}

.brief-quant > span:last-child { border-right: 0; }

.brief-quant small,
.brief-quant strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-quant small {
  color: #829089;
  font-size: 7px;
  font-weight: 850;
}

.brief-quant strong {
  margin-top: 3px;
  color: #276f5c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.brief-quant strong.negative { color: #b95d54; }

body[data-density-mode="quant"] .global-scope .scope-intro p,
body[data-density-mode="quant"] .scope-detail p,
body[data-density-mode="quant"] .view-head > div > p:not(.section-kicker),
body[data-density-mode="quant"] .decision-head p,
body[data-density-mode="quant"] .pane-intro,
body[data-density-mode="quant"] .scenario-controls > p,
body[data-density-mode="quant"] .brief-copy > p:last-child,
body[data-density-mode="quant"] .panel-header p,
body[data-density-mode="quant"] .feed-copy p,
body[data-density-mode="quant"] .research-rules span,
body[data-density-mode="quant"] .prototype-status span:last-child {
  display: none;
}

body[data-density-mode="quant"] .global-scope {
  min-height: 0;
  padding-top: 9px;
  padding-bottom: 9px;
}

body[data-density-mode="quant"] .scope-intro h2 {
  margin-bottom: 0;
  font-size: 16px;
}

body[data-density-mode="quant"] .scope-detail {
  min-height: 50px;
  padding-top: 7px;
  padding-bottom: 7px;
}

body[data-density-mode="quant"] .view-head {
  margin-bottom: 9px;
}

body[data-density-mode="quant"] .prototype-status {
  min-height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
}

body[data-density-mode="quant"] .decision-head {
  padding-bottom: 8px;
}

body[data-density-mode="quant"] .brief-item {
  grid-template-columns: 54px 46px minmax(180px, 1fr) minmax(196px, 0.62fr) 76px;
}

body[data-density-mode="quant"] .brief-next {
  display: none;
}

body[data-density-mode="quant"] .priority-detail p:first-of-type {
  display: none;
}

body[data-density-mode="quant"] .feed-item {
  min-height: 54px;
}

@media (max-width: 1180px) {
  .market-cockpit {
    grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.7fr);
  }

  .priority-table-head,
  .priority-row {
    grid-template-columns: 22px minmax(100px, 1fr) 38px 40px 62px 46px;
  }

  .priority-spark svg {
    width: 62px;
  }

  .brief-item,
  body[data-density-mode="quant"] .brief-item {
    grid-template-columns: 50px 44px minmax(170px, 1fr) minmax(180px, 0.65fr) 72px;
  }

  .brief-next { display: none; }
}

@media (max-width: 820px) {
  .market-cockpit {
    grid-template-columns: 1fr;
  }

  .cockpit-chart-pane {
    border-right: 0;
    border-bottom: 1px solid rgba(38, 83, 69, 0.13);
  }

  .regime-pane {
    display: grid;
    grid-template-columns: minmax(150px, 0.6fr) minmax(0, 1.4fr);
    gap: 14px;
  }

  .regime-metrics {
    grid-column: 2;
    grid-row: 1 / 3;
    margin-top: 0;
  }

  .regime-footer {
    align-self: end;
  }

  .priority-vol,
  .priority-table-head span:nth-child(4) {
    display: none;
  }

  .priority-table-head,
  .priority-row {
    grid-template-columns: 22px minmax(116px, 1fr) 42px 68px 48px;
  }
}

@media (max-width: 620px) {
  .top-actions .language-toggle {
    grid-column: 1;
    grid-row: 1;
  }

  .top-actions .search-box {
    grid-column: 2;
    grid-row: 1;
  }

  .top-actions .action-stack {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .quant-tape {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .market-cockpit {
    margin-right: -12px;
    margin-left: -12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .cockpit-chart-pane,
  .regime-pane {
    padding-right: 12px;
    padding-left: 12px;
  }

  .cockpit-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .cockpit-head > div:first-child {
    min-width: 0;
  }

  .cockpit-head .market-period-tabs {
    width: 100%;
  }

  .market-series-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-performance-chart {
    min-height: 155px;
  }

  .market-chart-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .regime-pane {
    display: block;
  }

  .regime-head {
    align-items: center;
  }

  .regime-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .regime-metrics > div {
    min-width: 0;
  }

  .priority-table-head {
    display: grid;
  }

  .priority-table-head span:nth-child(4),
  .priority-table-head span:nth-child(5),
  .priority-vol,
  .priority-spark {
    display: none;
  }

  .priority-table-head,
  .priority-row {
    grid-template-columns: 20px minmax(0, 1fr) 42px 46px;
    gap: 5px;
  }

  .priority-table-head span:nth-child(6) {
    grid-column: 4;
  }

  .priority-name strong {
    white-space: normal;
  }

  .brief-item,
  body[data-density-mode="quant"] .brief-item {
    grid-template-columns: 44px minmax(0, 1fr) 62px;
    gap: 8px;
  }

  .brief-signal {
    display: none;
  }

  .brief-copy {
    grid-column: 2;
  }

  .brief-quant {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .evidence-btn {
    grid-column: 3;
    grid-row: 1;
  }

  .brief-next { display: none; }
}

/* Evidence search and institutional experiment control */
.evidence-workbench {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(41, 83, 69, 0.16);
}

.evidence-workbench-head,
.evidence-tools,
.experiment-console-head,
.experiment-actions,
.lineage-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.evidence-workbench-head h3,
.experiment-console-head h3 {
  margin-top: 2px;
  color: #173f34;
  font-size: 14px;
}

.evidence-tools {
  justify-content: flex-end;
}

.evidence-tools input {
  width: 152px;
  height: 31px;
  padding: 0 9px;
  border: 1px solid rgba(44, 89, 74, 0.18);
  border-radius: 5px;
  outline: 0;
  color: #254b40;
  background: #fbfcfa;
  font-size: 9px;
}

.evidence-tools input:focus {
  border-color: #2d866d;
  box-shadow: 0 0 0 2px rgba(45, 134, 109, 0.1);
}

.evidence-tabs button {
  min-height: 29px;
  padding-right: 9px;
  padding-left: 9px;
}

.evidence-matrix-table {
  margin-top: 9px;
  border-top: 1px solid rgba(44, 86, 72, 0.13);
}

.evidence-matrix-row {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) 62px 64px minmax(124px, 0.72fr) 72px;
  gap: 7px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 7px 5px;
  border: 0;
  border-bottom: 1px solid rgba(44, 86, 72, 0.1);
  color: #3c5a50;
  background: transparent;
  font-size: 9px;
  text-align: left;
}

button.evidence-matrix-row {
  position: relative;
  cursor: pointer;
}

button.evidence-matrix-row::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 2px;
  background: transparent;
  content: "";
}

button.evidence-matrix-row:hover,
button.evidence-matrix-row.selected {
  background: #f1f7f3;
}

button.evidence-matrix-row.selected::before { background: #2d866d; }
button.evidence-matrix-row.challenge.selected::before { background: #b66a35; }

.evidence-matrix-row.header {
  min-height: 27px;
  color: #7a8983;
  background: #f7f9f6;
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.evidence-matrix-row > span,
.evidence-matrix-row > b {
  min-width: 0;
}

.evidence-matrix-row > b {
  color: #236c59;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.evidence-matrix-row.challenge > b { color: #ad6532; }

.evidence-matrix-row span strong,
.evidence-matrix-row span small {
  display: block;
}

.evidence-matrix-row span strong {
  color: #244b40;
  font-size: 9px;
}

.evidence-matrix-row span small {
  margin-top: 2px;
  color: #6f8179;
  font-size: 7px;
}

.evidence-matrix-row.support span small { color: #2d8069; }
.evidence-matrix-row.challenge span small { color: #ad6532; }

.evidence-source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confidence-cell {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}

.confidence-cell strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.confidence-cell i {
  height: 4px;
  border-radius: 2px;
  background: #e1e8e3;
  overflow: hidden;
}

.confidence-cell em {
  display: block;
  width: var(--confidence);
  height: 100%;
  background: #2d866d;
}

.evidence-selection {
  min-height: 40px;
  padding: 8px 6px;
  color: #46655b;
  background: #fbfcf9;
  font-size: 8px;
}

.evidence-selection span,
.evidence-selection strong {
  display: block;
}

.evidence-selection span { color: #72817b; }
.evidence-selection strong { margin-top: 3px; font-size: 9px; line-height: 1.45; }
.evidence-empty { padding: 20px; color: #7b8a84; font-size: 9px; text-align: center; }

.quant-lab-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
}

.quant-lab-tabs button {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 1px 7px;
  align-items: center;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid rgba(42, 87, 72, 0.15);
  border-radius: 6px;
  color: #62766e;
  background: #f8faf7;
  cursor: pointer;
  text-align: left;
}

.quant-lab-tabs button.selected {
  border-color: rgba(35, 126, 103, 0.34);
  background: #ebf4ef;
}

.quant-lab-tabs button > span {
  grid-row: 1 / 3;
  color: #2d866d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
}

.quant-lab-tabs strong { color: #264e42; font-size: 10px; }
.quant-lab-tabs small { color: #7d8b85; font-size: 7px; }

.experiment-console {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(38, 83, 69, 0.17);
  border-radius: 7px;
  background: rgba(255, 255, 252, 0.94);
  box-shadow: 0 10px 28px rgba(42, 72, 58, 0.07);
  scroll-margin-top: 16px;
}

.experiment-actions {
  justify-content: flex-end;
  color: #6f8078;
  font-size: 8px;
}

.experiment-actions button {
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid rgba(35, 122, 99, 0.24);
  border-radius: 5px;
  color: #ffffff;
  background: #1f806b;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
}

.experiment-actions button:disabled { cursor: wait; opacity: 0.7; }

.experiment-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-top: 11px;
}

.experiment-kpis > div {
  min-width: 0;
  min-height: 60px;
  padding: 8px;
  border: 1px solid rgba(44, 88, 73, 0.12);
  background: #f8faf7;
}

.experiment-kpis span,
.experiment-kpis strong,
.experiment-kpis small { display: block; }
.experiment-kpis span { color: #687a72; font-size: 8px; }
.experiment-kpis strong { margin-top: 4px; color: #235f50; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; }
.experiment-kpis small { margin-top: 2px; color: #8a9691; font-size: 7px; }

.experiment-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(240px, 0.65fr);
  margin-top: 8px;
  border-top: 1px solid rgba(42, 85, 71, 0.14);
  border-bottom: 1px solid rgba(42, 85, 71, 0.14);
}

.experiment-runs-pane {
  min-width: 0;
  padding: 7px 9px 7px 0;
  border-right: 1px solid rgba(42, 85, 71, 0.13);
}

.experiment-row {
  display: grid;
  grid-template-columns: 62px minmax(120px, 1fr) 54px 66px 38px 42px 52px 52px;
  gap: 5px;
  align-items: center;
  width: 100%;
  min-height: 43px;
  padding: 5px 6px;
  border: 0;
  border-bottom: 1px solid rgba(42, 85, 71, 0.09);
  color: #536a61;
  background: transparent;
  font-size: 8px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

button.experiment-row { cursor: pointer; }
button.experiment-row:hover,
button.experiment-row.selected { background: #edf5f0; }

.experiment-row.header {
  min-height: 26px;
  color: #7d8b85;
  background: #f7f9f6;
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.experiment-row > strong,
.experiment-row > b {
  color: #285b4d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
}

.experiment-row .drawdown { color: #ac5f55; }

.run-status {
  justify-self: start;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 7px;
  font-weight: 850;
}

.run-status.passed { color: #236c59; background: #e5f1eb; }
.run-status.review { color: #9a661f; background: #f7eedc; }
.run-status.failed { color: #aa584f; background: #f8e8e5; }
.run-status.running { color: #426d9d; background: #e8eef6; }

.experiment-detail-pane {
  min-width: 0;
  padding: 10px 0 10px 12px;
  scroll-margin-top: 16px;
}

.lineage-title {
  align-items: flex-start;
}

.lineage-title h4 {
  margin: 2px 0 0;
  color: #244b40;
  font-size: 12px;
}

.lineage-title > strong {
  color: #2d8069;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.lineage-flow {
  display: grid;
  gap: 0;
  margin-top: 9px;
}

.lineage-flow > div {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 2px 6px;
  min-height: 38px;
  padding: 5px 6px;
  border: 1px solid rgba(40, 87, 71, 0.13);
  background: #f8faf7;
}

.lineage-flow > div > span {
  grid-row: 1 / 3;
  color: #2d866d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  font-weight: 900;
}

.lineage-flow strong { color: #355b50; font-size: 8px; }
.lineage-flow small { overflow: hidden; color: #788680; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }

.lineage-flow > i {
  width: 1px;
  height: 7px;
  margin-left: 16px;
  background: #8eb6aa;
}

.lineage-warning {
  margin-top: 8px;
  padding: 7px;
  border-left: 2px solid #b67a27;
  color: #7b633e;
  background: #faf5e9;
  font-size: 8px;
  line-height: 1.4;
}

.compute-queue {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.compute-queue > div {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 32px;
  gap: 3px 6px;
  align-items: center;
  color: #66786f;
  font-size: 7px;
}

.compute-queue b { color: #32594d; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: right; }
.compute-queue i { grid-column: 1 / -1; height: 4px; background: #e1e8e3; overflow: hidden; }
.compute-queue em { display: block; width: var(--compute); height: 100%; background: #4a75a8; transition: width 260ms ease; }

.model-registry-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 9px;
}

.model-registry-strip > div {
  min-width: 0;
  padding: 7px;
  border-left: 2px solid rgba(45, 134, 109, 0.42);
  background: #f8faf7;
}

.model-registry-strip span,
.model-registry-strip strong,
.model-registry-strip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-registry-strip span { color: #74847d; font-size: 7px; }
.model-registry-strip strong { margin-top: 3px; color: #2e574a; font-size: 9px; }
.model-registry-strip small { margin-top: 2px; color: #89958f; font-size: 7px; }

body[data-density-mode="quant"] .analysis-block {
  padding-top: 8px;
  padding-bottom: 8px;
}

body[data-density-mode="quant"] .analysis-block p:nth-of-type(2) {
  display: none;
}

@media (max-width: 960px) {
  .experiment-lab-grid {
    grid-template-columns: 1fr;
  }

  .experiment-runs-pane {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(42, 85, 71, 0.13);
  }

  .experiment-detail-pane {
    padding-left: 0;
  }

  .lineage-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
  }

  .lineage-flow > i {
    display: none;
  }
}

@media (max-width: 720px) {
  .evidence-workbench-head,
  .evidence-tools,
  .experiment-console-head {
    align-items: stretch;
    flex-direction: column;
  }

  .evidence-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
  }

  .evidence-tools input {
    width: 132px;
  }

  .evidence-matrix-row {
    grid-template-columns: minmax(140px, 1fr) 56px 64px;
    grid-template-rows: auto auto;
  }

  .evidence-matrix-row.header span:nth-child(3),
  .evidence-matrix-row.header span:nth-child(4),
  .evidence-matrix-row:not(.header) > span:nth-child(3) {
    display: none;
  }

  .evidence-matrix-row.header span:nth-child(5) { grid-column: 3; }
  .evidence-matrix-row:not(.header) .evidence-source { grid-column: 1 / 3; grid-row: 2; font-size: 7px; }
  .evidence-matrix-row:not(.header) .confidence-cell { grid-column: 3; grid-row: 1 / 3; }

  .quant-lab-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .experiment-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .experiment-kpis > div:last-child {
    grid-column: 1 / -1;
  }

  .experiment-row {
    grid-template-columns: 58px minmax(128px, 1fr) 38px 42px 52px;
  }

  .experiment-row > :nth-child(3),
  .experiment-row > :nth-child(4),
  .experiment-row > :nth-child(7) {
    display: none;
  }

  .lineage-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .model-registry-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .evidence-tools {
    grid-template-columns: 1fr;
  }

  .evidence-tools input {
    width: 100%;
  }

  .experiment-console {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .experiment-actions {
    align-items: stretch;
  }

  .experiment-row {
    grid-template-columns: 54px minmax(112px, 1fr) 36px 40px 49px;
    gap: 3px;
    padding-right: 2px;
    padding-left: 2px;
  }
}
