/* Karam Bagh Utility Bills: one light theme. Tokens from KBU_MASTER C3 (kbu/ui/style.py). 10pt base = 13.5px. */
:root {
  --green: #228B22; --green-dark: #1a6b1a; --red: #C62828; --amber: #B26A00; --grey: #6b7280; --ink: #1f2937;
  --line: #d9dee5; --panel: #ffffff; --page: #f3f5f8;
  --aup: #1a6b1a; --aup-tint: #e6f4e6; --readings: #5b34a3; --readings-tint: #efe8fa;
  --ebills: #9a5b00; --ebills-tint: #fff1d6; --gbills: #0b5cad; --gbills-tint: #e3effb;
  --shared: #475569; --shared-tint: #eceff3;
  --pass-text: #1a6b1a; --pass-bg: #e6f4e6; --warn-text: #B26A00; --warn-bg: #fff4dd;
  --block-text: #C62828; --block-bg: #fde8e8; --info-text: #0b5cad; --info-bg: #e3effb;
  --skip-text: #6b7280; --skip-bg: #eef0f3;
  --button-border: #c3cad5; --button-hover: #f0f3f7; --disabled-text: #a0a7b3; --primary-disabled: #a9cfa9;
  --table-header: #eef1f5; --grid-line: #e8ebf0; --selection: #dcefdc; --link: #0b5cad;
  --drop-border: #b9c2cf; --drop-bg: #fafbfc; --drop-active-bg: #f0f9f0;
  --recovery-bg: #fff4dd; --recovery-border: #e0c080; --credit: #374151;
  --padlock-admin-text: #ffd54a; --padlock-admin-bg: #3a2a00;
  --shadow: 0 1px 2px rgba(31,41,55,.06), 0 2px 8px rgba(31,41,55,.06); --shadow-lg: 0 10px 30px rgba(31,41,55,.18);
  --focus: #0b5cad; --rail: 224px; --content: 1280px; --field: 420px; --prose: 72ch; --zebra: #fafbfc;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: 'Segoe UI', Arial, sans-serif; font-size: 13.5px; line-height: 1.45;
  display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 20px; font-weight: 600; margin: 0 0 8px; }               /* 15pt page title */
h2 { font-size: 14.7px; font-weight: 600; color: var(--green-dark); margin: 12px 0 6px; }  /* 11pt card title */
h3 { font-size: 13.5px; font-weight: 600; margin: 10px 0 4px; }
p { margin: 0 0 8px; max-width: var(--prose); } .card p:last-child, .msg p:last-child { margin-bottom: 0; }
small, .small { font-size: 10.7px; color: var(--grey); }                  /* 8pt second line */
.grey, .muted { color: var(--grey); } .red { color: var(--red); } .amber { color: var(--amber); } .green { color: var(--green-dark); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.big-figure { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; } .nowrap { white-space: nowrap; } .grow { flex: 1 1 auto; } .prose { max-width: var(--prose); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .row.top { align-items: flex-start; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.cols { display: flex; gap: 14px; align-items: flex-start; } .cols > .col { flex: 1 1 0; min-width: 0; } .cols > .col.narrow { flex: 0 0 38%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* icons: one sprite, one stroke weight, sized by the text around them */
.icon { width: 1.25em; height: 1.25em; flex: 0 0 auto; vertical-align: -0.22em; stroke: currentColor; fill: none; }
.icon.lg { width: 22px; height: 22px; } .icon.xl { width: 28px; height: 28px; } .icon.sm { width: 1em; height: 1em; }
.lockmark { color: var(--grey); margin-left: 4px; } button.primary .lockmark, .btn.primary .lockmark { color: #fff; }

/* ---- page shell: sticky top bar in the module colour, module rail, centred content */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 8px 14px; color: #fff; background: var(--shared);
  box-shadow: 0 1px 0 rgba(0,0,0,.12); min-height: 48px; }
.topbar .brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }
.topbar .brand img { width: 28px; height: 28px; border-radius: 6px; background: #fff; }
.topbar .title { font-size: 18.7px; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 8px; }     /* 14pt */
.topbar .crumbs { margin-left: auto; color: #fff; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.topbar .crumbs a { color: #fff; text-decoration: none; opacity: .92; } .topbar .crumbs a:hover { text-decoration: underline; opacity: 1; }
.topbar .crumbs a[aria-current] { font-weight: 600; opacity: 1; }
.topbar .navtoggle { display: none; }
.pagehead { } /* kept for older selectors */
.mod-aup { background: var(--aup); } .mod-readings { background: var(--readings); } .mod-ebills { background: var(--ebills); }
.mod-gbills { background: var(--gbills); } .mod-shared { background: var(--shared); }
.chip { display: inline-flex; align-items: center; gap: 8px; color: #fff; white-space: nowrap; text-decoration: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.45); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; text-transform: uppercase; }
.chip .who-name { font-weight: 600; } .chip .who-role { opacity: .85; font-size: 11.5px; display: block; line-height: 1.1; }
.topbar .home, .padlock { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 6px;
  padding: 5px 12px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.topbar .home:hover, .padlock:hover { background: rgba(255,255,255,.3); }
.padlock.admin { color: var(--padlock-admin-text); background: var(--padlock-admin-bg); border-color: var(--padlock-admin-bg); font-weight: 600; }
.shell { display: flex; flex: 1 1 auto; min-height: 0; }
.rail { flex: 0 0 var(--rail); background: var(--panel); border-right: 1px solid var(--line); padding: 10px 8px; position: sticky; top: 48px; align-self: flex-start;
  height: calc(100vh - 48px); overflow-y: auto; }
.rail .group { font-size: 10.7px; text-transform: uppercase; letter-spacing: .4px; color: var(--grey); padding: 10px 10px 4px; font-weight: 600; }
.rail a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
.rail a:hover { background: var(--button-hover); } .rail a[aria-current] { background: var(--shared-tint); font-weight: 600; border-left-color: var(--shared); }
.rail a.aup .icon { color: var(--aup); } .rail a.readings .icon { color: var(--readings); } .rail a.ebills .icon { color: var(--ebills); } .rail a.gbills .icon { color: var(--gbills); } .rail a.shared .icon { color: var(--shared); }
.rail a.aup[aria-current] { background: var(--aup-tint); border-left-color: var(--aup); } .rail a.readings[aria-current] { background: var(--readings-tint); border-left-color: var(--readings); }
.rail a.ebills[aria-current] { background: var(--ebills-tint); border-left-color: var(--ebills); } .rail a.gbills[aria-current] { background: var(--gbills-tint); border-left-color: var(--gbills); }
.content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pagebar { display: flex; align-items: center; gap: 8px; padding: 10px 20px 0; max-width: calc(var(--content) + 40px); width: 100%; margin: 0 auto; }
.readonly-banner { background: var(--block-bg); color: var(--red); text-align: center; padding: 6px 14px; font-weight: 600; }
main.body { flex: 1 1 auto; padding: 12px 20px 16px; min-width: 0; max-width: calc(var(--content) + 40px); width: 100%; margin: 0 auto; }
main.body.wide { max-width: none; }                                        /* many-column grids (payments) use the whole width */
main.body > * + * { margin-top: 12px; }
footer.pagefoot { display: flex; justify-content: flex-end; padding: 4px 20px 10px; max-width: calc(var(--content) + 40px); width: 100%; margin: 0 auto; }
.credit { font-weight: 700; color: var(--credit); }
body.has-dialog footer.pagefoot .credit, body.has-dialog .banner .credit { visibility: hidden; }

/* ---- welcome */
.banner { background: var(--green-dark); color: #fff; padding: 16px 24px 10px; position: relative; }
.banner .inner { max-width: var(--content); margin: 0 auto; position: relative; display: flex; gap: 14px; align-items: center; }
.banner .emblem { width: 56px; height: 56px; border-radius: 12px; background: #fff; flex: 0 0 56px; }
.banner .trust { font-size: 26.7px; font-weight: 700; line-height: 1.15; }                  /* 20pt */
.banner .system { font-size: 16px; }                                     /* 12pt */
.banner .tools { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.banner .credit { display: block; text-align: right; color: #fff; font-size: 14.7px; font-weight: 700; margin: 2px auto 0; max-width: var(--content); }
.welcome { padding: 14px 24px 24px; max-width: calc(var(--content) + 48px); width: 100%; margin: 0 auto; }
.lane-head { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; flex-wrap: wrap; }
.lane-heading { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }  /* 12pt */
.progress { display: inline-flex; align-items: center; gap: 8px; color: var(--grey); }
.progress .bar { display: inline-flex; gap: 3px; } .progress .bar i { width: 26px; height: 6px; border-radius: 3px; background: var(--line); display: block; }
.progress .bar i.on { background: var(--green); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
a.tile { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink);
  min-height: 92px; overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .12s, transform .12s; }
a.tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
a.tile .bar { flex: 0 0 8px; border-radius: 8px 0 0 8px; background: var(--shared); }
a.tile .text { padding: 10px 14px; min-width: 0; flex: 1 1 auto; } a.tile .ticon { padding: 12px 0 0 14px; }
a.tile .t { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
a.tile .s { font-size: 14.7px; font-weight: 600; margin-top: 3px; } a.tile .d { color: var(--grey); margin-top: 2px; }
a.tile.aup .bar { background: var(--aup); } a.tile.aup .t, a.tile.aup .ticon { color: var(--aup); } a.tile.aup:hover, a.tile.aup:focus { background: var(--aup-tint); }
a.tile.readings .bar { background: var(--readings); } a.tile.readings .t, a.tile.readings .ticon { color: var(--readings); } a.tile.readings:hover, a.tile.readings:focus { background: var(--readings-tint); }
a.tile.ebills .bar { background: var(--ebills); } a.tile.ebills .t, a.tile.ebills .ticon { color: var(--ebills); } a.tile.ebills:hover, a.tile.ebills:focus { background: var(--ebills-tint); }
a.tile.gbills .bar { background: var(--gbills); } a.tile.gbills .t, a.tile.gbills .ticon { color: var(--gbills); } a.tile.gbills:hover, a.tile.gbills:focus { background: var(--gbills-tint); }
a.tile.shared .bar { background: var(--shared); } a.tile.shared .t, a.tile.shared .ticon { color: var(--shared); } a.tile.shared:hover, a.tile.shared:focus { background: var(--shared-tint); }

/* ---- buttons: primary, secondary (outline), danger, icon, disabled, loading */
button, .btn { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--button-border); border-radius: 6px;
  padding: 5px 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; line-height: 1.35; }
button:hover, .btn:hover { background: var(--button-hover); }
button:disabled, .btn.disabled, .btn[aria-disabled=true] { color: var(--disabled-text); cursor: default; background: var(--panel); pointer-events: none; }
button.primary, .btn.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
button.primary:disabled, .btn.primary.disabled { background: var(--primary-disabled); border-color: var(--primary-disabled); color: #fff; }
button.secondary, .btn.secondary { background: transparent; }
button.danger, .btn.danger { color: var(--red); border-color: var(--red); background: var(--panel); } button.danger:hover, .btn.danger:hover { background: var(--block-bg); }
button.big, .btn.big { padding: 10px 18px; font-size: 16px; }
button.iconbtn, .btn.iconbtn { padding: 5px 7px; } button.link { border: none; background: none; color: var(--link); text-decoration: underline; padding: 0; }
.htmx-request.btn, button.htmx-request, .htmx-request button[type=submit] { opacity: .75; pointer-events: none; position: relative; }
button.htmx-request::after, .btn.htmx-request::after, .htmx-request button[type=submit]::after { content: ""; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: kbu-spin .7s linear infinite; }
@keyframes kbu-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- forms: label above field, help below, grouped in titled cards, sticky save bar */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], input[type=search], input[type=tel], input[type=time],
select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--button-border); border-radius: 5px; padding: 5px 8px; max-width: var(--field); }
input[type=number], input.short, select.short { max-width: 140px; } input.mid, select.mid { max-width: 240px; }
input:hover, select:hover, textarea:hover { border-color: var(--grey); }
input.error, textarea.error, select.error { border: 2px solid var(--red); }
textarea { width: 100%; max-width: 760px; }
label { display: inline-flex; align-items: center; gap: 6px; }
.field { display: grid; grid-template-columns: 260px 1fr; gap: 6px 12px; align-items: center; } .field > .help { grid-column: 2; }
.fgroup { display: flex; flex-direction: column; gap: 3px; margin: 0 0 12px; max-width: var(--field); }
.fgroup > label, .fgroup > .flabel { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fgroup > .help, .help { color: var(--grey); font-size: 11.5px; } .fgroup > .ferror, .ferror { color: var(--red); font-size: 11.5px; font-weight: 600; }
.fgroup input:not([type=checkbox]):not([type=radio]), .fgroup select, .fgroup textarea { width: 100%; }
.fgroup.inline { flex-direction: row; align-items: center; max-width: none; } .fgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 20px; }
.keytag { font-family: Consolas, monospace; font-size: 10.7px; color: var(--grey); background: var(--skip-bg); border-radius: 4px; padding: 0 5px; font-weight: 400; }
.resetlink { font-size: 11.5px; font-weight: 400; }
.savebar { position: sticky; bottom: 0; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 8px 8px 0 0; box-shadow: 0 -4px 12px rgba(31,41,55,.08);
  padding: 8px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: flex-end; gap: 10px 14px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); }
.toolbar .fgroup { margin: 0; max-width: 220px; }
.switch { display: inline-flex; border: 1px solid var(--button-border); border-radius: 6px; overflow: hidden; }
.switch a { padding: 5px 16px; text-decoration: none; color: var(--ink); background: var(--panel); display: inline-flex; gap: 6px; align-items: center; } .switch a.on { background: var(--ink); color: #fff; font-weight: 600; }

/* ---- cards, tables, badges */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; box-shadow: var(--shadow); }
.card > h2:first-child, .card > .card-title { margin-top: 0; display: flex; align-items: center; gap: 8px; } .card > .card-desc { color: var(--grey); margin: -2px 0 10px; max-width: var(--prose); }
.card.accent { border-left: 5px solid var(--line); } .card.pass { border-left: 5px solid var(--pass-text); background: var(--pass-bg); } .card.block { border-left: 5px solid var(--red); background: var(--block-bg); }
.card.skip { border-left: 5px solid var(--grey); background: var(--skip-bg); } .card.warn { border-left: 5px solid var(--amber); background: var(--warn-bg); } .card.info { border-left: 5px solid var(--info-text); background: var(--info-bg); }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: auto; max-height: 64vh; box-shadow: var(--shadow); }
.tablewrap.auto { display: inline-block; max-width: 100%; vertical-align: top; }     /* narrow tables do not stretch over a wide screen */
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th { background: var(--table-header); font-weight: 600; text-align: left; position: sticky; top: 0; z-index: 2; }
th, td { padding: 5px 8px; border-bottom: 1px solid var(--grid-line); border-right: 1px solid var(--grid-line); height: 28px; vertical-align: middle; }
th:last-child, td:last-child { border-right: none; } tbody tr:hover td { background: var(--button-hover); }
table.zebra tbody tr:nth-child(even) td { background: var(--zebra); } table.zebra tbody tr:hover td { background: var(--button-hover); }
table.readings td { height: 36px; } table.twoline td { height: 54px; } td small { display: block; }
table.select tbody tr { cursor: pointer; } table.select tbody tr:hover td, tr.selected td { background: var(--selection) !important; }
th.clickable { cursor: pointer; text-decoration: underline dotted; }
.stickycol th:first-child, .stickycol td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: 1px 0 0 var(--grid-line); } .stickycol th:first-child { z-index: 3; background: var(--table-header); }
tfoot td { font-weight: 600; background: var(--table-header); position: sticky; bottom: 0; }
.pill, .badge, td.status { display: inline-flex; align-items: center; gap: 4px; border-radius: 9px; padding: 1px 9px; font-weight: 600; white-space: nowrap; }
td.status { display: table-cell; border-radius: 0; }
.pass, .locked, .paid, .issued, .sent, .delivered, .read, .done { color: var(--pass-text); background: var(--pass-bg); }
.warn, .draft, .partial, .part-paid, .held, .queued { color: var(--warn-text); background: var(--warn-bg); }
.block, .unpaid, .failed { color: var(--block-text); background: var(--block-bg); }
.info, .verified { color: var(--info-text); background: var(--info-bg); }
.skip, .none, .withdrawn, .replaced, .cancelled { color: var(--skip-text); background: var(--skip-bg); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 5px 8px; border-radius: 6px; margin-bottom: 3px; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; }
.checklist li .mark { font-weight: 700; width: 18px; text-align: center; flex: 0 0 18px; } .checklist li .code { font-weight: 600; white-space: nowrap; }
.checklist li.selected { outline: 2px solid var(--focus); }

/* ---- stepper */
.steps { display: flex; gap: 0; align-items: center; flex-wrap: wrap; counter-reset: step; }
.steps .step { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 6px; border-radius: 11px; background: var(--skip-bg); color: var(--grey); text-decoration: none; position: relative; margin-right: 26px; }
.steps .step::after { content: ""; position: absolute; right: -22px; top: 50%; width: 18px; height: 2px; background: var(--line); } .steps .step:last-child { margin-right: 0; } .steps .step:last-child::after { display: none; }
.steps .step .n { width: 20px; height: 20px; border-radius: 50%; background: #fff; color: inherit; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11.5px; border: 1px solid currentColor; }
.steps .step.done { background: var(--pass-bg); color: var(--pass-text); } .steps .step.done::after { background: var(--green); }
.steps .step.current { background: var(--ink); color: #fff; font-weight: 600; } .steps .step.current .n { color: var(--ink); border-color: #fff; }
a.step:hover { filter: brightness(.96); }

/* ---- drop zone, crops, messages, empty states, countdown */
.dropzone { border: 2px dashed var(--drop-border); background: var(--drop-bg); border-radius: 8px; padding: 22px; text-align: center; color: var(--grey); cursor: pointer; }
.dropzone.big { padding: 34px 22px; } .dropzone.active, .dropzone:hover { border-color: var(--green); background: var(--drop-active-bg); color: var(--green-dark); }
.crop img { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; }
.recovery { background: var(--recovery-bg); border: 1px solid var(--recovery-border); border-radius: 6px; font-family: Consolas, monospace;
  font-size: 24px; font-weight: 700; padding: 10px 16px; display: inline-block; letter-spacing: 1px; }
.msg { border-radius: 6px; padding: 8px 12px; display: flex; gap: 8px; align-items: flex-start; } .msg.ok { background: var(--pass-bg); color: var(--pass-text); }
.msg.err { background: var(--block-bg); color: var(--red); } .msg.note { background: var(--warn-bg); color: var(--amber); } .msg.inf { background: var(--info-bg); color: var(--info-text); }
code { background: var(--skip-bg); border-radius: 4px; padding: 0 4px; font-family: Consolas, monospace; overflow-wrap: anywhere; }
.progress-pill { border-radius: 9px; padding: 2px 10px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.countdown { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 26px 16px; color: var(--grey); }
.empty svg.art { width: 120px; height: 84px; stroke: var(--drop-border); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } .empty .etitle { color: var(--ink); font-weight: 600; font-size: 14.7px; }
.menu { position: relative; display: inline-block; } .menu > summary { list-style: none; cursor: pointer; } .menu > summary::-webkit-details-marker { display: none; }
.menu[open] > .menu-items { position: absolute; right: 0; top: 100%; z-index: 15; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; min-width: 220px; display: flex; flex-direction: column; }
.menu-items > a, .menu-items > button { border: none; background: none; text-align: left; padding: 7px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; display: flex; gap: 8px; align-items: center; }
.menu-items > a:hover, .menu-items > button:hover { background: var(--button-hover); }

/* ---- dialogs: title, body, Cancel and primary action, credit in the footer */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--page); color: var(--ink); min-width: min(440px, 94vw); max-width: min(1100px, 94vw); max-height: 92vh; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(31,41,55,.4); }
dialog .dlg-title { font-weight: 600; font-size: 14.7px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; display: flex; align-items: center; gap: 8px; }
dialog .dlg-title .x { margin-left: auto; border: none; background: none; padding: 2px; color: var(--grey); }
dialog .dlg-body { padding: 14px 16px; overflow: auto; max-height: calc(92vh - 140px); } dialog .dlg-body > * + * { margin-top: 10px; }
dialog .dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 4px 16px 10px; flex-wrap: wrap; }
dialog .dlg-foot { border-top: 1px solid var(--line); padding: 6px 16px; text-align: right; }
.glyph { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: 0 0 34px; color: #fff; }
.glyph.info { background: var(--info-text); } .glyph.warn { background: var(--amber); } .glyph.error { background: var(--red); } .glyph.ask { background: var(--green); }

/* ---- centred card pages (sign-in, password) */
.centre { max-width: 720px; margin: 28px auto; width: 100%; } .centre.narrow { max-width: 440px; }
.centre .card { padding: 22px 26px; } .authcard { text-align: center; } .authcard .emblem { width: 72px; height: 72px; border-radius: 16px; margin: 0 auto 8px; display: block; }
.authcard form { text-align: left; } .authcard .fgroup { max-width: none; } .login-form .field { grid-template-columns: 160px 1fr; }

/* ---- responsive: 1920 and 1366 by the centred content; 1024 narrow rail; phone: menu, stacked tiles, tables scroll inside their card */
@media (max-width: 1100px) { :root { --rail: 60px; } .rail .group, .rail a span { display: none; } .rail a { justify-content: center; padding: 9px 0; } .topbar .brand span { display: none; } }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; } .topbar .navtoggle { display: inline-flex; } .topbar .crumbs { order: 9; flex: 1 1 100%; text-align: left; margin-left: 0; } .chip .who-text { display: none; }
  .shell { display: block; } .rail { display: none; position: fixed; top: 48px; left: 0; bottom: 0; width: 240px; height: auto; z-index: 40; box-shadow: var(--shadow-lg); }
  body.nav-open .rail { display: block; } body.nav-open .rail .group, body.nav-open .rail a span { display: initial; } body.nav-open .rail a { justify-content: flex-start; padding: 9px 10px; }
  .tiles { grid-template-columns: 1fr; } .cols { flex-direction: column; } .cols > .col.narrow { flex-basis: auto; } .field { grid-template-columns: 1fr; } .field > .help { grid-column: 1; }
  main.body, .pagebar, footer.pagefoot { padding-left: 12px; padding-right: 12px; } .banner .inner { flex-wrap: wrap; } .banner .trust { font-size: 20px; } dialog { min-width: 0; width: 96vw; }
}
@media print { .topbar, .rail, .pagebar, .savebar { display: none; } }
.avatar.big-avatar { width: 48px; height: 48px; font-size: 18px; background: var(--green-dark); border: none; }

/* ---- additions asked for by the module passes (NEEDS_UI.md) */
button:disabled.danger, button.danger:disabled, .btn.danger.disabled { color: var(--disabled-text); border-color: var(--button-border); background: var(--panel); }
.icon.spin { animation: kbu-spin 1s linear infinite; }
dialog .msg { max-width: calc(var(--prose) + 40px); }
.btngroup { display: inline-flex; flex-wrap: wrap; } .btngroup > * { border-radius: 0; margin-left: -1px; } .btngroup > *:first-child { border-radius: 6px 0 0 6px; margin-left: 0; } .btngroup > *:last-child { border-radius: 0 6px 6px 0; }
.cardfoot { border-top: 1px solid var(--line); margin: 10px -14px -12px; padding: 8px 14px; background: var(--zebra); border-radius: 0 0 8px 8px; color: var(--grey); }
table.zebra tbody tr td.status.pass, table tbody tr:hover td.status.pass, td.status.locked, td.status.paid { background: var(--pass-bg); }
table.zebra tbody tr td.status.warn, table tbody tr:hover td.status.warn, td.status.partial, td.status.draft { background: var(--warn-bg); }
table.zebra tbody tr td.status.block, table tbody tr:hover td.status.block, td.status.unpaid { background: var(--block-bg); }
table.zebra tbody tr td.status.info, table tbody tr:hover td.status.info { background: var(--info-bg); }
table.zebra tbody tr td.status.skip, table tbody tr:hover td.status.skip { background: var(--skip-bg); }
.dropzone .zone-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tilecell { display: flex; flex-direction: column; min-width: 0; }
.tilecell > a.tile { flex: 1 1 auto; }
a.tiletotal { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 4px; padding: 2px 8px; border-radius: 9px;
  font-size: 11.5px; font-weight: 600; text-decoration: none; color: var(--block-text); background: var(--block-bg); }
a.tiletotal:hover { text-decoration: underline; }
