/*
  Daybook: time tracking and invoicing for one freelance illustrator (Screenery template)
  Letterpress stationery: cream stock, warm black ink, one vermilion used only for what needs attention
  (running timer, overdue money, VAT set aside, the total due). Libre Bodoni sets display and figures; Hedvig Letters Sans the UI.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Primitives: icons, buttons, fields, switch, tables, status
   4. App shell: sidebar, header, banner, tab bar
   5. Desk: timer, statement, unbilled, awaiting, chart
   6. Timesheet
   7. Invoices list
   8. Builder
   9. Income
  10. Invoice sheet (stationery) and stamp
  11. Drawer, dialogs, toast
  12. Loading, error, empty, no-JS
  13. Narrow screens
  14. Motion and print
*/

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;

  /* Stock and ink */
  --stock: #f1e9d8;        /* cream board the app is printed on */
  --stock-2: #ebe1cc;      /* a shade deeper: sidebar, table heads */
  --paper: #faf6ec;        /* the invoice sheet, a brighter laid paper */
  --ink: #221d19;          /* warm black */
  --ink-2: #4f463e;        /* secondary text, 7.6:1 on stock */
  --ink-3: #6a5f55;        /* quiet text, 5.1:1 on stock */
  --rule: rgba(34, 29, 25, .2);
  --rule-2: rgba(34, 29, 25, .36);
  --press: rgba(255, 252, 244, .75);   /* the light lip under debossed type */

  /* The one vermilion */
  --red: #b3321b;          /* 5.2:1 on stock, carries text */
  --red-soft: rgba(179, 50, 27, .1);
  --red-hatch: rgba(179, 50, 27, .55);

  /* Type */
  --display: "Libre Bodoni", "Bodoni 72", Didot, Georgia, serif;
  --sans: "Hedvig Letters Sans", ui-sans-serif, system-ui, sans-serif;
  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs: 14px;
  --fs-md: 16px;
  --fs-lg: 21px;
  --fs-xl: 30px;
  --track: .12em;          /* tracking for small capitals */

  /* Space, radius, size */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --r: 2px;
  --side-w: 236px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* A faint paper grain: fractal noise baked into an SVG */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35  0 0 0 0 .28  0 0 0 0 .2  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--stock) var(--grain);
  color: var(--ink);
  font: var(--fs)/1.5 var(--sans);
  font-variant-numeric: tabular-nums lining-nums;
  caret-color: var(--red);
  accent-color: var(--ink);
  scrollbar-color: var(--rule-2) transparent;
}
::selection { background: rgba(179, 50, 27, .2); color: var(--ink); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a, .link { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
kbd { font: 11px/1 var(--sans); border: 1px solid var(--rule-2); border-radius: var(--r); padding: 2px 5px; color: var(--ink-2); background: var(--paper); }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--stock); padding: 8px 12px; }
.skip:focus { top: 8px; }
.defs { position: absolute; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-2); border: 3px solid var(--stock); border-radius: 6px; }

/* ---------- 3. Primitives ---------- */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: square; stroke-linejoin: miter; }
.small-h { font: var(--fs-xs)/1.3 var(--sans); letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-2); }
.h2 { font: 600 var(--fs-lg)/1.2 var(--display); letter-spacing: -.005em; text-wrap: balance; text-shadow: 0 1px 0 var(--press); }
.muted { color: var(--ink-3); }
.red { color: var(--red); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--ink); border-radius: var(--r);
  background: transparent; color: var(--ink);
  font-size: var(--fs-sm); letter-spacing: .04em;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { background: rgba(34, 29, 25, .06); }
.btn:active { box-shadow: inset 0 2px 3px rgba(34, 29, 25, .18); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ink { background: var(--ink); color: var(--stock); }
.btn-ink:hover { background: #3a322b; }
.btn-red { background: var(--red); border-color: var(--red); color: #fbf4ea; }
.btn-red:hover { background: #982a16; }
.btn-quiet { border-color: var(--rule-2); }
.btn-icon { width: 38px; padding: 0; border-color: transparent; }
.btn-icon:hover { border-color: var(--rule-2); }
.btn-small { min-height: 30px; padding: 0 10px; font-size: var(--fs-xs); }
.btn-icon.btn-small { width: 30px; }

.select, input[type="text"], input[type="date"], input[type="number"], input[type="search"], textarea {
  width: 100%; min-height: 40px; padding: 8px 10px;
  background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r);
  box-shadow: inset 0 1px 2px rgba(34, 29, 25, .08);
}
.select { appearance: none; padding-right: 30px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%23221d19' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; }
input:hover, .select:hover, textarea:hover { border-color: var(--ink-3); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
[aria-invalid="true"] { border-color: var(--red) !important; background-color: #fbefe6 !important; }
textarea { resize: vertical; min-height: 64px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-size: var(--fs-sm); color: var(--ink-2); }
.opt { color: var(--ink-3); font-size: var(--fs-xs); margin-left: 4px; }
.field-row { display: grid; gap: var(--s4); }
.field-row.two { grid-template-columns: 1fr 1fr; }
.err { color: var(--red); font-size: var(--fs-sm); min-height: 0; }
.err:empty { display: none; }
.hint { color: var(--ink-3); font-size: var(--fs-sm); }
.hint:empty { display: none; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 32px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 34px; height: 18px; border: 1px solid var(--ink); border-radius: 10px; position: relative; flex: none; transition: background .2s var(--ease); }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); transition: transform .25s var(--ease), background .2s; }
.switch input:checked + .switch-track { background: var(--ink); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: var(--stock); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--ink); outline-offset: 2px; }

.tbl-frame { overflow-x: auto; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs); }
.tbl th, .tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl thead th { font-size: var(--fs-xs); font-weight: 400; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--ink); white-space: nowrap; }
.tbl tbody th { font-weight: 400; }
.tbl tfoot th, .tbl tfoot td { border-top: 3px double var(--ink); border-bottom: 0; font-family: var(--display); font-weight: 600; font-size: var(--fs-md); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.tbl .act { text-align: right; width: 1%; }
.empty-cell { color: var(--ink-2); padding: 24px 10px !important; }

.status { display: inline-block; font-size: var(--fs-xs); letter-spacing: var(--track); text-transform: uppercase; padding: 2px 7px; border: 1px solid var(--rule-2); border-radius: var(--r); white-space: nowrap; font-family: var(--sans); font-weight: 400; vertical-align: middle; }
.s-draft { border-style: dashed; color: var(--ink-2); }
.s-sent { border-color: var(--ink); }
.s-paid { background: var(--ink); border-color: var(--ink); color: var(--stock); }
.s-overdue { border-color: var(--red); color: var(--red); background: var(--red-soft); }

/* ---------- 4. App shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s6);
  padding: var(--s6) var(--s5) 76px;
  background: var(--stock-2) var(--grain);
  border-right: 1px solid var(--rule-2);
}
.mark { display: grid; gap: 2px; padding-bottom: var(--s4); border-bottom: 3px double var(--ink); }
.mark-word { font: 700 30px/1 var(--display); letter-spacing: -.01em; text-shadow: 0 1px 0 var(--press); }
.mark-word::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 3px; background: var(--red); border-radius: 50%; }
.mark-who { font: italic 400 var(--fs-sm)/1.3 var(--display); color: var(--ink-2); }
.nav { display: grid; gap: 2px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px;
  background: none; border: 1px solid transparent; border-radius: var(--r); text-align: left;
  color: var(--ink-2); transition: background .15s, color .15s;
}
.nav-btn span { flex: 1; }
.nav-btn kbd { opacity: 0; transition: opacity .15s; }
.nav-btn:hover { background: rgba(34, 29, 25, .05); color: var(--ink); }
.nav-btn:hover kbd, .nav-btn:focus-visible kbd { opacity: 1; }
.nav-btn[aria-current] { color: var(--ink); border-color: var(--ink); background: var(--paper); }
.nav-count { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fbf4ea; font: 600 11px/20px var(--sans); text-align: center; }
.vat-box { display: grid; gap: 8px; padding-top: var(--s4); border-top: 1px solid var(--rule-2); }
.vat-note { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.45; }
.sync { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: var(--fs-xs); color: var(--ink-2); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.sync.off .sync-dot { background: transparent; border: 1px solid var(--red); }
.sync.off { color: var(--red); }
.side-keys { font-size: var(--fs-xs); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }

.main { min-width: 0; padding: 0 var(--s8) var(--s10); outline: none; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
  margin: 0 calc(var(--s8) * -1); padding: var(--s6) var(--s8) var(--s4);
  background: var(--stock) var(--grain);
  border-bottom: 1px solid var(--ink);
  box-shadow: 0 1px 0 var(--press);
}
.top h1 { font: 700 var(--fs-xl)/1 var(--display); letter-spacing: -.015em; text-shadow: 0 1px 0 var(--press); }
.top-date { margin-top: 6px; font: italic var(--fs-sm)/1.3 var(--display); color: var(--ink-2); }
.top-tools { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.range { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--r); }
.range button { min-height: 34px; padding: 0 12px; border: 0; background: none; font-size: var(--fs-sm); color: var(--ink-2); }
.range button + button { border-left: 1px solid var(--rule-2); }
.range button[aria-checked="true"] { background: var(--ink); color: var(--stock); }
[data-view="desk"] .chip-timer { display: none; }
.chip-timer {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 4px 0 12px; max-width: 340px;
  border: 1px solid var(--red); border-radius: var(--r); background: var(--paper); color: var(--ink);
  justify-content: flex-start; text-align: left;
}
.chip-time { font: 600 var(--fs-md)/1 var(--display); min-width: 4.6ch; }
.chip-proj { font-size: var(--fs-xs); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip-stop { background: var(--red); color: #fbf4ea; padding: 5px 9px; border-radius: 1px; font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }

.banner { display: flex; gap: var(--s3); align-items: center; margin-top: var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--red); background: var(--red-soft); color: var(--ink); border-radius: var(--r); }
.banner .i { color: var(--red); }
.banner p { flex: 1; font-size: var(--fs-sm); }
.banner strong { color: var(--red); font-weight: 400; letter-spacing: .04em; }

.view { padding-top: var(--s6); }
.tabbar { display: none; }

.block { padding-top: var(--s4); border-top: 1px solid var(--ink); display: grid; gap: var(--s3); align-content: start; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4); flex-wrap: wrap; }
.block-meta { color: var(--ink-2); font-size: var(--fs-sm); }

/* ---------- 5. Desk ---------- */
.desk { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: var(--s8) var(--s10); align-items: start; }
.desk-right { display: grid; gap: var(--s8); }
.desk-chart { grid-column: 1 / -1; }

.press {
  position: sticky; top: 120px;
  display: grid; gap: var(--s3);
  padding: var(--s5) var(--s5) var(--s4);
  background: var(--paper);
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink); outline-offset: 3px;    /* a printer's double border */
  box-shadow: 0 10px 24px -14px rgba(34, 29, 25, .35);
}
.press-time { font: 500 clamp(52px, 5.4vw, 72px)/1 var(--display); letter-spacing: -.02em; display: flex; align-items: baseline; text-shadow: 0 1px 0 var(--press); color: var(--ink-3); }
.press-time span { display: inline-block; width: .62em; text-align: center; }
.press-time i { font-style: normal; width: .3em; text-align: center; position: relative; top: -.06em; }
.press.on .press-time { color: var(--ink); }
.press-state { font: italic var(--fs-md)/1.35 var(--display); color: var(--ink-2); min-height: 2.7em; }
.press.on .press-state::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 8px; vertical-align: 1px; }
.press-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); }
.btn-press { min-width: 96px; min-height: 40px; }
.press-foot { font-size: var(--fs-xs); color: var(--ink-3); }
.today-h { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--rule); }
.today li { display: grid; grid-template-columns: 3.4em 1fr; gap: var(--s3); padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-sm); }
.today .t-h { font: 600 var(--fs-md)/1.2 var(--display); text-align: right; }
.today small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.today .t-total { border-bottom: 0; border-top: 1px solid var(--ink); color: var(--ink-2); }
.t-empty { color: var(--ink-2); font-size: var(--fs-sm); padding: var(--s3) 0; grid-template-columns: 1fr !important; }

.statement { display: grid; gap: var(--s3); }
.statement-text { font: 400 clamp(20px, 1.9vw, 27px)/1.42 var(--display); max-width: 34em; text-wrap: pretty; text-shadow: 0 1px 0 var(--press); }
.statement-text b { font-weight: 700; }
.statement-text .red { font-style: italic; }

.await li + li { border-top: 1px solid var(--rule); }
.aw-row { width: 100%; display: grid; grid-template-columns: 6.2em minmax(0, 1fr) auto auto; gap: var(--s4); align-items: baseline; padding: 10px 6px; background: none; border: 0; text-align: left; border-radius: var(--r); }
.aw-row:hover { background: rgba(34, 29, 25, .05); }
.aw-num { font-family: var(--display); font-weight: 600; }
.aw-client { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-due { font-size: var(--fs-sm); color: var(--ink-2); }
.aw-row.overdue .aw-due { color: var(--red); }
.aw-amt { font-family: var(--display); font-weight: 600; font-size: var(--fs-md); text-align: right; min-width: 6.5em; }

/* Chart */
.chart { position: relative; display: grid; gap: var(--s2); }
.chart-svg { width: 100%; height: auto; display: block; }
.readout { font-size: var(--fs-sm); color: var(--ink-2); min-height: 1.5em; }
.readout b { font-weight: 400; color: var(--ink); font-family: var(--display); font-size: var(--fs-md); margin-right: 4px; }
.readout span { color: var(--red); }
.grid { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.axis { stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tick, .xl { font: 11px var(--sans); fill: var(--ink-2); }
.bar { outline: none; cursor: default; }
.bar .hit { fill: transparent; }
.bar .b-in { fill: var(--ink); }
.bar .b-halo { stroke: var(--stock); stroke-width: 5; vector-effect: non-scaling-stroke; }
.bar .b-work { stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.hatch-bg { fill: var(--stock); }
.hatch-line { stroke: var(--red); stroke-width: 2.4; }
.bar .b-vat { stroke: var(--red); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bar.hl .hit, .bar:focus-visible .hit { fill: rgba(34, 29, 25, .06); }
.bar:focus-visible .hit { stroke: var(--red); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bar.hl .xl { fill: var(--ink); }
.chart-empty { padding: 40px 0; color: var(--ink-2); font: italic var(--fs-md) var(--display); text-align: center; border: 1px dashed var(--rule-2); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: var(--fs-xs); color: var(--ink-2); }
.key { display: inline-block; width: 14px; height: 10px; margin-right: -8px; vertical-align: -1px; }
.key-in { background: var(--ink); }
.key-vat { background: repeating-linear-gradient(45deg, var(--red) 0 1.5px, var(--stock) 1.5px 4px); border: 1px solid var(--red); }
.key-work { height: 0; border-top: 2px dashed var(--ink-2); }

/* ---------- 6. Timesheet ---------- */
.ts-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.stepper { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.stepper-label { font: 600 var(--fs-lg)/1.2 var(--display); min-width: 14ch; text-align: center; }
.ts th.pin, .ts td.pin { min-width: 220px; }
.ts thead th small { display: block; font: 600 var(--fs-md)/1.2 var(--display); letter-spacing: 0; text-transform: none; color: var(--ink); }
.ts thead th.wkend, .ts thead th.wkend small { color: var(--ink-3); }
.ts thead th.today { color: var(--red); }
.ts thead th.today small { color: var(--red); }
.ts td.today { background: rgba(179, 50, 27, .045); }
.ts .ts-p { display: block; }
.ts td.cell { padding: 0; }
.cell-btn { width: 100%; min-height: 44px; padding: 0 10px; background: none; border: 0; text-align: right; font: var(--fs) var(--sans); }
.cell-btn:hover:not(:disabled) { background: rgba(34, 29, 25, .06); }
.cell-btn:disabled { cursor: default; }
.cell.billed .cell-btn { color: var(--ink-3); }
.dash { display: inline-block; width: 10px; height: 1px; background: var(--rule-2); vertical-align: middle; }
.ts .strong { font-family: var(--display); font-weight: 600; font-size: var(--fs-md); }
.ts-note { margin-top: var(--s3); color: var(--ink-3); font-size: var(--fs-sm); max-width: 70ch; }
.ts-days { display: none; }

.pin { position: sticky; left: 0; background: var(--stock) var(--grain); z-index: 1; }

/* ---------- 7. Invoices ---------- */
.inv-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--rule-2); }
.tabs button { min-height: 38px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--ink-2); font-size: var(--fs-sm); }
.tabs button span { color: var(--ink-3); margin-left: 3px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button.has-od span { color: var(--red); }
.inv-tools { display: flex; gap: var(--s2); flex-wrap: wrap; }
.search, .sort { position: relative; display: flex; align-items: center; }
.search .i, .sort .i { position: absolute; left: 10px; color: var(--ink-2); pointer-events: none; width: 16px; height: 16px; }
.search input { padding-left: 34px; width: 250px; }
.sort .select { padding-left: 34px; width: 170px; }
.inv-tbl tbody tr { cursor: pointer; transition: background .15s; }
.inv-tbl tbody tr:hover { background: rgba(34, 29, 25, .04); }
.row-btn { background: none; border: 0; padding: 4px 0; font: 600 var(--fs-md) var(--display); min-height: 32px; }
.inv-tbl .cl small { max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-tbl tr.overdue .num { color: var(--red); }
.inv-foot { margin-top: var(--s3); color: var(--ink-2); font-size: var(--fs-sm); }

/* ---------- 8. Builder ---------- */
.builder { display: grid; grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); gap: var(--s10); align-items: start; }
.b-form { display: grid; gap: var(--s6); }
.b-set { border: 0; padding: var(--s4) 0 0; margin: 0; border-top: 1px solid var(--ink); display: grid; gap: var(--s4); min-width: 0; }
.b-set legend { padding: 0; float: left; width: 100%; margin-bottom: var(--s1); }
.b-set legend + * { clear: both; }
.b-lines { display: grid; }
.b-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "c p v" "c h v"; gap: 2px var(--s3); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.b-line input { grid-area: c; width: 18px; height: 18px; }
.bl-p { grid-area: p; }
.bl-p small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.bl-h { grid-area: h; color: var(--ink-2); font-size: var(--fs-sm); }
.bl-v { grid-area: v; font: 600 var(--fs-md) var(--display); }
.b-line.off .bl-p, .b-line.off .bl-v { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--rule-2); }
.b-fixed { display: grid; gap: var(--s3); }
.b-fixed:empty { display: none; }
#bAddFixed { justify-self: start; }
.m-only { display: none; }
.fx { display: grid; grid-template-columns: minmax(0, 1fr) 64px 100px 38px; gap: var(--s2); align-items: start; }
.fx .btn-icon { margin-top: 26px; }
.b-actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end; align-items: center; padding-top: var(--s4); border-top: 3px double var(--ink); }
.b-status { flex: 1 1 100%; font-size: var(--fs-sm); }
.b-status:empty { display: none; }
.b-status.bad { color: var(--red); }
.b-status.good { padding: var(--s3); border: 1px solid var(--ink); background: var(--paper); }
.b-status .link { margin-left: 8px; }
.b-form[aria-busy="true"] #bIssueBtn::after { content: ""; width: 12px; height: 12px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.b-preview { position: sticky; top: 120px; display: grid; gap: var(--s3); }

/* ---------- 9. Income ---------- */
.income { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s8) var(--s10); }
.income > :first-child, .income > :nth-child(2) { grid-column: 1 / -1; }
.share, .share-h { width: 34%; }
.share-in { display: flex; align-items: center; gap: var(--s2); }
.share-bar { flex: 1; height: 6px; background: linear-gradient(var(--ink), var(--ink)) no-repeat 0 0 / var(--w) 100%, var(--rule); }
.share-n { min-width: 3.5ch; text-align: right; }
.threshold p { max-width: 60ch; color: var(--ink-2); }
.threshold b { color: var(--ink); font-weight: 400; font-family: var(--display); font-size: var(--fs-md); }
.thr-bar { height: 8px; border: 1px solid var(--ink); position: relative; background: var(--paper); }
.thr-bar span { position: absolute; inset: 0 auto 0 0; background: var(--ink); }

/* ---------- 10. The invoice sheet ---------- */
.sheet-wrap { padding: 18px; }
.sheet {
  position: relative; max-width: 640px; margin: 0 auto;
  padding: 44px 46px 34px;
  background: var(--paper) var(--grain);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(34, 29, 25, .08), 0 18px 34px -20px rgba(34, 29, 25, .45);
  font-size: 13px;
}
.crop { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.crop::before, .crop::after { content: ""; position: absolute; background: var(--ink-3); }
.crop::before { width: 14px; height: 1px; }
.crop::after { width: 1px; height: 14px; }
.crop.tl { top: -18px; left: -18px; } .crop.tl::before { top: 17px; left: 0; } .crop.tl::after { left: 17px; top: 0; }
.crop.tr { top: -18px; right: -18px; } .crop.tr::before { top: 17px; right: 0; } .crop.tr::after { right: 17px; top: 0; }
.crop.bl { bottom: -18px; left: -18px; } .crop.bl::before { bottom: 17px; left: 0; } .crop.bl::after { left: 17px; bottom: 0; }
.crop.br { bottom: -18px; right: -18px; } .crop.br::before { bottom: 17px; right: 0; } .crop.br::after { right: 17px; bottom: 0; }
.sh-head { text-align: center; display: grid; gap: 4px; }
.sh-name { font: 500 28px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; text-indent: .22em; text-shadow: 0 1px 0 var(--press), 0 -.5px 0 rgba(34, 29, 25, .15); }
.sh-trade { font: italic 15px/1.2 var(--display); color: var(--ink-2); }
.sh-addr { font-size: 11px; color: var(--ink-2); letter-spacing: .03em; }
.sh-rule { height: 0; margin: 20px auto 22px; width: 100%; border-top: 1px solid var(--red); position: relative; }
.sh-rule::after { content: ""; position: absolute; left: 50%; top: -4px; width: 7px; height: 7px; background: var(--paper); border: 1px solid var(--red); transform: translateX(-50%) rotate(45deg); }
.sh-meta { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.sh-title { font: 700 26px/1 var(--display); }
.sh-num { margin-top: 6px; font: italic 14px var(--display); color: var(--ink-2); }
.sh-meta dl { display: grid; grid-template-columns: auto auto; gap: 3px 14px; font-size: 12px; }
.sh-meta dt { color: var(--ink-2); font-size: 10.5px; letter-spacing: var(--track); text-transform: uppercase; padding-top: 2px; }
.sh-meta dd { text-align: right; }
.sh-to { margin: 22px 0 18px; display: grid; grid-template-columns: 5em 1fr; gap: 10px; }
.sh-label { font-size: 10.5px; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-2); padding-top: 2px; }
.sh-to b { font-weight: 400; font-family: var(--display); font-size: 15px; }
.sh-lines { width: 100%; border-collapse: collapse; }
.sh-lines th { font-size: 10.5px; font-weight: 400; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-2); text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--ink); }
.sh-lines td { padding: 8px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sh-lines .num { text-align: right; white-space: nowrap; }
.sh-lines th:first-child, .sh-lines td:first-child { padding-left: 0; }
.sh-lines th:last-child, .sh-lines td:last-child { padding-right: 0; }
.sh-none { color: var(--ink-3); font-style: italic; font-family: var(--display); }
.sh-tot { display: grid; grid-template-columns: 1fr auto; gap: 4px 0; margin: 14px 0 0 auto; width: min(100%, 300px); }
.sh-tot dt { color: var(--ink-2); }
.sh-tot dd { text-align: right; padding-left: 24px; }
.sh-tot .due { padding-top: 8px; margin-top: 4px; border-top: 3px double var(--ink); font: 700 18px/1.2 var(--display); color: var(--ink); }
.sh-tot dd.due { color: var(--red); }
.sh-novat { margin-top: 14px; padding: 8px 10px; border: 1px solid var(--rule-2); font: italic 13px/1.45 var(--display); }
.sh-note { margin-top: 14px; font: italic 13px/1.45 var(--display); color: var(--ink-2); }
.sh-foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--rule); display: grid; gap: 4px; font-size: 11px; color: var(--ink-2); line-height: 1.5; }

/* The rubber stamp: vermilion ink, double border, a little rotated and pressed into the stock */
.stamp {
  position: absolute; top: 262px; right: 44px; z-index: 2;
  display: grid; justify-items: center;
  padding: 6px 14px 5px; border: 3px double var(--red); border-radius: 4px;
  color: var(--red); font: 700 26px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; text-indent: .16em;
  transform: rotate(-9deg); mix-blend-mode: multiply; opacity: .88;
  -webkit-mask: var(--grain), linear-gradient(#000, #000); mask: var(--grain), linear-gradient(#000, #000);
}
.stamp small { font: 600 11px/1.2 var(--sans); letter-spacing: .14em; margin-top: 3px; }
.stamp-draft { border-color: var(--ink-3); border-style: dashed; color: var(--ink-3); font-size: 20px; }

/* ---------- 11. Drawer, dialogs, toast ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(34, 29, 25, .32); opacity: 0; transition: opacity .25s var(--ease); }
.scrim.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(760px, 100%);
  display: flex; flex-direction: column;
  background: var(--stock-2) var(--grain); border-left: 1px solid var(--ink);
  box-shadow: -18px 0 40px -24px rgba(34, 29, 25, .5);
  transform: translateX(100%); transition: transform .32s var(--ease);
}
.drawer.open { transform: none; }
.dr-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s4) var(--s6); border-bottom: 1px solid var(--rule-2); }
.dr-head .status { margin-left: 8px; vertical-align: 3px; }
.dr-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: end; padding: var(--s4) var(--s6); border-bottom: 1px solid var(--rule-2); }
.pay { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.pay label { font-size: var(--fs-sm); color: var(--ink-2); }
.pay input { width: 160px; }
.pay .err { flex-basis: 100%; }
.dr-note { flex-basis: 100%; font-size: var(--fs-sm); color: var(--red); max-width: 70ch; }
.dr-status { flex-basis: 100%; font-size: var(--fs-sm); }
.dr-status:empty { display: none; }
.dr-status.bad { color: var(--red); }
.dr-body { flex: 1; overflow-y: auto; padding: var(--s6) var(--s4) var(--s8); display: grid; gap: var(--s6); align-content: start; }
.dr-log { max-width: 640px; margin: 0 auto; width: 100%; display: grid; gap: var(--s2); }
.dr-log li { display: grid; grid-template-columns: 5em 1fr; gap: var(--s3); font-size: var(--fs-sm); padding: 6px 0; border-bottom: 1px solid var(--rule); }
.dr-log time { color: var(--ink-2); }

.dlg { width: min(520px, calc(100% - 24px)); padding: 0; border: 1px solid var(--ink); border-radius: var(--r); background: var(--paper) var(--grain); color: var(--ink); box-shadow: 0 24px 50px -24px rgba(34, 29, 25, .55); }
.dlg::backdrop { background: rgba(34, 29, 25, .35); }
.dlg form[method="dialog"]:not(.dlg-head form), .dlg > form { display: grid; gap: var(--s4); padding: 0 var(--s6) var(--s6); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s4) var(--s6) var(--s3); margin: 0 calc(var(--s6) * -1); border-bottom: 1px solid var(--rule-2); }
.dlg-keys .dlg-head { margin: 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--rule-2); }
.cell-list { display: grid; border: 1px solid var(--rule-2); }
.cell-list li { display: flex; align-items: center; gap: var(--s3); padding: 6px 10px; font-size: var(--fs-sm); }
.cell-list li + li { border-top: 1px solid var(--rule); }
.cl-h { font: 600 var(--fs-md) var(--display); min-width: 3em; }
.cl-n { flex: 1; color: var(--ink-2); }
.cl-lock { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: .04em; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; padding: var(--s5) var(--s6) var(--s6); font-size: var(--fs-sm); }
.keys dt { white-space: nowrap; color: var(--ink-2); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: min(460px, calc(100% - 32px)); padding: 10px 16px; background: var(--ink); color: var(--stock); border-radius: var(--r); font-size: var(--fs-sm); transform: translate(-50%, 12px); opacity: 0; transition: opacity .25s var(--ease), transform .3s var(--ease); box-shadow: 0 10px 24px -12px rgba(34, 29, 25, .6); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 12. Loading, error, empty, no-JS ---------- */
.skel { display: grid; gap: 10px; padding: 6px 0; }
.skel span { height: 12px; background: linear-gradient(90deg, rgba(34, 29, 25, .08), rgba(34, 29, 25, .14), rgba(34, 29, 25, .08)); background-size: 200% 100%; border-radius: 1px; animation: shimmer 1.6s linear infinite; }
.skel .s2 { width: 72%; } .skel .s3 { width: 48%; }
.failed { display: grid; gap: var(--s3); justify-items: start; padding: var(--s5); border: 1px solid var(--red); background: var(--red-soft); max-width: 60ch; }
.failed p, .failed .btn { font: var(--fs)/1.5 var(--sans); text-shadow: none; }
.is-failed .desk-right .block, .is-failed .desk-chart .legend { display: none; }
.failed b { color: var(--red); font-weight: 400; font-family: var(--display); font-size: var(--fs-md); }
.nojs { display: none; }
.no-js .view, .no-js .top-tools, .no-js .vat-box, .no-js .nav, .no-js .side-keys, .no-js .sync, .no-js .tabbar { display: none !important; }
.no-js .nojs { display: grid; gap: var(--s4); padding-top: var(--s6); max-width: 680px; }
.no-js .nojs .sheet { display: grid; gap: 10px; margin: 0; }

/* ---------- 13. Narrow screens ---------- */
@media (max-width: 1280px) {
  .desk { grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); gap: var(--s8); }
  .builder { grid-template-columns: minmax(0, 1fr); }
  .b-preview { position: static; }
}
@media (max-width: 1100px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
  .press { position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s6); }
  .press > .small-h, .press-time, .press-state, .press-row, .press-foot { grid-column: 1; }
  .press .today-h { grid-column: 2; grid-row: 1; margin: 0; padding: 0; border: 0; }
  .today { grid-column: 2; grid-row: 2 / span 4; align-self: start; }
  .income { grid-template-columns: minmax(0, 1fr); }
  .search input { width: 200px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 0 var(--s4) 96px; }
  .top { margin: 0 calc(var(--s4) * -1); padding: var(--s4) var(--s4) var(--s3); align-items: center; }
  .top h1 { font-size: 26px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: var(--stock-2) var(--grain); border-top: 1px solid var(--ink);
  }
  .tabbar button { display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 2px; background: none; border: 0; color: var(--ink-2); font-size: 11px; border-radius: var(--r); }
  .tabbar button[aria-current] { color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
  .tabbar .tab-new .i { color: var(--red); }
  .ts-frame { display: none; }
  .ts-days { display: grid; gap: var(--s3); }
  .day-tabs { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--ink); }
  .day-tabs button { display: grid; justify-items: center; gap: 0; padding: 6px 0; min-height: 56px; background: none; border: 0; font-size: 11px; color: var(--ink-2); }
  .day-tabs button + button { border-left: 1px solid var(--rule-2); }
  .day-tabs b { font: 600 17px/1.15 var(--display); color: var(--ink); }
  .day-tabs button[aria-selected="true"] { background: var(--ink); color: var(--stock); }
  .day-tabs button[aria-selected="true"] b { color: var(--stock); }
  .day-tabs button:disabled { opacity: .4; }
  .day-list li + li { border-top: 1px solid var(--rule); }
  .day-list button { width: 100%; display: grid; grid-template-columns: 3.6em 1fr; gap: var(--s3); padding: 12px 4px; background: none; border: 0; text-align: left; }
  .dl-h { font: 600 var(--fs-lg) var(--display); text-align: right; }
  .dl-p small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
  .day-sum { padding-top: var(--s3); border-top: 3px double var(--ink); font-size: var(--fs-sm); color: var(--ink-2); }
  .day-sum b { color: var(--ink); font-weight: 400; font-family: var(--display); font-size: var(--fs-md); }
  .toast { bottom: 84px; }
}
@media (max-width: 640px) {
  .top { position: sticky; }
  .top-title { flex: 1 1 100%; display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
  .top-date { margin: 0; }
  .top-tools { flex: 1 1 100%; justify-content: space-between; }
  .range { flex: 1; }
  .range button { flex: 1; padding: 0 4px; font-size: 12px; }
  .chip-timer { flex: 1 1 100%; max-width: none; }
  .chip-proj { flex: 1; }
  .press { grid-template-columns: minmax(0, 1fr); }
  .press .today-h, .today { grid-column: 1; grid-row: auto; }
  .press .today-h { margin-top: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--rule); }
  .press-time { font-size: 56px; }
  .statement-text { font-size: 20px; }
  .hide-s { display: none; }
  .aw-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "c a" "n d"; gap: 0 var(--s3); }
  .aw-client { grid-area: c; } .aw-amt { grid-area: a; } .aw-num { grid-area: n; font-size: var(--fs-sm); } .aw-due { grid-area: d; text-align: right; }
  .field-row.two { grid-template-columns: 1fr; }
  .inv-bar, .inv-tools { width: 100%; }
  .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tabs button { flex: none; }
  .search { flex: 1; } .search input { width: 100%; }
  .sort .select { width: 150px; }
  /* invoice table becomes a stack of rows */
  .inv-tbl thead { display: none; }
  .inv-tbl, .inv-tbl tbody { display: block; }
  .inv-tbl tr[data-row] { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n t" "c s" "i d"; gap: 2px var(--s3); padding: 10px 2px; border-bottom: 1px solid var(--rule); }
  .inv-tbl tr[data-row] > * { border: 0; padding: 0; position: static; background: none; }
  .inv-tbl tr[data-row] > :nth-child(1) { grid-area: n; }
  .inv-tbl tr[data-row] > :nth-child(2) { grid-area: c; }
  .inv-tbl tr[data-row] > :nth-child(3) { grid-area: i; font-size: var(--fs-xs); color: var(--ink-3); }
  .inv-tbl tr[data-row] > :nth-child(4) { grid-area: d; font-size: var(--fs-xs); color: var(--ink-3); text-align: right; }
  .inv-tbl tr[data-row] > :nth-child(5) { grid-area: t; font: 600 var(--fs-md) var(--display); }
  .inv-tbl tr[data-row] > :nth-child(6) { grid-area: s; text-align: right; }
  .inv-tbl .cl small { max-width: none; }
  .inv-tbl .m-only { display: inline; }
  .fx { grid-template-columns: minmax(0, 1fr) 64px 38px; }
  .fx-d { grid-column: 1 / -1; }
  .fx .btn-icon { margin-top: 26px; }
  .b-actions .btn { flex: 1; }
  .sheet-wrap { padding: 12px 6px; }
  .sheet { padding: 30px 20px 24px; font-size: 12px; }
  .crop { display: none; }
  .sh-name { font-size: 21px; letter-spacing: .16em; text-indent: .16em; }
  .sh-meta dl { grid-template-columns: 1fr auto; width: 100%; }
  .sh-title { font-size: 22px; }
  .sh-lines th:nth-child(3), .sh-lines td:nth-child(3) { display: none; }
  .stamp { top: 122px; right: 16px; font-size: 20px; }
  .dr-head, .dr-actions { padding-left: var(--s4); padding-right: var(--s4); }
  .dr-body { padding: var(--s4) var(--s2) var(--s8); }
  .share, .share-h { width: auto; }
  .share-bar { min-width: 40px; }
  .ts-bar .btn-ink { flex: 1 1 100%; }
  .stepper { flex: 1 1 100%; justify-content: space-between; }
  .stepper-label { font-size: var(--fs-md); min-width: 0; flex: 1; }
  .dlg > form { padding: 0 var(--s4) var(--s4); }
  .dlg-head { margin: 0 calc(var(--s4) * -1); padding: var(--s3) var(--s4); }
}

/* ---------- 14. Motion and print ---------- */
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
/* The signature moment: the stamp comes down onto the sheet, blurred and large, then bites into the stock */
@keyframes press {
  0% { transform: rotate(-9deg) scale(1.9); opacity: 0; filter: blur(5px); }
  55% { transform: rotate(-9deg) scale(.94); opacity: 1; filter: blur(0); }
  75% { transform: rotate(-9deg) scale(1.03); }
  100% { transform: rotate(-9deg) scale(1); opacity: .88; }
}
@media (prefers-reduced-motion: no-preference) {
  .stamp.pressing { animation: press .6s var(--ease) both; }
  .press.on .press-state::before, .chip-timer .rec { animation: blink 2s steps(1) infinite; }
  @keyframes blink { 50% { opacity: .25; } }
  .view:not([hidden]) { animation: settle .28s var(--ease); }
  @keyframes settle { from { opacity: .4; transform: translateY(4px); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ?print=HM-0147 shows the sheet alone, as it will print */
.print-preview .drawer { width: 100%; }
.print-preview .dr-log { display: none; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .app, .scrim, .dr-head, .dr-actions, .dr-log, .toast, .skip { display: none !important; }
  .drawer { position: static; transform: none; width: auto; border: 0; box-shadow: none; background: #fff; display: block !important; }
  .drawer[hidden] { display: none !important; }
  .dr-body { overflow: visible; padding: 0; }
  .sheet-wrap { padding: 0; }
  .sheet { box-shadow: none; max-width: none; background: #fff; padding: 0; }
  .crop { display: none; }
  .stamp { -webkit-mask: none; mask: none; }
}

/* Chart data disclosure: the same figures as a table, for screen readers and anyone who prefers numbers */
.chart-data summary { cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: .22em; width: max-content; min-height: 24px; }
.chart-data[open] summary { margin-bottom: var(--s2); }
.chart-data .tbl { font-size: var(--fs-sm); }
.chart-data .tbl td { text-align: right; }
#incChart .chart-data { display: none; }   /* the Income view prints the full table right below */
/* Between phone and laptop the Screenery badge sits bottom left; keep the tab bar clear of it */
@media (min-width: 641px) and (max-width: 860px) { .tabbar { padding-left: 150px; } }
