:root {
  color-scheme: light;
  --bg: #f5f4ef;
  --panel: #ffffff;
  --panel-2: #f0f5f1;
  --text: #1d2522;
  --muted: #69736f;
  --line: #d8ddd5;
  --green: #156f55;
  --red: #b9423b;
  --amber: #be7d19;
  --ink: #111816;
  --blue: #256785;
  --shadow: 0 18px 60px rgba(21, 28, 25, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(21, 111, 85, 0.08), transparent 38%),
    linear-gradient(320deg, rgba(190, 125, 25, 0.09), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
  max-width: 100vw;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.topbar,
.control-strip,
.summary-grid,
.chart-grid,
.research-grid {
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.guide-link,
.guide-back {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.77rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.guide-link:hover,
.guide-back:hover {
  border-color: rgba(21, 111, 85, 0.3);
  color: var(--green);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.75rem, 3vw, 3.15rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.status-pill,
.mini-badge,
.lane {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill {
  padding: 9px 12px;
}

.mini-badge,
.lane {
  padding: 6px 9px;
}

.lane {
  cursor: pointer;
  font-family: inherit;
}

.lane:hover,
.lane.active {
  border-color: rgba(21, 111, 85, 0.42);
  color: var(--green);
}

.lane.active {
  box-shadow: inset 0 0 0 1px rgba(21, 111, 85, 0.18);
}

.lane.pass,
.mini-badge.pass {
  border-color: rgba(21, 111, 85, 0.28);
  background: rgba(21, 111, 85, 0.1);
  color: var(--green);
}

.lane.fail,
.mini-badge.fail {
  border-color: rgba(185, 66, 59, 0.25);
  background: rgba(185, 66, 59, 0.1);
  color: var(--red);
}

.mini-badge.danger,
.ghost.danger {
  border-color: rgba(185, 66, 59, 0.3);
  background: rgba(185, 66, 59, 0.12);
  color: var(--red);
}

.control-strip {
  display: grid;
  grid-template-columns: minmax(150px, 1.6fr) repeat(4, minmax(92px, 0.75fr)) minmax(110px, 0.7fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 36px rgba(21, 28, 25, 0.08);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd2ca;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21, 111, 85, 0.14);
}

.symbol-box input {
  font-size: 1.2rem;
  font-weight: 850;
  text-transform: uppercase;
}

.primary,
.secondary,
.ghost,
.upload-label {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 13px;
  font-weight: 820;
}

.primary {
  background: var(--ink);
  color: #fff;
}

.primary:hover {
  background: #24312d;
}

.secondary,
.upload-label {
  background: #eef5f1;
  border-color: #cad9d1;
  color: var(--green);
}

.ghost {
  min-height: 34px;
  background: transparent;
  border-color: var(--line);
  color: var(--text);
  padding: 7px 10px;
}

.full {
  width: 100%;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.verdict-panel,
.metric,
.chart-panel,
.check-panel,
.panel,
.screen-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.verdict-panel,
.metric,
.panel,
.check-panel,
.screen-panel {
  padding: 16px;
}

.verdict-kicker,
.metric span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.verdict {
  margin-top: 8px;
  color: var(--ink);
  font-size: 2.05rem;
  font-weight: 900;
  letter-spacing: 0;
}

.verdict.qualifies {
  color: var(--green);
}

.verdict.watchlist {
  color: var(--amber);
}

.verdict.reject {
  color: var(--red);
}

.muted {
  color: var(--muted);
}

.metric {
  display: grid;
  align-content: space-between;
  min-height: 132px;
}

.metric strong {
  margin-top: 12px;
  color: var(--ink);
  font-size: 1.72rem;
  letter-spacing: 0;
}

.metric small {
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  min-height: 455px;
}

.risk-panel {
  display: grid;
  gap: 12px;
}

.risk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.risk-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 12px;
}

.risk-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 9px;
}

.risk-form label {
  min-width: 0;
}

.risk-form input,
.risk-form select {
  min-height: 40px;
}

.risk-form .r-multiple-field input {
  border-color: rgba(190, 125, 25, 0.45);
  background: #f8a91f;
  color: #111816;
  font-weight: 900;
  text-align: center;
}

.risk-output-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 8px;
}

.risk-output-grid article {
  display: grid;
  gap: 6px;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.risk-output-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.risk-output-grid strong {
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.risk-narrative {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.scenario-wrap {
  overflow-x: auto;
}

.scenario-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scenario-table th,
.scenario-table td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.scenario-table th:first-child,
.scenario-table td:first-child {
  text-align: center;
}

.scenario-table th {
  background: #10231d;
  color: #fff;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.scenario-table td {
  color: var(--text);
  font-size: 0.88rem;
}

.scenario-table tr.active td {
  background: rgba(248, 169, 31, 0.22);
  font-weight: 850;
}

.scenario-table tr:last-child td {
  border-bottom: 0;
}

.chart-panel {
  min-width: 0;
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head.tight {
  margin-bottom: 10px;
}

.panel-head p {
  margin-bottom: 0;
  font-size: 0.84rem;
}

.chart-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-view-toggle,
.chart-timeframe-toggle,
.chart-session-toggle,
.chart-zoom-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.chart-view-button,
.chart-timeframe-button,
.chart-session-button,
.chart-zoom-button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 0.77rem;
  font-weight: 850;
  white-space: nowrap;
}

.chart-view-button.active,
.chart-timeframe-button.active,
.chart-session-button.active {
  background: var(--ink);
  color: #ffffff;
}

.chart-zoom-label {
  min-width: 58px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.stream-toggle {
  white-space: nowrap;
}

.lane-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

canvas {
  display: block;
}

#priceCanvas {
  width: 100%;
  height: 360px;
  border: 1px solid #e2e5df;
  border-radius: 7px;
  background: #fbfcfa;
}

.copilot-panel {
  margin-top: 18px;
}

.authority-strip {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid #e2e5df;
  border-radius: 8px;
  background: #fbfcfa;
}

.authority-strip label {
  display: grid;
  gap: 4px;
  min-width: 170px;
}

.authority-strip label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.authority-strip select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 6px 9px;
}

.copilot-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.05fr) minmax(260px, 1fr);
  gap: 14px;
}

.copilot-voice,
.pattern-board,
.teaching-board,
.trade-plan-board {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.copilot-actions,
.paper-actions,
.pattern-board-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.voice-transcript {
  min-height: 112px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d9e4dd;
  border-radius: 8px;
  background: #f8faf8;
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.pattern-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.pattern-card {
  border: 1px solid #e2e5df;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.pattern-card.short {
  border-left-color: var(--red);
}

.pattern-card button {
  margin-top: 8px;
}

.pattern-card h4,
.teaching-board h3,
.trade-plan-board h3,
.pattern-board h3 {
  margin: 0;
}

.pattern-card p,
.pattern-lesson p,
.trade-plan-output p,
.paper-order-output p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.pattern-card small,
.pattern-lesson small,
.trade-plan-output small,
.paper-order-output small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.pattern-lesson,
.trade-plan-output,
.paper-order-output {
  margin-top: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.trade-plan-output {
  min-height: 112px;
}

.paper-actions {
  margin-top: 12px;
}

.paper-actions input {
  min-width: min(100%, 260px);
  flex: 1;
  height: 40px;
  border: 1px solid #cbd2ca;
  border-radius: 7px;
  padding: 0 10px;
  font: inherit;
}

.overlay-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.overlay-chip {
  border: 1px solid #cad9d1;
  border-radius: 999px;
  background: #f8faf8;
  color: var(--ink);
  padding: 5px 9px;
  font-size: 0.82rem;
}

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

.criterion {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fbfcfa;
}

.criterion.pass {
  border-left-color: var(--green);
}

.criterion.fail {
  border-left-color: var(--red);
}

.criterion .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.criterion strong {
  font-size: 0.9rem;
}

.criterion span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  text-align: right;
}

.criterion p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.research-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 12px;
}

.news-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.research-detail {
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.42;
}

.research-detail p {
  margin: 0;
  color: var(--muted);
}

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

.detail-grid div {
  display: grid;
  gap: 3px;
}

.detail-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
  text-transform: uppercase;
}

.detail-grid strong {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.25;
}

.news-item {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.news-item a {
  color: var(--ink);
  font-weight: 820;
  line-height: 1.28;
  text-decoration: none;
}

.news-item a:hover {
  color: var(--green);
}

.news-item small,
.term-row {
  color: var(--muted);
  font-size: 0.78rem;
}

.term-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.term {
  border-radius: 999px;
  background: rgba(190, 125, 25, 0.13);
  color: #8a5b14;
  padding: 3px 7px;
  font-weight: 750;
}

.reasoning {
  color: var(--text);
  line-height: 1.48;
}

.news-digest {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.news-digest-panel,
.news-digest-empty {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.news-digest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.news-digest h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.news-digest-head span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 760;
  text-align: right;
}

.news-digest-panel > p,
.news-digest-empty p {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.42;
}

.news-signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.news-signal-grid div {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid #e2e5df;
  border-radius: 8px;
  background: #ffffff;
}

.news-signal-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
  text-transform: uppercase;
}

.news-signal-grid strong {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.34;
}

.digest-headlines,
.reasoning-check-list {
  display: grid;
  gap: 8px;
}

.digest-headlines h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.digest-headline,
.reasoning-check-list div {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid #e2e5df;
  border-radius: 8px;
  background: #ffffff;
}

.digest-headline a,
.digest-headline strong {
  color: var(--ink);
  font-weight: 820;
  line-height: 1.25;
  text-decoration: none;
}

.digest-headline a:hover {
  color: var(--green);
}

.digest-headline small,
.digest-headline p,
.reasoning-check-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.34;
}

.reasoning-check-list span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
  text-transform: uppercase;
}

.reasoning-check-list strong {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.3;
}

.reasoning-check-list .pass {
  border-left: 4px solid var(--green);
}

.reasoning-check-list .fail {
  border-left: 4px solid var(--red);
}

.next-checks {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.screen-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-height: calc(100vh - 36px);
  position: sticky;
  top: 18px;
}

.screen-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vision-key-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #d9e4dd;
  border-radius: 8px;
  background: #f7fbf8;
}

.vision-key-form label {
  min-width: 0;
}

.vision-key-form input {
  min-height: 38px;
}

.vision-key-form button {
  min-height: 38px;
  padding: 8px 10px;
  white-space: nowrap;
}

.vision-key-form small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
}

.vision-key-form small.key-error {
  color: var(--red);
  font-weight: 760;
}

.upload-label {
  display: grid;
  place-items: center;
  min-height: 42px;
  text-align: center;
  text-transform: none;
}

.upload-label input {
  display: none;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
  border: 1px dashed #b8c4bd;
  border-radius: 8px;
  background: #fbfcfa;
  overflow: hidden;
}

#screenCanvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #edf0ec;
}

#screenEmpty {
  position: absolute;
  inset: auto 16px 16px;
  margin-bottom: 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
}

.vision-output {
  flex: 1;
  min-height: 170px;
  max-height: 430px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101816;
  color: #d8f3e5;
  padding: 12px;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.82rem;
}

.guide-shell {
  width: min(980px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.guide-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.guide-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 42px);
}

.guide-page h1 {
  margin-bottom: 10px;
}

.guide-page h2 {
  margin: 28px 0 10px;
  font-size: 1.28rem;
}

.guide-page p,
.guide-page li,
.guide-page dd {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.58;
}

.guide-lede {
  max-width: 740px;
  color: var(--muted);
  font-size: 1.12rem;
}

.guide-callout {
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: rgba(190, 125, 25, 0.1);
  padding: 12px 14px;
  font-weight: 760;
}

.guide-definitions {
  display: grid;
  grid-template-columns: minmax(130px, 0.32fr) minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
}

.guide-definitions dt {
  color: var(--ink);
  font-weight: 900;
}

.guide-definitions dd {
  margin: 0;
  color: var(--muted);
}

.guide-page ol,
.guide-page ul {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
  padding-left: 22px;
}

.site-body {
  background:
    linear-gradient(180deg, rgba(17, 24, 22, 0.02), rgba(37, 103, 133, 0.06)),
    #f7f7f3;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(17, 24, 22, 0.08);
  background: rgba(247, 247, 243, 0.9);
  backdrop-filter: blur(16px);
}

.site-brand {
  display: inline-grid;
  gap: 1px;
  color: var(--ink);
  text-decoration: none;
}

.site-brand span {
  font-size: 1.1rem;
  font-weight: 920;
}

.site-brand small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.site-nav nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.site-nav nav a,
.site-nav-cta {
  border-radius: 999px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 820;
  text-decoration: none;
  padding: 9px 12px;
}

.site-nav nav a:hover,
.site-nav nav a[aria-current="page"] {
  background: rgba(37, 103, 133, 0.1);
  color: var(--blue);
}

.site-nav-cta {
  justify-self: end;
  border: 1px solid rgba(17, 24, 22, 0.14);
  background: var(--ink);
  color: #fff;
}

.site-hero {
  position: relative;
  min-height: min(760px, calc(100vh - 70px));
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: clamp(76px, 10vw, 132px) clamp(18px, 6vw, 86px);
  isolation: isolate;
}

.site-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(247, 247, 243, 0.98) 0%, rgba(247, 247, 243, 0.9) 44%, rgba(247, 247, 243, 0.36) 100%),
    linear-gradient(180deg, rgba(21, 111, 85, 0.14), rgba(37, 103, 133, 0.1));
}

.site-hero-copy {
  width: min(680px, 100%);
  position: relative;
  z-index: 2;
}

.site-hero h1,
.page-hero h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(2.8rem, 7vw, 6.6rem);
  line-height: 0.95;
}

.site-lede {
  max-width: 700px;
  color: #38433f;
  font-size: clamp(1.02rem, 1.8vw, 1.28rem);
  line-height: 1.55;
}

.site-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
}

.site-cta-row.center {
  justify-content: center;
}

.site-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 142px;
  text-decoration: none;
}

.site-legal-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.product-shot {
  position: absolute;
  right: clamp(18px, 6vw, 88px);
  top: 50%;
  z-index: -1;
  width: min(540px, 46vw);
  min-height: 520px;
  transform: translateY(-47%) rotate(-2deg);
  display: grid;
  align-content: space-between;
  gap: 18px;
  margin: 0;
  border: 1px solid rgba(17, 24, 22, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 34px 100px rgba(17, 24, 22, 0.16);
  padding: 18px;
}

.product-shot-top,
.risk-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.product-shot-top span,
.product-shot-top strong,
.product-shot-top small,
.risk-strip div,
.mentor-card {
  border: 1px solid rgba(17, 24, 22, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.product-shot-top strong {
  color: var(--amber);
}

.product-shot-top small {
  color: var(--green);
  font-weight: 900;
}

.mini-chart {
  display: flex;
  align-items: end;
  gap: 9px;
  min-height: 220px;
  border: 1px solid rgba(17, 24, 22, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(rgba(17, 24, 22, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 22, 0.04) 1px, transparent 1px),
    #fbfcfa;
  background-size: 100% 44px, 54px 100%;
  padding: 16px;
}

.mini-chart span {
  flex: 1;
  min-width: 12px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--green), #2a8e72);
}

.mini-chart span:nth-child(3n) {
  background: linear-gradient(180deg, var(--amber), #d89a3a);
}

.mentor-card p:last-child,
.risk-strip span {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.risk-strip div {
  display: grid;
  gap: 4px;
}

.risk-strip strong {
  font-size: 1.1rem;
}

.site-section,
.site-band,
.site-page {
  padding: clamp(42px, 8vw, 92px) clamp(18px, 6vw, 86px);
}

.site-page {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.section-head {
  max-width: 760px;
  margin-bottom: 26px;
}

.section-head h2,
.site-band h2,
.final-cta h2,
.sample-output h2,
.setup-list h2 {
  color: var(--ink);
  font-size: clamp(1.8rem, 3.4vw, 3.4rem);
  line-height: 1;
}

.workflow-grid,
.split-grid,
.pricing-grid,
.connector-grid,
.policy-grid,
.account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.workflow-grid article,
.split-grid article,
.pricing-grid article,
.connector-grid article,
.policy-grid article,
.account-grid article,
.journal-preview article,
.sample-output,
.setup-list,
.demo-flow article {
  border: 1px solid rgba(17, 24, 22, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 42px rgba(17, 24, 22, 0.07);
  padding: 20px;
}

.workflow-grid span,
.demo-flow span,
.plan-kicker,
.journal-preview span {
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.workflow-grid h3,
.split-grid h3,
.pricing-grid h2,
.connector-grid h2,
.policy-grid h2,
.account-grid h2,
.demo-flow h2,
.journal-preview h2 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 1.1rem;
}

.workflow-grid p,
.split-grid p,
.pricing-grid p,
.connector-grid p,
.policy-grid p,
.account-grid p,
.demo-flow p,
.journal-preview p,
.sample-output p,
.setup-list li {
  color: #4c5652;
  line-height: 1.52;
}

.site-band {
  background: #edf3ef;
}

.site-band > div:first-child {
  max-width: 860px;
  margin-bottom: 24px;
}

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

.split-grid a {
  color: var(--green);
  font-weight: 850;
  text-decoration: none;
}

.final-cta {
  text-align: center;
}

.final-cta h2 {
  max-width: 760px;
  margin: 0 auto;
}

.page-hero {
  padding: 34px 0 28px;
}

.page-hero.compact {
  padding-bottom: 18px;
}

.page-hero h1 {
  font-size: clamp(2.4rem, 5vw, 5rem);
}

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

.pricing-grid article {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pricing-grid strong {
  color: var(--ink);
  font-size: 1.45rem;
}

.pricing-grid ul,
.setup-list ol {
  display: grid;
  gap: 8px;
  margin: 4px 0 8px;
  padding-left: 20px;
}

.featured-plan {
  border-color: rgba(21, 111, 85, 0.32) !important;
  background: #f8fffb !important;
}

.demo-flow {
  display: grid;
  gap: 14px;
}

.sample-output,
.setup-list,
.journal-preview {
  margin-top: 18px;
}

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

.disclosure-page .policy-grid article {
  border-left: 5px solid rgba(185, 66, 59, 0.55);
}

.account-panel {
  margin-bottom: 16px;
  border: 1px solid rgba(17, 24, 22, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 42px rgba(17, 24, 22, 0.07);
  padding: 20px;
}

.account-panel h2 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 1.16rem;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.account-form textarea {
  width: 100%;
  min-height: 116px;
  border: 1px solid #cbd2ca;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 10px;
  font: inherit;
  resize: vertical;
}

.account-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21, 111, 85, 0.14);
  outline: none;
}

.account-form .wide-field {
  grid-column: 1 / -2;
}

.account-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.account-status-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(17, 24, 22, 0.1);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--ink);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-table td {
  color: #4c5652;
}

.admin-table td:nth-child(5) {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.admin-table td:nth-child(5) span,
.status-badge {
  border-radius: 999px;
  background: rgba(37, 103, 133, 0.08);
  color: var(--blue);
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 850;
}

.status-badge.ok {
  background: rgba(21, 111, 85, 0.1);
  color: var(--green);
}

.status-badge.attention {
  background: rgba(185, 66, 59, 0.1);
  color: #a13731;
}

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.connector-details {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(17, 24, 22, 0.1);
}

.connector-details h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.connector-details .compact-list {
  font-size: 0.9rem;
}

.connector-version-row {
  display: grid;
  gap: 4px;
}

.connector-version-row small {
  color: var(--muted);
  font-weight: 760;
}

.site-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.compact-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: #4c5652;
  line-height: 1.5;
}

.journal-preview {
  display: grid;
  gap: 14px;
}

.journal-preview #journalList {
  display: grid;
  gap: 14px;
}

.journal-preview small {
  color: var(--muted);
  font-weight: 780;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span {
  border: 1px solid rgba(21, 111, 85, 0.2);
  border-radius: 999px;
  background: rgba(21, 111, 85, 0.08);
  color: var(--green);
  padding: 4px 8px;
  text-transform: none;
}

.journal-outcome-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(17, 24, 22, 0.1);
}

.journal-outcome-form textarea {
  width: 100%;
  min-height: 74px;
  border: 1px solid #cbd2ca;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 10px;
  font: inherit;
  resize: vertical;
}

.journal-outcome-form .wide-field {
  grid-column: 1 / -2;
}

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

  .screen-panel {
    position: static;
    max-height: none;
  }
}

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

  .screen-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .site-nav {
    position: static;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .site-nav nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .site-nav-cta {
    justify-self: start;
  }

  .site-hero {
    min-height: auto;
    padding-top: 52px;
  }

  .site-hero::before {
    background:
      linear-gradient(180deg, rgba(247, 247, 243, 0.98), rgba(247, 247, 243, 0.82)),
      linear-gradient(180deg, rgba(21, 111, 85, 0.14), rgba(37, 103, 133, 0.1));
  }

  .product-shot {
    position: relative;
    right: auto;
    top: auto;
    z-index: 1;
    width: 100%;
    min-height: 420px;
    transform: none;
    margin-top: 28px;
  }

  .workflow-grid,
  .split-grid,
  .pricing-grid,
  .connector-grid,
  .policy-grid,
  .account-grid,
  .account-form,
  .journal-outcome-form {
    grid-template-columns: 1fr;
  }

  .account-form .wide-field,
  .journal-outcome-form .wide-field {
    grid-column: auto;
  }

  .account-status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .shell {
    padding: 12px;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-strip,
  .summary-grid,
  .chart-grid,
  .copilot-grid,
  .research-grid,
  .risk-workbench {
    grid-template-columns: 1fr;
  }

  .risk-form,
  .risk-output-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 108px;
  }

  .screen-actions {
    grid-template-columns: 1fr;
  }

  .detail-grid,
  .news-signal-grid {
    grid-template-columns: 1fr;
  }

  .vision-key-form {
    grid-template-columns: 1fr;
  }

  .risk-actions {
    width: 100%;
    justify-content: space-between;
  }

  .chart-actions,
  .chart-view-toggle,
  .chart-timeframe-toggle,
  .chart-session-toggle,
  .chart-zoom-toggle {
    width: 100%;
  }

  .chart-view-button,
  .chart-timeframe-button,
  .chart-session-button,
  .chart-zoom-button {
    flex: 1;
  }

  .guide-definitions {
    grid-template-columns: 1fr;
  }

  .guide-definitions dt {
    margin-top: 8px;
  }
}
