:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5f6b7a;
  --border: #dde2e8;
  --brand: #1f3864;
  --brand-soft: #e8edf6;
  --in: #1b7f4b;
  --in-soft: #dff3e8;
  --out: #b4432b;
  --out-soft: #fbe6e1;
  --warn: #9a6200;
  --warn-soft: #fff4dc;
  --radius: 10px;
  /* chart colors: checked for colorblind separation and contrast on this surface */
  --series-income: #2a78d6;
  --series-costs: #eb6834;
  --acct-1: #1baf7a;
  --acct-2: #6250d6;
  --grid: #eceef2;
}
/* dark: follows the device unless a choice was made in the menu (data-theme on <html>, see theme.js) */
:root[data-theme="dark"] {
    --bg: #12161c; --surface: #1b2129; --text: #e6e9ee; --muted: #9aa5b3; --border: #2c3440;
    --brand: #8fb0ea; --brand-soft: #22304a; --in: #5fd197; --in-soft: #183527; --out: #f08f78; --out-soft: #3d221c;
    --warn: #f3c065; --warn-soft: #3a2f17;
    --series-income: #3987e5; --series-costs: #d95926; --acct-1: #199e70; --acct-2: #9085e9; --grid: #262d36;
  }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161c; --surface: #1b2129; --text: #e6e9ee; --muted: #9aa5b3; --border: #2c3440;
    --brand: #8fb0ea; --brand-soft: #22304a; --in: #5fd197; --in-soft: #183527; --out: #f08f78; --out-soft: #3d221c;
    --warn: #f3c065; --warn-soft: #3a2f17;
    --series-income: #3987e5; --series-costs: #d95926; --acct-1: #199e70; --acct-2: #9085e9; --grid: #262d36;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
td.num, .num, .kpis b, .kpi b { font-variant-numeric: tabular-nums; }
a { color: var(--brand); }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 16px; }
h2 { font-size: 15px; font-weight: 650; margin: 0 0 10px; }
code { font-size: 12px; background: var(--brand-soft); padding: 1px 4px; border-radius: 4px; }

.brand { font-weight: 700; font-size: 16px; color: var(--brand); padding: 12px 0; }
.brand span { font-weight: 400; color: var(--muted); }
.brand .mode-tag { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 5px;
  padding: 2px 7px; margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: .04em; }
/* ---- layout: sidebar, top bar, phone tab bar ---- */
:root { --side-w: 232px; --top-h: 58px; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 6px 12px 14px; z-index: 30; overflow-y: auto; }
.side .brand { padding: 10px 8px 14px; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  padding: 16px 10px 6px; }
.nav-spacer { flex: 1; min-height: 16px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-align: left; }
.nav-item:hover { background: var(--bg); border-color: transparent; }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item .badge { margin-left: auto; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 14px; height: 14px; }
.nav-item .ic { color: var(--muted); }
.nav-item.active .ic { color: var(--brand); }
.shell { margin-left: var(--side-w); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; }
.search > .ic { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search input[type=search] { width: 100%; padding: 8px 40px 8px 36px; border-radius: 9px; background: var(--surface); }
.search kbd { position: absolute; right: 9px; font: 12px/1 ui-monospace, Menlo, monospace; color: var(--muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; pointer-events: none; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 25, 40, .16); padding: 6px; max-height: 70vh; overflow-y: auto; z-index: 40; }
.sr-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 10px 4px; }
.sr-item { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; width: 100%; text-align: left; background: none;
  border: 0; border-radius: 7px; padding: 7px 10px; cursor: pointer; }
.sr-item.active, .sr-item:hover { background: var(--brand-soft); }
.sr-item .sr-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item .sr-side { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sr-empty { padding: 14px 10px; color: var(--muted); }
.menu-wrap { position: relative; }
.new-btn { display: flex; align-items: center; gap: 6px; padding: 7px 14px; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 190px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 25, 40, .16); padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.menu.right { left: auto; right: 0; }
.menu button { background: none; border: 0; border-radius: 7px; text-align: left; padding: 8px 10px; }
.menu button:hover, .menu button:focus-visible { background: var(--brand-soft); }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head span { color: var(--muted); font-size: 13px; }
#company-switch { border-bottom: 1px solid var(--border); margin-bottom: 6px; padding-bottom: 6px; display: flex; flex-direction: column; }
#company-switch[hidden] { display: none; }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 4px 10px; }
.menu-current { padding: 8px 10px; font-weight: 600; }
.menu a { color: var(--text); text-decoration: none; border-radius: 7px; padding: 8px 10px; }
.menu a:hover, .menu a:focus-visible { background: var(--brand-soft); }
.co-others { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.co-others summary { cursor: pointer; font-weight: 600; }
.co-other { margin-bottom: 6px; }
.topbar > .menu-wrap:last-child { margin-left: auto; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border-color: transparent; padding: 4px 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--surface); display: grid; place-items: center;
  font-weight: 700; font-size: 13px; }
.icon-btn { background: none; border-color: transparent; padding: 6px; display: grid; place-items: center; }
.tabbar, .only-phone, .scrim { display: none; }
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  .scrim:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(10, 15, 25, .35); z-index: 25; }
  .shell { margin-left: 0; }
  .topbar { padding: 0 12px; gap: 8px; }
  .only-phone { display: grid; }
  .only-wide { display: none; }
  .new-btn span { display: none; }
  .new-btn { padding: 7px 9px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface);
    border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .tabbar .nav-item { flex: 1; flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 2px; text-align: center; border-radius: 8px; }
  .tabbar .nav-item.active { background: none; }
  main { padding-bottom: 96px !important; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
.welcome { border-color: var(--brand); }
.login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 380px; padding: 0; }
.login-box .brand { text-align: center; margin-bottom: 12px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.login-box input { padding: 9px 10px; }
.msg.error { background: var(--out-soft); color: var(--out); margin: 0; }
.activity td { font-size: 12px; }
nav { display: flex; gap: 2px; flex-wrap: wrap; }
nav button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 14px 12px; font: inherit;
  color: var(--muted); cursor: pointer; }
nav button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.badge { background: var(--out); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; margin-left: 4px; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 24px 60px; }
@media (max-width: 900px) { main { padding: 18px 14px 60px; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }

button, select, input { font: inherit; color: var(--text); }
button { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 6px 12px; cursor: pointer; }
button:hover { border-color: var(--brand); }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button.primary { color: #10151c; } }
:root[data-theme="dark"] button.primary { color: #10151c; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
button.danger { color: var(--out); }
button.small { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
select, input[type=text], input[type=search], input[type=number], input[type=password], input[type=email], input[type=url], input:not([type]) {
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 10px 0 16px; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi.warn { border-color: var(--warn); background: var(--warn-soft); cursor: pointer; }
/* Overview: page subtitle, section headers, and the summary strip (revenue, expenses, net income, assets, liabilities) */
h1.with-sub { margin-bottom: 2px; }
#tab-overview > .row-between > .controls { margin-left: auto; }
.page-sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; }
.h-sub { font-weight: 450; color: var(--muted); font-size: 13px; margin-left: 6px; }
#ov-kpis { grid-template-columns: 1fr 1fr 1fr 1.15fr 1.15fr; gap: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; }
#ov-kpis .kpi { border: 0; border-left: 1px solid var(--border); border-radius: 0; background: none; padding: 16px 18px; }
#ov-kpis .kpi:first-child { border-left: 0; }
@media (max-width: 1100px) { #ov-kpis { grid-template-columns: repeat(3, 1fr); }
  #ov-kpis .kpi:nth-child(4), #ov-kpis .kpi:nth-child(5) { border-top: 1px solid var(--border); }
  #ov-kpis .kpi:nth-child(4) { border-left: 0; } }
@media (max-width: 600px) { #ov-kpis { grid-template-columns: 1fr 1fr; }
  #ov-kpis .kpi { border-top: 1px solid var(--border); } #ov-kpis .kpi:nth-child(-n+2) { border-top: 0; }
  #ov-kpis .kpi:nth-child(odd) { border-left: 0; } #ov-kpis .kpi:nth-child(4) { border-left: 1px solid var(--border); }
  #ov-kpis .kpi:last-child { grid-column: 1 / -1; border-left: 0; } }
.kpi-go { display: flex; flex-direction: column; justify-content: flex-start; width: 100%; text-align: left; font: inherit;
  color: inherit; cursor: pointer; position: relative; }
.kpi-go::after { content: "›"; position: absolute; top: 12px; right: 14px; color: var(--muted); font-size: 16px; opacity: 0; transition: opacity .15s; }
.kpi-go:hover { background: var(--bg) !important; }
.kpi-go:hover::after { opacity: 1; }
#ov-kpis .label { font-size: 11px; font-weight: 600; letter-spacing: .06em; }
#ov-kpis .label span { font-weight: 450; letter-spacing: 0; text-transform: none; margin-left: 4px; opacity: .8; }
#ov-kpis .value { font-size: 26px; font-weight: 650; letter-spacing: -.01em; margin: 6px 0 8px; }
.kpi-delta { font-size: 12px; font-weight: 600; }
.kpi-delta span { font-weight: 400; color: var(--muted); margin-left: 2px; }
.kpi-delta.up { color: var(--in); }
.kpi-delta.down { color: var(--out); }
.kpi-delta.flat { color: var(--muted); font-weight: 400; }
.kpi-note { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.kpi-note b { color: var(--text); }
.kpi-note.warn { color: var(--warn); margin: 6px 0 0; }
.kpi-rows { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 0; font-size: 12px; }
.kpi-rows dt { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kpi-rows dd.neg { color: var(--out); }

.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 170px; padding-top: 6px; }
.month { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bars { display: flex; gap: 2px; align-items: flex-end; height: 140px; width: 100%; justify-content: center; }
.bar { width: 42%; border-radius: 3px 3px 0 0; min-height: 1px; }
.bar.in { background: var(--in); } .bar.out { background: var(--out); }
.month span { font-size: 11px; color: var(--muted); margin-top: 4px; }
.legend { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.dot.in { background: var(--in); } .dot.out { background: var(--out); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--border); padding: 6px 8px; }
td { border-bottom: 1px solid var(--border); padding: 7px 8px; vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--border); }
tr.section td { font-weight: 700; padding-top: 14px; color: var(--brand); border-bottom: 0; }
.in-amt { color: var(--in); } .out-amt { color: var(--text); }
.desc { color: var(--muted); font-size: 12px; word-break: break-word; }
.nowrap { white-space: nowrap; }
#wk-list td:first-child { min-width: 170px; }
#wk-list input.notes { width: 100%; min-width: 140px; }
.tag { display: inline-block; font-size: 11px; border-radius: 5px; padding: 1px 6px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--out-soft); color: var(--out); }
.tag.good { background: var(--in-soft); color: var(--in); }
.table-wrap { overflow-x: auto; }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px dashed var(--border);
  border-radius: var(--radius); padding: 34px 16px; cursor: pointer; color: var(--muted); text-align: center; }
.drop strong { color: var(--text); font-size: 15px; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.file-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.file-row .name { flex: 1; min-width: 160px; word-break: break-all; }
.steps { padding-left: 18px; margin: 0 0 8px; } .steps li { margin-bottom: 4px; }
.result { border-radius: 8px; padding: 10px 12px; margin-top: 10px; background: var(--in-soft); }
.result.error { background: var(--out-soft); color: var(--out); }

.rv { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
  display: grid; grid-template-columns: 22px 92px 1fr 120px; gap: 4px 12px; align-items: start; }
.rv.done { opacity: .45; }
.rv .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rv .why { font-size: 12px; color: var(--warn); margin-top: 3px; }
.rv .editor { grid-column: 3 / 5; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.rv .editor select.cat-select { max-width: 260px; }
.editor input.worker, .editor input.customer { width: 170px; }
.editor { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.rv .remember { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rv .remember input[type=text] { width: 160px; font-size: 12px; padding: 4px 6px; }
@media (max-width: 700px) {
  .rv { grid-template-columns: 22px 1fr auto; }
  .rv .meta { grid-column: 2 / 4; }
  .rv .editor { grid-column: 1 / 4; }
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filters input[type=search] { flex: 1; min-width: 200px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; color: var(--muted); }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--brand-soft); }
tr.editing td { background: var(--brand-soft); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.msg { padding: 10px 12px; border-radius: 8px; background: var(--brand-soft); margin-bottom: 10px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface);
  padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: 90vw; }

/* ---- logo ---- */
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.login-box .brand { justify-content: center; flex-direction: column; font-size: 18px; }
.login-box .brand img { width: 96px; height: 96px; }

/* ---- charts ---- */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .charts { grid-template-columns: 1fr; } }
.chart { min-height: 120px; }
.chart svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--grid); stroke-width: 1; }
.viz-axis { stroke: var(--border); stroke-width: 1; }
.viz-tick { fill: var(--muted); font-size: 11px; }
.viz-sub { fill: var(--text); font-size: 11px; font-weight: 600; }
.viz-end { fill: var(--text); font-size: 12px; font-weight: 600; }
.viz-end-value { fill: var(--muted); font-size: 11px; }
.viz-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.viz-hit { cursor: default; }
.viz-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.viz-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.viz-tip { position: fixed; z-index: 30; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.15); min-width: 150px; }
.tip-title { font-weight: 700; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 58px; gap: 10px; align-items: center; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.hbar.clickable { cursor: pointer; }
.hbar.clickable:hover { background: var(--brand-soft); }
.hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 14px; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hbar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---- worker detail ---- */
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; min-width: 120px; }
.stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.linklike { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; font-weight: 700; text-align: left; }
.linklike:hover { text-decoration: underline; }
.assign-row input { width: 180px; }

/* ---- transactions overview ---- */
.tx-overview .kpis { margin: 8px 0 12px; }
.tx-overview .kpi .value { font-size: 20px; }
.tx-ov-table td, .tx-ov-table th { padding: 5px 8px; }
.date-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.date-filter input { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; font: inherit; color-scheme: light dark; }

/* ---- year-end and form details ---- */
.warn-msg { background: var(--warn-soft); color: var(--text); border-left: 3px solid var(--warn); }
#ye-body h2 { margin-top: 18px; }
.form-details { display: grid; grid-template-columns: 1.2fr 2fr 0.6fr; gap: 10px; margin: 6px 0 2px; }
@media (max-width: 760px) { .form-details { grid-template-columns: 1fr; } }
.form-details label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.wk-filters { position: sticky; top: 52px; z-index: 4; background: var(--bg); padding: 8px 0; margin: 0 0 8px; align-items: center; }
.wk-filters input[type=search] { max-width: 420px; }
.muted-heading { opacity: .45; }

/* ---- meals by place ---- */
.charts .wide { grid-column: 1 / -1; }
.meals-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .meals-split { grid-template-columns: 1fr; } }
.meal-kind { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.meal-kind:last-child { border-bottom: 0; }
.meal-kind .desc { margin-left: 6px; }
.meal-kind div.desc { margin: 2px 0 0; }
.tx-ov-table + .tx-ov-table { margin-top: 12px; }

/* ---- bank balances ---- */
.bank-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.bank-tile { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.bank-tile .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bank-tile .value { font-size: 24px; font-weight: 700; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.bank-tile .value.neg { color: var(--out); }
.bank-tile.total { border-color: var(--brand); }

/* ---- invoices and estimates ---- */
textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 8px; width: 100%; resize: vertical; min-width: 0; }
input[type=date] { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px;
  font: inherit; color-scheme: light dark; }
.tag.muted { background: var(--bg); color: var(--muted); }
.doc-table td { vertical-align: middle; }
.editor-head { margin-bottom: 12px; }
.editor-head h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; margin-bottom: 12px; align-items: end; }
.doc-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 760px) { .doc-grid, .doc-grid.two { grid-template-columns: 1fr; } }
.doc-grid label, label.block { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.doc-grid label input:not([type=checkbox]), .doc-grid label select { width: 100%; }
.doc-grid label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); padding-bottom: 6px; }
label.block { margin-top: 10px; }
.lines td { padding: 4px; vertical-align: top; }
.lines input { width: 100%; }
.lines td.l-amt { padding-top: 10px; }
.lines tr.bad-line input { border-color: var(--out); background: var(--out-soft); }
.doc-total { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-total span { margin-left: 10px; }
.doc-actions { position: sticky; bottom: 0; background: var(--surface); display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  border-top: 1px solid var(--border); margin: 14px -16px 0; padding: 12px 16px; }
.doc-actions .spacer { flex: 1; }
.pdf-info { margin: 12px 0 0; }
.pdf-info code { word-break: break-all; }
.pay-form input, .pay-form select { min-width: 0; }
@media (max-width: 700px) { .pay-form > * { width: 100%; max-width: none !important; } }
@media (max-width: 700px) {
  .lines tr.lines-head { display: none; }
  .lines .line-rows tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 6px 0;
    border-bottom: 1px solid var(--border); align-items: center; }
  .lines td { border: 0; padding: 2px; }
  .lines td:first-child { grid-column: 1 / -1; }
  .lines td.l-amt { padding-top: 2px; }
}
/* estimate and invoice editor: sections on the left, live preview on the right (wide screens) */
main:has(.doc-editor.with-preview:not([hidden])) { max-width: 1760px; }
.editor-split { display: block; }
.editor-preview { display: none; }
.doc-editor.with-preview .editor-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 42%); gap: 16px; align-items: start; }
.doc-editor.with-preview .editor-preview { display: flex; flex-direction: column; position: sticky; top: calc(var(--top-h) + 12px); height: calc(100vh - var(--top-h) - 28px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.pv-frames { flex: 1; position: relative; background: #e9e9ea; }
.pv-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pv-frame.loading { visibility: hidden; }
/* beside the preview there's less room: each line gets the full width for its description, the numbers under it */
.doc-editor.with-preview .lines tr.lines-head { display: none; }
.doc-editor.with-preview .lines .line-rows tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(90px, auto) auto auto; gap: 4px;
  padding: 6px 0; border-bottom: 1px solid var(--border); align-items: center; }
.doc-editor.with-preview .lines td { border: 0; padding: 2px; }
.doc-editor.with-preview .lines td:first-child { grid-column: 1 / -1; }
.doc-editor.with-preview .lines td.l-amt { padding-top: 2px; }
.stacked-only { display: none; }
.l-ref-wrap { display: inline-flex; align-items: center; gap: 2px; }
.doc-editor.with-preview .stacked-only { display: inline; font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 700px) { .stacked-only { display: inline; font-size: 12px; color: var(--muted); white-space: nowrap; } }
.sec-h { margin: 0 0 12px; }
.lines td.nowrap { white-space: nowrap; }
.price-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(80vh, 760px); border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); padding: 16px; }
.price-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.price-dialog .pl-q { width: 100%; margin: 12px 0 8px; }
.pl-rows { display: flex; flex-direction: column; gap: 4px; }
.pl-row { display: flex; gap: 6px; align-items: center; }
.pl-pick { flex: 1; display: flex; justify-content: space-between; gap: 12px; text-align: left; min-width: 0; font-weight: 400; }
.pl-pick > span { min-width: 0; }
.pl-pick b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-sub { font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.pl-new { margin-top: 12px; }
.pl-new summary { cursor: pointer; font-weight: 600; }
.pl-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: start; margin-top: 8px; flex: 1; }
.pl-form textarea { flex: 1 1 100%; }
.neg { color: var(--out); }
.job-kpis .kpi .desc { margin-top: 4px; }
.j-docs-panel, .j-cost-panel { border-top: 1px solid var(--border); margin: 12px 0; padding-top: 12px; }
.j-cost-panel .scroll-box, .j-docs-panel .scroll-box { max-height: 420px; }
.job-costs input.c-amt { width: 100px; text-align: right; }
.job-costs select.c-kind { max-width: 170px; }
.reminder-panel { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.reminder-panel label.check, #rem-form label.check { display: flex; gap: 6px; align-items: center; font-size: 13px; margin-top: 6px; }
.owed-table td:first-child { min-width: 190px; }
.owed-table tr.owed-total td { font-weight: 600; border-top: 2px solid var(--border); }
.email-panel { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.email-panel label.check { display: flex; gap: 6px; align-items: center; font-size: 13px; margin-top: 6px; }
.em-sugg button { margin: 2px 4px 2px 0; }

/* company details and email setup */
.brand #brand-name { font-weight: 700; color: var(--brand); }
.brand img.custom { border-radius: 6px; object-fit: contain; width: auto; max-width: 120px; background: #fff; padding: 2px 4px; }
.login-box .brand img.custom { width: auto; max-width: 220px; height: 96px; padding: 6px 10px; border-radius: 10px; }
.logo-row { display: flex; gap: 14px; align-items: center; margin: 4px 0 14px; }
.logo-preview { width: 150px; height: 84px; border: 1px solid var(--border); border-radius: 8px; display: flex;
  align-items: center; justify-content: center; background: #fff; flex: none; }
.logo-preview img { max-width: 130px; max-height: 70px; object-fit: contain; }
.button-like { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
  background: var(--surface); }
.button-like:hover { border-color: var(--brand); }
.setup-steps { margin: 8px 0 12px; padding-left: 20px; }
.setup-steps li { margin: 4px 0; }
.setup-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .logo-row { flex-direction: column; align-items: flex-start; } }

/* getting-started list on Overview */
.getting-started { border-color: var(--brand); }
.getting-started .hint { margin: 2px 0 0; }
.progress { height: 6px; background: var(--brand-soft); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s ease; }
.setup-list { list-style: none; margin: 0; padding: 0; }
.setup-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--border); }
.setup-list li:last-child { border-bottom: 0; }
.setup-list .tick { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--muted); }
.setup-list li.done .tick { background: var(--in); border-color: var(--in); color: var(--surface); }
.setup-list li.done b { color: var(--muted); font-weight: 500; }

/* Settings: section links, and long lists that scroll in their own box */
.jump { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 16px; }
.jump a { padding: 5px 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface);
  color: var(--text); text-decoration: none; font-size: 13px; }
.jump a:hover { border-color: var(--brand); color: var(--brand); }
#tab-settings .card { scroll-margin-top: calc(var(--top-h) + 12px); }
.scroll-box { max-height: 380px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.scroll-box table { margin: 0; }
.scroll-box thead th, .scroll-box table tr:first-child th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.scroll-box > .hint { margin: 12px; }
.list-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.list-tools input { flex: 1; }
.list-tools .hint { margin: 0; white-space: nowrap; }
/* Settings: two columns that stack on their own, so a long card on one side doesn't push the other down */
.settings-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings-col { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 860px) { .settings-cols { grid-template-columns: 1fr; } }

/* sign-in page links */
.small-link { font-size: 13px; color: var(--muted); text-align: center; }

/* view-only sign-in: hide what would change the books (the server refuses those anyway) */
.read-only #new-btn, .read-only .doc-actions .save, .read-only .doc-actions [data-status], .read-only .doc-actions .convert,
.read-only .doc-actions .copy, .read-only .doc-actions .delete, .read-only .doc-actions .email, .read-only .doc-actions .make-job,
.read-only .doc-actions .save-pdf, .read-only #inv-new, .read-only #inv-new-co, .read-only #est-new, .read-only #cl-new, .read-only #job-new,
.read-only .remind, .read-only .rec, .read-only .skip, .read-only .pay-form, .read-only .pay-del, .read-only .add-line, .read-only .pick-price,
.read-only .l-del, .read-only .l-keep, .read-only #inv-matches, .read-only #job-suggest, .read-only .j-edit, .read-only .j-status,
.read-only .j-del, .read-only .j-add-docs, .read-only .j-add-bank, .read-only .j-add-hand, .read-only .j-unlink, .read-only .c-del,
.read-only #tab-import .card, .read-only .rv .editor, .read-only .co-edit-only, .read-only #setup-card { display: none !important; }

/* sortable list headings */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--brand); }
th.sorted { color: var(--text); }

/* receipt photos on a transaction */
.receipt-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.receipt { position: relative; display: inline-flex; }
.receipt img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.receipt-file { width: 84px; height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; font-weight: 700; text-align: center; font-size: 13px; text-decoration: none; color: var(--text); }
.receipt .r-del { position: absolute; top: -8px; right: -8px; padding: 0 6px; border-radius: 50%; }
.r-add.busy { opacity: .6; pointer-events: none; }
.read-only .r-add, .read-only .r-del, .read-only .client-link, .read-only .rx-act { display: none !important; }
/* receipts to match (synced from a phone) */
.rx { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.rx:first-child { border-top: 0; }
.rx-pic img, .rx-pic .receipt-file { width: 96px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.rx-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rx-opts, .rx-found { display: flex; flex-direction: column; gap: 4px; }
.rx-opt { display: grid; grid-template-columns: 7.5em 1fr auto; gap: 10px; align-items: center; text-align: left; width: 100%; }
.rx-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-find { max-width: 360px; }
@media (max-width: 600px) {
  .rx { gap: 10px; }
  .rx-pic img, .rx-pic .receipt-file { width: 64px; height: 84px; }
  .rx-opt { grid-template-columns: 1fr auto; }
  .rx-opt > span:first-child { grid-column: 1 / -1; font-size: 12px; }
  .rx-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
}
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
#people-list .desc { word-break: break-all; }

/* ticking several rows */
th.pick, td.pick { width: 28px; padding-right: 0; }
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; margin: 6px 0 10px;
  background: var(--brand-soft); border-radius: 8px; }
.read-only .pick, .read-only .bulk-bar { display: none !important; }

/* Ideas to spend less, under "Where the money went" */
.tips { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.tips summary { font-weight: 600; font-size: 14px; cursor: pointer; }
.tips[open] summary { margin-bottom: 8px; }
.tips h3 { font-size: 14px; margin: 0 0 6px; }
.tips ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.tips li div { color: var(--text); margin-top: 2px; }
.tips .hint { margin: 10px 0 0; }

/* Rules & Settings → Health */
.health-list { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.health-list .h-mark { display: inline-block; width: 18px; font-weight: 700; }
.health-list .h-ok .h-mark { color: var(--in, #1e7b45); }
.health-list .h-warn .h-mark { color: #b7791f; }
.health-list .h-bad .h-mark, .health-list .h-bad b { color: var(--out); }

/* Cash flow forecast (Overview) */
.fc-options label.check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.msg.bad-msg { border-left-color: var(--out); }
.fc-details { margin-top: 8px; }
.fc-details summary { cursor: pointer; font-size: 13px; color: var(--muted); }

/* bank balance check on the Overview's bank tiles */
.bal-check { margin-top: 6px; }
.bal-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 12px; }
.bal-form label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.bal-form .msg, .bal-form ul { margin: 6px 0 0; font-size: 12px; }
.bal-form ul { padding-left: 16px; }

/* Taxes to set aside (Overview) */
.tax-rate { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.tax-rate input { width: 56px; text-align: right; }
#tax-table input.tax-paid { width: 100px; text-align: right; }
tr.tax-current td { background: var(--brand-soft); }
.read-only .tax-paid, .read-only #tax-rate { pointer-events: none; }

/* two-step sign-in */
.two-step { margin: 12px 0; }
.two-step h2 { font-size: 15px; margin: 0 0 4px; }
.ts-qr svg { display: block; margin: 8px 0; border-radius: 6px; width: 180px; height: 180px; }
.ts-codes { background: var(--bg); padding: 10px; border-radius: 8px; font-size: 15px; line-height: 1.6; }

/* job photos and documents */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.job-file { position: relative; margin: 0; }
.job-file img, .job-file .file-tile { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text); text-decoration: none; }
.job-file .file-tile { background: var(--bg); }
.job-file figcaption { font-size: 12px; margin-top: 4px; word-break: break-word; }
.job-file .jf-del { position: absolute; top: -8px; right: -8px; padding: 0 6px; border-radius: 50%; }
.read-only .jf-add, .read-only .jf-del { display: none !important; }

/* time clock (Workers page) */
#tc-card > summary { cursor: pointer; list-style: none; }
#tc-card > summary::-webkit-details-marker { display: none; }
#tc-card > summary h2::before { content: "▸ "; color: var(--muted); }
#tc-card[open] > summary h2::before { content: "▾ "; }
.tc-more { margin-top: 10px; }
.tc-more summary { cursor: pointer; font-size: 13px; color: var(--muted); }
#tc-links input.tc-rate { width: 90px; text-align: right; }
.read-only .tc-more, .read-only .tc-fix, .read-only .tc-del { display: none !important; }

/* Appearance switch in the user menu */
.menu-theme { padding: 4px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-theme .menu-label { padding: 0 0 4px; display: block; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.menu .seg button { flex: 1; border-radius: 0; padding: 5px 6px; font-size: 12px; text-align: center; border-right: 1px solid var(--border); }
.menu .seg button:last-child { border-right: 0; }
.menu .seg button.on { background: var(--brand-soft); font-weight: 600; }

/* Add transaction */
.at-dir { max-width: 280px; }
.at-dir button { flex: 1; border: 0; border-radius: 0; border-right: 1px solid var(--border); background: var(--surface); padding: 7px; }
.at-dir button:last-child { border-right: 0; }
.at-dir button.on { background: var(--brand-soft); font-weight: 600; }
.doc-grid .span2 { grid-column: 1 / -1; }
.read-only .add-tx { display: none !important; }

/* Needs your attention (Overview) */
#att-list { display: flex; flex-direction: column; }
.att-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0;
  border-top: 1px solid var(--border); border-radius: 0; padding: 10px 4px; }
.att-item:first-child { border-top: 0; }
.att-item:hover { background: var(--bg); }
.att-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand); flex: none; }
.att-bad .att-ic { background: var(--out-soft); color: var(--out); }
.att-warn .att-ic { background: var(--warn-soft); color: var(--warn); }
.att-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.att-go { color: var(--muted); font-size: 20px; }

/* Job performance (Overview) */
.jp-bar { height: 4px; border-radius: 2px; background: var(--in-soft); margin-top: 4px; max-width: 220px; overflow: hidden; }
.jp-bar span { display: block; height: 100%; background: var(--out); }

/* Reports */
.rp-head { margin-bottom: 10px; }
.rp-head h2 { margin: 0; }
.rp-table tr.section td { font-weight: 700; padding-top: 14px; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .03em; }
.rp-table tr.total td { font-weight: 600; border-top: 1px solid var(--border); }
.rp-table tr.grand td { font-weight: 700; border-top: 2px solid var(--text); }
.rp-table h3, #rp-out h3 { font-size: 14px; margin: 18px 0 4px; }
@media print {
  .side, .topbar, .tabbar, .no-print, #toast, .bulk-bar { display: none !important; }
  .shell { margin: 0 !important; }
  main { max-width: none; padding: 0; }
  body { background: #fff; color: #000; }
  .card { border: 0; padding: 0; }
  .table-wrap { overflow: visible; }
}

/* Require two-step sign-in for admins */
.people-require { margin: 10px 0 4px; }
.people-require label.check { display: flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; }
.people-require .desc { display: block; margin: 2px 0 0 22px; }
.two-step-required { max-width: 520px; }
.two-step-required .controls { margin-top: 12px; }
.two-step-required::backdrop { background: var(--bg); }

/* Balance sheet and Reconcile */
.rp-bs .desc { font-weight: 400; }
.rp-edit { margin-top: 12px; }
.rp-edit summary { cursor: pointer; font-weight: 600; }
.rp-loans { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.rc-account { margin-bottom: 16px; }
.rc-table { margin-top: 10px; }
.rc-table td { vertical-align: top; }
.rc-table tr.rc-changed td:first-child { box-shadow: inset 3px 0 0 var(--out); }
.rc-form-row td { background: var(--brand-soft); }
.rc-form label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.rc-result ul { margin: 6px 0; padding-left: 18px; }
.rc-more { margin-top: 8px; }
.read-only .rp-edit, .read-only .rc-act { display: none; }

/* Charts in Reports: above the table, and printed with it */
.rp-chart { margin: 4px 0 18px; }
.rp-chart .hint { margin: 6px 0 0; }
.hbar-stack { display: flex; }
.hbar-stack .hbar-fill { border-radius: 0; }
.hbar-stack .hbar-fill:last-child { border-radius: 0 4px 4px 0; }
@media print {
  .rp-chart { break-inside: avoid; }
  .rp-chart, .rp-chart * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
