/* Outdoor theme: black on white, big type, nothing smaller than a gloved thumb. */
:root {
	--ink: #111; --paper: #fff; --dim: #555; --line: #222; --soft: #f1f1f1;
	--go: #0a7d2c; --go-soft: #dff5e5; --warn: #b85c00; --warn-soft: #fff1d6;
	--stop: #c0141c; --stop-soft: #ffe1e1; --cond: #6a2bb8; --cond-soft: #efe4ff; --acc: #ffd400;
	--tap: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 600 20px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: calc(110px + env(safe-area-inset-bottom)); overscroll-behavior: none; }
button { font: inherit; color: inherit; }
h1 { font-size: 30px; line-height: 1.15; margin: 4px 0 6px; }
h2 { font-size: 22px; margin: 18px 0 8px; }
.sub { color: var(--dim); font-weight: 500; font-size: 18px; }
main { padding: 10px 14px; max-width: 640px; margin: 0 auto; }

/* Top bar: who's tapping, sync, break, help */
#top { position: sticky; top: 0; z-index: 5; background: var(--ink); color: #fff; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; }
.bar { display: flex; gap: 6px; align-items: center; max-width: 640px; margin: 0 auto; }
.people { display: flex; gap: 6px; overflow-x: auto; flex: 1; }
.chip { min-height: 48px; padding: 0 14px; border-radius: 24px; border: 3px solid #fff; background: transparent; color: #fff; white-space: nowrap; font-size: 18px; }
.chip.on { background: var(--acc); border-color: var(--acc); color: #000; }
.chip small { font-weight: 500; opacity: .8; margin-left: 4px; }
.tb { min-height: 48px; min-width: 48px; padding: 0 10px; border-radius: 10px; border: 0; background: #333; color: #fff; font-size: 17px; }
.tb.help { background: var(--stop); }
.syncline { max-width: 640px; margin: 4px auto 0; font-size: 15px; font-weight: 500; opacity: .9; display: flex; justify-content: space-between; gap: 8px; }
.syncline .bad { color: #ffb3b3; }

/* Swipe-or-hold cards: the only way anything gets completed */
.swipe { position: relative; min-height: 84px; border: 3px solid var(--line); border-radius: 16px; margin: 10px 0; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; background: var(--paper); outline: none; }
.swipe .fill { position: absolute; inset: 0; width: 0; background: var(--acc); }
.swipe.holding .fill { width: 100%; transition: width .65s linear; }
.swipe .txt { position: relative; padding: 14px 16px 14px 76px; display: flex; flex-direction: column; justify-content: center; min-height: 78px; }
.swipe .txt small { font-weight: 500; color: var(--dim); font-size: 17px; }
.swipe .knob { position: absolute; left: 6px; top: 50%; margin-top: -30px; width: 60px; height: 60px; border-radius: 12px; background: var(--ink); color: var(--acc); display: grid; place-items: center; font-size: 34px; z-index: 1; }
.swipe.go { border-color: var(--go); }
.swipe.go .knob { background: var(--go); color: #fff; }
.swipe.big { min-height: 110px; }
.swipe.big .txt { min-height: 104px; font-size: 24px; }
.swipe.danger { border-color: var(--stop); }
.swipe.danger .knob { background: var(--stop); color: #fff; }
.swipe.done { border-color: var(--go); background: var(--go-soft); }
.swipe:focus-visible { box-shadow: 0 0 0 4px var(--acc); }
.hint { text-align: center; color: var(--dim); font-size: 15px; font-weight: 500; margin-top: -4px; }

.doneitem { display: flex; gap: 12px; align-items: center; min-height: 56px; padding: 8px 14px; border-radius: 12px; background: var(--go-soft); margin: 8px 0; color: #0b4d1e; }
.doneitem::before { content: "✓"; font-size: 28px; }
.progress { height: 14px; background: var(--soft); border-radius: 7px; overflow: hidden; margin: 6px 0 2px; }
.progress div { height: 100%; background: var(--go); transition: width .3s; }

.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--tap); border-radius: 14px; border: 3px solid var(--ink); background: var(--paper); font-size: 20px; margin: 10px 0; text-decoration: none; color: var(--ink); text-align: center; padding: 8px 12px; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.go { background: var(--go); border-color: var(--go); color: #fff; }
.btn.stop { background: var(--stop); border-color: var(--stop); color: #fff; }
.btn.quiet { border-color: #bbb; color: var(--dim); font-size: 18px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn { margin: 0; }

.card { border: 3px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 10px 0; }
.card.note { border-color: var(--warn); background: var(--warn-soft); }
.card.bad { border-color: var(--stop); background: var(--stop-soft); }
.where { font-size: 18px; font-weight: 600; margin-top: 6px; }
.where.near { color: var(--go); }

/* Person tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.tile { min-height: 96px; border-radius: 16px; border: 3px solid var(--ink); background: var(--paper); font-size: 24px; }
.tile small { display: block; font-size: 16px; font-weight: 500; color: var(--dim); }

/* Counter sheet */
.section { margin: 14px 0 6px; padding: 6px 10px; border-radius: 10px; background: var(--soft); font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.section.condition { background: var(--cond); color: #fff; }
.crow { padding: 8px 0 10px; border-bottom: 2px solid var(--soft); }
.crow .lab { display: flex; justify-content: space-between; align-items: baseline; font-size: 22px; }
.crow .ghost { color: #9a9a9a; font-weight: 500; font-size: 18px; }
.crow.diff .ghost { color: var(--warn); font-weight: 700; }
.crow.diff .val { border-color: var(--warn); }
.crow.over .val { border-color: var(--stop); background: var(--stop-soft); }
.ctr { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; margin-top: 6px; }
.ctr button { min-height: 76px; border-radius: 14px; border: 3px solid var(--ink); background: var(--paper); font-size: 40px; line-height: 1; }
.ctr .minus { background: var(--soft); }
.ctr .plus { background: var(--ink); color: #fff; }
.ctr .val { font-size: 44px; font-variant-numeric: tabular-nums; }
.crow.condition .plus { background: var(--cond); border-color: var(--cond); }
.crow.condition .minus { background: var(--cond-soft); border-color: var(--cond); }
.crow.condition .val { border-color: var(--cond); }
.msg { color: var(--stop); font-size: 17px; margin-top: 4px; }
textarea, input[type=text], input[type=password], input[type=time], input[type=tel] { width: 100%; font: inherit; font-size: 20px; padding: 12px; border: 3px solid var(--ink); border-radius: 12px; min-height: var(--tap); background: #fff; color: var(--ink); }
textarea { min-height: 110px; }
.compare { width: 100%; border-collapse: collapse; font-size: 20px; margin: 8px 0; }
.compare th, .compare td { padding: 10px 6px; text-align: right; border-bottom: 2px solid var(--soft); }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare tr.miss td { background: var(--warn-soft); }
.compare tr.miss td:last-child { color: var(--warn); }

/* Overlays */
#layer:empty { display: none; }
#layer { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; }
.sheet { background: var(--paper); width: 100%; max-width: 640px; margin: 0 auto; border-radius: 22px 22px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
.sheet h1 { font-size: 26px; }
.reasons { display: grid; gap: 10px; margin: 10px 0; }
.reasons button { min-height: var(--tap); border-radius: 14px; border: 3px solid var(--ink); background: var(--paper); text-align: left; padding: 0 16px; font-size: 20px; }
.reasons button.on { background: var(--acc); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.keypad button { min-height: 72px; border-radius: 14px; border: 3px solid var(--ink); background: var(--paper); font-size: 32px; }
.keyshow { font-size: 52px; text-align: center; font-variant-numeric: tabular-nums; min-height: 64px; border-bottom: 3px solid var(--ink); }

#toast:empty { display: none; }
#toast { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
#toast button { min-height: 64px; min-width: 120px; border-radius: 12px; border: 0; background: var(--acc); color: #000; font-size: 22px; }
.flagbtn { position: fixed; right: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 6; min-height: 56px; padding: 0 16px; border-radius: 28px; border: 3px solid var(--ink); background: var(--paper); font-size: 17px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }

.pulse { animation: pulse .35s ease-out; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 212, 0, .95); transform: scale(1.03); } 100% { box-shadow: 0 0 0 18px rgba(255, 212, 0, 0); transform: scale(1); } }
.flash { animation: flash .3s ease-out; }
@keyframes flash { 0% { background: var(--acc); } 100% { background: inherit; } }
.banner { padding: 12px 14px; border-radius: 12px; margin: 8px 0; font-size: 18px; }
.banner.bad { background: var(--stop); color: #fff; }
.banner.warn { background: var(--warn-soft); border: 3px solid var(--warn); }
.big-num { font-size: 56px; font-variant-numeric: tabular-nums; text-align: center; margin: 10px 0; }
.list-mini { font-size: 17px; font-weight: 500; color: var(--dim); }
