/* Kiosk — Hub OMS Design Language */
:root{
  --red:#c81e1e;--red-h:#a81818;--red-bg:#fef2f2;--red-b:#fecaca;
  --bg:#f4f4f5;--white:#fff;--text:#111;--muted:#9ca3af;--muted-d:#6b7280;
  --border:#e5e7eb;--border-d:#d1d5db;
  --green:#16a34a;--green-bg:#f0fdf4;--amber:#d97706;--blue:#1d4ed8;
  --r:12px;--r-lg:16px;
  --shadow:0 1px 3px rgba(0,0,0,.08),0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:0 4px 24px rgba(0,0,0,.12);
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
svg{fill:none;display:block;flex-shrink:0;overflow:visible}
svg path,svg circle,svg rect,svg polyline{fill:none}
body{font-family:'Inter',sans-serif;background:var(--white);color:var(--text);overflow:hidden}
button,input{font-family:inherit}

/* ── Pages ─────────────────────────────────────────────────── */
.page{position:fixed;inset:0;display:none;flex-direction:column;background:var(--white)}
.page.active{display:flex}

/* ── Shared Topbar ──────────────────────────────────────────── */
.k-topbar{height:52px;background:var(--white);border-bottom:1px solid var(--border);
  padding:0 24px;display:flex;align-items:center;justify-content:space-between;
  flex-shrink:0;z-index:10}
.k-topbar-mark{width:30px;height:30px;background:var(--red);border-radius:7px;
  display:flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:800;color:#fff;flex-shrink:0}
.k-topbar-brand{font-size:13px;font-weight:600;color:var(--muted-d);margin-left:10px}
.k-topbar-left{display:flex;align-items:center;gap:10px}
.k-topbar-right{display:flex;align-items:center;gap:8px}
.k-session-ref{font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums;
  background:var(--bg);border:1px solid var(--border);border-radius:6px;
  padding:3px 8px;letter-spacing:.04em}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary{background:var(--red);color:#fff;border:none;border-radius:8px;
  padding:11px 20px;font-size:14px;font-weight:700;cursor:pointer;
  display:inline-flex;align-items:center;gap:7px;transition:background .12s;white-space:nowrap}
.btn-primary:hover{background:var(--red-h)}
.btn-primary:active{transform:scale(.97)}
.btn-outline{background:var(--white);border:1px solid var(--border);color:var(--muted-d);
  border-radius:8px;padding:10px 16px;font-size:13px;font-weight:600;cursor:pointer;
  display:inline-flex;align-items:center;gap:7px;transition:all .12s;white-space:nowrap}
.btn-outline:hover{border-color:var(--red);color:var(--red)}
.btn-ghost{background:none;border:none;color:var(--muted);font-size:13px;font-weight:500;
  cursor:pointer;padding:6px 10px;border-radius:7px;transition:all .12s}
.btn-ghost:hover{background:var(--bg);color:var(--text)}
.btn-sm{padding:7px 12px;font-size:12px}

/* ── Card ───────────────────────────────────────────────────── */
.card{background:var(--white);border:1px solid var(--border);border-radius:var(--r);
  box-shadow:var(--shadow);overflow:hidden}

/* ── Mark ───────────────────────────────────────────────────── */
.ss-mark{width:34px;height:34px;background:var(--red);border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  font-size:12px;font-weight:800;color:#fff;flex-shrink:0}

/* ── Badge ──────────────────────────────────────────────────── */
.badge{display:inline-block;font-size:10px;font-weight:700;padding:2px 8px;
  border-radius:20px;letter-spacing:.03em;white-space:nowrap}
.b-red{background:var(--red-bg);color:var(--red);border:1px solid var(--red-b)}
.b-green{background:var(--green-bg);color:var(--green);border:1px solid #bbf7d0}
.b-amber{background:#fffbeb;color:var(--amber);border:1px solid #fde68a}
.b-blue{background:#eff6ff;color:var(--blue);border:1px solid #bfdbfe}
.b-muted{background:var(--bg);color:var(--muted);border:1px solid var(--border)}

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════════════ */
#page-login{align-items:center;justify-content:center;background:var(--bg)}
.login-wrap{width:100%;max-width:960px;padding:40px 24px;display:flex;
  flex-direction:column;align-items:center;gap:40px}
.login-header{text-align:center}
.login-header .ss-mark{width:44px;height:44px;font-size:14px;margin:0 auto 12px}
.login-title{font-size:22px;font-weight:800;letter-spacing:-.02em;color:var(--text)}
.login-sub{font-size:13px;color:var(--muted);margin-top:4px;font-weight:500}
.brand-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;width:100%}
.brand-card{background:var(--white);border:1px solid var(--border);border-radius:var(--r-lg);
  padding:32px 24px;cursor:pointer;text-align:center;
  border-top:3px solid var(--border);transition:all .2s;
  display:flex;flex-direction:column;align-items:center;gap:12px}
.brand-card:hover{border-top-color:var(--red);box-shadow:var(--shadow-lg);transform:translateY(-2px)}
.brand-card.selected{border-top-color:var(--red);box-shadow:0 0 0 2px rgba(200,30,30,.15)}
.brand-card-icon{width:48px;height:48px;border-radius:10px;background:var(--red-bg);
  display:flex;align-items:center;justify-content:center}
.brand-card-icon svg{width:24px;height:24px;stroke:var(--red);fill:none}
.brand-card-name{font-size:17px;font-weight:800;color:var(--text)}
.brand-card-sub{font-size:12px;color:var(--muted);font-weight:500}

/* Password modal */
.pass-modal{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:100;
  display:none;align-items:center;justify-content:center;
  transition:opacity .2s}
.pass-modal.show{display:flex}
.pass-box{background:var(--white);border-radius:var(--r-lg);padding:36px 32px;
  width:100%;max-width:400px;box-shadow:var(--shadow-lg)}
.pass-box h2{font-size:16px;font-weight:800;margin-bottom:4px}
.pass-box p{font-size:12px;color:var(--muted);margin-bottom:24px}
.pass-label{display:block;font-size:11px;font-weight:700;color:var(--muted-d);
  letter-spacing:.08em;text-transform:uppercase;margin-bottom:5px}
.pass-input{width:100%;border:1px solid var(--border);border-radius:8px;
  padding:12px 14px;font-size:15px;outline:none;color:var(--text);
  transition:border .12s;margin-bottom:14px;letter-spacing:.12em}
.pass-input:focus{border-color:var(--red)}
.pass-actions{display:flex;gap:8px}
.pass-error{background:var(--red-bg);border:1px solid var(--red-b);color:var(--red);
  border-radius:7px;padding:9px 12px;font-size:12px;margin-bottom:12px}

/* ══════════════════════════════════════════════════════════════
   START PAGE
══════════════════════════════════════════════════════════════ */
#page-start{background:var(--bg)}
.start-body{flex:1;display:flex;align-items:center;justify-content:center}
.start-card{background:var(--white);border:1px solid var(--border);border-radius:20px;
  box-shadow:var(--shadow-lg);padding:64px 80px;text-align:center;cursor:pointer;
  transition:transform .2s,box-shadow .2s;user-select:none;
  animation:pulse-card 3s ease-in-out infinite}
.start-card:hover{transform:translateY(-4px);box-shadow:0 8px 40px rgba(0,0,0,.12)}
.start-card:active{transform:scale(.97)}
@keyframes pulse-card{0%,100%{box-shadow:var(--shadow-lg)}
  50%{box-shadow:0 4px 40px rgba(200,30,30,.15)}}
.start-tap-label{font-size:12px;font-weight:700;letter-spacing:.2em;text-transform:uppercase;
  color:var(--muted);margin-bottom:20px}
.start-tap-title{font-size:clamp(2rem,4vw,3.5rem);font-weight:900;letter-spacing:-.03em;
  color:var(--text);margin-bottom:8px}
.start-tap-title span{color:var(--red)}
.start-tap-sub{font-size:15px;color:var(--muted);font-weight:400}
.start-tap-icon{width:64px;height:64px;background:var(--red-bg);border-radius:16px;
  display:flex;align-items:center;justify-content:center;margin:24px auto 0}
.start-tap-icon svg{width:32px;height:32px;stroke:var(--red);fill:none}
.start-clock{font-size:12px;color:var(--muted);margin-top:8px;
  font-variant-numeric:tabular-nums}

/* ══════════════════════════════════════════════════════════════
   SCREENSAVER
══════════════════════════════════════════════════════════════ */
#page-screensaver{background:#111;cursor:pointer}
.ss-body{flex:1;display:flex;align-items:center;justify-content:center;padding:32px}
.ss-product{display:grid;grid-template-columns:1fr 1fr;gap:0;
  background:var(--white);border-radius:20px;overflow:hidden;
  max-width:1100px;width:100%;box-shadow:0 8px 60px rgba(0,0,0,.4)}
.ss-img-col{background:var(--bg);display:flex;align-items:center;justify-content:center;
  padding:48px;min-height:500px}
.ss-img-col img{max-height:400px;object-fit:contain;
  animation:float 4s ease-in-out infinite}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-12px)}}
.ss-info-col{padding:48px 40px;display:flex;flex-direction:column;gap:24px;justify-content:center}
.ss-tap-hint{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);
  font-size:12px;color:rgba(255,255,255,.4);letter-spacing:.12em;text-transform:uppercase}

/* Note pyramid in screensaver */
.ss-product-name{font-size:clamp(1.2rem,2.5vw,2rem);font-weight:800;
  letter-spacing:-.02em;line-height:1.1}
.ss-product-sku{font-size:10px;font-weight:700;color:var(--red);
  letter-spacing:.12em;text-transform:uppercase;margin-bottom:4px}
.notes-pyramid{display:flex;flex-direction:column;gap:16px}
.notes-tier{}
.notes-tier-label{font-size:9px;font-weight:800;letter-spacing:.2em;
  text-transform:uppercase;color:var(--muted);margin-bottom:8px}
.notes-tier-items{display:flex;gap:12px;flex-wrap:wrap}
.note-item{display:flex;flex-direction:column;align-items:center;gap:5px;
  min-width:56px}
.note-item img{width:52px;height:52px;border-radius:10px;object-fit:cover;
  background:var(--bg);border:1px solid var(--border)}
.note-item span{font-size:10px;font-weight:600;color:var(--muted-d);
  text-align:center;line-height:1.2}
.note-item-placeholder{width:52px;height:52px;border-radius:10px;
  background:var(--bg);border:1px solid var(--border)}

/* ══════════════════════════════════════════════════════════════
   SCAN PAGE
══════════════════════════════════════════════════════════════ */
#page-scan{align-items:center;justify-content:center;gap:32px;padding:24px}
.scan-wrap{display:flex;flex-direction:column;align-items:center;gap:24px}
.scan-label{font-size:10px;font-weight:800;letter-spacing:.25em;text-transform:uppercase;
  color:var(--muted)}
.scan-viewport{position:relative;width:clamp(240px,30vw,340px);
  height:clamp(240px,30vw,340px);flex-shrink:0}
.scan-circle{position:absolute;inset:0;border-radius:50%;overflow:hidden;
  background:var(--bg);border:2px solid var(--border)}
#scan-video{width:100%;height:100%;object-fit:cover;border-radius:50%}
/* Corner brackets */
.scan-bracket{position:absolute;width:28px;height:28px}
.scan-bracket::before,.scan-bracket::after{content:'';position:absolute;
  background:var(--text);border-radius:1px}
.scan-bracket::before{width:100%;height:2px}
.scan-bracket::after{width:2px;height:100%}
.scan-bracket.tl{top:8px;left:8px}
.scan-bracket.tl::before,.scan-bracket.tl::after{top:0;left:0}
.scan-bracket.tr{top:8px;right:8px;transform:scaleX(-1)}
.scan-bracket.tr::before,.scan-bracket.tr::after{top:0;left:0}
.scan-bracket.bl{bottom:8px;left:8px;transform:scaleY(-1)}
.scan-bracket.bl::before,.scan-bracket.bl::after{top:0;left:0}
.scan-bracket.br{bottom:8px;right:8px;transform:scale(-1)}
.scan-bracket.br::before,.scan-bracket.br::after{top:0;left:0}
/* Scan line */
.scan-line{position:absolute;left:8px;right:8px;height:2px;
  background:linear-gradient(90deg,transparent,var(--red),transparent);
  border-radius:1px;opacity:0;top:50%}
.scan-line.active{opacity:1;animation:sweep 2s ease-in-out infinite}
@keyframes sweep{0%{top:10%}100%{top:90%}}
/* Outer ring */
.scan-ring{position:absolute;inset:-8px;border-radius:50%;
  border:2px solid transparent;border-top-color:var(--red);opacity:0}
.scan-ring.active{opacity:1;animation:spin 1.2s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
/* Scan status */
.scan-status{text-align:center}
.scan-status-title{font-size:clamp(1rem,2vw,1.4rem);font-weight:700;
  letter-spacing:-.01em;margin-bottom:6px}
.scan-status-sub{font-size:13px;color:var(--muted)}
.scan-status-sub.error{color:var(--red)}
.scan-skip{margin-top:8px}

/* Video orientation */
#scan-video[data-angle="90"] {transform:rotate(-90deg) scale(1.4)}
#scan-video[data-angle="270"]{transform:rotate(90deg) scale(1.4)}
#scan-video[data-angle="180"]{transform:rotate(180deg)}

/* ══════════════════════════════════════════════════════════════
   SCENT PICKER
══════════════════════════════════════════════════════════════ */
#page-scent{background:var(--bg)}
.scent-body{flex:1;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:28px;padding:24px;overflow-y:auto}
.scent-question{text-align:center}
.scent-question-label{font-size:10px;font-weight:700;letter-spacing:.2em;
  text-transform:uppercase;color:var(--muted);margin-bottom:8px}
.scent-question-title{font-size:clamp(1.4rem,3vw,2.4rem);font-weight:800;
  letter-spacing:-.02em;color:var(--text)}
.scent-question-title span{color:var(--red)}
/* Family cards */
.family-grid{display:grid;grid-template-columns:repeat(4,1fr);
  gap:14px;width:100%;max-width:1400px}
.family-card{background:var(--white);border:1px solid var(--border);
  border-top:3px solid var(--border);border-radius:var(--r);
  padding:28px 20px;cursor:pointer;text-align:center;
  transition:all .18s;display:flex;flex-direction:column;
  align-items:center;gap:10px}
.family-card:hover{border-top-color:var(--red);transform:translateY(-3px);
  box-shadow:var(--shadow-lg)}
.family-card:active{transform:scale(.97)}
.family-card.selected{border-top-color:var(--red);background:var(--red-bg)}
.family-card-icon{width:44px;height:44px;border-radius:10px;
  background:var(--bg);display:flex;align-items:center;justify-content:center}
.family-card-icon svg{width:22px;height:22px;stroke:var(--muted-d);fill:none}
.family-card.selected .family-card-icon svg{stroke:var(--red)}
.family-card-name{font-size:15px;font-weight:700;color:var(--text)}
.family-card-sub{font-size:11px;color:var(--muted);line-height:1.4}
/* Sub chips */
.sub-chips{display:flex;flex-wrap:wrap;gap:10px;
  justify-content:center;width:100%;max-width:1000px}
.sub-chip{background:var(--white);border:1px solid var(--border);
  border-radius:50px;padding:10px 22px;font-size:14px;font-weight:600;
  color:var(--muted-d);cursor:pointer;transition:all .15s}
.sub-chip:hover{border-color:var(--red);color:var(--red);background:var(--red-bg)}
.sub-chip:active{transform:scale(.96)}
.scent-back{margin-top:4px}

/* ══════════════════════════════════════════════════════════════
   JOURNEY PAGE
══════════════════════════════════════════════════════════════ */
#page-journey{background:var(--white)}
.journey-body{flex:1;display:grid;grid-template-columns:42% 1fr;
  overflow:hidden;min-height:0}
/* Left: image panel */
.journey-img-panel{background:var(--bg);display:flex;align-items:center;
  justify-content:center;padding:40px;border-right:1px solid var(--border);
  position:relative;overflow:hidden}
.journey-img-panel img{max-height:70vh;max-width:100%;object-fit:contain;
  filter:drop-shadow(0 8px 24px rgba(0,0,0,.15));
  animation:float 4s ease-in-out infinite}
.journey-rank-badge{position:absolute;top:16px;left:16px}
/* Right: info panel */
.journey-info-panel{overflow-y:auto;padding:36px 40px;
  display:flex;flex-direction:column;gap:20px}
.journey-family-label{font-size:10px;font-weight:700;letter-spacing:.15em;
  text-transform:uppercase;color:var(--muted)}
.journey-name{font-size:clamp(1.4rem,3vw,2.8rem);font-weight:800;
  letter-spacing:-.02em;line-height:1.1;color:var(--text)}
.journey-price{font-size:clamp(1.1rem,2vw,1.8rem);font-weight:700;color:var(--red)}
/* Popularity */
.journey-pop{display:flex;align-items:center;gap:12px}
.journey-pop-bar{flex:0 0 120px;height:4px;background:var(--border);border-radius:2px;overflow:hidden}
.journey-pop-fill{height:100%;background:var(--red);border-radius:2px;
  transition:width 1s ease}
.journey-pop-label{font-size:11px;color:var(--muted);font-weight:500}
/* Notes pyramid */
.notes-section-title{font-size:10px;font-weight:800;letter-spacing:.2em;
  text-transform:uppercase;color:var(--muted-d);
  padding-bottom:8px;border-bottom:1px solid var(--border)}
/* Action row */
.journey-actions{display:flex;flex-direction:column;gap:10px;margin-top:4px}
.journey-select-btn{width:100%;padding:14px;font-size:15px;font-weight:800}
.journey-meta{display:flex;align-items:center;justify-content:space-between;
  padding-top:8px;border-top:1px solid var(--border)}
.journey-count{font-size:11px;color:var(--muted)}

/* Fallback toast */
#fallback-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);
  background:var(--text);color:#fff;border-radius:10px;padding:10px 20px;
  font-size:12px;font-weight:600;white-space:nowrap;z-index:50;
  opacity:0;pointer-events:none;transition:all .35s;min-width:300px;text-align:center}
#fallback-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* Selection overlay */
#selection-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:100;
  display:flex;align-items:center;justify-content:center;
  opacity:0;pointer-events:none;transition:opacity .3s}
#selection-overlay.show{opacity:1;pointer-events:all}
.selection-card{background:var(--white);border-radius:var(--r-lg);padding:48px 40px;
  max-width:480px;width:90%;text-align:center;box-shadow:var(--shadow-lg)}
.selection-check{width:72px;height:72px;background:var(--green-bg);border-radius:50%;
  display:flex;align-items:center;justify-content:center;margin:0 auto 20px;
  animation:pop .4s cubic-bezier(.34,1.56,.64,1)}
.selection-check svg{width:36px;height:36px;stroke:var(--green);fill:none;stroke-width:2.5}
@keyframes pop{from{transform:scale(0)}to{transform:scale(1)}}
.selection-title{font-size:22px;font-weight:800;margin-bottom:6px}
.selection-sub{font-size:14px;color:var(--muted);margin-bottom:6px;line-height:1.5}
.selection-ref{font-size:11px;color:var(--muted);font-family:monospace;
  background:var(--bg);border-radius:6px;padding:6px 12px;
  display:inline-block;margin:12px 0 24px}

/* Idle warning */
#idle-warning{position:fixed;top:12px;right:12px;background:var(--amber);color:#fff;
  border-radius:8px;padding:8px 16px;font-size:12px;font-weight:700;z-index:200;
  display:none}

/* ── Utility ────────────────────────────────────────────────── */
.hidden{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.text-red{color:var(--red)}
.text-muted{color:var(--muted)}
.divider{border:none;border-top:1px solid var(--border);margin:4px 0}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar{width:4px;height:4px}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}

/* ── Responsive portrait ────────────────────────────────────── */
@media(max-width:900px),(orientation:portrait){
  .brand-grid{grid-template-columns:1fr}
  .family-grid{grid-template-columns:1fr 1fr}
  .journey-body{grid-template-columns:1fr;grid-template-rows:auto 1fr}
  .journey-img-panel{min-height:280px;border-right:none;border-bottom:1px solid var(--border)}
  .journey-img-panel img{max-height:220px}
  .journey-info-panel{padding:24px}
}
@media(max-width:600px){
  .family-grid{grid-template-columns:1fr 1fr}
  .sub-chips .sub-chip{font-size:13px;padding:8px 16px}
}
