/* TMS app styles.
   Cloudflare's design language (flat surfaces, 2-4px radii, a 4px spacing scale, dense type with
   slight negative tracking, one accent), with TMS navy from the Society's logo in place of
   Cloudflare's orange so the app matches the Society's documents. Light mode only, as in that
   system. Geist stands in for FT Kunst Grotesk, which is not freely licensed. */

@font-face {
	font-family: "Geist"; src: url("fonts/Geist-Variable.967211bfd11a.woff2") format("woff2");
	font-weight: 100 900; font-display: swap;
}
@font-face {
	font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.378be39c9e25.woff2") format("woff2");
	font-weight: 100 900; font-display: swap;
}

:root {
	--accent: #0B284C;        /* TMS navy: buttons, active navigation, focus */
	--accent-hover: #164771;
	--on-accent: #FFFFFF;
	--bg: #FFFFFF;
	--surface: #FDFDFC;
	--surface-2: #F4F4F3;
	--divider: #ECECEB;
	--control: #8F949B;       /* input and button borders: 3:1 against white */
	--text: #262626;
	--muted: #5C5C5C;
	--ok: #1F6B3A; --warn: #8A4B00; --bad: #A12622;   /* state only, never decoration */

	--r-sm: 2px; --r: 3px;
	--s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 32px; --s6: 40px; --s7: 48px;
	--shadow: 0 4px 60px rgba(11, 40, 76, .06), 0 2px 12px rgba(0, 0, 0, .03);
	--ease: cubic-bezier(0.19, 1, 0.22, 1); --fast: 100ms; --base: 200ms;

	--sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* even on elements styled display: grid or flex */
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; background: var(--bg); color: var(--text);
	font: 400 14px/1.45 var(--sans); letter-spacing: -0.14px;
	/* The footer stays at the bottom of the window on a short page. */
	min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--s4); }

/* Header: white, one line, the logo carries the brand. */
.top { border-bottom: 1px solid var(--divider); background: var(--bg); }
.top-in { display: flex; align-items: center; gap: var(--s4); min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.brand img { display: block; }
.brand strong { font-weight: 600; font-size: 15px; letter-spacing: -0.3px; }
.brand span { color: var(--muted); font-size: 13px; }
.top nav { display: flex; gap: 2px; margin-left: var(--s4); overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.user { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.user a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: var(--r); }
.user a:hover { background: var(--surface-2); color: var(--text); }
.top nav a, .signout button {
	color: var(--text); text-decoration: none; white-space: nowrap; padding: 8px 10px; border-radius: var(--r);
	font: inherit; background: none; border: 0; cursor: pointer;
	transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.top nav a:hover, .signout button:hover { background: var(--surface-2); color: var(--text); }
.top nav a.here { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.signout { margin: 0; }
.signout button { color: var(--muted); }

main.wrap { width: 100%; flex: 1 0 auto; padding-top: var(--s6); padding-bottom: var(--s7); }
h1 { font-size: 32px; line-height: 1.05; font-weight: 500; letter-spacing: -0.8px; margin: 0 0 var(--s2); }
h2 { font-size: 19px; line-height: 1.2; font-weight: 500; letter-spacing: -0.48px; margin: var(--s6) 0 var(--s3); }
.lede { color: var(--muted); margin: 0 0 var(--s5); max-width: 68ch; }
.muted { color: var(--muted); }
.num, td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.foot { color: var(--muted); font-size: 12px; padding: var(--s4); border-top: 1px solid var(--divider); }

/* Figures at a glance. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.stat { border: 1px solid var(--divider); border-radius: var(--r); padding: var(--s4); background: var(--surface); }
.stat .num { display: block; font-family: var(--sans); font-size: 30px; font-weight: 500; letter-spacing: -0.8px;
	font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .label { display: block; color: var(--muted); margin-top: var(--s1); }
.stat a { display: inline-block; margin-top: var(--s2); }

/* Messages after an action. */
.messages { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: var(--s2); }
.messages li { padding: 10px var(--s3); background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: var(--r-sm); }
.messages .success { border-color: var(--ok); }
.messages .warning { border-color: var(--warn); }
.messages .error { border-color: var(--bad); }

/* Tables: dense, light header, figures in mono. */
.scroll { overflow-x: auto; border: 1px solid var(--divider); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; background: var(--bg); }
th, td { text-align: left; padding: 10px var(--s3); border-bottom: 1px solid var(--divider); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
td:first-child { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; }
tr.total td { font-weight: 600; background: var(--surface); border-top: 1px solid var(--control); }
td .sub { display: block; color: var(--muted); font-size: 12px; }
td .sub.num { font-family: var(--mono); letter-spacing: 0; }
.flag { color: var(--warn); font-weight: 600; font-size: 12px; font-family: var(--sans); }
.empty { color: var(--muted); padding: var(--s5) var(--s3); text-align: center; }

/* The overview: one panel per section. */
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
.panel { border: 1px solid var(--divider); border-radius: var(--r); padding: var(--s4) var(--s4) var(--s4); background: var(--surface); }
.panel header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.panel h2 { margin: 0; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.figures .num { display: block; font-family: var(--sans); font-size: 28px; font-weight: 500; letter-spacing: -0.7px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figures .label { color: var(--muted); }
.balances { list-style: none; margin: 0 0 var(--s4); padding: 0; border-top: 1px solid var(--divider); }
.balances li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--divider); }

/* Section menus and filter pills. */
.subnav, .pills { display: flex; gap: 2px; flex-wrap: wrap; margin: calc(-1 * var(--s3)) 0 var(--s5); border-bottom: 1px solid var(--divider); }
.subnav a, .pills a { padding: 8px 10px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.subnav a:hover, .pills a:hover { color: var(--text); }
.subnav a.here, .pills a.here { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.pills { margin: 0 0 var(--s3); border-bottom: 0; }
table.lines td { padding: 6px; }
table.lines input { min-width: 90px; }
fieldset, .field ul { margin: 0; padding: 0; }
.field > div[id] { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); min-height: 36px; align-items: center; }
.field > div[id] label { display: flex; gap: 6px; align-items: center; font-weight: 400; font-size: 14px; }

/* Buttons: flat, one primary per screen. */
.btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 var(--s4);
	border-radius: var(--r); border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
	font: 500 14px/1 var(--sans); letter-spacing: -0.14px; text-decoration: none; cursor: pointer; white-space: nowrap;
	transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--bg); color: var(--text); border-color: var(--control); }
.btn.secondary:hover { background: var(--surface-2); color: var(--text); }
.btn.small { min-height: 30px; padding: 0 var(--s3); font-size: 13px; }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

/* Forms: label above, error below. */
form.filters { display: flex; gap: var(--s3); align-items: end; flex-wrap: wrap; margin-bottom: var(--s4); }
form.filters .field { margin: 0; min-width: 180px; }
.section { border-top: 1px solid var(--divider); padding-top: var(--s4); margin-bottom: var(--s5); }
.section h2 { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 var(--s4); }
.field { display: grid; gap: 6px; margin-bottom: var(--s4); align-content: start; }
.field label { font-size: 13px; font-weight: 500; }
.field.check { display: flex; align-items: center; gap: var(--s2); min-height: 36px; }
.field.check label { font-weight: 400; font-size: 14px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], input[type=search], select, textarea {
	width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--control); border-radius: var(--r-sm);
	font: inherit; color: var(--text); background: var(--bg);
}
textarea { min-height: 64px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.has-error input, .has-error select { border-color: var(--bad); }
.error { color: var(--bad); font-size: 13px; margin: 0; }
.note { padding: 10px var(--s3); background: var(--surface-2); border-radius: var(--r-sm); margin: 0 0 var(--s4); }
.note.warn { color: var(--warn); font-weight: 500; }
/* Fields the chit reader was unsure of. */
.unsure input, .unsure select { border-color: var(--warn); background: #FFF7EB; }
.unsure label { color: var(--warn); }
.unsure-key { border-bottom: 2px solid var(--warn); background: #FFF7EB; padding: 0 2px; }

/* Entering a chit beside its scan. */
.entry { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.entry.with-scan { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
.scan img { width: 100%; border: 1px solid var(--divider); border-radius: var(--r); background: #fff; display: block; }
.scan { position: sticky; top: var(--s4); }

/* Uploaded chits. */
.uploader { display: flex; gap: var(--s3); align-items: end; flex-wrap: wrap; padding: var(--s4); border: 1px dashed var(--control); border-radius: var(--r); margin-bottom: var(--s5); }
.uploader .field { margin: 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.thumb { border: 1px solid var(--divider); border-radius: var(--r); padding: var(--s3); background: var(--surface); }
.thumb img { width: 100%; display: block; border-radius: var(--r-sm); margin-bottom: var(--s2); }

.login { max-width: 380px; margin: var(--s7) auto; padding: var(--s5); border: 1px solid var(--divider); border-radius: var(--r); box-shadow: var(--shadow); }
.login h1 { font-size: 26px; }

@media (max-width: 768px) {
	.entry.with-scan { grid-template-columns: minmax(0, 1fr); }
	.scan { position: static; }
	.brand span { display: none; }
	.top-in { flex-wrap: wrap; gap: 0 var(--s3); }
	.top nav { order: 3; width: 100%; margin: 0 calc(-1 * var(--s2)); border-top: 1px solid var(--divider); }
	.panels { grid-template-columns: minmax(0, 1fr); }
	main.wrap { padding-top: var(--s5); }
	h1 { font-size: 26px; letter-spacing: -0.6px; }
	.btn, input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], input[type=search], select { min-height: 44px; }
	.top nav a, .signout button, .user a { padding: 12px 10px; }
	.subnav { overflow-x: auto; flex-wrap: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}

/* Zooming into a chit while checking it. */
.zoombar { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); flex-wrap: wrap; }
.zoombar input[type=range] { flex: 1 1 120px; accent-color: var(--accent); }
.zoombar .btn.small { min-width: 34px; }
.scanview { overflow: auto; max-height: 78vh; border: 1px solid var(--divider); border-radius: var(--r); background: #fff; touch-action: pan-x pan-y; }
.scanview img { display: block; width: 100%; max-width: none; border: 0; border-radius: 0; user-select: none; }
.scanview.zoomed { cursor: grab; }
.scanview.dragging { cursor: grabbing; }

/* The call to review chits, at the top of the overview. */
.review-call { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
	padding: var(--s4); margin: 0 0 var(--s5); border: 1px solid var(--accent); border-radius: var(--r); background: var(--surface); }

/* Registering online: the student's form and page, on a phone. */
.join { max-width: 560px; margin: 0 auto; }
.join h1 { font-size: 28px; }
.howto { border: 1px solid var(--divider); border-radius: var(--r); background: var(--surface); padding: var(--s3) var(--s4); margin-bottom: var(--s5); }
.howto summary { font-weight: 600; cursor: pointer; }
.steps { margin: var(--s3) 0 0; padding-left: 20px; display: grid; gap: var(--s2); }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.small { font-size: 12px; }
.field .label { font-size: 13px; font-weight: 500; }
.pick { display: flex; gap: var(--s2); flex-wrap: wrap; }
.pick-one { position: relative; }
.pick-one input { position: absolute; opacity: 0; }
.pick-one span { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; min-height: 44px; padding: 0 var(--s3);
	border: 1px solid var(--control); border-radius: var(--r); cursor: pointer; font-weight: 500; }
.pick-one input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pick-one input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.with-suffix, .with-prefix, .phone { display: flex; align-items: stretch; }
.with-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.with-suffix span, .with-prefix span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--control);
	background: var(--surface-2); color: var(--muted); white-space: nowrap; font-size: 14px; }
.with-suffix span { border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.with-prefix span { border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.with-prefix input { border-top-left-radius: 0; border-bottom-left-radius: 0; min-width: 0; }
.phone select { width: auto; max-width: 46%; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.phone input { min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.items { display: grid; gap: var(--s2); }
.item { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s3); align-items: start; padding: var(--s3); cursor: pointer;
	border: 1px solid var(--control); border-radius: var(--r); background: var(--bg); }
.item input { margin-top: 2px; }
.item.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.item-name { font-weight: 600; display: flex; justify-content: space-between; gap: var(--s2); }
.item-note { grid-column: 2; color: var(--muted); font-size: 13px; }
.price { font-family: var(--mono); font-weight: 500; letter-spacing: 0; }
.souvenir-more { padding: var(--s3); border: 1px solid var(--divider); border-radius: var(--r); background: var(--surface); }
.souvenir-more img { width: 100%; height: auto; display: block; border-radius: var(--r-sm); margin: var(--s2) 0; }
.souvenir-more p { margin: 0 0 var(--s2); }
p.total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 600; margin: var(--s4) 0 var(--s2);
	padding-top: var(--s3); border-top: 1px solid var(--control); }
.btn.big { min-height: 48px; font-size: 16px; padding: 0 var(--s5); }
.btn.light { background: #fff; color: #A01818; border-color: #fff; }
.btn.light:hover { background: #FFE9E9; color: #A01818; }
.links { display: grid; gap: var(--s2); }

/* The student's own page: red until they reach the desk, so it is not closed by mistake. */
body.you-filled { background: #FCE8E8; }
body.you-filled .top { background: #FCE8E8; }
.callout { border-radius: var(--r); padding: var(--s4); margin-bottom: var(--s4); color: #fff; }
.callout p { margin: 0 0 var(--s2); }
.callout-big { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.1; text-transform: uppercase; }
.callout.red { background: #B3141C; }
.callout.navy { background: var(--accent); }
.callout.green { background: var(--ok); }
.handler-id { display: grid; gap: var(--s2); margin-top: var(--s3); }
.handler-id label { font-weight: 600; }
.handler-id input { font-size: 20px; letter-spacing: 2px; font-family: var(--mono); }
.handler-id .error { color: #fff; font-weight: 600; background: rgba(0, 0, 0, .25); padding: 4px 8px; border-radius: var(--r-sm); }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); margin: 0 0 var(--s4); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }

/* The online form's settings and its QR code. */
.online-settings { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s5); align-items: start; }
.qr-box { text-align: center; border: 1px solid var(--divider); border-radius: var(--r); padding: var(--s4); }
.big-qr svg { width: 100%; height: auto; display: block; }
.qr-sheet { text-align: center; max-width: 640px; margin: 0 auto; }
.qr-sheet .big-qr { max-width: 460px; margin: var(--s4) auto; }
@media (max-width: 768px) {
	.online-settings { grid-template-columns: minmax(0, 1fr); }
}
@media print {
	body { display: block; min-height: 0; }
	body.print-qr .top, body.print-qr .foot, body.print-qr .subnav, body.print-qr .messages { display: none; }
	body.print-qr main.wrap { padding: 0; }
}
.change-desk { margin-top: var(--s3); border-top: 1px solid rgba(255, 255, 255, .3); padding-top: var(--s2); }
.change-desk summary { cursor: pointer; font-weight: 600; }
td .note-line { color: var(--warn); white-space: normal; max-width: 42ch; }

/* Paid by: cash, mobile money, or both, each with its amount. */
fieldset.pay { border: 1px solid var(--divider); border-radius: var(--r); padding: var(--s3) var(--s4); margin: 0 0 var(--s4); display: grid; gap: var(--s2); }
fieldset.pay legend { font-size: 13px; font-weight: 500; padding: 0 4px; }
.pay-row { display: grid; grid-template-columns: minmax(0, 160px) auto minmax(0, 160px); gap: var(--s2); align-items: center; }
.pay-way { display: flex; align-items: center; gap: var(--s2); font-size: 14px; }
.pay-cur { color: var(--muted); }
.pay-row input[type=number] { width: 100%; }
.pay-row input:disabled { background: var(--surface-2); color: var(--muted); }
.pay-total { margin: 0; color: var(--muted); }
.pay-total strong { color: var(--text); }

/* The student's page: the sound switch, the call from a handler, and paying by mobile money. */
/* The two things a waiting student must do, big enough to see at a glance: tap for sound, then
   type the handler's ID. */
.sound-on { display: grid; gap: 2px; width: 100%; margin: var(--s3) 0 0; padding: var(--s4); min-height: 72px; text-align: left;
	border: 0; border-radius: var(--r); background: #fff; color: #8E0F16; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.sound-on:disabled { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; cursor: default; }
.sound-on .step, .id-step .step { font: 800 22px/1.15 var(--sans); text-transform: uppercase; letter-spacing: -0.2px; }
.sound-on .why, .id-step .why { font: 500 16px/1.3 var(--sans); }
.id-step { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid rgba(255, 255, 255, .35); }
.id-step label { display: grid; gap: 2px; }
.big-id span { font: 700 26px/1 var(--mono); padding: 0 14px; color: var(--text); }
.big-id input { font: 700 34px/1 var(--mono); letter-spacing: 6px; min-height: 68px; padding: 0 12px; }
.call-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(120, 8, 14, .92); display: grid; place-items: center;
	padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.call-box { width: min(480px, 100%); text-align: center; color: #fff; display: grid; gap: var(--s3); animation: call-pulse 1.2s ease-in-out infinite; }
.call-big { font-size: 34px; font-weight: 800; text-transform: uppercase; line-height: 1.05; margin: 0; letter-spacing: -0.5px; }
.call-id { font: 700 54px/1 var(--mono); margin: 0; letter-spacing: 2px; }
.call-close { background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; cursor: pointer; padding: 8px; }
@keyframes call-pulse { 50% { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .call-box { animation: none; } }
.momo.momo-on { border: 2px solid var(--accent); border-radius: var(--r); padding: var(--s4); }
.dial { display: grid; gap: var(--s2); }
.dial .btn { justify-content: space-between; min-height: 48px; }
fieldset.extras { border: 1px dashed var(--divider); border-radius: var(--r); padding: var(--s2) var(--s4) var(--s3); margin: 0 0 var(--s4); }
fieldset.extras legend { font-size: 13px; font-weight: 500; padding: 0 4px; }
fieldset.extras .field { margin-bottom: var(--s2); }
form.collect { display: flex; align-items: center; gap: var(--s2); margin-top: 4px; flex-wrap: wrap; }
button.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; font-size: 12px; cursor: pointer; }

/* Home: what is waiting, as a plain list of links. */
.todo { list-style: none; padding: 0; margin: 0; border: 1px solid var(--divider); border-radius: var(--r); }
.todo li { border-bottom: 1px solid var(--divider); }
.todo li:last-child { border-bottom: 0; }
.todo a { display: block; padding: var(--s3) var(--s4); text-decoration: none; font-weight: 500; }
.todo a:hover { background: var(--surface-2); }
.todo a::after { content: "\2192"; float: right; color: var(--muted); }

/* A page's title, with its one main action beside it. */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3) var(--s4); flex-wrap: wrap; }
.page-head > div { min-width: 0; flex: 1 1 320px; }
.head-action { flex: none; display: flex; gap: var(--s2); align-items: center; margin-top: var(--s1); }
.head-action select { min-width: 0; }

/* Something used now and then, folded away until wanted. */
details.more { margin-top: var(--s5); border-top: 1px solid var(--divider); padding-top: var(--s4); }
details.more summary { cursor: pointer; font-weight: 500; color: var(--accent); }
details.more[open] summary { margin-bottom: var(--s3); }
td.nowrap, .nowrap { white-space: nowrap; }

/* The money page's days: one row of days, and a date box for any other. */
.day-pick { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.day-pick .pills { margin: 0; flex: 1 1 auto; }
.day-pick input { width: auto; }

.user .short { display: none; }

/* Phones: the menu fits on one line, the name gives way to "Password", figures two to a row. */
@media (max-width: 560px) {
	.user .long { display: none; }
	.user .short { display: inline; }
	.top nav { gap: 0; }
	.top nav a { padding: 12px 6px; }
	.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
	.stat { padding: var(--s3); }
	.stat .num { font-size: 22px; letter-spacing: -0.4px; }
	.page-head .head-action { margin-top: 0; margin-bottom: var(--s4); }
}

/* The offline desk: a band across every page, so no one mistakes it for the website. */
.offline-bar { background: #8A4B00; color: #fff; font-weight: 600; padding: 8px 0; font-size: 13px; }

/* The shop: items, cart and checkout, mostly seen on a phone. */
.shop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); flex-wrap: wrap; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); margin-top: var(--s4); }
.product { display: flex; flex-direction: column; border: 1px solid var(--divider); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.product-pic { aspect-ratio: 4 / 3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.product-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-body { padding: var(--s3); display: grid; gap: var(--s2); }
.product-body h2 { margin: 0; font-size: 16px; }
.product-body p { margin: 0; }
.product .price { font-family: var(--mono); font-weight: 600; }
.product-buy { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); align-items: end; }
.product-buy label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
.product-buy select, .product-buy input { width: 100%; }
.product-buy .btn { grid-column: 1 / -1; width: 100%; }
input.qty { width: 72px; }
.link-button { display: block; background: none; border: 0; padding: var(--s1) 0 0; font: inherit; font-size: 13px; color: var(--accent); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-top: var(--s4); }
.actions form.inline { display: inline-flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin: 0; }
.pay-box { border: 1px solid var(--accent); border-radius: var(--r); padding: var(--s4); text-align: center; display: grid; gap: var(--s1); margin-bottom: var(--s3); }
.pay-box p { margin: 0; }
.pay-amount, .pay-number { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--accent); }
.leave-empty { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.item-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.item-form { border: 1px solid var(--divider); border-radius: var(--r); padding: var(--s3); margin: 0; min-width: 0; }
.item-form legend { font-weight: 600; padding: 0 var(--s1); }
.settings-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); align-items: end; }
.settings-row .field { margin: 0; }
.settings-row .field.check { min-height: 40px; }
.new-item-row { display: grid; grid-template-columns: minmax(150px, 2fr) 110px minmax(150px, 3fr) minmax(170px, 2fr) auto auto auto; gap: var(--s3); align-items: end; }
.new-item-row .field { margin: 0; }
.new-item-row .field.check { min-height: 40px; }
.new-item-row input[type=file], .item-table input[type=file] { font-size: 12px; max-width: 180px; }
.item-table td { vertical-align: middle; padding: 6px var(--s2); }
.item-table td:first-child { white-space: normal; }
.item-table input[type=text], .item-table input[type=number] { width: 100%; min-width: 70px; }
.item-table td.tick { text-align: center; }
.item-table td:nth-child(3), .item-table td:last-child { width: 96px; }
.item-table td:last-child input { min-width: 0; }
input[type=time] { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--control); border-radius: var(--r-sm); font: inherit; color: var(--text); background: var(--bg); }
.item-table th.tick { text-align: center; }
.item-table .pic-cell { display: flex; align-items: center; gap: var(--s2); }
.item-table img { width: 56px; height: 42px; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); align-items: start; }
.checkout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: start; }
.checkout .section:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 800px) {
	.new-item-row { grid-template-columns: 1fr 1fr; }
	.new-item-row .wide { grid-column: 1 / -1; }
	.two-up, .checkout { grid-template-columns: 1fr; gap: var(--s4); }
}
