/* Kiosk styles. Designed for a Kindle Fire mounted upright (portrait, roughly
   600-800px wide); a landscape layout is kept at the bottom as a fallback.
   Every tap target is at least ~64px tall. */
:root {
  --black: #000; --panel: #111; --key: #1a1a1a; --line: #2a2a2a;
  --white: #fff; --muted: #a3a3a3; --green: #39ff14; --red: #ff4d4d;
  --gutter: clamp(16px, 4vw, 32px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--black); color: var(--white);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.3em; font-size: 22px; margin: 8px 0; }

.screen { position: fixed; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }
.center { margin: auto; text-align: center; padding: var(--gutter); width: 100%; max-width: 760px; }
h1 { font-size: clamp(40px, 7vw, 56px); margin: 0 0 10px; }
.status { font-size: clamp(22px, 3.6vw, 28px); color: var(--muted); margin: 0 0 28px; }

/* Logo: made for white, so it sits on a white panel on the black screens. */
.logo { display: block; width: min(320px, 52vw); margin: 0 auto 8px; background: #fff; padding: 12px 16px; border-radius: 16px; }
.brand { font-size: 30px; font-weight: 800; letter-spacing: .12em; }
.brand span { color: var(--green); }

/* Camera preview: small, top-right corner */
#cam { position: fixed; right: 14px; top: 14px; width: 104px; height: 78px; object-fit: cover;
  border-radius: 10px; border: 2px solid var(--green); z-index: 5; background: #111; transform: scaleX(-1); }
#cam.off { display: none; }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 50; transition: opacity .25s; }
#flash.on { opacity: .8; transition: none; }

/* ---------- 1. Keypad ---------- */
.pad-screen { align-items: center; justify-content: space-evenly; padding: var(--gutter); }
.left { text-align: center; }
.clock { font-size: clamp(76px, 15vw, 120px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 6px; }
.date { font-size: clamp(22px, 3.6vw, 28px); color: var(--muted); }
.dots { display: flex; gap: 22px; justify-content: center; margin: 28px 0 12px; }
.dots i { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--muted); }
.dots i.on { background: var(--green); border-color: var(--green); box-shadow: 0 0 14px var(--green); }
.hint { font-size: clamp(22px, 3.6vw, 28px); color: var(--muted); min-height: 1.3em; }
.hint.err { color: var(--red); font-weight: 700; }
.camstate { font-size: 15px; color: var(--muted); margin-top: 8px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2.4vw, 20px); width: 100%; max-width: 620px; }
.pad button { height: clamp(96px, 11.5vh, 140px); font-size: clamp(48px, 8vw, 68px); font-weight: 700;
  border: 2px solid var(--line); border-radius: 22px; background: var(--key); }
.pad button:active { border-color: var(--green); color: var(--green); background: #0d1f08; }
.pad .fn { font-size: clamp(24px, 4vw, 32px); color: var(--muted); }

/* ---------- 2. In / Out choice ---------- */
.big-buttons { display: flex; flex-direction: column; gap: 22px; }
.big { width: 100%; min-height: clamp(170px, 22vh, 260px); padding: 20px; border-radius: 28px;
  font-size: clamp(32px, 5.5vw, 44px); border: 3px solid var(--line); background: var(--key); }
.big b { display: block; font-size: clamp(64px, 12vw, 96px); letter-spacing: .04em; line-height: 1.05; }
.big small { display: block; font-size: clamp(18px, 3vw, 24px); color: var(--muted); margin-top: 8px; }
.big.suggested { background: var(--green); border-color: var(--green); color: var(--black); box-shadow: 0 0 32px rgba(57,255,20,.45); }
.big.suggested small { color: #133d06; }
.photo-note { color: var(--muted); font-size: 20px; margin: 22px 0 0; }
.row-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.row-links > button { flex: 1 1 220px; }
.ghost { background: none; border: 2px solid #444; border-radius: 16px; min-height: 68px; padding: 14px 22px; font-size: 22px; }
.primary { background: var(--green); color: var(--black); border: 0; border-radius: 16px; min-height: 68px;
  padding: 14px 28px; font-size: 24px; font-weight: 800; }
.primary.wide { width: 100%; min-height: 88px; font-size: 30px; }

/* ---------- 4. Confirmation ---------- */
.confirm.in { background: var(--green); color: var(--black); }
.confirm.out { background: var(--white); color: var(--black); }
.confirm h1 { font-size: clamp(64px, 13vw, 100px); }
.confirm .status { color: inherit; opacity: .75; }
.cf-time { font-size: clamp(36px, 6vw, 48px); font-weight: 700; margin: 0 0 14px; }

/* ---------- 5. Time card ---------- */
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px var(--gutter);
  border-bottom: 2px solid var(--green); }
.card-head > div:first-child { flex: 1 1 auto; }
.card-head h2 { margin: 0; font-size: clamp(26px, 4.4vw, 34px); }
.card-head .muted { font-size: 18px; }
.seg { order: 3; flex: 1 1 100%; display: flex; border: 2px solid #444; border-radius: 16px; overflow: hidden; }
.seg button { flex: 1; background: none; border: 0; min-height: 60px; font-size: 21px; color: var(--muted); }
.seg button.on { background: var(--white); color: var(--black); font-weight: 800; }
#tcDone { min-width: 130px; }
.card-body { flex: 1; overflow-y: auto; padding: 4px var(--gutter); -webkit-overflow-scrolling: touch; }
.banner { background: #1d1d1d; border-left: 4px solid var(--green); padding: 12px 16px; font-size: 19px; }
table.tc { width: 100%; border-collapse: collapse; font-size: clamp(19px, 3.2vw, 24px); }
.tc thead { display: none; }
.tc td { padding: 12px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tc td:first-child { white-space: nowrap; font-weight: 700; width: 1%; padding-right: 14px; }
.tc .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; width: 1%; white-space: nowrap; }
.tc td:last-child { width: 1%; padding-left: 12px; }
.tc tr.sun td, .tc tr.future td { color: #555; }
.tc tr.today td:first-child { color: var(--green); }
.pair { display: block; white-space: nowrap; line-height: 1.5; }
.tag { display: inline-block; font-size: 14px; padding: 3px 9px; border-radius: 99px; margin: 2px 6px 2px 0; vertical-align: middle; font-weight: 800; }
.tag.edit { background: var(--white); color: var(--black); }
.tag.pto { background: #1d1d1d; color: var(--green); border: 1px solid var(--green); }
.tag.miss { background: var(--red); color: var(--black); }
.tag.live { background: var(--green); color: var(--black); }
.edit-btn { background: none; border: 2px solid var(--green); color: var(--green); border-radius: 14px;
  min-width: 96px; min-height: 60px; font-size: 21px; font-weight: 800; }
.edit-btn:active { background: var(--green); color: var(--black); }
.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 12px; padding: 12px var(--gutter);
  border-top: 2px solid var(--line); font-size: 17px; text-align: center; color: var(--muted); }
.totals span { display: flex; flex-direction: column; }
.totals b { color: var(--green); font-size: clamp(26px, 4.6vw, 34px); }
.totals .pto-left { grid-column: 1 / -1; font-size: 18px; }

/* Verify time card */
.verify-bar { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px var(--gutter); background: #0d1f08;
  border-top: 3px solid var(--green); font-size: 20px; }
.verify-bar > div { flex: 1 1 100%; }
.verify-bar button { flex: 1 1 auto; min-height: 80px; }
.verify-bar .primary { flex: 2 1 auto; font-size: 26px; }
.verify-err { margin: 8px 0; padding: 0 var(--gutter); }
.verify-err:empty { display: none; }

/* ---------- 6. Edit a day ---------- */
.ed-row { display: flex; gap: 12px; align-items: flex-end; margin: 12px 0; }
.ed-row label { flex: 1; font-size: 16px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.ed-row .rm { background: none; border: 2px solid #444; color: var(--red); border-radius: 14px; font-size: 28px; width: 72px; height: 72px; flex: none; }
.add { width: 100%; margin: 6px 0; }
h3 { font-size: 22px; margin: 24px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chips button { flex: 1 1 auto; background: var(--key); border: 2px solid #444; border-radius: 99px; min-height: 64px; padding: 10px 22px; font-size: 20px; }
.chips button.on { background: var(--green); color: var(--black); border-color: var(--green); font-weight: 800; }
.pto-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.pto-row .step { width: 80px; height: 80px; border-radius: 18px; border: 3px solid var(--green); background: none;
  color: var(--green); font-size: 44px; font-weight: 800; line-height: 1; }
.pto-row .step:active { background: var(--green); color: var(--black); }
.pto-val { font-size: 24px; min-width: 110px; text-align: center; }
.pto-val b { font-size: 48px; color: var(--green); }
.pto-row .muted { flex: 1 1 100%; font-size: 18px; }
#s-edit .totals { display: flex; gap: 14px; }
#s-edit .totals button { flex: 1; min-height: 84px; font-size: 26px; }

/* Error banner at the top of a screen (hidden when empty) */
.alert { margin: 12px var(--gutter) 0; padding: 14px 18px; border-radius: 14px; background: var(--red); color: var(--black);
  font-size: 22px; font-weight: 800; }
.alert:empty { display: none; }
.center .alert { margin: 0 0 14px; }

/* Time picker buttons (open the scroll-wheel picker) */
.tp { width: 100%; min-height: 72px; font-size: clamp(28px, 5vw, 36px); font-weight: 700; border-radius: 14px;
  border: 2px solid #444; background: var(--key); color: var(--white); font-variant-numeric: tabular-nums; }
.tp.empty { color: #777; }
.tp:active { border-color: var(--green); }
.tp-big { min-height: 96px; font-size: 48px; border: 3px solid var(--green); margin: 8px 0; }
.tp-big.empty { font-size: 28px; }

/* Scroll-wheel picker sheet */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; }
.sheet-box { width: 100%; background: #111; border-top: 3px solid var(--green); border-radius: 24px 24px 0 0; padding: 18px var(--gutter) 24px; }
.sheet-title { text-align: center; font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.wheels { position: relative; display: flex; justify-content: center; align-items: center; gap: 6px; height: 320px; }
.wheel { position: relative; z-index: 2; height: 320px; width: 120px; overflow-y: scroll; scroll-snap-type: y mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.wheel::-webkit-scrollbar { display: none; }
.wheel.ampm { width: 110px; margin-left: 14px; }
.wheel .item, .wheel .spacer { height: 64px; line-height: 64px; text-align: center; scroll-snap-align: center; }
.wheel .item { font-size: 40px; font-weight: 600; color: #666; font-variant-numeric: tabular-nums; }
.wheel .item.sel { color: var(--white); font-weight: 800; }
.wheel.ampm .item { font-size: 32px; }
.colon { font-size: 44px; font-weight: 800; z-index: 2; }
.wheel-band { position: absolute; left: 0; right: 0; top: 128px; height: 64px; z-index: 1; pointer-events: none;
  border-top: 2px solid var(--green); border-bottom: 2px solid var(--green); background: #0d1f08; border-radius: 12px; }
.sheet-actions { display: flex; gap: 12px; margin-top: 18px; }
.sheet-actions button { flex: 1; min-height: 76px; font-size: 24px; }
.sheet-actions .primary { flex: 2; }

/* ---------- Landscape fallback ---------- */
@media (orientation: landscape) {
  .pad-screen { flex-direction: row; gap: 32px; max-width: 1100px; margin: 0 auto; }
  .left { flex: 1; }
  .pad { flex: 1; max-width: 440px; }
  .pad button { height: clamp(84px, 16vh, 110px); }
  .big-buttons { flex-direction: row; }
  .big { min-height: 200px; }
  #cam { top: auto; bottom: 14px; }
  .seg { order: 0; flex: 0 1 360px; }
}
