:root {
  color-scheme: dark;
  --bg: #0a1422;
  --panel: #111f30;
  --border: #293b50;
  --text: #edf3fa;
  --muted: #afbed0;
  --accent: #6fe1c5;
  --blue: #8bb9ff;
  --amber: #f2c98a;
  font: 16px/1.65 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg)
}

a {
  color: var(--accent);
  text-underline-offset: 4px
}

button,
input,
select {
  font: inherit
}

button,
.button {
  cursor: pointer;
  border: 1px solid #3c546b;
  background: #182b3e;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 16px;
  text-decoration: none;
  display: inline-block
}

button:hover,
.button:hover {
  border-color: var(--accent);
  background: #203a4a
}

button:disabled {
  opacity: .5;
  cursor: wait
}

.primary {
  background: var(--accent);
  color: #10222b;
  border-color: var(--accent);
  font-weight: 650
}

.primary:hover {
  background: #9fead8;
  color: #10222b
}

a,
button,
input,
select,
summary {
  outline-offset: 5px
}

:focus-visible {
  outline: 3px solid var(--accent)
}

.skip {
  position: absolute;
  top: -90px
}

.skip:focus {
  top: 10px;
  left: 10px;
  z-index: 10;
  background: var(--panel);
  padding: 10px
}

.masthead,
main {
  max-width: 1400px;
  margin: auto;
  padding: 0 4vw
}

.masthead {
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--border)
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 21px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.3
}

.brand small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  font-weight: 400
}

.mark {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 20px;
  font-weight: 650;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 3px
}

.header-links { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.header-links a { display: inline-flex; align-items: center; min-height: 44px; }

.hero { padding: 28px 0 16px; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 1.9px;
  color: var(--accent);
  font-weight: 650;
  margin: 0 0 14px
}

h1 {
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -.5px;
  margin: 0 0 8px
}

.lead { font-size: 16px; max-width: 75ch; color: var(--muted); margin: 0; }

.freshness {
  border-left: 3px solid var(--border);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px
}

.freshness strong {
  color: var(--accent)
}

.stale {
  border-color: var(--amber);
  color: var(--amber)
}

.workspace {
  scroll-margin-top: 22px
}

.workspace-heading { margin-bottom: 12px; }
.workspace-heading h2 { font-size: 20px; margin: 0; }

h2 {
  font-size: 26px;
  letter-spacing: -.45px;
  line-height: 1.35;
  margin: 0 0 12px
}

h3 {
  font-size: 20px;
  line-height: 1.45;
  margin: 0 0 13px
}

h4 {
  font-size: 17px;
  margin: 20px 0 6px
}

p {
  margin: 0 0 16px
}

.filters {
  display: flex;
  gap: 18px;
  align-items: end;
  flex-wrap: wrap;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px
}

#selection input, #selection select { font-size: 16px; }

.filters label {
  min-width: 190px;
  flex: 1
}

.filters label:first-child {
  flex: 1.6
}

label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550
}

select,
input {
  display: block;
  margin-top: 8px;
  width: 100%;
  background: #0a1625;
  border: 1px solid #40546a;
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 46px
}

input[type=range] {
  padding: 0;
  accent-color: var(--accent)
}

.scope {
  font-size: 14px;
  color: var(--muted);
  margin: 12px 0 8px
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  border-bottom: 1px solid var(--border);
  margin: 8px 0 24px
}

.steps button {
  min-height: 44px;
  font-size: 16px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 12px;
  color: var(--muted)
}

.steps button:hover { color: var(--text); background: var(--panel); }
.steps button[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 25px;
  min-width: 0;
  margin-bottom: 22px
}

.panel p:last-child {
  margin-bottom: 0
}

.grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 22px
}

.grid.equal {
  grid-template-columns: 1fr 1fr
}

.grid .panel {
  height: calc(100% - 22px)
}

.muted,
.note {
  color: var(--muted)
}

.note {
  font-size: 14px
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 20px 0 24px
}

.kpi {
  padding: 19px;
  background: #13273a;
  border: 1px solid var(--border);
  border-radius: 9px
}

.kpi span {
  display: block;
  font-size: 13px;
  color: var(--muted)
}

.kpi strong {
  display: block;
  font-size: 28px;
  letter-spacing: -.8px;
  margin: 7px 0;
  color: var(--text);
  font-variant-numeric: tabular-nums
}

.kpi small {
  font-size: 13px;
  color: var(--muted)
}

.question {
  border-left: 3px solid var(--accent);
  padding: 14px 19px;
  background: #0e2530;
  margin: 20px 0
}

.question p {
  margin: 0
}

.question strong {
  display: block;
  margin-bottom: 7px
}

.question-list {
  padding-left: 20px
}

.question-list li {
  margin: 14px 0
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 18px 0
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 13px 14px;
  vertical-align: top
}

th {
  background: #192b3e;
  color: #c5d1de;
  font-size: 13px;
  font-weight: 600
}

td {
  font-variant-numeric: tabular-nums
}

tr:last-child td {
  border-bottom: 0
}

tbody tr:hover {
  background: #19304466
}

.numeric {
  white-space: nowrap;
  text-align: right
}

.table-button {
  padding: 4px 9px;
  font-weight: 650;
  font-size: 14px
}

.chart {
  width: 100%;
  height: auto;
  display: block
}

.chart text {
  font-family: inherit
}

.legend {
  display: flex;
  gap: 22px;
  font-size: 14px;
  flex-wrap: wrap
}

.legend span:before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  margin-right: 7px
}

.legend span:last-child:before {
  background: var(--blue)
}

.score {
  font-size: 48px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: -2px;
  line-height: 1.3
}

.score small {
  font-size: 18px;
  letter-spacing: 0;
  color: var(--muted)
}

meter {
  display: block;
  width: 100%;
  height: 13px;
  margin: 14px 0;
  accent-color: var(--accent)
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px
}

.field-help {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
  font-weight: 400
}

.result-number {
  font-size: 28px;
  font-weight: 650;
  color: var(--accent)
}

.formula {
  padding: 14px 17px;
  margin: 14px 0;
  background: #0b1725;
  border-radius: 6px;
  border: 1px solid var(--border);
  font: 14px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: normal;
  overflow-wrap: anywhere
}

details {
  border-top: 1px solid var(--border);
  padding: 15px 0;
  margin-top: 12px
}

summary {
  cursor: pointer;
  color: var(--accent)
}

details p {
  margin-top: 15px
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0
}

.timeline div {
  background: #152b3d;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px
}

.timeline strong {
  display: block;
  color: var(--accent);
  margin-bottom: 8px
}

.timeline p {
  font-size: 14px;
  color: var(--muted)
}

.error {
  background: #452e2b;
  border: 1px solid #bb8575;
  border-radius: 8px;
  padding: 18px;
  margin: 18px 0;
  color: #ffe2d7
}

.empty {
  padding: 36px;
  color: var(--muted)
}

#status:not(:empty) {
  margin: 15px 0;
  color: var(--amber)
}

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  margin-top: 55px;
  font-size: 13px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  color: var(--muted)
}

code {
  overflow-wrap: anywhere;
  font-size: 13px
}

.brief-paper {
  background: #122439
}

.brief-paper dl {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  font-size: 14px
}

.brief-paper dt {
  color: var(--muted)
}

.brief-paper dd {
  margin: 0;
  overflow-wrap: anywhere
}

.full {
  grid-column: 1/-1
}

@media(min-width:1500px) {

  .masthead,
  main {
    padding-left: 60px;
    padding-right: 60px
  }
}

@media(max-width:900px) {

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

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

  .grid.equal {
    grid-template-columns: 1fr
  }

  .timeline {
    grid-template-columns: 1fr 1fr
  }

}

@media(max-width:650px) {

  .masthead,
  main {
    padding-left: 20px;
    padding-right: 20px
  }

  .masthead {
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    align-items: center;
    gap: 16px
  }

  .header-links { flex-direction: column; align-items: flex-start; gap: 0; }
  .hero { padding-top: 20px; }

  .filters {
    padding: 16px;
    gap: 14px
  }

  .filters label {
    min-width: 100%
  }

  .filters button {
    width: 100%
  }

  .panel {
    padding: 19px
  }

  .kpis {
    gap: 10px
  }

  .kpi {
    padding: 14px
  }

  .kpi strong {
    font-size: 25px
  }

  .fields {
    grid-template-columns: 1fr
  }

  .timeline {
    grid-template-columns: 1fr
  }

  .brief-paper dl {
    grid-template-columns: 1fr;
    gap: 4px
  }

  .brief-paper dd {
    margin-bottom: 10px
  }

  footer {
    flex-direction: column;
    gap: 12px
  }

  .chart text {
    font-size: 15px
  }
}

@media print {
  body {
    background: white !important;
    color: #111 !important;
    font-size: 11pt
  }

  .masthead,
  .hero,
  .freshness,
  .workspace-heading,
  .filters,
  .scope,
  .steps,
  .actions,
  footer,
  #status,
  .no-print {
    display: none !important
  }

  main {
    max-width: none;
    padding: 0
  }

  .panel,
  .brief-paper {
    background: white !important;
    border: 0 !important;
    color: #111 !important;
    padding: 0
  }

  a,
  .muted,
  .note,
  dt {
    color: #222 !important
  }

  table {
    font-size: 10pt
  }

  th,
  td {
    border-color: #bbb !important;
    color: #111 !important
  }

  th {
    background: #eee !important
  }

  .kpi,
  .question {
    background: white !important
  }

  .brief-paper dl {
    display: block
  }

  .brief-paper dd {
    margin-bottom: 8px
  }

  h2,
  h3 {
    break-after: avoid
  }

  tr {
    break-inside: avoid
  }
}

@media print {
  @page { size: A4; margin: 15mm; }
  .table-wrap { overflow: visible; border: 0; }
  table { table-layout: fixed; }
  th, td { overflow-wrap: anywhere; padding: 6px; }
}

.interim-periods { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; margin: 20px 0; }
.interim-periods div { border-left: 3px solid var(--accent, #5de4d0); padding: 10px 16px; background: rgba(93, 228, 208, .04); }
.interim-periods span, .interim-periods strong { display: block; }
.interim-periods span { color: #b3c3d4; margin-bottom: 8px; }
.interim-periods strong { font-size: 1rem; line-height: 1.6; }

.cash-bridge { margin-top: 32px; border-top: 1px solid #35495b; padding-top: 20px; }
.cash-bridge h4 { font-size: 1.2rem; line-height: 1.5; margin-bottom: 12px; }
.bridge-scroll { overflow-x: auto; border: 1px solid #35495b; border-radius: 12px; margin: 20px 0 10px; }
.cash-waterfall { display: block; width: 100%; min-width: 800px; height: auto; }
.cash-bridge th[scope="row"] { white-space: normal; min-width: 170px; font-weight: 500; }
.cash-bridge h5 { font-size: 1rem; margin: 24px 0 10px; }
@media print { .bridge-scroll, #export-cash-svg { display: none; } .cash-bridge { border-color: #aaa; } }

.evidence-links { display: inline-block; line-height: 1.7; }
.evidence-links small { display: block; font-size: .88rem; color: #b3c3d4; overflow-wrap: anywhere; margin-top: 4px; }
@media print { .evidence-links small { color: #333; } }

.saved-brief { margin: 0; padding: 0; border: 0; background: transparent; }
.saved-brief > summary { min-height: 44px; padding: 8px 0; }
.saved-brief[open] { padding-bottom: 16px; }
.saved-brief p { max-width: 75ch; }
.saved-brief label { display: block; margin-bottom: .5rem; }
.saved-brief input { max-width: 100%; }
#restore-preview code { overflow-wrap: anywhere; }
#restore-message:empty { display: none; }

/* Current monitoring is separate from the dated research workspace. */
.official-updates { margin: 0 0 24px; padding: 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; }
.official-updates > summary { padding: 10px 0; min-height: 44px; cursor: pointer; font-weight: 550; font-size: 16px; }
.official-updates > summary span { margin-left: 12px; font-size: 14px; font-weight: 400; color: var(--muted); }
.updates-body { padding: 12px 0 20px; }
.updates-controls { display: flex; align-items: end; gap: 1rem; flex-wrap: wrap; }
.updates-controls label { display: grid; gap: .35rem; }
.updates-controls select { min-width: 11rem; }
#updates-content > section { padding: 1.2rem 0; border-top: 1px solid var(--border); }
.updates-scroll { max-height: 32rem; overflow: auto; }
.official-updates table { min-width: 700px; font-size: 1rem; }
.official-updates th { font-size: .95rem; }
.official-updates td { white-space: nowrap; }
.official-updates small { display: block; font-size: .9rem; color: var(--muted); margin-top: .35rem; }
.updates-rates { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .8rem; margin: 1rem 0 1.5rem; }
.updates-rates > div { padding: .9rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.updates-rates span, .updates-rates strong { display: block; }
.updates-rates strong { font-size: 1.3rem; margin-top: .25rem; overflow-wrap: anywhere; }
.updates-warning { color: var(--amber); }
.updates-provenance { border-top: 1px solid var(--border); padding-top: 1rem; }
.updates-provenance code { overflow-wrap: anywhere; white-space: normal; font-size: .95rem; }
.updates-provenance li { margin: 1rem 0; }
@media (max-width: 680px) {
 .official-updates > summary span { display: block; margin-left: 18px; }
 .updates-rates { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .updates-controls { align-items: stretch; flex-direction: column; }
}
/* Coverage is a reading column, not an additional dashboard. */
.updates-coverage { margin: 1rem 0; line-height: 1.6; }
.updates-coverage code { overflow-wrap: anywhere; }
.official-updates td.filing-coverage { white-space: normal; min-width: 18rem; max-width: 23rem; }
.filing-coverage strong { font-size: 1rem; }
.filing-coverage small { line-height: 1.5; }

/* Expand filing evidence at full width rather than crowding the coverage column. */
.inspect-filing { display: block; margin-top: .5rem; padding: .5rem 0; min-height: 44px; border: 0; background: none; color: var(--accent); text-align: left; text-decoration: underline; font-size: 1rem; }
.filing-facts { margin: 1rem 0; scroll-margin-top: 1rem; }
.filing-facts > summary { min-height: 44px; padding: .5rem 0; font-size: 1rem; }
.filing-facts p { font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; }
.filing-facts ol { list-style: none; padding: 0; margin: 0; }
.filing-facts li { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr); gap: 1.5rem; padding: 1rem 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; font-size: 1rem; }
.filing-facts .fact-value { font-variant-numeric: tabular-nums; }
.filing-facts code { white-space: normal; overflow-wrap: anywhere; font-size: .9rem; }
@media (max-width: 680px) {
 .filing-facts li { grid-template-columns: minmax(0,1fr); gap: .5rem; }
}

/* Screen-only reading hierarchy. Printed briefs retain their existing layout. */
@media screen {
 #content .panel {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 24px 0;
  margin-bottom: 8px;
 }
 #content .grid { gap: 28px; }
 #content .grid .panel { height: auto; }
 #content .panel:has(form), #restore-preview .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 24px;
 }
 .kpis {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
 }
 .kpi {
  min-width: 0;
  padding: 18px 20px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
 }
 .kpi:first-child { border-left: 0; }
 .kpi span, .kpi small {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  text-wrap: balance;
 }
 .kpi strong {
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -.4px;
  margin: 8px 0;
  overflow-wrap: anywhere;
 }
}
@media screen and (max-width:900px) {
 .kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .kpi { padding: 16px; }
 .kpi:nth-child(odd) { border-left: 0; }
 .kpi:nth-child(n+3) { border-top: 1px solid var(--border); }
 .kpi span { min-height: 3em; }
}
@media screen and (max-width:650px) {
 #content .panel:has(form), #restore-preview .panel { padding: 16px; }
 #content .grid { gap: 0; }
 .kpi { padding: 16px 10px; }
 .kpi strong { font-size: 25px; }
}
