/* Paperclip — typography follows charity-crowdfund.co.za (Red Hat Display / Red Hat Text / Nunito),
   palette is navy-blue and green. */
:root {
  --navy-900: #061a2e;
  --navy: #0b2a4a;
  --navy-700: #0d3b66;
  --blue: #1f6fd1;
  --blue-600: #1a5db3;
  --blue-pale: #e9f1fc;
  --teal: #14a3a0;
  --teal-pale: #e3f6f5;
  --green: #088a3c;
  --green-600: #07732f;
  --green-500: #12a35a;
  --mint: #b9f3cf;
  --green-pale: #e8f5ee;
  --green-tint: #f0faf4;
  --bg: #f2f6f8;
  --card: #ffffff;
  --line: #e1e9ee;
  --line-soft: #eef3f6;
  --text: #0f2236;
  --muted: #5d6f80;
  --danger: #c0392b;
  --danger-pale: #fdecea;

  --font-display: 'Red Hat Display', system-ui, sans-serif;
  --font-body: 'Red Hat Text', system-ui, sans-serif;
  --font-num: 'Nunito', system-ui, sans-serif;

  --radius: 12px;
  --radius-lg: 18px;
  --card-shadow: 0 1px 2px rgba(11, 42, 74, .04), 0 8px 24px rgba(11, 42, 74, .05);
  --card-hover: 0 2px 4px rgba(11, 42, 74, .05), 0 18px 40px rgba(11, 42, 74, .10);
  --sidebar-w: 252px;
}

*, *::before, *::after { box-sizing: border-box; }
/* Scripts hide things with the hidden attribute; it has to win over components' own display (grid, flex). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; color: var(--navy); }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-600); }
small { font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.ic { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; color: var(--text); }
.block { display: block; }
.pos { color: var(--green); }
.neg { color: var(--danger) !important; }
.spacer { flex: 1; }
.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.stack { display: grid; gap: 14px; }
:focus-visible { outline: 3px solid rgba(31, 111, 209, .35); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- shell */
body.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 16px;
  background: linear-gradient(170deg, var(--navy) 0%, var(--navy-900) 100%);
  color: #cfdbe7;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 1.1; letter-spacing: -.01em; }
.brand:hover { color: #fff; }
.sidebar .brand { padding: 4px 10px 22px; font-size: 15px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #1f6fd1 0%, #128c74 55%, #12a35a 100%);
  box-shadow: 0 6px 16px rgba(18, 163, 90, .25);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand small { font-family: var(--font-body); font-weight: 500; font-size: 12px; color: rgba(207, 219, 231, .7); letter-spacing: 0; }
.sidebar-head { display: flex; align-items: center; gap: 8px; padding: 4px 0 22px 6px; }
.sidebar .sidebar-head .brand { padding: 0; gap: 10px; flex: 1 1 auto; min-width: 0; }
.sidebar-head .brand > span { min-width: 0; overflow-wrap: break-word; }
.change-btn { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; }
.change-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.change-btn:focus-visible { outline: 3px solid rgba(111, 224, 160, .45); outline-offset: 2px; }
.nav { display: grid; gap: 4px; }
.nav a, .sidebar-foot a, .sidebar-foot button {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: #cfdbe7; font-family: var(--font-display); font-weight: 600; font-size: 15px;
  background: none; border: 0; width: 100%; cursor: pointer; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.nav a:hover, .sidebar-foot a:hover, .sidebar-foot button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #34c26b; color: #fff;
  font-family: var(--font-num); font-size: 12px; font-weight: 800; line-height: 18px; text-align: center; }
.nav-badge.done { display: inline-grid; place-items: center; min-width: 0; width: 22px; height: 20px; padding: 0; }
.nav-badge .ic { stroke-width: 3; }
.nav a.active, .sidebar-foot a.active { background: rgba(255, 255, 255, .10); color: #fff; box-shadow: inset 3px 0 0 #34c26b; }
.nav a.active .ic, .sidebar-foot a.active .ic { color: #6fe0a0; }
.nav-label {
  display: flex; align-items: center; gap: 8px; margin: 14px 12px 4px; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: rgba(207, 219, 231, .55);
}
.nav-label:first-child { margin-top: 0; }
.nav-label.live { color: #8fe3b3; }
.nav-label.live i { width: 7px; height: 7px; border-radius: 50%; background: #34c26b; box-shadow: 0 0 0 3px rgba(52, 194, 107, .25); }
.nav-label.dev { margin-top: 20px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.nav-dev { display: grid; gap: 2px; }
.nav-dev a { padding-top: 8px; padding-bottom: 8px; font-size: 14px; color: rgba(207, 219, 231, .78); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); display: grid; gap: 2px; }
.sidebar-foot form { margin: 0; }
.topbar { display: none; }
.scrim { display: none; }

.main { padding: 32px clamp(16px, 3vw, 40px) 64px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- cards & grids */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow); padding: 20px 22px; margin-bottom: 20px; min-width: 0;
}
.card > h2 { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 10px; }
.card-head-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card.empty { text-align: center; padding: 44px 24px; }
.card.empty h2 { margin-bottom: 6px; }
.card.empty p { color: var(--muted); }
.grid { display: grid; gap: 20px; }
.grid > .card, .grid > aside > .card { margin-bottom: 0; }
.grid + .grid, .grid + .card, .stats + .card, .stats + .grid, .card + .grid { margin-top: 0; }
.grid { margin-bottom: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.two-one { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.grid.two-one > aside { display: grid; gap: 20px; align-content: start; }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow); padding: 16px 18px 16px 20px;
}
.stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue); }
.stat.green::before { background: var(--green-500); }
.stat.navy::before { background: var(--navy-700); }
.stat.teal::before { background: var(--teal); }
.stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-value { font-family: var(--font-num); font-weight: 800; font-size: 25px; letter-spacing: -.01em; color: var(--navy); margin: 2px 0 4px; white-space: nowrap; }
.stat-foot { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stat-foot .progress { width: 100%; margin-top: 4px; }

.chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 6px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.chip.up { background: var(--green-pale); color: var(--green-600); }
.chip.down { background: var(--danger-pale); color: var(--danger); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--blue-pale); color: var(--blue-600); vertical-align: middle; font-family: var(--font-body); }
.tag.green { background: var(--green-pale); color: var(--green-600); }
.tag.red { background: var(--danger-pale); color: var(--danger); }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 20px; border-radius: var(--radius);
  background: var(--green-tint); border: 1px solid #cdeedb; color: var(--green-600);
}
.banner form { margin: 0; }

/* progress */
.progress { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue) 0%, var(--green-500) 100%); transition: width .3s ease; }
.progress.done span { background: var(--green-500); }
.progress.light { background: rgba(255, 255, 255, .18); }
.progress.light span { background: linear-gradient(90deg, #8fd0ff 0%, #6fe0a0 100%); }
.mini-progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.mini-progress .progress { flex: 1; height: 6px; }
.mini-progress span:last-child { font-size: 12.5px; color: var(--muted); width: 34px; text-align: right; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--green); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(8, 138, 60, .18);
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--green-600); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 12px; font-size: 13px; gap: 6px; }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--line-soft); color: var(--navy); }
.btn.ghost.danger { color: var(--danger); }
.btn.ghost.danger:hover { background: var(--danger-pale); }
.btn.icon-only { padding: 9px; }
.btn.disabled { opacity: .4; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--line-soft); color: var(--navy); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--navy); }
.field > span small { font-weight: 500; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #cfdbe3; background: #fff;
  font: inherit; color: var(--text); transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 111, 209, .15); }
textarea { resize: vertical; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 160px; }
.field-row > .field.grow { flex: 2 1 240px; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 38px; height: 22px; border-radius: 999px; background: #cfdbe3; position: relative; flex: none; transition: background .15s ease; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s ease; }
.switch input:checked + span { background: var(--green-500); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 3px solid rgba(31, 111, 209, .35); outline-offset: 2px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--line-soft); gap: 2px; justify-self: start; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 14px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg input:checked + span { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(11, 42, 74, .12); }
.seg input:focus-visible + span { outline: 3px solid rgba(31, 111, 209, .35); }
.form-actions, .dialog-actions { display: flex; flex-direction: row-reverse; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-actions form, .dialog-actions form { margin: 0; }

/* ---------------------------------------------------------------- dialogs */
.dialog {
  border: 0; padding: 0; border-radius: 20px; width: min(520px, calc(100vw - 32px));
  box-shadow: 0 30px 80px rgba(6, 26, 46, .35); color: var(--text);
}
.dialog.wide { width: min(720px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(6, 26, 46, .45); backdrop-filter: blur(2px); }
.dialog-body { display: grid; gap: 14px; padding: 22px 24px 24px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin: -4px -8px 2px 0; }
.dialog p { margin: 0; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-top: 2px solid var(--line); font-weight: 700; padding-top: 12px; color: var(--navy); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.num small { color: inherit; opacity: .75; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--green-tint); }
.table.compact td { padding: 8px 6px; }
.table .note-row td { padding-top: 0; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line-soft); }
.table tr:has(+ .note-row) td { border-bottom: 0; }
.neg-row td { color: var(--danger); }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gl { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font-body); }
.chart .dot { transition: r .12s ease; cursor: default; }
.chart .dot:hover { r: 6; }
.chart rect:hover { opacity: .85; }
.chart .marker { stroke: var(--navy); stroke-width: 2.5; stroke-linecap: round; }
.chart-empty { padding: 40px 0; text-align: center; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.key-line { height: 3px; width: 14px; border-radius: 2px; }
.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 4px 0 6px; background: var(--line-soft); }
.split-bar span { display: block; height: 100%; min-width: 3px; }

/* ---------------------------------------------------------------- checklist & lines */
.check { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c3d2dc; flex: none;
  display: grid; place-items: center; color: transparent; background: #fff;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.check:hover .box { border-color: var(--green-500); }
.check input:checked + .box { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.check input:focus-visible + .box { outline: 3px solid rgba(31, 111, 209, .35); outline-offset: 2px; }
.amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.empty-inline { display: flex; align-items: center; gap: 8px; color: var(--green); margin: 8px 0; }

/* ---------------------------------------------------------------- budget page */
.summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-item {
  display: grid; gap: 1px; padding: 14px 16px; border-radius: var(--radius); background: #fff;
  border: 1px solid var(--line); box-shadow: var(--card-shadow); color: var(--text);
}
a.summary-item:hover { color: var(--text); border-color: #c9d8e2; }
.summary-item i { width: 24px; height: 4px; border-radius: 4px; display: block; margin-bottom: 8px; }
.summary-item span { font-size: 13px; color: var(--muted); font-weight: 600; }
.summary-item strong { font-family: var(--font-num); font-weight: 800; font-size: 20px; color: var(--navy); white-space: nowrap; }
.summary-item small { color: var(--muted); }
.summary-item.total { background: linear-gradient(150deg, var(--green-tint), #e7f2fd); border-color: #cfe6dc; }
.summary-item.total i { background: linear-gradient(90deg, var(--blue), var(--green-500)); }
.summary-item.total.neg strong { color: var(--danger); }

.budget-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.budget-side { position: sticky; top: 20px; }
.section-card { padding-bottom: 12px; scroll-margin-top: 20px; }
.dot-lg { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.sec-total { font-family: var(--font-num); font-weight: 800; font-size: 17px; color: var(--navy); white-space: nowrap; }
.lines { display: grid; }
.line-group {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 9px 12px 9px 14px;
  border-radius: 10px; background: var(--bg); border-left: 4px solid var(--grp, var(--blue));
}
.lines > .line-group:first-child { margin-top: 2px; }
.lg-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--navy); }
.lg-name small { font-family: var(--font-body); font-weight: 500; font-size: 12.5px; color: var(--muted); }
.lg-total { font-family: var(--font-num); font-weight: 800; font-size: 15px; color: var(--navy); white-space: nowrap; }
.line { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 7px 4px; border-bottom: 1px solid var(--line-soft); transition: background .15s ease; }
.line:hover { background: var(--green-tint); border-radius: 8px; }
.line-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.line.is-paid .line-desc, .line.is-paid .amt { color: var(--muted); }
.line.is-paid .line-name { text-decoration: line-through; text-decoration-color: rgba(93, 111, 128, .5); }
.check-spacer { width: 22px; }
.add-line {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 10px;
  border: 0; border-radius: 8px; background: none; color: var(--blue); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.add-line:hover { background: var(--blue-pale); }
.tracker h2 { margin-bottom: 12px; }
.kv { margin: 0; display: grid; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.kv .kv-total { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 700; }
.kv .kv-total dt { color: var(--navy); }
.kv .excluded { opacity: .55; }
.tracker-progress { margin: 14px 0 18px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.tracker-form { display: grid; gap: 12px; }
.after { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--green-tint); border: 1px solid #cdeedb; }
.after span { font-size: 13px; color: var(--green-600); font-weight: 600; }
.after strong { font-family: var(--font-num); font-weight: 800; font-size: 22px; color: var(--green-600); }
.after.neg { background: var(--danger-pale); border-color: #f5c6c0; }
.after.neg span, .after.neg strong { color: var(--danger); }


/* ---------------------------------------------------------------- banking */
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--line-soft); padding: 2px 6px; border-radius: 6px; }
.mt { margin-top: 18px; margin-bottom: 6px; }
.hint { display: flex; align-items: center; gap: 6px; margin: -4px 0 0; font-size: 12.5px; color: var(--green-600); }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.link-btn:hover { color: var(--blue-600); text-decoration: underline; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 20px; }
.acct {
  position: relative; display: grid; gap: 2px; padding: 18px 20px; border-radius: var(--radius-lg);
  background: #fff; border: 1px solid var(--line); box-shadow: var(--card-shadow);
}
.acct.primary {
  color: #e6f0fa; border: 0;
  background: radial-gradient(120% 140% at 100% 0%, rgba(52, 194, 107, .35) 0%, rgba(52, 194, 107, 0) 55%), linear-gradient(150deg, var(--navy-700) 0%, #0f5f8c 60%, #0f8b6a 100%);
}
.acct-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.acct-name { font-family: var(--font-display); font-weight: 700; color: var(--navy); }
.acct.primary .acct-name { color: #fff; }
.acct-meta { font-size: 12.5px; color: var(--muted); }
.acct.primary .acct-meta, .acct.primary .acct-foot { color: rgba(230, 240, 250, .8); }
.acct-bal { font-family: var(--font-num); font-weight: 800; font-size: 26px; color: var(--navy); margin-top: 8px; white-space: nowrap; }
.acct.primary .acct-bal { color: #fff; }
.acct-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.acct-action { margin: 6px 0 0; }
.tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; font-family: var(--font-display); font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--navy); }
.tabs a.active { color: var(--navy); border-bottom-color: var(--green-500); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px 18px; }
.filters .field { flex: 1 1 150px; }
.filters .field.grow { flex: 2 1 220px; }
.filters-total { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filters-total span { color: var(--muted); font-size: 13px; }
.filters-total strong { font-family: var(--font-num); font-weight: 800; font-size: 22px; color: var(--navy); }
input[type=search] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #cfdbe3; background: #fff; font: inherit; color: var(--text); }

.tx-list { list-style: none; margin: 0; padding: 0; }
.tx-list li { border-bottom: 1px solid var(--line-soft); }
.tx-list li:last-child { border-bottom: 0; }
.tx {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%;
  padding: 10px 6px; border: 0; background: none; text-align: left; font: inherit; color: inherit; border-radius: 10px;
}
button.tx { cursor: pointer; }
button.tx:hover { background: var(--green-tint); }
.tx-date { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-pale); color: var(--blue-600); font-size: 11px; font-weight: 700; text-transform: uppercase; line-height: 1.05; }
.tx-date strong { font-family: var(--font-num); font-size: 17px; color: var(--navy); }
.tx-main { display: grid; gap: 4px; min-width: 0; }
.tx-desc { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.cat-chip { padding: 1px 8px; border-radius: 999px; background: var(--line-soft); color: var(--navy); font-weight: 600; }
.line-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--green-pale); color: var(--green-600); font-weight: 600; }
.tx-amt { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; color: var(--navy); }
.tx-list.compact .tx { padding: 8px 2px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pager a { min-width: 34px; padding: 6px 10px; text-align: center; border-radius: 8px; border: 1px solid var(--line); color: var(--navy); font-weight: 600; }
.pager a.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.cat-bar { display: grid; grid-template-columns: minmax(110px, 1.1fr) 2fr auto; gap: 12px; align-items: center; padding: 7px 6px; border-radius: 8px; color: var(--text); }
.cat-bar:hover { background: var(--green-tint); color: var(--text); }
.cat-name { display: grid; font-weight: 600; font-size: 14px; }
.cat-name small { font-weight: 500; color: var(--muted); }
.cat-track { height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.cat-track span { display: block; height: 100%; border-radius: inherit; }
.cat-amt { display: grid; justify-items: end; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.cat-amt small { font-weight: 600; }

.switch.sm { font-size: 12.5px; gap: 6px; color: var(--muted); }
.switch.sm span { width: 30px; height: 18px; }
.switch.sm span::after { width: 12px; height: 12px; }
.switch.sm input:checked + span::after { transform: translateX(12px); }
.bank-chip { display: flex; width: fit-content; align-items: center; gap: 4px; margin-top: 3px; padding: 1px 4px 1px 8px; border-radius: 999px; background: var(--green-pale); color: var(--green-600); font-size: 11.5px; font-weight: 600; text-decoration: none; }
.bank-chip.over { background: #fff4e5; color: #a35c00; }
.bank-chip form { margin: 0; }
.chip-x { display: grid; place-items: center; width: 16px; height: 16px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: .6; padding: 0; }
.chip-x:hover { opacity: 1; background: rgba(0, 0, 0, .06); }

.acct-group-head { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 2px 10px; }
.acct-group-head h2 { font-size: 15px; }
.acct.loan .acct-bal { color: var(--navy-700); }
.banner select { width: auto; padding: 7px 10px; font-size: 14px; }
.track-list { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 12px; margin: 0; display: grid; gap: 10px; }
.track-list legend { font-size: 13px; font-weight: 600; color: var(--navy); padding: 0 6px; }

.typical-card { border-color: #cfe6dc; background: linear-gradient(160deg, #fff 0%, var(--green-tint) 100%); align-content: start; }
.typical-card h2 .ic, .compare-card h2 .ic { color: var(--green-500); }
.typical-card .kv { margin-bottom: 16px; }
.typical-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.typical-actions form { margin: 0; }
.compare-card { display: grid; gap: 12px; }
.compare-card h2 { margin-bottom: 0; }
.compare-card .table th { text-transform: none; letter-spacing: 0; font-size: 12px; }
.compare-card .table td.num small { opacity: 1; font-weight: 600; }
.vs-typical { margin-top: 20px; }

.tag.amber { background: #fff4e5; color: #a35c00; }
.cat-chip { display: inline-flex; align-items: center; gap: 5px; }
.cat-chip i, .group-name i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.group-name { display: inline-flex; align-items: center; gap: 8px; }
.group-bars { display: grid; gap: 2px; }
.group-row summary { list-style: none; cursor: pointer; }
.group-row summary::-webkit-details-marker { display: none; }
.group-row[open] summary { background: var(--line-soft); }
.sub-cats { list-style: none; margin: 2px 0 8px; padding: 0 6px 0 22px; display: grid; }
.sub-cats a { display: flex; justify-content: space-between; gap: 10px; padding: 5px 8px; border-radius: 6px; color: var(--text); font-size: 13.5px; }
.sub-cats a:hover { background: var(--green-tint); color: var(--text); }
.sub-cats a span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }

#sec-income .line.is-paid .line-name { text-decoration: none; color: var(--green-600); }
#sec-income .line.is-paid .amt { color: var(--green-600); }
.income-kv { margin: 6px 0 2px; }

.line-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 32px; }
.find-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--blue); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  opacity: .75; transition: opacity .15s ease, background .15s ease;
}
.line:hover .find-btn, .find-btn:focus-visible { opacity: 1; }
.find-btn:hover { background: var(--blue-pale); border-color: #cfe0f6; }
.match-list { list-style: none; margin: 0; padding: 0; max-height: min(52vh, 460px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.match-list li + li { border-top: 1px solid var(--line-soft); }
.match-list .muted { padding: 14px; }
.match-option {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%;
  padding: 10px 12px; border: 0; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.match-option:hover, .match-option:focus-visible { background: var(--green-tint); }
.match-option .mo-date { font-size: 12px; font-weight: 700; color: var(--blue-600); text-transform: uppercase; }
.match-option .mo-main { display: grid; gap: 2px; min-width: 0; }
.match-option .mo-desc { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-option .mo-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.match-option .mo-hint { color: var(--green-600); font-weight: 600; }
.match-option .mo-change { color: #a35c00; font-weight: 600; }
.match-option .mo-amt { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .find-btn span { display: none; } .find-btn { opacity: 1; padding: 5px; } }

.budget-tabs a { display: inline-flex; align-items: center; gap: 7px; }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff4e5; color: #a35c00; font-size: 11.5px; font-weight: 700; }
.matched-list summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.matched-list summary::-webkit-details-marker { display: none; }
.matched-list summary h2 { margin: 0; }
.matched-list[open] summary { margin-bottom: 10px; }
.bva { display: grid; gap: 14px; }
.bva-row { display: grid; gap: 6px; }
.bva-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.bva-head strong { font-family: var(--font-num); }
/* Clickable figures: tiles, section rows, chips and payments open the Transactions tab filtered. */
a.stat { display: block; color: inherit; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
a.stat:hover { color: inherit; border-color: #b9d3e6; box-shadow: 0 6px 18px rgba(11, 42, 74, .10); transform: translateY(-1px); }
a.stat .stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
a.stat .stat-label svg { opacity: 0; color: var(--blue); transition: opacity .15s ease; }
a.stat:hover .stat-label svg, a.stat:focus-visible .stat-label svg { opacity: 1; }
a.bva-row { color: inherit; margin: -6px; padding: 6px; border-radius: 10px; }
a.bva-row:hover { background: var(--green-tint); color: inherit; }
a.tx { color: inherit; }
a.tx:hover { background: var(--green-tint); color: inherit; }
a.cat-chip:hover { background: #dfe8ef; color: var(--navy); }
a.line-chip:hover { background: #cdeedb; color: var(--green-600); }
a.tag:hover { background: #d6e6f8; color: var(--blue-600); }
.bank-chip a { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.bank-chip a:hover { text-decoration: underline; }
/* Cash: the bank balance so far and its forecast (dashboard hero, budget page), with a hover crosshair. */
.cash-hero { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 28px; align-items: center; }
.cash-figure { display: grid; gap: 2px; align-content: start; }
.hero-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.hero-value { font-family: var(--font-num); font-weight: 800; font-size: 48px; line-height: 1.05; color: var(--navy); letter-spacing: -.02em; }
.hero-sub { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.hero-eq { font-size: 14px; }
.hero-eq > div { padding: 6px 0; }
.hero-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 14px; }
.cash-plot { min-width: 0; }
.chart .gl.zero { stroke: #9fb3c5; stroke-width: 1.25; }
.chart .today { stroke: var(--navy); stroke-width: 1; opacity: .3; }
.chart .today-label { font-size: 11px; font-weight: 600; fill: var(--navy); opacity: .7; }
.chart .mark { stroke: #fff; stroke-width: 2; }
.chart .mark-label { font: 700 12px var(--font-body); fill: var(--navy); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.chart .mark-label.neg { fill: var(--danger); }
.chart .crosshair { stroke: var(--navy); stroke-width: 1; opacity: .35; pointer-events: none; }
.chart[data-hover] { cursor: crosshair; touch-action: pan-y; }
.chart[data-hover]:focus-visible { outline: 3px solid rgba(31, 111, 209, .35); outline-offset: 4px; border-radius: 6px; }
.chart-wrap { position: relative; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 160px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(11, 42, 74, .14); font-size: 12.5px; }
.chart-tip strong { display: block; margin-bottom: 4px; color: var(--muted); font-weight: 600; }
.chart-tip div { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.chart-tip i { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.chart-tip b { font-variant-numeric: tabular-nums; color: var(--navy); }
.chart-tip span { color: var(--muted); }
.legend i.key-line.dashed { background: none; height: 0; border-top: 2px dashed currentColor; border-radius: 0; }
.cash-table .col-date { width: 1%; white-space: nowrap; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.cash-table .col-date small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.cash-table .cash-line { display: block; font-weight: 600; color: var(--navy); margin-bottom: 3px; }
.cash-table tr.short td { background: #fff6f4; }
.pm-income { background: var(--green-pale); color: var(--green-600); }
.cash-details { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.cash-details summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 700; color: var(--navy); }
.cash-details summary::-webkit-details-marker { display: none; }
.cash-details summary .muted { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-weight: 500; font-size: 13px; }
.cash-details[open] summary { margin-bottom: 10px; }
.cash-details[open] summary svg { transform: rotate(180deg); }
.group-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.group-bars a { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1.3fr) auto; gap: 12px; align-items: center; padding: 6px; border-radius: 8px; color: var(--text); }
.group-bars a:hover { background: var(--green-tint); color: var(--text); }
.gb-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: 14px; }
.gb-name > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-track { position: relative; height: 10px; border-radius: 999px; background: var(--line-soft); }
.gb-fill { display: block; height: 100%; min-width: 2px; border-radius: 999px; background: var(--blue); }
.gb-usual { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--navy); box-shadow: 0 0 0 2px #fff; }
.gb-amt { display: grid; justify-items: end; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.gb-amt small { font-size: 12px; font-weight: 600; }
.legend-note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.gb-usual-key { display: inline-block; width: 2px; height: 14px; border-radius: 2px; background: var(--navy); }
.meters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.meter-tile { display: grid; gap: 6px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
.meter-tile:hover { border-color: #b9d3e6; background: var(--green-tint); color: var(--text); }
.meter-tile strong { font-family: var(--font-num); font-size: 20px; color: var(--navy); line-height: 1.1; }
@media (max-width: 960px) {
  .cash-hero { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero-value { font-size: 38px; }
  .group-bars a { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .gb-track { grid-column: 1 / -1; grid-row: 2; }
}

/* Budget → Transactions: the filterable table and its category chips. */
.facet-row { flex: 1 1 100%; display: grid; gap: 6px; }
.facet-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.facet { display: flex; flex-wrap: wrap; gap: 6px; }
.facet-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: 13px; font-weight: 600; white-space: nowrap; transition: border-color .15s ease, background .15s ease; }
.facet-chip:first-child { padding-left: 12px; }
.facet-chip:hover { border-color: #9fbdd6; color: var(--navy); }
.facet-chip > svg { margin-right: 4px; opacity: .8; }
.facet-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); flex: none; }
.facet-n { min-width: 24px; padding: 2px 7px; border-radius: 999px; background: var(--line-soft); color: var(--muted); font-family: var(--font-num); font-size: 12px; font-weight: 700; text-align: center; }
.facet-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.facet-chip.active .facet-n { background: rgba(255, 255, 255, .18); color: #fff; }
.facet-chip.active .facet-ic { background: #fff; }
.tx-table th .sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.tx-table th .sort:hover, .tx-table th .sort.on { color: var(--navy); }
.tx-table td { padding: 9px 10px; }
.tx-table .col-date { width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); }
.tx-table .col-date small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.tx-table .tx-name { min-width: 220px; font-weight: 500; }
.tx-table td:nth-child(3), .tx-table td:nth-child(4) { white-space: nowrap; }
.tx-table tbody tr:hover td { background: var(--green-tint); }
.tx-table tbody tr { scroll-margin-top: 90px; }
.tx-table tbody tr:target td { background: var(--green-tint); }
.tx-table tbody tr:target td:first-child { box-shadow: inset 3px 0 0 var(--green-500); }
.tx-table tfoot td { line-height: 1.5; }
.show-sm { display: none; }
.tx-sub { flex-wrap: wrap; gap: 4px; margin-top: 5px; font-size: 12px; }
@media (min-width: 961px) {
  .tx-wrap { overflow: visible; }
  .tx-table thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
}
.stat-value small { font-size: 15px; font-weight: 600; }

.progress.over span { background: var(--danger); }

.pay-method { display: inline-flex; align-items: center; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: 1px; white-space: nowrap; }
.pm-debit_order { background: var(--blue-pale); color: var(--blue-600); }
.pm-eft { background: var(--teal-pale); color: #0f7c7a; }
.pm-credit_card { background: #e7edf4; color: var(--navy-700); }
.pay-day { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--line-soft); color: var(--muted); font-size: 11px; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.kv-strong dt { font-weight: 700; color: var(--navy); display: grid; }
.kv-strong dt small { font-weight: 500; font-size: 12px; color: var(--muted); }
.kv-strong dd { font-weight: 800; color: var(--navy); }
.pm-manual { background: #fff4e5; color: #a35c00; }
.pm-unset { background: transparent; color: var(--muted); border: 1px dashed #cfdbe3; font-weight: 600; }
.kv .kv-sub { padding: 4px 0 4px 10px; border-bottom: 0; font-size: 13px; }
.kv .kv-sub .pay-method { margin-left: 0; }

/* ---------------------------------------------------------------- flash */
.flash { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; }
.flash-success { background: var(--green-pale); color: var(--green-600); border: 1px solid #cdeedb; }
.flash-info { background: var(--blue-pale); color: var(--blue-600); border: 1px solid #cfe0f6; }
.flash-error { background: var(--danger-pale); color: var(--danger); border: 1px solid #f5c6c0; }
.flash-x { border: 0; background: none; color: inherit; cursor: pointer; opacity: .6; display: grid; place-items: center; padding: 2px; }
.flash-x:hover { opacity: 1; }

/* ---------------------------------------------------------------- company: reports and documents */
.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.report-tile { display: block; color: var(--text); margin: 0; transition: box-shadow .15s ease, transform .15s ease; }
.report-tile:hover { box-shadow: var(--card-hover); transform: translateY(-1px); color: var(--text); }
.report-tile h3 { margin-bottom: 6px; }
.report-tile p { margin: 0; }
.report-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 20px; }
.report-form .field { flex: 0 1 200px; }
.table.report td { padding-top: 8px; padding-bottom: 8px; }
.table.report tr.head td { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--navy); padding-top: 18px; border-bottom: 0; }
.table.report tr.sec td { font-family: var(--font-display); font-weight: 700; color: var(--navy); padding-top: 14px; }
.table.report tr.sum td { font-weight: 700; border-bottom: 1px solid var(--line); }
.table.report tr.grand td { font-weight: 800; color: var(--navy); background: var(--line-soft); }
.check-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--line-soft); color: var(--muted); }
.status.paid, .status.accepted, .status.posted, .status.billed, .status.invoiced, .status.registered { background: var(--green-pale); color: var(--green-600); }
.status.authorised, .status.sent, .status.submitted, .status.awaiting { background: var(--blue-pale); color: var(--blue-600); }
.status.overdue, .status.declined { background: var(--danger-pale); color: var(--danger); }
.status.voided, .status.deleted, .status.archived { text-decoration: line-through; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 9px 14px; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--navy); }
.tabs a.active { color: var(--navy); border-bottom-color: var(--green-500); }
.tabs a small { font-weight: 700; color: var(--muted); background: var(--line-soft); border-radius: 999px; padding: 0 7px; font-size: 11.5px; }
.doc-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin-bottom: 18px; }
.doc-head div span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.doc-head div strong { font-weight: 600; color: var(--text); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filter-bar .field { flex: 0 1 180px; }
.filter-bar .field.grow { flex: 1 1 240px; }
.doc-totals { max-width: 360px; margin: 14px 0 0 auto; }
.table td form.inline select { width: auto; max-width: 340px; }

/* ---------------------------------------------------------------- auth */
body.bare { min-height: 100vh; background: #fff; }
.auth-main { min-height: 100vh; }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art {
  position: relative; overflow: hidden; display: flex; align-items: center; padding: 48px clamp(24px, 6vw, 80px);
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(52, 194, 107, .35) 0%, rgba(52, 194, 107, 0) 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-700) 50%, #0f6f6a 100%);
  color: #cfe0ee;
}
.auth-art-inner { max-width: 440px; display: grid; gap: 18px; }
.auth-art h2 { color: #fff; font-size: clamp(32px, 4vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin-top: 30px; }
.auth-art p { font-size: 17px; line-height: 1.55; }
.auth-chart { width: 100%; max-width: 380px; margin-top: 18px; }
.auth-panel { display: grid; place-items: center; padding: 40px 16px; }
.auth-form { width: min(380px, 100%); display: grid; gap: 16px; }
.auth-form .sub { color: var(--muted); margin: -8px 0 6px; }
.auth-form .btn { padding: 13px 18px; font-size: 16px; margin-top: 6px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .budget-layout { grid-template-columns: minmax(0, 1fr); }
  .budget-side { position: static; }
  .grid.two, .grid.two-one { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  body.shell { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); z-index: 40;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 60px rgba(0, 0, 0, .3);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(6, 26, 46, .45); z-index: 30; }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20;
    padding: 10px 12px; background: var(--navy); color: #fff;
  }
  .topbar .icon-btn { color: #fff; }
  .topbar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
  .topbar .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .topbar .brand-mark svg { width: 21px; height: 21px; }
  .topbar .brand { min-width: 0; }
  .topbar .brand > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .change-btn { margin-left: auto; }
  .main { padding: 22px 16px 48px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 24px; min-height: 0; }
  .auth-art h2 { margin-top: 12px; font-size: 30px; }
  .auth-art p, .auth-chart { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 24px; }
  .stats.three { grid-template-columns: 1fr 1fr; }
  .cat-bar { grid-template-columns: minmax(90px, 1fr) 1fr auto; gap: 8px; }
  .tx { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; }
  .card { padding: 16px; border-radius: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .stats, .stats.four { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stat { padding: 12px 12px 12px 16px; }
  .stat-value { font-size: 19px; }
  .hide-sm { display: none; }
  .show-sm { display: flex; }
  .tx-wrap { overflow: visible; }
  .tx-table { table-layout: fixed; font-size: 13px; }
  .tx-table .col-date { width: 54px; }
  .tx-table th.num { width: 100px; }
  .tx-table .tx-name { min-width: 0; overflow-wrap: anywhere; }
  .tx-table th, .tx-table td { padding: 9px 5px; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .line { grid-template-columns: 26px minmax(0, 1fr) auto 30px; gap: 8px; }
  .line-group { padding-left: 12px; }
  .page-actions .btn span { display: none; }
  .page-actions .btn { padding: 9px; }
  .dialog-body { padding: 18px; }
}
@media (max-width: 400px) {
  .stats, .stats.four { grid-template-columns: minmax(0, 1fr); }
}


/* ---------------------------------------------------------------- company: Reconcile (Xero's reconcile screen) */
.rec-head { display: grid; grid-template-columns: minmax(0, 5fr) 84px minmax(0, 7fr); gap: 14px; padding: 0 4px 8px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rec { display: grid; grid-template-columns: minmax(0, 5fr) 84px minmax(0, 7fr); gap: 14px; margin-bottom: 14px; }
.rec-form { display: contents; }
.rec-form > .rec-ok { grid-column: 2; grid-row: 1; }
.rec-line, .rec-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.rec-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date amt" "desc amt" "meta amt"; gap: 2px 14px; align-content: start; }
.rec-date { grid-area: date; font-weight: 700; color: var(--navy); font-size: 13.5px; }
.rec-desc { grid-area: desc; overflow-wrap: anywhere; }
.rec-meta { grid-area: meta; }
.rec-amt { grid-area: amt; text-align: right; font-family: var(--font-num); font-weight: 800; font-size: 16px; color: var(--navy);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-amt.pos { color: var(--green); }
.rec-amt small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.rec-ok { display: grid; place-items: start center; padding-top: 14px; }
.rec-ok .btn { width: 72px; justify-content: center; }
.rec.suggested .rec-panel { border-color: #9fdcbb; box-shadow: inset 4px 0 0 var(--green-500); }
.rec-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: -4px 0 12px; border-bottom: 1px solid var(--line); }
.rec-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.rec-tabs label { padding: 6px 12px; font-family: var(--font-display); font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rec-tabs label:hover { color: var(--navy); }
.rec-tabs input:checked + label { color: var(--navy); border-bottom-color: var(--green-500); }
.rec-tabs input:focus-visible + label { outline: 3px solid rgba(31, 111, 209, .35); outline-offset: 2px; border-radius: 6px; }
.rec-pane { display: none; }
.rec-pane[data-pane="money"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.rec-panel:has(input[name="type"][value="money"]:checked) .rec-pane[data-pane="money"] { display: grid; }
.rec-panel:has(input[name="type"][value="transfer"]:checked) .rec-pane[data-pane="transfer"],
.rec-panel:has(input[name="type"][value="payment"]:checked) .rec-pane[data-pane="payment"],
.rec-panel:has(input[name="type"][value="match"]:checked) .rec-pane[data-pane="match"],
.rec-panel:has(input[name="type"][value="line"]:checked) .rec-pane[data-pane="line"],
.rec-panel:has(input[name="type"][value="category"]:checked) .rec-pane[data-pane="category"] { display: grid; gap: 8px; }
.rec-match { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; }
.rec-match:has(input:checked) { border-color: var(--green-500); background: var(--green-tint); }
.rec-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; font-size: 13px; }
.rec-foot .field { flex: 1 1 220px; }
.rec-why { display: inline-flex; align-items: center; gap: 5px; color: var(--green-600); font-weight: 600; }
.rec-rule { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.rec-error { margin: 10px 0 0; color: var(--danger); font-size: 13px; }
.rec.done { grid-template-columns: 1fr; }
.rec-done { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--green-tint);
  border: 1px solid #cdeedb; color: var(--green-600); font-weight: 600; }
.rec-done .muted { font-weight: 500; }
/* A budget month's Reconcile tab: what to show, and reconciling everything suggested in one go. */
.rec-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; }
.seg a { display: block; padding: 6px 14px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg a:hover { color: var(--navy); }
.seg a[aria-current] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(11, 42, 74, .12); }
@media (max-width: 960px) {
  .rec-head { display: none; }
  .rec, .rec.done { grid-template-columns: 1fr; gap: 8px; }
  .rec-form > .rec-ok { grid-column: 1; grid-row: 3; place-items: stretch; padding: 0; }
  .rec-ok .btn { width: 100%; }
  .rec-pane[data-pane="money"] { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- company: reports (Xero's layout) */
.xr-favs { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.xr-fav { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.xr-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.xr-groups .card { margin: 0; }
.xr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.xr-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.xr-list li:last-child { border-bottom: 0; }
.xr-list a { font-weight: 600; }
.xr-list small { display: block; margin-top: 1px; }
.xr-star button { font-size: 17px; color: var(--green); width: 26px; height: 26px; }
.xr-actions { justify-content: flex-end; margin-bottom: 12px; }
.xr-toolbar { margin-bottom: 16px; }
.xr-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; align-self: center; font-size: 13.5px; }
.xr-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.xr-sheet { padding: 28px clamp(16px, 3vw, 36px) 24px; }
.xr-title { text-align: center; margin-bottom: 22px; }
.xr-title h1 { font-size: 24px; }
.xr-org { font-weight: 700; color: var(--navy); margin-top: 4px; }
.xr-sub { color: var(--muted); margin-top: 2px; }
.table.xr { font-size: 13.5px; }
.table.xr caption { text-align: left; font-family: var(--font-display); font-weight: 700; color: var(--navy); padding: 18px 0 6px; }
.table.xr th { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--navy); border-bottom: 2px solid var(--navy); }
.table.xr td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); }
.table.xr td a { color: var(--blue); }
.table.xr .xr-section td { font-family: var(--font-display); font-weight: 700; color: var(--navy); padding-top: 16px; border-bottom: 1px solid var(--line); }
.table.xr .xr-row td:first-child { padding-left: 22px; }
.table.xr .xr-total td { font-weight: 700; border-bottom: 1px solid var(--line); }
.table.xr .xr-grand td { font-weight: 800; color: var(--navy); border-top: 1px solid var(--navy); border-bottom: 2px solid var(--navy); background: var(--line-soft); }
.table.xr .xr-note td { color: var(--muted); font-size: 12.5px; }
.table.xr .neg-amt, .table.xr .neg-amt a { color: var(--danger); }
.xr-empty { text-align: center; padding: 20px 0; }
.xr-notes { margin: 14px 0 0; }
@media print {
  body.shell { display: block; background: #fff; }
  .sidebar, .topbar, .scrim, .flash, .xr-actions, .xr-toolbar, .page-actions { display: none !important; }
  .main { padding: 0; }
  .card, .xr-sheet { box-shadow: none; border: 0; padding: 0; }
  .table.xr td a { color: inherit; text-decoration: none; }
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
}

/* ---------------------------------------------------------------- the books against Xero (Check, Line by line) */
.tag.grey { background: var(--line-soft); color: var(--muted); }
.xc-verdict { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 22px; padding: 22px 24px; }
.xc-badge { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--green-pale); color: var(--green-600); }
.xc-verdict.diff .xc-badge { background: var(--danger-pale); color: var(--danger); }
.xc-verdict.none .xc-badge { background: var(--line-soft); color: var(--muted); }
.xc-eyebrow { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.xc-verdict h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.xc-verdict p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.xc-run { display: flex; align-items: flex-end; gap: 10px; margin: 0; }
.xc-run .field input { width: 160px; }
.xc-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.xc-foot .btn { margin-left: auto; }
.xc-hist { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-weight: 600; }
.xc-hist:hover { border-color: var(--blue); color: var(--blue-600); }
.xc-hist.current { background: var(--navy); border-color: var(--navy); color: #fff; }
.xc-hist i, .xc-key i { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); }
.xc-hist i.diff { background: var(--danger); }
.xc-hist i.expected { background: #e8a33a; }

/* Five areas: the first two (bank, profit) wide, the other three beneath them; Line by line's tiles just fill the row. */
.xc-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.xc-tiles > * { grid-column: span 2; }
.xc-tiles > :nth-child(-n+2) { grid-column: span 3; }
.xc-tiles.fill { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.xc-tiles.fill > * { grid-column: auto; }
.xc-tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--card-shadow);
  padding: 16px 18px 16px 20px; color: var(--text); transition: box-shadow .15s ease, transform .15s ease;
}
a.xc-tile:hover { color: var(--text); box-shadow: var(--card-hover); transform: translateY(-1px); }
.xc-tile::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--green-500); }
.xc-tile.diff::before { background: var(--danger); }
.xc-tile.amber::before { background: #e8a33a; }
.xc-tile.none::before { background: var(--line); }
.xc-tile-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; color: var(--navy); }
.xc-tile-head .ic { color: var(--muted); }
.xc-tile-head .tag { margin-left: auto; white-space: nowrap; }
.xc-tile > p { margin: 0; font-size: 13px; color: var(--muted); }
.xc-tile .pair-bars { margin-top: auto; }

/* Here against Xero: two bars on one scale; the longer one's extra is marked. */
.pair-bars { display: grid; gap: 4px; }
.pb-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pb-same { display: inline-flex; align-items: center; gap: 3px; color: var(--green-600); }
.pb-row { display: grid; grid-template-columns: 34px minmax(40px, 1fr) auto; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.pb-track { display: flex; height: 9px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.pb-track i { display: block; height: 100%; background: var(--navy-700); }
.pb-xero .pb-track i { background: #13b5ea; }
.pb-track i.pb-gap { min-width: 4px; background: repeating-linear-gradient(135deg, var(--danger) 0 3px, #e8675a 3px 6px); }
.pb-row b { font-family: var(--font-num); font-weight: 800; font-size: 13px; color: var(--navy); text-align: right; white-space: nowrap; }

.xc-group + .xc-group { margin-top: 22px; }
.xc-group h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.xc-group h3 .ic { color: var(--muted); }
.xc-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.xc-item {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 10px 24px; align-items: start;
  padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--danger); border-radius: var(--radius); background: #fff;
}
.xc-item.expected { border-left-color: #e8a33a; background: #fffcf6; }
.xc-meta { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.xc-item h4 { margin: 0; font-family: var(--font-display); font-size: 15.5px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.xc-item p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.xc-fig .pb-row { font-size: 12.5px; }
.xc-fix { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; font-weight: 600; }
.xc-fix a { display: inline-flex; align-items: center; gap: 2px; }
.xc-more { margin: 10px 0 0; }

.xc-figs { border-top: 1px solid var(--line-soft); }
.xc-figs summary { display: flex; align-items: center; gap: 10px; padding: 12px 2px; cursor: pointer; font-family: var(--font-display); font-weight: 700; color: var(--navy); list-style: none; }
.xc-figs summary::-webkit-details-marker { display: none; }
.xc-figs summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s ease; margin-right: 2px; }
.xc-figs[open] summary::before { transform: rotate(45deg); }
.xc-figs .table-wrap, .xc-figs > p { margin-bottom: 14px; }

/* Line by line: how each bank account's movements pair up. */
.xc-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.xc-key li { display: inline-flex; align-items: center; gap: 5px; }
.xc-key b { font-family: var(--font-num); color: var(--navy); }
.xc-tile .split-bar { height: 12px; margin: 0; }
.xc-sheet-head { margin: 26px 0 12px; }
@media print { .xr-summary { display: none !important; } }
@media (max-width: 1100px) {
  .xc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xc-tiles > *, .xc-tiles > :nth-child(-n+2) { grid-column: auto; }
  .xc-tiles:not(.fill) > :nth-child(5):last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .xc-tiles { grid-template-columns: minmax(0, 1fr); }
  .xc-tiles:not(.fill) > :nth-child(5):last-child { grid-column: auto; }
  .xc-verdict { grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 18px; }
  .xc-side { grid-column: 1 / -1; }
  .xc-verdict h2 { font-size: 20px; }
  .xc-badge { width: 48px; height: 48px; }
  .xc-item { grid-template-columns: minmax(0, 1fr); }
}

/* Users and invites. */
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.access-row > span { font-weight: 600; color: var(--navy); font-size: 14px; }
.people { display: grid; }
.person { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.person:first-child { border-top: 0; padding-top: 0; }
.person-head { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.person-head .grow { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.person-edit { margin-top: 10px; }
.person-edit summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 13px; }
.person-edit form { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--line-soft); }
/* View-only access to a company: forms that would change something lose their buttons (the server refuses them anyway). */
.view-only main form[method="post" i] :is(button, input[type="submit"]) { display: none; }

/* Accounts: signing up, adding an account, roles and Portfolio's account cards. */
.auth-alt { text-align: center; margin: 0; }
.tag.teal { background: var(--teal-pale); color: #0d7a78; }
.kind-pick { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kind-pick legend { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; padding: 0; }
.kind-pick label { position: relative; cursor: pointer; }
.kind-pick input { position: absolute; opacity: 0; pointer-events: none; }
.kind-pick label > span { display: grid; gap: 4px; height: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; }
.kind-pick strong { font-family: var(--font-display); color: var(--navy); font-size: 15px; }
.kind-pick small { color: var(--muted); font-size: 13px; }
.kind-pick .ic { color: var(--muted); }
.kind-pick input:checked + span { border-color: var(--green-500); background: var(--green-tint); box-shadow: 0 0 0 3px rgba(18, 163, 90, .12); }
.kind-pick input:checked + span .ic { color: var(--green-500); }
.kind-pick input:focus-visible + span { outline: 3px solid rgba(31, 111, 209, .35); }
.setup .pe-only { display: none; }
.setup.is-individual .co-only, .setup:has(input[name="kind"][value="individual"]:checked) .co-only { display: none; }
.setup.is-individual .pe-only, .setup:has(input[name="kind"][value="individual"]:checked) .pe-only { display: inline; }
.role-pick { display: grid; gap: 6px; }
.role-pick label { position: relative; cursor: pointer; }
.role-pick input { position: absolute; opacity: 0; pointer-events: none; }
.role-pick label > span { display: grid; gap: 1px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.role-pick strong { color: var(--navy); font-size: 14px; }
.role-pick small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.role-pick input:checked + span { border-color: var(--green-500); background: var(--green-tint); }
.role-pick input:focus-visible + span { outline: 3px solid rgba(31, 111, 209, .35); }
.role-list > div { align-items: baseline; }
.role-list dd { font-weight: 400; font-size: 13px; color: var(--muted); max-width: 70%; }
.lock-form { margin-top: 14px; align-items: flex-end; }
.pf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.pf-cards > .card { margin-bottom: 0; }
.pf-card { display: grid; grid-template-rows: auto 1fr auto; gap: 14px; }
.pf-card.current { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(18, 163, 90, .10), var(--card-shadow); }
.pf-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pf-head .grow { flex: 1 1 auto; min-width: 0; }
.pf-head h2 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-head h2 a { color: var(--navy); }
.pf-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff; }
.pf-figs { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; align-content: start; }
.pf-figs dt { font-size: 12.5px; color: var(--muted); }
.pf-figs dd { margin: 2px 0 0; font-family: var(--font-num); font-weight: 800; font-size: 18px; color: var(--navy); font-variant-numeric: tabular-nums; }
.pf-figs dd small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 12px; color: var(--muted); }
.pf-month { margin: 0; font-weight: 600; font-size: 13px; color: var(--navy); }
.pf-none { margin: 0; font-size: 14px; }
.pf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.pf-foot form { margin: 0 0 0 auto; }
.pf-add { display: grid; place-content: center; justify-items: center; gap: 4px; min-height: 180px; border-style: dashed; color: var(--muted); text-align: center; }
.pf-add strong { color: var(--navy); font-family: var(--font-display); }
.pf-add:hover { border-color: var(--green-500); color: var(--green-600); }
.pf-empty .form-actions { justify-content: center; margin-top: 14px; }
@media (max-width: 640px) {
  .pf-cards { grid-template-columns: minmax(0, 1fr); }
  .kind-pick { grid-template-columns: minmax(0, 1fr); }
  .role-list dd { max-width: 60%; }
}

/* After signing in: which account to open. */
.account-pick { width: min(520px, calc(100vw - 32px)); }
.ap-list { display: grid; gap: 8px; max-height: min(60vh, 520px); overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.ap-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius); color: var(--navy); }
.ap-row:hover, .ap-row:focus-visible { border-color: var(--green-500); background: var(--green-tint); color: var(--navy); }
.ap-row.current { border-color: var(--green-500); }
.ap-row > .ic { color: var(--muted); }
.ap-row .pf-icon { width: 36px; height: 36px; border-radius: 10px; }
.ap-name { display: grid; min-width: 0; }
.ap-name strong { font-family: var(--font-display); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-name small { color: var(--muted); font-size: 12.5px; }
.ap-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .ap-row { grid-template-columns: auto minmax(0, 1fr) auto; } .ap-row > .ic { display: none; } }
