/* Calm, editorial look: warm off-white, near-black ink, light serif headings, black pill buttons
   and soft rounded cards, kept compact. Only fonts already on the computer are used, so
   nothing is loaded from other sites. */
:root{
  --bg:#f6f4f0;--panel:#fff;--soft:#ece8e1;--fg:#1f1e1d;--muted:#6f6b66;--line:#e4dfd7;
  --ink:#1f1e1d;--on-ink:#fff;
  --accent:#1f1e1d;--accent-soft:#ece8e1;--brand:#ed8422;--on-brand:#fff;
  --ok:#2e7a57;--ok-soft:#e3f0e8;--warn:#8a6a00;--warn-soft:#f6efd2;--bad:#d1242f;--bad-soft:#fbe3e3;
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI Variable Text","Segoe UI",system-ui,"Helvetica Neue",Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --radius:12px;--side:196px;
  color-scheme:light;
}
/* Dark: follows the computer unless the sidebar switch picked one (theme.js sets data-theme) */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#141312;--panel:#1c1b19;--soft:#272522;--fg:#f3f0ea;--muted:#a39e96;--line:#2f2c28;
  --ink:#f3f0ea;--on-ink:#141312;
  --accent:#f3f0ea;--accent-soft:#272522;--brand:#f39a47;--on-brand:#1a1206;
  --ok:#6cc79a;--ok-soft:#173226;--warn:#e0c057;--warn-soft:#332c12;--bad:#ff6b63;--bad-soft:#3d1717;
  color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#141312;--panel:#1c1b19;--soft:#272522;--fg:#f3f0ea;--muted:#a39e96;--line:#2f2c28;
  --ink:#f3f0ea;--on-ink:#141312;
  --accent:#f3f0ea;--accent-soft:#272522;--brand:#f39a47;--on-brand:#1a1206;
  --ok:#6cc79a;--ok-soft:#173226;--warn:#e0c057;--warn-soft:#332c12;--bad:#ff6b63;--bad-soft:#3d1717;
  color-scheme:dark}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--fg);font:14px/1.5 var(--sans);-webkit-font-smoothing:antialiased}
a{color:var(--fg);text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:3px;
  text-decoration-thickness:1px;transition:text-decoration-color .15s}
a:hover{text-decoration-color:var(--fg)}

/* Sidebar: same background as the page (the same rules are in tracker-theme.css) */
aside.side{position:fixed;inset:0 auto 0 0;width:var(--side);z-index:20;display:flex;flex-direction:column;gap:18px;
  padding:18px 12px 14px;background:var(--bg);border-right:1px solid var(--line);overflow-y:auto}
aside.side .logo{display:block;padding:0 8px;text-decoration:none}
aside.side .logo img{display:block;width:100%;max-width:142px;height:auto}
aside.side nav{display:flex;flex-direction:column;gap:1px}
aside.side nav a{display:block;color:var(--muted);text-decoration:none;font-weight:500;font-size:13.5px;padding:6px 8px;
  border-radius:8px;transition:background .15s,color .15s}
aside.side nav a:hover{color:var(--fg);background:var(--soft)}
aside.side nav a.on{color:var(--fg);background:var(--soft)}
aside.side .foot{margin-top:auto;display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:0 8px}
aside.side .foot form{margin:0}
/* Light / dark switch (same rules in tracker-theme.css) */
.theme-switch{display:inline-flex;gap:2px;padding:2px;border-radius:999px;background:var(--soft)}
.theme-switch button{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;font-size:12.5px;border:0;
  background:transparent;color:var(--muted)}
.theme-switch button:hover{opacity:1;color:var(--fg)}
.theme-switch button[aria-pressed="true"]{background:var(--ink);color:var(--on-ink)}
.theme-switch svg{width:13px;height:13px}
aside.side .foot button{padding:5px 12px;font-size:13px}
body.with-side{padding-left:var(--side)}
@media (max-width:860px){
  body.with-side{padding-left:0}
  aside.side{position:sticky;inset:auto;top:0;width:auto;flex-direction:row;align-items:center;gap:10px;padding:8px 12px;
    border-right:0;border-bottom:1px solid var(--line);overflow-x:auto;white-space:nowrap}
  aside.side .logo{padding:0;flex:none}
  aside.side .logo img{width:100px}
  aside.side nav{flex-direction:row}
  aside.side .foot{margin:0 0 0 auto;flex-direction:row;align-items:center;padding:0}
  aside.side .qbo-status{display:none}
}

main{max-width:1120px;margin:0 auto;padding:26px clamp(14px,2.4vw,32px) 64px;display:flex;flex-direction:column;gap:16px}
body.wide main{max-width:1560px}

/* Type */
h1{font-family:var(--serif);font-weight:400;font-size:clamp(24px,3vw,32px);line-height:1.15;letter-spacing:-.015em;margin:0}
h2{font-family:var(--serif);font-weight:400;font-size:19px;line-height:1.2;letter-spacing:-.01em;margin:0}
h3{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:0}
h1 .pill{font-family:var(--sans);vertical-align:middle;margin-left:4px}
.sub{color:var(--muted);margin:4px 0 0;max-width:72ch;font-size:14px}
header.actions{align-items:flex-end}
header.actions > a,header > a{color:var(--muted);font-size:13px}

/* Surfaces */
.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;display:flex;
  flex-direction:column;gap:10px;min-width:0}
.panel h2 + .note,.panel h2 + p{margin-top:-4px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}
.two{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:16px;align-items:start}
@media (max-width:860px){.two{grid-template-columns:minmax(0,1fr)}}

/* Figures */
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:0}
.tile{padding:2px 16px 2px 0}
.tile + .tile{border-left:1px solid var(--line);padding-left:16px}
@media (max-width:560px){.tile + .tile{border-left:0;padding-left:0}.tile{padding:8px 0;border-top:1px solid var(--line)}.tile:first-child{border-top:0}}
.tile .v{font-family:var(--serif);font-size:34px;font-weight:400;line-height:1.05;letter-spacing:-.02em;font-variant-numeric:lining-nums tabular-nums}
.tile .k{font-size:12.5px;color:var(--muted);margin-top:3px}

/* Tables */
table{width:100%;border-collapse:collapse;font-size:13.5px}
th{text-align:left;font-size:11.5px;font-weight:500;color:var(--muted);padding:0 8px 6px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:7px 8px;border-bottom:1px solid var(--line);vertical-align:top}
th:first-child,td:first-child{padding-left:0}
th:last-child,td:last-child{padding-right:0}
tr:last-child td{border-bottom:0}
td.r,th.r{text-align:right}
/* Whole row opens the link in its first cell */
tr.rowlink{position:relative;cursor:pointer;transition:background .12s}
tr.rowlink:hover td{background:var(--soft)}
tr.rowlink a.stretch{text-decoration:none;font-weight:500}
tr.rowlink a.stretch::after{content:"";position:absolute;inset:0}
tr.rowlink td:first-child{border-radius:8px 0 0 8px}
tr.rowlink td:last-child{border-radius:0 8px 8px 0}
.num{font-family:var(--sans);font-variant-numeric:tabular-nums lining-nums;letter-spacing:-.005em}
.tablewrap{overflow-x:auto;margin:0 -2px;padding:0 2px}
table.days td{white-space:nowrap}
table.days td .note{white-space:normal;min-width:130px}

/* Forms */
input,select,textarea,button{font:inherit;color:inherit}
input,select,textarea{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:6px 9px;width:100%;
  min-width:0;color:var(--fg);transition:border-color .15s,box-shadow .15s}
input:hover,select:hover,textarea:hover{border-color:color-mix(in srgb,var(--fg) 25%,var(--line))}
input:disabled,select:disabled{background:var(--soft);color:var(--muted)}
input[type=file]{padding:5px;color:var(--muted);font-size:13px}
input[type=file]::file-selector-button{font:inherit;font-weight:500;color:var(--fg);background:transparent;border:1px solid var(--line);
  border-radius:999px;padding:4px 12px;margin-right:10px;cursor:pointer;transition:background .15s}
input[type=file]::file-selector-button:hover{background:var(--soft)}
textarea{font-family:var(--mono);font-size:12.5px}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:none;border-color:var(--fg);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--fg) 12%,transparent)}
button:focus-visible,a:focus-visible{outline:2px solid var(--fg);outline-offset:2px}
label{display:flex;flex-direction:column;gap:3px;font-size:12.5px;color:var(--muted);font-weight:500}
label.check{flex-direction:row;align-items:center;gap:8px;color:var(--fg);font-weight:400;font-size:13.5px}
label.check input{width:16px;height:16px;accent-color:var(--ink)}
.form{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;align-items:end}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 12px}
@media (max-width:520px){.fields{grid-template-columns:minmax(0,1fr)}}
.fields .src{font-size:10.5px;color:var(--muted);font-family:var(--mono);font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Buttons: black pills */
button{cursor:pointer;border-radius:999px;padding:7px 16px;border:1px solid var(--ink);background:var(--ink);
  color:var(--on-ink);font-weight:500;font-size:13.5px;line-height:1.2;transition:transform .1s,opacity .15s,background .15s}
button:hover{opacity:.88}
button:active{transform:scale(.98)}
button.ghost{background:transparent;color:var(--fg);border-color:var(--line)}
button.ghost:hover{background:var(--soft);opacity:1}
button.danger{background:transparent;color:var(--bad);border-color:transparent;padding-left:10px;padding-right:10px}
button.danger:hover{background:var(--bad-soft);opacity:1}
button:disabled{opacity:.4;cursor:default;transform:none}
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.actions > a{font-weight:500}

/* Messages and status */
.flash{border-radius:8px;padding:8px 12px;border:0;font-size:13.5px}
.flash.ok{background:var(--ok-soft);color:var(--fg)}
.flash.warn{background:var(--warn-soft);color:var(--fg)}
.flash.bad{background:var(--bad-soft);color:var(--fg)}
.pill{display:inline-block;font-size:11.5px;font-weight:500;padding:2px 8px;border-radius:999px;white-space:nowrap;border:0;
  background:var(--soft);color:var(--muted);line-height:1.4}
.pill.review{background:var(--warn-soft);color:var(--warn)}
.pill.approved{background:var(--soft);color:var(--fg)}
.pill.posted,.pill.ok{background:var(--ok-soft);color:var(--ok)}
.pill.bad{background:var(--bad-soft);color:var(--bad)}
.pill.muted{background:var(--soft);color:var(--muted)}
tr.fail td{background:var(--bad-soft)}
tr.warnrow td{background:var(--warn-soft)}
tr.fail td:first-child,tr.warnrow td:first-child{padding-left:8px;border-radius:8px 0 0 8px}
tr.fail td:last-child,tr.warnrow td:last-child{padding-right:8px;border-radius:0 8px 8px 0}
.mark{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:999px;font-size:10px;font-weight:700}
.mark.ok{color:var(--ok);background:var(--ok-soft)}
.mark.bad{color:var(--on-ink);background:var(--bad)}
.mark.warn{color:var(--warn);background:var(--warn-soft)}
.note{font-size:12.5px;color:var(--muted);margin:0;max-width:80ch;line-height:1.45}
td .note{margin-top:1px}

/* Documents */
iframe.pdf{width:100%;height:70vh;border:1px solid var(--line);border-radius:var(--radius);background:#fff}
details summary{cursor:pointer;color:var(--muted);font-size:13px}
pre.raw{max-height:360px;overflow:auto;font-size:11.5px;background:var(--soft);padding:10px;border-radius:8px;white-space:pre}

/* Pay stubs list: fiscal year switch and quarters */
/* Header like the salary tracker: title, year switch under it, a small card on the right */
.stubshead{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:16px 28px;align-items:start}
@media (max-width:760px){.stubshead{grid-template-columns:minmax(0,1fr)}}
.stubshead-main{display:flex;flex-direction:column;gap:12px;min-width:0}
.qbomatch{grid-column:2;justify-self:stretch;margin-top:-6px}
.qbomatch button{width:100%}
@media (max-width:760px){.qbomatch{grid-column:1}}
/* Upload card: a square drop area on the left; title, field and button on the right */
.uploadcard{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;padding:12px;align-items:stretch}
.uploadcard .uc-side{display:flex;flex-direction:column;gap:7px;min-width:0;justify-content:space-between}
.uploadcard h3{margin:0}
.dropzone.square{aspect-ratio:1;justify-content:center;padding:8px 6px;gap:2px}
.dropzone .dz-icon{width:22px;height:22px;margin-bottom:4px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;color:var(--muted)}
.dropzone.square .dz-main{font-size:12.5px}
.dropzone.square .dz-sub{font-size:11px;white-space:normal;line-height:1.25}
.dropzone.has-files .dz-icon{color:var(--ok)}
.dropzone{position:relative;display:flex;flex-direction:column;align-items:center;gap:1px;padding:14px 10px;
  border:1.5px dashed var(--line);border-radius:10px;background:var(--bg);cursor:pointer;text-align:center;
  color:var(--fg);transition:border-color .15s,background .15s}
.dropzone:hover,.dropzone.over{border-color:color-mix(in srgb,var(--fg) 40%,var(--line));background:var(--soft)}
.dropzone:focus-within{border-color:var(--fg)}
.dropzone input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%;padding:0;border:0}
.dropzone .dz-main{font-weight:500;font-size:13.5px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dropzone .dz-sub{font-size:11.5px;color:var(--muted);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dropzone.has-files{border-style:solid;border-color:var(--ok);background:var(--ok-soft)}
.doclist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.doclist li{display:flex;align-items:center;gap:8px;padding:5px 0;border-bottom:1px solid var(--line);font-size:13.5px}
.doclist li a{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.doclist li form{margin:0}
.doclist li button{padding:3px 8px;font-size:12.5px}
.docadd{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.uploadcard select{font-size:13px}
.uploadcard button{width:100%}
/* Year switch: same size, shape and type as the salary tracker's */
.fyswitch{display:inline-flex;align-self:flex-start;align-items:center;gap:4px;padding:4px;border-radius:999px;background:var(--soft);max-width:100%}
.fyswitch a{text-decoration:none;color:var(--fg);border-radius:999px}
.fyswitch .fy{display:flex;flex-direction:column;align-items:center;min-width:110px;padding:4px 12px;line-height:1.25}
.fyswitch .fy .yy{font-family:var(--sans);font-weight:500;font-size:18px}
.fyswitch .fy .fyr{font-size:11px;color:var(--muted);white-space:nowrap}
.fyswitch .fy:hover{background:color-mix(in srgb,var(--panel) 60%,transparent)}
.fyswitch .fy.on{background:var(--panel);box-shadow:0 1px 2px rgba(0,0,0,.08),0 0 0 1px var(--line)}
.fyswitch .fyarrow{display:grid;place-items:center;width:30px;height:30px;font-size:20px;line-height:1;color:var(--muted)}
.fyswitch .fyarrow:hover{background:var(--panel);color:var(--fg)}
@media (max-width:520px){.fyswitch .fy{min-width:0;padding:4px 8px}.fyswitch .fy .yy{font-size:15px}}
.fytotals{display:flex;gap:0;flex-wrap:wrap}
.fytotals > div{padding:0 16px}
.fytotals > div:first-child{padding-left:0}
.fytotals > div + div{border-left:1px solid var(--line)}
.fytotals .v{font-family:var(--serif);font-size:24px;line-height:1.1;letter-spacing:-.01em;font-variant-numeric:lining-nums tabular-nums}
.fytotals .k{font-size:12px;color:var(--muted)}
.qhead{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.qhead .qmonths{font-family:var(--sans);font-size:13px;color:var(--muted);margin-left:6px}
.qsums{display:flex}
.qsums > div{padding:0 0 0 14px;text-align:right}
.qsums > div + div{border-left:1px solid var(--line);margin-left:14px}
.qsums .v{font-family:var(--serif);font-size:19px;line-height:1.1;font-variant-numeric:lining-nums tabular-nums}
.qsums .k{font-size:11.5px;color:var(--muted)}
tr.subtotal td{border-top:1px solid var(--fg);border-bottom:0;font-weight:600;padding-top:8px}
table.qtable{table-layout:fixed;min-width:860px}
table.qtable td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
table.qtable td.wrap{white-space:normal}
table.qtable .c-cheque{width:100px}
table.qtable .c-week{width:120px}
table.qtable .c-money{width:116px}
table.qtable .c-small{width:100px}
table.qtable .c-tag{width:72px}

/* Pay stub page: the PDF on the left, the verdict on the right, all on one screen */
body.fit main{max-width:none;padding:14px clamp(12px,1.6vw,22px);gap:10px}
.stubview{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,1fr);gap:18px;align-items:start}
.pdfpane iframe.pdf{height:calc(100vh - 28px);min-height:480px;margin:0}
.side-col{display:flex;flex-direction:column;gap:12px;min-width:0;max-height:calc(100vh - 28px);overflow-y:auto;padding:2px 4px 6px 0}
.stubhead .back{color:var(--muted);font-size:13px;text-decoration:none}
.stubhead h1{font-size:clamp(22px,2.2vw,28px);margin-top:4px}
.stubhead .sub{font-size:13px;margin-top:2px}
.headrow{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap}
.netcard{text-align:right;padding:8px 14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel)}
.netcard .v{font-family:var(--serif);font-size:clamp(22px,2.2vw,28px);line-height:1.05;letter-spacing:-.02em;font-variant-numeric:lining-nums tabular-nums;white-space:nowrap}
.netcard .k{font-size:12px;color:var(--muted);margin-top:2px}
.figs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.figs.four{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:520px){.figs.four{grid-template-columns:repeat(2,minmax(0,1fr))}.figs.four > div:nth-child(3){border-left:0;padding-left:0}}
.figs > div{padding:9px 10px 9px 0}
.figs > div + div{border-left:1px solid var(--line);padding-left:10px}
.figs .v{font-family:var(--serif);font-size:clamp(17px,1.7vw,22px);line-height:1.05;letter-spacing:-.02em;font-variant-numeric:lining-nums tabular-nums;white-space:nowrap}
.figs .k{font-size:12px;color:var(--muted);margin-top:2px}
.verdict{border-radius:var(--radius);padding:12px 14px;display:flex;flex-direction:column;gap:8px}
.verdict.ok{background:var(--ok-soft)}
.verdict.warn{background:var(--warn-soft)}
.verdict.bad{background:var(--bad-soft)}
.verdict h2{font-size:18px}
.verdict.ok h2::before{content:"✓";display:inline-grid;place-items:center;width:20px;height:20px;margin-right:8px;border-radius:999px;
  background:var(--ok);color:var(--on-ink);font:700 11px var(--sans);vertical-align:2px}
.problems{list-style:none;margin:0;padding:0 4px 0 0;display:flex;flex-direction:column;gap:6px;max-height:42vh;overflow-y:auto}
.problems li{display:flex;flex-direction:column;gap:1px;padding:7px 10px;border-radius:8px;background:var(--panel);font-size:13px}
.problems li.error{box-shadow:inset 3px 0 0 var(--bad)}
.problems li.warn{box-shadow:inset 3px 0 0 var(--warn)}
.problems li b{font-weight:600}
.options{display:flex;flex-direction:column;gap:6px}
.options label.check{align-items:flex-start}
.options label.check input{margin-top:2px;flex:none}
.options small{display:block;font-size:11.5px;color:var(--muted)}
details.more{border-top:1px solid var(--line);padding-top:10px}
details.more[open]{display:flex;flex-direction:column;gap:10px}
details.more summary{font-weight:500}
.actions.small button{padding:5px 12px;font-size:13px}
@media (max-width:960px){
  .stubview{grid-template-columns:minmax(0,1fr)}
  .side-col{max-height:none;overflow:visible;order:-1}
  .pdfpane iframe.pdf{height:75vh}
}

/* Sign in */
.login{max-width:360px;margin:14vh auto 0;padding:0 16px}
.login .panel{padding:26px 24px;gap:14px}
.login h1{font-size:28px}
.login-logo{display:block;width:150px;height:auto}
.login button{width:100%;padding:9px}
.empty{color:var(--muted);text-align:center;padding:18px 10px}

@media (prefers-reduced-motion:reduce){*{transition:none!important}}
/* Dismissing a problem on a pay stub */
.problems details.dismiss{margin-top:3px;font-size:12px}
.problems details.dismiss summary{cursor:pointer;color:var(--muted);list-style:none;width:max-content}
.problems details.dismiss summary::-webkit-details-marker{display:none}
.problems details.dismiss summary:hover{color:var(--fg)}
.problems details.dismiss[open]{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.problems details.dismiss[open] summary{flex-basis:100%}
.problems details.dismiss input{flex:1;min-width:160px;font-size:12px;padding:4px 8px}
.problems button.ghost{padding:3px 10px;font-size:12px;width:max-content}
.problems li.muted{opacity:.75}
details.dismissed{margin-top:8px}
details.dismissed summary{cursor:pointer;font-size:12.5px;color:var(--muted)}
details.dismissed .problems{margin-top:6px}
/* Keep a long file name inside the square: wrap it over up to three lines, never widen the box */
.uploadcard .dropzone.square{min-width:0;width:100%;overflow:hidden}
.dropzone.square .dz-main{white-space:normal;overflow-wrap:anywhere;line-height:1.2;display:-webkit-box;
  -webkit-box-orient:vertical;-webkit-line-clamp:3;font-size:11.5px}
.dropzone.square.has-files .dz-sub{display:none}
/* Brief confirmation after posting: bottom centre, fades in and out */
.toast{position:fixed;left:50%;bottom:28px;z-index:50;display:flex;align-items:center;gap:12px;
  max-width:min(460px,calc(100vw - 32px));padding:12px 18px 12px 14px;border-radius:12px;cursor:pointer;
  background:var(--fg);color:var(--bg);box-shadow:0 10px 30px rgba(0,0,0,.25);
  opacity:0;transform:translate(-50%,12px);transition:opacity .3s,transform .3s}
.toast.shown{opacity:1;transform:translate(-50%,0)}
.toast.leaving{opacity:0;transform:translate(-50%,12px)}
.toast svg{width:22px;height:22px;flex:none;fill:none;stroke:var(--ok);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.toast b{display:block;font-weight:600;font-size:14px}
.toast span{display:block;font-size:12.5px;opacity:.75}
@media (prefers-reduced-motion:reduce){.toast{transition:none}}
/* Stub page: actions kept at the bottom of the side column */
@media (min-width:961px){.side-col{height:calc(100vh - 28px)}.stubfoot{position:sticky;bottom:-6px}}
.stubfoot{margin-top:auto;display:flex;align-items:center;gap:8px;
  padding:12px 0 8px;border-top:1px solid var(--line);background:var(--bg)}
.stubfoot button{padding:6px 14px;font-size:13px}
.stubfoot button.danger.solid{margin-left:auto}
button.danger.solid{background:var(--bad);border-color:var(--bad);color:#fff;padding-left:16px;padding-right:16px}
button.danger.solid:hover{background:var(--bad);opacity:.88}
/* Sidebar: QuickBooks status under the logo; light/dark switch as icons at the bottom */
aside.side .qbo-status{display:block;padding:0 8px;margin-top:-8px;text-decoration:none;line-height:1}
aside.side .qbo-status .pill{display:inline-block;font-size:11.5px;font-weight:500;padding:2px 8px;border-radius:999px;white-space:nowrap}
aside.side .qbo-status .pill.ok{background:color-mix(in srgb,var(--ok) 16%,transparent);color:var(--ok)}
aside.side .qbo-status .pill.muted{background:var(--soft);color:var(--muted)}
aside.side .qbo-status:hover .pill{filter:brightness(1.08)}
.theme-switch button{padding:5px 9px}
.theme-switch svg{width:14px;height:14px}
.panel.signout{flex-direction:row;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.panel.signout h2{margin:0 0 2px}
.panel.signout form{margin:0}
/* Dashboard: rows of cards; each card opens its page */
.cardrow{display:flex;flex-direction:column;gap:8px}
.cardrow .rowhead{font-family:var(--sans);font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted);margin:6px 2px 0}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}
a.card{display:flex;flex-direction:column;gap:3px;padding:16px 18px;border-radius:var(--radius);background:var(--panel);
  border:1px solid var(--line);color:var(--fg);text-decoration:none;min-width:0;
  transition:border-color .15s,box-shadow .15s,transform .15s}
a.card:hover{border-color:color-mix(in srgb,var(--fg) 25%,var(--line));box-shadow:0 4px 16px rgba(0,0,0,.06)}
a.card:active{transform:scale(.995)}
a.card .k{font-size:12.5px;color:var(--muted);font-weight:500}
a.card .v{font-family:var(--serif);font-size:32px;line-height:1.1;letter-spacing:-.02em;margin:4px 0 2px;
  font-variant-numeric:lining-nums tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
a.card .s{font-size:12.5px;color:var(--muted)}
a.card .s.ok{color:var(--ok);font-weight:500}
a.card .s.bad{color:var(--bad)}
a.card .faint{opacity:.7}
a.card.alert{border-color:color-mix(in srgb,var(--bad) 40%,var(--line))}
a.card.alert .v{color:var(--bad)}
/* Dashboard rows: four columns; the draws card spans two. Cards are centred: label at the top,
   the number in the middle, a short note at the bottom. */
.cards.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.cards.four .card.wide{grid-column:span 2}
@media (max-width:1100px){.cards.four{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:620px){.cards.four{grid-template-columns:minmax(0,1fr)}.cards.four .card.wide{grid-column:auto}}
.cards.four a.card{align-items:center;justify-content:space-between;text-align:center;min-height:150px;padding:18px 16px;gap:8px}
.cards.four a.card .v{font-size:36px;margin:0}
a.card.draws{flex-direction:row;align-items:stretch;gap:18px;text-align:left}
a.card.draws .dr-main{flex:1 1 0;display:flex;flex-direction:column;align-items:center;justify-content:space-between;text-align:center;gap:8px}
a.card.draws .dr-side{flex:1.2 1 0;display:flex;flex-direction:column;justify-content:center;gap:6px;min-width:0;
  border-left:1px solid var(--line);padding-left:18px}
a.card.draws .dr-box{display:flex;flex-direction:column;gap:2px;background:var(--soft);border-radius:10px;padding:10px 12px;font-size:13px}
a.card.draws .dr-box.quiet{align-items:center;justify-content:center;text-align:center;flex:1}
a.card.draws .dr-box.quiet span{color:var(--muted)}
a.card.draws .dr-box.new{background:var(--ok-soft)}
a.card.draws .dr-box ul{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-direction:column;gap:2px}
a.card.draws .dr-box li{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:10px;text-align:left;white-space:nowrap}
a.card.draws .dr-box li span:nth-child(2){overflow:hidden;text-overflow:ellipsis}
a.card.draws .dr-box.new b{text-align:center}
a.card.draws .dr-status{text-align:center}
@media (max-width:620px){a.card.draws{flex-direction:column}a.card.draws .dr-side{border-left:0;padding-left:0;border-top:1px solid var(--line);padding-top:12px}}
/* Salary tracker row: the draws card across the full width, then two half-width cards */
.cards.four .card.full{grid-column:1 / -1}
.cards.four .card.half{grid-column:span 2}
a.card.draws.full .dr-main{flex:1 1 0;justify-content:center;gap:10px}
a.card.draws.full .dr-side{flex:1.4 1 0;padding-left:24px}
a.card.draws.full .v{font-size:44px}
a.card.draws.full{min-height:170px;padding:22px 24px}
@media (max-width:620px){.cards.four .card.half{grid-column:auto}}
a.card.draws.full .dr-side{align-items:center}
a.card.draws.full .dr-box{width:100%;max-width:440px}
@media (max-width:1100px) and (min-width:621px){.cards.four .card.half{grid-column:span 1}}
/* Salary tracker row on a six-column grid: the draws card full width, then three cards a third wide */
.cards.six{display:grid;grid-template-columns:repeat(6,minmax(0,1fr))}
.cards.six .card.full{grid-column:1 / -1}
.cards.six .card.third{grid-column:span 2}
.cards.six a.card{align-items:center;justify-content:space-between;text-align:center;min-height:150px;padding:18px 16px;gap:8px}
.cards.six a.card .v{font-size:36px;margin:0}
.cards.six a.card.draws{align-items:stretch;text-align:left}
a.card.alert .v{color:var(--bad)}
@media (max-width:1100px) and (min-width:621px){.cards.six{grid-template-columns:repeat(3,minmax(0,1fr))}.cards.six .card.third{grid-column:span 1}}
@media (max-width:620px){.cards.six{grid-template-columns:minmax(0,1fr)}.cards.six .card.third,.cards.six .card.full{grid-column:auto}}
/* Draw room speedometer: a square card, the dial on top and the number below */
.cards.six a.card.gauge{aspect-ratio:1/1;min-height:0;justify-content:space-between}
a.card.gauge .dial{width:88%;max-width:260px;height:auto;display:block;margin:4px auto 0;overflow:visible}
a.card.gauge .dial .track{fill:none;stroke:var(--soft);stroke-width:16;stroke-linecap:round}
a.card.gauge .dial .fill{fill:none;stroke:var(--ok);stroke-width:16;stroke-linecap:round}
a.card.gauge .dial.warn .fill{stroke:var(--warn)}
a.card.gauge .dial.bad .fill{stroke:var(--bad)}
a.card.gauge .dial .needle{stroke:var(--fg);stroke-width:3;stroke-linecap:round}
a.card.gauge .dial .hub{fill:var(--fg)}
a.card.gauge .dial .end{font-size:11px;fill:var(--muted);font-family:var(--sans)}
@media (max-width:620px){.cards.six a.card.gauge{aspect-ratio:auto}}
a.card.gauge .dial .track{stroke:color-mix(in srgb,var(--fg) 12%,transparent)}
.cards.six a.card.third .v{font-size:42px}
/* Pay stubs header: the title across the top, then the year switch and totals beside the upload card */
.stubshead > h1{grid-column:1 / -1;margin:0}
.stubshead-main{gap:20px;padding-top:2px}
/* Year switch: bigger years, the selected one bold in ECS orange (same on the salary tracker) */
.fyswitch{gap:6px;padding:5px}
.fyswitch .fy{min-width:128px;padding:7px 16px}
.fyswitch .fy .yy{font-size:23px;font-weight:400;letter-spacing:-.01em}
.fyswitch .fy .fyr{font-size:11.5px}
.fyswitch .fy.on{background:var(--brand);color:var(--on-brand);box-shadow:none}
.fyswitch .fy.on .yy{font-weight:700}
.fyswitch .fy.on .fyr{color:var(--on-brand);opacity:.85}
.fyswitch .fyarrow{width:34px;height:34px}
.fytotals > div{padding:0 22px}
.fytotals .v{font-size:28px}
.fytotals .k{margin-top:2px}
@media (max-width:520px){.fyswitch .fy{min-width:0;padding:5px 10px}.fyswitch .fy .yy{font-size:17px}}
@media (max-width:520px){.fyswitch{gap:2px;padding:3px}.fyswitch .fy{padding:4px 7px}.fyswitch .fy .yy{font-size:16px}
  .fyswitch .fy .fyr{font-size:9.5px}.fyswitch .fyarrow{width:24px;height:24px;font-size:17px}
  .fytotals > div{padding:0 12px}.fytotals .v{font-size:22px}}
/* Salary tracker row: two pairs. Draws (two thirds) with the draw room gauge, then source deductions
   (two thirds) with the cost of $1 drawn. */
.cards.six .card.span4{grid-column:span 4}
@media (max-width:1100px) and (min-width:621px){.cards.six .card.span4{grid-column:span 2}}
@media (max-width:620px){.cards.six .card.span4{grid-column:auto}}
/* Dashboard, salary tracker section: the QuickBooks list across the top, then three cards */
a.card.feedcard{align-items:stretch;text-align:left;gap:10px;padding:16px 20px}
.feedcard .fc-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.feedcard .fc-head .s{font-size:12.5px}
.feedcard .fc-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.feedcard .fc-list li{display:grid;grid-template-columns:62px 92px minmax(0,1fr) auto;gap:12px;align-items:center;
  padding:7px 0;border-top:1px solid var(--line);font-size:13.5px}
.feedcard .fc-list li:first-child{border-top:0}
.feedcard .note{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.feedcard .amt{text-align:right}
.feedcard .tag{justify-self:start;font-size:11.5px;font-weight:500;padding:2px 8px;border-radius:999px}
.feedcard .tag.draw{background:color-mix(in srgb,var(--brand) 16%,transparent);color:color-mix(in srgb,var(--brand) 75%,var(--fg))}
.feedcard .tag.remittance{background:var(--soft);color:var(--fg)}
.feedcard .fc-empty{margin:0;font-size:13px;color:var(--muted)}
@media (max-width:620px){.feedcard .fc-list li{grid-template-columns:52px minmax(0,1fr) auto}.feedcard .note{display:none}}
.cards.three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
@media (max-width:760px){.cards.three{grid-template-columns:minmax(0,1fr)}}
.cards.three a.card{align-items:center;justify-content:space-between;text-align:center;min-height:150px;padding:18px 16px;gap:8px}
.cards.three a.card .v{font-size:42px;margin:0}
/* Draws gauge: 240-degree arc in green / gold / red zones, drawn part solid, an arrow above it */
.cards.three a.card.gauge{aspect-ratio:1/1;min-height:0}
@media (max-width:760px){.cards.three a.card.gauge{aspect-ratio:auto}}
.dial-wrap{position:relative;width:92%;max-width:300px}
.dial-wrap .dial{display:block;width:100%;height:auto;overflow:visible}
.dial path{fill:none;stroke-width:15;stroke-linecap:butt}
.dial path.ok{stroke:#2fa36b}
.dial path.warn{stroke:#e2b528}
.dial path.bad{stroke:#d9433c}
.dial path.rest{opacity:.22}
.dial .pointer{fill:var(--fg)}
.dial-mid{position:absolute;left:0;right:0;top:43%;transform:translateY(-50%);display:flex;flex-direction:column;align-items:center;gap:2px}
.cards.three a.card.gauge .dial-mid .v{font-size:32px}
.cards.three a.card.gauge .room b{color:var(--fg);font-weight:600}
.cards.three a.card.gauge .room.warn b{color:#b8901a}
.cards.three a.card.gauge .room.bad,.cards.three a.card.gauge .room.bad b{color:var(--bad)}
.dial-wrap{width:100%;max-width:340px}
.cards.three a.card.gauge .dial-mid .v{font-size:clamp(22px,2.4vw,34px)}
.dial path{stroke-width:16}
/* Bigger arc, number the same size as the other cards */
.dial-wrap{width:100%;max-width:400px}
.dial path{stroke-width:14}
.dial-mid{top:71%}
.cards.three a.card.gauge .dial-mid .v{font-size:42px}
/* Keep the gauge number inside the arc on narrower cards; full size (42px) when there's room */
.cards.three a.card.gauge{container-type:inline-size}
.cards.three a.card.gauge .dial-mid .v{font-size:min(42px,13.5cqi)}
/* Salary tracker cards: the gauge 2x2 on the left, source deductions and $1 cost stacked on the right */
.cards.trk{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(170px,auto);gap:12px}
.cards.trk a.card{align-items:center;justify-content:space-between;text-align:center;padding:18px 16px;gap:8px}
.cards.trk a.card .v{font-size:42px;margin:0}
.cards.trk a.card.gauge{grid-column:1 / span 2;grid-row:1 / span 2;justify-content:space-between}
.cards.trk a.card.wide2{grid-column:span 2}
@media (max-width:760px){.cards.trk{grid-template-columns:minmax(0,1fr)}
  .cards.trk a.card.gauge,.cards.trk a.card.wide2{grid-column:auto;grid-row:auto}}
.cards.trk .dial-wrap{position:relative;width:min(100%,330px);margin:auto 0}
.cards.trk .dial-wrap .dial{width:100%;height:auto;display:block;overflow:visible}
.cards.trk .dial-mid{position:absolute;left:0;right:0;top:56%;transform:translateY(-50%);display:flex;flex-direction:column;align-items:center;gap:2px}
.cards.trk a.card.gauge .dial-mid .v{font-size:42px}
.cards.trk a.card.gauge .room b{color:var(--fg);font-weight:600}
.cards.trk a.card.gauge .room.warn b{color:#b8901a}
.cards.trk a.card.gauge .room.bad,.cards.trk a.card.gauge .room.bad b{color:var(--bad)}
.cards.trk .dial-wrap{width:min(100%,440px)}
.cardrow{gap:12px}
/* QuickBooks list: not a link (it has a button), so no hover lift */
div.card.feedcard{display:flex;flex-direction:column;gap:10px;padding:16px 20px;border-radius:var(--radius);
  background:var(--panel);border:1px solid var(--line);text-align:left}
.feedcard .fc-more{align-self:center;padding:5px 16px;font-size:13px}
.feedcard .fc-list li[hidden]{display:none}
div.card.feedcard .k{font-size:12.5px;color:var(--muted);font-weight:500}
div.card.feedcard .s{font-size:12.5px;color:var(--muted)}
div.card.feedcard .s.bad{color:var(--bad)}
/* Draw and Remittance pills: the same width, centred; remittances green, draws red */
.feedcard .tag{width:96px;text-align:center;justify-self:start}
.feedcard .tag.remittance{background:var(--ok-soft);color:var(--ok)}
.feedcard .tag.draw{background:var(--bad-soft);color:var(--bad)}
.feedcard .fc-list li{grid-template-columns:62px 100px minmax(0,1fr) auto}
@media (max-width:620px){.feedcard .fc-list li{grid-template-columns:52px 100px auto}}
/* Reserve the scrollbar space on every page, so content does not shift between short and long pages */
html{scrollbar-gutter:stable}
/* Passkeys: sign-in button and the Settings section */
.login .passkey-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:10px;background:var(--brand);border-color:var(--brand);color:var(--on-brand);font-weight:600}
.login .passkey-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.login .or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px}
.login .or::before,.login .or::after{content:"";flex:1;border-top:1px solid var(--line)}
.login [data-passkey-msg]:empty{display:none}
.passkey-add{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.passkey-add input{max-width:220px}
table.passkeys td form{margin:0}
/* Sign-in: logo centred, "Password" label centred; the password hides behind a link once a passkey is set up */
.login .panel{align-items:center;text-align:center}
.login .login-logo{margin:0 auto 4px}
.login .pw{display:flex;flex-direction:column;gap:12px;width:100%}
.login .pw[hidden]{display:none}
.login .pw label{text-align:center}
.login .pw input{text-align:left}
.login .flash,.login .passkey-btn{width:100%}
.login .pw-toggle{background:none;border:0;color:var(--muted);font-size:12.5px;padding:2px;width:auto;text-decoration:underline;text-underline-offset:3px}
.login .pw-toggle:hover{color:var(--fg);opacity:1}
/* Sign-in card: square, contents centred; it grows taller only if the password is shown and needs the room */
.login .panel{aspect-ratio:1/1;justify-content:center;padding:28px 26px}
.login .login-title{margin:-4px 0 6px;font-family:var(--serif);font-size:21px;letter-spacing:-.01em;color:var(--fg)}
/* More room around the passkey button: the logo and title move up, the password link down */
.login .passkey-btn{margin:20px 0 16px}
