/* Certification console — the brand, applied to a working tool.
 *
 * Tokens come from tokenizationexpert.com: DM Sans, white ground, near-black
 * ink, hairline #e5e5e5 rules, 4px radius, pill primary buttons, and an almost
 * monochrome palette. Colour is reserved for status — severity and workflow
 * state are the only things allowed to be loud.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --paper:      #ffffff;
  --paper-2:    #fafafa;   /* sidebar and inset panels */
  --paper-3:    #f0f0f0;   /* hover */
  --card:       #ffffff;

  --ink:        #171717;
  --ink-2:      #525252;
  --muted:      #737373;
  --faint:      #a3a3a3;

  --rule:       #e5e5e5;
  --rule-2:     #d4d4d4;

  /* the brand is monochrome: the accent is ink itself */
  --bronze:     #171717;
  --bronze-2:   #525252;
  --bronze-bg:  #f5f5f5;

  --r:          4px;

  /* status — the one place colour carries meaning */
  --critical:   #b3361c;
  --high:       #9a6512;
  --moderate:   #8a7412;
  --low:        #4a6a8a;
  --done:       #2f7d54;

  --nav-w:      230px;
  --serif:      'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --display:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:       'IBM Plex Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }
body {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
ul, ol { list-style: none; }
a { color: var(--bronze); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: #e5e9eb; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.is-hidden { display: none !important; }

/* small-caps label, used everywhere a column or a section is named */
.lbl {
  font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}

/* ═══════════════════════════════════ gate ═══════════════════════════════════ */

.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); padding: 24px;
}
.gate__card { width: 380px; max-width: 100%; text-align: center; }
.gate__mark {
  font-family: var(--display); font-size: 24px; letter-spacing: -0.01em;
  font-weight: 700; color: var(--ink); line-height: 1.2;
}
.gate__sub { margin-top: 6px; }
.gate__lead { font-size: 12.5px; color: var(--muted); margin-top: 28px; line-height: 1.7; }
.gate form { margin-top: 26px; text-align: left; }
.gate label { display: block; margin-bottom: 7px; }
.gate input {
  width: 100%; background: var(--card); border: 1px solid var(--rule-2);
  padding: 10px 12px; font-size: 13px;
}
.gate input:focus { border-color: var(--bronze-2); outline: none; }
.gate .btn { width: 100%; justify-content: center; margin-top: 14px; padding: 10px; }
.gate__err { min-height: 18px; font-size: 12px; color: var(--critical); margin-top: 8px; }
.gate__note { font-size: 11px; color: var(--faint); margin-top: 24px; line-height: 1.7; }

/* ═══════════════════════════════════ shell ══════════════════════════════════ */

.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }

.nav {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--paper-2); border-right: 1px solid var(--rule);
}
.nav__mark { padding: 22px 20px 20px; }
.nav__title {
  display: block; font-family: var(--display); font-size: 17px;
  letter-spacing: -0.01em; font-weight: 700; line-height: 1.25;
}
.nav__sub { display: block; margin-top: 7px; }

.nav__items { padding: 8px 0; border-top: 1px solid var(--rule); flex: 1; }
.nav__i {
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 8px 20px; font-size: 13px; color: var(--ink-2);
  border-left: 2px solid transparent; text-align: left;
}
.nav__i svg { width: 15px; height: 15px; flex: none; stroke-width: 1.8; opacity: .8; }
.nav__i:hover { background: var(--paper-3); color: var(--ink); }
.nav__i.is-on { background: var(--paper-3); color: var(--ink); border-left-color: var(--ink); font-weight: 600; }
.nav__i .n {
  margin-left: auto; font-size: 10.5px; color: var(--muted);
}
.nav__i.is-on .n { color: var(--bronze-2); }

.nav__foot { padding: 16px 20px 20px; border-top: 1px solid var(--rule); }
.nav__user { display: block; font-size: 13px; margin-top: 8px; }
.nav__role { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.nav__out { font-size: 11.5px; color: var(--bronze); margin-top: 12px; display: inline-block; }

/* ═══════════════════════════════════ page ═══════════════════════════════════ */

.main { display: flex; flex-direction: column; min-width: 0; }

.phead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 18px 26px 16px; border-bottom: 1px solid var(--rule);
}
.phead__t { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin-top: 4px; }
.phead__meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 9px; font-size: 12px; color: var(--muted); }
.phead__meta b { font-weight: 500; color: var(--ink); }
.phead__acts { display: flex; gap: 8px; flex: none; }

.view { padding: 22px 26px 60px; }
.view--split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; }

/* ═══════════════════════════════ controls ══════════════════════════════════ */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--rule-2); background: var(--card);
  padding: 8px 18px; font-size: 12.5px; font-weight: 500; color: var(--ink);
  border-radius: 100px; transition: all .2s ease;
}
.btn:hover { border-color: var(--ink); }
.btn--go { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn--go:hover { background: #262626; border-color: #262626; }
.btn svg { width: 13px; height: 13px; }
.mini { font-size: 11.5px; color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; padding: 2px 0; }
.mini:hover { color: var(--ink-2); }

.filters { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.filters input[type="search"], .search {
  width: 300px; background: var(--card); border: 1px solid var(--rule-2);
  padding: 8px 14px; font-size: 12.5px; border-radius: 100px;
}
.search::placeholder { color: var(--faint); }
.search:focus { border-color: var(--ink); outline: none; }

.seg { display: flex; border: 1px solid var(--rule-2); background: var(--card); width: max-content; border-radius: 100px; overflow: hidden; }
.seg button {
  padding: 7px 15px; font-size: 12px; font-weight: 500; color: var(--ink-2);
  border-right: 1px solid var(--rule-2);
}
.seg button:last-child { border-right: none; }
.seg button:hover { background: var(--paper-2); }
.seg button.is-on { background: var(--ink); color: #fff; }
.seg button .n { color: var(--muted); margin-left: 6px; font-size: 11px; }
.seg button.is-on .n { color: #a3a3a3; }

/* ═══════════════════════════════ stat tiles ════════════════════════════════ */

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--rule); background: var(--card); border-radius: var(--r); overflow: hidden; margin-bottom: 30px; }
.tile { padding: 18px 20px 16px; border-right: 1px solid var(--rule); }
.tile:last-child { border-right: none; }
.tile b {
  display: block; font-family: var(--display); font-size: 30px; font-weight: 600;
  line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.tile span { display: block; margin-top: 10px; }
.tile--warn b { color: var(--critical); }

/* ═══════════════════════════════════ table ══════════════════════════════════ */

.tsec { margin-bottom: 34px; }
.tsec__h { margin-bottom: 4px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.tsec__d { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

.tbl { width: 100%; border-collapse: collapse; table-layout: auto; }
.tbl--tight { table-layout: fixed; }
.tbl th {
  text-align: left; padding: 0 14px 9px 0; border-bottom: 1px solid var(--rule-2);
  font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; white-space: nowrap;
}
.tbl th.r, .tbl td.r { text-align: right; padding-right: 14px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl td { padding: 13px 14px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 13px; }
.tbl tbody tr:hover td { background: rgba(32, 31, 29, 0.02); }
.tbl tbody tr.is-click { cursor: pointer; }
.tbl .t-main { display: block; }
.tbl .t-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .dim { color: var(--muted); }

.tag {
  display: inline-block; padding: 2px 8px; background: var(--paper-2);
  border: 1px solid var(--rule); border-radius: 100px; font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2); font-weight: 600;
}
.stage-active { color: var(--bronze); }
.stage-blocked { color: var(--critical); }
.stage-done { color: var(--done); }
.stage-waiting { color: var(--faint); }

/* denser rows: the engagements table carries nine columns, so it earns its space */
.tbl--tight td { padding: 9px 14px 9px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl--tight th { padding-right: 14px; }
/* a right-aligned column still needs a gutter, or its header touches the next one */
.tbl--tight th.r, .tbl--tight td.r { text-align: right; }
.tbl td.strong, .tbl .strong { font-weight: 500; }
.tbl td.nowrap { white-space: nowrap; }
.tbl__group td {
  padding: 16px 0 5px; border-bottom: 1px solid var(--rule-2);
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.tbl tbody tr:first-child .tbl__group td { padding-top: 4px; }

/* finding counts: two figures, never merged into one */
.pip {
  display: inline-block; min-width: 20px; text-align: center; padding: 1px 6px;
  font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  border: 1px solid var(--rule-2); border-radius: 100px; margin-left: 4px;
}
.pip--critical { color: var(--critical); border-color: #d9b3a9; background: #f9efec; }
.pip--high { color: var(--high); border-color: #ddc9a2; background: #faf4e9; }
.pip--ok { color: var(--done); border-color: #b9d2c5; background: #eef5f1; }

/* file coverage, as a figure and a bar */
.cov { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cov__t { display: block; width: 40px; height: 3px; background: var(--paper-3); flex: none; }
.cov__t i { display: block; height: 100%; background: var(--done); }
.cov b {
  font-weight: 400; font-size: 11.5px; color: var(--muted); min-width: 30px; text-align: right;
  font-variant-numeric: lining-nums tabular-nums;
}

/* ═══════════════════════════════ settings ══════════════════════════════════ */

.sel {
  border: 1px solid var(--rule-2); background: var(--card); padding: 5px 8px;
  font-size: 12px; color: var(--ink-2); max-width: 220px; border-radius: var(--r);
}
.sel:hover { border-color: var(--ink-2); }
.sel:focus { border-color: var(--ink); outline: none; }
.sel:disabled { color: var(--faint); background: var(--paper-2); }
.sel--sm { font-size: 11.5px; padding: 5px 6px; }

.sig {
  font-size: 8.5px; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--bronze); border: 1px solid var(--bronze-2); padding: 0 5px; vertical-align: 1px;
}

.budget { border: 1px solid var(--rule); background: var(--card); border-radius: var(--r); padding: 15px 18px 14px; margin-bottom: 24px; }
.budget__h { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.budget__n { font-size: 12.5px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.budget__n b { color: var(--ink); font-weight: 500; }
.budget__bar { height: 4px; background: var(--paper-3); margin-top: 12px; }
.budget__bar i { display: block; height: 100%; background: var(--done); }
.budget__bar i.is-hot { background: var(--critical); }
.budget__range { width: 100%; margin-top: 12px; accent-color: var(--bronze); }

.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--faint); margin-right: 9px; vertical-align: 1px;
}
.dot--on { background: var(--done); }

/* ═══════════════════════════════ side cards ════════════════════════════════ */

.card { border: 1px solid var(--rule); background: var(--card); border-radius: var(--r); margin-bottom: 20px; }
.card__h { padding: 11px 16px; border-bottom: 1px solid var(--rule); }
.card__b { padding: 4px 16px 12px; }
.card__row { padding: 12px 0; border-bottom: 1px solid var(--rule); display: flex; gap: 12px; align-items: flex-start; }
.card__row:last-child { border-bottom: none; }
.card__row > div { min-width: 0; flex: 1; }
.card__t { font-size: 12.5px; line-height: 1.45; }
.card__m { font-size: 11px; color: var(--muted); margin-top: 3px; }
.card__a { font-size: 11.5px; color: var(--bronze); flex: none; }

/* ═════════════════════════════ project detail ══════════════════════════════ */
/* The page scrolls as one document. The two rails stick and scroll internally
   only when taller than the viewport — an inner scrollbox for the main content
   leaves the page bottom dead, which is worse than a long page. */

.pj { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; align-items: start; }
.pj__rail {
  border-right: 1px solid var(--rule); background: var(--paper-2); padding: 18px 18px 40px;
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
}
.pj__mid { min-width: 0; }
.pj__docs {
  border-left: 1px solid var(--rule); background: var(--paper-2); padding: 18px 18px 40px;
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
}

.rail__h { margin-bottom: 6px; }
.rail__sum { font-size: 12px; color: var(--bronze); margin-bottom: 14px; }

/* the workflow spine */
.steps { border-top: 1px solid var(--rule); }
.step {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px;
}
.step__n { font-size: 10.5px; color: var(--faint); }
.step__t { color: var(--muted); line-height: 1.35; }
.step__s { font-size: 10px; letter-spacing: 0.06em; color: var(--faint); }
.step.done .step__t { color: var(--ink-2); }
.step.done .step__s { color: var(--done); }
.step.done .step__n { color: var(--done); }
.step.current { border-left: 2px solid var(--bronze); margin-left: -18px; padding-left: 16px; }
.step.current .step__t { color: var(--ink); font-weight: 500; }
.step.current .step__s { color: var(--bronze); }
.step__phase {
  grid-column: 1 / -1; margin-top: 8px; font-size: 9px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--bronze-2);
}

/* tabs over the middle column — sticky, so the lens survives a long scroll */
.tabs {
  display: flex; gap: 0; padding: 0 24px; border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: var(--paper); z-index: 5;
}
.tab {
  padding: 12px 16px; font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tab .n { font-size: 11px; margin-left: 6px; color: var(--critical); }

.panels { min-width: 0; }
.panel { padding: 20px 24px 60px; }
/* the assistant keeps an internal scroll: a chat needs its composer in view */
.panel--chat {
  display: flex; flex-direction: column; padding: 0;
  height: calc(100vh - 44px); position: sticky; top: 44px;
}

/* ══════════════════════════════ review panel ═══════════════════════════════ */

.sumbar { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--rule); background: var(--card); border-radius: var(--r); overflow: hidden; margin-bottom: 18px; }
.sev { padding: 13px 14px; border-right: 1px solid var(--rule); }
.sev:last-child { border-right: none; }
.sev b {
  display: block; font-family: var(--display); font-size: 23px; font-weight: 600; line-height: 1;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.sev span { display: block; margin-top: 7px; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.sev-critical b { color: var(--critical); }
.sev-high b { color: var(--high); }
.sev-moderate b { color: var(--moderate); }
.sev-low b { color: var(--low); }
.sev-ok b { color: var(--done); }

.verdict {
  border: 1px solid var(--rule); border-left: 3px solid var(--rule-2); background: var(--card);
  border-radius: var(--r); padding: 13px 16px; font-size: 12.5px; line-height: 1.65; margin-bottom: 22px;
}
.verdict.is-blocked { border-left-color: var(--critical); }
.verdict.is-clear { border-left-color: var(--done); }
.verdict strong { font-weight: 600; }

.grp { margin-bottom: 26px; }
.grp__h { display: flex; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-2); margin-bottom: 4px; }
.grp__t { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.grp__d { font-size: 11.5px; color: var(--muted); }
.t-critical { color: var(--critical); }
.t-high { color: var(--high); }
.t-moderate { color: var(--moderate); }
.t-low { color: var(--low); }

.find { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.find__h { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: start; }
.find__t { font-size: 13.5px; line-height: 1.45; }
.find__kind {
  align-self: center; white-space: nowrap; font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 2px 7px; border: 1px solid var(--rule-2); color: var(--muted);
}
.find__kind.k-file { color: var(--bronze); border-color: var(--bronze-2); }
.find__kind.k-both { color: var(--moderate); border-color: #ddd0a0; }
.find__area { align-self: center; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.find__note { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; margin-top: 6px; }
.find details { margin-top: 8px; }
.find summary { font-size: 11.5px; color: var(--bronze); cursor: pointer; list-style: none; }
.find summary::-webkit-details-marker { display: none; }
.find summary::before { content: "+ "; }
.find details[open] summary::before { content: "– "; }
.find__d { font-size: 12px; color: var(--ink-2); line-height: 1.65; margin-top: 8px; }
.find__auth { font-size: 11px; color: var(--muted); margin-top: 7px; }
.find__docs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.find__docs span { font-size: 10.5px; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--rule); padding: 2px 7px; }

.reqlist { margin-top: 30px; border-top: 1px solid var(--rule-2); padding-top: 16px; }
.reqlist__h { margin-bottom: 12px; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.req { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 11px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; }
.req i { width: 4px; height: 4px; border-radius: 50%; background: var(--rule-2); transform: translateY(-2px); }
.req--critical i { background: var(--critical); }
.req--high i { background: var(--high); }
.req--moderate i { background: var(--moderate); }
.req--low i { background: var(--low); }
.req small { font-size: 10.5px; color: var(--muted); }

.empty { font-size: 12.5px; color: var(--muted); padding: 18px 0; }

/* lens over the two limbs */
.kfilter { margin-bottom: 18px; }

/* ═══════════════════════════ fields and notes ══════════════════════════════ */
/* Shaped like a chat: the record above as a feed, one rounded composer below.
   Dragging anything over the card morphs the composer into a drop target. */

.ncard { margin-bottom: 24px; }
.ncard__h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.ncard__h .lbl { margin-right: auto; }

/* intake proposals (step 06): one row per proposed field, accept per row */
.prop { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--rule); cursor: pointer; }
.prop input[type="checkbox"] { margin-top: 3px; accent-color: var(--ink); }
.prop__m { flex: 1; min-width: 0; display: grid; gap: 4px; }
.prop__top { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.prop__conf { font-size: 10.5px; color: var(--done); font-variant-numeric: tabular-nums; }
.prop__conf.is-low { color: var(--warn, #b45309); }
.prop__val { font-size: 12.5px; }
.prop__q { font-size: 11px; color: var(--faint); line-height: 1.5; overflow-wrap: anywhere; }
.prop__sel { font-size: 12.5px; width: 100%; }
.prop__defect { color: var(--warn, #b45309); }
.grp__h .mini { margin-left: auto; }
.ncard__stat { font-size: 11px; color: var(--faint); transition: color .2s; }
.ncard__stat.is-on { color: var(--done); }

.ncard__feed { display: grid; gap: 8px; margin-bottom: 12px; }
.ncard__feed:empty { margin-bottom: 0; }
.ncard__chips { display: flex; flex-wrap: wrap; gap: 7px; }
.nchip {
  display: inline-flex; align-items: baseline; gap: 7px;
  border: 1px solid var(--rule); background: var(--paper-2); border-radius: 100px;
  padding: 3px 6px 3px 11px; font-size: 11.5px;
}
.nchip b { font-weight: 600; }
.nchip b::after { content: ":"; color: var(--faint); font-weight: 400; }
.nchip__x { color: var(--faint); font-size: 13px; line-height: 1; padding: 0 4px; }
.nchip__x:hover { color: var(--critical); }

.nentry {
  position: relative; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper-2); padding: 10px 34px 10px 13px;
}
.nentry__t { font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.nentry__x {
  position: absolute; top: 7px; right: 9px; color: var(--faint);
  font-size: 14px; line-height: 1; opacity: 0; transition: opacity .15s;
}
.nentry:hover .nentry__x { opacity: 1; }
.nentry__x:hover { color: var(--critical); }

/* the composer itself — one rounded input, controls in the bottom row */
.composer2 {
  position: relative; border: 1px solid var(--rule-2); border-radius: 14px;
  background: var(--card); padding: 4px 6px 6px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.composer2:focus-within { border-color: var(--ink); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05); }
.composer2__ta {
  display: block; width: 100%; border: none; background: none; resize: none;
  padding: 9px 10px 4px; font-size: 13px; line-height: 1.6; overflow-y: hidden;
  box-sizing: border-box; min-height: 38px;
}
.composer2__ta:focus { outline: none; }
.composer2__ta::placeholder { color: var(--faint); }
.composer2__row { display: flex; align-items: center; gap: 9px; padding: 0 4px; }
.composer2__row .sp { flex: 1; }
.composer2__ic {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; color: var(--muted);
  border: 1px solid transparent;
}
.composer2__ic:hover { border-color: var(--rule-2); color: var(--ink); }
.composer2__ic svg { width: 15px; height: 15px; }
.composer2__hint { font-size: 10.5px; color: var(--faint); }
.composer2__send {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff; transition: background .15s;
}
.composer2__send:hover { background: #262626; }
.composer2__send svg { width: 13px; height: 13px; }

/* the morph: while a drag hovers, the composer becomes the drop target */
.composer2__drop {
  position: absolute; inset: 0; border-radius: 14px; display: none;
  align-items: center; justify-content: center; gap: 9px;
  font-size: 12.5px; font-weight: 500; color: var(--ink);
}
.composer2__drop svg { width: 17px; height: 17px; stroke-width: 1.7; }
.composer2.is-drop { border: 1.5px dashed var(--ink); background: var(--paper-2); }
.composer2.is-drop .composer2__ta,
.composer2.is-drop .composer2__row { visibility: hidden; }
.composer2.is-drop .composer2__drop { display: flex; }

.ncard__foot { font-size: 10.5px; color: var(--faint); margin-top: 8px; }

/* ══════════════════════════════ dossier panel ══════════════════════════════ */

.dosr { border-left: 2px solid var(--rule-2); padding: 11px 0 12px 14px; border-bottom: 1px solid var(--rule); }
.dosr:last-child { border-bottom: none; }
.dosr--critical { border-left-color: var(--critical); }
.dosr--high { border-left-color: var(--high); }
.dosr--moderate { border-left-color: var(--moderate); }
.dosr--low { border-left-color: var(--low); }
.dosr.is-unfiled { border-left-color: var(--faint); }
.dosr__h { display: flex; align-items: baseline; gap: 10px; }
.dosr__n { font-size: 13px; line-height: 1.45; flex: 1; }
.dosr__s { font-size: 9px; letter-spacing: 0.11em; text-transform: uppercase; }
.dosr__note { font-size: 12px; color: var(--high); line-height: 1.6; margin-top: 5px; }
.dosr__auth { font-size: 11px; color: var(--muted); margin-top: 7px; }
.dosr__m { font-style: normal; width: 13px; flex: none; text-align: center; font-size: 11px; color: var(--faint); }
.m-present { color: var(--done); }
.m-defect  { color: var(--high); }
.m-missing { color: var(--critical); }
.m-na      { color: var(--rule-2); }
.m-unfiled { color: var(--moderate); }

.dform { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.dform__l { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-right: 2px; }
.dform__t { font-size: 10px; color: var(--ink-2); border: 1px solid var(--rule); background: var(--paper-2); padding: 1px 7px; }

.dgrp { border-bottom: 1px solid var(--rule); }
.dgrp:last-child { border-bottom: none; }
.dgrp > summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 11px 0; cursor: pointer; list-style: none;
  font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.dgrp > summary::-webkit-details-marker { display: none; }
.dgrp > summary::before { content: "▸"; margin-right: 8px; font-size: 9px; color: var(--faint); }
.dgrp[open] > summary::before { content: "▾"; }
.dgrp > summary:hover { color: var(--ink); }
.dgrp__c { font-size: 11px; color: var(--faint); letter-spacing: 0.04em; }
.dgrp__b { padding: 2px 0 12px; }

.dreg { border-top: 1px solid var(--rule); }
.dreg > summary { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; cursor: pointer; list-style: none; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.dreg > summary::-webkit-details-marker { display: none; }
.dreg > summary:hover { color: var(--ink); }
.dreg.is-na > summary { opacity: .45; }
.dreg__n { flex: 1; }
.dreg__f { font-size: 11px; color: var(--muted); text-align: right; max-width: 40%; overflow-wrap: anywhere; }
.dreg__sev { font-size: 9px; letter-spacing: 0.11em; text-transform: uppercase; }
.dreg__b { padding: 2px 0 14px 23px; }
.dreg__h { font-size: 9px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); margin: 10px 0 5px; }
.dreg__list { display: grid; gap: 5px; }
.dreg__list li { font-size: 12px; color: var(--ink-2); line-height: 1.6; padding-left: 14px; position: relative; }
.dreg__list li::before { content: "·"; position: absolute; left: 4px; color: var(--faint); }
.dreg__list--bad li::before { content: "×"; color: var(--high); font-size: 10px; top: 1px; }

.dos__sampled { font-size: 11px; color: var(--faint); line-height: 1.6; margin: -10px 0 18px; }

/* ══════════════════════════════ documents rail ═════════════════════════════ */

.docs__h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.dgroup { margin-bottom: 14px; }
.dgroup__h { padding-bottom: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 1px; }
.dfile { text-align: left; padding: 5px 0; border-bottom: 1px solid var(--paper-3); }
.dfile:hover { background: var(--paper-2); }
.dfile__n {
  flex: 1; min-width: 0; font-size: 11.5px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dfile__m {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dfile__v {
  border: 1px solid var(--rule-2); border-radius: 100px; padding: 0 5px;
  font-size: 8.5px; font-weight: 600; color: var(--ink-2);
}
.dfile--archived .dfile__n { color: var(--muted); }
.rail__foot { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 10px; color: var(--faint); overflow-wrap: anywhere; }

/* ══════════════════════════════ activity ═══════════════════════════════════ */

.act { display: grid; grid-template-columns: 92px 96px minmax(0, 1fr); gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; align-items: baseline; }
.act__t { font-size: 11px; color: var(--faint); }
.act__w { font-size: 11px; color: var(--bronze); }
.act__x { line-height: 1.55; }

/* ══════════════════════════════ assistant ══════════════════════════════════ */

.chat { flex: 1; overflow-y: auto; padding: 20px 24px; }
.msg { max-width: 74ch; margin-bottom: 18px; }
.msg__w { margin-bottom: 5px; }
.msg__b { font-size: 13px; line-height: 1.65; }
.msg__b p { margin-bottom: 9px; }
.msg__b ul { margin: 0 0 9px 16px; list-style: disc; }
.msg__b li { margin-bottom: 4px; }
.msg__b code { font-family: var(--mono); font-size: 11.5px; background: var(--paper-2); padding: 1px 4px; }
.msg--you .msg__b { border-left: 2px solid var(--rule-2); padding-left: 13px; }
.msg--ai .msg__b { border-left: 2px solid var(--bronze-2); padding-left: 13px; }

.composer { border-top: 1px solid var(--rule); padding: 14px 24px 18px; flex: none; background: var(--paper-2); }
.composer textarea {
  width: 100%; background: var(--card); border: 1px solid var(--rule-2);
  padding: 10px 12px; font-size: 12.5px; resize: none; line-height: 1.6;
}
.composer textarea:focus { border-color: var(--bronze-2); outline: none; }
.composer__r { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.composer__r .sp { flex: 1; }
.composer__hint { font-size: 11px; color: var(--faint); }

/* ══════════════════════════════ viewer ═════════════════════════════════════ */

.viewer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--paper); }
.viewer__bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 24px; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.viewer__meta { min-width: 0; }
.viewer__name { display: block; font-size: 13px; font-weight: 500; }
.viewer__path { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.viewer__acts { display: flex; gap: 8px; flex: none; }
.paper {
  flex: 1; overflow-y: auto; padding: 44px 0 90px;
  background: var(--paper);
}
.paper > * { max-width: 74ch; margin-left: auto; margin-right: auto; }
.paper h1 { font-size: 24px; font-weight: 400; margin-bottom: 18px; }
.paper h2 { font-size: 17px; font-weight: 500; margin: 30px auto 12px; }
.paper h3 { font-size: 14px; font-weight: 600; margin: 22px auto 9px; }
.paper p { margin-bottom: 13px; line-height: 1.75; }
.paper ul, .paper ol { margin: 0 auto 14px; padding-left: 20px; list-style: disc; }
.paper li { margin-bottom: 5px; line-height: 1.7; }
.paper table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 12.5px; }
.paper th, .paper td { border: 1px solid var(--rule); padding: 7px 10px; text-align: left; }
.paper th { background: var(--paper-2); font-weight: 500; }
.paper code { font-family: var(--mono); font-size: 12px; background: var(--paper-2); padding: 1px 4px; }
.paper blockquote { border-left: 2px solid var(--bronze-2); padding-left: 14px; color: var(--ink-2); margin-bottom: 14px; }

/* ══════════════════════════════ roadmap ════════════════════════════════════ */

.road__now { border: 1px solid var(--rule); background: var(--card); border-radius: var(--r); padding: 20px 22px; margin-bottom: 32px; }
.road__nowhead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.road__stage { font-size: 16px; }
.road__stage em { font-style: normal; color: var(--bronze); }
.road__count { font-size: 11.5px; color: var(--muted); }
.road__meter { position: relative; height: 4px; margin-top: 15px; background: var(--paper-3); }
.road__meter i { position: absolute; inset: 0 auto 0 0; background: var(--done); }
.road__line { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-top: 14px; max-width: 70ch; }

.phases { max-width: 900px; }
.phase { position: relative; padding: 0 0 30px 30px; border-left: 1px solid var(--rule-2); }
.phase:last-child { border-left-color: transparent; padding-bottom: 6px; }
.phase__dot { position: absolute; left: -4.5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--paper); border: 1px solid var(--faint); }
.phase[data-stage="done"] .phase__dot { background: var(--done); border-color: var(--done); }
.phase[data-stage="now"] .phase__dot { background: var(--bronze); border-color: var(--bronze); box-shadow: 0 0 0 4px rgba(182, 130, 53, 0.18); }
.phase__head { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; }
.phase__title { font-size: 14.5px; font-weight: 500; }
.phase__tag { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; padding: 2px 8px; border: 1px solid var(--rule-2); color: var(--muted); }
.phase[data-stage="done"] .phase__tag { color: var(--done); border-color: #b9d2c5; }
.phase[data-stage="now"] .phase__tag { color: var(--bronze); border-color: var(--bronze-2); }
.phase__note { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin-top: 6px; max-width: 70ch; }
.phase__items { margin-top: 13px; display: grid; gap: 7px; }
.phase__items li { display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 9px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.phase__items li b { font-weight: 400; color: var(--faint); font-size: 11px; text-align: center; }
.phase__items li.is-done { color: var(--ink-2); }
.phase__items li.is-done b { color: var(--done); }
.phase__items li code { font-family: var(--mono); font-size: 11px; background: var(--paper-2); border: 1px solid var(--rule); padding: 0 4px; }

.road__open { margin-top: 12px; border-top: 1px solid var(--rule-2); padding-top: 26px; max-width: 900px; }
.road__open h3 { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.road__open ol { display: grid; gap: 11px; counter-reset: q; }
.road__open li { counter-increment: q; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; font-size: 12.5px; line-height: 1.65; color: var(--ink-2); border-left: 2px solid var(--high); padding-left: 13px; }
.road__open li::before { content: "Q" counter(q); color: var(--high); font-size: 11px; }

/* ══════════════════════════════ toast ══════════════════════════════════════ */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: var(--ink); color: var(--paper); padding: 9px 18px; font-size: 12.5px;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 200;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { background: var(--critical); }

@media print {
  .nav, .tabs, .pj__rail, .pj__docs, .composer, .viewer__bar { display: none; }
  body { background: #fff; }
}

/* ═══════════════════════════════ lucide details ════════════════════════════ */

.dgroup__i { width: 12px; height: 12px; stroke-width: 1.8; }
.dgroup__h { display: flex; align-items: center; gap: 5px; font-size: 9px; }
.dfile { display: flex; gap: 7px; align-items: center; width: 100%; }
.dfile__i { width: 13px; height: 13px; flex: none; color: var(--faint); stroke-width: 1.7; }
.dfile:hover .dfile__i { color: var(--ink); }
.dot-defect {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--critical); vertical-align: 1px;
}

/* ═══════════════════════════════ drop targets ══════════════════════════════ */

.dropzone {
  margin-top: 18px; border: 1.5px dashed var(--rule-2); border-radius: var(--r);
  padding: 16px 14px; text-align: center; color: var(--faint);
  display: grid; gap: 4px; justify-items: center;
}
.dropzone svg { width: 17px; height: 17px; stroke-width: 1.6; }
.dropzone span { font-size: 11.5px; color: var(--muted); }
.dropzone small { font-family: var(--mono); font-size: 9.5px; overflow-wrap: anywhere; }

.dropveil {
  position: fixed; inset: 10px; z-index: 90; border: 2px dashed var(--ink);
  border-radius: 8px; background: rgba(255, 255, 255, 0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; pointer-events: none;
}
.dropveil svg { width: 30px; height: 30px; stroke-width: 1.5; }
.dropveil b { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.dropveil span { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ═══════════════════════════════ timeline ══════════════════════════════════ */

.tl { max-width: 620px; }
.tl__head { padding: 14px 0 8px 34px; }
.tl__row {
  position: relative; display: flex; gap: 13px; padding: 9px 0 9px 0;
}
.tl__row::before {
  content: ""; position: absolute; left: 10.5px; top: 0; bottom: 0;
  width: 1px; background: var(--rule);
}
.tl__row:last-child::before { bottom: 50%; }
.tl__dot {
  position: relative; z-index: 1; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--rule-2); background: var(--paper);
  display: flex; align-items: center; justify-content: center;
}
.tl__i { width: 11px; height: 11px; stroke-width: 2; color: var(--muted); }
.tl__row.is-now .tl__dot { border-color: var(--ink); background: var(--ink); }
.tl__row.is-now .tl__i { color: #fff; }
.tl__row.is-now .tl__main { font-weight: 600; }
.tl__row.is-future .tl__dot { border-style: dashed; }
.tl__row.is-future .tl__main { color: var(--muted); }
.tl__row.is-date .tl__dot { border-color: var(--high); }
.tl__row.is-date .tl__i { color: var(--high); }
.tl__row.is-date .tl__main { color: var(--high); font-weight: 500; }
.tl__body { min-width: 0; padding-top: 1px; }
.tl__main { font-size: 12.5px; line-height: 1.5; }
.tl__meta { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* ═══════════════════════════ compact documents table ═══════════════════════ */

.tbl--compact { table-layout: fixed; }
.tbl--compact td {
  padding: 5px 12px 5px 0; font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tbl--compact th { padding-bottom: 6px; padding-right: 12px; }
.tbl--compact td.strong { font-weight: 500; }
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--ink); }
.th-sort.is-on { color: var(--ink); }
.th-dir { font-size: 9px; }

/* row action links share a cell */
.rowacts { display: inline-flex; gap: 12px; }

/* ═══════════════════════════ modal forms ═══════════════════════════════════ */

.modal__veil {
  position: fixed; inset: 0; z-index: 120; background: rgba(23, 23, 23, 0.35);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 9vh;
}
.modal {
  width: 470px; max-width: calc(100vw - 40px); max-height: 82vh; overflow-y: auto;
  background: var(--card); border-radius: 14px; box-shadow: 0 14px 50px rgba(0, 0, 0, 0.18);
}
.modal__h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--rule);
}
.modal__t { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.modal__x { display: flex; color: var(--muted); }
.modal__x:hover { color: var(--ink); }
.modal__x svg { width: 15px; height: 15px; }
.modal__b { padding: 16px 20px 6px; display: flex; flex-wrap: wrap; gap: 13px 12px; }
.modal__f { display: block; flex: 1 1 100%; }
.modal__f--half { flex: 1 1 calc(50% - 6px); }
.modal__f .lbl { display: block; margin-bottom: 6px; }
.modal__in, .modal__f .sel {
  width: 100%; max-width: none; background: var(--card); border: 1px solid var(--rule-2);
  border-radius: var(--r); padding: 8px 11px; font-size: 12.5px; box-sizing: border-box;
}
.modal__in:focus { border-color: var(--ink); outline: none; }
.modal__foot {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 20px 18px; border-top: 1px solid var(--rule); margin-top: 12px;
}
.modal__foot .sp { flex: 1; }
.modal__danger {
  font-size: 12px; color: var(--critical); text-decoration: underline; text-underline-offset: 2px;
}

/* ═══════════════════════════ format badges ═════════════════════════════════ */

.extb {
  display: inline-block; flex: none; padding: 0 5px; border-radius: 3px;
  font-size: 8px; font-weight: 700; letter-spacing: 0.06em; line-height: 14px;
  color: #fff; background: var(--faint); vertical-align: 1px;
}
.ext-pdf { background: #b3361c; }
.ext-doc { background: #3a6ea5; }
.ext-xls { background: #2f7d54; }
.ext-md  { background: #525252; }
.ext-img { background: #8a5fa8; }
.ext-zip { background: #9a6512; }
.ext-any { background: var(--faint); }

.doccell { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; }
.doccell__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════════════ dossier, compact ══════════════════════════════ */

.sumbar--click .sev { text-align: left; transition: background .15s; }
.sumbar--click button.sev { cursor: pointer; }
.sumbar--click button.sev:hover { background: var(--paper-2); }
.sumbar--click .sev.is-on { background: var(--paper-3); box-shadow: inset 0 -2px 0 var(--ink); }

/* one-line outstanding rows; everything else opens on demand */
.dosx { border-bottom: 1px solid var(--paper-3); }
.dosx > summary {
  display: flex; align-items: center; gap: 8px; padding: 6px 2px;
  cursor: pointer; list-style: none; font-size: 12px; line-height: 1.4;
}
.dosx > summary::-webkit-details-marker { display: none; }
.dosx > summary:hover { background: var(--paper-2); }
.dosx__n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dosx[open] .dosx__n { white-space: normal; }
.dosx__s { flex: none; font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.dosx__b { padding: 4px 2px 12px 23px; }
.dosx__files { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); margin-top: 5px; }
.dosx--unfiled { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 12px; }

/* stronger state marks: filled, unmissable */
.dosr__m {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700; font-style: normal; text-align: center;
}
.m-present { background: #e7f2ec; color: var(--done); }
.m-defect  { background: #f8efdd; color: var(--high); }
.m-missing { background: #f8e6e0; color: var(--critical); }
.m-na      { background: var(--paper-3); color: var(--faint); }
.m-unfiled { background: #f3edda; color: var(--moderate); }

.dgrp__badges { display: inline-flex; align-items: center; gap: 6px; }
.dgrp > summary { padding: 8px 0; }
.dreg > summary { padding: 6px 0; font-size: 12px; }
.dreg__f .extb { margin-right: 3px; }
.dgrp__b { padding: 0 0 8px; }

/* owner split in the dossier */
.grp__ti { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; stroke-width: 2; }
.grp__sub { font-size: 11px; color: var(--muted); margin: -2px 0 8px; }
.ownchip {
  flex: none; font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--rule-2); border-radius: 100px; padding: 0 6px;
  color: var(--ink-2); background: var(--paper-2);
}

/* ═══════════════════════════ settings, compact ═════════════════════════════ */

.tiles--slim .tile { padding: 11px 16px 10px; }
.tiles--slim .tile b { font-size: 21px; }
.tiles--slim .tile span { margin-top: 5px; }

.budget--slim { padding: 10px 16px 12px; margin-bottom: 18px; }
.budget--slim .budget__bar { margin-top: 8px; }
.budget--slim .budget__range { margin-top: 8px; }

.tbl--settings td { padding-top: 4px; padding-bottom: 4px; }
.tbl--settings .sel { padding: 3px 6px; font-size: 11.5px; max-width: 100%; }
.tbl--settings .sig { margin-left: 6px; }

.pbtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 24px; border: 1px solid var(--rule-2); border-radius: var(--r);
  color: var(--muted); background: var(--card);
}
.pbtn:hover { color: var(--ink); border-color: var(--ink); }
.pbtn svg { width: 12px; height: 12px; }
.pbtn__dot {
  position: absolute; top: -3px; right: -3px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--done); border: 1.5px solid var(--card);
}

.setmeta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card--slim { margin-bottom: 0; }
.card--slim .card__row { padding: 8px 0; }
.card--slim .card__t { font-size: 12px; }

.modal--wide { width: 640px; }
.modal__help { flex: 1 1 100%; font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-bottom: 2px; }
.modal__in--ta { font-family: var(--mono); font-size: 11.5px; line-height: 1.65; resize: vertical; }

/* ═══════════════════════════ contract intake strip ═════════════════════════ */

.intake-wrap { margin-bottom: 26px; }
.intake {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 12px; align-items: center; text-align: left; width: 100%;
  border: 1.5px dashed var(--rule-2); border-radius: 10px; background: var(--paper-2);
  padding: 13px 18px; transition: border-color .15s, background .15s;
}
.intake:hover, .intake.is-drop { border-color: var(--ink); background: var(--bronze-bg); }
.intake__write {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 11.5px; font-weight: 500; color: var(--muted);
}
.intake__write:hover { color: var(--ink); }
.intake__write svg { width: 13px; height: 13px; }

/* file-attach control inside openForm (contract file[s]) */
.attach { display: grid; gap: 8px; }
.attach.is-drop .attach__add { border-color: var(--ink); background: var(--bronze-bg); }
.attach__list { display: grid; gap: 6px; }
.attach__list:empty { display: none; }
.attach__f { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.attach__n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach__s { color: var(--faint); font-variant-numeric: tabular-nums; }
.attach__x { color: var(--muted); font-size: 15px; line-height: 1; padding: 0 4px; }
.attach__x:hover { color: var(--critical); }
.attach__add {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1.5px dashed var(--rule-2); border-radius: var(--r);
  padding: 9px 12px; font-size: 12px; color: var(--muted); transition: all .15s;
}
.attach__add:hover { border-color: var(--ink); color: var(--ink); }
.attach__add svg { width: 13px; height: 13px; }

/* loading spinner while the model reads the contract */
.loadbox { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 20px; }
.loadbox__t { font-size: 13px; color: var(--muted); text-align: center; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--rule-2); border-top-color: var(--ink);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* proposed-engagements table (contract intake) */
.itbl { width: 100%; min-width: 560px; }
.itbl th { font-size: 9px; padding-bottom: 6px; }
.itbl td { padding: 4px 8px 4px 0; border-bottom: none; vertical-align: middle; }
.itbl__cb { width: 22px; }
.itbl__cb input { accent-color: var(--ink); }
.itbl__in {
  width: 100%; background: var(--card); border: 1px solid var(--rule-2);
  border-radius: var(--r); padding: 6px 8px; font-size: 12px;
}
.itbl__in.num { font-variant-numeric: tabular-nums; }
.itbl__in:focus { border-color: var(--ink); outline: none; }
.itbl__sel { padding: 5px 6px; font-size: 12px; }
.itbl__rm { width: 26px; text-align: right; }
.itbl__x { color: var(--muted); font-size: 15px; line-height: 1; padding: 0 4px; }
.itbl__x:hover { color: var(--critical); }
.itbl__files { font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.intake > svg { grid-row: 1 / 3; width: 22px; height: 22px; stroke-width: 1.5; color: var(--muted); }
.intake__t { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.intake__d { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ═══════════════════════ horizontal timeline strip ═════════════════════════ */

.tstrip { border-bottom: 1px solid var(--rule); background: var(--paper-2); padding: 14px 24px 10px; }
.tstrip__track { display: flex; overflow-x: auto; padding-bottom: 2px; }
.tstrip__node {
  position: relative; flex: 1 1 0; min-width: 74px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding-top: 2px;
}
/* connector line through the dots */
.tstrip__node::before {
  content: ""; position: absolute; top: 12px; left: 0; right: 0; height: 1.5px;
  background: var(--rule-2);
}
.tstrip__node:first-child::before { left: 50%; }
.tstrip__node:last-child::before { right: 50%; }
.tstrip__node.is-done::before { background: var(--done); }
.tstrip__dot {
  position: relative; z-index: 1; width: 21px; height: 21px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--rule-2);
  display: flex; align-items: center; justify-content: center;
}
.tstrip__dot i { font-style: normal; font-size: 8.5px; font-weight: 600; color: var(--muted); }
.tstrip__dot svg { width: 11px; height: 11px; }
.tstrip__node.is-done .tstrip__dot { border-color: var(--done); color: var(--done); }
.tstrip__node.is-now .tstrip__dot { background: var(--ink); border-color: var(--ink); }
.tstrip__node.is-now .tstrip__dot i { color: #fff; }
.tstrip__lab {
  font-size: 9.5px; line-height: 1.25; color: var(--faint); max-width: 86px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tstrip__node.is-done .tstrip__lab { color: var(--muted); }
.tstrip__node.is-now .tstrip__lab { color: var(--ink); font-weight: 600; }
.tstrip__phase {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  font-size: 7.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
  white-space: nowrap; font-weight: 700;
}
.tstrip:has(.tstrip__phase) { padding-top: 24px; }

.tstrip__dates { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 9px; }
.tdate { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.tdate__i { width: 12px; height: 12px; stroke-width: 1.8; }
.tdate b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.tdate.is-bad b { color: var(--critical); }
.tdate.is-ok b { color: var(--done); }

/* regulatory clocks (step 09): computed deadlines, each with its article */
.tstrip__clocks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.tclock { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); border: 1px solid var(--rule-2); border-radius: 100px; padding: 4px 11px; }
.tclock__i { width: 12px; height: 12px; stroke-width: 1.8; flex: none; }
.tclock__l { font-weight: 600; color: var(--ink); }
.tclock__v { color: var(--muted); font-variant-numeric: tabular-nums; }
.tclock__c { font-size: 9.5px; letter-spacing: 0.04em; color: var(--faint); padding-left: 2px; }
.tclock--bad { border-color: #e7c9c9; background: #fbf1f1; }
.tclock--bad .tclock__v { color: var(--critical); font-weight: 600; }
.tclock--soon { border-color: #e6d7bd; background: #faf5ec; }
.tclock--soon .tclock__v { color: var(--warn, #b45309); font-weight: 600; }
.tclock--pending .tclock__l { color: var(--warn, #b45309); }

/* assistant reply provenance */
.msg__meta { text-transform: none; letter-spacing: 0.02em; color: var(--faint); font-weight: 400; }
.msg--pending .msg__b { color: var(--faint); }

/* ═══════════════════════════ implementation plan ═══════════════════════════ */

.plan { display: grid; gap: 2px; }
.plan__row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.plan__n { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 1px; }
.plan__t { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan__size {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.08em; border-radius: 100px;
  padding: 1px 7px; border: 1px solid var(--rule-2); color: var(--muted);
}
.plan__size.s-L { color: var(--critical); border-color: #d9b3a9; }
.plan__size.s-M { color: var(--high); border-color: #ddc9a2; }
.plan__size.s-S { color: var(--done); border-color: #b9d2c5; }
.plan__dep { font-size: 10px; color: var(--faint); }
.plan__d { font-size: 12px; color: var(--muted); line-height: 1.65; margin-top: 3px; max-width: 78ch; }

.road__plan { margin-top: 12px; border-top: 1px solid var(--rule-2); padding-top: 26px; max-width: 900px; }
.road__plan h3 {
  font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px; font-weight: 500;
}
.plan__row.is-done .plan__n { color: var(--done); font-weight: 700; }
.plan__row.is-done .plan__t { color: var(--muted); }

/* ═══════════════════════════════ mobile ═════════════════════════════════════
 * The console is built for a desk, but a certifier chasing a filing is often on
 * a phone. Below 860px the left rail becomes an off-canvas drawer behind a top
 * bar, the multi-column views stack, and wide tables scroll inside their own
 * box rather than pushing the page sideways.
 */

/* The top bar and its drawer machinery are desktop-hidden. */
.topbar { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 860px) {
  .topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; border-bottom: 1px solid var(--rule);
    position: sticky; top: 0; z-index: 40; background: var(--paper);
  }
  .topbar__menu { display: flex; padding: 4px; color: var(--ink); }
  .topbar__menu svg { width: 22px; height: 22px; }
  .topbar__brand { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }

  /* one column; the nav leaves the flow and slides over the content */
  .app { grid-template-columns: 1fr; }
  .nav {
    position: fixed; top: 0; left: 0; height: 100vh; width: 80vw; max-width: 300px;
    transform: translateX(-100%); transition: transform .25s ease; z-index: 60;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.22);
  }
  .app.is-nav-open .nav { transform: none; }
  .app.is-nav-open .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(23, 23, 23, 0.4);
  }

  /* page chrome tightens up */
  .phead { flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 16px; }
  .phead__acts { flex-wrap: wrap; }
  .view { padding: 16px 16px 48px; }
  .view--split { grid-template-columns: 1fr; gap: 22px; }
  .view--split > * { min-width: 0; }   /* a grid child must be allowed to shrink */
  .filters { gap: 10px; }
  .filters input[type="search"], .search { width: 100%; }

  /* the project view stacks: workflow, then the panels, then the documents */
  .pj { grid-template-columns: 1fr; }
  .pj__rail, .pj__docs {
    position: static; max-height: none; overflow: visible;
    border-left: none; border-right: none; padding: 16px 16px 22px;
  }
  .pj__rail { border-bottom: 1px solid var(--rule); }
  .pj__docs { border-top: 1px solid var(--rule); }
  .tabs { padding: 0 16px; overflow-x: auto; }
  .panel { padding: 16px 16px 48px; }
  /* the assistant gives up its internal scroll so the page scrolls as one */
  .panel--chat { position: static; height: auto; min-height: 62vh; }

  /* numeric strips fold to two across, with a divider between rows */
  .tiles, .tiles--slim { grid-template-columns: repeat(2, 1fr); }
  .tiles .tile { border-bottom: 1px solid var(--rule); }
  .sumbar { grid-template-columns: repeat(2, 1fr); }
  .sumbar .sev { border-bottom: 1px solid var(--rule); }

  /* a wide table scrolls inside its wrapper instead of widening the page */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .tbl { min-width: 560px; }
  .tbl--compact, .tbl--settings { min-width: 680px; }

  /* the document viewer's action row wraps rather than overflowing */
  .viewer__bar { flex-wrap: wrap; }
  .viewer__acts { flex-wrap: wrap; }

  /* modals sit a touch higher and their half-width fields go full width */
  .modal__veil { padding-top: 5vh; }
  .modal__f--half { flex: 1 1 100%; }
}

/* very small phones: single-column strips and a narrower drawer */
@media (max-width: 460px) {
  .tiles, .tiles--slim, .sumbar { grid-template-columns: 1fr 1fr; }
  .phead__t { font-size: 18px; }
  .nav { width: 86vw; }
  .modal { border-radius: 12px; }
}
