:root {
  --ink: #0E1A2B; --muted: #4A5566; --line: #D8DEE7; --bg: #F2F4F7; --card: #fff;
  --accent: #1F3A8A; --accent-ink: #fff; --amber: #F5B33D; --amber-ink: #1A1204; --warn: #9a5b00; --warn-bg: #fff4e0; --bad: #a12a2a; --bad-bg: #fdecec; --good: #1f6b3a;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 'Instrument Sans', system-ui, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, .figures .value, .tile .value { font-family: 'Bricolage Grotesque', system-ui, sans-serif; letter-spacing: -0.02em; }
.top { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand span { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; font-size: 24px; letter-spacing: -0.03em; }
#nav { display: flex; gap: 12px; align-items: center; margin-left: auto; flex-wrap: wrap; }
#nav a, #nav button.link { color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
#nav select { font: inherit; padding: 4px 6px; width: auto; max-width: 240px; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin: 14px 0; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.spread { justify-content: space-between; }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.figures > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.figures > div:last-child { border-right: 0; }
.figures .label { color: var(--muted); font-size: 13px; }
.figures .value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.instruction { margin: 12px 0 0; padding: 12px 14px; border-radius: 6px; font-weight: 600; }
.instruction.move { background: var(--amber); color: var(--amber-ink); }
.instruction.ok { background: #e9f5ee; color: var(--good); }
.instruction.none { background: #eef1f3; color: var(--muted); font-weight: 400; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
td.detail { overflow-wrap: anywhere; min-width: 220px; }
td.detail .kv { display: inline-block; margin-right: 10px; }
tr.excluded td { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 4px; background: #eef1f3; color: var(--muted); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.note { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.error { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 6px; margin: 10px 0; }
button, .btn { font: inherit; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary { background: var(--card); color: var(--accent); }
button.danger { background: var(--card); color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .6; cursor: default; }
label { display: block; margin: 8px 0 4px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=url], select { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; width: 100%; max-width: 420px; background: #fff; }
.checks label { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; }
.months { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.months label { display: inline-flex; gap: 4px; margin: 0; color: var(--ink); }
.login { max-width: 440px; margin: 60px auto; }
details summary { cursor: pointer; font-weight: 600; }
.scroll { overflow-x: auto; }
ol.steps { padding-left: 20px; margin: 6px 0; }
ol.steps li { margin: 6px 0; }
code { background: #eef1f3; padding: 1px 4px; border-radius: 3px; font-size: 13px; word-break: break-all; }
@media (max-width: 700px) {
  .figures { grid-template-columns: 1fr; }
  .figures > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .figures .value { font-size: 22px; }
}
.onboard { max-width: 720px; margin: 0 auto; }
ul.tight, ol.tight { margin: 4px 0; padding-left: 20px; }
ul.tight li, ol.tight li { margin: 3px 0; }
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.stepper li span { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; background: #eef1f3; font-size: 12px; }
.stepper li.current { color: var(--ink); border-color: var(--accent); }
.stepper li.current span { background: var(--accent); color: #fff; }
.tabs a.on { border-bottom-color: var(--amber); }
.stepper li.done span { background: #e9f5ee; color: var(--good); }
.howto { margin-top: 10px; padding: 10px 12px; background: #eef1f3; border-radius: 6px; font-size: 14px; }
.checks input[type=radio] { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 14px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tag.good { background: #e9f5ee; color: var(--good); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.formgrid label, form.plan > label, #site label, #smtp label, #pushover label { display: block; }
.formgrid input, .formgrid select, form.plan textarea, form.plan input, #site input { max-width: none; }
textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; width: 100%; box-sizing: border-box; }
input[type=number], input[type=date], input[type=time] { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; width: 100%; background: #fff; }
tr.manage td { background: #fafbfc; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; }
.announce { background: var(--amber); color: var(--amber-ink); font-weight: 600; text-align: center; padding: 8px 16px; font-size: 14px; }
h3 { font-size: 14px; margin: 18px 0 4px; }
.sso { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 4px; }
/* Xero's own Sign in with Xero button: navy #003C64, white bold label, Xero logo on the left. */
button.xero, a.btn.xero { display: inline-flex; align-items: center; justify-content: center; gap: 9px; background: #003C64; border: 1px solid #003C64; color: #fff; font-weight: 700; padding: 6px 16px 6px 6px; min-height: 40px; border-radius: 999px; -webkit-font-smoothing: antialiased; }
button.xero:hover:not(:disabled), a.btn.xero:hover { background: #002A46; border-color: #002A46; }
.sso button { width: 100%; }
.sso-row { flex-direction: row; flex-wrap: wrap; }
.sso-row button { flex: 1 1 170px; width: auto; min-height: 44px; border-radius: 999px; }
.sso-row button.xero { padding-left: 9px; }
button.wide { width: 100%; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0 4px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
pre.codes { background: #eef1f3; padding: 12px 14px; border-radius: 6px; font-size: 15px; line-height: 1.8; columns: 2; max-width: 360px; }
.instruction.none { margin-bottom: 8px; }
.protect h1 { font-size: 24px; margin-bottom: 8px; }
.protect p { margin: 10px 0; }
table.ways td { padding: 10px 4px; vertical-align: middle; }
button.link-btn { background: none; border: 0; padding: 0 4px; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
form.confirm { margin-top: 12px; gap: 8px; align-items: center; }
/* Who is signed in, and the admin colour */
.who { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.admin-badge { background: var(--amber); color: var(--amber-ink); font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; }
body.is-admin .top { background: #0E1A2B; border-bottom-color: #0E1A2B; }
body.is-admin .top .brand, body.is-admin #nav a, body.is-admin #nav button.link { color: #E7EDF6; }
body.is-admin .top .brand svg rect:not([fill="#F5B33D"]) { fill: #E7EDF6; }
body.is-admin .top .brand svg rect[fill="#fff"] { fill: #0E1A2B; }
body.is-admin #nav select { background: #1c2a40; color: #E7EDF6; border-color: #33445f; }
.support-bar { background: var(--amber); color: var(--amber-ink); text-align: center; padding: 8px 16px; font-size: 14px; }
.support-bar .link-btn { color: var(--amber-ink); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .6s; z-index: 50; }
.toast.gone { opacity: 0; }
/* Business avatars */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; overflow: hidden; flex: none; background: #fff; border: 1px solid var(--line); font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: contain; }
.avatar.initials { border: 0; }
.biz-head, .biz-cell { display: flex; gap: 12px; align-items: center; }
.invite-box { margin-top: 10px; padding: 10px 12px; background: #eef1f3; border-radius: 6px; }
.invite-box input { flex: 1 1 280px; max-width: none; font-size: 13px; }
a.secondary-btn, .btn.secondary-btn { background: var(--card); color: var(--accent); }
.file-btn { cursor: pointer; margin: 0; font-size: 15px; }
.tabs + #tabBody .card:first-child { margin-top: 16px; }
.formgrid > div { min-width: 0; }
.formgrid input { max-width: none; }
.biz-head h1 { margin: 0; }

.calc-row { border-top: 1px solid var(--line, #e5e8eb); padding: 14px 0; }
.calc-row p { margin: 6px 0; }
.calc-row select { max-width: 420px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
button.secondary-btn { background: var(--card); color: var(--accent); }
.link-btn.danger { color: var(--bad); }

/* Dashboard charts */
.dash2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash2 .card { margin: 14px 0 0; }
@media (max-width: 760px) { .dash2 { grid-template-columns: 1fr; } }
.donutwrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donutbox { width: 170px; flex: none; }
.donut { width: 100%; height: auto; display: block; }
.donut .seg { transition: stroke-dasharray 1s cubic-bezier(.2,.8,.2,1); }
.donut-big { font: 700 26px 'Bricolage Grotesque', system-ui, sans-serif; fill: var(--ink); letter-spacing: -0.02em; }
.donut-small { font-size: 12px; fill: var(--muted); }
.potlist { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 200px; }
.potlist li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #EEF1F5; font-size: 14px; }
.potlist li > span { flex: 1; }
.potlist li > span .banklabel { display: inline-flex; vertical-align: middle; }
.potlist li strong { font-variant-numeric: tabular-nums; }
.potlist li.tot { border-bottom: 0; border-top: 2px solid var(--line); margin-top: 2px; }
.potlist i, .debtline i, .legend i, i.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
i.dot { margin-right: 6px; vertical-align: -1px; }
.debtline { margin-top: 12px; padding: 8px 10px; background: #fbf1f3; border-radius: 6px; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badtxt { color: var(--bad); } .goodtxt { color: var(--good); }
.seg-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: #F6F8FA; }
.seg-toggle button { background: none; border: 0; color: var(--muted); padding: 5px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; min-height: 0; }
.seg-toggle button.on { background: var(--card); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 600; }
.chartbox { width: 100%; overflow-x: auto; }
.duechart { width: 100%; height: auto; display: block; }
.duechart .grid { stroke: #EEF1F5; } .duechart .axis0 { stroke: #C5CDD8; }
.duechart .tick { font-size: 11px; fill: var(--muted); } .duechart .tick.now { fill: var(--bad); font-weight: 600; }
.duechart .barval { font-size: 11px; fill: var(--ink); font-weight: 600; }
.duechart .stack { transform: scaleY(0); transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.duechart .stack.in { transform: scaleY(1); }
.duechart .bar { cursor: pointer; outline: none; }
.duechart .bar .hit { fill: transparent; }
.duechart .bar:hover .hit, .duechart .bar:focus .hit { fill: #F3F5F9; }
.duechart .bar.on .hit { fill: #EAF0FB; }
.duechart .resline { fill: none; stroke: var(--good); stroke-width: 2.5; stroke-linejoin: round; }
.duechart .resdot { fill: #fff; stroke: var(--good); stroke-width: 2; } .duechart .resdot.bad { stroke: var(--bad); fill: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .lineswatch { width: 16px; height: 3px; background: var(--good); border-radius: 2px; }
.picktable { margin-top: 12px; } .picktable tr.tot td { border-top: 2px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .donut .seg, .duechart .stack { transition: none; } }
@media (max-width: 760px) { .donutbox { width: 140px; margin: 0 auto; } .potlist { min-width: 100%; } }

.lblrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lblrow label { margin-bottom: 4px; }
.tagslot { display: inline-flex; align-items: center; gap: 6px; }
.src-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 7px; border-radius: 999px; white-space: nowrap; }
.src-tag svg { width: 11px; height: 11px; }
.src-tag.xero { background: #E6F4FB; color: #0B6E99; }
.src-tag.acct { background: #EEF1F5; color: var(--muted); }
.src-tag.edited { background: var(--warn-bg); color: var(--warn); }
.link-btn.small { font-size: 12px; }

/* Brand icons and bank picker */
.brandicon { display: inline-block; vertical-align: -2px; border-radius: 50%; object-fit: contain; }
.src-tag.xero { background: #E6F4FB; color: #0B6E99; gap: 5px; padding: 2px 8px 2px 3px; }
.src-tag.xero .brandicon { width: 15px; height: 15px; }
.bankicon { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 7px; overflow: hidden; background: #EEF1F5; color: var(--muted); font-weight: 700; border: 1px solid var(--line); }
.bankicon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bankicon.blank { background: #EEF1F5; color: var(--muted); font-weight: 700; border-color: transparent; }
.banklabel { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; }
.bankpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 6px 0; }
.bankopt { display: flex !important; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--card); margin: 0 !important; font-weight: 400; }
.bankopt:hover { border-color: #b9c3d3; }
.bankopt input { margin: 0; }
.bankopt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #F5F8FF; }
.bankopt .bo-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bankopt.none .bo-name { color: var(--muted); }
.inline-link { display: inline !important; cursor: pointer; margin: 0 !important; font-size: 13px; color: var(--accent); text-decoration: underline; font-weight: 400; }
.morebanks { margin: 4px 0 8px; } .morebanks summary { cursor: pointer; font-size: 13px; color: var(--accent); }

/* Site footer and page foot */
.pagefoot { margin: 18px 0 0; text-align: center; }
.appfoot { border-top: 1px solid var(--line, #e5e7eb); margin-top: 10px; }
.appfoot-in { max-width: 1100px; margin: 0 auto; padding: 18px 16px 28px; font-size: 12.5px; color: var(--muted, #6b7280); }
.appfoot .disclaimer { margin: 0 0 10px; line-height: 1.5; }
.appfoot .footrow { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.appfoot .footrow a { color: inherit; }
.sysstatus { display: inline-flex; align-items: center; gap: 6px; }
.sysstatus i { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; }
.sysstatus.warn i { background: #d97706; }
.sysstatus.down i { background: #dc2626; }
ol.steps { padding-left: 20px; margin: 10px 0; }
ol.steps li { margin: 4px 0; }
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
.appfoot-in { text-align: center; }
.appfoot .footrow { justify-content: center; }
tr.unread td { font-weight: 600; }
.msglog td { vertical-align: top; }
.msglog .nowrap { white-space: nowrap; }
.msgbody { white-space: pre-wrap; font: inherit; margin: 6px 0 0; max-width: 420px; }

/* Settings forms: 12-column grid, label above a full-width field */
.fgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 16px; }
.fgrid > label { grid-column: span 6; margin: 10px 0 0; }
.fgrid > .c2 { grid-column: span 2; } .fgrid > .c3 { grid-column: span 3; } .fgrid > .c4 { grid-column: span 4; } .fgrid > .c5 { grid-column: span 5; }
.fgrid > .c6 { grid-column: span 6; } .fgrid > .c8 { grid-column: span 8; } .fgrid > .c9 { grid-column: span 9; } .fgrid > .c12 { grid-column: 1 / -1; }
.fgrid > label > input, .fgrid > label > select { display: block; width: 100%; max-width: none; margin-top: 4px; box-sizing: border-box; }
input[type=tel], input[type=search], input:not([type]) { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; box-sizing: border-box; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.testrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid #EEF1F5; }
.testrow input { flex: 1 1 220px; max-width: 320px; }
.webhook { margin-top: 12px; padding-top: 12px; border-top: 1px solid #EEF1F5; display: grid; gap: 4px; }
.webhook code { word-break: break-all; font-size: 12.5px; background: #F5F7FA; padding: 6px 8px; border-radius: 5px; }
.filters { margin: 4px 0 12px; }
@media (max-width: 700px) { .fgrid > label { grid-column: 1 / -1 !important; } .testrow input { max-width: none; } }

/* Reminder profiles */
.rprof { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; background: #fff; }
.rprof > summary { cursor: pointer; padding: 11px 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; list-style: none; }
.rprof > summary::-webkit-details-marker { display: none; }
.rprof > summary::before { content: '\25B8'; color: var(--muted); }
.rprof[open] > summary::before { content: '\25BE'; }
.rprof[open] > summary { border-bottom: 1px solid #EEF1F5; }
.rp-name { font-weight: 600; }
.rp-sum { margin-left: auto; color: var(--muted); font-size: 13px; }
.rp-form { padding: 4px 14px 14px; }
label.locked { opacity: .55; }
.danger-link { color: #B42318; margin-left: auto; }
.tpl { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.tpl textarea, .fgrid > label > textarea { display: block; width: 100%; box-sizing: border-box; font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; margin-top: 4px; }
.tplpreview { border: 1px solid #EEF1F5; border-radius: 8px; margin-top: 10px; background: #F7F9FB; }
.tplpreview iframe { width: 100%; height: 420px; border: 0; display: block; border-radius: 8px; }
.phlist { columns: 2; font-size: 12.5px; color: var(--muted); padding-left: 18px; }
.phlist code { color: var(--ink); }
.holtable td { padding: 5px 8px; }
@media (max-width: 700px) { .phlist { columns: 1; } .rp-sum { margin-left: 0; width: 100%; } }

/* Businesses list */
.bizlist { display: grid; gap: 2px; }
.bizrow { display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 8px; color: inherit; text-decoration: none; border-bottom: 1px solid #EEF1F5; }
.bizrow:last-child { border-bottom: 0; }
.bizrow:hover { background: #F5F7FA; }
.bizname { display: grid; flex: 1; min-width: 0; }
.bizname strong { font-size: 15.5px; }

/* Billing */
.billtable td { vertical-align: middle; }
.billtable select { max-width: 220px; }
.code-pill { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; letter-spacing: .04em; }
hr.soft { border: 0; border-top: 1px solid #EEF1F5; margin: 18px 0 8px; }
.subcard { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 16px; background: var(--bg); }
.subcard h3 { margin-top: 0; }
.fintable td, .fintable th { white-space: nowrap; }
.fintable tr.strong td { font-weight: 600; border-top: 1px solid var(--line); }
.fintable tr.sel td { background: #EEF2FB; }
.fintable input { max-width: 120px; }
.neg { color: var(--bad, #B42318); }
.pos { color: var(--good, #1B7F4B); }
.finbar { gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
label.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
label.inline input { width: auto; }
dl.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; margin: 14px 0; }
dl.facts dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
dl.facts dd { margin: 2px 0 0; }
details summary { cursor: pointer; color: var(--accent); }
ul.bizmini { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
ul.bizmini li { display: flex; align-items: center; gap: 8px; }
button.xero .btn-mark { display: inline-flex; align-items: center; justify-content: center; }
button.xero .btn-mark .brandicon, button.xero > .brandicon, a.btn.xero > .brandicon { width: 26px; height: 26px; border-radius: 50%; }
button.pk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.bizrow.wide { display: grid; grid-template-columns: 40px minmax(160px, 1.3fr) 1.4fr 1.2fr 1.4fr auto; gap: 14px; align-items: center; }
.bizcol { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.bizcol .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bizcol .tag { align-self: flex-start; }
.alert-line { margin: 6px 0; padding: 8px 12px; border-radius: 8px; background: var(--bg); }
.alert-line.warn { background: var(--warn-bg); }
.alert-line.bad { background: var(--bad-bg); }
@media (max-width: 760px) { .bizrow.wide { grid-template-columns: 40px 1fr auto; } .bizrow.wide .bizcol { grid-column: 2 / 4; } }
/* Paged lists */
.pg-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.pg-bar input[type=search] { flex: 1 1 240px; max-width: 420px; }
.pg-bar select { width: auto; }
.pg-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.pg-btns { display: flex; align-items: center; gap: 6px; }
button.small-btn { padding: 5px 12px; font-size: 13px; }
tr.by-admin td { background: #F3EEFF; }
tr.by-admin td:first-child { box-shadow: inset 3px 0 0 #6D4AC7; }
.tag.putby { background: #E9E1FF; color: #4B2E9E; }
tr.by-partner td { background: #E7F6F3; }
tr.by-partner td:first-child { box-shadow: inset 3px 0 0 #1F8A78; }
.tag.partner { background: #D3EFE9; color: #145E52; }
.support-bar.partner { background: #1F8A78; color: #fff; }
.support-bar.partner .link-btn { color: #fff; }
.pname { display: inline-flex; align-items: center; gap: 8px; }
.code-inline { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; font-size: 15px; }
.pg-search { max-width: 320px; margin-bottom: 10px; }
/* Support access pop-up */
.modal-back { position: fixed; inset: 0; background: rgba(14, 26, 43, .55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal { background: #fff; border-radius: 14px; max-width: 460px; width: 100%; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal h2 { margin-top: 0; }
.modal .code-in { font-size: 28px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.code-show { font-size: 40px; font-weight: 700; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; padding: 10px; background: var(--bg); border-radius: 10px; margin: 10px 0; }
.support-live { background: #F3EEFF; color: #2E1B66; padding: 8px 16px; text-align: center; font-size: 14px; }
.subcard > h3 { margin-top: 22px; }
.actions.center { justify-content: center; }
.note.center { text-align: center; }
/* Selects match the text boxes (Safari otherwise draws its own smaller control). */
select:not([multiple]) { -webkit-appearance: none; appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b6b80' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 8px; }
.fgrid > label > input, .fgrid > label > select, .pg-bar select, .pg-bar input[type=search] { min-height: 38px; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 14px; font-size: 14px; }
.subnav a { color: var(--ink); text-decoration: none; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.subnav a:hover { border-color: var(--ink); }
.sorter { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.sorter::after { content: ''; margin-left: 4px; }
.sorter[data-dir="asc"]::after { content: '\25B2'; font-size: 9px; }
.sorter[data-dir="desc"]::after { content: '\25BC'; font-size: 9px; }
tr.removed td { color: var(--muted, #6b7785); }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea, .fgrid > label > textarea { font-size: 15px; color: var(--ink); }
.plogo { vertical-align: middle; object-fit: contain; border-radius: 3px; margin-right: 6px; background: #fff; }
.modal .plogo { display: block; margin: 0 0 10px; }
.logo-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 4px; }
.logo-edit .logo-box { min-width: 120px; height: 56px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 6px; background: #fff; padding: 4px 8px; }
.logo-edit .logo-box img { max-height: 48px; max-width: 200px; object-fit: contain; }
.disclaimer .legal { font-style: italic; font-weight: 700; font-size: 1.12em; color: var(--ink); }
.pbadges { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; vertical-align: middle; }
.pbadge { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; line-height: 1; }
.pbadge img { display: block; max-width: 110px; object-fit: contain; }
.pbadge.name { font-size: 12px; font-weight: 600; color: #145E52; background: #E7F6F3; border-color: #CBE9E2; padding: 4px 8px; }
.partner-line { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.bizname .pbadges { margin-top: 4px; }
.login .forgot { margin: 6px 0 0; text-align: right; }
.code-input { font-size: 24px; letter-spacing: 6px; font-variant-numeric: tabular-nums; max-width: 220px; }
.preview-text { white-space: pre-wrap; font: 13px/1.5 inherit; background: var(--soft, #f5f6f8); padding: 12px; border-radius: 8px; max-height: 320px; overflow: auto; }
.sec-notice { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
.warn-row td { background: #FFF7E6; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.choice { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; }
.choice h2 { margin: 0 0 6px; }
.choice p:last-child { margin-top: auto; margin-bottom: 0; text-align: center; padding-top: 12px; }
.plan-pick { display: grid; gap: 10px; }
.plan-opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.plan-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-opt.off { opacity: 0.55; cursor: not-allowed; }
.plan-opt input { margin-top: 4px; }
.plan-body { display: flex; flex-direction: column; gap: 2px; }
.instruction.warn-box { background: #FFF7E6; border-color: #F5B33D; margin-bottom: 14px; }
.centre { text-align: center; }
.signup-form { max-width: 420px; margin: 16px auto 0; }
.signup-form h2 { text-align: center; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
[hidden] { display: none !important; }
.code-input, input.code-input { text-align: center; text-indent: 6px; }
.qr-wrap { position: relative; width: 200px; height: 200px; margin: 10px auto 14px; }
.qr-wrap > img:first-child { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.qr-logo { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%); border: 4px solid #fff; border-radius: 12px; background: #fff; box-sizing: content-box; }
.totp-form { align-items: center; }
.totp-form .code-input { width: 160px; }
.skip-line { margin-top: 18px; }
.skip-line .link-btn { font-size: 14px; }
.tabs .tab-off { padding: 9px 14px; color: var(--muted); opacity: .45; font-weight: 600; font-size: 14px; cursor: not-allowed; }
.tab-alert { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; margin-left: 6px; border-radius: 50%; background: #C62828; color: #fff; font: 800 11px/1 system-ui, sans-serif; vertical-align: 1px; }
.notfound code { word-break: break-all; }

/* One button style everywhere: standalone actions are buttons, centred; links stay links only inside sentences. */
button.mini, .btn.mini { padding: 4px 12px; font-size: 13px; line-height: 1.4; }
button.danger.mini { background: var(--card); }
td button.mini, td .btn.mini { margin: 2px 4px 2px 0; }
.push-right { margin-left: auto; }
.skip-line { margin-top: 18px; }
.skip-line .form-actions { margin-top: 0; }
.skip-line p.small { margin-top: 6px; }
.card > p:has(> button:only-child), .card > p:has(> a.btn:only-child), form > p:has(> button:only-child), .card > div > p:has(> button:only-child) { text-align: center; }
p.row:has(> button), div.row.actions { justify-content: center; }
#more { justify-content: center; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.logo-actions label.btn { display: inline-block; margin: 0; color: var(--accent); cursor: pointer; font-weight: 400; }
/* Admin guide */
.guide-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.guide-bar input[type=search] { flex: 1 1 280px; max-width: none; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; }
.guide-cols { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 12px; }
.guide-toc { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; padding: 12px; font-size: 13px; }
.guide-toc .toc-h { font-weight: 700; margin: 10px 0 4px; color: var(--ink); }
.guide-toc .toc-group:first-child .toc-h { margin-top: 0; }
.guide-toc a { display: block; padding: 3px 0; color: var(--accent); text-decoration: none; }
.guide-toc a:hover { text-decoration: underline; }
.guide-group { margin: 22px 0 8px; font-size: 18px; }
.guide-group:first-child { margin-top: 0; }
.guide-sec { scroll-margin-top: 80px; transition: box-shadow .3s; }
.guide-sec.flash { box-shadow: 0 0 0 3px var(--amber); }
.guide-sec h3 { margin: 0; }
.guide-badges { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.guide-text { margin-top: 8px; line-height: 1.6; max-width: 75ch; }
.guide-text ul, .guide-text ol { padding-left: 22px; margin: 6px 0 10px; }
.guide-text li { margin: 3px 0; }
.guide-text p { margin: 6px 0 10px; }
.guide-text h4 { margin: 12px 0 4px; }
.guide-text mark { background: #FDE7B0; color: inherit; padding: 0 1px; border-radius: 2px; }
.guide-edit textarea { width: 100%; font: 14px/1.5 ui-monospace, Menlo, monospace; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.guide-edit input[type=text] { max-width: none; }
@media (max-width: 760px) { .guide-cols { grid-template-columns: 1fr; } .guide-toc { position: static; max-height: none; } }
.card form > .actions, .card form .actions:last-child { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* Stripe embedded checkout on Billing */
.stripe-checkout{min-height:420px;margin:12px 0}

/* Dashboard breakdowns (GST by return period, PAYE by due date) */
.breakdown { margin-top: 12px; border-top: 1px solid #e3e6ee; padding-top: 10px; }
.breakdown summary { cursor: pointer; font-weight: 600; }
.breakdown table { width: 100%; margin-top: 8px; }
.breakdown td { vertical-align: top; padding: 6px 4px; }
.breakdown td:nth-child(2) { white-space: nowrap; }
.breakdown tr.subtotal td { border-top: 1px solid #c9cedb; font-weight: 600; }
.breakdown tr.less td { color: #6b7280; }
.breakdown tr.total td { border-top: 2px solid #1F3A8A; font-weight: 700; }

/* What you owe now: current and arrears groups */
.potlist li.grp { border-bottom: 0; padding: 10px 0 2px; font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.potlist li.grp:first-child { padding-top: 0; }
.potlist li.sub { font-weight: 600; border-bottom: 1px solid #d5dae3; }

/* What you owe: next payment and bill list */
.nextpay { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 12px; border-bottom: 1px solid #e3e6ee; }
.nextwhat { font-size: 15px; font-weight: 600; }
.nextamt { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.bills { width: 100%; margin-top: 4px; }
table.bills td { padding: 8px 4px; border-bottom: 1px solid #eef1f5; font-size: 14px; vertical-align: middle; }
table.bills td.bdate { width: 74px; color: #6b7280; white-space: nowrap; }
table.bills td.num { white-space: nowrap; font-weight: 600; }
table.bills tr.muted-row td { color: #6b7280; }
table.bills tr.muted-row td.num { font-weight: 400; }
table.bills tr.total td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 700; }

/* Your tax commitments: four boxes */
.owehead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.owehead h2 { margin: 0; }
.owetotal { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.owegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0 4px; }
.owebox { background: #F3F5F8; border-radius: 10px; padding: 12px; }
.owebox .ob-l { font-size: 13px; color: #6b7280; }
.owebox .ob-n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
.owebox .ob-s { font-size: 12px; color: #6b7280; line-height: 1.5; font-variant-numeric: tabular-nums; }
.owebox.overdue { background: #FBECEC; }
.owebox.overdue .ob-l, .owebox.overdue .ob-n, .owebox.overdue .ob-s { color: #9B1C1C; }
.owebox.overdue.none { background: #F3F5F8; }
.owebox.overdue.none .ob-l, .owebox.overdue.none .ob-n, .owebox.overdue.none .ob-s { color: #6b7280; }
.owebox.next { background: #FDF3E1; outline: 2px solid #E9A21F; outline-offset: -2px; }
.owebox.next .ob-l, .owebox.next .ob-n, .owebox.next .ob-s { color: #7A4A06; }
.billdetail { margin-top: 10px; }

/* Tax commitments ring */
.owewrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.owering { flex: 1 1 190px; display: flex; flex-direction: column; align-items: center; }
.owehint { margin: 6px 0 0; max-width: 200px; text-align: center; font-size: 12px; }
.owedonut { width: 190px; flex: none; }
.owewrap .owegrid { flex: 999 1 260px; min-width: 260px; grid-template-columns: 1fr 1fr; margin: 0; }
.gdonut .gseg { transition: transform .18s ease, opacity .18s ease; cursor: pointer; outline: none; }
.owebox { cursor: pointer; transition: box-shadow .15s ease; }
.owebox.on { box-shadow: 0 0 0 2px #1F3A8A inset; }
.owebox .ob-l i, .tiphead i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: 0; }
.owetip { margin-top: 12px; min-height: 40px; border-top: 1px solid #e3e6ee; padding-top: 10px; }
.owetip .tiphead { display: flex; justify-content: space-between; font-weight: 600; font-size: 15px; }
.owetip p { margin: 4px 0 6px; }
@media (max-width: 760px) { .owedonut { margin: 0 auto; } }

/* Set aside by month */
.perblock { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid #e3e6ee; }
.perring { width: 110px; }
.pertitle { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.perhint { margin-top: 10px; font-size: 14px; }
@media (max-width: 760px) { .perblock { grid-template-columns: 90px 1fr; } .perring { width: 90px; } }
.instrsub { display: block; margin-top: 4px; font-size: 14px; color: #8a5a00; }
.leaveblock .bills td.num { white-space: nowrap; }
.leaveoff { margin: 0; padding: 12px 0; border-top: 1px solid #e3e6ee; }
.leavestrip { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e3e6ee; }
.ls-head { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.ls-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ls-item { background: #f3f5f8; border-radius: 10px; padding: 10px 12px; }
.ls-item.off { background: transparent; border: 1px dashed #cfd5df; }
.ls-item.off .ls-n { color: #8a92a0; }
.ls-l { font-size: 13px; color: #5b6270; }
.ls-n { font-size: 22px; font-weight: 700; margin-top: 2px; }
.leavestrip.collapsed summary { cursor: pointer; list-style-position: inside; }
.leavestrip.collapsed summary .ls-head { display: inline; margin: 0; }
.leavestrip.collapsed[open] .ls-row { margin-top: 10px; }
.leavestrip.collapsed p { margin: 8px 0 0; }
.leaveacct { margin: 0 0 4px; }
.covring .gseg { cursor: pointer; }
tr[data-ring] { transition: background .15s ease; }
tr[data-ring].hl td { background: #f3f5f8; }
tr[data-ring] { cursor: default; }
.donut .oncolor { fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.18); stroke-width: 2px; }
.donut-small.oncolor { stroke-width: 1.5px; }
.covhalo .halo-ring { opacity: .85; }
.covhalo .halo-shine { opacity: .9; transform-origin: 110px 110px; animation: haloSpin 2.4s ease-in-out 3; }
.covhalo .halo-star { animation: twinkle 2.4s ease-in-out 3 both; }
@keyframes haloSpin { from { transform: rotate(-90deg); opacity: .9; } to { transform: rotate(270deg); opacity: 0; } }
@keyframes twinkle { 0%, 100% { transform: scale(.4); opacity: .25; } 50% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .covhalo .halo-shine { display: none; } .covhalo .halo-star { animation: none; opacity: .8; } }
.moneynote { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 10px 12px; background: #FBECEC; border-radius: 10px; font-size: 13px; line-height: 1.45; color: #7a1f1f; }
.moneynote strong { color: #9B1C1C; }
/* The covered note is two lines until clicked, then shows in full. */
details.moneynote { display: block; padding: 0; }
details.moneynote > summary { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; cursor: pointer; list-style: none; border-radius: 10px; }
details.moneynote > summary::-webkit-details-marker { display: none; }
details.moneynote > summary:focus-visible { outline: 2px solid #9B1C1C; outline-offset: 2px; }
details.moneynote:not([open]) .mn-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.temppw { margin-top: 12px; padding: 12px 14px; background: #FDF3E1; border-radius: 10px; }
.temppw code { font-size: 17px; letter-spacing: .04em; padding: 4px 8px; background: #fff; border-radius: 6px; user-select: all; }
.temppw p { margin: 4px 0; }
.invlist { margin-top: 10px; }
.invlist table { margin-top: 4px; }

/* Admin, Privacy and terms */
.btn.ghost { background: var(--card); color: var(--accent); }
.legal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.legal-cards .card { margin: 0; }
.legal-card h2 { font-size: 18px; margin: 0; }
.legal-card .form-actions { justify-content: flex-start; }
.legal-history { margin-top: 10px; font-size: 14px; }
.legal-history .nowrap { white-space: nowrap; }
.legal-edit h2 { font-size: 20px; margin: 0; }
.legal-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 14px; }
.legal-fields .wide { grid-column: 1 / -1; }
.legal-fields input { max-width: none; }
.legal-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 12px; }
.legal-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.legal-src textarea { height: 64vh; min-height: 360px; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
.legal-src details { margin-top: 8px; }
.legal-preview-wrap > .small { margin-bottom: 8px; padding: 5px 0; }
.legal-preview { height: 64vh; min-height: 360px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 22px 26px; font-size: 15px; line-height: 1.6; }
.legal-preview h1 { font-size: 26px; margin: 0 0 18px; letter-spacing: -0.02em; }
.legal-preview h2 { font-size: 18px; margin: 26px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.legal-preview h3 { font-size: 15px; margin: 18px 0 6px; }
.legal-preview p, .legal-preview ul, .legal-preview ol { margin: 0 0 12px; }
.legal-preview ul, .legal-preview ol { padding-left: 22px; }
.legal-preview a { color: var(--accent); }
.legal-preview .legal-note { background: var(--bg); border-left: 4px solid var(--amber); border-radius: 0 6px 6px 0; padding: 10px 14px; margin: 14px 0; }
.legal-preview .legal-note p:last-child { margin: 0; }
.legal-preview .legal-table { overflow-x: auto; margin-bottom: 14px; }
.legal-preview table { font-size: 14px; }
.legal-preview hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.legal-edit .form-actions { justify-content: flex-start; align-items: center; }
@media (max-width: 900px) {
  .legal-split, .legal-fields { grid-template-columns: 1fr; }
  .legal-src textarea, .legal-preview { height: 46vh; }
}

/* Terms and privacy: sign-up agreement, sign-in acceptance and notices */
.modal.wide { max-width: 780px; max-height: calc(100vh - 32px); overflow: auto; }
.legal-agree { display: flex; flex-direction: column; min-height: 0; }
.legal-agree .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.legal-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0 0; }
.legal-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); font-weight: 600; padding: 8px 12px; margin-bottom: -1px; }
.legal-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.legal-doc { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 16px 20px; margin: 10px 0; background: #fbfcfd; font-size: 14px; line-height: 1.6; overflow-wrap: break-word; }
.modal .legal-doc { max-height: 42vh; }
.legal-doc h2 { font-size: 16px; margin: 20px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.legal-doc h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 6px; }
.legal-doc h3 { font-size: 14px; margin: 14px 0 4px; }
.legal-doc p, .legal-doc ul, .legal-doc ol { margin: 0 0 10px; }
.legal-doc ul, .legal-doc ol { padding-left: 20px; }
.legal-doc a { color: var(--accent); }
.legal-doc .legal-note { background: var(--bg); border-left: 4px solid var(--amber); border-radius: 0 6px 6px 0; padding: 10px 14px; margin: 12px 0; }
.legal-doc .legal-note p:last-child { margin: 0; }
.legal-doc .legal-table { overflow-x: auto; margin-bottom: 12px; }
.legal-doc table { font-size: 13px; }
.legal-change h2 { font-size: 18px; margin: 0; }
.legal-change h3 { font-size: 14px; margin: 12px 0 4px; }
.legal-changes { margin: 0 0 10px; padding-left: 20px; }
.legal-accept .form-actions { justify-content: flex-start; }
.legal-first { margin: 0 0 12px; }
.legal-notice-opts label { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: 14px; margin: 6px 0; }
.legal-notice-opts input { margin-top: 3px; }

/* Problem page: hides everything else while Putby is down or an admin has switched it on. */
body.has-problem > header, body.has-problem > main, body.has-problem > footer, body.has-problem > #announce, body.has-problem > .toast { display: none !important; }
#problem { position: fixed; inset: 0; z-index: 9999; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.problem-card { max-width: 480px; width: 100%; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--amber); border-radius: 12px; padding: 28px 24px; }
.problem-card svg { width: 36px; height: 36px; }
.problem-card h1 { font-size: 22px; margin: 14px 0 8px; }
.problem-card p { color: var(--muted); margin: 0 0 12px; }
.problem-card p.lead { color: var(--ink); }
.problem-row { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--muted); }
.problem-row button { margin-left: auto; white-space: nowrap; flex: none; }
.problem-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); flex: none; animation: problemPulse 1.6s ease-in-out infinite; }
@keyframes problemPulse { 50% { opacity: .3; } }
.incident-banner { background: var(--bad); color: #fff; font-weight: 600; text-align: center; padding: 8px 16px; font-size: 14px; }
.incident-banner a { color: #fff; }
/* Partner status page and sharing with partners */
.bad-ink { color: var(--bad); }
tr.overdue-row td { background: var(--bad-bg); }
.share-ask { display: flex; align-items: flex-start; gap: 12px; }
.share-ask .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* IRD payment plan entry: upload button and the editable schedule tables */
.plan-entry label.btn { display: inline-block; margin: 0; color: var(--accent-ink); cursor: pointer; font-weight: 400; }
table.compact td { padding-top: 3px; padding-bottom: 3px; }
table.compact input, table.compact select { margin: 0; padding: 4px 6px; width: 100%; min-width: 0; box-sizing: border-box; }
table.compact td.num input { text-align: right; max-width: 130px; }
#pf h3 { margin: 22px 0 6px; font-size: 15px; }

/* IRD page */
.ird-tiles .value { font-size: 22px; }
.filters select { width: auto; max-width: 260px; }
@media (max-width: 600px) {
  .ird-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ird-tiles .tile { padding: 10px 12px; }
  .ird-tiles .value { font-size: 18px; }
}

/* IRD bills agreement pop-up */
.modal.modal-wide { max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.modal-wide h3 { margin: 16px 0 4px; font-size: 15px; }
.modal.modal-wide ul { margin: 0; padding-left: 20px; }
.modal.modal-wide li { margin: 3px 0; }

/* Overdue box: dated items indented under their tax */
.owebox .ob-sub { padding-left: 10px; }

/* "*" note buttons beside a figure, and the note they open */
.infotip { background: none; border: 0; padding: 0 0 0 3px; margin: 0; color: var(--accent); font: inherit; font-size: 0.75em; line-height: 1; vertical-align: super; cursor: pointer; border-radius: 4px; }
.infotip:hover, .infotip[aria-expanded="true"] { color: var(--ink); }
.infotip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.infopop { margin: 8px 0 10px; padding: 10px 12px; border-radius: 8px; background: #f4f6f8; border: 1px solid #dde2e7; font-size: 13px; line-height: 1.45; color: var(--ink); }

/* Partner page: Add a client */
.add-client-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.add-client-grid h3 { margin: 4px 0 6px; font-size: 15px; }
.add-client-grid #signupLink { width: 100%; font-size: 13px; }
@media (max-width: 760px) { .add-client-grid { grid-template-columns: 1fr; } }

/* Admin, Tax rules: What Putby uses */
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { margin: 0 0 2px; }
td details summary { cursor: pointer; font-weight: 600; }
