/* Design system taken from the approved mockups in "Form scope decisions needed/standalone".
   Values are the mockups' own: flat surfaces (no shadow), 4px radius, 1px #D6DBD8 rules, a 32px
   stat figure, and 10.5-13px type. The mockups specify Inter; a web font would mean fetching from a
   third party, which this site does not do, so the system stack stands in for it. */
:root {
  --ink-900: #0B0F0E; --ink-800: #1A1F1C; --ink-700: #2A302E; --ink-500: #5A615D; --ink-400: #7A817E;
  --line-200: #D6DBD8; --line-100: #E7EBE9; --paper-000: #FFFFFF; --paper-050: #F4F5F4; --paper-100: #F1F8F4;
  --green-700: #0E5A38; --green-500: #1F8A55; --green-200: #CFE9DA;
  --amber-500: #C98A1B; --amber-100: #FBEED3; --red-600: #B3261E;
  --sidebar-w: 220px;
  --radius: 4px;
}
html, body { background: var(--paper-050); }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink-800); font-size: 14px; }
a { color: var(--green-700); }
a:hover { color: #0A4229; }
*:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }

/* ---- Top bar (Quarto navbar) ---------------------------------------------------------------- */
.navbar { background: var(--green-700) !important; padding: 10px 32px; min-height: 0; border: 0; }
.navbar .navbar-brand, .navbar .navbar-title { color: #fff !important; font-size: 15px; font-weight: 700; letter-spacing: -0.005em; padding: 0; }
.navbar .navbar-brand:hover { color: #fff !important; }
.navbar .navbar-nav .nav-link { color: rgba(255, 255, 255, .82) !important; font-size: 12px; font-weight: 500; padding: 0 0 0 18px; }
.navbar .navbar-nav .nav-link:hover { color: #fff !important; }
.navbar .quarto-navbar-tools { color: #fff; }
.navbar-brand-container::after { content: "Analytics workspace, portfolio project"; color: var(--green-200); font-size: 12px; font-weight: 400; margin-left: 16px; white-space: nowrap; }
@media (max-width: 760px) { .navbar-brand-container::after { display: none; } }

/* ---- Sidebar -------------------------------------------------------------------------------- */
#quarto-sidebar, .sidebar.sidebar-navigation { background: var(--paper-000) !important; border-right: 1px solid var(--line-200); padding: 14px 0; }
#quarto-sidebar .sidebar-item-container .sidebar-item-text, .sidebar nav .sidebar-item-text { font-size: 13px; color: var(--ink-700); }
.sidebar-item { margin: 0; }
.sidebar-item-container > .sidebar-item-text, .sidebar navbar a, #quarto-sidebar a.sidebar-item-text {
  display: block; padding: 8px 20px 8px 24px; border-left: 3px solid transparent; text-decoration: none;
}
#quarto-sidebar .sidebar-item-text:hover { background: var(--paper-050); color: var(--ink-900); }
/* Current page: a green rule and a pale wash, as in the mockups. */
#quarto-sidebar .sidebar-item-text.active, #quarto-sidebar [aria-current="page"], .sidebar-item .active {
  color: var(--green-700) !important; font-weight: 600; background: var(--paper-100); border-left-color: var(--green-700) !important;
}
/* Section captions (WORKSPACE, LAB). These are the link that sits DIRECTLY inside the section item;
   the pages themselves live in the nested list below it and must keep ordinary sentence case. */
#quarto-sidebar li.sidebar-item-section > .sidebar-item-container > .sidebar-item-text {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-500);
  padding: 16px 20px 6px 24px; pointer-events: none; border-left-color: transparent !important; background: none !important;
}
/* The sections are always open, so the collapse chevron would point at nothing. */
#quarto-sidebar .sidebar-item-toggle { display: none; }
#quarto-sidebar .sidebar-section .sidebar-item-text { font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; }
#quarto-sidebar .sidebar-section { padding-left: 0; }

/* ---- Page bar and content ------------------------------------------------------------------- */
#title-block-header, .quarto-title-block, .quarto-page-breadcrumbs, nav.quarto-page-breadcrumbs { display: none !important; }
/* Quarto's own content container becomes the page canvas, so the shell applies to every page
   without each one having to wrap itself in a layout div. */
main.content, #quarto-document-content { max-width: 1200px; width: 100%; margin: 0 auto; padding: 0 32px 40px !important; box-sizing: border-box; }
.pagebar {
  position: sticky; top: 0; z-index: 10; background: var(--paper-000); border-bottom: 1px solid var(--line-200);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 32px; margin: 0 -32px 28px;
}
.pagebar-title { font-size: 15px; font-weight: 700; letter-spacing: -0.005em; color: var(--ink-900); }
.pagebar .spacer { margin-left: auto; }
.page { display: contents; }  /* pages may wrap their body in this; it adds nothing of its own */
.section-title { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink-900); margin: 0; }
.section-sub { font-size: 12.5px; color: var(--ink-500); margin-top: 4px; }
h2 { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-500); border: 0; margin: 28px 0 10px; padding: 0; }
h3 { font-size: 13.5px; font-weight: 700; color: var(--ink-900); margin: 0; letter-spacing: -0.005em; }
main p, main > ul, main > ol { font-size: 13.5px; line-height: 1.6; max-width: 86ch; }

.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-500); }
.question { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-900); margin: 6px 0 12px; line-height: 1.18; text-wrap: pretty; max-width: 42ch; }

/* ---- Chips and pills ------------------------------------------------------------------------ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; max-width: 100%; line-height: 1.45; }
.chip.dark { background: var(--ink-900); color: #fff; }
.chip.line { border: 1px solid var(--line-200); color: var(--ink-500); background: #fff; }
.chip.asof { background: var(--green-200); color: var(--green-700); }
.chip.amber, .chip.synth { border: 1px solid var(--amber-500); color: var(--amber-500); background: #fff; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--green-200); color: var(--green-700); }
.pill.warn { background: var(--amber-100); color: #8A5E10; }
.pill.no { border: 1px solid var(--line-200); color: var(--ink-500); }
.delta { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.delta.up { background: var(--green-200); color: var(--green-700); }
.delta.down { background: var(--paper-050); color: var(--ink-700); }
.delta.flat { background: var(--amber-100); color: #8A5E10; }

/* ---- Cards ---------------------------------------------------------------------------------- */
.panel { background: var(--paper-000); border: 1px solid var(--line-200); border-radius: var(--radius); padding: 16px 18px; margin-top: 16px; }
.panel .sub { font-size: 12px; color: var(--ink-500); line-height: 1.5; margin-top: 3px; }
.panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.panel-head .spacer { margin-left: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.grid.thirds { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 20px; }
.kpi { display: block; background: var(--paper-000); border: 1px solid var(--line-200); border-radius: var(--radius); padding: 16px 18px; color: var(--ink-800); text-decoration: none; }
a.kpi:hover { border-color: var(--green-500); color: var(--ink-800); }
.kpi .k-label { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-500); line-height: 1.35; }
.kpi .k-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 8px; }
.kpi .k-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi .k-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.kpi .k-read { font-size: 12px; color: var(--ink-500); line-height: 1.45; }

/* Module cards on the overview */
.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.mod { background: var(--paper-000); border: 1px solid var(--line-200); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.mod-top { display: flex; align-items: center; gap: 8px; }
.mod-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.mod-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-500); }
.mod-q { font-size: 13.5px; font-weight: 700; color: var(--ink-900); line-height: 1.35; letter-spacing: -0.005em; }
.mod-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.mod-src { font-size: 11.5px; color: var(--ink-500); }
.btn { background: var(--green-700); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 14px; border: 0; border-radius: var(--radius); text-decoration: none; display: inline-block; margin-left: auto; white-space: nowrap; }
.btn:hover { background: #0A4229; color: #fff; }
.btn.ghost { background: #fff; color: var(--ink-700); border: 1px solid var(--line-200); }
.btn.ghost:hover { background: var(--paper-050); color: var(--ink-900); }

/* ---- Segmented control ---------------------------------------------------------------------- */
.segmented { display: flex; border: 1px solid var(--line-200); border-radius: var(--radius); overflow: hidden; }
.segmented button { border: 0; background: #fff; color: var(--ink-700); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 14px; cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--line-200); }
.segmented button[aria-pressed="true"] { background: var(--green-700); color: #fff; }

/* ---- Controls ------------------------------------------------------------------------------- */
.controls { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 12px 0 4px; font-size: 12px; }
.controls label { color: var(--ink-700); font-weight: 600; }
.controls select { font: inherit; font-size: 12px; padding: 5px 8px; border: 1px solid var(--line-200); border-radius: var(--radius); background: #fff; color: var(--ink-900); }
.controls select:hover { border-color: var(--green-500); }
.controls input[type=range] { accent-color: var(--green-700); width: 170px; vertical-align: middle; }
.controls label b { display: inline-block; min-width: 1.6rem; color: var(--green-700); font-variant-numeric: tabular-nums; }

/* ---- Readings, meta, limits ------------------------------------------------------------------ */
.read { font-size: 13.5px; font-weight: 500; color: var(--ink-900); line-height: 1.55; margin-top: 12px; text-wrap: pretty; max-width: 92ch; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; border-top: 1px solid var(--line-100); margin-top: 12px; padding-top: 10px; font-size: 11.5px; color: var(--ink-500); }
.changes { background: var(--paper-000); border: 1px solid var(--line-200); border-left: 3px solid var(--green-700); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin-top: 16px; }
.changes .label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--green-700); }
.changes dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; margin: 10px 0 0; font-size: 13px; line-height: 1.5; }
.changes dt { font-weight: 700; color: var(--ink-900); }
.changes dd { margin: 0; color: var(--ink-800); }
.limits { background: var(--paper-050); border: 1px solid var(--line-200); border-radius: var(--radius); padding: 14px 18px; margin-top: 16px; font-size: 12.5px; line-height: 1.55; }
.limits .label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 8px; }
.limits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 24px; }
.limits b { color: var(--ink-900); }
.small { font-size: 11.5px; color: var(--ink-500); line-height: 1.55; }
details.method { background: var(--paper-000); border: 1px solid var(--line-200); border-radius: var(--radius); margin-top: 16px; padding: 12px 18px; font-size: 13px; line-height: 1.6; }
details.method > summary { font-weight: 700; font-size: 13.5px; color: var(--ink-900); cursor: pointer; list-style: none; display: flex; align-items: center; }
details.method > summary::-webkit-details-marker { display: none; }
details.method > summary::after { content: "Expand"; margin-left: auto; font-size: 12px; font-weight: 500; color: var(--green-700); }
details.method[open] > summary::after { content: "Collapse"; }
details.method > *:not(summary) { margin-top: 10px; max-width: 92ch; }

/* ---- Tables --------------------------------------------------------------------------------- */
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 12px; }
table.data th { text-align: left; padding: 8px 10px; color: var(--ink-500); font-weight: 700; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line-200); white-space: nowrap; }
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line-100); vertical-align: top; }
table.data tbody tr:hover td { background: var(--paper-100); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }
table.cohort td, table.cohort th { padding: 5px 8px; font-size: 11.5px; }
table.cohort tbody tr:hover td { background: transparent; }
svg text { font-family: inherit; }
ul.brief { margin: 10px 0 0; padding-left: 18px; line-height: 1.7; font-size: 13.5px; }
ul.brief li { margin-bottom: 6px; max-width: 92ch; }
.synth-banner { border: 1px solid var(--amber-500); background: #FEFBF4; color: #6B4906; padding: 10px 14px; border-radius: var(--radius); font-size: 12.5px; line-height: 1.55; margin-top: 12px; max-width: 96ch; }
.nav-footer { font-size: 11.5px; color: var(--ink-500); line-height: 1.6; border-top: 1px solid var(--line-200); background: var(--paper-050); }
.nav-footer .nav-footer-center { max-width: 1200px; margin: 0 auto; padding: 0 32px; text-align: left !important; flex: 1 1 auto; }
.nav-footer-left, .nav-footer-right { display: none; }

/* A grid or flex child defaults to min-width:auto, so one wide table or chart pushes the page
   sideways and a phone reader gets clipped text instead of wrapped text. Let these boxes shrink. */
.grid > *, .kpis > *, .modules > *, .panel, .scroll-x, .kpi, .mod { min-width: 0; }
.scroll-x { max-width: 100%; }

@media (max-width: 760px) {
  main.content, #quarto-document-content { padding: 0 16px 32px !important; }
  .pagebar { padding: 10px 16px; margin: 0 -16px 20px; }
  .question { font-size: 21px; max-width: none; }
  .kpi .k-value { font-size: 26px; }
  .changes dl { grid-template-columns: 1fr; gap: 2px; }
  .changes dt { margin-top: 8px; }
  .controls input[type=range] { width: 100%; max-width: 200px; }
  main p, main > ul, main > ol, .read, .limits, .synth-banner, ul.brief li { max-width: none; }
}
@media print { .controls, .pagebar { display: none; } .panel, .kpi { break-inside: avoid; } }
