@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(fonts/plex-ar-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(fonts/plex-la-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0152-0153, U+2000-200B, U+2012-206F, U+20AC, U+2212; }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(fonts/plex-ar-600.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(fonts/plex-la-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0152-0153, U+2000-200B, U+2012-206F, U+20AC, U+2212; }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(fonts/plex-ar-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(fonts/plex-la-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0152-0153, U+2000-200B, U+2012-206F, U+20AC, U+2212; }

:root {
  --page: #f2f3f5; --paper: #fff; --line: #dfe3ea; --ink: #0d1117; --soft: #566176; --brand: #1d72f5; --brand-ink: #155fd1;
  --cover: #103a80; --cover-ink: #fff; --cover-soft: #c3d5f3; --bar: #a9c4ee; --good: #12793a; --bad: #c22424; --warn: #f6ecd5; --warn-ink: #5c4208; --due: #96560a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0a121c; --paper: #101c2a; --line: #22354b; --ink: #e8edf5; --soft: #93a5be; --brand: #60a5fa; --brand-ink: #8dbffc;
    --cover: #0f2f66; --cover-ink: #fff; --cover-soft: #b6cbee; --bar: #2f5489; --good: #4ade9b; --bad: #fca5a5; --warn: #33280d; --warn-ink: #f2d48a; --due: #fbbf4d;
  }
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--page); color: var(--ink); font: 400 1rem/1.6 Plex, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; min-height: 2.75rem; -webkit-tap-highlight-color: transparent; }
:is(button, input, a):focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
small { font-size: .55em; font-weight: 600; }
.icon { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* The cover: the shop's name and, on the first screen, the day. */
header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .25rem; padding: calc(env(safe-area-inset-top) + .625rem) 1.25rem .625rem; background: var(--cover); color: var(--cover-ink); }
header div { flex: 1; min-width: 0; }
header h1 { font-size: 1.0625rem; font-weight: 700; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header p { display: flex; align-items: center; gap: .375rem; color: var(--cover-soft); font-size: .8125rem; line-height: 1.4; }
header p::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: #6ee7a8; }
header p.is-off::before { background: #fcd57a; }
.round.is-back { margin-inline: -.75rem .25rem; }
.round { display: grid; place-items: center; width: 2.75rem; border-radius: 50%; margin-inline-end: -.5rem; }
.round + .round { margin-inline-start: .5rem; }
header .round:focus-visible { outline-color: #fff; }
.is-busy .icon { animation: turn 1s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.hero { background: var(--cover); color: var(--cover-ink); padding: .5rem 1.25rem 1.75rem; }
.hero h2 { font-size: 1rem; font-weight: 400; color: var(--cover-soft); }
.hero .figure { font-size: clamp(2.5rem, 13vw, 3.75rem); }
.hero .under, .hero .tape-key dt { color: var(--cover-soft); }
.kept { margin: 1.25rem 0 .625rem; }
.kept strong { font-weight: 700; }
.kept small { font-size: .8em; }
.tape { display: block; width: 100%; height: 1.5rem; border-radius: .25rem; }
[dir="rtl"] .tape { transform: scaleX(-1); }
.tape .cost { fill: #5f86c4; } .tape .expenses { fill: #a9c1e8; } .tape .profit { fill: #6ee7a8; }
.tape-key { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-top: .625rem; font-size: .875rem; }
.tape-key div { display: flex; align-items: baseline; gap: .375rem; }
.tape-key div::before { content: ''; width: .625rem; height: .625rem; border-radius: .125rem; background: #5f86c4; }
.tape-key .expenses::before { background: #a9c1e8; } .tape-key .profit::before { background: #6ee7a8; }
.tape-key dd { font-weight: 600; }

main { max-width: 40rem; margin-inline: auto; padding-bottom: calc(env(safe-area-inset-bottom) + 5.5rem); }
main > section:not(.hero) { padding: 1.5rem 1.25rem 0; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; }
section > h3:not(:first-child) { margin-top: 1.75rem; }
.lead > span { color: var(--soft); }
.figure { font-size: 2.25rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.under, .note { color: var(--soft); font-size: .9375rem; }
.under > span { margin-inline-start: .75rem; }
.note { font-size: .8125rem; margin-top: .75rem; }
.empty { color: var(--soft); padding-block: 1.5rem; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--due); } .strong { font-weight: 700; }
.rows { margin-top: .75rem; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: .75rem; border-bottom: 1px solid var(--line); }
.row dt { color: var(--soft); flex: none; max-width: 55%; }
.row dd { font-weight: 600; font-size: 1.0625rem; text-align: end; min-width: 0; overflow-wrap: anywhere; }
.row dd small { font-size: .75em; }
.row dd span { display: block; font-size: .8125rem; font-weight: 400; color: var(--soft); }

/* Four doors under the cover */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; padding: 1.25rem 1.25rem 0; }
.tile { display: grid; gap: .25rem; padding: .875rem 1rem; border-radius: .875rem; background: var(--paper); color: inherit; text-decoration: none; min-width: 0; }
.tile span { color: var(--soft); font-size: .875rem; line-height: 1.4; }
.tile strong { font-size: 1.1875rem; font-weight: 700; overflow-wrap: anywhere; }
.than { opacity: .9; }

.chart { margin-top: .75rem; }
.chart svg { display: block; width: 100%; height: 9rem; touch-action: pan-y; }
.chart .base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bar { fill: var(--bar); pointer-events: none; }
.chart .bar.is-loss { fill: var(--bad); opacity: .55; }
.chart .is-on .bar { fill: var(--brand); } .chart .is-on .bar.is-loss { fill: var(--bad); opacity: 1; }
.chart-tip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .75rem; min-height: 1.75rem; font-size: .875rem; color: var(--soft); }
.chart-tip strong { color: var(--ink); font-size: 1rem; }
.chart-tip small { font-size: .75em; }
[dir="rtl"] .chart-tip { direction: rtl; }
.chart figcaption { display: flex; justify-content: space-between; color: var(--soft); font-size: .8125rem; margin-top: .25rem; }
.bars { list-style: none; padding: 0; margin-top: .5rem; display: grid; gap: .875rem; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; }
.bars span { overflow-wrap: anywhere; } .bars strong { font-weight: 600; }
.bars svg { grid-column: 1 / -1; width: 100%; height: .5rem; } [dir="rtl"] .bars svg { transform: scaleX(-1); }
.bars .track { fill: var(--line); } .bars .bar { fill: var(--brand); }

.find { width: 100%; min-height: 2.875rem; margin-top: 1rem; padding-inline: .875rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--paper); font-size: 1rem; }
.chips { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; margin: .75rem -1.25rem 0; padding-inline: 1.25rem; }
.chips button { flex: none; min-height: 2.75rem; padding-inline: 1rem; border-radius: 99px; background: var(--paper); color: var(--soft); font-size: .9375rem; }
.chips [aria-pressed="true"] { background: var(--cover); color: #fff; font-weight: 600; }
.chips + .lead, .chips + h3 { margin-top: 1.25rem; }
.switch { display: grid; grid-template-columns: 1fr 1fr; gap: .1875rem; padding: .1875rem; margin-bottom: 1.25rem; border-radius: .875rem; background: color-mix(in srgb, var(--line) 70%, transparent); }
.switch a { display: grid; place-items: center; min-height: 2.75rem; border-radius: .6875rem; color: var(--soft); text-decoration: none; }
.switch [aria-current] { background: var(--paper); color: var(--ink); font-weight: 600; }

.list { list-style: none; padding: 0; margin-top: .75rem; }
.list li { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.list li > :first-child { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: .875rem; min-height: 3.5rem; padding-block: .625rem; min-width: 0; color: inherit; text-decoration: none; }
.list .day { display: block; padding: 1.25rem 0 .375rem; color: var(--soft); font-size: .875rem; font-weight: 600; border: 0; }
.what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.what b { font-weight: 600; display: block; line-height: 1.45; }
.what small, .end small { display: block; font-size: .8125rem; font-weight: 400; color: var(--soft); line-height: 1.5; }
.what small span { margin-inline-start: .5rem; }
.end { flex: none; max-width: 55%; text-align: end; line-height: 1.4; }
.end strong { font-weight: 600; }
.end strong small { display: inline; font-size: .75em; }
.list .icon { flex: none; width: 1.125rem; height: 1.125rem; color: var(--soft); }
[dir="rtl"] .list .icon, [dir="rtl"] .is-back .icon { transform: scaleX(-1); }
.list.menu .icon:first-child { width: 1.5rem; height: 1.5rem; color: var(--brand-ink); transform: none; }
.tel { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-inline-start: .25rem; border-radius: 50%; background: color-mix(in srgb, var(--brand) 12%, transparent); }
.list .tel .icon { color: var(--brand-ink); transform: none; }
.badge { display: inline-block; padding: .0625rem .625rem; border-radius: 99px; font-size: .8125rem; font-weight: 600; background: color-mix(in srgb, var(--soft) 14%, transparent); color: var(--ink); }
.badge.is-paid { background: color-mix(in srgb, var(--good) 14%, transparent); } .badge.is-unpaid, .badge.is-partial { background: color-mix(in srgb, var(--due) 16%, transparent); }
.call { display: inline-flex; align-items: center; justify-content: center; gap: .625rem; width: 100%; margin-top: 1rem; text-decoration: none; }
.stack { display: grid; margin-top: 1rem; }
.wide { display: flex; align-items: center; width: calc(100% + 1rem); min-height: 3rem; text-decoration: none; }
.wait { color: var(--soft); padding: 2rem 1.25rem; text-align: center; }

nav { position: fixed; inset: auto 0 0; z-index: 2; display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line); }
nav a { text-decoration: none; display: grid; justify-items: center; align-content: center; gap: .125rem; min-height: 4rem; color: var(--soft); font-size: .8125rem; line-height: 1.3; }
nav [aria-current] { color: var(--brand-ink); font-weight: 600; }
nav a:focus-visible { outline-offset: -3px; }
.problem { margin: 1rem 1.25rem 0; padding: .75rem 1rem; border-radius: .625rem; background: var(--warn); color: var(--warn-ink); font-size: .9375rem; }

.gate { min-height: 100dvh; max-width: 26rem; display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding: 2rem 1.5rem; }
.gate img { border-radius: 1rem; }
.gate h1 { font-size: 1.75rem; line-height: 1.3; }
.gate > p { color: var(--soft); }
.gate .problem { margin: 0; color: var(--warn-ink); }
.gate form, .gate label { display: grid; gap: .5rem; }
.gate form { gap: 1rem; }
.gate label { font-weight: 600; font-size: .9375rem; }
.gate input { min-height: 3.25rem; padding-inline: .875rem; border: 1px solid var(--soft); border-radius: .75rem; background: var(--paper); font-size: 1.0625rem; font-weight: 600; letter-spacing: .03em; text-align: center; }
.primary { min-height: 3.25rem; padding-inline: 1.5rem; border-radius: .75rem; background: var(--cover); color: #fff; font-weight: 600; }
.primary:disabled { opacity: .6; cursor: progress; }
.quiet { padding-inline: .5rem; margin-inline: -.5rem; color: var(--brand-ink); font-weight: 600; text-align: start; }
.quiet.bad { color: var(--bad); }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.25rem; margin-top: .5rem; color: var(--soft); font-size: .875rem; }
.wait { text-align: center; }
@media (prefers-reduced-motion: reduce) { .is-busy .icon { animation-duration: 4s; } }
.scanned { display: grid; gap: .375rem; padding: .875rem 1rem; border: 1px solid var(--line); border-radius: .875rem; text-align: center; }
.scanned span { font-size: .8125rem; }
.scanned bdi { font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--ink); }
