/* BidPilot — interfaccia operativa per l'ufficio gare.
   Sobria e densa: superfici chiare, bordi sottili, un solo colore di marca. I colori semantici indicano
   sempre uno stato epistemico (verificato, da rivedere, conflitto, sconosciuto, decisione umana, AI) e non
   si usano per decorare. */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --sunken: #f9fafb; --ink: #111827; --ink2: #374151; --muted: #6b7280;
  --faint: #9ca3af; --line: #e5e7eb; --line2: #f0f1f4; --line-strong: #d1d5db;
  --brand: #16254a; --brand2: #1f3c7a; --brand-bg: #edf1f9; --accent: #1f3c7a; --accent-bg: #edf1f9;
  --ok: #157f3c; --ok-bg: #ecf7f0; --warn: #9a5b06; --warn-bg: #fdf5e4; --bad: #b42318; --bad-bg: #fdeceb;
  --info: #1d4ed8; --info-bg: #eef3fe; --human: #6d28d9; --human-bg: #f3effd; --ai: #0e6b83; --ai-bg: #e9f5f8;
  --unk: #4b5563; --unk-bg: #eef0f3;
  --radius: 8px; --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(17,24,39,.04);
  --shadow-pop: 0 4px 16px rgba(17,24,39,.08), 0 1px 3px rgba(17,24,39,.06);
  --ring: 0 0 0 3px rgba(31,60,122,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 .45em; line-height: 1.25; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: 21px; font-weight: 650; } h2 { font-size: 16px; font-weight: 650; } h3 { font-size: 14.5px; font-weight: 650; }
h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
::selection { background: #dbe4f5; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--sunken); border-right: 1px solid var(--line); color: var(--ink2); padding: 14px 10px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 15px;
  margin: 2px 8px 16px; letter-spacing: -.01em; }
.logo .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); color: #fff; display: grid;
  place-items: center; font-size: 14px; font-weight: 700; flex: none; }
.logo small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: 0; }
.side a { color: var(--ink2); padding: 6px 10px; border-radius: 6px; display: flex; gap: 9px; align-items: center;
  font-size: 13.5px; font-weight: 500; }
.side a .ni, .nav-off .ni { width: 16px; text-align: center; color: var(--faint); font-size: 13px; flex: none; }
.side a:hover { background: #eef0f3; color: var(--ink); text-decoration: none; }
.side a.on { background: var(--brand-bg); color: var(--brand2); font-weight: 600; }
.side a.on .ni { color: var(--brand2); }
.side .sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 600;
  margin: 18px 10px 5px; }
.side .soon { margin-left: auto; }
.side .foot { margin-top: auto; font-size: 11.5px; line-height: 1.55; color: var(--muted); padding: 12px 10px 4px;
  border-top: 1px solid var(--line); }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 0 32px; height: 52px; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .crumbs { color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.top .grow { flex: 1; }
.top form { display: flex; gap: 6px; align-items: center; margin: 0; }
.top select, .top input[type=text] { font: inherit; font-size: 13px; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: #fff; }
.content { padding: 24px 32px 64px; max-width: 1360px; }

/* ---------------------------------------------------------------- containers */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 16px; }
.panel.flat { box-shadow: none; background: var(--sunken); }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; }
.sec-title h2 { margin: 0; font-size: 15px; }
.sec-title .line { flex: 1; height: 1px; background: var(--line); }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 550;
  height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: #fff;
  color: var(--ink); cursor: pointer; white-space: nowrap; box-shadow: 0 1px 1px rgba(17,24,39,.04);
  transition: background .12s, border-color .12s; }
.btn:hover { background: var(--sunken); border-color: #c4c9d1; text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--brand2); border-color: var(--brand2); color: #fff; }
.btn.primary:hover { background: var(--brand); border-color: var(--brand); }
.btn.accent { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.accent:hover { background: #000; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: #eef0f3; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=number], input[type=date], input[type=email], textarea, select.in, .content select {
  font: inherit; font-size: 13.5px; width: 100%; padding: 6px 10px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.content select { width: auto; max-width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand2); box-shadow: var(--ring); }
textarea { min-height: 64px; resize: vertical; line-height: 1.5; }
label { color: var(--ink2); }

/* ---------------------------------------------------------------- badges and states */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; line-height: 18px;
  padding: 0 7px; border-radius: 5px; background: var(--unk-bg); color: var(--unk); white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(75,85,99,.12); }
.badge.ok, .g-verificato .grade { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(21,127,60,.18); }
.badge.warn, .g-da_rivedere .grade, .g-ambiguo .grade { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(154,91,6,.2); }
.badge.bad, .g-conflitto .grade { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(180,35,24,.2); }
.badge.info { background: var(--info-bg); color: var(--info); box-shadow: inset 0 0 0 1px rgba(29,78,216,.16); }
.badge.human { background: var(--human-bg); color: var(--human); box-shadow: inset 0 0 0 1px rgba(109,40,217,.16); }
.badge.ai { background: var(--ai-bg); color: var(--ai); box-shadow: inset 0 0 0 1px rgba(14,107,131,.16); }
.badge.unk, .g-non_trovato .grade { background: var(--unk-bg); color: var(--unk); }
.badge.alta { background: var(--bad-bg); color: var(--bad); } .badge.media { background: var(--warn-bg); color: var(--warn); }
.badge.bassa { background: var(--unk-bg); color: var(--unk); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: currentColor; }

/* ---------------------------------------------------------------- tender header and tabs */
.th { background: var(--panel); border-bottom: 1px solid var(--line); padding: 18px 32px 0; }
.th .kicker { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.th h1 { margin: 6px 0 4px; font-size: 20px; max-width: 1100px; }
.th .facts { display: flex; gap: 28px; flex-wrap: wrap; margin: 12px 0 14px; }
.th .facts div { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.th .facts b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; text-transform: none; letter-spacing: 0;
  font-variant-numeric: tabular-nums; margin-top: 1px; }
.th .facts div .btn, .th .facts div .badge { text-transform: none; letter-spacing: 0; }
.tabs { display: flex; gap: 0; overflow-x: auto; margin: 0 -4px; }
.tabs a { padding: 9px 12px 10px; font-size: 13px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 550;
  white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { border-color: var(--brand2); color: var(--ink); }
.tabs .cnt { font-size: 11px; font-weight: 600; background: var(--warn-bg); color: var(--warn); padding: 0 6px;
  border-radius: 9px; margin-left: 5px; }
.tabs .later { color: var(--faint); font-weight: 500; }

/* ---------------------------------------------------------------- facts: every card shows its epistemic state */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fact { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fff; position: relative; }
.fact-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.fact-value { font-weight: 600; font-size: 14px; word-break: break-word; font-variant-numeric: tabular-nums; }
.fact.g-da_rivedere, .fact.g-ambiguo { border-left: 3px solid #e0a84a; }
.fact.g-conflitto { border-left: 3px solid var(--bad); background: #fffbfa; }
.fact.g-non_trovato { border-style: dashed; background: var(--sunken); }
.g-non_trovato .fact-value { color: var(--muted); font-weight: 500; font-style: italic; }
.fact-meta { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.fact .note { font-size: 12px; color: var(--ink2); margin-top: 5px; }
.fact .ai-was { font-size: 11.5px; color: var(--muted); text-decoration: line-through; margin-top: 3px; }
.fact details.fa { margin-top: 6px; } .fact details.fa summary { font-size: 11.5px; color: var(--muted); cursor: pointer; list-style: none; }
.fact details.fa summary:hover { color: var(--ink); }
.fact details.fa[open] { background: var(--sunken); border: 1px solid var(--line2); padding: 8px; border-radius: 6px; }
.fact details.fa form { display: grid; gap: 6px; margin-top: 6px; }
.fact.wide { grid-column: 1 / -1; }
.fact.g-human { border-left: 3px solid var(--human); }
.cite { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 0 6px; line-height: 18px;
  border-radius: 5px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink2); cursor: pointer; }
.cite:hover { border-color: var(--brand2); color: var(--brand2); text-decoration: none; }
.cite.v-exact, .cite.v-fuzzy, .cite.v-other_page { border-color: #b6dfc4; color: var(--ok); background: #fbfefc; }
.cite.v-not_found, .cite.v-bad_doc, .cite.v-too_short { border-color: #efc58f; color: var(--warn); background: #fffaf1; }

/* ---------------------------------------------------------------- tables */
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--sunken); white-space: nowrap; }
table.t th:first-child { border-top-left-radius: 6px; } table.t th:last-child { border-top-right-radius: 6px; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.t tbody tr:hover td, table.t tr:hover > td { background: #fafbfc; }
table.t tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- checks */
.check { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.check:last-child { border-bottom: 0; }
.check .ic { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 11.5px; flex: none;
  margin-top: 1px; font-weight: 700; }
.check.ok .ic { background: var(--ok-bg); color: var(--ok); } .check.warn .ic { background: var(--warn-bg); color: var(--warn); }
.check.error .ic { background: var(--bad-bg); color: var(--bad); } .check.info .ic { background: var(--info-bg); color: var(--info); }
.check .d { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- stat cards */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); }
.stat .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat .v { font-size: 22px; font-weight: 650; margin-top: 3px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--muted); }
.stat.hl { border-color: #c7d3ea; background: var(--brand-bg); }

/* ---------------------------------------------------------------- offer architecture */
.chapter { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.chapter > .ch-head { display: flex; gap: 14px; align-items: center; padding: 12px 16px; background: var(--sunken); border-bottom: 1px solid var(--line); }
.ch-head .n { width: 28px; height: 28px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center;
  font-weight: 650; flex: none; font-size: 13px; }
.ch-head .ttl { flex: 1; font-weight: 650; font-size: 14.5px; }
.ch-head .pts { text-align: right; min-width: 120px; }
.ch-head .pts b { font-size: 17px; font-variant-numeric: tabular-nums; }
.bar { height: 5px; background: var(--line2); border-radius: 3px; overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--brand2); border-radius: 3px; }
.para { padding: 12px 16px 12px 58px; border-bottom: 1px solid var(--line2); }
.para:last-child { border-bottom: 0; }
.para .ph { display: flex; gap: 10px; align-items: baseline; }
.para .ph .pn { font-weight: 650; color: var(--brand2); min-width: 34px; font-variant-numeric: tabular-nums; }
.para .ph .pt { font-weight: 600; flex: 1; }
.para .look { background: var(--ai-bg); border-radius: 6px; padding: 8px 10px; margin: 8px 0; font-size: 13px; color: #0b4a5a; }
.need { display: inline-flex; gap: 6px; align-items: center; border: 1px dashed #c9cfd8; border-radius: 6px; padding: 2px 8px;
  margin: 3px 4px 0 0; font-size: 12px; background: #fff; }
.need .o { font-weight: 650; color: var(--human); }
.need.done { opacity: .8; }
.need .ans-inline { display: block; font-size: 12px; color: var(--ok); margin-top: 2px; }
.risk { font-size: 12.5px; color: var(--bad); margin-top: 4px; }

/* ---------------------------------------------------------------- work queue */
.q { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.q.done { background: var(--sunken); box-shadow: none; }
.q .qh { display: flex; gap: 8px; align-items: flex-start; }
.q .qt { font-weight: 600; flex: 1; }
.q .why { font-size: 12.5px; color: var(--muted); margin: 4px 0; }
.q .ans { background: var(--human-bg); border-radius: 6px; padding: 8px 10px; margin-top: 6px; font-size: 13px; }
.q form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; align-items: start; }
.q form .acts { display: flex; flex-direction: column; gap: 6px; }
.owner-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.owner-chips a { border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 10px; background: #fff; font-size: 12.5px;
  color: var(--ink2); font-weight: 500; }
.owner-chips a:hover { text-decoration: none; background: var(--sunken); }
.owner-chips a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------------------------------------------------------------- source drawer */
.drawer { position: fixed; top: 0; right: 0; width: min(720px, 92vw); height: 100vh; background: #fff; border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(17,24,39,.12); transform: translateX(105%); transition: transform .18s ease; z-index: 50;
  display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer .dh { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.drawer .db { padding: 14px 18px; overflow: auto; flex: 1; }
.drawer pre { white-space: pre-wrap; font-family: "Cascadia Mono", "SF Mono", Consolas, monospace; font-size: 12px; line-height: 1.6;
  background: var(--sunken); border: 1px solid var(--line2); border-radius: 6px; padding: 12px; }
.drawer mark { background: #fde68a; padding: 1px 0; border-radius: 2px; box-shadow: 0 0 0 2px #fde68a; }
.src-quote { border-left: 3px solid var(--brand2); padding: 6px 10px; background: var(--brand-bg); border-radius: 0 6px 6px 0;
  margin-bottom: 10px; font-size: 13px; }
.scrim { position: fixed; inset: 0; background: rgba(17,24,39,.22); z-index: 40; display: none; }
.scrim.open { display: block; }

/* ---------------------------------------------------------------- page header, cards, messages */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--sunken); font-size: 13.5px; }
.hero { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
  box-shadow: var(--shadow); }
.hero h1 { font-size: 19px; margin-bottom: 4px; }
.hero p { color: var(--muted); margin: 4px 0 0; max-width: 860px; font-size: 13.5px; }
.card-t { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink);
  box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s; }
.card-t:hover { border-color: var(--line-strong); box-shadow: var(--shadow-pop); text-decoration: none; }
.card-t .ttl { font-weight: 650; margin: 4px 0; font-size: 14.5px; line-height: 1.35; }
.card-t .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.run-note { font-size: 12px; color: var(--ai); background: var(--ai-bg); border-radius: 6px; padding: 5px 10px; display: inline-flex; gap: 6px; align-items: center; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
ul.clean { margin: 0; padding-left: 18px; } ul.clean li { margin: 3px 0; }
.pill-line { display: flex; gap: 6px; flex-wrap: wrap; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; border: 1px solid transparent;
  border-left-width: 3px; background: #fff; }
.flash.warn { background: var(--warn-bg); color: #6f4204; border-color: #f1d9a9; border-left-color: var(--warn); }
.flash.info { background: var(--info-bg); color: #1e3a8a; border-color: #cddcfb; border-left-color: var(--info); }
.flash-error { background: var(--bad-bg); color: #7a1a12; border-color: #f5c7c2; border-left-color: var(--bad); margin: 12px 32px 0; }
.main > .flash.warn { margin: 12px 32px 0 !important; }
code { font-family: "Cascadia Mono", "SF Mono", Consolas, monospace; font-size: 12px; background: var(--line2); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .foot { display: none; }
  .cols, .g3, .g4 { grid-template-columns: 1fr; }
  .content, .th { padding-left: 16px; padding-right: 16px; } .top { padding: 0 16px; }
}

/* ---------------------------------------------------------------- brain and studio */
.asset { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 12px 14px; box-shadow: var(--shadow); }
.asset:target { outline: 2px solid var(--brand2); outline-offset: 1px; }
.asset .at { font-weight: 650; margin: 4px 0; }
.asset .rt { font-size: 12.5px; background: var(--sunken); border-left: 3px solid var(--line-strong); padding: 6px 10px; margin-top: 6px;
  color: var(--ink2); white-space: pre-wrap; max-height: 150px; overflow: auto; border-radius: 0 6px 6px 0; }
.asset .fx { font-size: 12px; color: var(--ink2); margin-top: 4px; }
.asset.excluded { opacity: .55; }
.type-chip { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand2); }
.cov { font-weight: 600; font-size: 11.5px; padding: 0 7px; line-height: 18px; border-radius: 5px; }
.cov-forte { background: var(--ok-bg); color: var(--ok); } .cov-parziale { background: var(--warn-bg); color: var(--warn); }
.cov-debole, .cov-assente { background: var(--bad-bg); color: var(--bad); }
.draft { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; font-size: 14.5px; line-height: 1.65;
  box-shadow: var(--shadow); max-width: 900px; }
.draft h3, .draft h4, .draft h5 { margin: 16px 0 6px; } .draft p { margin: 6px 0; } .draft ul, .draft ol { margin: 6px 0 6px 20px; padding: 0; }
.draft .aref { font-size: 11.5px; font-weight: 600; background: var(--brand-bg); color: var(--brand2); padding: 0 6px; border-radius: 5px; white-space: nowrap; }
.draft .aref.bad { background: var(--bad-bg); color: var(--bad); }
.tbc { background: #fff3c4; color: #6f4204; font-weight: 600; font-size: 12.5px; padding: 1px 6px; border-radius: 4px; border: 1px dashed #d9a93f; }
.status-strip { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-radius: var(--radius); margin-bottom: 12px;
  font-weight: 600; font-size: 13.5px; border: 1px solid transparent; }
.status-strip.bozza_ai { background: var(--ai-bg); color: var(--ai); border-color: #c9e6ee; }
.status-strip.approvata { background: var(--ok-bg); color: var(--ok); border-color: #c7e7d2; }
.status-strip.rifiutata { background: var(--bad-bg); color: var(--bad); border-color: #f5c7c2; }
.status-strip.modificata { background: var(--human-bg); color: var(--human); border-color: #ddd0f7; }
.ver { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ver a { font-size: 12px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 8px; background: #fff; }
.ver a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.band { font-size: 18px; font-weight: 750; text-transform: uppercase; letter-spacing: .02em; }

/* ---------------------------------------------------------------- iteration 1: human layer, decision, economics */
.badge.soon { background: var(--line2); color: var(--muted); font-weight: 600; font-size: 10px; padding: 0 6px; margin-left: 4px; box-shadow: none; }
.nav-off { display: flex; gap: 9px; align-items: center; padding: 6px 10px; color: var(--faint); cursor: default; font-size: 13.5px; }
.decision-badge { display: inline-block; font-weight: 750; font-size: 18px; padding: 5px 12px; border-radius: 6px; margin-bottom: 6px; letter-spacing: .01em; }
.d-GO { background: var(--ok-bg); color: var(--ok); } .d-NO_GO { background: var(--bad-bg); color: var(--bad); }
.d-GO_CON_RISERVA { background: var(--warn-bg); color: var(--warn); }
.badge.d-GO, .badge.d-NO_GO, .badge.d-GO_CON_RISERVA { font-size: 10px; padding: 0 6px; }
.badge.nat-fatto { background: var(--ok-bg); color: var(--ok); } .badge.nat-ipotesi { background: var(--human-bg); color: var(--human); }
.badge.nat-derivato { background: var(--unk-bg); color: var(--ink2); } .badge.nat-decisione { background: var(--warn-bg); color: var(--warn); }
.badge.nat-mancante { background: var(--bad-bg); color: var(--bad); }
.answer { border-top: 1px solid var(--line); padding: 10px 0; }
.answer .q { font-weight: 650; margin-bottom: 4px; border: 0; padding: 0; box-shadow: none; background: none; }

/* ---------------------------------------------------------------- iteration 2: studio */
.need-card { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 8px 0; background: #fff; }
.need-card.s-risolto { border-left: 3px solid var(--ok); } .need-card.s-proposto { border-left: 3px solid var(--ai); }
.need-card.s-aperto { border-left: 3px solid var(--warn); }
.badge.fam-riusabile { background: var(--ok-bg); color: var(--ok); } .badge.fam-specifico_gara { background: var(--brand-bg); color: var(--brand2); }
.badge.fam-decisione { background: var(--warn-bg); color: var(--warn); } .badge.fam-evidenza { background: var(--human-bg); color: var(--human); }
.badge.fam-costo { background: var(--bad-bg); color: var(--bad); }
.badge.imp-decisivo { background: var(--brand); color: #fff; box-shadow: none; } .badge.imp-alto { background: var(--brand2); color: #fff; box-shadow: none; }
.badge.imp-medio { background: var(--brand-bg); color: var(--brand2); } .badge.imp-basso { background: var(--line2); color: var(--muted); }
.draft table.mdt { margin: 8px 0; font-size: 13px; }
.look { background: var(--ai-bg); padding: 8px; border-radius: 6px; }
.diff del { background: var(--bad-bg); color: var(--bad); } .diff ins { background: var(--ok-bg); color: var(--ok); text-decoration: none; }
