/* Forefront Mechanical receipts. One idea runs through it: register tape. Receipts are slips of paper with a torn
   zigzag edge, and the year is one long adding-machine tape. Paper stays paper-colored in light and dark. Brand
   colors, fonts and the leaning gold button come from the main site (forefront-mechanical/public/site.css). */
@font-face { font-family: "Red Hat Display"; font-style: normal; font-weight: 500 900; font-display: swap; src: url(/fonts/red-hat-display.woff2) format("woff2"); }
@font-face { font-family: "Red Hat Display"; font-style: italic; font-weight: 500 900; font-display: swap; src: url(/fonts/red-hat-display-italic.woff2) format("woff2"); }
@font-face { font-family: "Red Hat Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/red-hat-text.woff2) format("woff2"); }
:root {
  color-scheme: light;
  --ground: #E9ECEB; --surface: #F6F7F7; --ink: #131715; --muted: #4A544F; --line: #C3CAC7;
  --gold: #D4AF37; --gold-hi: #E3C35A; --on-gold: #121212; --gold-ink: #6E5600; --danger: #B3261E;
  --paper: #FCFBF7; --paper-ink: #1A1C1A; --paper-muted: #5B625E; --paper-line: #D9D6CB;
  --display: "Red Hat Display", "Segoe UI", system-ui, sans-serif; --text: "Red Hat Text", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1); --lean: -12deg; --bar: 68px;
}
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --ground: #0F1312; --surface: #161B1A; --ink: #E4E8E6; --muted: #9BA6A1; --line: #2A3230; --gold-ink: #E8C95A; --danger: #F2766B;
    --paper: #F1EFE7; --paper-line: #CFCBBE; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1.0625rem/1.45 var(--text); -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--bar) + 28px + env(safe-area-inset-bottom)); overflow-x: hidden; }
h1, h2, h3, p { margin: 0; }
h2 { font: 800 1.15rem/1.2 var(--display); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.quiet { color: var(--muted); padding: 18px 0; }

/* paper */
.slip, .tape, .tape-thumb { --tooth: 14px; background: var(--paper); color: var(--paper-ink);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%; }

/* the leaning gold button, as on the jobs app */
.go { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 26px; border: 0; border-radius: 7px; background: var(--gold); color: var(--on-gold);
  font: 800 1.1rem/1 var(--display); text-decoration: none; transform: skewX(var(--lean)); transition: background .15s, transform .15s var(--ease); }
.go > span { transform: skewX(calc(var(--lean) * -1)); }
.go:active { transform: skewX(var(--lean)) scale(.97); background: var(--gold-hi); }
.go:disabled { opacity: .55; }
.go.danger { background: var(--danger); color: #fff; }
.plain { min-height: 48px; padding: 0 14px; border: 0; background: none; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); border-radius: 8px; }
.plain.strong { border: 1.5px solid var(--ink); text-decoration: none; }
.plain.danger { color: var(--danger); }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 18px; }
.acts .go { margin-right: 6px; flex: 1 1 150px; }
.acts.col { flex-direction: column; align-items: stretch; }
.acts.col .go { flex: none; margin: 0 6px; }

/* frame */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 10px 20px; background: var(--ground); border-bottom: 1px solid var(--line); }
.top .logo { font-size: 24px; } .top-logo { display: flex; text-decoration: none; }
.top-more { width: 48px; height: 48px; border: 0; background: none; border-radius: 10px; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 0; outline: none; }
.tabs { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; height: calc(var(--bar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); }
.tabs > a, .tabs > button:not(.snap) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--bar); border: 0; background: none; color: var(--muted); font: 600 .78rem/1 var(--text); text-decoration: none; border-top: 3px solid transparent; }
.tabs .on { color: var(--ink); border-top-color: var(--gold); }
.snap { justify-self: center; align-self: center; width: 74px; height: 62px; margin-top: -22px; border: 0; border-radius: 9px; background: var(--gold); color: var(--on-gold); transform: skewX(var(--lean)) translateY(-10px); box-shadow: 0 0 0 5px var(--ground); }
.snap svg { transform: skewX(calc(var(--lean) * -1)); stroke-width: 2; }
.snap:active { background: var(--gold-hi); }
.toast { position: fixed; z-index: 9; left: 12px; right: 12px; bottom: calc(var(--bar) + 30px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 520px; margin: 0 auto; padding: 14px 16px;
  border-radius: 10px; background: var(--ink); color: var(--ground); font-weight: 600; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s, transform .18s var(--ease); }
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast button { border: 0; background: none; color: var(--gold); font-weight: 800; min-height: 32px; }

/* to confirm: slips waiting on the counter */
.strip { margin: 0 -16px 18px; }
.strip h2 { display: flex; align-items: center; gap: 10px; padding: 0 16px 10px; }
.strip h2 b { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 6px; background: var(--gold); color: var(--on-gold); font-size: .95rem; transform: skewX(var(--lean)); }
.strip-row { display: flex; gap: 12px; overflow-x: auto; padding: 2px 16px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.strip-row::-webkit-scrollbar { display: none; }
.mini { flex: none; width: 132px; padding: 8px 8px 22px; text-decoration: none; scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; }
.mini img, .mini .tape-thumb { width: 100%; height: 132px; object-fit: cover; object-position: top; -webkit-mask: none; mask: none; background: var(--paper-line); display: block; }
.mini-what { font: 700 .9rem/1.2 var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-amt { font: 800 1.05rem/1 var(--display); font-variant-numeric: tabular-nums; min-height: 1em; }
.mini.busy img { animation: reading 1.1s ease-in-out infinite alternate; }
@keyframes reading { from { opacity: .45; } to { opacity: 1; } }

/* find */
.find { display: grid; gap: 10px; }
.search { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--ink); outline: none; font-size: 1.0625rem; }
.search:focus-within { border-color: var(--ink); }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.filters select { flex: none; height: 44px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 22px; background: var(--surface); font-weight: 600; font-size: .95rem; max-width: 60vw; }
.tally { padding: 14px 2px 0; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; min-height: 1.4em; }

/* rows */
.month { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 8px; font: 800 1rem/1.2 var(--display); color: var(--muted); }
.month span { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px dashed var(--line); text-decoration: none; min-height: 68px; }
.tape-thumb { --tooth: 8px; flex: none; width: 44px; height: 56px; object-fit: cover; object-position: top; display: block; }
.tape-thumb.none { background: repeating-linear-gradient(0deg, var(--paper) 0 9px, var(--paper-line) 9px 10px); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; text-decoration: none; }
.row-main b { font: 700 1.05rem/1.25 var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-amt { flex: none; display: grid; justify-items: end; gap: 4px; font: 800 1.1rem/1 var(--display); font-variant-numeric: tabular-nums; }
.row-amt.back { color: var(--gold-ink); }
.row-amt i { font: 700 .74rem/1 var(--text); font-style: normal; padding: 5px 8px; border-radius: 5px; background: var(--gold); color: var(--on-gold); }
.row-amt i.ask { background: none; border: 1.5px solid var(--ink); color: var(--ink); }
.more { display: block; width: 100%; min-height: 52px; margin-top: 14px; border: 1.5px solid var(--line); border-radius: 12px; background: none; font-weight: 700; }
.first { margin: 34px auto 0; max-width: 300px; padding: 34px 22px 44px; display: grid; justify-items: center; gap: 20px; font: 800 1.3rem/1.2 var(--display); }

/* one receipt */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -6px 0 6px -6px; padding-right: 10px; color: var(--muted); font-weight: 700; text-decoration: none; }
.shot { display: block; width: 100%; max-height: 46vh; overflow: hidden; padding: 0; border: 0; border-radius: 4px; background: #0A0C0B; }
.shot img { display: block; width: 100%; max-height: 46vh; object-fit: contain; }
.shot.none { display: grid; place-items: center; height: 96px; background: repeating-linear-gradient(0deg, var(--surface) 0 13px, var(--line) 13px 14px); color: var(--muted); font-weight: 700; }
.pdf { margin-top: 4px; }
.twin { margin-top: 14px; padding: 12px 14px 6px; border: 2px solid var(--gold); border-radius: 12px; }
.twin > p { font: 800 1rem/1.2 var(--display); }
.twin-acts { display: flex; gap: 6px; }
.fields { display: grid; gap: 14px; margin-top: 18px; }
.fields label { display: grid; gap: 6px; font-size: .86rem; font-weight: 700; color: var(--muted); min-width: 0; }
.fields input:not([type=checkbox]), .fields select, .fields textarea { width: 100%; min-width: 0; min-height: 54px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 1.0625rem; font-weight: 500; -webkit-appearance: none; appearance: none; }
.fields select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.fields textarea { padding: 14px; min-height: 76px; resize: vertical; line-height: 1.4; }
.fields input:focus, .fields select:focus, .fields textarea:focus { outline: none; border-color: var(--ink); }
.fields .need { border-color: var(--gold) !important; border-width: 2.5px; background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.fields .big input { font: 800 1.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.line { margin-top: -8px; font-size: .88rem; color: var(--muted); min-height: 0; }
.line:empty { display: none; }
.check { display: flex !important; align-items: center; gap: 12px; min-height: 44px; font-size: 1rem !important; color: var(--ink) !important; font-weight: 600 !important; }
.check input { width: 26px; height: 26px; accent-color: var(--gold); flex: none; }
.err { color: var(--danger); font-weight: 700; } .err:empty { display: none; }
.stamp { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.detail { transition: transform .26s var(--ease), opacity .26s; }
.detail.filed { transform: translateY(40px); opacity: 0; }

/* sheets */
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; align-items: end; background: rgba(0, 0, 0, .55); }
.panel { background: var(--ground); padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; font-weight: 600; max-width: 640px; width: 100%; margin: 0 auto; }
.sheet.zoom { background: #050606; align-items: stretch; }
.zoom-pan { overflow: auto; -webkit-overflow-scrolling: touch; height: 100dvh; touch-action: pan-x pan-y pinch-zoom; }
.zoom-pan img { display: block; width: 100%; } .zoom-pan img.in { width: 240%; max-width: none; }
.zoom-x { position: fixed; z-index: 21; top: 12px; right: 12px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: var(--gold); color: var(--on-gold); font-weight: 800; }

/* miles */
.odo { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 4px 2px 16px; }
.odo-num { font: italic 900 3.1rem/1 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.odo-what { color: var(--muted); font-weight: 600; }
.odo select, .tape-head select { border: 0; background: none; font: inherit; color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; padding: 6px 2px; }
.trip { padding: 20px 16px 34px; margin: 0; }
.trip label { color: var(--paper-muted); }
.trip input { background: #fff !important; color: var(--paper-ink) !important; border-color: var(--paper-line) !important; }
.trip input:focus { border-color: var(--paper-ink) !important; }
.trip .need { border-color: var(--gold) !important; }
.trip summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--paper-muted); cursor: pointer; }
.trip details[open] { display: grid; gap: 14px; }
.trip .plain { color: var(--paper-ink); } .trip .plain.danger { color: #B3261E; }
.trip-row .row-amt { grid-auto-flow: column; align-items: center; gap: 12px; }
.again { min-height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 20px; background: none; font: 700 .85rem/1 var(--text); }

/* year: the tape */
.year { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .16)); }
.tape { --tooth: 16px; padding: 26px 18px 44px; font-variant-numeric: tabular-nums; }
.tape-head { display: grid; justify-items: center; gap: 2px; padding-bottom: 16px; text-align: center; }
.tape-head b { font: italic 900 1.5rem/1.1 var(--display); }
.tape-head span { color: var(--paper-muted); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 74px; padding: 0 4px 18px; margin-bottom: 8px; border-bottom: 1px dashed var(--paper-line); }
.bars i { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; font-style: normal; }
.bars b { width: 100%; height: var(--h); min-height: 2px; background: var(--paper-ink); }
.bars span { font: 700 .68rem/1 var(--text); color: var(--paper-muted); }
.tl { display: flex; align-items: flex-end; gap: 6px; padding: 9px 0; }
.tl-name { font-weight: 700; display: grid; gap: 1px; }
.tl-name small { font-weight: 500; font-size: .8rem; color: var(--paper-muted); }
.tl-dots { flex: 1; min-width: 14px; border-bottom: 2px dotted var(--paper-muted); opacity: .5; margin-bottom: 6px; }
.tl-amt { font: 800 1.08rem/1.2 var(--display); white-space: nowrap; }
.tl.minor .tl-name, .tl.minor .tl-amt { font-weight: 500; font-size: .92rem; color: var(--paper-muted); }
.tl.minor { padding: 5px 0; }
.tl-rule { height: 6px; margin: 8px 0 2px; border-top: 2px solid var(--paper-ink); border-bottom: 2px solid var(--paper-ink); }
.tl.sum .tl-name { font: italic 900 1.5rem/1 var(--display); } .tl.sum .tl-amt { font: italic 900 1.7rem/1 var(--display); } .tl.sum .tl-dots { border: 0; }
.tl-gap { height: 14px; border-bottom: 1px dashed var(--paper-line); margin-bottom: 10px; }
.tape-note, .tape-empty { margin-top: 16px; font-size: .84rem; line-height: 1.4; color: var(--paper-muted); }
.tape-empty { text-align: center; padding: 10px 0 14px; font-size: 1rem; font-weight: 600; }
.flags { display: flex; flex-wrap: wrap; gap: 0 4px; margin-top: 10px; }
.exports { display: grid; gap: 14px; margin: 26px 0 0; filter: none; }
.exports .go { margin: 0 6px; }
.exports select { min-height: 48px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--surface); font-weight: 600; min-width: 0; width: 100%; }
.links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.links.col { flex-direction: column; margin-top: 14px; }
.links a, .links button { min-height: 44px; display: inline-flex; align-items: center; padding: 0; border: 0; background: none; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }

/* settings */
.settings h2, .pagehead { margin: 26px 0 0; } .settings .fields h2 { margin-top: 12px; }
.rate { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px dashed var(--line); }
.rate .cents { position: relative; display: block; } .rate .cents span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.rate button { grid-column: 1 / -1; justify-self: start; border: 0; background: none; min-height: 36px; padding: 0; color: var(--muted); font-weight: 600; text-decoration: underline; }
.meter { height: 14px; margin-top: 12px; border: 1.5px solid var(--ink); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); }

/* sign in */
.signin { padding-bottom: 0; min-height: 100dvh; display: grid; }
.door { width: 100%; max-width: 380px; margin: auto; padding: 24px 20px 60px; display: grid; gap: 30px; justify-items: center; }
.door-logo .logo { font-size: 34px; }
.door-slip { width: 100%; padding: 30px 22px 46px; }
.door-slip h1 { font: italic 900 2.3rem/1 var(--display); margin-bottom: 22px; }
.door-slip form { display: grid; gap: 8px; }
.door-slip label { font-size: .86rem; font-weight: 700; color: var(--paper-muted); }
.door-slip input { width: 100%; height: 56px; padding: 0 14px; border: 1.5px solid var(--paper-line); border-radius: 11px; background: #fff; color: var(--paper-ink); font-size: 1.15rem; }
.door-slip input:focus { outline: none; border-color: var(--paper-ink); }
.door-slip .go { margin: 14px 6px 0; }
.door-msg { min-height: 1.4em; color: #B3261E; font-weight: 700; } .door-msg:not(.show):empty { visibility: hidden; }
.busy .go span::after { content: " ..."; }

@media (prefers-reduced-motion: no-preference) {
  .tape .tl, .tape .tl-rule { animation: print .32s var(--ease) backwards; }
  .tape .tl:nth-of-type(2) { animation-delay: .04s; } .tape .tl:nth-of-type(3) { animation-delay: .08s; } .tape .tl:nth-of-type(4) { animation-delay: .12s; }
  .tape .tl:nth-of-type(5) { animation-delay: .16s; } .tape .tl:nth-of-type(6) { animation-delay: .2s; } .tape .tl:nth-of-type(n+7) { animation-delay: .24s; }
  @keyframes print { from { opacity: 0; transform: translateY(-8px); } }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { .shot, .shot img { max-height: 60vh; } }
@media print {
  .top, .tabs, .exports, .flags, .toast { display: none !important; }
  body { background: #fff; padding: 0; } .year { filter: none; } .tape { -webkit-mask: none; mask: none; background: #fff; } .tape select { text-decoration: none; -webkit-appearance: none; appearance: none; }
}
