/* Pay app - phone first, works on desktop. No external fonts or assets. */

:root {
  --navy: #1f3864;
  --navy-2: #2c4a7c;
  --ink: #1c2230;
  --muted: #5d6677;
  --line: #dde2ec;
  --bg: #f4f6fa;
  --card: #ffffff;
  --input: #fffdf3;
  --input-line: #e3d9a8;
  --good: #0d7a3e;
  --bad: #b3261e;
  --warn: #9a6100;
  --gold: #ffce3c;
  --purple: #c189f7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 2px 8px rgba(20, 30, 60, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
a { color: var(--navy-2); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .95em; }
small, .muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ buttons & inputs */
button, .button {
  font: inherit;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: .6em 1em;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
}
button:hover, .button:hover { border-color: #b9c2d6; }
button.primary, .button.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
button.danger { color: var(--bad); border-color: #efc4c0; }
button.link { border: 0; background: none; color: var(--navy-2); padding: .4em 0; min-height: 0; text-decoration: underline; }
button.icon { min-width: 44px; padding: 0; font-size: 1.3rem; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid #7aa7ff; outline-offset: 2px; }

label { display: block; margin: 0 0 .9em; font-weight: 500; }
label small { font-weight: 400; }
input, select, textarea {
  font: inherit;
  width: 100%;
  margin-top: .3em;
  padding: .55em .7em;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
}
input.num, input.pct, input.money {
  background: var(--input);
  border-color: var(--input-line);
  color: #0b3a9e;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
input.code { font-size: 1.4rem; letter-spacing: .25em; text-align: center; }
input[type="color"] { padding: 2px; width: 56px; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--navy); }
textarea { min-height: 5em; resize: vertical; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.switch input { flex: none; }

/* ------------------------------------------------------------ sign-in pages */
body.auth { display: flex; min-height: 100vh; align-items: flex-start; justify-content: center; padding: 6vh 16px 32px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.narrow { width: 100%; max-width: 420px; }
.brand { display: flex; align-items: center; gap: .6em; font-weight: 700; font-size: 1.15rem; color: var(--navy); text-decoration: none; margin-bottom: 1em; }
.error { color: var(--bad); background: #fdeceb; border-radius: 8px; padding: .6em .8em; }
.notice { color: var(--good); background: #e7f5ec; border-radius: 8px; padding: .6em .8em; }
.warning { color: var(--warn); background: #fff4dc; border-radius: 8px; padding: .6em .8em; }
.steps { color: var(--muted); font-size: .9rem; margin: 0; }
.howto { padding-left: 1.2em; }
.howto li { margin-bottom: .5em; }
.qr { display: flex; justify-content: center; margin: 1em 0; }
.qr img, .qr canvas { width: 220px; height: 220px; image-rendering: pixelated; border: 8px solid #fff; }
.key code { font-size: 1.1rem; letter-spacing: .08em; word-break: break-all; }
.codes { columns: 2; font-size: 1.05rem; padding-left: 1.6em; }
.codes li { margin-bottom: .3em; }
.checks { list-style: none; padding: 0; }
.checks .ok { color: var(--good); }
.checks .bad { color: var(--bad); }
details.help { margin: .8em 0; }
details.help summary { cursor: pointer; color: var(--navy-2); }
form.inline { margin-top: .5em; }
form button.primary { width: 100%; }

/* ------------------------------------------------------------ app chrome */
body.app { padding-bottom: 32px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: .5em;
  padding: 6px 12px;
  padding-top: max(6px, env(safe-area-inset-top));
  background: var(--navy);
  color: #fff;
}
.topbar .brand { color: #fff; margin: 0; font-size: 1rem; }
.topbar .brand span { display: none; }
.tabs { display: flex; flex: 1; gap: 2px; }
.tabs a {
  flex: 1;
  text-align: center;
  color: #d6def0;
  text-decoration: none;
  padding: .55em .2em;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
}
.tabs a.on { background: rgba(255, 255, 255, .16); color: #fff; }
.save-state { font-size: .75rem; min-width: 4.5em; text-align: right; color: #c8d3ea; }
.save-state.error { color: #ffb4ab; font-weight: 700; }

#view { max-width: 760px; margin: 0 auto; padding: 12px 12px 0; outline: none; }
.loading { text-align: center; color: var(--muted); padding: 3em 0; }

.section { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 14px 6px; margin-bottom: 12px; }
.section > h2 { display: flex; align-items: baseline; justify-content: space-between; gap: .5em; }
.section > h2 small { font-size: .8rem; font-weight: 400; }
/* every card opens and closes from its heading */
details.section { padding-bottom: 8px; }
details.section > summary,
details.sub > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 32px;
  user-select: none;
}
details.section > summary { font-weight: 700; font-size: 1.1rem; padding-bottom: 6px; }
details.section > summary::-webkit-details-marker,
details.sub > summary::-webkit-details-marker { display: none; }
details.section > summary::after,
details.sub > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-3px) rotate(45deg);
  transition: transform .15s;
}
details.section[open] > summary::after,
details.sub[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
details.section:not([open]) { padding-bottom: 4px; }
.sum-title { flex: 1; }
.sum-extra { font-size: .85rem; font-weight: 600; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
details.sub { border-top: 1px solid #eef1f6; padding: 8px 0 4px; }
details.sub > summary { font-weight: 600; font-size: 1rem; }

.banner { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.banner button { margin-top: .5em; }

/* ------------------------------------------------------------ period header */
.period-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.period-head .title { flex: 1; text-align: center; }
.period-head .title strong { display: block; font-size: 1.1rem; }
.period-head .title span { color: var(--muted); font-size: .9rem; }
.period-head select { width: auto; min-height: 36px; margin: 0; padding: .2em .4em; font-size: .9rem; }

.hero { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.hero .label { color: #c8d3ea; font-size: .85rem; }
.hero .big { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero .row { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: .95rem; }
.hero .row b { font-variant-numeric: tabular-nums; }
.hero .pos { color: #9ff0bf; }
.hero .neg { color: #ffb4ab; }
.hero small { color: #c8d3ea; }
.hero .hero-savings { align-items: center; }
.hero .hero-savings small { color: #c8d3ea; }
.hero .hero-link { min-height: 32px; padding: .2em .8em; font-size: .85rem; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; }
.hero .hero-link:hover { background: rgba(255, 255, 255, .22); border-color: #fff; }
.chip { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .16); }

/* ------------------------------------------------------------ days */
.week-label { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin: 6px 0 4px; }
.day {
  display: grid;
  grid-template-columns: 4.6em 1fr 6.5em;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border-top: 1px solid #eef1f6;
}
.day .date {
  display: block;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
  line-height: 1.1;
  background: #f1f3f8;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.day .date:hover { box-shadow: inset 0 0 0 2px rgba(31, 56, 100, .35); }
.day .date, .day .shift { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.shift-name { font-weight: 600; color: var(--ink); }
.shift.today .shift-name { color: var(--navy); }
.badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 99px; font-size: .7rem; font-weight: 600; background: #fff1c2; color: #7a5400; vertical-align: 1px; }
.small { font-size: .85rem; }
.day .date b { display: block; font-size: 1.05rem; }
.day .date span { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.day .shift { font-size: .9rem; color: var(--muted); }
.day .shift.today { color: var(--navy); font-weight: 700; }
.day input { margin: 0; }
.day.is-today .date { outline: 2px solid var(--navy); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; align-items: end; }
.grid2 > *, .grid3 > * { min-width: 0; }
input[type="date"] { min-width: 0; }
.field-hint { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ------------------------------------------------------------ money tables */
.lines { width: 100%; border-collapse: collapse; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.lines td { padding: 5px 0; border-bottom: 1px solid #eef1f6; vertical-align: top; }
.lines td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.lines tr.total td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--line); }
.lines tr.sub td { color: var(--muted); font-size: .88rem; }
.lines tr.head td { font-weight: 700; padding-top: 12px; color: var(--navy); }
.pos { color: var(--good); }
.neg { color: var(--bad); }

.rows .row { display: grid; grid-template-columns: 1fr 7.5em 44px; gap: 6px; align-items: center; margin-bottom: 6px; }
.rows.with-day .row { grid-template-columns: 1fr 6.5em 4.2em 44px; }
.rows.brackets .row { grid-template-columns: 1fr 1fr 44px; }
.rows.ohp .row { grid-template-columns: 1fr 1fr 1fr 44px; }
.rows .row input { margin: 0; }
.rows .row.headings { font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.rows .row.headings span { padding-left: 4px; }

/* ------------------------------------------------------------ year table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px; }
table.year { border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; min-width: 640px; width: 100%; }
table.year th, table.year td { padding: 7px 6px; text-align: right; border-bottom: 1px solid #eef1f6; white-space: nowrap; }
table.year th { position: sticky; top: 0; background: #f6f8fc; color: var(--muted); font-weight: 600; }
table.year th:first-child, table.year td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
table.year th:first-child { background: #f6f8fc; }
table.year tbody tr { cursor: pointer; }
table.year tbody tr:hover td { background: #f7f9ff; }
table.year tbody tr.now td { background: #fff8dc; }
table.year tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #fafbfd; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; }
.stat span { display: block; font-size: .78rem; color: var(--muted); }
.stat b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ menus */
.menu { list-style: none; margin: 0; padding: 0; }
.menu a { display: flex; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid #eef1f6; text-decoration: none; color: var(--ink); font-weight: 600; }
.menu a small { font-weight: 400; }
.menu a::after { content: "\203A"; color: var(--muted); font-size: 1.3rem; line-height: 1; }

.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.swatch { width: 2.4em; text-align: center; border-radius: 6px; padding: 4px 0; font-size: .75rem; background: #f1f3f8; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: 4px 0 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid rgba(0, 0, 0, .1); }

/* ------------------------------------------------------------ pop-up menu */
.popmenu {
  position: fixed;
  z-index: 60;
  min-width: 230px;
  max-width: calc(100vw - 16px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20, 30, 60, .25), 0 0 0 1px rgba(20, 30, 60, .08);
  padding: 6px;
}
.popmenu-title { padding: 6px 10px 4px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.popmenu button {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  min-height: 44px;
  padding: 8px 10px;
  white-space: pre;
}
.popmenu button:hover, .popmenu button:focus-visible { background: #eef2fa; outline: none; }
.popmenu button.current { font-weight: 700; }
.popmenu .dot { flex: none; width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.popmenu .tick { margin-left: auto; color: var(--good); }

/* ------------------------------------------------------------ premiums & budget */
.figures { margin-bottom: 10px; }
.figures > div { background: #f6f8fc; border-radius: 10px; padding: 8px 10px; }
.figures span { display: block; font-size: .78rem; color: var(--muted); }
.figures b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.figures small { color: var(--muted); font-variant-numeric: tabular-nums; }

.savings-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
label.tick { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 1.4em; font-weight: 500; cursor: pointer; min-height: 44px; }
.paid-list { padding: 2px 0 6px; }
.paid-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 2px;
  border-bottom: 1px solid #f0f2f7;
  font-weight: 400;
  cursor: pointer;
  min-height: 44px;
}
.paid-row .amt { font-variant-numeric: tabular-nums; }
.paid-row small { color: var(--muted); }
.is-paid .name, .is-paid .amt, .row.is-paid input:not([type="checkbox"]) { color: var(--muted); text-decoration: line-through; }
.row.is-paid input:not([type="checkbox"]) { background: #f6f7f9; }
.edit-link { display: inline-block; margin-top: 8px; font-size: .9rem; }
.rows.with-paid .row { grid-template-columns: 22px 1fr 7.5em 44px; }

.field { margin-bottom: .9em; }
.field-label { display: block; font-weight: 500; }
.field .grid2 select, .field .grid2 input { margin-top: .3em; }

/* ------------------------------------------------------------ shift types */
.shift-type { border-top: 1px solid #eef1f6; padding: 10px 0; }
.shift-type-head { display: grid; grid-template-columns: 2.4em 1fr auto; gap: 8px; align-items: center; }
.shift-type-head input { margin: 0; }
.shift-type .code { display: inline-flex; align-items: center; justify-content: center; height: 2.2em; border-radius: 8px; font-weight: 700; background: #f1f3f8; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.shift-type-body { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 0 8px; margin-top: 6px; }
.shift-type-body label { margin: 0; font-size: .85rem; }
.colour-pick { display: flex; align-items: center; gap: 8px; }
.colour-pick .tick { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 520px) {
  .shift-type-body { grid-template-columns: 1fr 1fr; gap: 6px 10px; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: #1c2230;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  z-index: 50;
}
.toast.error { background: var(--bad); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }

/* ------------------------------------------------------------ paystub import */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.stub-cards { display: grid; gap: 12px; }
.stub-card { padding: 14px 16px; }
.stub-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.stub-head small { color: var(--muted); }
.checks { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.checks li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 4px 0; border-bottom: 1px solid #f2f4f8; }
.checks li.ok > span { color: var(--ink); }
.checks li.bad > span { color: var(--bad); font-weight: 600; }
.checks small { color: var(--muted); font-variant-numeric: tabular-nums; }
.compare { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin: 6px 0 10px; }
.compare th { text-align: left; font-size: .8rem; color: var(--muted); padding: 4px 0; border-bottom: 1px solid var(--line); }
.compare td { padding: 5px 0; border-bottom: 1px solid #f2f4f8; }
.compare .num { text-align: right; padding-left: 10px; white-space: nowrap; }
.compare tr.differs td { background: #fff9ec; }
.stub-options { margin: 4px 0 10px; }
.stub-options label.tick { margin: 0; align-items: flex-start; font-size: .95rem; }
.bullets { margin: 0; padding-left: 1.1em; }
.bullets li { margin: .3em 0; }

/* ------------------------------------------------------------ lieu bank */
.lieu-box { border-top: 1px solid #eef1f6; padding-top: 10px; margin-bottom: 8px; }
.lieu-box .switch { margin-bottom: .6em; }
.lieu-box .figures { margin-bottom: 4px; }
.lieu-box .edit-link { margin: 0 0 6px; }
h2.lieu-title { margin: 18px 4px 8px; font-size: 1rem; color: var(--muted); }
.lieu-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; align-items: end; }
.lieu-fields .wide { grid-column: 1 / -1; }
@media (min-width: 560px) {
  .lieu-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
}
.lieu-amount { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 6px; }
table.ledger { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
table.ledger th { text-align: left; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 4px; border-bottom: 1px solid var(--line); }
table.ledger td { padding: 7px 4px; border-bottom: 1px solid #eef1f6; vertical-align: top; }
table.ledger .num { text-align: right; white-space: nowrap; }
table.ledger td.when { white-space: nowrap; color: var(--muted); width: 1%; }
table.ledger td.bal { font-weight: 600; }
table.ledger td small { display: block; font-size: .8rem; color: var(--muted); }
table.ledger tr.act { cursor: pointer; }
table.ledger tr.act:hover td { background: #f7f9ff; }
table.ledger tr.future td { color: #7b8394; }
table.ledger tr.future td.pos { color: #5f9a77; }
table.ledger tr.future td.neg { color: #c0726b; }
table.ledger tr.paydown td { background: #f3f8f4; }
table.ledger tr.today td { background: #fff8dc; font-weight: 700; color: var(--ink); }
table.ledger tr.opening td { font-weight: 600; }
table.ledger tr.edit td { background: #f6f8fc; padding: 10px 8px 2px; }
table.ledger tr.now td { background: #fff8dc; }
table.ledger tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
table.oneoffs .num { width: 1%; padding-left: 10px; }
@media (min-width: 560px) {
  table.oneoffs .num { padding-left: 18px; }
  table.oneoffs td.when small { display: inline; margin-left: 8px; font-size: inherit; }
}
.months { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 4px 0 10px; }
.months label { display: inline-flex; align-items: center; gap: 6px; margin: 0; min-height: 40px; font-weight: 400; }

@media (min-width: 560px) {
  .topbar .brand span { display: inline; }
  .cards { grid-template-columns: repeat(4, 1fr); }
  .hero .big { font-size: 2.6rem; }
  .day { grid-template-columns: 5.5em 1fr 8em; }
}

/* ------------------------------------------------------------ year page on big screens */
/* phones and small windows keep the narrow layout above */
@media (min-width: 1100px) {
  #view[data-page="year"] { max-width: 1900px; padding: 12px 24px 0; }
  #view[data-page="year"] table.year { font-size: 1rem; }
  #view[data-page="year"] table.year th,
  #view[data-page="year"] table.year td { padding: 6px 6px; }
  #view[data-page="year"] .cards { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  #view[data-page="year"] .period-head { margin-bottom: 4px; }
  #view[data-page="year"] .period-head .title strong { font-size: 1.3rem; }
  /* a short list: keep it list-width rather than stretched across the screen */
  #view[data-page="year"] > .year-oneoffs { max-width: 1100px; }
}
/* wide enough for the totals and buttons to sit beside the table, so the
   whole year fits on one screen */
@media (min-width: 1900px) {
  #view[data-page="year"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas: "banner banner" "head head" "table totals" "table actions" "oneoffs .";
    column-gap: 16px;
    align-items: start;
  }
  #view[data-page="year"] > .banner { grid-area: banner; }
  #view[data-page="year"] > .period-head { grid-area: head; }
  #view[data-page="year"] > .year-periods { grid-area: table; }
  #view[data-page="year"] > .year-totals { grid-area: totals; }
  #view[data-page="year"] > .year-oneoffs { grid-area: oneoffs; }
  #view[data-page="year"] > .actions { grid-area: actions; margin-top: 0; }
  #view[data-page="year"] .year-totals .cards { grid-template-columns: 1fr 1fr; }
  /* a 1920 screen: a touch smaller, so all the columns fit beside the totals */
  #view[data-page="year"] table.year { font-size: .9rem; }
  #view[data-page="year"] table.year th,
  #view[data-page="year"] table.year td { padding: 6px 5px; }
}
/* a 32" monitor: room to breathe */
@media (min-width: 2200px) {
  #view[data-page="year"] { max-width: 2300px; grid-template-columns: minmax(0, 1fr) 340px; }
  #view[data-page="year"] table.year { font-size: 1rem; }
  #view[data-page="year"] table.year th,
  #view[data-page="year"] table.year td { padding: 6px 10px; }
}
/* very large screens (a 4K monitor at 100%): everything a size bigger */
@media (min-width: 2800px) {
  #view[data-page="year"] { max-width: 3000px; grid-template-columns: minmax(0, 1fr) 440px; font-size: 1.2rem; }
  #view[data-page="year"] table.year { font-size: 1.25rem; }
  #view[data-page="year"] table.year th,
  #view[data-page="year"] table.year td { padding: 7px 14px; }
  #view[data-page="year"] .stat span { font-size: .95rem; }
  #view[data-page="year"] .stat b { font-size: 1.4rem; }
}

@media print {
  .topbar, .actions, button { display: none !important; }
  body { background: #fff; }
  .section, .hero { box-shadow: none; border: 1px solid #ccc; }
}
