:root {
  --ink: #192d2c; --muted: #6b8176; --soft: #8b9a90; --line: #e2e9e3; --line-soft: #edf1ed;
  --bg: #f5f7f6; --card: #fff; --brand: #196b58; --brand-soft: #e8f3ed; --brand-ink: #193f35;
  --warn-bg: #f8f5e9; --warn-line: #ece6cf; --warn-ink: #7c6a2b; --danger: #a23b2c; --danger-soft: #fbecea; --ok: #267958;
  font-family: "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
a { color: var(--brand); }
h1 { font-size: 30px; letter-spacing: -.8px; margin: 8px 0; }
h2 { font-size: 18px; letter-spacing: -.3px; margin: 4px 0 14px; }
h3 { font-size: 15px; margin: 22px 0 10px; }
p { font-size: 13px; color: var(--muted); line-height: 1.65; margin: 6px 0; }
small { display: block; font-size: 12px; color: var(--soft); margin-top: 3px; font-weight: 400; }
.boot { padding: 40px; }
button, .button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; border: 0; border-radius: 7px; padding: 10px 16px; background: var(--brand); color: #fff; font-weight: 600; font-size: 13px; text-decoration: none; display: inline-block; line-height: 1.3; }
button:hover, .button:hover { filter: brightness(.95); }
button:disabled { opacity: .55; cursor: wait; }
button.quiet, .button.quiet { background: #fff; color: #476a59; border: 1px solid #dfe7e0; }
button.danger { background: var(--danger); }
button.small, .button.small { padding: 6px 10px; font-size: 12px; }
button.link { background: none; color: var(--brand); padding: 0; font-weight: 500; text-decoration: underline; }
:focus-visible { outline: 3px solid #8acdbb; outline-offset: 2px; }
input, select, textarea { border: 1px solid #d5e0d8; border-radius: 6px; padding: 9px 10px; color: #304b3b; background: #fff; font-size: 13px; max-width: 100%; }
textarea { min-height: 80px; width: 100%; }
input[type="checkbox"], input[type="radio"] { width: auto; }
label { font-size: 12px; color: #5f7468; display: block; }
label > input:not([type="checkbox"]):not([type="radio"]), label > select, label > textarea { display: block; width: 100%; margin-top: 5px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; margin-right: 10px; }
.stack { display: grid; gap: 14px; }
[data-testid="tax-maturity"] fieldset { min-inline-size: 0; }
[data-testid="tax-maturity"] .stack > *, [data-testid="tax-maturity"] .form-grid > * { min-width: 0; }
[data-testid="tax-maturity"] .form-actions { flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 18px; align-items: end; margin: 10px 0; }
.form-grid .span2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-start; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.grant-form { display: grid; gap: 4px; min-width: 150px; }
.wide { width: 100%; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: #fff; border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { font-size: 29px; text-decoration: none; color: var(--brand); font-weight: 800; letter-spacing: -2px; display: flex; align-items: center; gap: 10px; margin: 0 6px 24px; }
.brand span { font-size: 17px; color: var(--brand-ink); letter-spacing: -.4px; font-weight: 650; }
nav { display: grid; gap: 3px; }
nav a { color: #5c7266; text-decoration: none; font-size: 13px; padding: 10px 12px; border-radius: 7px; }
nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
nav a:hover { background: #f2f6f3; }
.sidebar-footer { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--line-soft); display: grid; gap: 8px; font-size: 13px; }
.sidebar-footer a { text-decoration: none; color: var(--ink); }
.sidebar-footer button.link { justify-self: start; }
table.compact td, table.compact th { padding: 6px 8px; }
.nowrap { white-space: nowrap; }
.count { color: var(--soft); font-size: 13px; margin-left: 6px; font-weight: 400; }
ul.results { margin: 8px 0; padding-left: 18px; font-size: 13px; }
ul.results li.ok { color: var(--ok); }
ul.results li.warn { color: var(--danger); }
.question { border-top: 1px solid var(--line-soft); padding: 12px 0; }
nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
nav.tabs a { padding: 8px 12px; border-radius: 7px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: #476a59; font-size: 13px; }
nav.tabs a.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; border-color: #cfe5d8; }
p.meta { font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line-soft); padding-bottom: 8px; }
.warn-text { color: var(--danger); }
.assign-form { background: #f8faf8; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 8px; min-width: 320px; }
.chart-row .bar { display: block; margin: 2px 0; }
.question:first-child { border-top: 0; }
main { margin-left: 236px; min-height: 100vh; }
.context-bar { min-height: 76px; padding: 16px 36px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.context-company strong { display: block; font-size: 15px; }
.context-fy select { margin-top: 3px; font-weight: 600; }
.context-meta { font-size: 12px; color: var(--muted); }
.context-meta.warn { color: var(--warn-ink); }
.pill { margin-left: auto; background: #eff5ee; color: #568660; padding: 6px 10px; border-radius: 20px; font-size: 11px; }
.pill.warn { margin-left: 8px; background: #fbeae6; color: var(--danger); }
.eyebrow { font-size: 10px; letter-spacing: 1.3px; color: #7d9286; font-weight: 650; text-transform: uppercase; }
.page { max-width: 1420px; margin: 0 auto; padding: 30px 36px 80px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 0 0 20px; flex-wrap: wrap; }
.card, section.card { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 22px; margin-bottom: 20px; }
.narrow { max-width: 460px; margin: 40px auto; }
.grid.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }
.grid.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.metrics article { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 18px; }
.metrics article span { font-size: 12px; color: var(--muted); }
.metrics strong { display: block; font-size: 25px; letter-spacing: -.6px; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .9px; background: #f8faf8; }
td, th { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
td { font-size: 13px; }
tfoot td { font-weight: 650; border-top: 2px solid var(--line); }
tr.muted td { color: var(--soft); }
.table-wrap { overflow-x: auto; }
.number, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.empty { text-align: center; padding: 26px; color: var(--soft); }
.badge { background: #f0f3f1; color: #63766b; border-radius: 5px; font-size: 11px; padding: 4px 8px; white-space: nowrap; display: inline-block; }
.badge.received { background: #edf2fb; color: #4e6f9c; }
.badge.review { background: #f6f1e4; color: #8a6d24; }
.badge.question { background: #fbeee7; color: #a2502c; }
.badge.ready { background: #edf6ec; color: #4e7f4a; }
.badge.done, .badge.posted { background: #e5f2ec; color: var(--ok); }
.badge.locked, .badge.reversed { background: var(--danger-soft); color: var(--danger); }
.badge.draft { background: #edf2fb; color: #4e6f9c; }
.badge.blocked { background: #f3e9f7; color: #77408f; }
.note { background: #f3f6f1; padding: 14px; font-size: 13px; color: #55695c; border-radius: 8px; margin: 14px 0; line-height: 1.6; }
.note.warn, p.warn, .warn-box { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); padding: 10px 14px; border-radius: 7px; }
.ok { color: var(--ok); }
.hint { font-size: 12px; color: var(--soft); }
.error-panel { border: 1px solid #f0cfc9; background: #fff7f5; border-radius: 10px; padding: 24px; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; letter-spacing: .3px; }
.mono.small { font-size: 11px; }
pre { background: #f6f8f7; padding: 10px; border-radius: 6px; font-size: 11px; max-width: 520px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
dl.facts { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; font-size: 13px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.qr-holder { margin: 12px 0; }
img.qr { width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; }
.codes { columns: 2; font-size: 13px; }
details summary { cursor: pointer; font-size: 12px; color: var(--brand); }
.toast:not(:empty) { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); max-width: 680px; background: #244e3b; color: #fff; border-radius: 8px; padding: 14px 22px; box-shadow: 0 5px 30px #0003; z-index: 50; font-size: 13px; }
.toast.error:not(:empty) { background: #7d2a1f; }
.toast small { color: #f1e5e2; }
.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar label { min-width: 160px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.lines-table input, .lines-table select { width: 100%; min-width: 80px; padding: 7px; }
.lines-table td { padding: 6px 4px; }
.totals { display: flex; gap: 22px; justify-content: flex-end; font-size: 13px; padding: 10px 4px; font-variant-numeric: tabular-nums; }
.totals .diff { color: var(--danger); font-weight: 650; }
.doc-totals { max-width: 380px; margin: 8px 0 14px auto; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 650; border-top: 1px solid var(--line); }
.thread { display: grid; gap: 10px; margin: 10px 0; }
.thread .msg { background: #f6f8f7; border-radius: 8px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; }
.thread .msg.mine { background: var(--brand-soft); }
.preview-img { max-width: 100%; max-height: 520px; border: 1px solid var(--line); border-radius: 6px; }
.report-total { display: flex; justify-content: space-between; padding: 14px 16px; background: #edf4ee; margin-top: 12px; font-size: 14px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--brand); border-radius: 3px; min-width: 2px; }
.bar.neg { background: var(--danger); }
.chart-row { display: grid; grid-template-columns: 90px 1fr 120px; gap: 10px; align-items: center; font-size: 12px; margin: 4px 0; }
@media print {
  .sidebar, .context-bar .pill, button, .button, .toolbar, nav, form[data-form="filter"] { display: none !important; }
  main { margin: 0; } .page { padding: 0; } .card { border: 0; padding: 0; }
}
@media (max-width: 900px) {
  .sidebar { width: 190px; padding: 18px 10px; }
  main { margin-left: 190px; }
  .page, .context-bar { padding: 18px; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .sidebar { position: static; width: 100%; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin-bottom: 10px; }
  nav { display: flex; overflow-x: auto; gap: 4px; }
  nav a { white-space: nowrap; font-size: 12px; padding: 8px 10px; }
  .sidebar-footer { flex-direction: row; display: flex; justify-content: space-between; }
  main { margin: 0; }
  .context-bar { gap: 10px; padding: 12px; }
  .pill { margin-left: 0; }
  .page { padding: 16px 12px 60px; }
  h1 { font-size: 24px; }
  .grid.two { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  dl.facts { grid-template-columns: 1fr; }
  td, th { padding: 8px 6px; }
}
[hidden] { display: none !important; }
[data-testid="entry-copy"] fieldset { min-inline-size: 0; }
[data-testid="entry-copy"] .stack > *, [data-testid="entry-copy"] .form-grid > * { min-width: 0; }
[data-testid="entry-copy"] select { max-width: 100%; }
[data-testid="copy-origin"] a { overflow-wrap: anywhere; }
