:root {
  --bg: #f6efe3;
  --surface: #fffaf2;
  --surface-2: #f1e6d3;
  --line: #e4d5bd;
  --ink: #2b2118;
  --ink-2: #6e5d4b;
  --accent: #d9822b;      /* maple */
  --accent-ink: #ffffff;
  --accent-soft: #fbe3c6;
  --go: #2f8f5b;
  --go-soft: #d8f0e1;
  --danger: #c2412d;
  --milk: #f3efe6;   --milk-ink: #5b5244;
  --choc: #6b3e26;   --choc-soft: #ecd9cc;
  --straw: #e0475c;  --straw-soft: #fbdbe0;
  --shadow: 0 1px 2px rgba(60, 40, 15, .06), 0 6px 20px rgba(60, 40, 15, .08);
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: "Fredoka", ui-rounded, system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1712; --surface: #26201a; --surface-2: #322a21; --line: #3f352a;
    --ink: #f4ead9; --ink-2: #b6a58f;
    --accent: #f0a04b; --accent-ink: #2b1a08; --accent-soft: #4a3219;
    --go: #4cc283; --go-soft: #1f3a2b; --danger: #f2705c;
    --milk: #3a342b; --milk-ink: #efe6d4;
    --choc: #d9a27f; --choc-soft: #3d2a1f;
    --straw: #ff7d8f; --straw-soft: #4a2229;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: .01em; }
.muted { color: var(--ink-2); }
.small { font-size: .8em; font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link-btn { color: var(--accent); font-weight: 700; padding: 8px 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 22px; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  transition: transform .08s ease, filter .15s ease, opacity .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .4; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 70%, #000); }
.btn-go { background: var(--go); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--go) 70%, #000); }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; text-align: center; }
.brand-lg { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand-lg .brand-mark { font-size: 2.6rem; }
.login-card > p { margin: 6px 0 28px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.role-btn {
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 26px 12px 22px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: var(--shadow); transition: border-color .15s, transform .08s;
}
.role-btn:hover { border-color: var(--accent); }
.role-btn:active { transform: scale(.97); }
.role-emoji { font-size: 2.6rem; }
.role-name { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }
.role-desc { color: var(--ink-2); font-size: .9rem; }

.pin-dots { display: flex; justify-content: center; gap: 14px; height: 24px; margin-bottom: 22px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); animation: pop .15s ease; }
.pin-dots .placeholder { background: var(--line); animation: none; }
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto; }
.pin-pad button {
  height: 68px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; box-shadow: var(--shadow);
}
.pin-pad button:active { background: var(--surface-2); transform: scale(.96); }
.pin-pad .pin-go { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.pin-error { color: var(--danger); min-height: 1.4em; font-weight: 700; margin: 14px 0 0; }
.shake { animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; white-space: nowrap; }
.brand-mark { font-size: 1.5rem; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; margin-left: 8px; }
.tab { padding: 8px 16px; border-radius: 10px; font-weight: 700; color: var(--ink-2); white-space: nowrap; min-height: 40px; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.today-pill { background: var(--surface); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; white-space: nowrap; font-size: .95rem; }
.today-pill strong { font-family: var(--font-display); font-size: 1.05rem; }

.view:not(.login) { padding: 16px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); max-width: 1280px; margin: 0 auto; }

/* ---------- Cashier ---------- */
.cashier { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "builder cart" "queue cart"; align-items: start; }
.builder { grid-area: builder; display: grid; gap: 14px; }
.cart { grid-area: cart; position: sticky; top: 84px; }
.queue-mini { grid-area: queue; }

.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.step-title { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-size: .95rem; font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .step-num { color: var(--accent); } }

.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.price-btn {
  min-height: 96px; border-radius: var(--radius-sm); background: var(--surface-2); border: 3px solid transparent;
  font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; display: flex; align-items: center; justify-content: center; gap: 2px;
  transition: border-color .12s, background .12s, transform .08s;
}
.price-btn .cur { font-size: .55em; opacity: .7; margin-top: -.6em; }
.price-btn:active { transform: scale(.97); }
.price-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.price-btn.custom { flex-direction: column; font-size: 1.3rem; gap: 0; }
.custom-val { font-size: 1.3rem; color: var(--accent); }
.custom-row { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.custom-row label { font-weight: 700; }
.custom-row input {
  flex: 1; min-width: 140px; height: 54px; border-radius: var(--radius-sm); border: 2px solid var(--line);
  background: var(--bg); padding: 0 16px; font-size: 1.4rem; font-family: var(--font-display); font-weight: 600;
}
.custom-row input:focus { border-color: var(--accent); outline: none; }

.topping-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.top-btn {
  min-height: 84px; border-radius: var(--radius-sm); border: 3px solid transparent; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700;
  position: relative; transition: background .12s, border-color .12s, transform .08s;
}
.top-btn:active { transform: scale(.97); }
.top-emoji { font-size: 1.9rem; line-height: 1; }
.top-btn[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; color: #fff;
}
.t-milk[aria-pressed="true"] { background: var(--milk); border-color: var(--milk-ink); }
.t-milk[aria-pressed="true"]::after { background: var(--milk-ink); color: var(--milk); }
.t-chocolate[aria-pressed="true"] { background: var(--choc-soft); border-color: var(--choc); }
.t-chocolate[aria-pressed="true"]::after { background: var(--choc); }
.t-strawberry[aria-pressed="true"] { background: var(--straw-soft); border-color: var(--straw); }
.t-strawberry[aria-pressed="true"]::after { background: var(--straw); }

.step-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 4px; }
.stepper button { width: 56px; height: 56px; border-radius: 11px; font-size: 1.8rem; font-weight: 700; }
.stepper button:active { background: var(--surface); }
.stepper output { min-width: 56px; text-align: center; font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.btn-add { flex: 1; min-width: 180px; min-height: 64px; justify-content: space-between; font-size: 1.3rem; }

.cart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cart-head { display: flex; justify-content: space-between; align-items: center; }
.cart-head h2 { font-size: 1.2rem; }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 42vh; overflow-y: auto; }
.cart-item { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; background: var(--bg); border-radius: 12px; padding: 10px 8px 10px 12px; animation: slidein .18s ease; }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } }
.ci-qty { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; min-width: 32px; }
.ci-main { min-width: 0; }
.ci-price { font-weight: 700; }
.ci-line { font-family: var(--font-display); font-weight: 600; }
.ci-del { width: 40px; height: 40px; border-radius: 10px; color: var(--ink-2); font-size: 1.3rem; }
.ci-del:hover { background: var(--surface-2); color: var(--danger); }
.cart-empty { text-align: center; color: var(--ink-2); padding: 18px 8px; }
.cart-empty span { font-size: 2.4rem; opacity: .6; }
.cart-empty p { margin: 6px 0 0; }
.note-input { height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); padding: 0 14px; }
.note-input:focus { border-color: var(--accent); outline: none; }
.cart-foot { display: grid; gap: 12px; border-top: 2px dashed var(--line); padding-top: 12px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; }
.cart-total span { font-weight: 700; color: var(--ink-2); }
.cart-total strong { font-family: var(--font-display); font-size: 2rem; }
.btn-go { width: 100%; min-height: 64px; font-size: 1.3rem; }

/* toppings chips */
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.chip-t { font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chip-t.milk { background: var(--milk); color: var(--milk-ink); border: 1px solid var(--line); }
.chip-t.chocolate { background: var(--choc-soft); color: var(--choc); }
.chip-t.strawberry { background: var(--straw-soft); color: var(--straw); }
.chip-t.none { background: var(--surface-2); color: var(--ink-2); }

/* ---------- Section heads / mini lists ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 12px; gap: 12px; }
.section-head h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 8px; }
.count { background: var(--accent); color: var(--accent-ink); font-size: .9rem; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center; }
.mini-list { display: grid; gap: 8px; }
.mini {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 14px;
}
.mini .tno { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; min-width: 44px; }
.mini .meta { color: var(--ink-2); font-size: .85rem; }
.mini .sum { font-size: .95rem; }
.mini-actions { display: flex; align-items: center; gap: 6px; }
.small-btn { min-height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 700; background: var(--surface-2); }
.small-btn.danger { color: var(--danger); }
.small-btn:active { transform: scale(.96); }
.empty-line { color: var(--ink-2); padding: 14px; text-align: center; border: 2px dashed var(--line); border-radius: 14px; }

/* ---------- Kitchen ---------- */
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ticket {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; animation: slidein .25s ease;
}
.ticket.new { animation: slidein .25s ease, glow 1.6s ease 2; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px var(--accent); } }
.ticket-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--surface-2); }
.ticket-no { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; }
.ticket-age { font-weight: 700; font-size: .95rem; padding: 4px 10px; border-radius: 999px; background: var(--surface); }
.ticket-age.warn { background: var(--accent-soft); color: var(--accent); }
.ticket-age.late { background: var(--danger); color: #fff; }
.ticket-items { list-style: none; margin: 0; padding: 8px 16px; display: grid; gap: 2px; flex: 1; }
.ticket-items li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ticket-items li:last-child { border-bottom: 0; }
.ti-qty { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1.1; min-width: 40px; }
.ti-desc { font-weight: 700; }
.ti-desc .chips { margin-top: 4px; }
.ti-desc .chip-t { font-size: .9rem; padding: 3px 10px; }
.ticket-note { margin: 0 16px 10px; padding: 8px 12px; background: var(--accent-soft); border-radius: 10px; font-weight: 700; }
.ticket-done { margin: 0 12px 12px; min-height: 60px; width: auto !important; }
.kitchen-empty { text-align: center; padding: 40px 16px; color: var(--ink-2); border: 2px dashed var(--line); border-radius: var(--radius); }
.kitchen-empty span { font-size: 2.6rem; }
.done-head { margin-top: 28px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- History ---------- */
.history { display: grid; gap: 14px; max-width: 900px !important; }
.range-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.range-bar::-webkit-scrollbar { display: none; }
.chip { padding: 0 16px; min-height: 42px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.chip[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.custom-range { display: flex; gap: 12px; flex-wrap: wrap; }
.custom-range label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.custom-range input { height: 44px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); padding: 0 10px; }
.stats { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.stat-label { color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.stat strong { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; }
.stat-main { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.stat-main .stat-label { color: inherit; opacity: .85; }
.stat-main strong { font-size: 2.4rem; }
.btn-export { width: 100%; }
.history-list { display: grid; gap: 8px; }
.status-pill { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.status-pill.pending { background: var(--accent-soft); color: var(--accent); }
.status-pill.done { background: var(--go-soft); color: var(--go); }
.status-pill.cancelled { background: var(--surface-2); color: var(--ink-2); text-decoration: line-through; }
.amount { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; text-align: right; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, calc(100% + 40px)); visibility: hidden;
  background: var(--ink); color: var(--bg); padding: 14px 20px; border-radius: 14px; font-weight: 700;
  box-shadow: var(--shadow); transition: transform .25s ease, visibility .25s; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }
@media (max-width: 960px) { body:has(.mobile-bar:not([hidden])) .toast { bottom: calc(96px + env(safe-area-inset-bottom)); } }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .cashier { grid-template-columns: 1fr; grid-template-areas: "builder" "cart" "queue"; }
  .cart { position: static; }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .tabs { order: 3; width: 100%; margin-left: 0; }
  .tab { flex: 1; }
  .brand-text { display: none; }
  .price-btn { min-height: 80px; font-size: 2rem; }
  .top-btn { min-height: 76px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-main { grid-column: 1 / -1; }
  /* Sticky checkout bar on phones */
  .cart { padding-bottom: 12px; }
  .cart-foot {
    position: sticky; bottom: 0; background: var(--surface);
    margin: 0 -16px -12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-radius: 0 0 var(--radius) var(--radius);
  }
}
@media (max-width: 400px) {
  .price-grid, .topping-grid { gap: 8px; }
  .top-btn span:not(.top-emoji) { font-size: .85rem; }
  .today-pill .muted { display: none; }
  .ticket-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Mobile checkout bar ---------- */
.mobile-bar { display: none; }
@media (max-width: 960px) {
  .mobile-bar:not([hidden]) {
    display: flex; gap: 10px; align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.08);
  }
  .mobile-bar .btn-go { width: auto; flex: 0 0 auto; min-height: 56px; padding: 0 28px; }
  .mb-view { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 56px; text-align: left; }
  .mb-badge { background: var(--accent); color: var(--accent-ink); min-width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; padding: 0 8px; }
  .mb-total { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; }
  .cashier { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  .cart-foot .btn-go { display: none; }
  .cart-foot { position: static !important; margin: 0 !important; padding: 12px 0 0 !important; }
}

/* ---------- Live indicator ---------- */
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 700; color: var(--ink-2); padding: 0 6px; }
.live-dot .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2); opacity: .5; }
.live-dot.on { color: var(--go); }
.live-dot.on .dot { background: var(--go); opacity: 1; box-shadow: 0 0 0 0 var(--go); animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--go) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 400px) { .live-dot .live-text { display: none; } }

/* ---------- Clear all ---------- */
.danger-zone {
  margin-top: 24px; padding: 16px; border-radius: var(--radius);
  border: 2px dashed color-mix(in srgb, var(--danger) 45%, var(--line));
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.danger-zone h2 { font-size: 1.1rem; color: var(--danger); }
.danger-zone p { margin: 4px 0 0; font-size: .92rem; max-width: 52ch; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--danger) 70%, #000); }
.btn-ghost { background: var(--surface-2); }
.modal {
  border: 0; border-radius: var(--radius); padding: 22px; width: min(420px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal::backdrop { background: rgba(20, 12, 4, .5); backdrop-filter: blur(2px); }
.modal h2 { font-size: 1.35rem; margin-bottom: 8px; }
.modal p { margin: 0 0 14px; color: var(--ink-2); }
.modal label { display: block; font-weight: 700; margin-bottom: 6px; }
.modal .pin-error { margin: 8px 0 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; min-height: 52px; font-size: 1.05rem; padding: 0 12px; }
.pad-label { font-weight: 700; color: var(--ink) !important; margin: 0 0 10px !important; text-align: center; }
.modal .pin-dots { margin-bottom: 14px; }
.pin-pad-sm { gap: 8px; max-width: 280px; }
.pin-pad-sm button { height: 54px; font-size: 1.4rem; }
.modal .pin-error { text-align: center; min-height: 1.4em; color: var(--danger); }
/* Never let the OS keyboard or zoom kick in on PIN pads */
.pin-pad, .pin-dots { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
