/* VP HeatMapAudit — foglio di lavoro regolamentare. Palette per installazione in brand.css. */
@font-face { font-family: "Encode Sans"; src: url("../fonts/EncodeSans-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/SourceSans3-Variable.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
:root {
  --brand-ink: #20364b; --brand-ink-soft: #2b4b61; --brand-ink-text: #dce6ed; --brand-ink-muted: #bdcdd9;
  --brand-primary: #274b63; --brand-primary-strong: #193b52; --brand-primary-soft: #e4edf1;
  --brand-canvas: #eff2f2; --brand-surface: #fff; --brand-surface-alt: #f6f8f8; --brand-border: #d0dadd;
  --brand-text: #233841; --brand-muted: #596d76; --brand-focus: #246d9d; --brand-focus-on-ink: #a8d6f1;
  --brand-invalid: #a32431; --brand-invalid-soft: #fff2f1; --brand-success: #215c40; --brand-success-soft: #edf6ef; --brand-success-border: #bbd8c7;
  --brand-level-0: #d5eadd; --brand-level-0-ink: #244c38; --brand-level-1: #65bc91; --brand-level-1-ink: #153b2b;
  --brand-level-2: #b7da72; --brand-level-2-ink: #304916; --brand-level-3: #ffda72; --brand-level-3-ink: #55410d;
  --brand-level-4: #efa85b; --brand-level-4-ink: #58300d; --brand-level-5: #c53b49; --brand-level-5-ink: #fff;
  --brand-level-missing: #e9eef0; --brand-level-missing-ink: #53656e;
  --matrix-head-1: 32px; --radius: 2px; --radius-sm: 2px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; scrollbar-color: #aabcc3 #edf1f2; }
body { margin: 0; background: var(--brand-canvas); color: var(--brand-text); font: 14px/1.5 "Source Sans 3", sans-serif; }
::selection { background: var(--brand-primary); color: white; }
:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: 3px; }
.appbar :focus-visible, .techbar :focus-visible { outline-color: var(--brand-focus-on-ink); }
a { color: var(--brand-primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-primary-strong); }
h1, h2, h3 { font-family: "Encode Sans", sans-serif; margin: 0 0 10px; line-height: 1.3; font-weight: 600; }
h1 { font-size: 24px; letter-spacing: -0.025em; }
h2 { font-size: 18px; letter-spacing: -0.015em; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; } p:last-child { margin-bottom: 0; }
.muted, .hint { color: var(--brand-muted); }
.hint { margin: 6px 0 0; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: -60px; left: 12px; padding: 10px 16px; background: white; color: var(--brand-ink); }
.skip-link:focus { top: 8px; }
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 30; background: var(--brand-ink); color: white; }
.appbar-inner { min-height: 64px; display: flex; align-items: stretch; gap: 20px; padding: 0 24px; }
.appbar-brand { display: flex; align-items: center; flex: none; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { width: auto; height: 32px; display: block; }
.appbar-brand .brand-logo { background: white; padding: 3px; height: 34px; }
.brand-name { color: var(--brand-text); font-weight: 700; }
.appbar-app { align-self: center; font-family: "Encode Sans", sans-serif; font-size: 15px; font-weight: 600; white-space: nowrap; }
.appnav { display: flex; flex: 1; min-width: 0; }
.nav-list { list-style: none; display: flex; align-items: stretch; margin: 0; padding: 0; gap: 4px; }
.nav-list li { display: flex; }
.nav-link { display: flex; align-items: center; padding: 0 12px; color: var(--brand-ink-text); font-size: 13px; font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; padding-top: 3px; white-space: nowrap; }
.nav-link:hover { background: var(--brand-ink-soft); color: white; }
.nav-link.is-active { background: var(--brand-ink-soft); color: white; border-bottom-color: #a8d0df; }
.appbar-user { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 12px; }
.appbar-context { display: none; }
.user-box { line-height: 1.3; white-space: nowrap; }
.user-name { display: block; font-weight: 600; color: white; }
.user-role { color: var(--brand-ink-muted); font-size: 11px; }
.appbar form { margin: 0; }
.nav-toggle { display: none; color: white; border: 1px solid #657d8d; background: transparent; padding: 8px; align-self: center; cursor: pointer; }
.icon { width: 18px; height: 18px; display: block; }
.frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; min-width: 0; width: 100%; padding: 26px 28px 20px; }
.content-narrow { max-width: 1000px; margin: auto; }
.pagefoot { padding: 6px 28px 16px; color: var(--brand-muted); font-size: 11px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin: 0 0 24px; }
.page-heading h1 { margin-bottom: 5px; }
.page-heading p { color: var(--brand-muted); max-width: 76ch; margin: 0; }
.page-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 12px; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.heatmap-heading { padding-bottom: 20px; margin-bottom: 0; }
.heatmap-heading h1 { font-size: 25px; }
.backlink { display: inline-block; margin-bottom: 16px; font-weight: 600; text-decoration: none; }
.panel { background: var(--brand-surface); border: 1px solid var(--brand-border); padding: 24px; margin-bottom: 20px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.section-title h2 { margin: 0; }
.section-note { color: var(--brand-muted); font-size: 13px; }
.btn { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 34px; padding: 6px 13px; border: 1px solid #b8c7ce; border-radius: 2px; background: white; color: var(--brand-text); font: 600 13px/1.4 "Source Sans 3", sans-serif; text-decoration: none; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; white-space: nowrap; }
.btn:hover { background: var(--brand-surface-alt); border-color: #7c949f; color: var(--brand-text); }
.btn-primary { background: var(--brand-primary); border-color: var(--brand-primary); color: white; }
.btn-primary:hover { background: var(--brand-primary-strong); border-color: var(--brand-primary-strong); color: white; }
.btn-ink { background: transparent; border-color: #647c8c; color: white; min-height: 30px; }
.btn-ink:hover { background: var(--brand-ink-soft); color: white; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.full { width: 100%; }
.linkbtn { font: inherit; font-weight: 600; padding: 0; border: 0; background: transparent; color: var(--brand-primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.icon-button { width: 32px; height: 32px; padding: 6px; border: 1px solid var(--brand-border); background: white; cursor: pointer; color: var(--brand-muted); }
.icon-button:hover { background: var(--brand-surface-alt); color: var(--brand-text); }
.icon-button svg { width: 18px; height: 18px; }
label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; }
input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="url"], input[type="date"], input[type="datetime-local"], select, textarea { width: 100%; border: 1px solid #bdcbd1; border-radius: 2px; background: white; color: var(--brand-text); padding: 7px 10px; font: inherit; font-size: 14px; min-height: 35px; caret-color: var(--brand-primary); }
input::placeholder, textarea::placeholder { color: #657780; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-focus); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--brand-invalid); background: var(--brand-invalid-soft); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-primary); flex: none; }
textarea { min-height: 96px; resize: vertical; }
.method-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.form-section-title { margin-top: 28px; }
input.number-input { width: 98px; text-align: right; font-variant-numeric: tabular-nums; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-bottom: 18px; }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.form-grid > .span-2 { grid-column: span 2; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.pending { font-size: 12px; color: #765310; font-weight: 600; }
.req { color: var(--brand-primary); }
.input-unit { display: flex; }
.input-unit input { border-right: 0; border-radius: 2px 0 0 2px; }
.input-unit .unit { display: flex; align-items: center; padding: 0 12px; border: 1px solid #bdcbd1; background: var(--brand-surface-alt); font-size: 13px; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 12px 20px; margin: 16px 0; }
.permission-grid label, .check-label { display: flex; align-items: center; gap: 9px; margin: 0; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.toolbar .field { flex: 1 1 240px; max-width: 380px; }
.toolbar .field-sm { flex: 0 1 180px; }
.toolbar-note { margin: 0 0 0 auto; color: var(--brand-muted); font-size: 12px; }
.table-scroll { position: relative; overflow: auto; border: 1px solid var(--brand-border); }
table.data { width: 100%; border-collapse: collapse; background: white; font-size: 14px; }
table.data th { background: var(--brand-surface-alt); color: var(--brand-muted); text-align: left; font-size: 12px; font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--brand-border); white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--brand-border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--brand-surface-alt); }
table.data .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.code { font-size: 11px; font-weight: 700; color: var(--brand-muted); font-variant-numeric: tabular-nums; margin-right: 8px; }
.table-footer { margin: 10px 0; color: var(--brand-muted); font-size: 13px; }
.report-metadata { display: flex; flex-wrap: wrap; gap: 16px 32px; margin: 0 0 16px; }
.report-metadata > div { min-width: 0; }
.report-metadata dt { color: var(--brand-muted); font-size: 12px; }
.report-metadata dd { margin: 0; overflow-wrap: anywhere; }
.report-integrity { margin-top: 16px; }
.report-integrity summary, .report-contributions summary { cursor: pointer; color: var(--brand-primary); font-weight: 600; min-height: 44px; padding: 11px 0; }
.report-integrity .report-metadata { margin: 8px 0; }
.report-areas tbody th { min-width: 180px; max-width: 320px; white-space: normal; vertical-align: top; font-size: 14px; font-weight: 400; color: var(--brand-text); }
.report-detail-cell { min-width: 240px; }
.report-causes { margin: 4px 0 8px; padding-left: 18px; }
.report-contribution-list { list-style: none; margin: 0; padding: 0; max-width: 65ch; }
.report-contribution-list > li { padding: 12px 0; border-top: 1px solid var(--brand-border); }
.report-contribution-list p { margin: 4px 0; }
.report-contribution-list blockquote { margin: 12px 0; padding: 0 12px; border-left: 1px solid var(--brand-border); }
.report-contribution-list blockquote footer { color: var(--brand-muted); font-size: 13px; }
.audit-workspace { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; align-items: start; }
.audit-workspace.has-inspector { grid-template-columns: minmax(0,1fr) 340px; }
.matrix-panel { min-width: 0; border: 1px solid #b9cbd2; background: white; }
.matrix-panel .toolbar { padding: 12px 14px; background: var(--brand-surface-alt); border-bottom: 1px solid #b9cbd2; }
.matrix-scroll { position: relative; overflow: auto; max-height: calc(100dvh - 256px); min-height: 180px; }
table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.matrix th, .matrix td { padding: 7px 12px; border-right: 1px solid rgba(35,56,65,.14); border-bottom: 1px solid rgba(35,56,65,.14); }
.matrix th:last-child, .matrix td:last-child { border-right: 0; }
.matrix tr:last-child td { border-bottom: 0; }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--brand-ink); color: white; font-weight: 600; font-size: 12px; text-align: center; border-color: #587181; }
.matrix thead tr:first-child th { height: var(--matrix-head-1); padding-block: 5px; }
.matrix thead tr:nth-child(2) th { top: var(--matrix-head-1); background: var(--brand-ink-soft); padding-block: 5px; }
.matrix .grp-start { border-left: 1px solid #7b939f; }
.matrix .grp-weight { margin-left: 6px; font-weight: 400; font-size: 11px; color: var(--brand-ink-text); }
.matrix .grp-excluded, .matrix .kpi-excluded { color: #e3d7b6; }
.matrix .col-kpi { min-width: 102px; max-width: 160px; }
.matrix .col-judiciary { min-width: 170px; max-width: 210px; text-align: center; }
.matrix .col-fte { min-width: 120px; text-align: center; }
.matrix .module-note { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; }
.matrix-summary [data-kpi-col] { display: none; }
.matrix-summary thead tr:nth-child(2) { display: none; }
.matrix .kpi-name { display: block; font-size: 12px; line-height: 1.25; }
.matrix .kpi-weight { display: block; font-size: 10px; color: var(--brand-ink-text); margin-top: 3px; }
.matrix .col-id { position: sticky; z-index: 1; background: white; text-align: left; }
.matrix thead .col-id { z-index: 4; background: var(--brand-ink); }
.matrix .col-code { left: 0; width: 100px; min-width: 100px; max-width: 100px; font-size: 11px; color: var(--brand-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matrix thead .col-code { color: var(--brand-ink-text); }
.matrix .col-name { left: 100px; min-width: 230px; width: 32%; }
.matrix thead .col-name { text-align: left; }
.matrix .area-name { color: var(--brand-text); font-size: 14px; line-height: 1.25; font-weight: 600; text-decoration: none; display: block; }
.matrix .area-name:hover { text-decoration: underline; color: var(--brand-primary); }
.matrix .area-class { display: none; }
.matrix .area-code-inline { display: none; }
.matrix td { vertical-align: middle; height: 43px; font-variant-numeric: tabular-nums; }
.matrix .cell { text-align: center; }
.matrix .cell-score { min-width: 108px; }
.matrix-summary .cell-score { font-size: 14px; min-width: 130px; width: 170px; font-weight: 600; }
.matrix-summary .cell-official { width: 180px; }
.matrix .cell-official { min-width: 142px; text-align: center; }
.matrix .cell-official strong { display: block; font-size: 17px; font-weight: 700; line-height: 1.1; }
.matrix .official-note { display: block; font-size: 10px; font-weight: 500; line-height: 1.1; margin-top: 1px; }
.matrix .header-note { display: block; font-size: 10px; color: var(--brand-ink-text); font-weight: 400; }
.matrix .sort-score { border: 0; background: transparent; color: white; font: inherit; font-weight: 700; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 7px; }
.sort-score svg { width: 14px; height: 14px; }
.matrix .cell[data-level="0"], .swatch[data-level="0"] { background: var(--brand-level-0); color: var(--brand-level-0-ink); }
.matrix .cell[data-level="1"], .swatch[data-level="1"] { background: var(--brand-level-1); color: var(--brand-level-1-ink); }
.matrix .cell[data-level="2"], .swatch[data-level="2"] { background: var(--brand-level-2); color: var(--brand-level-2-ink); }
.matrix .cell[data-level="3"], .swatch[data-level="3"] { background: var(--brand-level-3); color: var(--brand-level-3-ink); }
.matrix .cell[data-level="4"], .swatch[data-level="4"] { background: var(--brand-level-4); color: var(--brand-level-4-ink); }
.matrix .cell[data-level="5"], .swatch[data-level="5"] { background: var(--brand-level-5); color: var(--brand-level-5-ink); }
.matrix .cell-empty, .swatch-neutral { background: var(--brand-level-missing); color: var(--brand-level-missing-ink); font-size: 12px; }
.matrix-summary .cell-score[data-level] { background: var(--brand-surface-alt); color: var(--brand-text); }
.matrix tbody tr:hover .col-id, .matrix tr.is-selected .col-id { background: var(--brand-primary-soft); }
.matrix tr.is-selected .area-name { color: var(--brand-primary-strong); }
.matrix [data-no-match] td { background: white; height: 100px; text-align: center; }
.reasons { margin-top: 5px; font-size: 12px; font-weight: 400; text-align: left; }
.reasons summary { cursor: pointer; font-size: 11px; color: var(--brand-primary); text-align: center; }
.reasons ul { margin: 10px 0 0; padding-left: 16px; min-width: 150px; }
.matrix-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 10px 14px; border-top: 1px solid #b9cbd2; font-size: 11px; color: var(--brand-muted); }
.legend-title { font-weight: 600; margin-right: 4px; }
.swatch { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; font-size: 11px; font-variant-numeric: tabular-nums; }
.legend-note { margin-left: 8px; }
.completeness { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.area-inspector { background: white; border: 1px solid #b9cbd2; padding: 18px; max-height: calc(100dvh - 180px); display: flex; flex-direction: column; position: sticky; top: 80px; }
.inspector-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.area-inspector h2 { font-size: 19px; margin-bottom: 5px; }
#inspector-title { scroll-margin-top: 84px; }
.inspector-classification { color: var(--brand-muted); font-size: 12px; }
.inspector-links { display: flex; gap: 16px; font-size: 12px; padding: 10px 0 18px; border-bottom: 1px solid var(--brand-border); }
.area-inspector form { display: flex; flex-direction: column; min-height: 0; }
.inspector-fields { overflow: auto; min-height: 0; }
.inspector-section { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 10px; }
.inspector-section h3 { font-size: 13px; margin: 0; }
.inspector-section span { font-size: 11px; color: var(--brand-muted); }
.inspector-field { display: grid; grid-template-columns: minmax(0,1fr) 82px; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--brand-border); }
.inspector-field label { font-size: 13px; font-weight: 500; line-height: 1.3; margin: 0; }
.inspector-field label span { display: block; color: var(--brand-muted); font-size: 10px; margin-top: 4px; }
.inspector-field input { font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.inspector-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; padding-top: 16px; margin-top: 12px; border-top: 1px solid var(--brand-border); }
.inspector-actions > div { display: flex; gap: 8px; }
.inspector-message { font-size: 12px; color: var(--brand-success); margin: 12px 0 0; }
.inspector-message.is-error { color: var(--brand-invalid); }
.validation { background: var(--brand-invalid-soft); border: 1px solid #ebbbc0; color: var(--brand-invalid); padding: 12px 16px; margin: 0 0 20px; }
.validation:empty, .validation-summary-valid { display: none; }
.validation ul { margin: 0; padding-left: 18px; }
.flash { color: var(--brand-success); background: var(--brand-success-soft); border: 1px solid var(--brand-success-border); padding: 12px 16px; margin-bottom: 20px; }
.notice { background: var(--brand-surface-alt); padding: 14px 16px; border: 1px solid var(--brand-border); margin-bottom: 18px; }
.notice h3 { margin-bottom: 6px; }
.notice ul { padding-left: 18px; margin: 0; color: var(--brand-muted); }
.empty { padding: 32px; color: var(--brand-muted); }
.empty h2, .empty h3 { color: var(--brand-text); }
.empty p { max-width: 66ch; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pagenote { margin: 18px 0 0; font-size: 12px; color: var(--brand-muted); }
.pagenote summary { cursor: pointer; font-weight: 600; }
.pagenote p { margin-top: 10px; max-width: 90ch; }
.method-version { border-top: 1px solid var(--brand-border); padding: 14px 0; }
.method-version summary { cursor: pointer; font-weight: 600; }
.method-version p { white-space: pre-wrap; max-width: 80ch; margin-top: 14px; }
.chip { font-size: 11px; padding: 2px 6px; background: var(--brand-primary-soft); color: var(--brand-primary-strong); margin-left: 6px; white-space: nowrap; }
.chip-incomplete { background: var(--brand-level-missing); color: var(--brand-level-missing-ink); }
.group-sums { padding: 14px 16px; background: var(--brand-surface-alt); margin: 18px 0; border: 1px solid var(--brand-border); }
.group-sums p { margin-bottom: 5px; font-size: 13px; }
.area-list { border: 1px solid var(--brand-border); }
.area-list a { display: flex; gap: 10px; align-items: center; padding: 13px; color: var(--brand-text); text-decoration: none; border-bottom: 1px solid var(--brand-border); }
.area-list a:hover { background: var(--brand-surface-alt); }
.area-list a:last-child { border-bottom: 0; }
.area-open { margin-left: auto; color: var(--brand-primary); font-size: 12px; }
pre { background: var(--brand-ink); color: white; padding: 16px; overflow: auto; font-size: 12px; max-height: 320px; }
code { font-size: .92em; background: var(--brand-surface-alt); padding: 1px 4px; }
.auth-body { min-height: 100dvh; background: var(--brand-surface); font-size: 16px; }
.auth-stage { min-height: 100dvh; display: flex; flex-direction: column; }
.auth-header { min-height: 76px; padding: 12px 28px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--brand-border); }
.auth-brand .brand-logo { width: auto; max-width: 164px; height: auto; max-height: 50px; }
.auth-product { font-family: "Encode Sans",sans-serif; font-size: 16px; font-weight: 600; }
.auth-entry { flex: 1; padding: 64px 24px; display: grid; place-items: center; }
.auth-card { width: min(380px,100%); }
.auth-heading { font-size: 27px; line-height: 1.3; margin-bottom: 28px; font-weight: 600; }
.auth-card form label { margin-top: 20px; font-size: 15px; }
.auth-card input { min-height: 48px; border-radius: var(--radius); padding: 11px 12px; border-color: var(--brand-border); font-size: 16px; caret-color: var(--brand-text); }
.auth-card form .btn { min-height: 48px; margin-top: 28px; font-size: 16px; }
.auth-password { position: relative; }
.auth-password input { padding-right: 82px; }
.auth-password button { position: absolute; right: 2px; top: 2px; min-height: 44px; padding-inline: 12px; border: 0; background: transparent; color: var(--brand-primary); font: 600 14px "Source Sans 3",sans-serif; cursor: pointer; border-radius: var(--radius); }
.auth-password button:hover { background: var(--brand-primary-soft); }
.auth-note, .auth-alt { color: var(--brand-muted); font-size: 14px; margin-top: 20px; }
.auth-alt { margin-top: 24px; }
.auth-alt a { display: inline-flex; align-items: center; min-height: 44px; }
.auth-foot { padding: 20px 24px; display: flex; justify-content: center; }
.auth-provider { display: block; width: 90px; height: auto; }
.history-detail { margin: 0; font-size: 13px; max-width: 80ch; }
.history-detail > div + div { margin-top: 9px; }
.history-detail dt { color: var(--brand-muted); font-size: 12px; }
.history-detail dd { margin: 1px 0 0; overflow-wrap: anywhere; }
.ai-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.chart-panel { margin: 0 0 22px; padding: 22px 24px 18px; background: var(--brand-surface); border: 1px solid var(--brand-border); min-width: 0; }
.chart-heading, .chart-navigation, .chart-footer, .chart-selection { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chart-heading { align-items: flex-start; margin-bottom: 18px; }
.chart-heading h2 { font-size: 19px; margin: 0 0 4px; }
.chart-heading p, .chart-footer p { margin: 0; font-size: 13px; color: var(--brand-muted); }
.chart-heading .btn { flex-shrink: 0; }
.chart-settings { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; margin-bottom: 15px; }
.chart-settings > label { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--brand-muted); }
.chart-settings select { width: clamp(190px,22vw,320px); max-width: 100%; }
.chart-settings input[type="number"] { width: 116px; }
.chart-settings .chart-labels { flex-direction: row; align-items: center; gap: 8px; min-height: 39px; color: var(--brand-text); }
.chart-labels input { width: 17px; height: 17px; accent-color: var(--brand-primary); }
.chart-navigation { flex-wrap: wrap; padding: 10px 0; border-block: 1px solid var(--brand-border); }
.chart-navigation > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chart-navigation .btn { min-height: 44px; padding: 7px 12px; }
.chart-navigation .chart-square { width: 44px; justify-content: center; padding: 10px; }
.chart-square svg { width: 20px; height: 20px; }
.chart-navigation [data-chart-scale] { min-width: 48px; text-align: right; color: var(--brand-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-stage { position: relative; min-width: 0; border: 1px solid var(--brand-border); background: #fff; overflow: hidden; }
.chart-stage svg { display: block; width: 100%; height: clamp(390px,48vw,620px); cursor: grab; touch-action: none; user-select: none; }
.chart-panel[data-mode="zoom"] .chart-stage svg { cursor: crosshair; }
.chart-stage svg:active { cursor: grabbing; }
.chart-stage svg:focus-visible { outline: 3px solid var(--brand-focus); outline-offset: -4px; }
.chart-point { cursor: pointer; }
.chart-point:hover path, .chart-point.is-selected path { stroke-width: 2.5; }
.chart-tooltip { position: absolute; z-index: 1; pointer-events: none; width: min(270px,calc(100% - 16px)); padding: 10px 12px; border: 1px solid var(--brand-border); background: #fff; box-shadow: 0 7px 22px rgba(20,40,70,.15); font-size: 12px; line-height: 1.5; }
.chart-tooltip strong, .chart-tooltip span { display: block; }
.chart-tooltip strong { margin-bottom: 4px; }
.chart-footer { margin-top: 12px; flex-wrap: wrap; }
.chart-legend { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--brand-muted); }
.chart-selection { margin-top: 14px; padding: 12px 14px; background: var(--brand-primary-soft); border: 1px solid var(--brand-border); }
.chart-selection > div { flex: 1; min-width: 0; }
.chart-selection strong { display: block; overflow-wrap: anywhere; }
.chart-selection p { margin: 4px 0 0; font-size: 13px; }
.chart-selection .btn { flex-shrink: 0; }
.chart-missing { margin-top: 12px; color: var(--brand-muted); font-size: 13px; }
.chart-missing summary { cursor: pointer; padding: 8px 0; }
.chart-missing li { margin-bottom: 5px; overflow-wrap: anywhere; }
.chart-panel [hidden] { display: none !important; }
@media (max-width: 900px) {
  .auth-header { padding: 12px 20px; gap: 20px; flex-wrap: wrap; }
  .auth-product { font-size: 14px; }
  .auth-entry { padding: 40px 24px; align-items: start; }
  .chart-panel { padding: 16px; }
  .chart-settings > label { flex: 1 1 180px; }
  .chart-settings select { width: 100%; }
  .chart-stage svg { height: 440px; }
  .chart-navigation .btn { min-height: 44px; }
}
@media (max-width: 540px) {
  .chart-heading { flex-wrap: wrap; }
  .chart-settings { gap: 12px; }
  .chart-settings > label { flex-basis: 100%; }
  .chart-settings .chart-labels { flex-basis: auto; }
  .chart-navigation { gap: 12px; }
  .chart-stage svg { height: 355px; }
  .chart-selection { flex-wrap: wrap; }
  .chart-selection > div { flex-basis: calc(100% - 50px); }
  .chart-selection .btn { order: 2; }
}
.tech-body { min-height: 100dvh; }
.techbar { display: flex; align-items: center; gap: 20px; background: var(--brand-ink); color: white; padding: 14px 24px; }
.techbar .brand-logo { background: white; padding: 3px; }
.techbar form { margin-left: auto; }
.techbar-label { font-size: 13px; }
.import-steps { display: flex; list-style: none; padding: 0; margin: 0 0 26px; gap: 30px; border-bottom: 1px solid var(--brand-border); }
.import-steps li { display: flex; align-items: center; gap: 9px; padding: 0 0 14px; color: var(--brand-muted); border-bottom: 2px solid transparent; font-size: 13px; }
.import-steps li span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--brand-border); font-size: 11px; }
.import-steps .is-current { color: var(--brand-primary-strong); font-weight: 700; border-bottom-color: var(--brand-primary); }
.import-steps .is-current span { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }
.import-steps .is-done span { background: var(--brand-primary-soft); color: var(--brand-primary-strong); border-color: transparent; }
.import-start { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(260px,1fr); padding: 0; max-width: 1100px; }
.import-upload { padding: 30px; }
.upload-icon { width: 36px; height: 36px; color: var(--brand-primary); margin-bottom: 16px; }
.import-upload h2 { font-size: 20px; }
.import-upload > p { max-width: 54ch; color: var(--brand-muted); }
.import-upload form { margin-top: 24px; }
input[type="file"] { display: block; width: 100%; padding: 12px; border: 1px dashed #9eb3be; background: var(--brand-surface-alt); font: inherit; font-size: 14px; }
input[type="file"]::file-selector-button { border: 1px solid #b8c7ce; background: white; color: var(--brand-text); padding: 7px 12px; margin-right: 12px; cursor: pointer; font: inherit; }
.import-upload form > .btn { margin-top: 22px; }
.import-help { padding: 30px; background: var(--brand-surface-alt); border-left: 1px solid var(--brand-border); }
.import-help ul { padding-left: 18px; margin: 18px 0 24px; display: grid; gap: 12px; }
.import-help p { color: var(--brand-muted); font-size: 13px; }
.import-mapping { max-width: 1100px; }
.import-source { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 0 0 18px; }
.import-source > div { min-width: 0; max-width: 100%; }
.import-source dt { color: var(--brand-muted); font-size: 13px; }
.import-source dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.import-source-fields { margin: 20px 0 24px; padding-block: 14px; border-block: 1px solid var(--brand-border); }
.import-source-fields summary { cursor: pointer; font-weight: 600; }
.import-source-fields label { margin-top: 14px; }
.import-settings { display: flex; gap: 16px; align-items: flex-end; margin: 22px 0; padding-bottom: 24px; border-bottom: 1px solid var(--brand-border); }
.import-settings > div { flex: 1; min-width: 0; }
.mapping-table td { vertical-align: middle !important; }
.mapping-table td:first-child { width: 42%; }
.mapping-table label { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.import-options { margin-top: 24px; }
.import-options > .hint { margin-left: 25px; max-width: 74ch; }
.import-save-mapping { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--brand-border); }
.import-save-mapping summary { cursor: pointer; font-weight: 600; }
.import-save-mapping label:first-of-type { margin: 18px 0; }
.import-save-mapping input[type="text"] { max-width: 440px; }
.import-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--brand-border); }
.import-actions form { margin: 0; }
.import-secondary-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.import-discard { margin: 18px 0 0; }
.import-discard .linkbtn { font-size: 12px; font-weight: 400; }
.import-status { font-size: 12px; font-weight: 600; color: var(--brand-muted); }
.import-counts { display: flex; gap: 32px; padding: 16px 0; margin: 18px 0; border-block: 1px solid var(--brand-border); }
.import-counts > div { display: flex; gap: 9px; align-items: baseline; }
.import-counts dt { color: var(--brand-muted); font-size: 13px; }
.import-counts dd { margin: 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.has-errors, .has-errors dt { color: var(--brand-invalid); }
.import-guidance { color: var(--brand-muted); font-size: 13px; max-width: 92ch; margin-bottom: 18px; }
.import-table th { white-space: normal !important; min-width: 110px; }
.import-table th:nth-child(2) { min-width: 230px; }
.import-table .row-number { color: var(--brand-muted); font-variant-numeric: tabular-nums; }
.table-subtext { display: block; margin-top: 3px; color: var(--brand-muted); font-size: 12px; }
.row-errors { margin: 0; padding-left: 16px; color: var(--brand-invalid); min-width: 220px; }
.import-row-error { background: var(--brand-invalid-soft); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 16px; font-size: 12px; color: var(--brand-muted); }
@media (min-width: 1600px) { .appbar-context { display: block; color: var(--brand-ink-muted); max-width: 230px; } }
@media (max-width: 1100px) { .appbar-app { display: none; } .appbar-inner { gap: 16px; } }
@media (min-width: 901px) and (max-width: 1250px) {
  .appbar-inner { flex-wrap: wrap; row-gap: 0; }
  .appbar-brand, .appbar-user { min-height: 60px; }
  .appnav { order: 3; flex: 1 0 100%; }
  .nav-list { min-height: 44px; }
}
@media (max-width: 900px) {
  .appbar-inner { min-height: 60px; padding: 10px 16px; flex-wrap: wrap; gap: 12px; align-items: center; }
  .nav-toggle { display: inline-flex; order: -2; }
  .appbar-brand { order: -1; }
  .appbar-user { margin-left: auto; gap: 10px; }
  .appbar .brand-logo { height: 30px; }
  .user-role { display: none; }
  .appnav { display: none; order: 5; flex: 1 0 100%; }
  body.nav-open .appnav { display: flex; }
  .nav-list { flex-wrap: wrap; gap: 0; width: 100%; padding-top: 6px; }
  .nav-list li { flex: 1 0 33%; }
  .nav-link { width: 100%; padding: 10px; }
  .content { padding: 20px 16px; }
  .audit-workspace.has-inspector { grid-template-columns: minmax(0,1fr); }
  .audit-workspace.has-inspector .matrix-panel { display: none; }
  .area-inspector { position: static; max-height: none; }
  .inspector-fields { overflow: visible; }
  .inspector-actions { position: sticky; bottom: 0; background: white; padding-bottom: 8px; }
  .matrix .col-code { display: none; }
  .matrix .col-name { left: 0; min-width: 170px; width: 170px; }
  .matrix .area-code-inline { display: block; font-size: 10px; font-weight: 600; color: var(--brand-muted); margin-bottom: 3px; }
  .matrix .cell-official { min-width: 118px; }
  .matrix-summary .cell-official { width: 118px; }
  .matrix-summary .cell-score { width: 130px; }
  .matrix-scroll { max-height: 68dvh; }
  .completeness { flex-basis: 100%; margin-left: 0; margin-top: 5px; }
  .legend-note { display: none; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid > .span-2 { grid-column: auto; }
  .toolbar .field { max-width: none; }
  .toolbar .field-sm { flex: 1 1 140px; }
  .panel { padding: 20px; }
  .import-start { display: block; padding: 0; }
  .import-upload, .import-help { padding: 24px 20px; }
  .import-help { border-left: 0; border-top: 1px solid var(--brand-border); }
  .import-steps { gap: 14px; }
  .import-steps li { font-size: 12px; gap: 5px; flex: 1; align-items: flex-start; }
  .import-steps li span { flex: none; width: 20px; height: 20px; }
  .import-settings { flex-direction: column; align-items: stretch; }
  .import-counts { gap: 10px 20px; flex-wrap: wrap; }
  .import-actions { align-items: stretch; }
  .pagination { justify-content: space-between; flex-wrap: wrap; }
}
.ai-workspace { max-width: 1320px; margin-inline: auto; }
.ai-provider { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 12px 0; margin: -6px 0 20px; border-block: 1px solid var(--brand-border); color: var(--brand-muted); font-size: 13px; }
.ai-provider strong { color: var(--brand-text); margin-right: 10px; }
.ai-launch summary { cursor: pointer; font-size: 16px; font-weight: 600; }
.ai-launch > p { margin-top: 14px; max-width: 75ch; }
.ai-selection { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.ai-selection legend { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.ai-options { max-height: 230px; overflow: auto; border: 1px solid var(--brand-border); background: var(--brand-surface); }
.ai-options label { padding: 10px 12px; border-bottom: 1px solid var(--brand-border); align-items: flex-start; min-height: 44px; }
.ai-options label:last-child { border-bottom: 0; }
.ai-options input { margin-top: 3px; }
.ai-options label:has(input:disabled) { color: var(--brand-muted); background: var(--brand-surface-alt); }
.ai-results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 28px 0 12px; }
.ai-results-heading h2 { margin: 0; }
.ai-filter { display: grid; grid-template-columns: minmax(180px,340px) auto; gap: 5px 10px; align-items: end; }
.ai-filter label { grid-column: 1 / -1; margin: 0; }
.ai-refresh-status { margin-bottom: 16px; }
.ai-result-group { margin-bottom: 28px; }
.ai-group-title { font-size: 13px; padding-block: 12px; border-bottom: 1px solid var(--brand-border); margin: 0; }
.ai-group-title > span { margin-left: 10px; font-weight: 400; }
.ai-result { background: var(--brand-surface); padding: 20px 24px; border: 1px solid var(--brand-border); border-top: 0; }
.ai-result-header { display: grid; grid-template-columns: minmax(0,1fr) auto 180px; align-items: center; gap: 24px; }
.ai-result-header h3 { margin-bottom: 5px; font-size: 16px; }
.ai-result-header p { color: var(--brand-muted); font-size: 13px; }
.ai-state { padding: 4px 8px; font-size: 12px; font-weight: 600; background: var(--brand-primary-soft); color: var(--brand-primary-strong); }
.ai-state.is-accepted { color: var(--brand-success); background: var(--brand-success-soft); }
.ai-value { text-align: right; }
.ai-value > span { display: block; font-size: 12px; color: var(--brand-muted); }
.ai-value strong { font-size: 23px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.ai-value small { font-size: 13px; font-weight: 400; color: var(--brand-muted); }
.ai-result-meta { color: var(--brand-muted); font-size: 12px; margin: 14px 0; overflow-wrap: anywhere; }
.ai-motivation, .ai-gaps { max-width: 75ch; }
.ai-gaps { padding-left: 18px; margin-block: 12px; }
.ai-evidence { margin-top: 16px; font-size: 13px; }
.ai-evidence summary { cursor: pointer; color: var(--brand-primary); font-weight: 600; min-height: 28px; }
.ai-source { margin-top: 12px; padding: 14px; background: var(--brand-surface-alt); overflow-wrap: anywhere; }
.ai-source blockquote { margin: 8px 0; white-space: pre-wrap; max-width: 75ch; }
.ai-decision { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--brand-border); }
.ai-decision textarea { max-width: 760px; }
.ai-decision .form-actions { margin-top: 12px; }
.ai-decision .hint { flex: 1; min-width: 220px; margin: 0; }
.ai-decision-record { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--brand-border); font-size: 13px; }
@media (max-width: 900px) {
  .ai-selection { grid-template-columns: 1fr; gap: 20px; }
  .ai-results-heading { display: block; }
  .ai-filter { margin-top: 18px; grid-template-columns: minmax(0,1fr) auto; }
  .ai-result { padding: 18px 16px; }
  .ai-result-header { grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .ai-result-header > div:first-child { grid-column: 1 / -1; }
  .ai-value { min-width: 140px; }
  .ai-decision .hint { flex-basis: 100%; }
  .ai-decision .btn { flex: 1; min-height: 44px; }
}
.ai-document-selection { margin-top: 24px; }
.ai-document-selection legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.ai-document-selection > .hint { max-width: 75ch; margin-block: 10px; }
.ai-document-selection > a { display: inline-block; margin-top: 12px; }
.documents-workspace { max-width: 1320px; margin-inline: auto; }
.documents-layout { display: grid; grid-template-columns: minmax(260px,340px) minmax(0,1fr); background: var(--brand-surface); border: 1px solid var(--brand-border); }
.document-register { border-right: 1px solid var(--brand-border); padding: 24px; min-width: 0; }
.document-register-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.document-register-heading h2 { font-size: 18px; margin: 0; }
.document-register-heading > span, .document-meta { font-size: 12px; }
.document-list { list-style: none; margin: 18px -24px 0; padding: 0; }
.document-list a { display: block; padding: 14px 24px; border-block: 1px solid transparent; text-decoration: none; overflow-wrap: anywhere; }
.document-list a:hover { background: var(--brand-surface-alt); }
.document-list a.is-selected { background: var(--brand-primary-soft); border-color: var(--brand-border); color: var(--brand-primary-strong); }
.document-list strong { display: block; font-size: 14px; font-weight: 600; }
.document-list a > span { display: block; color: var(--brand-muted); margin-top: 5px; font-size: 12px; }
.document-empty { color: var(--brand-muted); font-size: 14px; margin-block: 18px; }
.document-detail { min-width: 0; padding: 26px 30px; }
.document-detail > h2 { font-size: 21px; overflow-wrap: anywhere; margin-bottom: 8px; }
.document-detail > h3 { font-size: 15px; margin: 28px 0 6px; }
.document-detail > p { max-width: 70ch; }
.document-meta { color: var(--brand-muted); }
.document-version { padding-block: 18px; border-bottom: 1px solid var(--brand-border); }
.document-version strong { font-size: 14px; }
.document-version .table-subtext { overflow-wrap: anywhere; }
.document-latest { margin-left: 8px; color: var(--brand-primary-strong); background: var(--brand-primary-soft); padding: 2px 6px; font-size: 11px; }
.document-hash { margin-top: 10px; font-size: 12px; color: var(--brand-muted); }
.document-hash summary { cursor: pointer; min-height: 28px; }
.document-hash code { display: block; overflow-wrap: anywhere; color: var(--brand-text); font-size: 11px; }
.document-version-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.document-version-actions form { margin: 0; }
.document-upload { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--brand-border); }
.document-upload summary { cursor: pointer; color: var(--brand-primary); font-weight: 600; font-size: 14px; min-height: 32px; }
.document-upload form { margin-top: 14px; }
.document-upload input[type="file"] { min-width: 0; overflow: hidden; }
.document-upload .hint { margin-block: 10px 16px; }
.document-inspection { margin-top: 32px; }
.document-inspection h3 { margin-bottom: 10px; font-size: 17px; }
.document-search { margin: 20px 0; }
.document-search > div { display: flex; gap: 8px; }
.document-search input { min-width: 0; flex: 1; }
.document-preview { margin-top: 20px; }
.document-preview summary { cursor: pointer; color: var(--brand-primary); min-height: 32px; font-size: 14px; }
.document-preview pre, .document-passage { background: var(--brand-surface-alt); padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; max-height: 440px; overflow: auto; }
.document-passage { margin-block: 12px; }
.document-passage blockquote { margin: 8px 0 0; max-width: 75ch; }
@media (max-width: 900px) {
  .documents-layout { grid-template-columns: minmax(0,1fr); }
  .document-register { border-right: 0; border-bottom: 1px solid var(--brand-border); padding: 20px; }
  .document-detail { padding: 24px 20px; }
  .document-list { margin-inline: -20px; max-height: 270px; overflow: auto; }
  .document-list a { padding-inline: 20px; }
  .document-version-actions .btn, .document-upload .btn, .document-search .btn, .document-upload summary, .document-preview summary, .document-hash summary { min-height: 44px; }
  .ai-launch .btn, .documents-workspace .page-heading .btn { min-height: 44px; }
  .ai-document-selection > a { min-height: 44px; padding-block: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
