/* DEPC client portal. Light theme, local fonts only. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/archivo-latin-700-normal.woff2") format("woff2"); }

:root {
  --ink: #14212c;
  --ink-2: #22313e;
  --ink-line: #34465a;
  --on-ink: #e7edf2;
  --on-ink-2: #a9b8c5;
  --text: #17232d;
  --text-2: #475665;
  --paper: #edf0f2;
  --surface: #ffffff;
  --line: #d2d9df;
  --line-soft: #e6eaee;
  --accent: #0a5b7a;
  --accent-hover: #07465f;
  --accent-tint: #e1eef3;
  --grid: rgba(10, 91, 122, 0.07);
  --ok: #1e6f43;
  --ok-tint: #dcefe3;
  --cond: #6b4500;
  --cond-tint: #f7e4b5;
  --cond-line: #d6a537;
  --danger: #a8201a;
  --danger-tint: #fbe4e2;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-display: "Archivo", "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid #2f8fb5; outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--text); margin: 0; letter-spacing: -0.005em; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 700; }
h2 { font-size: 19px; line-height: 1.25; font-weight: 600; }
h3 { font-size: 16px; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { top: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------------ top bar */
.topbar { background: var(--ink); color: var(--on-ink); }
.topbar .wrap { display: flex; align-items: center; gap: 28px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--on-ink); text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: 0.04em; }
.brand-sub { font-size: 13px; color: var(--on-ink-2); }
.topnav { display: flex; gap: 4px; flex: 1 1 auto; }
.topnav a { color: var(--on-ink); text-decoration: none; padding: 6px 10px; border-radius: 5px; font-weight: 500; font-size: 14px; }
.topnav a:hover { background: var(--ink-2); color: #fff; }
.topnav a[aria-current="page"] { background: var(--ink-2); box-shadow: inset 0 -2px 0 #6fb7d3; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--on-ink-2); }
.who strong { color: var(--on-ink); font-weight: 500; }
.who a { color: var(--on-ink-2); }
.who form { margin: 0; }
.btn-ink { font: inherit; font-size: 13px; color: var(--on-ink); background: transparent; border: 1px solid var(--ink-line); border-radius: 5px; padding: 4px 10px; cursor: pointer; }
.btn-ink:hover { border-color: var(--on-ink-2); color: #fff; }

/* ------------------------------------------------------------------ page head */
.pagehead { padding: 28px 0 0; }
.pagehead .wrap { display: flex; flex-direction: column; gap: 6px; }
.crumbs { font-size: 13px; color: var(--text-2); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); }
.headrow { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.headrow .lead { max-width: 70ch; color: var(--text-2); margin-top: 4px; }
.idline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.idline .pid { font-family: var(--mono); font-weight: 500; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; }

.tabs { margin-top: 18px; border-bottom: 1px solid var(--line); }
.tabs .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { display: block; padding: 10px 14px 11px; color: var(--text-2); text-decoration: none; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-family: var(--mono); font-size: 12px; color: var(--text-2); margin-left: 4px; }

.content { padding: 24px 0 56px; }
.content .wrap { display: flex; flex-direction: column; gap: 24px; }

/* ------------------------------------------------------------------ panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-body { padding: 16px 20px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* ------------------------------------------------------------------ messages */
.notice { padding: 11px 16px; border-radius: 6px; border: 1px solid; font-size: 14px; }
.notice-ok { background: var(--ok-tint); border-color: #9fcdb1; color: #174f31; }
.notice-err { background: var(--danger-tint); border-color: #e7a7a2; color: #7c1712; }
.notice-info { background: var(--accent-tint); border-color: #a9cddb; color: #0b4058; }
.empty { padding: 28px 20px; color: var(--text-2); max-width: 70ch; }

/* ------------------------------------------------------------------ tables */
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; font-size: 13px; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f6f8f9; white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data th:first-child, table.data td:first-child { padding-left: 20px; }
table.data th:last-child, table.data td:last-child { padding-right: 20px; }
table.data .code { font-family: var(--mono); font-weight: 500; white-space: nowrap; }
table.data tr.internal td { background: #fafbfc; }
.rowlink { font-weight: 600; text-decoration: none; }
.rowlink:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ tags */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; line-height: 1.2; padding: 3px 8px; border-radius: 4px; border: 1px solid transparent; white-space: nowrap; }
.tag-plain { background: #eef1f4; color: #3c4955; border-color: #d8dee4; }
.sev-critical { background: var(--danger); color: #fff; }
.sev-finding { background: #fbe1d3; color: #8a370b; border-color: #eaa77f; }
.sev-warning { background: #faeec8; color: #674700; border-color: #dfbf5f; }
.sev-info { background: #e3ecf4; color: #24527a; border-color: #acc5da; }
.fst-open { background: var(--surface); color: var(--text); border-color: #9aa8b4; }
.fst-resolved, .fst-accepted_by_client { background: var(--ok-tint); color: #195a37; border-color: #a5cfb5; }
.fst-rejected_by_client { background: var(--danger-tint); color: #7c1712; border-color: #e7a7a2; }
.fst-withdrawn { background: #eef1f4; color: #5b6874; text-decoration: line-through; }
.dst-draft { background: #eef1f4; color: #3c4955; border-color: #d3dae0; }
.dst-issued_for_review { background: var(--accent-tint); color: #0b4a63; border-color: #a9cddb; }
.dst-approved { background: var(--ok-tint); color: #195a37; border-color: #a5cfb5; }
.dst-superseded { background: #eef1f4; color: #66727d; text-decoration: line-through; }
.dec-approve, .dec-accept { color: var(--ok); }
.dec-reject { color: var(--danger); }
.dec-approve_with_comments, .dec-request_change { color: var(--cond); }
.vis-internal { background: #fff; color: #5b6874; border: 1px dashed #9aa8b4; }
.vis-changed { background: #fff6df; color: #5a3d00; border: 1px dashed #c9a24a; }

/* gate chips: equipment-tag look; status carried by fill, border and label */
.gate { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; line-height: 1.2; padding: 3px 8px 3px 3px; border-radius: 4px; border: 1px solid #b6c1ca; background: var(--surface); color: var(--text-2); white-space: nowrap; text-decoration: none; }
.gate .gid { font-family: var(--mono); font-weight: 500; font-size: 12px; padding: 1px 5px; border-radius: 3px; background: #e9edf0; color: var(--text); }
.gate-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.gate-done .gid { background: rgba(255,255,255,0.2); color: #fff; }
.gate-done_with_conditions { background: var(--cond-tint); border-color: var(--cond-line); color: var(--cond); }
.gate-done_with_conditions .gid { background: rgba(255,255,255,0.6); color: var(--cond); }
.gate-skipped { background: repeating-linear-gradient(135deg, #eef1f4 0 6px, #e0e5ea 6px 12px); border-color: #aab5bf; color: #3f4b56; }
.gate-skipped .gid { background: #fff; }
.gate-proposed_done { background: var(--accent-tint); border: 1px dashed var(--accent); color: var(--accent); }
.gate-proposed_done .gid { background: #fff; color: var(--accent); }

/* ------------------------------------------------------------------ life cycle strip
   Drawn like a strip log: phases are intervals along one string, the gate that
   closes each phase sits on the boundary like a casing shoe. */
.lifecycle-panel { background-color: var(--surface); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 100% 12px, 24px 100%; }
.lifecycle { list-style: none; margin: 0; padding: 8px 20px 18px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.lc-step { position: relative; display: flex; flex-direction: column; gap: 8px; padding-right: 6px; min-width: 0; }
.lc-label { display: flex; flex-direction: column; gap: 0; min-height: 44px; padding-right: 4px; }
.lc-code { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.lc-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.lc-pipe { position: relative; height: 14px; margin-right: -6px; border: 2px solid #9fb0bd; border-right: 0; background: var(--surface); }
.lc-step:last-child .lc-pipe { border-right: 2px solid #9fb0bd; margin-right: 0; }
.lc-past .lc-pipe { background: var(--ink-2); border-color: var(--ink-2); }
.lc-current .lc-pipe { background: repeating-linear-gradient(90deg, var(--accent) 0 10px, #2c7fa0 10px 20px); border-color: var(--accent); }
.lc-current .lc-name::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.lc-shoe { position: absolute; right: -7px; top: -5px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid #6e8191; z-index: 1; }
.lc-past .lc-shoe { border-top-color: var(--ink); }
.lc-step:last-child .lc-shoe { right: -6px; }
.lc-gate .gate { white-space: normal; }
.lc-gate { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 40px; }
.lc-gate .gate-name { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.lc-now { font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--accent); }
.lc-legend { padding: 0 20px 14px; font-size: 13px; color: var(--text-2); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* mini strip in the project list */
.mini { display: flex; align-items: center; gap: 0; min-width: 170px; }
.mini span { flex: 1 1 0; height: 8px; border: 1.5px solid #9fb0bd; border-right-width: 0; background: #fff; position: relative; }
.mini span:last-child { border-right-width: 1.5px; }
.mini .m-past { background: var(--ink-2); border-color: var(--ink-2); }
.mini .m-current { background: var(--accent); border-color: var(--accent); }
.mini span i { position: absolute; right: -3px; top: -6px; width: 5px; height: 5px; border-radius: 1px; background: #b6c1ca; }
.mini span i.g-done { background: var(--ok); }
.mini span i.g-done_with_conditions { background: var(--cond-line); }
.mini span i.g-proposed_done { background: var(--accent); }
.mini span i.g-skipped { background: #7d8a96; }

/* ------------------------------------------------------------------ facts and counts */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 14px; }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.sevcounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sevcount { display: flex; flex-direction: column; gap: 4px; padding: 14px 20px; text-decoration: none; color: var(--text); border-left: 1px solid var(--line-soft); }
.sevcount:first-child { border-left: 0; }
.sevcount:hover { background: #f6f8f9; color: var(--text); }
.sevcount .n { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; }
.sevcount.zero .n { color: #a2adb7; }
.sevcount .bar { height: 4px; border-radius: 2px; background: var(--line-soft); }
.sevcount.s-critical .bar { background: var(--danger); }
.sevcount.s-finding .bar { background: #d9773f; }
.sevcount.s-warning .bar { background: #d8b13e; }
.sevcount.s-info .bar { background: #5d8db5; }
.sevcount.zero .bar { background: var(--line-soft); }

/* ------------------------------------------------------------------ forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .field .label { font-weight: 500; font-size: 14px; }
.field .help { font-size: 13px; color: var(--text-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid #aeb9c3; border-radius: 6px; padding: 8px 10px; width: 100%; max-width: 100%;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid rgba(10,91,122,0.25); outline-offset: 0; }
input[type="file"] { padding: 6px; background: #f8fafb; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.choices legend { font-weight: 500; font-size: 14px; margin-bottom: 6px; padding: 0; }
.choice { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid #aeb9c3; border-radius: 6px; background: #fff; cursor: pointer; font-size: 14px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input { margin: 0; accent-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.btn { font: inherit; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-quiet { background: #fff; color: var(--text); border-color: #aeb9c3; }
.btn-quiet:hover { background: #f2f5f7; color: var(--text); border-color: #8d9aa6; }
.btn-danger { background: #fff; color: var(--danger); border-color: #e0a19c; }
.btn-danger:hover { background: var(--danger-tint); color: #7c1712; border-color: var(--danger); }
.btn-sm { font-size: 13px; padding: 4px 10px; font-weight: 500; }
.inline { display: inline; margin: 0; }

/* filters */
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px 20px; }
.filters .field { min-width: 150px; flex: 0 1 190px; }
.filters .field label { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* ------------------------------------------------------------------ findings */
.findings { list-style: none; margin: 0; padding: 0; }
.finding { border-top: 1px solid var(--line-soft); padding: 16px 20px; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 16px; scroll-margin-top: 12px; }
.finding:first-child { border-top: 0; }
.finding:target { background: #f5fafc; box-shadow: inset 3px 0 0 var(--accent); }
.finding .fid { font-family: var(--mono); font-weight: 500; font-size: 13px; padding-top: 2px; }
.finding .fid small { display: block; color: var(--text-2); font-weight: 400; }
.finding .fbody { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.finding .ftitle { font-weight: 600; font-size: 15.5px; }
.finding .fmeta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--text-2); }
.finding .fdetail { max-width: 78ch; white-space: pre-line; }
.refs { display: flex; flex-wrap: wrap; gap: 6px; }
.ref { font-family: var(--mono); font-size: 12px; background: #f1f4f6; border: 1px solid var(--line-soft); border-radius: 4px; padding: 2px 6px; color: #33414d; }
.resolution { border-left: 3px solid #a5cfb5; padding: 4px 12px; background: #f5faf7; font-size: 14px; }
.declog { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.declog li { border-left: 2px solid var(--line); padding: 2px 0 2px 10px; }
.declog .d { font-weight: 600; }
details.decide { border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; }
details.decide > summary { cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 14px; color: var(--accent); list-style: none; }
details.decide > summary::-webkit-details-marker { display: none; }
details.decide > summary::before { content: "+"; display: inline-block; width: 14px; font-family: var(--mono); }
details.decide[open] > summary::before { content: "\2212"; }
details.decide .form { padding: 4px 12px 14px; max-width: 820px; }

/* ------------------------------------------------------------------ gates */
.gates { list-style: none; margin: 0; padding: 0; }
.gaterow { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px 24px; padding: 18px 20px; border-top: 1px solid var(--line-soft); scroll-margin-top: 12px; }
.gaterow:first-child { border-top: 0; }
.gaterow:target { background: #f5fafc; }
.gatehead { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.gatehead .gname { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.gatehead .gphase { font-size: 13px; color: var(--text-2); }
.gatebody { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gatebody ul { margin: 0; padding-left: 18px; }
.lock { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #5a3d00; background: #fff6df; border: 1px solid #e8cd86; border-radius: 4px; padding: 2px 7px; }
.proposal { border: 1px dashed var(--accent); background: var(--accent-tint); border-radius: 6px; padding: 10px 14px; color: #0b4058; font-size: 14px; }
.history { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.history li { padding: 10px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.history li:first-child { border-top: 0; }
.history .when { color: var(--text-2); font-size: 13px; min-width: 150px; }

/* ------------------------------------------------------------------ project list */
.plist { list-style: none; margin: 0; padding: 0; }
.pitem { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(170px, 1fr) 110px; gap: 16px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.pitem:first-child { border-top: 0; }
.pitem .pname { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pitem .pname a { font-weight: 600; font-size: 16px; text-decoration: none; color: var(--text); }
.pitem .pname a:hover { color: var(--accent); text-decoration: underline; }
.pitem .pid { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.pitem .phase { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.pitem .phase b { color: var(--text); font-weight: 600; }
.pitem.missing { opacity: 0.6; }
.openn { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.openn.zero { color: #a2adb7; }

/* ------------------------------------------------------------------ deliverable detail */
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.files li:first-child { border-top: 0; }
.files .fname { font-family: var(--mono); font-size: 13.5px; overflow-wrap: anywhere; min-width: 0; }
.files .fsha { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); overflow-wrap: anywhere; }
.kv { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.kv b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------ users */
.userrow td .assigned { display: flex; flex-wrap: wrap; gap: 6px; }
.userrow td .assigned form { display: inline-flex; }
.pill-x { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12px; background: #eef1f4; border: 1px solid #d3dae0; border-radius: 4px; padding: 1px 2px 1px 7px; }
.pill-x button { font: inherit; border: 0; background: transparent; color: var(--danger); cursor: pointer; padding: 0 5px; font-size: 14px; line-height: 1; }
.useracts { display: flex; gap: 6px; flex-wrap: wrap; }
.temp { font-family: var(--mono); font-size: 18px; letter-spacing: 0.04em; background: #fff; border: 1px dashed var(--accent); border-radius: 6px; padding: 8px 12px; display: inline-block; user-select: all; }
.checklist { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checklist label { display: inline-flex; gap: 6px; align-items: center; font-family: var(--mono); font-size: 13px; }

/* ------------------------------------------------------------------ audit */
.detail { font-family: var(--mono); font-size: 12px; color: #33414d; overflow-wrap: anywhere; max-width: 60ch; }

/* ------------------------------------------------------------------ login */
body.login { background: var(--surface); }
.login-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.login-side { background: var(--ink); color: var(--on-ink); padding: 48px 56px; display: flex; flex-direction: column; gap: 32px; position: relative; overflow: hidden; }
.login-side .brand-mark { font-size: 22px; }
.login-side h1 { color: #fff; font-size: 34px; max-width: 14ch; }
.login-side p { color: var(--on-ink-2); max-width: 40ch; }
.welltrack { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; display: flex; flex-direction: column; gap: 0; }
.welltrack::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 6px; border-left: 2px solid #5d7387; border-right: 2px solid #5d7387; }
.welltrack li { position: relative; padding: 7px 0; display: flex; gap: 12px; align-items: baseline; color: var(--on-ink-2); font-size: 14px; }
.welltrack li::before { content: ""; position: absolute; left: -28px; top: 15px; width: 20px; border-top: 2px solid #5d7387; }
.welltrack li b { font-family: var(--mono); font-weight: 500; color: var(--on-ink); font-size: 13px; min-width: 22px; }
.welltrack .g { font-family: var(--mono); font-size: 11.5px; color: #7f93a5; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; }
.login-card .btn { width: 100%; padding: 10px 16px; }
.login-foot { font-size: 13px; color: var(--text-2); }

/* ------------------------------------------------------------------ footer */
.foot { border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); padding: 14px 0; background: var(--paper); }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ error */
.errorbox { padding: 40px 0; display: flex; flex-direction: column; gap: 14px; max-width: 60ch; }
.errorbox .status { font-family: var(--mono); color: var(--text-2); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .pitem { grid-template-columns: minmax(0, 1fr) 90px; }
  .pitem .client { grid-column: 1 / 2; }
  .pitem .phase { grid-column: 1 / -1; }
  .lifecycle { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 18px; }
  .lifecycle .lc-step:nth-child(4) .lc-pipe { border-right: 2px solid #9fb0bd; margin-right: 0; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .wrap { padding: 0 16px; }
  h1 { font-size: 23px; }
  .topbar .wrap { gap: 8px 14px; padding-top: 8px; padding-bottom: 8px; }
  .topnav { order: 3; flex-basis: 100%; overflow-x: auto; margin: 0 -6px; }
  .who { margin-left: auto; }
  .who .whoname { display: none; }
  .panel-head, .panel-body, .panel-foot, .filters { padding-left: 16px; padding-right: 16px; }
  table.data th:first-child, table.data td:first-child { padding-left: 16px; }
  table.data th:last-child, table.data td:last-child { padding-right: 16px; }
  /* life cycle turns into a vertical well track */
  .lifecycle { grid-template-columns: minmax(0, 1fr); padding: 12px 16px 16px; row-gap: 0; }
  .lc-step { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 0 12px; padding: 0; }
  .lc-label { grid-column: 2; grid-row: 1; min-height: 0; padding: 4px 0 10px; }
  .lc-pipe, .lc-step:last-child .lc-pipe, .lifecycle .lc-step:nth-child(4) .lc-pipe { grid-column: 1; grid-row: 1 / span 2; height: auto; width: 14px; margin: 0; border: 2px solid #9fb0bd; border-bottom: 0; }
  .lc-step:last-child .lc-pipe { border-bottom: 2px solid #9fb0bd; }
  .lc-past .lc-pipe { border-color: var(--ink-2); }
  .lc-current .lc-pipe { background: repeating-linear-gradient(180deg, var(--accent) 0 10px, #2c7fa0 10px 20px); }
  .lc-shoe, .lc-step:last-child .lc-shoe { right: auto; left: 12px; top: auto; bottom: -1px; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 9px solid #6e8191; border-right: 0; }
  .lc-past .lc-shoe { border-left-color: var(--ink); border-top-color: transparent; }
  .lc-gate { grid-column: 3; grid-row: 1 / span 2; align-items: flex-end; justify-content: flex-end; padding-bottom: 6px; min-height: 0; text-align: right; }
  .sevcounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sevcount:nth-child(3) { border-left: 0; }
  .sevcount:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .finding { grid-template-columns: minmax(0, 1fr); }
  .gaterow { grid-template-columns: minmax(0, 1fr); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .pitem { grid-template-columns: minmax(0, 1fr) 70px; gap: 10px; padding: 14px 16px; }
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-side { padding: 28px 20px; gap: 16px; }
  .login-side h1 { font-size: 26px; }
  .login-side .welltrack { display: none; }
  .login-main { align-items: flex-start; padding: 28px 16px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .hide-sm { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm thead { display: none; }
  table.stack-sm tr { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
  table.stack-sm tr:last-child { border-bottom: 0; }
  table.data.stack-sm td { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 3px 0; border: 0; }
  table.data.stack-sm td { justify-items: start; }
  table.data.stack-sm td > * { grid-column: 2; }
  table.data.stack-sm td::before { content: attr(data-label); color: var(--text-2); font-size: 13px; font-family: var(--font); font-weight: 400; }
  .filters .field { flex: 1 1 140px; }
  table.data .tag { white-space: normal; }
  .tabs a { padding: 10px 10px 11px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

@media print {
  .topbar, .tabs, .foot, details.decide, form { display: none !important; }
  body { background: #fff; }
  .panel { border-color: #999; }
}
.gate-noid { padding-left: 8px; }
.assigned form.row { gap: 6px; flex-wrap: nowrap; }
.assigned select { width: auto; padding: 4px 8px; font-size: 13px; }
.headrow form.row select { width: auto; min-width: 180px; }
.headrow form.row { flex-wrap: nowrap; }
