/* 77 editorial design system — tokens.css
   Loaded by base_editorial.html only. Does not affect the admin UI. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --ink:          #0B0B0C;
  --paper:        #FFFFFF;
  --ink-2:        #2A2A2E;
  --muted:        #55555B;
  --muted-on-ink: #B8B8BC;
  --quiet-on-ink: #8E8E94;
  --rule:         #E2E2E6;
  --rule-on-ink:  #3A3A3F;
  --field-on-ink: #17171A;
  --accent:       #1F3BFF;
  --risk:         #FF5A1F;
  --risk-on-ink:  #FF7A2E;
  --risk-text:    #C2410C;
  --risk-tint:    #FFF4EE;
  --good-on-ink:  #5CC8FF;
  --empty:        #D4D4D8;

  --max-w:  1360px;
  --pad-x:  40px;
  --mono:   'JetBrains Mono', monospace;
  --sans:   'Inter', system-ui, sans-serif;
  --arch:   'Archivo', system-ui, sans-serif;
}

@media (max-width: 600px) {
  :root { --pad-x: 20px; }
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.e-page {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.e-page a { color: inherit; text-decoration: none; }
.e-page a:hover { color: var(--accent); }
.e-page a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Masthead ───────────────────────────────────────────────────────────── */
.mast {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.mast-bar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}

.mast-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  text-decoration: none;
  opacity: 1;
  transition: opacity .15s;
}
.mast-logo:hover { opacity: 0.8; }

.mast-nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
  list-style: none;
  align-items: center;
}
.mast-nav a {
  color: var(--muted-on-ink);
  text-decoration: none;
  padding-bottom: 4px;
  white-space: nowrap;
}
.mast-nav a:hover { color: #fff; }
.mast-nav a.active {
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.mast-nav .handover-count {
  font-family: var(--mono);
  color: var(--risk-on-ink);
}

.mast-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.mast-client {
  font-size: 14px;
  color: var(--muted-on-ink);
  white-space: nowrap;
}

.mast-search-wrap { position: relative; }
.mast-search {
  width: 240px; height: 40px;
  border: 1px solid var(--rule-on-ink);
  background: var(--field-on-ink);
  color: #fff;
  padding: 0 14px;
  font: 14px var(--sans);
}
.mast-search::placeholder { color: var(--quiet-on-ink); }
.mast-search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.mast-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

/* Mobile toggle */
.mast-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  flex-direction: column;
  gap: 5px;
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.mast-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
}

@media (max-width: 900px) {
  .mast-nav   { display: none; }
  .mast-search-wrap { display: none; }
  .mast-client { display: none; }
  .mast-toggle { display: flex; }

  .mast.nav-open .mast-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: var(--ink);
    padding: 8px var(--pad-x) 24px;
    gap: 0;
    border-top: 1px solid var(--rule-on-ink);
    z-index: 99;
  }
  .mast.nav-open .mast-nav a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule-on-ink);
    font-size: 17px;
    width: 100%;
  }
  .mast.nav-open .mast-nav a.active {
    border-bottom-color: var(--rule-on-ink);
  }
}

/* ── Live strip ─────────────────────────────────────────────────────────── */
.live-strip {
  border-top: 1px solid var(--rule-on-ink);
  background: var(--ink);
  color: #fff;
}
.live-strip-row {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  font-family: var(--mono);
  font-size: 13px;
  height: 44px;
  align-items: center;
  white-space: nowrap;
}
.live-strip-row::-webkit-scrollbar { display: none; }
.live-item { padding: 0 24px; flex-shrink: 0; }
.live-item:first-child { padding-left: 0; }
.live-item + .live-item { border-left: 1px solid var(--rule-on-ink); }
.live-item b { color: #fff; font-weight: 600; }
.live-up   { color: var(--risk-on-ink); }
.live-down { color: var(--good-on-ink); }

/* ── Page wrap ──────────────────────────────────────────────────────────── */
.e-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px var(--pad-x) 80px;
}

/* ── Page title row ─────────────────────────────────────────────────────── */
.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 8px;
}
.page-title {
  font-family: var(--arch);
  font-weight: 900;
  font-stretch: 80%;
  font-size: 40px;
  letter-spacing: -0.02em;
}
.page-title-context {
  font-size: 15px;
  color: var(--muted);
}

/* ── Kicker ─────────────────────────────────────────────────────────────── */
.kicker {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--risk-text);
  margin-bottom: 14px;
}
.kicker-on-ink { color: var(--risk-on-ink); }
.kicker-muted  { color: var(--muted); }

/* ── Lead headline ──────────────────────────────────────────────────────── */
.lead-hed {
  font-family: var(--arch);
  font-weight: 800;
  font-stretch: 78%;
  font-size: 68px;
  line-height: 0.95;
  letter-spacing: -0.025em;
}
@media (max-width: 900px) { .lead-hed { font-size: 44px; line-height: 1; } }
@media (max-width: 480px) { .lead-hed { font-size: 34px; } }

/* ── Standfirst ─────────────────────────────────────────────────────────── */
.standfirst {
  margin-top: 20px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 760px;
}
@media (max-width: 600px) { .standfirst { font-size: 17px; } }

.standfirst-on-ink {
  color: var(--empty);
  max-width: 520px;
}

/* ── Button row ─────────────────────────────────────────────────────────── */
.btn-row { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.btn-p {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 22px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  min-width: 44px;
  white-space: nowrap;
}
.btn-p:hover { opacity: 0.85; color: #fff; }

.btn-s {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: none;
  font-weight: 600;
  font-size: 15px;
  min-width: 44px;
  white-space: nowrap;
}
.btn-s:hover { background: var(--ink); color: #fff; }

/* ── Lede grid ──────────────────────────────────────────────────────────── */
.lede-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) { .lede-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ── Building figure ────────────────────────────────────────────────────── */
.bldg-fig {
  margin-top: 36px;
  background: var(--ink);
}
.bldg-fig svg { display: block; width: 100%; height: auto; }
.bldg-fig figcaption {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted-on-ink);
  border-top: 1px solid var(--rule-on-ink);
}

/* ── Section title ──────────────────────────────────────────────────────── */
.sec-title {
  font-family: var(--arch);
  font-weight: 800;
  font-stretch: 85%;
  font-size: 22px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.sec-title-lg {
  font-size: 28px;
  border-bottom-width: 3px;
  padding-bottom: 12px;
}
.sec-count { font-family: var(--mono); font-size: 15px; color: var(--muted); font-weight: 400; }
.sec-count-risk { font-family: var(--mono); font-size: 15px; color: var(--risk-text); font-weight: 400; }

/* ── Readiness bar ──────────────────────────────────────────────────────── */
.r-bar { display: flex; gap: 3px; margin-top: 10px; }
.r-seg       { flex: 1; height: 6px; background: var(--ink); }
.r-seg-risk  { background: var(--risk); }
.r-seg-empty { background: var(--empty); }
.r-seg-done  { background: var(--accent); }

/* ── Board row ──────────────────────────────────────────────────────────── */
.board-list { list-style: none; }
.board-row { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.board-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.board-row-name {
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
}
.board-row-name:hover { color: var(--accent); }
.board-score { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.board-score-risk { color: var(--risk-text); }
.board-meta { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ── Needs you ──────────────────────────────────────────────────────────── */
.needs-sec { margin-top: 40px; }
.attn-list { list-style: none; }
.attn-row { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.attn-row a { font-weight: 600; color: var(--ink); display: block; margin-bottom: 4px; }
.attn-row a:hover { color: var(--accent); }
.attn-meta { font-size: 13px; color: var(--muted); }

/* ── Bottom band ────────────────────────────────────────────────────────── */
.bottom-band {
  margin-top: 64px;
  border-top: 3px solid var(--ink);
  padding-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
@media (max-width: 900px) { .bottom-band { grid-template-columns: 1fr; gap: 32px; } }

/* ── Big numbers ────────────────────────────────────────────────────────── */
.big-num-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.big-num {
  font-family: var(--arch);
  font-weight: 900;
  font-stretch: 75%;
  font-size: 72px;
  line-height: 1;
}
.big-num-accent { color: var(--accent); }
.big-caption { margin-top: 6px; font-size: 14px; color: var(--muted); }

/* ── Overnight list ─────────────────────────────────────────────────────── */
.night-list { list-style: none; }
.night-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  line-height: 1.45;
  align-items: start;
}
.night-time { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 2px; }

/* ── Source freshness ───────────────────────────────────────────────────── */
.source-list { list-style: none; font-family: var(--mono); font-size: 13px; }
.source-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.source-stale { color: var(--risk-text); }
.source-note { margin-top: 12px; font-size: 13px; color: var(--muted); font-family: var(--sans); }

/* ── Hero band (package page) ───────────────────────────────────────────── */
.hero-band { background: var(--ink); color: #fff; }
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px var(--pad-x) 48px;
}
.hero-breadcrumb {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--quiet-on-ink);
  margin-bottom: 32px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 48px;
  align-items: end;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-hed {
  font-family: var(--arch);
  font-weight: 800;
  font-stretch: 78%;
  font-size: 80px;
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-top: 12px;
}
@media (max-width: 900px) { .hero-hed { font-size: 52px; } }
@media (max-width: 480px) { .hero-hed { font-size: 40px; } }

.hero-defs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
  border-top: 1px solid var(--rule-on-ink);
  padding-top: 16px;
}
@media (max-width: 600px) { .hero-defs { grid-template-columns: 1fr 1fr; } }

.hero-dt {
  font-size: 12px;
  color: var(--quiet-on-ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hero-dd { margin-top: 6px; font-weight: 600; font-size: 15px; }
.hero-dd-mono { font-family: var(--mono); }

.hero-figures {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.display-score {
  font-family: var(--arch);
  font-weight: 900;
  font-stretch: 70%;
  font-size: 220px;
  line-height: 0.8;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.display-score-done { color: #fff; }
.display-score-risk { color: var(--risk); }
@media (max-width: 900px) { .display-score { font-size: 120px; } }
@media (max-width: 480px)  { .display-score { font-size: 80px; } }

/* ── Body grid (package page) ───────────────────────────────────────────── */
.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) { .body-grid { grid-template-columns: 1fr; } }

/* ── Condition table ────────────────────────────────────────────────────── */
.cond-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cond-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 500px;
}
.cond-table th {
  text-align: left;
  padding: 14px 12px 10px 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 400;
  border-bottom: 1px solid var(--rule);
}
.cond-table th:not(:first-child) { padding-left: 12px; }
.cond-table td {
  padding: 15px 12px;
  border-top: 1px solid var(--rule);
  vertical-align: top;
}
.cond-table td:first-child { padding-left: 0; }
.cond-table td:last-child  { padding-right: 0; }
.cond-row-risk { background: var(--risk-tint); }
.cond-row-risk td:first-child { font-weight: 600; }
.cond-status-risk { color: var(--risk-text); font-weight: 600; }
.cond-source { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ── What happens next ──────────────────────────────────────────────────── */
.next-list { list-style: none; }
.next-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  line-height: 1.45;
}
.next-date { font-family: var(--mono); font-size: 13px; font-weight: 600; padding-top: 2px; }
.next-date-risk { color: var(--risk-text); }

/* ── Linked list (drawings / actions / programme) ───────────────────────── */
.linked-list { list-style: none; margin-top: 12px; }
.linked-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.linked-val { font-family: var(--mono); font-size: 13px; flex-shrink: 0; }
.linked-val-risk { color: var(--risk-text); }
