/* Pointpath Docs — brand tokens live here; swap these to rebrand. */
:root {
  --ink: #1A2433;
  --ink-2: #4B5667;
  --ink-3: #6E7888;
  --paper: #F5F6F8;
  --surface: #FFFFFF;
  --rule: #D8DDE4;
  --rule-soft: #E7EAEF;
  --path: #0B6E99;          /* the route line + waypoints */
  --path-soft: #CFE3EC;
  --ok: #2E7D4F;
  --gap: #B42318;
  --na: #8A94A3;
  --changed: #B26A00;

  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --radius: 4px;
  --measure: 70ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--path); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--path); outline-offset: 2px; border-radius: 2px; }
code { font-size: .9em; background: var(--rule-soft); padding: .1em .3em; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------- Masthead ---------- */
.masthead {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: .85rem clamp(1rem, 3vw, 2rem);
  background: var(--surface); border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.mark { width: 34px; height: 34px; color: var(--ink); }
.brand-org { font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.brand-site { font-weight: 400; color: var(--ink-3); font-size: 1.1rem; }
.masthead-client { margin: 0; color: var(--ink-2); padding-left: 1.5rem; border-left: 1px solid var(--rule); }
.masthead-client a { color: var(--ink); font-weight: 600; text-decoration: none; }
.masthead-nav { margin-left: auto; display: flex; gap: 1.25rem; }
.masthead-nav a { color: var(--ink-2); text-decoration: none; }
.masthead-nav a:hover { color: var(--path); text-decoration: underline; }

.sitefoot { margin-top: auto; padding: 1.5rem clamp(1rem, 3vw, 2rem); color: var(--ink-3); font-size: .85rem; border-top: 1px solid var(--rule); }
.sitefoot p { margin: 0; max-width: var(--measure); }

/* ---------- Three-column doc shell ---------- */
.shell {
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: clamp(1.5rem, 3vw, 3rem);
  padding: 2rem clamp(1rem, 3vw, 2rem) 4rem; max-width: 1380px; width: 100%; margin: 0 auto;
}

/* Waypoint nav: the brand's route line. */
.pathnav { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow: auto; }
.pathnav-title { font-weight: 700; font-size: .95rem; margin-bottom: 1rem; cursor: default; list-style: none; }
.pathnav-title::-webkit-details-marker { display: none; }
.waypoints { list-style: none; margin: 0; padding: 0; position: relative; }
.waypoints::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--path-soft); }
.wp { position: relative; padding: 0 0 1rem 1.75rem; }
.wp-dot {
  position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--path);
}
.mode-client .wp[data-progress] .wp-dot {
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface) 0);
  border-color: var(--ok);
}
.wp.is-current .wp-dot { box-shadow: 0 0 0 4px var(--path-soft); }
.mode-library .wp.is-current .wp-dot { background: var(--path); }
.wp a { color: var(--ink-2); text-decoration: none; display: block; line-height: 1.35; }
.wp a:hover { color: var(--path); }
.wp.is-current a { color: var(--ink); font-weight: 600; }
.wp small { display: block; color: var(--ink-3); font-weight: 400; font-size: .8rem; margin-top: .15rem; }
.pathnav-links { display: flex; flex-direction: column; gap: .4rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .9rem; }

/* ---------- Doc column ---------- */
.doc { min-width: 0; }
.doc-lib { margin: 0 0 .35rem; color: var(--ink-3); font-size: .9rem; }
.doc h1, .dash h1, .home h1, .login h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; margin: 0 0 .75rem; max-width: 30ch; text-wrap: balance; }
.lede { font: 400 1.15rem/1.55 var(--serif); color: var(--ink-2); max-width: var(--measure); margin: 0 0 1rem; }
.applies { color: var(--ink-2); margin: 0 0 1.5rem; }

.prose {
  position: relative; padding-left: 2.25rem; margin-top: 2rem;
  font: 400 17px/1.65 var(--serif); max-width: calc(var(--measure) + 2.25rem);
}
/* the path line running down the page, linking every requirement */
.prose::before { content: ""; position: absolute; left: 7px; top: .4rem; bottom: 0; width: 2px; background: linear-gradient(var(--path-soft), var(--path-soft)) no-repeat; }
.prose h2 { font: 700 1.45rem/1.25 var(--sans); letter-spacing: -.01em; margin: 2.75rem 0 .75rem; position: relative; scroll-margin-top: 1rem; }
.prose h2::before { content: ""; position: absolute; left: calc(-2.25rem + 1px); top: .35em; width: 14px; height: 14px; background: var(--path); border-radius: 2px; transform: rotate(45deg); }
.prose h3 { font: 600 1.1rem/1.3 var(--sans); margin: 2rem 0 .5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin-bottom: .35rem; }
.prose table { width: 100%; border-collapse: collapse; font: 400 14px/1.45 var(--sans); margin: 1rem 0 1.5rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .55rem .7rem; border-bottom: 1px solid var(--rule); }
.prose thead th { font-weight: 600; color: var(--ink-2); border-bottom: 2px solid var(--ink); white-space: nowrap; }

/* ---------- Requirement blocks ---------- */
.req {
  position: relative; margin: 1.25rem 0 1.5rem; padding: 1rem 1.25rem 1.1rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  font: 400 15px/1.55 var(--sans); scroll-margin-top: 1rem;
}
.mode-client .req, .mode-client .prose h2 { scroll-margin-top: 4.5rem; }
.req:target { border-color: var(--path); box-shadow: 0 0 0 3px var(--path-soft); }
.req-marker { position: absolute; left: calc(-2.25rem - 1px); top: 1.15rem; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--path); }
/* marker shape + colour encode status (shape alone is enough to read it) */
.state-ref .req-marker { width: 12px; height: 12px; left: calc(-2.25rem + 2px); top: 1.3rem; background: var(--path); }
.state-confirmed .req-marker { background: var(--ok); border-color: var(--ok); }
.state-confirmed .req-marker::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.state-na .req-marker { border-color: var(--na); }
.state-na .req-marker::after { content: ""; position: absolute; left: 3px; right: 3px; top: 6px; height: 2px; background: var(--na); }
.state-gap .req-marker { border-radius: 2px; transform: rotate(45deg); background: var(--gap); border-color: var(--gap); }
.state-changed .req-marker { border-color: var(--changed); background: linear-gradient(90deg, var(--changed) 50%, var(--surface) 50%); }
.state-gap { border-color: color-mix(in srgb, var(--gap) 45%, var(--rule)); }
.state-changed { border-color: color-mix(in srgb, var(--changed) 45%, var(--rule)); }

.req-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .75rem; margin-bottom: .5rem; }
.req-id { font-weight: 700; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.req-id:hover { color: var(--path); }
.req-pri { font-size: .85rem; color: var(--ink-2); }
.req-pri::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .35rem; border-radius: 50%; background: var(--ink-2); vertical-align: 1px; }
.pri-required::before { background: var(--ink); }
.pri-conditional::before { background: transparent; border: 1.5px solid var(--ink-2); }
.pri-recommended::before { background: var(--na); }
.pri-open-question::before { background: var(--changed); }
.req-flag { font-size: .8rem; color: var(--changed); border: 1px solid currentColor; padding: 0 .4rem; border-radius: 999px; }
.req-applies { font-size: .85rem; color: var(--ink-3); margin-left: auto; }
.req-text p { margin: 0 0 .6rem; }
.req-text p:last-child { margin-bottom: 0; }
.req-meta { margin: .8rem 0 0; display: grid; gap: .3rem; font-size: .88rem; border-top: 1px solid var(--rule-soft); padding-top: .65rem; }
.req-meta div { display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; }
.req-meta dt { color: var(--ink-3); }
.req-meta dd { margin: 0; color: var(--ink-2); }

/* status form */
.req-form { margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--rule); }
.req-choices { border: 0; margin: 0 0 .7rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-block; padding: .3rem .75rem; border: 1px solid var(--rule); border-radius: 999px; cursor: pointer; font-size: .88rem; color: var(--ink-2); background: var(--surface); }
.choice:hover span { border-color: var(--ink-3); }
.choice input:focus-visible + span { outline: 2px solid var(--path); outline-offset: 2px; }
.choice input:checked + span { color: #fff; border-color: transparent; }
.choice-open input:checked + span { background: var(--ink-2); }
.choice-confirmed input:checked + span { background: var(--ok); }
.choice-na input:checked + span { background: var(--na); }
.choice-gap input:checked + span { background: var(--gap); }
.req-note { display: block; font-size: .85rem; color: var(--ink-3); }
.req-note small { font-size: inherit; }
.req-note textarea { display: block; width: 100%; margin-top: .25rem; font: 400 14px/1.45 var(--sans); padding: .45rem .6rem; border: 1px solid var(--rule); border-radius: var(--radius); resize: vertical; color: var(--ink); }
.req-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; }
.req-who { margin: 0; color: var(--ink-3); font-size: .85rem; }
.req-changed { margin: .6rem 0 0; color: var(--changed); font-size: .88rem; }
.req-error { margin: .6rem 0 0; color: var(--gap); font-size: .88rem; }
.req.is-saved .req-who { color: var(--ok); }

button, .btn {
  font: 600 14px/1 var(--sans); padding: .6rem 1rem; border-radius: var(--radius); cursor: pointer;
  background: var(--ink); color: #fff; border: 1px solid var(--ink); text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { background: var(--path); border-color: var(--path); color: #fff; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover { background: var(--surface); color: var(--path); border-color: var(--path); }
button[disabled] { opacity: .6; cursor: progress; }

/* filter bar */
.filterbar { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.25rem 0 0; position: sticky; top: 0; background: var(--paper); padding: .6rem 0; z-index: 2; }
.filterbar button { background: var(--surface); color: var(--ink-2); border-color: var(--rule); font-weight: 500; padding: .4rem .75rem; }
.filterbar button span { color: var(--ink-3); margin-left: .2rem; }
.filterbar button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.filterbar button[aria-pressed="true"] span { color: #C9D0DA; }
.req.is-filtered { display: none; }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); max-width: calc(var(--measure) + 2.25rem); }
.pager a { text-decoration: none; font-weight: 600; color: var(--ink); }
.pager a:hover { color: var(--path); }
.pager small { display: block; font-weight: 400; color: var(--ink-3); }
.pager-next { margin-left: auto; text-align: right; }

.toc { position: sticky; top: 1rem; align-self: start; font-size: .88rem; }
.toc p { margin: 0 0 .5rem; color: var(--ink-3); }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 .75rem; border-left: 1px solid var(--rule); }
.toc li { margin: 0 0 .45rem; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--path); }

/* ---------- Home ---------- */
.home { max-width: 980px; width: 100%; margin: 0 auto; padding: 3.5rem clamp(1rem, 3vw, 2rem) 4rem; }
.home h1 { max-width: 20ch; font-size: clamp(2rem, 4.5vw, 3rem); }
.home-intro p { font: 400 1.15rem/1.6 var(--serif); color: var(--ink-2); max-width: 60ch; }
.libraries { list-style: none; margin: 3rem 0 0; padding: 0 0 0 2.25rem; position: relative; }
.libraries::before { content: ""; position: absolute; left: 7px; top: .6rem; bottom: .6rem; width: 2px; background: var(--path-soft); }
.library { position: relative; padding-bottom: 2rem; }
.library::before { content: ""; position: absolute; left: calc(-2.25rem); top: .45rem; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--path); }
.library h2 { margin: 0 0 .35rem; font-size: 1.35rem; }
.library h2 a { color: var(--ink); text-decoration: none; }
.library h2 a:hover { color: var(--path); }
.library p { margin: 0 0 .35rem; max-width: 64ch; color: var(--ink-2); }
.library-facts { color: var(--ink-3) !important; font-size: .9rem; }
.empty { color: var(--ink-3); }

/* ---------- Dashboard / tables ---------- */
.dash { max-width: 1100px; width: 100%; margin: 0 auto; padding: 2.5rem clamp(1rem, 3vw, 2rem) 4rem; }
.dash-sub { color: var(--ink-2); margin: 0 0 1.25rem; font-size: 1.05rem; }
.dash-actions { display: flex; gap: .6rem; margin: 1.25rem 0 0; flex-wrap: wrap; }
.dash-lib { margin-top: 2.75rem; }
.dash-lib h2, .attention h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
.dash-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); }
.dash-table th, .dash-table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.dash-table thead th { font-weight: 600; font-size: .85rem; color: var(--ink-3); border-bottom: 1px solid var(--rule); }
.dash-table tbody th { font-weight: 600; }
.dash-table tbody th a { color: var(--ink); text-decoration: none; }
.dash-table tbody th a:hover { color: var(--path); }
.dash-table td:last-child { width: 40%; }
.history td:last-child { width: auto; }

.progress-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--rule-soft); max-width: 640px; gap: 2px; }
.is-compact .progress-bar { height: 8px; }
.seg { display: block; min-width: 3px; }
.seg-confirmed { background: var(--ok); }
.seg-na { background: var(--na); }
.seg-gap { background: var(--gap); }
.seg-changed { background: var(--changed); }
.seg-open { background: var(--rule); }
.progress-key { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 0; margin: .75rem 0 0; color: var(--ink-2); font-size: .9rem; }
.progress-key li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .4rem; vertical-align: -1px; background: var(--rule); }
.key-confirmed::before { background: var(--ok) !important; }
.key-na::before { background: var(--na) !important; }
.key-gap::before { background: var(--gap) !important; }
.key-changed::before { background: var(--changed) !important; }

.attention { margin-top: 2.5rem; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--gap); border-radius: var(--radius); }
.attention ul { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; gap: .75rem; padding: .35rem 0; border-top: 1px solid var(--rule-soft); }
.attention li:first-child { border-top: 0; }
.attention a { font-weight: 700; min-width: 5rem; }
.att-changed a { color: var(--changed); }

.pill { font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; background: var(--rule-soft); color: var(--ink-2); white-space: nowrap; }
.pill-confirmed { background: #DDEFE3; color: var(--ok); }
.pill-gap { background: #FBE2DF; color: var(--gap); }
.pill-na { background: var(--rule-soft); }

/* ---------- Login ---------- */
.login { max-width: 420px; width: 100%; margin: 0 auto; padding: 4rem 1.25rem; }
.login h1 { font-size: 1.8rem; }
.login p { color: var(--ink-2); }
.login form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.login label { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
.login input { font: 400 15px/1.4 var(--sans); padding: .6rem .7rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.login button { justify-self: start; }
.form-error { color: var(--gap) !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 230px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; padding-top: 1rem; }
  .pathnav { position: static; max-height: none; border-bottom: 1px solid var(--rule); padding-bottom: .5rem; }
  .pathnav-title { cursor: pointer; list-style: revert; }
  .masthead-client { border-left: 0; padding-left: 0; width: 100%; order: 3; }
  .prose { padding-left: 1.6rem; }
  .prose h2::before { left: calc(-1.6rem + 1px); }
  .req-marker { left: calc(-1.6rem - 1px); }
  .state-ref .req-marker { left: calc(-1.6rem + 2px); }
  .req-meta div { grid-template-columns: 1fr; gap: 0; }
  .dash-table td:last-child { width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- Print: a clean sign-off record ---------- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .masthead-nav, .pathnav, .toc, .pager, .filterbar, .skip, .req-choices, .req-form button, .dash-actions { display: none !important; }
  .shell { display: block; padding: 0; }
  .prose { font-size: 11pt; max-width: none; }
  .req { break-inside: avoid; border-color: #999; }
  .req.is-filtered { display: block; }
  .req-note textarea { border: 0; padding: 0; resize: none; }
  .req-form { border-top-style: solid; }
  a { color: inherit; }
}
