/* Sam's Club demo styles. Brand blue taken from the supplied logo (#0067A0). */
@font-face { font-family: 'Gibson'; src: url('/assets/Gibson-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Gibson'; src: url('/assets/Gibson-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Gibson'; src: url('/assets/Gibson-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --blue: #0067A0;
  --blue-dark: #004F7C;
  --blue-tint: #E6F0F6;
  --ink: #1D2731;
  --ink-2: #5A6773;
  --line: #DCE3E9;
  --bg: #F3F6F9;
  --card: #FFFFFF;
  --green: #2E7D32;
  --amber: #B26A00;
  --red: #C62828;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Gibson', -apple-system, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }

#app { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; background: var(--bg); }

/* Header */
.header {
  position: sticky; top: 0; z-index: 10;
  background: var(--blue); color: #fff;
  padding: calc(var(--safe-top) + 10px) 16px 12px;
  display: flex; align-items: center; gap: 12px; min-height: 56px;
}
.header .logo { height: 22px; display: block; }
.header .back { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-size: 22px; line-height: 1; }
.header .back:active { background: rgba(255,255,255,.15); }
.header .title { font-weight: 600; font-size: 17px; flex: 1; }
.header .pill { font-size: 12px; font-weight: 600; background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 99px; }

.content { flex: 1; padding: 16px 16px calc(24px + var(--safe-bottom)); }

/* Home */
.hero { padding: 28px 4px 20px; }
.hero h1 { font-size: 28px; line-height: 1.15; margin: 0 0 8px; font-weight: 700; }
.hero p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.4; }
.route-card {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  background: var(--card); border-radius: var(--radius); padding: 18px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(16,40,60,.06), 0 4px 16px rgba(16,40,60,.06);
}
.route-card:active { transform: scale(.99); }
.route-card .icon { width: 52px; height: 52px; border-radius: 12px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; flex: none; }
.route-card h2 { font-size: 19px; margin: 0 0 2px; font-weight: 600; }
.route-card p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.35; }
.route-card .chev { margin-left: auto; color: var(--ink-2); font-size: 22px; }

.status-line { margin-top: 20px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.dot.off { background: var(--amber); }

/* Steps strip */
.steps { display: flex; gap: 6px; margin: 0 0 16px; }
.steps .s { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps .s.on { background: var(--blue); }
.step-label { font-size: 13px; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.section-title { font-size: 22px; font-weight: 700; margin: 0 0 14px; }

/* Shopping list */
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(16,40,60,.06); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row:active { background: var(--blue-tint); }
.row .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.row .meta { flex: 1; min-width: 0; }
.row .name { font-weight: 600; font-size: 16px; line-height: 1.25; }
.row .sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.row .price { font-weight: 700; font-size: 16px; }
.row .aisle { font-size: 12px; font-weight: 600; color: var(--blue); background: var(--blue-tint); padding: 3px 8px; border-radius: 99px; margin-top: 6px; display: inline-block; }

/* Map */
.map-wrap { position: relative; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(16,40,60,.06); }
.map-wrap svg { display: block; width: 100%; height: 360px; touch-action: none; }
.map-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.map-tools button { background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--blue); }
.map-tools button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.map-legend { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,.95); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
@keyframes pulse { 0% { r: 14; opacity: .55; } 100% { r: 46; opacity: 0; } }
.pulse { animation: pulse 1.6s ease-out infinite; }

/* Item card */
.item-card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-top: 12px; box-shadow: 0 1px 2px rgba(16,40,60,.06); }
.item-card .top { display: flex; gap: 12px; align-items: flex-start; }
.item-card .brand { font-size: 13px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.item-card h3 { margin: 2px 0 4px; font-size: 20px; line-height: 1.2; }
.item-card .size { color: var(--ink-2); font-size: 14px; }
.item-card .big-price { margin-left: auto; font-size: 26px; font-weight: 700; white-space: nowrap; }
.where { display: flex; gap: 8px; margin-top: 14px; }
.where .chip { flex: 1; background: var(--blue-tint); border-radius: 10px; padding: 10px 12px; }
.where .chip .k { font-size: 12px; color: var(--ink-2); }
.where .chip .v { font-size: 18px; font-weight: 700; color: var(--blue); }
.label-img { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.label-img img { display: block; width: 100%; height: auto; }
.label-img .cap { font-size: 12px; color: var(--ink-2); padding: 8px 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; }

.primary { display: block; width: 100%; background: var(--blue); color: #fff; font-weight: 600; font-size: 17px; padding: 15px; border-radius: 12px; margin-top: 16px; text-align: center; }
.primary:active { background: var(--blue-dark); }
.primary[disabled] { background: var(--line); color: var(--ink-2); }
.note { font-size: 13px; color: var(--ink-2); text-align: center; margin-top: 10px; }

.placeholder { background: var(--card); border-radius: var(--radius); padding: 20px; color: var(--ink-2); line-height: 1.45; }
.placeholder ol { padding-left: 20px; margin: 8px 0 0; }
.placeholder li { margin: 4px 0; }
.placeholder li.done { color: var(--ink); font-weight: 600; }

.banner { background: #FFF4E0; color: #6B4300; font-size: 13px; padding: 8px 16px; text-align: center; }
.loading { padding: 60px 0; text-align: center; color: var(--ink-2); }

/* Proximity (simulated) */
.prox { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; box-shadow: 0 1px 2px rgba(16,40,60,.06); }
.prox-top { display: flex; align-items: center; gap: 14px; }
.prox-ft { font-size: 34px; font-weight: 700; color: var(--blue); min-width: 84px; font-variant-numeric: tabular-nums; }
.prox-ft span { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.prox-text { font-size: 16px; font-weight: 600; line-height: 1.3; }
.prox-bar { height: 6px; background: var(--line); border-radius: 6px; margin-top: 10px; overflow: hidden; }
.prox-bar div { height: 100%; background: var(--green); border-radius: 6px; }
.sim { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.sim span { margin-right: auto; }
.sim button { border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: #fff; }

.mini-item { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 10px 12px; margin-top: 12px; box-shadow: 0 1px 2px rgba(16,40,60,.06); }
.mini-item img { width: 92px; border: 1px solid var(--line); border-radius: 6px; }
.mini-item .name { font-weight: 600; font-size: 15px; }
.mini-item .sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }

/* Flash panel */
.flash { background: var(--card); border-radius: var(--radius); padding: 14px 16px 16px; margin-top: 12px; box-shadow: 0 1px 2px rgba(16,40,60,.06); }
.flash-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.flash-row .k { width: 64px; font-size: 14px; color: var(--ink-2); font-weight: 600; flex: none; }
.swatches { display: flex; gap: 6px; flex-wrap: nowrap; }
.sw { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.sw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue); }
.seg { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; flex: 1; }
.seg button { flex: 1; padding: 7px 0; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.flash .primary { margin-top: 12px; }
.primary.flashing { background: var(--ink); display: flex; align-items: center; justify-content: center; gap: 10px; }
.led { width: 14px; height: 14px; border-radius: 50%; background: var(--led); box-shadow: 0 0 10px var(--led); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.primary.secondary { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.primary.secondary[disabled] { border-color: var(--line); color: var(--ink-2); background: #fff; }
.note.err { color: var(--red); }

/* ---- Shared additions ---- */
.header .title { cursor: default; user-select: none; -webkit-user-select: none; }
.hdr-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.hdr-btn:active { background: rgba(255,255,255,.15); }
.label-img .cap .ok { color: var(--green); font-weight: 600; }
.label-img .cap .warn { color: var(--amber); font-weight: 600; }
.where .chip .v.small { font-size: 14px; padding-top: 3px; }
.note.left { text-align: left; }
.note.sim-tag { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; box-shadow: 0 1px 2px rgba(16,40,60,.06); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.link { color: var(--blue); font-weight: 600; font-size: 15px; padding: 8px 0; display: block; margin: 12px auto 0; }
a.primary { text-decoration: none; }
.row.done .name { color: var(--ink-2); text-decoration: line-through; }
.row .check { display: grid; place-items: center; }
.row.done .check { background: var(--green); border-color: var(--green); color: #fff; }
.row.done .check svg { width: 14px; height: 14px; }
.rank { width: 26px; height: 26px; border-radius: 50%; background: var(--blue-tint); color: var(--blue); font-weight: 700; display: grid; place-items: center; font-size: 14px; flex: none; }
.route-card.compact { padding: 14px; }
.route-card.compact .icon { width: 44px; height: 44px; }
.route-card.compact h2 { font-size: 17px; }
.route-card .num { font-size: 12px; font-weight: 700; color: var(--blue); }

/* Bottom sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(10,20,30,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet { background: var(--bg); width: 100%; max-width: 480px; max-height: 88vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: up .25s ease; padding-bottom: var(--safe-bottom); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; padding: 8px 16px 4px; }
.sheet-head h3 { margin: 0; font-size: 20px; flex: 1; }
.sheet-x { width: 32px; height: 32px; border-radius: 50%; background: var(--card); color: var(--ink-2); }
.sheet-body { overflow-y: auto; padding: 4px 16px 20px; -webkit-overflow-scrolling: touch; }
.sheet-sub { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 18px 0 8px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.kvs { background: var(--card); border-radius: 12px; overflow: hidden; margin-top: 6px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-2); }
.kv span small { display: block; font-size: 12px; }
.kv b { text-align: right; font-weight: 600; }
.kv b.ok { color: var(--green); } .kv b.warn { color: var(--amber); } .kv b.bad { color: var(--red); }
.btn-row { display: flex; gap: 8px; }
.btn-row button { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; font-size: 14px; font-weight: 600; color: var(--blue); }

/* Presenter button and toast */
.fab { position: fixed; right: max(16px, calc(50% - 224px)); bottom: calc(20px + var(--safe-bottom)); width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 40; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-bottom)); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; font-weight: 600; z-index: 60; animation: fade .2s ease; }

/* Coupon */
.coupon { display: flex; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 20px rgba(0,103,160,.18); border: 2px dashed var(--blue); transform: translateY(24px) scale(.97); opacity: 0; transition: transform .45s cubic-bezier(.2,.9,.3,1.2), opacity .3s; }
.coupon.in { transform: none; opacity: 1; }
.coupon-l { flex: 1; padding: 16px; }
.coupon-tag { display: inline-block; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.coupon-text { font-size: 22px; font-weight: 700; margin: 8px 0 6px; line-height: 1.15; }
.coupon-sub { font-size: 13px; color: var(--ink-2); }
.coupon-r { width: 96px; background: var(--blue-tint); display: grid; place-items: center; border-left: 2px dashed var(--blue); }
.clip-btn { background: var(--blue); color: #fff; font-weight: 700; font-size: 17px; padding: 12px 16px; border-radius: 12px; }
.clipped-badge { display: grid; justify-items: center; gap: 4px; color: var(--green); font-weight: 700; }
.clipped-badge svg { width: 30px; height: 30px; }
.coupon.clipped { border-color: var(--green); }
.coupon.clipped .coupon-r { background: #E8F5E9; border-left-color: var(--green); }

/* Scanner */
.scan-view { position: relative; background: #0d1a24; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #cfe3ef; text-align: center; padding: 24px; font-size: 15px; line-height: 1.4; }
.scan-frame { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); border: 3px solid rgba(255,255,255,.9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.scan-frame.qr { width: 55%; aspect-ratio: 1; }
.scan-frame.barcode { width: 78%; height: 32%; }
.manual { display: flex; gap: 8px; margin-top: 10px; }
.manual input { flex: 1; font: inherit; font-size: 16px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; min-width: 0; }
.manual button { background: var(--blue); color: #fff; font-weight: 600; padding: 0 16px; border-radius: 10px; }
.qr-result { background: var(--card); border-radius: var(--radius); padding: 22px 16px 16px; text-align: center; box-shadow: 0 1px 2px rgba(16,40,60,.06); }
.qr-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; margin: 0 auto 10px; }
.qr-k { color: var(--ink-2); font-size: 14px; }
.qr-v { font-size: 22px; font-weight: 700; margin: 4px 0 4px; }

/* Price change */
.price-now { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(16,40,60,.06); }
.price-now .k { font-size: 13px; color: var(--ink-2); }
.price-now .v { font-size: 30px; font-weight: 700; }
.tpl { font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 99px; background: var(--blue-tint); color: var(--blue); }
.tpl.ess { background: #FFF59D; color: #4E3B00; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 10px; padding: 3px; flex: 1; justify-content: space-between; }
.stepper button { width: 44px; height: 36px; border-radius: 8px; background: #fff; font-size: 22px; font-weight: 600; color: var(--blue); }
.stepper b { font-size: 20px; }
.preview { margin-top: 8px; }
.preview .k { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.preview img { width: 100%; display: block; border: 1px solid var(--line); border-radius: 10px; }
.timeline .tl { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; }
.timeline .tl span:nth-child(2) { flex: 1; }
.timeline .tl small { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.timeline .tl svg { width: 20px; height: 20px; flex: none; }
.timeline .tl.ok svg { color: var(--green); }
.dot-s { width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin: 0 5px; flex: none; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--blue-tint); border-top-color: var(--blue); animation: rot .9s linear infinite; flex: none; margin: 0 1px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Attention list */
.att { background: var(--card); border-radius: 12px; margin-top: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,40,60,.06); }
.att-head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; }
.att-t { flex: 1; }
.att-t b { display: block; font-size: 16px; }
.att-t small { color: var(--ink-2); font-size: 13px; }
.sev { width: 10px; height: 36px; border-radius: 4px; flex: none; }
.sev.bad { background: var(--red); } .sev.warn { background: #F9A825; } .sev.info { background: #90A4AE; }
.count { font-weight: 700; font-size: 18px; min-width: 34px; text-align: right; }
.att-list { border-top: 1px solid var(--line); }
.att-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 14px 10px 36px; border-bottom: 1px solid var(--line); }
.att-row:last-child { border-bottom: 0; }
.att-row > div { flex: 1; min-width: 0; }
.att-row .name { font-weight: 600; font-size: 15px; }
.att-row .sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.simtag { font-size: 11px; font-weight: 700; color: #6A1B9A; background: #F3E5F5; padding: 3px 7px; border-radius: 6px; text-transform: uppercase; flex: none; }

/* Heatmap */
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.heat-legend .grad { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgb(30,136,229), rgb(253,216,53), rgb(229,57,53)); }
.dwell-name { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; }
.dwell-name .swatch { width: 14px; height: 14px; border-radius: 4px; }
.dwell-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.dwell-grid .k { font-size: 13px; color: var(--ink-2); }
.dwell-grid .v { font-size: 22px; font-weight: 700; color: var(--blue); }

/* Room for the presenter button at the bottom of every screen */
.content { padding-bottom: calc(96px + var(--safe-bottom)); }
.sim button { padding: 4px 9px; white-space: nowrap; }

/* Passcode screen */
.passcode { padding-top: 40px; text-align: center; }
.passcode h1 { font-size: 24px; margin: 0 0 20px; }
.passcode input { font: inherit; font-size: 32px; font-weight: 700; letter-spacing: .4em; text-align: center; width: 100%; padding: 14px 0 14px .4em; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; }

/* Flash patterns (all four) */
.flash-row.top { align-items: flex-start; }
.flash-row.top .k { padding-top: 10px; }
.patterns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; }
.pat { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--bg); border-radius: 10px; padding: 8px; border: 1.5px solid transparent; }
.pat.on { background: #fff; border-color: var(--blue); }
.pat b { display: block; font-size: 14px; }
.pat small { display: block; font-size: 11px; color: var(--ink-2); line-height: 1.25; }
.pat-dots { width: 14px; height: 14px; flex: none; display: grid; place-items: center; }
.pat-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); animation: patblink var(--rate) steps(1, end) infinite; }
@keyframes patblink { 0% { opacity: 1; } 15% { opacity: .15; } 100% { opacity: .15; } }

/* Shelf writes toggle */
.toggle-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px; padding: 12px; }
.toggle-row > div { flex: 1; }
.toggle-row b { display: block; font-size: 15px; }
.toggle-row small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; line-height: 1.3; }
.switch { width: 52px; height: 30px; border-radius: 15px; background: #C9D2DA; position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s; }
.switch.on { background: var(--red); }
.switch.on i { left: 25px; }
.switch.armed { background: #F9A825; }

/* Page number (in the header) */
.page-no { margin-left: auto; background: rgba(255,255,255,.18); color: #fff; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 99px; font-variant-numeric: tabular-nums; flex: none; }
.page-no span { opacity: .7; font-weight: 600; }
.header .title { flex: 1; }

/* Heatmap lists */
.seg.tabs { margin: 14px 0 8px; }
.row.sel { background: var(--blue-tint); }
.loc { font-weight: 700; font-size: 13px; color: var(--blue); background: var(--blue-tint); border-radius: 8px; padding: 4px 7px; min-width: 52px; text-align: center; flex: none; font-variant-numeric: tabular-nums; }
.row.sel .loc { background: var(--blue); color: #fff; }

/* Settings */
.settings .card { padding: 4px 14px 12px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row > div:first-child { flex: 1; }
.set-row b { display: block; font-size: 15px; }
.set-row small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; line-height: 1.3; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.switch:not(.danger).on { background: var(--green); }
.switch[disabled] { opacity: .5; }
.kvs.flat { background: transparent; border-radius: 0; margin: 4px 0 0; }
.kvs.flat .kv { padding: 10px 0; }
.settings .sheet-sub { margin-top: 20px; }

/* Flash patterns: one list, slowest to fastest, indicator in the chosen color */
.patterns { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pat { display: flex; align-items: center; gap: 10px; padding: 9px 10px; }
.pat-t { flex: 1; }
.pat-f { font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pat.on .pat-f { color: var(--blue); }
.led-ind { width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.led-ind i { width: 12px; height: 12px; border-radius: 50%; background: var(--led); box-shadow: 0 0 0 1px var(--edge), 0 0 8px var(--led); opacity: .15; }
.led-ind.r4 i { animation: led4 4s linear infinite; }
.led-ind.r2 i { animation: led2 2s linear infinite; }
.led-ind.r1 i { animation: led1 1s linear infinite; }
.led-ind.rq i { animation: ledq .25s linear infinite; }
@keyframes led4 { 0%, 7% { opacity: 1; } 7.1%, 100% { opacity: .15; } }
@keyframes led2 { 0%, 14% { opacity: 1; } 14.1%, 100% { opacity: .15; } }
@keyframes led1 { 0%, 28% { opacity: 1; } 28.1%, 100% { opacity: .15; } }
@keyframes ledq { 0%, 50% { opacity: 1; } 50.1%, 100% { opacity: .15; } }

/* Wayfinding route */
.route-flow { animation: flow .9s linear infinite; }
@keyframes flow { to { stroke-dashoffset: var(--dash); } }

/* Keep the bottom-left corner free for the entrance marker */
.map-legend { left: auto; right: 10px; }

/* Matching */
.m-step { padding: 12px 14px 14px; }
.m-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.m-head b { flex: 1; font-size: 16px; }
.m-head .link { margin: 0; padding: 0; font-size: 14px; }
.m-num { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.m-head.done .m-num { background: var(--green); }
.m-head.done .m-num svg { width: 15px; height: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip-btn.on { border-color: var(--blue); background: var(--blue-tint); color: var(--blue); }
.m-step .timeline { margin-top: 8px; }

/* Flash pattern indicator: always in the selected flash color, brighter when lit */
.led-ind { width: 22px; height: 22px; }
.led-ind i { width: 14px; height: 14px; opacity: .3; box-shadow: 0 0 0 1px var(--edge); }
@keyframes led4 { 0%, 8% { opacity: 1; box-shadow: 0 0 0 1px var(--edge), 0 0 10px 2px var(--led); } 8.1%, 100% { opacity: .3; } }
@keyframes led2 { 0%, 15% { opacity: 1; box-shadow: 0 0 0 1px var(--edge), 0 0 10px 2px var(--led); } 15.1%, 100% { opacity: .3; } }
@keyframes led1 { 0%, 30% { opacity: 1; box-shadow: 0 0 0 1px var(--edge), 0 0 10px 2px var(--led); } 30.1%, 100% { opacity: .3; } }
@keyframes ledq { 0%, 50% { opacity: 1; box-shadow: 0 0 0 1px var(--edge), 0 0 10px 2px var(--led); } 50.1%, 100% { opacity: .3; } }
.pat.on { border-color: var(--blue); }
