/* ===== UI PASS 3 — SHELL: header, global venue, sync indicator, guidance, Venues, pre-audit, calculator =====
   Editorial hospitality: ivory canvas, paper cards that float on warm shadows
   (no boxed borders), serif italic titles, Space Grotesk body, mono numbers. */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --font: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --k-serif: ui-serif, 'New York', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --k-radius-lg: 8px;
  --k-shadow-warm: 0 1px 3px rgba(28, 25, 23, 0.1), 0 1px 2px -1px rgba(28, 25, 23, 0.1);
  --k-sage-bg: #EEF1EA;
  --k-sage: #4F5A45;
  /* Canvas is ivory fog; cards step up to paper (background shift, not borders). */
  --bg: var(--keva-fog);
  --canvas: var(--keva-fog);
  --surface: var(--keva-paper);
}
html, body, #app { background: var(--keva-fog); }
.k-card, .k-stat { background: var(--keva-paper); }

.k-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.k-num, #calcResult, #calcExpr, .k-pill-time { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.k-display {
  font-family: var(--font);
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--keva-slate);
}
.submit-btn.k-pill-btn { border-radius: 6px; } /* Keva buttons: 6px, never pills */
.submit-btn.k-btn-quiet { background: var(--keva-fog-200); border-color: transparent; color: var(--keva-slate); }
.submit-btn.k-btn-quiet:active { background: var(--keva-fog-300); }

/* ---------- Header ---------- */
.header {
  background: rgba(250, 248, 245, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 0;
  box-shadow: 0 1px 0 rgba(28, 25, 23, 0.06);
  padding: calc(8px + var(--safe-top)) max(12px, var(--safe-right)) 8px max(12px, var(--safe-left));
  gap: 8px;
}
.header-left { gap: 8px; }
.header-right { gap: 6px; }
.k-venue-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  min-width: 0;
  max-width: 100%;
  padding: 0 12px 0 10px;
  border: 1px solid rgba(28, 25, 23, 0.1);
  border-radius: 8px;
  background: var(--keva-paper);
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
  color: var(--keva-slate);
  font: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.k-venue-switch:hover {
  background: var(--keva-fog);
  border-color: rgba(28, 25, 23, 0.18);
}
.k-venue-switch:active { background: var(--keva-fog-200); }
.k-venue-switch.is-static { cursor: default; background: transparent; border-color: transparent; box-shadow: none; }
.k-venue-switch.is-static .k-venue-caret { display: none; }
.k-venue-ico { display: inline-flex; align-items: center; color: var(--keva-brass); line-height: 1; flex-shrink: 0; }
.k-venue-caret { display: inline-flex; align-items: center; color: var(--keva-slate-600); line-height: 1; flex-shrink: 0; }
.header .venue-badge {
  font-family: var(--font);
  font-style: normal;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--keva-slate);
  flex: 0 1 auto;
}

/* Audit pill: ● COUNT 1 · 00:42 */
.k-audit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--keva-brass-50);
  color: var(--keva-brass-700);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}
.k-audit-pill.hide { display: none; }
.k-audit-pill:active { background: var(--keva-brass-100); }
.k-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--keva-brass); flex-shrink: 0; }
.k-audit-pill.is-running .k-pill-dot { animation: kPulse 1.6s ease-in-out infinite; }
@keyframes kPulse { 50% { opacity: 0.35; } }
/* The badge text is the phase; its old chip look and phone hide don't apply inside the pill. */
.k-audit-pill #headerAuditBadge {
  display: inline !important;
  background: none;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
}

/* Sync pill: dot + one clear word */
.header .k-sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  background: var(--keva-olive-50);
  color: var(--keva-olive);
  flex-shrink: 0;
}
.header .k-sync.hide { display: none; }
.header .k-sync.is-uploading { background: var(--keva-brass-50); color: var(--keva-brass-700); }
.header .k-sync.is-offline { background: var(--k-sage-bg); color: var(--k-sage); }
.header .k-sync.is-error { background: var(--keva-error-50); color: var(--keva-error-700); }
.header .k-sync .k-sync-ico { font-size: 11px; line-height: 1; display: inline-flex; }
.header .k-sync .k-sync-ico .k-icon { width: 14px; height: 14px; }
/* Status dot (saved, live, open issue): a coloured dot, not an icon. */
.k-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.header .k-sync.is-uploading .k-sync-ico { animation: kPulse 1.4s ease-in-out infinite; }
.k-sync-short { display: none; }

/* Phones: brand tile and "12 counted" make way; short words; phase without timer. */
@media (max-width: 767px) {
  .header .k-brand-tile { display: none; }
  .header #headerCount { display: none; }
  .header .k-sync .k-sync-txt { display: none; }
  .header .k-sync .k-sync-short { display: inline; }
  .k-pill-time { display: none; }
  .k-audit-pill { padding: 0 10px; }
  .header .venue-badge { font-size: 18px; }
  .k-venue-switch { padding: 0 8px 0 4px; gap: 4px; }
}

/* ---------- Nav: idle data tabs when this venue has no audit ---------- */
.bottom-nav {
  background: rgba(250, 248, 245, 0.94);
  border-top: 0;
  box-shadow: 0 -1px 0 rgba(28, 25, 23, 0.06);
}
.nav-item { min-height: 44px; }
.nav-item.is-idle:not(.active) { opacity: 0.5; }
@media (min-width: 1024px) and (orientation: landscape) {
  .bottom-nav { border-right: 0; box-shadow: 1px 0 0 rgba(28, 25, 23, 0.06); background: var(--keva-fog-200); }
  .nav-item.active { background: var(--keva-paper); box-shadow: var(--k-shadow-warm); }
}

/* ---------- Venues page ---------- */
.venue-select-page h1.k-display { font-size: 34px; margin-bottom: 6px; font-weight: 500; letter-spacing: -0.015em; }
.venue-select-page .subtitle { font-size: 14px; color: var(--keva-slate-600); margin-bottom: 20px; }
.k-venue-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0; background: none; overflow: visible; }
@media (min-width: 768px) {
  .k-venue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .venue-select-page h1.k-display { font-size: 40px; }
}
.k-venue-grid .venue-card.k-venue-card,
.k-venue-grid .venue-card.k-venue-card + .venue-card {
  margin: 0;
  border: 0;
  border-radius: var(--k-radius-lg);
  background: var(--keva-paper);
  box-shadow: var(--k-shadow-warm);
  padding: 18px 16px 18px 18px;
  min-height: 92px;
  align-items: center;
  gap: 14px;
}
.k-venue-grid .venue-card.k-venue-card:focus-visible { outline: 2px solid var(--keva-brass); outline-offset: 3px; }
.k-venue-grid .venue-card.k-venue-card.is-sandbox {
  background: transparent;
  box-shadow: none;
  outline: 1.5px dashed var(--border-strong);
  outline-offset: -1.5px;
}
.k-venue-card .venue-avatar { width: 52px; height: 52px; border-radius: 8px; font-family: var(--mono); font-size: 15px; }
.k-venue-card .venue-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.k-venue-card .venue-addr { color: var(--keva-slate-600); font-size: 13px; }
.k-venue-card .venue-access { margin-top: 4px; font-size: 12px; color: var(--keva-slate-600); }
.k-venue-card .venue-role {
  background: none; padding: 0; text-transform: none; letter-spacing: 0;
  font-size: 12px; font-weight: 500; color: var(--keva-slate-600);
}
.k-vstatus { margin-top: 6px; font-size: 13px; color: var(--keva-slate-600); font-weight: 500; }
.k-vstatus.is-live { color: var(--keva-brass-700); font-weight: 600; }
#venueList .k-search input { border: 0; box-shadow: var(--k-shadow-warm); border-radius: 6px; }

/* ---------- Count page: no venue ---------- */
.k-guide {
  background: var(--keva-paper);
  border: 1px solid var(--keva-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
  padding: 24px;
  margin: 8px 0 16px;
  max-width: 560px;
}
.k-guide-title {
  font-family: var(--font);
  font-style: normal;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--keva-slate);
  margin: 2px 0 0;
}
.k-guide-body { font-size: 14px; color: var(--keva-slate-600); margin: 8px 0 18px; line-height: 1.5; }
.submit-btn.k-guide-btn { width: auto; min-height: 44px; padding: 0 24px; border-radius: 6px; font-weight: 500; }
#countNoVenue .k-guide { margin: 24px auto; }

/* ---------- Pre-audit ---------- */
.k-pre-hero { padding: 6px 0 22px; }
.k-pre-title { font-size: 34px; margin: 2px 0 6px; overflow-wrap: anywhere; }
.k-pre-addr { font-size: 15px; color: var(--keva-slate-600); }
.k-pre-who { font-size: 13px; color: var(--keva-slate-600); margin-top: 10px; }
#preAuditUser, #preAuditDate { font-size: 13px; font-weight: 600; color: var(--keva-slate); }
.k-btn-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}
#startAuditBtn.k-btn-outline .k-btn-chip { background: var(--keva-fog-200); }
#preAuditScreen #joinAuditBtn { margin-top: 10px; }
.k-pre-live { background: var(--keva-brass-50); border-radius: var(--k-radius-lg); padding: 16px 18px; margin: 0 0 14px; }
.k-pre-live .k-vstatus { margin: 0 0 12px; font-size: 14px; }
.k-pre-live .submit-btn { margin: 0; }
#preAuditScreen .k-back-link {
  display: block;
  width: auto;
  min-height: 44px;
  margin: 6px auto 0;
  padding: 0 12px;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--keva-slate-600);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.k-ready, .k-zones {
  background: var(--keva-paper);
  border-radius: var(--k-radius-lg);
  box-shadow: var(--k-shadow-warm);
}
.k-ready { padding: 16px 18px 8px; margin: 20px 0 12px; }
.k-ready .k-eyebrow { margin-bottom: 4px; }
.k-ready-row { display: flex; align-items: center; gap: 12px; min-height: 52px; font-size: 15px; color: var(--keva-slate); }
.k-ready-ico {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--keva-fog-200);
  color: var(--keva-slate-600);
  font-size: 13px; font-weight: 700;
}
.k-ready-ico.is-ok { background: var(--keva-olive-50); color: var(--keva-olive); }
.k-ready-txt { flex: 1; min-width: 0; }
.k-icon-pill {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--keva-fog-200);
  color: var(--keva-slate);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.k-icon-pill:active { background: var(--keva-fog-300); }
.k-zones { padding: 0 18px; margin-bottom: 12px; }
.k-zones > summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; list-style: none; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--keva-slate);
}
.k-zones > summary::-webkit-details-marker { display: none; }
.k-zones > summary:focus-visible { outline: 2px solid var(--keva-brass); outline-offset: 2px; border-radius: 6px; }
.k-zones-chev { color: var(--keva-slate-600); transition: transform 0.2s ease; }
.k-zones[open] .k-zones-chev { transform: rotate(90deg); }
.k-zones .k-chips { padding-bottom: 16px; }
.k-zones .k-chip { border: 0; background: var(--keva-fog-200); border-radius: 4px; cursor: default; }
@media (min-width: 768px) {
  .k-pre-title { font-size: 40px; }
  #preAuditScreen .submit-btn.k-pill-btn { max-width: 420px; }
}
@media (min-width: 1024px) {
  .k-pre .k-ready { margin-top: 0; }
  .k-pre-hero { padding-top: 24px; }
}

/* ---------- Active count: next-step line under the count bar ---------- */
.k-next-step {
  display: flex; align-items: center; gap: 8px;
  margin: -2px 0 12px;
  font-size: 14px; font-weight: 500;
  color: var(--keva-slate-600);
}
.k-next-step::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--keva-brass); flex-shrink: 0; }
.k-next-step.hide { display: none; }
/* One more auto row in the iPad two-column grid for the next-step line. */
@media (min-width: 1024px) {
  #activeAuditContent:not(.hide) { grid-template-rows: repeat(8, auto) 1fr; }
}

/* ---------- Sheet (venue switcher, sync status) ---------- */
.k-sheet-overlay {
  position: fixed; inset: 0; z-index: 350;
  background: rgba(28, 25, 23, 0.32);
  display: flex; align-items: flex-end; justify-content: center;
  animation: kFade 0.18s ease;
}
.k-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--keva-paper);
  border-radius: 12px 12px 0 0; /* Keva dialogs: 12px */
  padding: 10px max(20px, var(--safe-right)) calc(20px + var(--safe-bottom)) max(20px, var(--safe-left));
  box-shadow: 0 -8px 32px rgba(28, 25, 23, 0.16);
  animation: kSheetUp 0.22s ease;
}
.k-sheet-handle { width: 36px; height: 4px; border-radius: 999px; background: var(--keva-fog-300); margin: 0 auto 14px; }
.k-sheet-title { font-family: var(--font); font-style: normal; font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; color: var(--keva-slate); margin: 2px 0 12px; }
.k-sheet-body { font-size: 15px; line-height: 1.45; color: var(--keva-slate-600); margin: 0 0 18px; }
.k-sheet .submit-btn + .submit-btn { margin-top: 8px; }
.k-sheet .k-search input { border: 0; background: var(--keva-fog-200); border-radius: 6px; }
.k-sheet-list { display: flex; flex-direction: column; gap: 4px; }
.k-sheet-venue {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px;
  padding: 10px 12px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--keva-slate);
  font: inherit; text-align: left;
  cursor: pointer;
}
.k-sheet-venue:hover, .k-sheet-venue:focus-visible { background: var(--keva-fog-200); }
.k-sheet-venue.is-current { background: var(--keva-brass-50); }
.k-sheet-venue.is-sandbox { outline: 1.5px dashed var(--border-strong); outline-offset: -1.5px; }
.k-sheet-venue .k-avatar { font-family: var(--mono); }
.k-sheet-venue-body { flex: 1; min-width: 0; }
.k-sheet-venue-name { display: block; font-size: 16px; font-weight: 600; }
.k-sheet-venue .k-vstatus { margin-top: 2px; }
.k-sheet-venue-check { color: var(--keva-brass-700); font-size: 18px; font-weight: 700; }
.k-sync-big {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--keva-olive-50); color: var(--keva-olive);
  margin-bottom: 10px;
}
.k-sync-sheet.is-uploading .k-sync-big { background: var(--keva-brass-50); color: var(--keva-brass-700); }
.k-sync-sheet.is-offline .k-sync-big { background: var(--k-sage-bg); color: var(--k-sage); }
.k-sync-big .k-icon { width: 24px; height: 24px; }
.k-sync-sheet.is-error .k-sync-big { background: var(--keva-error-50); color: var(--keva-error-700); }
@media (min-width: 768px) {
  /* Tablet: a popover card near the top bar instead of a bottom sheet. */
  .k-sheet-overlay { align-items: flex-start; padding-top: calc(72px + var(--safe-top)); }
  .k-sheet { max-width: 440px; border-radius: 12px; padding: 20px; box-shadow: var(--shadow-lg); }
  .k-sheet-handle { display: none; }
}
@keyframes kFade { from { opacity: 0; } }
@keyframes kSheetUp { from { transform: translateY(24px); opacity: 0; } }

/* ---------- First-run tour ---------- */
.k-tour { position: fixed; inset: 0; z-index: 450; }
.k-tour-ring {
  position: fixed;
  border-radius: 8px;
  box-shadow: 0 0 0 3px var(--keva-brass), 0 0 0 9999px rgba(28, 25, 23, 0.45);
  pointer-events: none;
  transition: all 0.25s ease;
}
.k-tour.is-centered { background: rgba(28, 25, 23, 0.45); display: flex; align-items: center; justify-content: center; }
.k-tour-card {
  position: fixed;
  background: var(--keva-paper);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.k-tour.is-centered .k-tour-card { position: static; width: min(340px, calc(100vw - 32px)); }
.k-tour-title { font-family: var(--font); font-style: normal; font-weight: 600; font-size: 20px; line-height: 1.2; letter-spacing: -0.015em; color: var(--keva-slate); margin: 2px 0 6px; }
.k-tour-body { font-size: 15px; line-height: 1.45; color: var(--keva-slate-600); }
.k-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.k-tour-skip {
  min-height: 44px; padding: 0 12px;
  border: 0; background: none; border-radius: 6px;
  color: var(--keva-slate-600); font-family: var(--font); font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.submit-btn.k-tour-next { width: auto; min-height: 48px; padding: 0 26px; }

/* ---------- Calculator ---------- */
.k-calc-display { background: var(--keva-paper); border: 0; border-radius: var(--k-radius-lg); box-shadow: var(--k-shadow-warm); padding: 20px 20px 16px; }
.k-calc-keys .calc-key { border: 0; box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08); border-radius: 6px; }
.k-calc-keys .calc-key:not(.calc-fn):not(.calc-op):not(.calc-eq) { background: var(--keva-paper); }
.k-calc-recent { background: var(--keva-paper); border-radius: var(--k-radius-lg); box-shadow: var(--k-shadow-warm); padding: 4px 18px 12px; margin-top: 16px; }
.k-calc-recent .k-rows { background: none; border: 0; }
@media (min-width: 768px) {
  .k-calc-layout { align-items: stretch; }
  .k-calc-keys .calc-key { min-height: 72px; font-size: 24px; }
  .k-calc-recent { margin-top: 0; height: 100%; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .k-audit-pill.is-running .k-pill-dot,
  .header .k-sync.is-uploading .k-sync-ico,
  .k-sheet-overlay, .k-sheet, .k-tour-ring { animation: none !important; transition: none !important; }
}

/* Menu button: a quiet round target, not a boxed square. */
.header .icon-btn { border: 0; border-radius: 6px; background: transparent; }
.header .icon-btn:hover { background: var(--keva-fog-200); }
/* Sheet or tour open: the floating calculator must not sit on top of it. */
body:has(#kSheet) #calcFab, body:has(#kTour) #calcFab { visibility: hidden; }
/* "Back to venues" centres under the capped buttons, not the whole page. */
@media (min-width: 768px) { #preAuditScreen .k-back-link { width: 100%; max-width: 420px; margin-left: 0; } }

/* Lucide icons sit on the text line like Keva's; never squash in flex rows. */
.k-icon { flex-shrink: 0; vertical-align: -0.15em; }
/* Header venue initials tile: a small twin of the Venues card avatar. */
.k-venue-tile { width: 24px; height: 24px; border-radius: 7px; justify-content: center; background: var(--keva-brass-100); color: var(--keva-brass-700); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.02em; }
/* Login lockup: omega mark + serif italic "kount" + BY KEVA eyebrow. */
.k-login-lockup { display: inline-flex; align-items: center; gap: 12px; margin: 0 auto 18px; }
.k-login-mark { color: var(--keva-brass); flex-shrink: 0; }
.k-login-wordmark { text-align: left; }
.k-login-brand .k-login-word { font-family: var(--k-serif); font-style: italic; font-weight: 500; font-size: 40px; line-height: 1; letter-spacing: 0; color: var(--keva-slate); }
.k-login-brand .k-login-eyebrow { margin: 6px 0 0 2px; color: var(--keva-brass-700); }
/* Keeps a replaced glyph as an invisible, full-size text target (tests and find-in-page still match it). */
.k-glyph-keep { position: absolute; inset: 0; color: transparent; overflow: hidden; user-select: none; }

/* ===== REDESIGN v3 — shell & entry (login, venues, pre-audit, header, nav, calculator, tips) ===== */
/* Header: ONE audit pill (phase · timer · people). "N counted" folds away; Count page shows its own bar. */
.header #headerCount { display: none !important; }
.k-pill-people:empty { display: none; }
@media (max-width: 767px) { .k-pill-people { display: none; } }
/* Menu footer: the build version (data-version set in ui.js), never a toast. */
#headerMenu::after {
  content: attr(data-version);
  display: block;
  padding: 10px 16px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--keva-border);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--keva-slate-600);
}
#headerMenu:not([data-version])::after { display: none; }

/* Toasts: bottom centre above the nav (never over the header pills). */
.toast { top: auto; bottom: calc(84px + var(--safe-bottom)); border-radius: 6px; }
@media (min-width: 1024px) and (orientation: landscape) {
  .toast { top: auto; bottom: calc(24px + var(--safe-bottom)); }
}

/* Bottom nav (phone/portrait): 56px tabs, brass active tile behind the icon. */
.nav-item { min-height: 56px; justify-content: center; font-size: 11px; color: var(--keva-slate-600); }
.nav-item svg { border-radius: 6px; padding: 4px 12px; }
.nav-item.active { color: var(--keva-brass-700); }
.nav-item.active svg { background: var(--keva-brass-50); }
/* Lock badge for counters in Count 1: Lucide lock, not an emoji. */
.nav-item.is-locked::after {
  content: '';
  width: 10px; height: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* iPad rail: full height, active = brass icon on brass-50 tile, Calculator sits at the bottom. */
@media (min-width: 1024px) and (orientation: landscape) {
  .bottom-nav { height: 100vh; height: 100dvh; }
  .nav-item { min-height: 60px; border-radius: 8px; }
  .nav-item.active { background: var(--keva-brass-50); box-shadow: none; }
  .nav-item.active svg { background: none; }
  .nav-item[data-page="calculator"] { order: 99; margin-top: auto; }
}

/* Login: flat on paper, one slate button, quiet links. */
#page-login .form-input { min-height: 48px; border-radius: 6px; }
#page-login #loginBtn { min-height: 56px; border-radius: 6px; background: var(--keva-slate); border-color: var(--keva-slate); color: var(--keva-paper); }
#page-login #loginBtn:active { background: #000; }
#loginError { border-radius: 6px; }
.k-login-brand .k-login-title { font-family: var(--k-serif); font-style: italic; font-weight: 500; font-size: 26px; letter-spacing: -0.01em; color: var(--keva-slate); margin: 0; }
.k-login-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 10px; margin-top: 16px; font-size: 14px; color: var(--keva-slate-600); }
.k-login-links .k-login-link { display: inline-flex; align-items: center; min-height: 44px; }
.k-login-foot { font-size: 12px; color: var(--keva-slate-600); text-align: center; margin-top: 8px; }
.k-pw-toggle { border-radius: 6px; }
@media (max-width: 767px) { #page-login:not(.hide) { align-items: flex-start; padding-top: 14vh; } .k-login-links { flex-direction: column; gap: 0; } .k-login-links > span { display: none; } }

/* Venues + pre-audit: serif titles, cards 8px, brass "Counting now". */
.venue-select-page h1.k-display, .k-pre-title { font-family: var(--k-serif); font-style: italic; font-weight: 500; }
.k-venue-grid .venue-card.k-venue-card { min-height: 72px; }
.k-venue-card .v-chev { color: var(--keva-slate-600); display: inline-flex; }
.k-vstatus.is-live .k-dot { color: var(--keva-brass); }

/* Pre-audit: "Start audit · Count 1" reads as one label, not a badge inside a pill. */
#preAuditScreen #startAuditBtn { min-height: 56px; }
#preAuditScreen .submit-btn { border-radius: 6px; }
.k-btn-chip { margin-left: 0; padding: 0; border-radius: 4px; background: none !important; font-family: inherit; font-size: inherit; letter-spacing: 0; text-transform: none; vertical-align: baseline; }
.k-btn-chip::before { content: '\00b7\00a0'; }
.k-pre-live { border-radius: 8px; }
.k-ready-ico { border-radius: 6px; }

/* Coach tip: one dismissible line, replaces the automatic tour. */
.k-coach {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 4px 4px 4px 12px;
  border-radius: 8px;
  background: var(--keva-brass-50);
  color: var(--keva-brass-700);
  font-size: 14px; font-weight: 500;
}
.k-coach-txt { flex: 1; min-width: 0; color: var(--keva-slate); }
.k-coach-x {
  display: grid; place-items: center;
  min-width: 44px; min-height: 44px;
  border: 0; border-radius: 6px; background: none;
  color: var(--keva-slate-600); cursor: pointer;
}
.k-coach-x:hover { background: var(--keva-brass-100); }

/* Calculator: Keva radius; mono everywhere numbers live. */
.calc-key { border-radius: 6px; font-family: var(--mono); }
.k-calc-display, .k-calc-recent { border-radius: 8px; }
.calc-fab-panel { border-radius: 12px; }
.calc-key .k-icon { vertical-align: middle; }
