/* NexNith assessment tools — stylesheet.
   Tokens and navigation copied from the site's Fieldwork stylesheet so the
   design system cannot drift. Tool components are prefixed tl-. Print styles
   at the end produce a clean plan when the visitor saves to PDF. */

:root {
  --navy: #0F1B2D;
  --navy-soft: #1A2B45;
  --ink: #1C1C1C;
  --paper: #F8F5EE;
  --paper-warm: #F2EDE2;
  --rule: #2C3E5C;
  --rule-light: #D8D2C4;
  --accent: #B8551E;
  --accent-soft: #D87842;
  --muted: #5A6478;
  --muted-light: #9099A8;
  --white: #FFFFFF;
  --sev-critical: #7A1F1F;
  --sev-high: #B8551E;
  --sev-moderate: #8A6D1F;
  --sev-low: #3E5C4A;
  --tier-core: #0F1B2D;
  --tier-conditional: #5A6478;
  --tier-lower: #9099A8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: 'ss01', 'ss02';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-family: 'Fraunces', Georgia, serif; font-weight: 400; letter-spacing: -0.02em; color: var(--navy); }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent); }
.uppercase { text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; font-weight: 500; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ------------------------------------------------------------------ nav */
.nav { position: fixed; top: 0; left: 0; right: 0; background: rgba(248, 245, 238, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule-light); z-index: 100; padding: 18px 0; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; }
.nav-logo { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 500; color: var(--navy); letter-spacing: -0.02em; }
.nav-logo .dot { color: var(--accent); font-style: italic; }
.nav-links { display: flex; gap: 36px; list-style: none; align-items: center; }
.nav-links a { color: var(--ink); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.nav-links a.is-current { color: var(--accent); }
.nav-cta { background: var(--navy); color: var(--paper) !important; padding: 10px 20px; border-radius: 2px; font-size: 13px; letter-spacing: 0.04em; transition: background 0.2s; }
.nav-cta:hover { background: var(--accent) !important; }
.nav-mobile-toggle { display: none; }

footer { border-top: 1px solid var(--rule-light); padding: 48px 0; margin-top: 80px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-logo { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500; color: var(--navy); }
.footer-logo .dot { color: var(--accent); font-style: italic; }
.footer-meta { font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 32px; list-style: none; }
.footer-links a { font-size: 13px; color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

/* ------------------------------------------------------------------ shell */
.tl-main { padding: 140px 0 40px; min-height: 70vh; }
.tl-main .container { max-width: 1080px; }
.tl-loading, .tl-error { padding: 80px 0; color: var(--muted); }
.tl-error { color: var(--sev-critical); }

/* ------------------------------------------------------------------ buttons */
.tl-btn { font: inherit; font-size: 14px; font-weight: 500; letter-spacing: 0.02em; border-radius: 2px; padding: 12px 22px; cursor: pointer; border: 1px solid var(--navy); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.tl-btn-primary { background: var(--navy); color: var(--paper); }
.tl-btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.tl-btn-primary:disabled { background: var(--rule-light); border-color: var(--rule-light); color: var(--muted); cursor: not-allowed; }
.tl-btn-ghost { background: transparent; color: var(--navy); border-color: var(--rule-light); }
.tl-btn-ghost:hover { border-color: var(--navy); }
.tl-btn-small { padding: 8px 14px; font-size: 13px; }

/* ------------------------------------------------------------------ landing */
.tl-landing { max-width: 820px; }
.tl-eyebrow { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 28px; padding-bottom: 4px; border-bottom: 1px solid var(--rule-light); color: var(--muted); }
.tl-eyebrow .dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; display: inline-block; }
.tl-h1 { font-size: clamp(38px, 5vw, 58px); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 22px; }
.tl-h1-small { font-size: clamp(30px, 4vw, 42px); margin-bottom: 0; }
.tl-lead { font-size: 20px; line-height: 1.55; color: var(--muted); font-weight: 300; max-width: 680px; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 26px 0 40px; font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.tl-meta-item::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: 2px; }
.tl-outputs { margin-bottom: 44px; }
.tl-outputs-label { color: var(--muted); margin-bottom: 14px; }
.tl-outputs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tl-output { background: var(--white); border: 1px solid var(--rule-light); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.tl-output strong { font-weight: 600; font-size: 14px; color: var(--navy); }
.tl-output span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.tl-start { display: grid; grid-template-columns: 1fr auto; gap: 12px 12px; align-items: end; max-width: 680px; }
.tl-label { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.tl-input { font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--rule-light); border-radius: 2px; background: var(--white); color: var(--ink); width: 100%; }
.tl-input:focus { outline: none; border-color: var(--navy); }
.tl-privacy { margin-top: 18px; font-size: 13px; color: var(--muted); }
.tl-landing-part { max-width: 680px; margin-bottom: 32px; }
.tl-options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ------------------------------------------------------------------ question */
.tl-question { max-width: 820px; }
.tl-progress { margin-bottom: 36px; }
.tl-progress-bar { height: 2px; background: var(--rule-light); }
.tl-progress-fill { height: 2px; background: var(--accent); transition: width 0.3s; }
.tl-progress-label { margin-top: 10px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.tl-q-title { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.2; margin-bottom: 12px; }
.tl-q-helper { color: var(--muted); font-size: 16px; margin-bottom: 28px; max-width: 680px; }
.tl-part { margin-bottom: 28px; }
.tl-part-label { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--navy); margin-bottom: 10px; }
.tl-options { display: flex; flex-direction: column; gap: 8px; }
.tl-option { display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left; font: inherit; font-size: 15px; line-height: 1.45; padding: 13px 16px; background: var(--white); border: 1px solid var(--rule-light); border-radius: 2px; cursor: pointer; color: var(--ink); transition: border-color 0.15s, background 0.15s; }
.tl-option:hover { border-color: var(--navy); }
.tl-option-mark { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 3px; border: 1.5px solid var(--muted-light); border-radius: 50%; position: relative; transition: border-color 0.15s, background 0.15s; }
.tl-option[role="checkbox"] .tl-option-mark { border-radius: 2px; }
.tl-option.is-selected { border-color: var(--navy); background: #FBFAF6; }
.tl-option.is-selected .tl-option-mark { border-color: var(--navy); background: var(--navy); }
.tl-option.is-selected .tl-option-mark::after { content: ''; position: absolute; left: 4px; top: 4px; width: 6px; height: 6px; background: var(--paper); border-radius: inherit; }
.tl-option-body { display: flex; flex-direction: column; gap: 2px; }
.tl-option-tag { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.tl-option-unknown { border-style: dashed; color: var(--muted); }
.tl-option-unknown.is-selected { color: var(--ink); }
.tl-q-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 24px; border-top: 1px solid var(--rule-light); }

/* ------------------------------------------------------------------ results */
.tl-section { padding: 44px 0; border-top: 1px solid var(--rule-light); }
.tl-section:first-child { border-top: 0; padding-top: 0; }
.tl-section-head { margin-bottom: 22px; }
.tl-section-eyebrow { color: var(--accent); margin-bottom: 10px; }
.tl-section-title { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; margin-bottom: 8px; }
.tl-section-lead { color: var(--muted); font-size: 15px; max-width: 760px; }
.tl-snapshot-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.tl-actions { display: flex; gap: 10px; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.tl-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--rule-light); border: 1px solid var(--rule-light); margin-bottom: 22px; }
.tl-stat { background: var(--white); padding: 18px 20px; }
.tl-stat-n { font-family: 'Fraunces', Georgia, serif; font-size: 40px; line-height: 1; color: var(--navy); margin-bottom: 6px; }
.tl-stat-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.tl-stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-snapshot-lead { font-size: 17px; max-width: 800px; }
.tl-note { margin-top: 12px; padding: 12px 16px; background: var(--paper-warm); border-left: 2px solid var(--accent); font-size: 14px; max-width: 800px; }
.tl-muted { color: var(--muted); font-size: 13px; }
.tl-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--navy); }
.tl-empty { color: var(--muted); font-style: italic; }
.tl-label-strong { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 14px 0 6px; }
.tl-label-strong:first-child { margin-top: 0; }
.tl-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* pills */
.tl-pill { display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 2px; border: 1px solid var(--rule-light); color: var(--navy); background: var(--white); white-space: nowrap; vertical-align: middle; }
.tl-pill-profile { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.tl-pill-unknown { border-style: dashed; color: var(--muted); background: transparent; }
.tl-pill-type, .tl-pill-role { text-transform: uppercase; font-size: 10.5px; }
.tl-pill-ctl { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 500; letter-spacing: 0; margin: 2px 4px 2px 0; white-space: normal; }
.tl-pill-tier-core { background: var(--tier-core); color: var(--paper); border-color: var(--tier-core); }
.tl-pill-tier-conditional { background: var(--white); color: var(--tier-conditional); border-color: var(--tier-conditional); }
.tl-pill-tier-lower { background: transparent; color: var(--tier-lower); border-color: var(--rule-light); }
.sev-critical { color: var(--sev-critical); border-color: var(--sev-critical); }
.sev-high { color: var(--sev-high); border-color: var(--sev-high); }
.sev-moderate { color: var(--sev-moderate); border-color: var(--sev-moderate); }
.sev-low { color: var(--sev-low); border-color: var(--sev-low); }
.tl-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }

/* expandables */
.tl-expand { background: var(--white); border: 1px solid var(--rule-light); border-radius: 2px; margin-bottom: 8px; }
.tl-expand-summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; }
.tl-expand-summary::-webkit-details-marker { display: none; }
.tl-expand-title { font-weight: 500; }
.tl-expand-chevron { color: var(--muted); transition: transform 0.2s; flex: 0 0 auto; }
.tl-expand[open] > .tl-expand-summary .tl-expand-chevron { transform: rotate(180deg); }
.tl-expand-body { padding: 4px 18px 20px; border-top: 1px solid var(--paper-warm); font-size: 15px; }
.tl-expand-plain { background: transparent; }
.tl-area-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tl-area-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); }
.tl-area-name { font-weight: 500; font-size: 16px; }
.tl-area-sub { flex-basis: 100%; font-size: 13px; color: var(--muted); font-weight: 400; }
.tl-area-note { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* scope tiers */
.tl-tier { margin-bottom: 28px; }
.tl-tier-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; }
.tl-tier-title { font-size: 22px; }
.tl-tier-depth { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tl-tier-desc { font-size: 14px; color: var(--muted); margin-bottom: 12px; max-width: 760px; }
.tl-tier-core .tl-expand { border-left: 3px solid var(--tier-core); }
.tl-tier-conditional .tl-expand { border-left: 3px solid var(--tier-conditional); }
.tl-tier-lower .tl-expand { border-left: 3px solid var(--rule-light); }

/* lists */
.tl-list { padding-left: 20px; margin: 4px 0; }
.tl-list li { margin-bottom: 5px; }
.tl-list-tight li { margin-bottom: 3px; font-size: 13px; }

/* risk cards */
.tl-risk { background: var(--white); border: 1px solid var(--rule-light); border-left: 3px solid var(--rule-light); border-radius: 2px; padding: 20px 22px; margin-bottom: 12px; }
.tl-risk.sev-critical { border-left-color: var(--sev-critical); color: inherit; }
.tl-risk.sev-high { border-left-color: var(--sev-high); color: inherit; }
.tl-risk.sev-moderate { border-left-color: var(--sev-moderate); color: inherit; }
.tl-risk.sev-low { border-left-color: var(--sev-low); color: inherit; }
.tl-risk-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.tl-risk-n { font-family: 'Fraunces', Georgia, serif; font-size: 30px; line-height: 1; color: var(--muted-light); min-width: 28px; }
.tl-risk-title { font-size: 22px; line-height: 1.25; }
.tl-risk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; font-size: 14.5px; }
.tl-block p { margin: 0; }
.tl-also { margin-top: 18px; padding: 16px 20px; background: var(--white); border: 1px solid var(--rule-light); }
.tl-also .tl-list li { font-size: 14px; }

/* tables */
.tl-table-wrap { overflow-x: auto; border: 1px solid var(--rule-light); background: var(--white); }
.tl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tl-table th { text-align: left; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--rule-light); background: var(--paper-warm); vertical-align: bottom; }
.tl-table td { padding: 12px 14px; border-bottom: 1px solid var(--paper-warm); vertical-align: top; line-height: 1.5; }
.tl-table tr:last-child td { border-bottom: 0; }
.tl-table-objectives td:first-child { width: 28%; }
.tl-table-programme { min-width: 1000px; }
.tl-table-programme th:nth-child(1) { width: 12%; } .tl-table-programme th:nth-child(2) { width: 14%; } .tl-table-programme th:nth-child(3) { width: 19%; } .tl-table-programme th:nth-child(4) { width: 15%; } .tl-table-programme th:nth-child(5) { width: 26%; } .tl-table-programme th:nth-child(6) { width: 14%; }
.tl-table-programme td { font-size: 12.5px; }
.tl-table-programme .tl-pill { margin-bottom: 4px; }

/* evidence, procedures, interviews */
.tl-evidence, .tl-procs, .tl-interviews { padding-left: 22px; margin-top: 10px; }
.tl-evidence li, .tl-procs li { margin-bottom: 14px; }
.tl-ev-item { font-weight: 500; }
.tl-ev-meta { font-size: 13px; color: var(--muted); }
.tl-ctl-refs { margin-top: 4px; font-size: 13px; }
.tl-proc-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.tl-proc-text { margin: 0; }
.tl-proc-establish { padding: 10px 14px; background: var(--paper-warm); border-left: 2px solid var(--accent); list-style-position: inside; }
.tl-interviews li { margin-bottom: 16px; }
.tl-iq { font-size: 17px; font-family: 'Fraunces', Georgia, serif; color: var(--navy); margin: 0 0 4px; }
.tl-iq-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tl-ctl-list li { margin-bottom: 8px; }
.tl-ctl-obj { font-size: 13px; color: var(--ink); margin-top: 2px; }

/* boundary and next */
.tl-boundary { padding: 14px 18px; border: 1px solid var(--rule-light); background: var(--paper-warm); font-size: 14px; margin-bottom: 18px; max-width: 900px; }
.tl-next-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tl-next-card { display: block; background: var(--white); border: 1px solid var(--rule-light); border-radius: 2px; padding: 20px 22px; color: inherit; transition: border-color 0.2s; }
.tl-next-card:hover { border-color: var(--navy); color: inherit; }
.tl-next-kicker { color: var(--accent); margin-bottom: 8px; }
.tl-next-title { font-family: 'Fraunces', Georgia, serif; font-size: 19px; color: var(--navy); margin-bottom: 6px; line-height: 1.3; }
.tl-next-line { font-size: 13.5px; color: var(--muted); margin: 0; }

/* ------------------------------------------------------------------ tools index */
.tl-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 36px; }
.tl-index-card { display: block; background: var(--white); border: 1px solid var(--rule-light); padding: 26px 26px 24px; color: inherit; }
.tl-index-card:hover { border-color: var(--navy); color: inherit; }
.tl-index-card h3 { font-size: 22px; margin: 8px 0 8px; }
.tl-index-card p { font-size: 14px; color: var(--muted); }
.tl-index-card.is-soon { opacity: 0.7; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--navy); }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--paper); padding: 24px 32px; gap: 20px; border-bottom: 1px solid var(--rule-light); }
  .tl-main { padding-top: 110px; }
  .container { padding: 0 20px; }
  .tl-risk-grid { grid-template-columns: 1fr; }
  .tl-start { grid-template-columns: 1fr; }
  .tl-snapshot-head { align-items: flex-start; }
}

/* ------------------------------------------------------------------ print */
@media print {
  @page { margin: 14mm 12mm; }
  @page wide { size: letter landscape; margin: 12mm; }
  body { background: #fff; color: #000; font-size: 10pt; line-height: 1.45; }
  .nav, footer, .tl-noprint, .tl-next, .tl-expand-chevron { display: none !important; }
  .tl-main { padding: 0; min-height: 0; }
  .tl-main .container { max-width: none; padding: 0; }
  .tl-section { padding: 12pt 0; break-inside: auto; }
  .tl-section-title { font-size: 16pt; }
  .tl-section-lead, .tl-tier-desc, .tl-area-note { font-size: 9pt; }
  .tl-expand { break-inside: auto; border-left-width: 2pt; margin-bottom: 5pt; }
  .tl-expand-summary { padding: 6pt 8pt; break-after: avoid; }
  .tl-expand-body { padding: 2pt 8pt 8pt; font-size: 9.5pt; }
  .tl-evidence li, .tl-procs li, .tl-interviews li, .tl-list li { break-inside: avoid; }
  .tl-evidence li, .tl-procs li { margin-bottom: 7pt; }
  .tl-risk { break-inside: avoid; padding: 10pt 12pt; margin-bottom: 7pt; }
  .tl-risk-grid { font-size: 9.5pt; gap: 6pt 16pt; }
  .tl-risk-title { font-size: 13pt; }
  .tl-table-wrap { overflow: visible; border: 0; }
  .tl-table { font-size: 8.5pt; min-width: 0; }
  .tl-table-programme { min-width: 0; }
  .tl-table th, .tl-table td { padding: 4pt 5pt; }
  .tl-table tr { break-inside: avoid; }
  #programme { page: wide; break-before: page; }
  .tl-stat { padding: 8pt 10pt; }
  .tl-stat-n { font-size: 20pt; }
  .tl-summary-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 10pt; }
  .tl-snapshot-lead { font-size: 10pt; }
  .tl-h1-small { font-size: 22pt; }
  .tl-tier { margin-bottom: 10pt; }
  .tl-label-strong { margin: 6pt 0 3pt; }
  a { color: inherit; }
  .tl-pill-profile { background: #000; color: #fff; }
  .tl-pill-tier-core { background: #000; color: #fff; }
}
