/* ============================================================================
   kiosk-app.css — the Allegra Floor Android app: make the pages look and feel like an app (js/kiosk-shell.js).
   Everything is scoped to html.kiosk-app, which only the Android app sets, so desktop and ordinary browsers are untouched.
   ============================================================================ */

html.kiosk-app { --ks-bar: 64px; }

/* ── Native-app behaviour: not a web page ─────────────────────────────────── */
html.kiosk-app, html.kiosk-app body {
  overscroll-behavior: none;                 /* no rubber-band bounce / pull-to-refresh of the whole page */
  -webkit-tap-highlight-color: transparent;  /* no grey flash on tap */
  -webkit-touch-callout: none;
  touch-action: manipulation;                /* no double-tap zoom delay */
}
html.kiosk-app body { -webkit-user-select: none; user-select: none; }   /* nothing is selectable ... */
html.kiosk-app input, html.kiosk-app textarea, html.kiosk-app select, html.kiosk-app [contenteditable], html.kiosk-app .selectable {
  -webkit-user-select: text; user-select: text;                         /* ... except what a person types or copies */
}
html.kiosk-app button, html.kiosk-app .btn, html.kiosk-app [role="button"], html.kiosk-app .fl-card, html.kiosk-app .dl-card {
  transition: transform 80ms ease, opacity 80ms ease;
}
html.kiosk-app button:active, html.kiosk-app .btn:active, html.kiosk-app [role="button"]:active, html.kiosk-app .fl-card:active, html.kiosk-app .dl-card:active {
  transform: scale(0.97); opacity: 0.88;     /* a press you can feel */
}

/* ── The desktop furniture goes ───────────────────────────────────────────── */
html.kiosk-app #sidebar-container, html.kiosk-app #sidebar-rail, html.kiosk-app #floor-nav-toggle,
html.kiosk-app #dark-mode-toggle, html.kiosk-app #user-name, html.kiosk-app #logout-btn,
html.kiosk-app #header .icon-btn:not(#ks-back):not(#ks-more), html.kiosk-app #page-heading-desc,
html.kiosk-app #dvBugBtn, html.kiosk-app #app-shell.floor-nav-open::before { display: none !important; }

/* ── App bar ──────────────────────────────────────────────────────────────── */
html.kiosk-app #header {
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  padding: calc(6px + env(safe-area-inset-top, 0px)) 6px 6px 6px;
  gap: 2px; align-items: center;
  background: var(--bg-card, #fff);
  border-bottom: 1px solid var(--border, #e3e3dd);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
}
html.kiosk-app #page-heading { flex: 1; min-width: 0; padding: 0 10px; }
html.kiosk-app #page-heading-title {
  font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2;
  white-space: normal; overflow: visible; text-overflow: clip;   /* the whole title, never "Drive…" */
}
html.kiosk-app #ks-back, html.kiosk-app #ks-more {
  flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 24px; background: none; color: var(--text-primary, #111); cursor: pointer;
}
html.kiosk-app #ks-back[hidden] { display: none; }
html.kiosk-app #ks-back:active, html.kiosk-app #ks-more:active { background: var(--surface-2, #eee); transform: none; }

/* ── Bottom tab bar ───────────────────────────────────────────────────────── */
html.kiosk-app #ks-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: flex; background: var(--bg-card, #fff); border-top: 1px solid var(--border, #e3e3dd);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .05);
}
html.kiosk-app .ks-tab {
  flex: 1; min-height: var(--ks-bar); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--text-secondary, #6b7280); font: 600 12px/1 inherit; font-family: inherit; cursor: pointer;
}
html.kiosk-app .ks-tab.ks-on { color: var(--accent, #c8102e); }
html.kiosk-app .ks-tab.ks-on svg { stroke-width: 2.3; }
html.kiosk-app .ks-tab:active { transform: scale(0.94); opacity: 1; }
html.kiosk-app #main-content { padding-bottom: calc(var(--ks-bar) + 16px + env(safe-area-inset-bottom, 0px)); }

/* ── "More" sheet ─────────────────────────────────────────────────────────── */
html.kiosk-app #ks-sheet { position: fixed; inset: 0; z-index: 2000; }
html.kiosk-app .ks-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); animation: ks-fade 140ms ease; }
html.kiosk-app .ks-panel {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg-card, #fff);
  border-radius: 18px 18px 0 0; padding: 14px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  animation: ks-up 180ms ease;
}
html.kiosk-app .ks-who { font-size: 15px; font-weight: 700; padding: 6px 8px 10px; color: var(--text-secondary, #6b7280); }
html.kiosk-app .ks-item {
  display: block; width: 100%; text-align: left; padding: 16px 12px; font: 600 17px/1.2 inherit; font-family: inherit;
  border: 0; border-top: 1px solid var(--border, #e8e8e2); background: none; color: var(--text-primary, #111); cursor: pointer;
}
html.kiosk-app .ks-danger { color: #b3261e; }
html.kiosk-app .ks-build { padding: 12px 12px 0; font-size: 12px; color: var(--text-secondary, #6b7280); }
@keyframes ks-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ks-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Screen transitions: a short slide/fade when the page changes (js/kiosk-shell.js _animate) ──────────────── */
html.kiosk-app #main-content.ks-go-fwd  { animation: ks-in-fwd 190ms ease-out; }
html.kiosk-app #main-content.ks-go-back { animation: ks-in-back 190ms ease-out; }
html.kiosk-app #main-content.ks-go-fade { animation: ks-in-fade 160ms ease-out; }
@keyframes ks-in-fwd  { from { opacity: 0; transform: translateX(28px); }  to { opacity: 1; transform: none; } }
@keyframes ks-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes ks-in-fade { from { opacity: 0; } to { opacity: 1; } }
/* Full-screen layers rise in instead of snapping on */
html.kiosk-app #ps-overlay, html.kiosk-app #dvDetailsOverlay, html.kiosk-app #dvArriveOverlay, html.kiosk-app #signaturePadContainer, html.kiosk-app #dl-viewer { animation: ks-up 200ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  html.kiosk-app #main-content, html.kiosk-app #ps-overlay, html.kiosk-app #dvDetailsOverlay, html.kiosk-app #dvArriveOverlay, html.kiosk-app #signaturePadContainer,
  html.kiosk-app #dl-viewer, html.kiosk-app .ks-scrim, html.kiosk-app .ks-panel { animation: none !important; }
}

/* ── The iPhone app (PrintLogic, html.kiosk-ios): raised Scan bubble, Deliveries strip, More tab ─────────────── */
html.kiosk-ios #ks-more { display: none !important; }               /* More is a tab on the iPhone */
html.kiosk-ios #ks-logo { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; margin: 0 2px 0 4px; }   /* the logo lives in the app bar on every page */
html.kiosk-ios #ks-plus {
  flex: 0 0 auto; width: 44px; height: 44px; margin: 0 6px 0 4px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: var(--accent, #c8102e); color: #fff; cursor: pointer;   /* a red disc with a white plus (Jeff 2026-11-09: not green) */
  box-shadow: 0 2px 8px rgba(200, 16, 46, .35);
}
html.kiosk-ios #ks-plus svg { stroke-width: 3; }
html.kiosk-ios #ks-plus:active { background: var(--accent, #c8102e); transform: scale(0.92); }
html.kiosk-app .ks-scrim { cursor: pointer; }                           /* iOS only treats a tap on something that looks tappable as a click */
html.kiosk-ios { --ks-bar: 60px; }
html.kiosk-ios #ks-tabs { overflow: visible; }
html.kiosk-ios .ks-tab .ks-label { font-size: 11.5px; }
html.kiosk-ios .ks-bubble { flex: 0 0 84px; position: relative; min-height: var(--ks-bar); color: var(--text-secondary, #6b7280); }
html.kiosk-ios .ks-bubble .ks-disc {
  position: absolute; left: 50%; top: -48px; width: 68px; height: 68px; margin-left: -34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent, #c8102e); color: #fff;
  border: 4px solid var(--bg-card, #fff); box-shadow: 0 6px 16px rgba(200, 16, 46, .42);
}
html.kiosk-ios .ks-bubble .ks-label { position: absolute; left: 0; right: 0; bottom: 7px; text-align: center; }
html.kiosk-ios .ks-bubble.ks-on { color: var(--accent, #c8102e); }
html.kiosk-ios .ks-bubble.ks-on .ks-disc { box-shadow: 0 6px 20px rgba(200, 16, 46, .6); }
html.kiosk-ios .ks-bubble.ks-on svg { stroke-width: 2.4; }
html.kiosk-ios .ks-bubble:active { transform: none; }
html.kiosk-ios .ks-bubble:active .ks-disc { transform: scale(0.93); }

html.kiosk-ios #ks-strip {
  display: flex; gap: 4px; margin: 8px 12px 0; padding: 3px; border-radius: 11px; background: var(--surface-2, #eceef1);
}
html.kiosk-ios .ks-seg {
  flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: none; font: 600 14px/1 inherit; font-family: inherit;
  color: var(--text-secondary, #6b7280); cursor: pointer;
}
html.kiosk-ios .ks-seg.ks-on { background: var(--bg-card, #fff); color: var(--text-primary, #111); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
html.kiosk-app .ks-siri { padding: 4px 12px 10px; font-size: 14px; line-height: 1.7; color: var(--text-secondary, #6b7280); border-top: 1px solid var(--border, #e8e8e2); }

/* iPhone: the More and + sheets are easy to read (Jeff 2026-11-09: "that text was too small") */
html.kiosk-ios .ks-who { font-size: 18px; padding: 8px 10px 12px; }
html.kiosk-ios .ks-item { font-size: 22px; padding: 20px 14px; }
html.kiosk-ios .ks-siri { font-size: 17px; line-height: 1.9; }
html.kiosk-ios .ks-build { font-size: 14px; }
