/* Clinexus working papers — a reading surface, not a deck.
   Colour and type are the canonical Light IT tokens; nothing is invented here. */

:root {
  --li-primary: #2954DA;
  --li-secondary: #F3D32F;
  --li-accent: #6BE7F1;
  --li-alert: #DB5156;
  --li-text: #1E1F22;
  --li-muted: #5B6270;
  --li-bg: #FFFFFF;

  --li-surface-1: #F8F9FA;
  --li-card-border: #E8EAF0;
  --li-ui-border: #DDE4F0;
  --li-pill-bg: #FAFBFE;
  --li-pill-border: #D5DCEA;
  --li-accent-light: #EFF4FF;
  --li-accent-border: #B2DDFF;

  --shell: 1440px;
  --gutter: 32px;
}

@font-face { font-family: "Montserrat"; src: url("../assets/fonts/Montserrat-Regular.woff2")  format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../assets/fonts/Montserrat-Medium.woff2")   format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../assets/fonts/Montserrat-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../assets/fonts/Montserrat-Bold.woff2")     format("woff2"); font-weight: 700; font-display: swap; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--li-text);
  background: var(--li-surface-1);
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- masthead ---------------------------------------------------------- */

.masthead {
  background: var(--li-bg);
  border-bottom: 1px solid var(--li-card-border);
  padding: 40px 0 34px;
}

.masthead img.logo { width: 168px; height: auto; display: block; margin-bottom: 30px; }

.masthead h1 {
  margin: 0 0 14px;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: -0.9px;
}

.masthead .standfirst {
  margin: 0;
  max-width: 900px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--li-muted);
}

.masthead .standfirst strong { color: var(--li-text); font-weight: 600; }

.masthead .backlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--li-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.masthead .backlink:hover { border-bottom-color: var(--li-primary); }

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.pdf-link {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 22px;
  padding: 9px 16px;
  border: 1px solid var(--li-pill-border);
  border-radius: 8px;
  background: var(--li-pill-bg);
  font-size: 15px;
  font-weight: 600;
  color: var(--li-text);
  text-decoration: none;
}

.pdf-link:hover {
  border-color: var(--li-primary);
  color: var(--li-primary);
}

.pdf-link .meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--li-muted);
}

/* ---- tabs -------------------------------------------------------------- */

.tabbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--li-ui-border);
}

.tabbar .shell {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabbar .shell::-webkit-scrollbar { display: none; }

.tab {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--li-muted);
  padding: 18px 16px 15px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover { color: var(--li-text); }

.tab[aria-selected="true"] {
  color: var(--li-primary);
  border-bottom-color: var(--li-primary);
}

.tab .count {
  display: inline-block;
  margin-left: 7px;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--li-accent-light);
  border: 1px solid var(--li-accent-border);
  color: var(--li-primary);
  font-size: 12px;
  font-weight: 700;
}

/* ---- panels ------------------------------------------------------------ */

.panel { display: none; padding: 40px 0 96px; }
.panel.is-active { display: block; }

.panel-intro {
  max-width: 860px;
  margin: 0 0 34px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--li-muted);
}

.panel-intro strong { color: var(--li-text); font-weight: 600; }

/* ---- sheet cards ------------------------------------------------------- */

.sheet {
  background: var(--li-bg);
  border: 1px solid var(--li-card-border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 28px;
  scroll-margin-top: 76px;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 26px 30px 22px;
  border-bottom: 1px solid var(--li-card-border);
}

.sheet-head .text { flex: 1 1 auto; min-width: 0; }

.sheet-head h2 {
  margin: 0 0 8px;
  font-size: 25px;
  line-height: 1.22;
  letter-spacing: -0.3px;
}

.sheet-head p {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
  color: var(--li-muted);
  max-width: 860px;
}

.chip {
  flex: none;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: var(--li-pill-bg);
  border: 1px solid var(--li-pill-border);
  color: var(--li-muted);
  white-space: nowrap;
}

.chip.pilot { background: var(--li-accent-light); border-color: var(--li-accent-border); color: var(--li-primary); }
.chip.both  { background: #FEFBE8; border-color: #F0E3A0; color: #8A6D00; }
.chip.ask   { background: #FDF0F0; border-color: #F3C9CB; color: #A63B3F; }

.sheet-body {
  padding: 22px;
  background: var(--li-surface-1);
  overflow-x: auto;
}

.sheet-body a { display: block; min-width: 900px; }

.sheet-body img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--li-card-border);
  border-radius: 8px;
  background: var(--li-bg);
}

.sheet-foot {
  padding: 14px 30px 18px;
  font-size: 14px;
  color: var(--li-muted);
  border-top: 1px solid var(--li-card-border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.sheet-foot a { color: var(--li-primary); font-weight: 600; text-decoration: none; }
.sheet-foot a:hover { text-decoration: underline; }

/* ---- a sheet whose body is written here rather than exported from Figma -- */

.sheet-body.is-paper {
  background: var(--li-bg);
  padding: 28px 30px 32px;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}

.tbl th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--li-muted);
  padding: 0 12px 12px;
  border-bottom: 2px solid var(--li-ui-border);
  white-space: nowrap;
}

.tbl th.num, .tbl td.num { text-align: right; }

.tbl td {
  padding: 12px;
  border-bottom: 1px solid var(--li-card-border);
  vertical-align: top;
  line-height: 1.35;
}

.tbl td.num   { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.lead  { font-weight: 700; }
.tbl td.desc  { color: var(--li-muted); }
.tbl td.quiet { color: var(--li-muted); font-weight: 500; }
.tbl td.dash  { color: var(--li-pill-border); font-weight: 400; }

.tbl tr.total td {
  border-bottom: none;
  border-top: 2px solid var(--li-primary);
  padding-top: 15px;
  font-weight: 700;
  font-size: 18px;
}

.tbl tr.total td.num { color: var(--li-primary); }

.tbl-note {
  margin: 18px 0 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--li-muted);
}

.tbl-note strong { color: var(--li-text); font-weight: 600; }

.tbl-wrap { overflow-x: auto; }
.tbl-wrap .tbl { min-width: 720px; }

/* ---- callout ----------------------------------------------------------- */

.callout {
  border: 1px solid var(--li-ui-border);
  border-left: 5px solid var(--li-primary);
  border-radius: 12px;
  background: var(--li-bg);
  padding: 22px 26px;
  margin-bottom: 28px;
}

.callout.is-flag { border-left-color: var(--li-secondary); }

.callout h3 { margin: 0 0 8px; font-size: 20px; }
.callout p  { margin: 0; font-size: 17px; line-height: 1.45; color: var(--li-muted); }
.callout p + p { margin-top: 10px; }
.callout a { color: var(--li-primary); font-weight: 600; }

/* ---- footer ------------------------------------------------------------ */

.colophon {
  background: var(--li-bg);
  border-top: 1px solid var(--li-card-border);
  padding: 34px 0 44px;
  font-size: 14px;
  color: var(--li-muted);
}

.colophon .shell { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.colophon img { width: 128px; height: auto; }

/* Page-sized strips of the tall sheets. Screen never shows them — see
   slice-sheets.py for why paper needs them. */
.strips { display: none; }

/* ---- print ------------------------------------------------------------- */
/* On paper the tabs are meaningless, so every panel is shown in order and each
   gains the heading the tab was carrying on screen. */

@page {
  size: A4 portrait;
  margin: 14mm 12mm 16mm;
}

.panel-title { display: none; }

@media print {
  html, body { background: #FFFFFF; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .shell { max-width: none; padding: 0; }

  .tabbar, .backlink, .sheet-foot a, .pdf-link { display: none !important; }

  .masthead { border: 0; padding: 0 0 10mm; }
  .masthead h1 { font-size: 26pt; }
  .masthead .standfirst { font-size: 10.5pt; max-width: none; }
  .masthead img.logo { width: 34mm; margin-bottom: 8mm; }

  .panel {
    display: block !important;
    padding: 0;
    break-before: page;
  }

  .panel-title {
    display: block;
    margin: 0 0 4mm;
    padding-bottom: 3mm;
    border-bottom: 2px solid var(--li-primary);
    font-size: 17pt;
    color: var(--li-primary);
  }

  .panel-intro { font-size: 10.5pt; max-width: none; margin-bottom: 6mm; }

  .sheet {
    border: 0;
    border-radius: 0;
    margin-bottom: 8mm;
    break-inside: auto;
  }

  .sheet-head {
    border: 0;
    border-left: 3px solid var(--li-primary);
    padding: 0 0 3mm 4mm;
    break-after: avoid;
    break-inside: avoid;
  }

  .sheet-head h2 { font-size: 13.5pt; }
  .sheet-head p  { font-size: 10pt; max-width: none; }
  .chip { font-size: 7.5pt; padding: 1mm 2mm; }

  .sheet-body { padding: 3mm 0 0; background: #FFFFFF; overflow: visible; }
  .sheet-body img { border: 1px solid var(--li-card-border); border-radius: 0; }
  .sheet-body.is-paper { padding: 3mm 0 0; }

  /* Where a sheet was cut into strips, the strips are what prints — the whole
     image would be taller than a page, and Chrome drops rather than splits it. */
  .sheet-body:has(.strips) > a { display: none; }
  .sheet-body a { min-width: 0; }

  .strips { display: block; }
  .strips img { display: block; break-inside: avoid; }
  .strips img + img { margin-top: 0; break-before: page; }

  .sheet-foot {
    border: 0;
    padding: 2mm 0 0;
    font-size: 9pt;
    break-before: avoid;
  }

  .callout { break-inside: avoid; padding: 4mm 5mm; }
  .callout h3 { font-size: 12pt; }
  .callout p  { font-size: 10pt; }

  .tbl        { font-size: 8.5pt; }
  .tbl-wrap   { overflow: visible; }
  .tbl-wrap .tbl { min-width: 0; }
  .tbl th     { font-size: 7pt; padding: 0 2mm 2mm; }
  .tbl td     { padding: 2mm; }
  .tbl tr     { break-inside: avoid; }
  .tbl-note   { font-size: 9pt; }

  .colophon { border: 0; padding: 8mm 0 0; font-size: 9pt; break-before: avoid; }
  .colophon img { width: 28mm; }
}

/* ---- responsive -------------------------------------------------------- */

@media (max-width: 900px) {
  :root { --gutter: 18px; }
  .masthead h1 { font-size: 32px; }
  .masthead .standfirst { font-size: 17px; }
  .sheet-head { flex-direction: column; gap: 12px; padding: 20px 20px 18px; }
  .sheet-head h2 { font-size: 21px; }
  .sheet-body { padding: 14px; }
  .sheet-foot { padding: 12px 20px 16px; }
}

/* The money sits in the table rather than in a card of its own: a table row prints
   reliably, and hours, people and cost belong on one line anyway. */
.tbl tr.money td {
  border-bottom: none;
  padding-top: 14px;
  font-weight: 700;
  color: var(--li-color-primary, var(--li-primary));
}

.tbl tr.money td.num { font-size: 21px; letter-spacing: -0.5px; }

.tbl tr.money td.cap,
.tbl tr.money td.desc {
  font-weight: 500;
  font-size: 15px;
  color: var(--li-color-muted, var(--li-muted));
  text-align: right;
}
