:root {
  --bg: #f4f1ec;
  --card: #ffffff;
  --ink: #1f1d1a;
  --muted: #6d675f;
  --line: #e2ddd4;
  --accent: #b5651d;
  --accent-ink: #ffffff;
  --accent-soft: #f6e7d8;
  --good: #2f7a4b;
  --good-soft: #e3f1e8;
  --bad: #b3362b;
  --bad-soft: #f8e1de;
  --warn: #a8740a;
  --warn-soft: #fbefd2;
  --blue: #2c5d8a;
  --blue-soft: #e2ecf5;
  --radius: 12px;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h2 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }
h3 { font-size: 13px; margin: 0 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
h3.sec { margin: 22px 0 10px; }
h4 { margin: 14px 0 6px; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bad-text { color: var(--bad); }
.ok-text { color: var(--good); }
.warn-text { color: var(--warn); }
.import-out { margin-top: 14px; }
.approval .ap-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.approval .inline { margin-top: 10px; }
.import-out .tablewrap { margin-top: 10px; }
.hide { display: none !important; }
.loading { padding: 40px 16px; text-align: center; color: var(--muted); }

/* header + layout */
header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.logo { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.tag { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.who { display: flex; align-items: center; gap: 10px; }
.who .user { color: var(--ink); font-size: 14px; text-decoration: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100vh - 52px); }
.layout.site { grid-template-columns: minmax(0, 1fr); max-width: 620px; margin: 0 auto; padding-bottom: 90px; }
nav.side { border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 52px; align-self: start; height: calc(100vh - 52px); overflow-y: auto; }
nav.side a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14px; }
nav.side a:hover { background: #ebe6de; }
nav.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge { background: var(--bad); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; line-height: 18px; font-weight: 700; }
.main { padding: 18px 22px 40px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-bottom: 8px; }
.page-head .page-tools { margin-bottom: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters select { width: auto; min-width: 180px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.inline .qty-in { max-width: 160px; }

@media (max-width: 899px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  nav.side { position: sticky; top: 49px; z-index: 4; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); background: var(--bg); padding: 8px 10px; }
  nav.side a { white-space: nowrap; padding: 7px 11px; font-size: 13px; gap: 6px; }
  .main { padding: 14px 16px 40px; }
  .who .user { display: none; }
}

/* cards, kpis */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.flat { background: var(--bg); border: 0; padding: 10px 12px; }
.card.narrow { max-width: 440px; }
.card.error { border-color: var(--bad); }
.card.empty { color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-family: var(--mono); font-size: 19px; font-weight: 600; margin-top: 2px; }
.kpi .s { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpi.neg .v { color: var(--bad); }
.kpi.warn .v { color: var(--warn); }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-weight: 600; text-decoration: none; }
.check { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.check.ok { background: var(--good-soft); color: var(--good); }
.check.bad { background: var(--bad-soft); color: var(--bad); }
.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 899px) { .two { grid-template-columns: minmax(0, 1fr); } }

/* projects */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-bottom: 14px; }
.card.proj { color: var(--ink); text-decoration: none; margin: 0; display: block; }
.card.proj:hover { border-color: var(--accent); }
.proj .head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.proj .meta { font-size: 12px; color: var(--muted); }
.proj .lines { display: grid; grid-template-columns: 100px 1fr 44px; gap: 6px 8px; align-items: center; font-size: 12px; margin-top: 10px; }
.proj .lines .p { font-family: var(--mono); text-align: right; }
.proj .nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.proj .nums small { display: block; font-size: 11px; color: var(--muted); }
.proj .nums b { font-family: var(--mono); font-size: 13px; }
.neg { color: var(--bad); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bar.cost i { background: var(--ink); }
.bar.over i { background: var(--bad); }
.flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }

/* forms */
select, input, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; min-height: 40px; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input:disabled { background: var(--bg); color: var(--muted); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 14px; }
.form .field.wide { grid-column: 1 / -1; }
.form .field small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.field.check { display: flex; gap: 8px; align-items: center; color: var(--ink); margin: 14px 0 4px; font-size: 14px; cursor: pointer; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 10px; }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--accent); border-radius: 10px; padding: 11px 16px; cursor: pointer; background: var(--accent); color: var(--accent-ink); margin-top: 14px; text-decoration: none; display: inline-block; text-align: center; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.small { padding: 7px 12px; font-size: 13px; margin: 0; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost.danger { background: transparent; color: var(--bad); }
.section-actions { display: flex; gap: 8px; }
.icon-btn { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.qty-in { max-width: 130px; padding: 6px 8px; min-height: 34px; font-family: var(--mono); font-size: 13px; text-align: right; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-top: 12px; }

/* segmented tabs */
.seg { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
.seg button { font: inherit; font-size: 13px; padding: 8px 14px; border-radius: 99px; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--ink); white-space: nowrap; }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.card .tablewrap { border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
td.n, th.n { text-align: right; font-family: var(--mono); }
th { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: #faf8f5; position: sticky; top: 0; }
th.n { font-family: inherit; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fbf6f0; }
tr.sel td { background: var(--accent-soft); }
tr.over td { color: var(--bad); }
tfoot td, tr.total td { font-weight: 700; border-bottom: 0; background: #faf8f5; }
td.empty { color: var(--muted); text-align: center; padding: 20px; white-space: normal; }
table.compact td { white-space: normal; }
table.jv select { min-width: 170px; }
td a.on { font-weight: 700; }

/* pills */
.pill { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 99px; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.expense { background: var(--accent-soft); color: var(--accent); }
.pill.labour { background: var(--blue-soft); color: var(--blue); }
.pill.material { background: #ece6f3; color: #5b4386; }
.pill.work { background: var(--good-soft); color: var(--good); }

/* site entries */
.entries { display: grid; gap: 10px; }
.card.entry { margin: 0; padding: 12px 14px; }
.entry-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.entry-top .pill:last-child { margin-left: auto; }
.entry-body { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; font-size: 14px; }
.entry-text { flex: 1; min-width: 0; }
.entry-text .muted { font-size: 12px; margin-top: 2px; }
.entry-acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
img.full { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; }
.amt { font-family: var(--mono); font-size: 14px; white-space: nowrap; text-align: right; }

/* abstract (RA bill / bill totals) */
.abstract { font-size: 14px; }
.ab-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ab-row b { font-family: var(--mono); font-weight: 600; text-align: right; }
.ab-row.muted { color: var(--muted); }
.ab-row.strong { font-weight: 700; }
.ab-row.total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 10px; font-size: 16px; font-weight: 700; }

/* printable bill */
.bill-doc { position: relative; max-width: 900px; padding: 28px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.doc-head h2 { font-size: 20px; }
.doc-head h3 { color: var(--ink); font-size: 14px; }
.doc-head .r { text-align: right; }
.doc-head small { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
table.doc-table { margin: 10px 0 16px; }
table.doc-table td, table.doc-table th { white-space: normal; }
@media (max-width: 600px) { .bill-doc { padding: 16px; } table.doc-table td, table.doc-table th { padding: 6px 5px; font-size: 12px; } .doc-head .r { text-align: left; } }
.abstract-t { max-width: 520px; margin-left: auto !important; }
.abstract-t tr.strong td { font-weight: 700; }
.abstract-t tr.total td { border-top: 2px solid var(--ink); font-size: 15px; }
.abstract-t tr.muted td { color: var(--muted); }
.sign { display: flex; justify-content: space-between; margin-top: 48px; font-size: 13px; color: var(--muted); }
.stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); font-size: 64px; font-weight: 700; color: var(--bad); opacity: .2; pointer-events: none; }

/* modal + toast */
.modal-wrap { position: fixed; inset: 0; background: rgba(31, 29, 26, .45); z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; overflow-y: auto; }
.modal { background: var(--card); border-radius: 14px; width: 100%; max-width: 640px; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; }
.modal-head h3 { margin: 0; color: var(--ink); font-size: 16px; text-transform: none; letter-spacing: 0; }
.modal-body { padding: 4px 16px 10px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px 16px; flex-wrap: wrap; }
.modal-foot .btn { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
.toast.bad { background: var(--bad); }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card.login { width: 100%; max-width: 380px; padding: 26px; }
.card.login h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.02em; }
.card.login .btn { width: 100%; }

/* site engineer (phone) */
.site-head { margin: 4px 0 14px; display: grid; gap: 6px; }
.site-head select { font-weight: 600; }
.site-name { font-weight: 600; }
.back { text-decoration: none; font-size: 14px; }
.big-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big { display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--accent); min-height: 92px; }
.big b { font-size: 17px; }
.big small { color: var(--muted); font-size: 12px; }
.big.labour { border-left-color: var(--blue); }
.big.material { border-left-color: #5b4386; }
.big.work { border-left-color: var(--good); }
.labour-rows { display: grid; gap: 8px; margin: 10px 0; }
.lrow { display: grid; grid-template-columns: 1.3fr 1fr auto 34px; gap: 8px; align-items: center; }
.calc { font-size: 14px; background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.photo-row { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.photo { display: flex; align-items: center; gap: 10px; }
.photo img { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.site .btn:not(.small) { width: 100%; }
.stock { font-size: 13px; color: var(--muted); margin-top: 8px; }
.stock b { font-family: var(--mono); color: var(--ink); }
.list .item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.list .item:first-child { border-top: 0; }
.item .t { font-weight: 600; font-size: 14px; }
.item .s { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.list .bar { max-width: 220px; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--card); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
nav.tabs .in { max-width: 620px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
nav.tabs a { font-size: 12px; color: var(--muted); padding: 9px 2px; border-radius: 10px; text-align: center; text-decoration: none; }
nav.tabs a.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.site .main { padding: 14px 16px 30px; }
.site .kpis { grid-template-columns: 1fr 1fr; }
.site .kpi .v { font-size: 17px; }

@media print {
  header.top, nav.side, nav.tabs, .noprint, .toast, .seg, .filters, .page-tools { display: none !important; }
  body { background: #fff; }
  .layout { display: block; }
  .main { padding: 0; }
  .card { border: 0; padding: 0; }
  .bill-doc { max-width: none; }
  th { position: static; }
}

.rules ul { margin: 4px 0 0; padding-left: 18px; }
.rules li { margin: 2px 0; }

/* ---- charts ---- */
.chart-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.chart-title { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-head .chart-title { margin-bottom: 0; }
.chart-head select { width: auto; min-width: 160px; }
.chart-card .gauges { justify-content: space-around; }
.chart { width: 100%; height: auto; overflow: visible; display: block; }
.chart.radial { max-width: 380px; margin: 2px auto 0; }
.chart .bar { transition: opacity .12s; }
.chart .bar:hover { opacity: .8; }
.chart .r-guide { fill: none; stroke: var(--line); stroke-width: 1; }
.chart .r-lab { font-size: 10px; fill: var(--muted); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .x-lab, .chart .y-lab { font-size: 11px; fill: var(--muted); }
.chart .bar-tot { font-size: 11px; fill: var(--ink); font-family: var(--mono); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chart-legend .lg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; display: none; background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.4; padding: 6px 9px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 240px; }
.chart-tip b { color: #fff; }
.gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gauge { width: 130px; height: 130px; }
.gauge-track { fill: none; stroke: var(--line); stroke-width: 12; }
.gauge-val { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.gauge-num { font-size: 30px; font-weight: 700; fill: var(--ink); font-family: var(--mono); }
.gauge-sub { font-size: 11px; fill: var(--muted); }
.gauge-label { font-size: 13px; color: var(--muted); }
.gauges { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }

/* ---- reconciliation ---- */
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; white-space: nowrap; align-items: center; }
.row-actions .btn.small { padding: 5px 10px; }
.match-cell { max-width: 190px; }
.narr-cell { max-width: 200px; }
.narr-cell > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-cell > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap-cell { white-space: normal; min-width: 260px; max-width: 520px; line-height: 1.4; }
.filters input[type=month], .filters input[type=date], .filters select { width: auto; min-width: 150px; }
.row-actions.stack { flex-direction: column; align-items: stretch; gap: 4px; }

/* inventory count sheet */
.count-input { width: 6.5rem; }

/* period close checklist */
.check-row { padding: 10px 0; border-top: 1px solid var(--line, #e6e1d8); }
.check-row:first-of-type { border-top: 0; }
.check-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.check-items { margin: 6px 0 0 18px; padding: 0; font-size: 13px; }
.check-items li { margin: 2px 0; overflow-wrap: anywhere; }
.check-row textarea { width: 100%; margin-top: 6px; }

/* ---- analytics charts (viz.js) ----
   Categorical slots validated for colour-vision deficiency on the white card (adjacent ΔE ≥ 9), an ordinal
   blue ramp for ordered buckets, blue / red for profit / loss. Light slots below 3:1 always come with labels
   and a table view. */
:root {
  --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100; --viz-5: #e87ba4; --viz-6: #008300; --viz-7: #6250d6; --viz-8: #e34948;
  --viz-other: #a9a69d;
  --viz-seq-1: #86b6ef; --viz-seq-2: #3987e5; --viz-seq-3: #1c5cab; --viz-seq-4: #0d366b;
  --viz-pos: #2a78d6; --viz-neg: #e34948; --viz-plan: #86b6ef;
  --viz-grid: #ebe8e1; --viz-axis: #c3c2b7;
}
.viz-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; margin-bottom: 14px; }
.viz-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 14px; margin-bottom: 14px; }
.viz-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; min-width: 0; display: flex; flex-direction: column; break-inside: avoid; }
.viz-card.wide { grid-column: 1 / -1; }
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.viz-q { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.005em; }
.viz-basis { font-size: 12px; color: var(--muted); margin-top: 2px; }
.viz-tools { display: flex; gap: 6px; flex-shrink: 0; }
.viz-body { flex: 1; min-width: 0; }
.viz-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.viz-check { font-weight: 600; }
.viz-check.ok { color: var(--good); }
.viz-check.bad { color: var(--bad); }
.viz-empty { padding: 28px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.viz-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.viz-click { cursor: pointer; }
.viz-click:focus-visible, .viz-hit:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* legend */
.viz-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.viz-legend.inline { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
.viz-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 46px; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.viz-legend.inline li { display: inline-flex; padding: 0; font-size: 12px; color: var(--muted); }
.viz-legend li.viz-click:hover, .viz-legend li:focus-visible { background: var(--bg); }
.viz-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.viz-legend .ln { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.viz-legend .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.viz-legend.inline .lab { color: var(--muted); }
.viz-legend .val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.viz-legend .pct { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; font-size: 12px; }
/* donut */
.viz-donut-wrap { display: grid; grid-template-columns: minmax(130px, 170px) minmax(0, 1fr); gap: 14px; align-items: center; }
.viz-donut { width: 100%; height: auto; display: block; }
.viz-seg { stroke: var(--card); stroke-width: 2; transition: opacity .12s; }
.viz-donut:hover .viz-seg { opacity: .55; }
.viz-donut .viz-seg:hover, .viz-donut .viz-seg:focus { opacity: 1; outline: none; }
.viz-seg:focus { stroke: var(--ink); stroke-width: 2; }
.viz-centre-v { font-size: 17px; font-weight: 650; fill: var(--ink); }
.viz-centre-l { font-size: 11px; fill: var(--muted); }
/* horizontal and diverging bars */
.viz-hbars, .viz-div { display: flex; flex-direction: column; gap: 6px; }
.hrow { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr); gap: 10px; align-items: center; }
.hlab { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.hlab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hlab small { color: var(--muted); font-size: 11px; }
.hlab small.flag { color: var(--bad); font-weight: 600; }
.bars { display: flex; flex-direction: column; gap: 2px; }
.bar-line { display: flex; align-items: center; gap: 6px; min-height: 16px; border-radius: 4px; }
.bar-line:hover .bar, .bar-line:focus .bar { filter: brightness(1.12); }
.bar-line:focus { outline: none; }
.bar-line:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.bar { height: 12px; border-radius: 0 4px 4px 0; flex-shrink: 0; }
.bar-val { font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtrack { height: 22px; border-radius: 4px; padding: 0 60px; }
.dinner { position: relative; height: 100%; }
.dzero { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--viz-axis); }
.dbar { position: absolute; top: 5px; height: 12px; }
.dbar.pos { border-radius: 0 4px 4px 0; }
.dbar.neg { border-radius: 4px 0 0 4px; }
.dval { position: absolute; top: 3px; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 5px; color: var(--ink); }
.dtrack:hover .dbar, .dtrack:focus .dbar { filter: brightness(1.12); }
/* lines */
.viz-line .plot { width: 100%; min-height: 230px; }
.viz-svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-base { stroke: var(--viz-axis); stroke-width: 1; }
.viz-axis { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.viz-path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-dot { stroke: var(--card); stroke-width: 2; }
.viz-cross { stroke: var(--viz-axis); stroke-width: 1; }
/* tooltip */
.viz-tip { position: fixed; z-index: 60; pointer-events: none; display: none; background: #1f1d1a; color: #f4f1ec; font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 280px; }
.viz-tip .tt { font-weight: 600; margin-bottom: 3px; color: #fff; }
.viz-tip .tr { display: flex; align-items: center; gap: 7px; }
.viz-tip .tr i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.viz-tip .tr b { color: #fff; font-variant-numeric: tabular-nums; }
.viz-tip .tr span { color: #cfc9bf; }
/* analytics page */
.an-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; }
.an-filters label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); min-width: 0; }
.an-filters select, .an-filters input { min-width: 0; width: auto; max-width: 220px; font-size: 13px; padding: 6px 8px; }
.an-filters .an-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.an-filters.busy { opacity: .6; }
.an-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 12px; }
.an-chip { font-size: 12px; background: var(--accent-soft); color: var(--ink); border-radius: 99px; padding: 3px 10px; display: inline-flex; gap: 6px; align-items: center; }
.an-chip button { border: 0; background: none; cursor: pointer; font-size: 14px; line-height: 1; color: var(--muted); padding: 0; }
.kpis.an { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.viz-grid-3 .viz-donut-wrap { grid-template-columns: 1fr; }
.viz-grid-3 .viz-donut { max-width: 170px; margin: 0 auto; }
.kpi .delta { font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .delta.good { color: var(--good); }
.kpi .delta.bad { color: var(--bad); }
.kpi.click { cursor: pointer; }
.kpi.click:hover, .kpi.click:focus-visible { border-color: var(--ink); }
.an-sec { margin: 22px 0 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.an-sec h3 { margin: 0; }
.an-sec p { margin: 0; font-size: 12px; color: var(--muted); }
.recon-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 4px 18px; font-size: 13px; }
.recon-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.recon-list .ok { color: var(--good); font-weight: 700; }
.recon-list .bad { color: var(--bad); font-weight: 700; }
.recon-list .amt { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; text-align: right; }
.tax-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.tax-mini a, .tax-mini div { display: block; background: var(--bg); border-radius: 8px; padding: 8px 10px; text-decoration: none; color: var(--ink); font-size: 12px; }
.tax-mini b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.drill-head { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin-bottom: 10px; font-size: 13px; }
.drill-head b { font-size: 16px; font-variant-numeric: tabular-nums; }
.modal.wide-modal { width: min(1100px, 96vw); max-width: none; }
.print-head { display: none; }
/* statements */
.stmt { width: 100%; border-collapse: collapse; font-size: 14px; }
.stmt td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.stmt td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stmt tr.sec td { font-weight: 700; background: var(--bg); text-transform: uppercase; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.stmt tr.grp td { font-weight: 600; }
.stmt tr.acc td:first-child { padding-left: 26px; color: var(--muted); }
.stmt tr.acc a { color: inherit; }
.stmt tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); }
.stmt-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.rep-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

@media (max-width: 899px) {
  .an-filters { position: static; }
  .an-filters .an-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .viz-donut-wrap { grid-template-columns: 1fr; }
  .viz-donut { max-width: 190px; margin: 0 auto; }
  .hrow { grid-template-columns: 1fr; gap: 2px; }
  .an-filters label { flex: 1 1 45%; }
  .an-filters select, .an-filters input { max-width: none; width: 100%; }
  .viz-head { flex-wrap: wrap; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .layout { display: block; }
  .main { padding: 0; }
  .print-head { display: block; border-bottom: 2px solid #000; margin-bottom: 10px; padding-bottom: 6px; }
  .print-head h1 { font-size: 16px; margin: 0; }
  .print-head div { font-size: 11px; color: #333; }
  .an-filters, .an-chips, .viz-toggle, .rep-tools, .page-head .page-tools, .an-actions, .banner { display: none !important; }
  .viz-card, .kpi, .stmt tr, tr { break-inside: avoid; }
  .page-head h2 { display: none; }
  .check { break-after: avoid; }
  .viz-grid-2, .viz-grid-3 { display: block; }
  .viz-card { margin-bottom: 8px; border-color: #bbb; }
  .kpis.an { grid-template-columns: repeat(3, 1fr); }
  .tablewrap { overflow: visible; border: 0; }
  table { font-size: 10px; }
  a { color: inherit; text-decoration: none; }
  .viz-tip { display: none !important; }
}

.viz-single { display: flex; gap: 12px; align-items: center; padding: 18px 8px; border-radius: 8px; }
.viz-single .sw { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.viz-single b { display: block; font-size: 22px; font-weight: 650; }
.viz-single span { color: var(--muted); font-size: 13px; }
.viz-single.viz-click:hover { background: var(--bg); }
@media (max-width: 560px) { .viz-tools { flex-wrap: wrap; flex-shrink: 1; min-width: 0; } .viz-tools select { max-width: 100%; min-width: 0; } }
.kpis.an .kpi .v { font-family: inherit; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.seg.sub-seg { margin-top: -6px; }
.seg.sub-seg button { font-size: 12px; padding: 6px 12px; }
.seg.sub-seg button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); font-weight: 600; }
@media print { .card:has(> .form) { display: none !important; } .seg.sub-seg { display: none !important; } }

/* ---------------- GST summary ---------------- */
.src-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 1px 6px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; border: 1px solid transparent; white-space: nowrap; }
.src-books { background: var(--blue-soft); color: var(--blue); }
.src-payments { background: var(--good-soft); color: var(--good); }
.src-filed { background: var(--warn-soft); color: #7a5300; }
.src-portal { background: #ece8f7; color: #4b3a9e; }
.fs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.fs-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fs-books { border-top: 3px solid var(--blue); } .fs-payments { border-top: 3px solid var(--good); } .fs-filed { border-top: 3px solid #c08a10; } .fs-portal { border-top: 3px solid #6250d6; }
.fs-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 13px; flex-direction: row-reverse; justify-content: flex-end; }
.fs-head .src-tag { margin-left: auto; }
.fs-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; border-bottom: 1px dashed var(--line); }
.fs-row:last-child { border-bottom: 0; }
.fs-row span { color: var(--muted); }
.fs-row b, .fs-row a { font-variant-numeric: tabular-nums; text-align: right; }
.fs-note { font-size: 12px; }
dl.defs { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; font-size: 12px; margin: 8px 0 0; }
dl.defs dt { font-weight: 600; } dl.defs dd { margin: 0; color: var(--muted); }
.itc-claimed { font-size: 12px; margin-bottom: 4px; }
.itc-claimed .src-tag { margin-left: 0; }
table.gst-sum td.lbl { min-width: 240px; }
table.gst-sum tr.sec-row td { background: var(--bg); padding-top: 10px; }
table.gst-sum tr.strong td { font-weight: 700; }
table.gst-sum tr.ind1 td.lbl { padding-left: 22px; color: var(--muted); }
table.gst-sum th, table.gst-sum td.n { white-space: nowrap; }
table.head-grid input { width: 100px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.nowrap { white-space: nowrap; }
tr.bad-row td { background: var(--bad-soft); }
.recon-head .inline { flex-wrap: wrap; }
.gst-page .stack { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.gst-page .kpi .k { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
@media (max-width: 640px) {
  dl.defs { grid-template-columns: 1fr; }
  table.gst-sum td.lbl { min-width: 170px; }
}
@media print {
  .gst-page .an-filters, .gst-page .viz-toggle, .gst-page button { display: none !important; }
  .fs-box, .viz-card { break-inside: avoid; }
  table.gst-sum { font-size: 10px; }
  tr.bad-row td { background: none; }
}
.recon-head select { width: auto; max-width: 100%; }
.gst-page .wrap-cell { min-width: 160px; max-width: 320px; white-space: normal; }
.gst-page td[data-t="Date"], .modal td[data-t="Date"] { white-space: nowrap; }
table.head-grid th { text-align: left; }

/* ---------------- login security ---------------- */
.stack-form { display: flex; flex-direction: column; gap: 4px; }
.stack-form .btn { margin-top: 10px; align-self: flex-start; }
.card.login.gate { max-width: 460px; }
.card.login.gate .stack-form .btn { align-self: stretch; }
.pw-hint { margin: 2px 0 4px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; margin-bottom: 14px; }
.account-grid .card { margin-bottom: 0; }
.secret-key { font-family: var(--mono); font-size: 15px; letter-spacing: .06em; background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; word-break: break-all; user-select: all; }
.steps-list { padding-left: 18px; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
input.code-in { width: 130px; font-family: var(--mono); letter-spacing: .15em; }
.recovery-codes { columns: 2; font-family: var(--mono); font-size: 15px; padding-left: 18px; }
.inline.wrap { flex-wrap: wrap; }
.user-sec { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
ul.tight { margin: 4px 0 0 18px; padding: 0; font-weight: 500; }
.check-list { list-style: none; padding: 0; margin: 8px 0; font-size: 13px; }
.check-list li { padding: 3px 0; }
dl.defs.about { font-size: 13px; gap: 6px 16px; } dl.defs.about dd { color: var(--ink); overflow-wrap: anywhere; }
.qr-box { margin: 8px 0; line-height: 0; } .qr-box svg { border: 1px solid var(--line); border-radius: 6px; max-width: 100%; height: auto; }

/* Material received and equipment entries, RA bill types, old-data import (from the 22 Oct 2026 build) */
tr.head td { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding-top: 14px; }
td.wrap { white-space: normal; min-width: 240px; }
.pill.arrival { background: #e3eeee; color: #2e6b6b; }
.pill.equipment { background: #f1ebdd; color: #7a5a1e; }
.big.arrival { border-left-color: #2e6b6b; }
.big.equipment { border-left-color: #7a5a1e; }
.mode-note { font-size: 13px; color: var(--muted); margin: -6px 0 10px; }
.arrivals { display: grid; gap: 6px; margin-top: 8px; }
.arrivals label { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--ink); font-size: 13px; cursor: pointer; }
.import-totals { font-family: var(--mono); font-size: 13px; margin: 8px 0; }

/* ---- dashboard: KPI cards with trend, exceptions, detailed tables ---- */
.kpi.an-kpi { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kpi-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.kpi-tick { font-size: 11px; font-weight: 600; white-space: nowrap; }
.kpi-tick.ok { color: var(--good); }
.kpi-tick.bad { color: var(--bad); }
.viz-spark { width: 100%; height: 30px; display: block; margin: 6px 0 2px; }
.viz-spark-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.viz-spark-zero { stroke: var(--viz-axis); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.viz-col { transition: opacity .12s; }
g.viz-click:hover .viz-col, g.viz-click:focus .viz-col { opacity: .75; }
g.viz-click:focus { outline: none; }
g.viz-click:focus-visible rect:first-child { stroke: var(--ink); stroke-width: 1; }

.alerts-card { margin-bottom: 14px; }
.alerts-card.has-high { border-left: 4px solid var(--bad); }
.alert-list { list-style: none; margin: 0 0 6px; padding: 0; }
.alert-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto auto; gap: 6px 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-row .sev { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.alert-row .sev i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.alert-row.sev-high .sev { color: var(--bad); } .alert-row.sev-high .sev i { background: var(--bad); }
.alert-row.sev-medium .sev { color: var(--warn); } .alert-row.sev-medium .sev i { background: var(--warn); }
.alert-row.sev-info .sev { color: var(--muted); } .alert-row.sev-info .sev i { background: var(--viz-other); }
.alert-text b { font-weight: 600; font-size: 14px; }
.alert-amt { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .alert-row { grid-template-columns: minmax(0, 1fr) auto; }
  .alert-row .sev { grid-column: 1 / -1; }
  .alert-row .alert-text { grid-column: 1 / -1; }
}

table.data-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.data-table th.sortable:hover { color: var(--ink); }
table.data-table th[aria-sort="ascending"]::after { content: ' ▲'; font-size: 9px; }
table.data-table th[aria-sort="descending"]::after { content: ' ▼'; font-size: 9px; }
table.data-table td.n { white-space: nowrap; }
table.data-table tr.over td { background: var(--bad-soft); }
table.data-table tr.flag-row td.warn-num a { color: var(--bad); font-weight: 600; }
table.data-table tr.muted-row td { color: var(--muted); font-style: italic; }
table.data-table .flag-cell { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.drill-link { text-decoration: none; border-bottom: 1px dotted currentColor; color: inherit; }
.drill-link:hover, .drill-link:focus-visible { color: var(--blue); border-bottom-style: solid; }
.gauge-click { border-radius: 10px; padding: 4px; }
.gauge-click:hover { background: var(--bg); }
.gauge-click:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media print { .alerts-card .btn, .alert-act { display: none !important; } .alert-row { grid-template-columns: 70px minmax(0, 1fr) auto; } }
table.data-table td.neg-num, table.data-table td.neg-num a { color: var(--bad); }
.kpi.an-kpi .s { margin-top: 0; }
table.data-table td:first-child { white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.an-content > .viz-card.wide { margin-bottom: 14px; }
table.data-table th, table.data-table td { padding-left: 7px; padding-right: 7px; }
.rep-band { margin: 0 0 16px; }
.rep-band .kpis.an { margin-bottom: 10px; }
.rep-band .band-check { margin-bottom: 12px; }
.rep-band .viz-grid-3 .viz-donut-wrap { grid-template-columns: 1fr; }

.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
table.data-table tr.done-row td { color: var(--muted); }
.archived-note { max-width: 160px; }
.archive-preview p { margin: 8px 0; }
.open-list { margin: 6px 0 12px 18px; padding: 0; }
.open-list li { margin: 3px 0; }

/* ---- project manager screens ---- */
.pm-chart { width: 100%; overflow: hidden; margin-bottom: 10px; }
.pm-bars { width: 100%; height: auto; max-height: 220px; display: block; }
.pm-axis { font-size: 10px; fill: var(--muted); font-family: var(--mono); }
.pm-prog { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.pm-prog .bar { flex: 1; }
.pm-prog span { font-family: var(--mono); font-size: 12px; min-width: 44px; text-align: right; }
.pm-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pm-photos figure { margin: 0; }
.pm-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.pm-photos figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pm-flags { margin: 0 0 10px; padding-left: 18px; }
.pm-flags li { margin: 4px 0; }
.pm-history { margin: 8px 0 0; padding-left: 16px; font-size: 13px; color: var(--muted); }
.pm-history b { color: var(--ink); font-weight: 600; }
.pm-title { margin: 0 0 12px; }
tr.warn-row td { background: var(--warn-soft); }
@media print { .pm-report .two { grid-template-columns: 1fr; } .pm-photos { grid-template-columns: repeat(4, 1fr); } .entry-acts { display: none; } }
