/* ==========================================================================
   Leaf API demo kit: shared styles
   ========================================================================== */

:root {
  --bg: #faf8f6;
  --fg: #1a4d2e;
  --fg-soft: rgba(26, 77, 46, 0.72);
  --fg-mute: rgba(26, 77, 46, 0.5);
  --card: #ffffff;
  --primary: #2d7a4f;
  --primary-hover: #256842;
  --primary-fg: #ffffff;
  --secondary: #f0ebe3;
  --muted: #e8ddf5;
  --border: #e0d5ca;
  --input: #ffffff;
  --danger: #c41e3a;
  --dark: #0f2818;
  --dark-2: #1a3a2a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 77, 46, 0.06), 0 1px 3px rgba(26, 77, 46, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 40, 24, 0.12);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--fg);
  background: linear-gradient(180deg, var(--secondary) 0%, var(--bg) 280px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--primary); }

/* ---------- Shell ---------- */
.leaf-shell { max-width: 1240px; margin: 0 auto; padding: 16px; }
.leaf-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 14px; flex-wrap: wrap; }
.leaf-brand { display: flex; align-items: center; gap: 10px; }
.leaf-logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: var(--primary-fg);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.leaf-brand-title { font-weight: 700; font-size: 16px; }
.leaf-brand-sub { font-size: 12px; color: var(--fg-mute); display: flex; align-items: center; gap: 6px; }
.leaf-status { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--card);
  border-radius: 999px; padding: 5px 10px; color: var(--fg-soft);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.status-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }

.leaf-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.leaf-app {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px; min-height: 520px; min-width: 0;
}
.leaf-stage { min-width: 0; }
/* The demo's own layouts respond to the space the demo really has (page, tablet or phone), not the window. */
.leaf-screen { container: site / inline-size; }
@media (max-width: 960px) { .leaf-layout { grid-template-columns: minmax(0, 1fr); } }
@container site (max-width: 960px) { .leaf-app { padding: 16px; } }

.leaf-boot { min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--fg-mute); font-size: 14px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--secondary); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- API call log ---------- */
.leaf-log {
  background: var(--dark); color: #f0ebe3; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  height: 640px; position: sticky; top: 16px;
}
@media (max-width: 960px) { .leaf-log { position: static; height: 360px; } }
.log-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); font-size: 14px; font-weight: 600; }
.log-head .count { color: rgba(255, 255, 255, 0.5); font-weight: 500; font-size: 12px; }
.log-head .spacer { flex: 1; }
.log-head button { background: none; border: 0; color: rgba(255, 255, 255, 0.55); padding: 4px; display: inline-flex; }
.log-head button:hover { color: #fff; }
.pulse { position: relative; width: 8px; height: 8px; }
.pulse::before, .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #4ade80; }
.pulse::before { animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite; opacity: 0.6; }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
.log-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.log-empty { text-align: center; color: rgba(255, 255, 255, 0.5); font-size: 13px; padding: 40px 16px; line-height: 1.5; }
.log-item { background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 10px; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.log-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.log-copy {
  margin-left: auto; flex-shrink: 0; width: 24px; height: 24px; border: 0; border-radius: 6px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.75); opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.log-copy svg { width: 13px; height: 13px; }
.log-item:hover .log-copy, .log-copy:focus-visible, .log-copy.done { opacity: 1; }
.log-copy:hover { background: #22c55e; color: #052e16; }
.log-copy.done { background: #22c55e; color: #052e16; }
@media (hover: none) { .log-copy { opacity: 1; } }
.log-path { font-family: var(--mono); font-size: 11.5px; color: rgba(255, 255, 255, 0.92); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-body pre { margin: 8px 0 0; max-height: 110px; overflow: auto; background: rgba(0, 0, 0, 0.3); border-radius: 6px; padding: 8px; font-family: var(--mono); font-size: 11px; line-height: 1.5; color: rgba(255, 255, 255, 0.72); }
.log-result { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; }
.log-result.ok { color: #86efac; }
.log-result.err { color: #fca5a5; }
.log-result .ms { margin-left: auto; color: rgba(255, 255, 255, 0.4); }
.log-result svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ---------- Methods ---------- */
.method { flex-shrink: 0; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 2px 6px; letter-spacing: 0.02em; }
.m-GET { background: #dbeafe; color: #1e40af; }
.m-POST { background: #dcfce7; color: #166534; }
.m-PATCH { background: #f3e8ff; color: #6b21a8; }
.m-PUT { background: #fef9c3; color: #854d0e; }
.m-DELETE { background: #fee2e2; color: #991b1b; }

/* ---------- Primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; border: 1px solid transparent;
  padding: 8px 14px; font-size: 14px; font-weight: 600; background: var(--primary); color: var(--primary-fg); white-space: nowrap; text-decoration: none;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.btn:hover:not(:disabled) { background: var(--primary-hover); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-outline { background: var(--card); color: var(--fg); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--secondary); border-color: rgba(45, 122, 79, 0.35); }
.btn-ghost { background: transparent; color: var(--fg-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--secondary); color: var(--fg); }
.btn-danger, .btn.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #a3182f; border-color: #a3182f; color: #fff; }
.btn-warn, .btn.btn-warn { background: #f59e0b; border-color: #f59e0b; color: #422006; }
.btn-warn:hover:not(:disabled) { background: #d97706; border-color: #d97706; color: #422006; }
/* Armed "click again to confirm" state for destructive buttons. */
.btn.armed { background: var(--danger); border-color: var(--danger); color: #fff; animation: armPulse 1s ease-in-out infinite; }
.btn.armed:hover:not(:disabled) { background: #a3182f; border-color: #a3182f; color: #fff; }
@keyframes armPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(196, 30, 58, 0.35); } 50% { box-shadow: 0 0 0 5px rgba(196, 30, 58, 0); } }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; padding: 4px; color: var(--fg-mute); display: inline-flex; border-radius: 6px; }
.icon-btn { transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--fg); background: var(--secondary); }
.icon-btn.danger:hover { color: var(--danger); background: #fee2e2; }
.icon-btn.armed, .icon-btn.armed:hover { background: var(--danger); color: #fff; padding: 4px 8px; font-size: 12px; font-weight: 600; gap: 4px; align-items: center; }
.icon-btn svg { width: 15px; height: 15px; }

.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border); background: var(--input); border-radius: 9px; padding: 8px 11px; font-size: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45, 122, 79, 0.15); }
.textarea { resize: vertical; min-height: 90px; }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.badge-low { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge-medium { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-hard { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.badge-expert { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.badge-mobile { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.chip { border: 0; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 500; background: var(--secondary); color: var(--fg-soft); transition: background .15s, color .15s; }
.chip:hover:not(.active) { background: #e7dfd3; color: var(--fg); }
.chip.active { background: var(--primary); color: var(--primary-fg); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--fg-mute); }
.soft { color: var(--fg-soft); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 8px; }
.grid { display: grid; gap: 12px; }
.title { font-size: 20px; font-weight: 700; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); }
.skeleton { background: var(--secondary); border-radius: 10px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
.error-banner { margin-bottom: 14px; border: 1px solid rgba(196, 30, 58, 0.3); background: rgba(196, 30, 58, 0.08); color: var(--danger); padding: 9px 12px; border-radius: 10px; font-size: 13px; }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

/* ---------- Modal ---------- */
.leaf-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 40, 24, 0.45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.leaf-modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border-radius: 20px;
  box-shadow: 0 25px 60px rgba(15, 40, 24, 0.3); animation: popIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.modal-hero { padding: 22px 22px 0; display: flex; gap: 14px; align-items: flex-start; }
.modal-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #dcfce7; color: var(--primary); }
.modal-icon.warn { background: #fef3c7; color: #b45309; }
.modal-icon.err { background: #ffe4e6; color: #be123c; }
.modal-icon svg { width: 22px; height: 22px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-sub { font-size: 13.5px; color: var(--fg-soft); margin-top: 4px; line-height: 1.5; }
.modal-body { padding: 18px 22px 22px; }
.modal-close { margin-left: auto; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--fg-soft); margin-bottom: 6px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 8px; }
.key-input { font-family: var(--mono); letter-spacing: 0.02em; }
.hint { font-size: 12px; color: var(--fg-mute); margin-top: 8px; line-height: 1.5; }
.account-note { display: flex; align-items: center; gap: 6px; color: var(--primary); }
.account-note svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-google { width: 100%; gap: 10px; padding: 10px 14px; color: var(--primary); border-color: var(--primary); }
.btn-google svg { width: 18px; height: 18px; }
.or-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; font-size: 12px; color: var(--fg-mute); }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--secondary); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 19px; }
.stat span { font-size: 11px; color: var(--fg-soft); }
.meter { height: 6px; background: var(--secondary); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.5s ease; }
.meter.warn > i { background: #f59e0b; }
.meter.full > i { background: var(--danger); }
.res-list { display: flex; flex-direction: column; gap: 6px; }
.res-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 11px; padding: 9px 10px; }
.res-item.current { border-color: var(--primary); background: rgba(45, 122, 79, 0.05); }
.res-item .grow { flex: 1; min-width: 0; }
.res-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-meta { font-size: 11.5px; color: var(--fg-mute); }
.tag { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px; background: var(--secondary); color: var(--fg-soft); }
.tag.green { background: #dcfce7; color: #166534; }
.tag.red { background: #ffe4e6; color: #9f1239; }
.need-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1px dashed #c4b5fd; background: #f5f3ff; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.need-box p { flex-basis: 100%; margin: 0; }
.need-facts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--fg-soft); }
.need-facts b { color: #6d28d9; }
.need-count { display: flex; align-items: baseline; gap: 6px; }
.need-count b { font-size: 30px; font-weight: 800; color: #6d28d9; line-height: 1; transition: transform .2s; }
.need-count span { font-size: 12px; color: var(--fg-soft); }
.need-slots { display: flex; gap: 5px; }
.need-slots i { width: 22px; height: 22px; border-radius: 6px; background: #ddd6fe; border: 2px solid #c4b5fd; }
.need-slots i.used { background: #7c3aed; border-color: #7c3aed; }
.need-slots i.just-freed { animation: popIn .35s ease; background: #dcfce7; border-color: #22c55e; }
.res-item.freed { opacity: .55; border-style: dashed; }
/* Project choice rows: info on the left, the two choices (each with an optional Recommended badge) on the right. */
.res-item.res-choice { flex-wrap: wrap; row-gap: 10px; }
.res-choice-info { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; }
.res-choice-actions { display: flex; align-items: flex-end; gap: 8px; margin-left: auto; }
.choice { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.choice.recommended .btn-warn { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3); }
.choice.recommended .btn-danger { box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.22); }
.rec-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.rec-badge svg { width: 10px; height: 10px; fill: currentColor; }
.rec-badge.use { background: #fef3c7; color: #92400e; }
.rec-badge.delete { background: #ffe4e6; color: #9f1239; }
.res-meta.fit-ok { color: #166534; }
.res-meta.fit-short { color: #9f1239; }
.res-meta.fit-tight { color: #92400e; }
.res-item.suggested { border-color: rgba(196, 30, 58, 0.45); background: rgba(196, 30, 58, 0.04); }
.ok-box { border-radius: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.warn-box { border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.progress-line { height: 4px; background: var(--secondary); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress-line > i { display: block; height: 100%; background: var(--primary); transition: width 0.25s; }

/* ---------- Toast ---------- */
.leaf-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; background: var(--dark); color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: popIn 0.25s ease;
}

/* ==========================================================================
   Device preview (website / tablet / mobile): only the demo goes in the frame
   ========================================================================== */
.leaf-statusbar, .leaf-homebar { display: none; }
.leaf-device { position: relative; }
html:not([data-device="desktop"]) .leaf-layout { align-items: stretch; }
html:not([data-device="desktop"]) .leaf-stage {
  display: flex; justify-content: center; align-items: flex-start; padding: 18px 12px; border-radius: 18px; border: 1px solid var(--border);
  background: radial-gradient(circle at 30% 20%, rgba(45,122,79,.12), transparent 50%), radial-gradient(circle at 80% 80%, rgba(139,92,246,.10), transparent 45%), #ece7df;
}
html:not([data-device="desktop"]) .leaf-device {
  display: flex; flex-direction: column; overflow: hidden; background: var(--card); flex-shrink: 0;
  border: 12px solid #121212; box-shadow: 0 0 0 2px #3a3a3a, 0 30px 70px rgba(0,0,0,.28);
}
/* Real device proportions (390×844 phone, 820×1180 tablet). leaf-api.js zooms the whole frame down to fit the
   window instead of squashing its height, so the preview always has the shape of a real device. */
html[data-device="mobile"] .leaf-device { width: 390px; height: 844px; border-radius: 56px; --leaf-screen-r: 44px; }
html[data-device="tablet"] .leaf-device { width: 820px; height: 1180px; border-radius: 38px; border-width: 16px; --leaf-screen-r: 22px; }
html:not([data-device="desktop"]) .leaf-screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
/* Chrome (GPU compositing) ignores the frame's rounded overflow clip for backdrop-filter, so a blurred bottom nav or
   sheet backdrop paints square corners over the frame. A solid mask forces a real mask layer that clips to the
   element's own rounded corners (radius = frame radius - border). clip-path: inset() is not enough for sticky navs. */
html:not([data-device="desktop"]) .leaf-screen,
html:not([data-device="desktop"]) .leaf-device > .in-device { -webkit-mask-image: linear-gradient(#000, #000); mask-image: linear-gradient(#000, #000); }
html:not([data-device="desktop"]) .leaf-screen { border-radius: 0 0 var(--leaf-screen-r) var(--leaf-screen-r); }
html:not([data-device="desktop"]) .leaf-device > .in-device { border-radius: var(--leaf-screen-r); overflow: hidden; }
html:not([data-device="desktop"]) .leaf-screen::-webkit-scrollbar { width: 0; }
html:not([data-device="desktop"]) .leaf-app { border: 0; border-radius: 0; box-shadow: none; min-height: 100%; padding: 16px 16px 28px; }
/* Apps drawn edge to edge (chat, full-screen tools): a root with .leaf-bleed fills the whole device screen with no
   white gutter around it, the way a native app does. */
html:not([data-device="desktop"]) .leaf-app:has(> .leaf-bleed) { padding: 0; display: flex; flex-direction: column; }
html:not([data-device="desktop"]) .leaf-app > .leaf-bleed { flex: 1; min-height: 0; border: 0; border-radius: 0; }
/* The API calls panel stays beside the device and matches its height. */
html:not([data-device="desktop"]) .leaf-log { height: auto; contain: size; position: static; }
@media (max-width: 960px) { html:not([data-device="desktop"]) .leaf-log { contain: none; height: 360px; } }
html:not([data-device="desktop"]) .leaf-statusbar {
  display: flex; align-items: center; justify-content: space-between; position: relative; flex-shrink: 0;
  padding: 0 26px; height: 48px; font-size: 15px; font-weight: 600; color: #111; background: var(--card);
}
html[data-device="tablet"] .leaf-statusbar { height: 30px; font-size: 12px; padding: 0 20px; }
.sb-island { position: absolute; left: 50%; top: 11px; width: 122px; height: 34px; transform: translateX(-50%); background: #000; border-radius: 999px; }
html[data-device="tablet"] .sb-island { width: 8px; height: 8px; top: 11px; background: #2a2a2a; }
.sb-icons { display: inline-flex; align-items: center; gap: 6px; }
.sb-icons svg { fill: #111; }
.sb-battery { position: relative; width: 25px; height: 12px; border: 1.5px solid rgba(0,0,0,.45); border-radius: 4px; padding: 1.5px; }
.sb-battery::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: rgba(0,0,0,.45); border-radius: 0 2px 2px 0; }
.sb-level { display: block; height: 100%; width: 100%; background: #111; border-radius: 1.5px; }
.sb-level.low { background: #ef4444; }
html:not([data-device="desktop"]) .leaf-homebar {
  display: block; position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: 134px; height: 5px; border-radius: 999px; background: #111; opacity: .85; z-index: 5; pointer-events: none;
}
html[data-device="tablet"] .leaf-homebar { width: 180px; }
/* The demo's own toasts appear on the device screen. */
.leaf-device > .leaf-toast { position: absolute; }

/* ---------- Top bar controls: preview size + settings ---------- */
.tb-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; }
.tb-seg-btn, .tb-btn {
  width: 30px; height: 28px; border: 0; border-radius: 999px; background: transparent; color: var(--fg-mute);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background .15s, color .15s;
}
.tb-seg-btn svg, .tb-btn svg { width: 16px; height: 16px; }
.tb-seg-btn:hover, .tb-btn:hover { color: var(--fg); background: var(--secondary); }
.tb-seg-btn.on { background: var(--primary); color: var(--primary-fg); }
.tb-btn { width: 36px; height: 36px; border: 1px solid var(--border); background: var(--card); }
.tb-btn:hover svg { animation: spin 2s linear infinite; }
@media (max-width: 600px) { .tb-seg { display: none; } }

/* ---------- Narrow demo widths (mobile preview, small screens) ---------- */
@media (max-width: 480px) {
  .leaf-shell { padding: 12px; }
  .leaf-status .status-chip { font-size: 11px; }
  .stat-grid { gap: 6px; }
}
@container site (max-width: 480px) {
  .leaf-app { padding: 14px; border-radius: 14px; min-height: 0; }
  .title { font-size: 18px; }
}

/* ---------- Waffle Shop (Golden Grid café) ----------
   Palette: cream paper, golden batter, caramel accents, cocoa text. Radius scale 12 / 18 / 26, 4-8px rhythm. */
.leaf-app:has(> .wf) { display: flex; flex-direction: column; background: #fff8ec; }
.leaf-device:has(.wf) .leaf-statusbar { background: #fff8ec; }
/* No toasts in this app: every action already shows its result on screen (flying waffle, tray bar, order tracker). */
.leaf-device:has(.wf) > .leaf-toast, body:has(.wf) > .leaf-toast { display: none; }
.wf, .wf-sheet-host, .wf-ghost {
  --wf-cream: #fff8ec;
  --wf-paper: #fffdf8;
  --wf-butter: #fdecc8;
  --wf-batter: #f6cf86;
  --wf-gold: #eaa23b;
  --wf-caramel: #c26a1a;
  --wf-caramel-2: #a2530f;
  --wf-cocoa: #3f2413;
  --wf-soft: rgba(63, 36, 19, 0.72);
  --wf-mute: rgba(63, 36, 19, 0.52);
  --wf-line: #f1dfc2;
  --wf-berry: #e0476b;
  --wf-mint: #2c8a57;
  --wf-r-sm: 12px;
  --wf-r: 18px;
  --wf-r-lg: 26px;
  --wf-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --wf-spring: cubic-bezier(0.3, 1.4, 0.5, 1);
  --wf-shadow: 0 1px 2px rgba(120, 66, 18, 0.06), 0 6px 18px rgba(120, 66, 18, 0.08);
  --wf-shadow-lg: 0 18px 40px rgba(120, 66, 18, 0.18);
  --wf-display: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Arial Rounded MT Bold", var(--font);
  color: var(--wf-cocoa);
}
.wf { flex: 1; display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 1120px; margin: 0 auto; }
.wf button { font-family: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.wf :focus-visible, .wf-sheet-host :focus-visible { outline: 3px solid rgba(234, 162, 59, 0.55); outline-offset: 2px; }
.wf-display { font-family: var(--wf-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.wf-grow { flex: 1; min-width: 0; }
.wf-muted { color: var(--wf-mute); font-size: 13px; }
.wf-hint { font-weight: 500; color: var(--wf-mute); }

/* Waffle art: the SVG scales with --s so size changes animate. */
.wf-art { display: block; width: 100%; aspect-ratio: 1; }
.wf-svg { display: block; width: 100%; height: 100%; overflow: visible; transform: scale(var(--s, 0.9)); transition: transform 0.45s var(--wf-spring); }

/* ---------- header + tabs ---------- */
.wf-head { display: flex; align-items: center; gap: 12px; }
.wf-logo { width: 44px; height: 44px; border-radius: 14px; background: var(--wf-butter); display: inline-flex; padding: 4px; box-shadow: inset 0 0 0 1px rgba(194, 106, 26, 0.15); flex-shrink: 0; }
.wf-brand { min-width: 0; flex: 1; }
.wf-brand h1 { font-family: var(--wf-display); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.wf-brand p { font-size: 12px; color: var(--wf-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-head > .wf-tabs { display: none; }
.wf-foot { position: sticky; bottom: 12px; z-index: 20; display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.wf-tabs-bottom { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; border-radius: 24px; background: rgba(255, 253, 248, 0.94); border: 1px solid var(--wf-line); box-shadow: 0 12px 30px rgba(120, 66, 18, 0.18); backdrop-filter: blur(12px); }
.wf-tab { position: relative; border: 0; background: none; border-radius: 18px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--wf-mute); transition: background 0.2s var(--wf-ease), color 0.2s, transform 0.15s var(--wf-ease); }
.wf-tab-ico { font-size: 20px; line-height: 1; filter: grayscale(0.85) opacity(0.75); transition: filter 0.2s, transform 0.3s var(--wf-spring); }
.wf-tab.on { background: var(--wf-butter); color: var(--wf-caramel-2); }
.wf-tab.on .wf-tab-ico { filter: none; transform: translateY(-1px) scale(1.08); }
.wf-tab:active { transform: scale(0.95); }
.wf-badge { position: absolute; top: 4px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--wf-berry); color: #fff; font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--wf-paper); }
.wf-badge.live { background: var(--wf-gold); }
.wf-traybar { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 20px; min-height: 54px; padding: 0 18px 0 10px; color: #fff !important; font-weight: 700; font-size: 15px; background: linear-gradient(135deg, var(--wf-caramel), #8a420c); box-shadow: 0 10px 24px rgba(162, 83, 15, 0.35); animation: wfRise 0.35s var(--wf-ease); transition: transform 0.15s var(--wf-ease), filter 0.15s; }
.wf-traybar span:nth-child(2) { flex: 1; text-align: left; }
.wf-traybar-n { min-width: 34px; height: 34px; border-radius: 12px; background: rgba(255, 255, 255, 0.2); display: inline-flex; align-items: center; justify-content: center; }
.wf-traybar:active { transform: scale(0.98); }

/* ---------- buttons ---------- */
.wf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; font-size: 14px; font-weight: 700; color: #fff !important; white-space: nowrap; background: linear-gradient(135deg, #e08a2a, var(--wf-caramel)); box-shadow: 0 4px 14px rgba(194, 106, 26, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25); transition: transform 0.15s var(--wf-ease), box-shadow 0.2s, filter 0.2s; }
.wf-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.wf-btn:active:not(:disabled) { transform: scale(0.97); }
.wf-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.wf-btn-soft { background: var(--wf-butter); color: var(--wf-caramel-2) !important; box-shadow: inset 0 0 0 1px rgba(194, 106, 26, 0.18); }
.wf-btn-light { background: #fff; color: var(--wf-caramel-2) !important; box-shadow: 0 4px 12px rgba(80, 40, 5, 0.2); min-height: 40px; padding: 0 14px; }
.wf-btn-sm { min-height: 40px; padding: 0 14px; font-size: 13px; }
.wf-btn-big { min-height: 52px; font-size: 15px; padding: 0 22px; }
.wf-btn-block { width: 100%; }
.wf-danger { background: #fff0f2; color: #b4234a !important; box-shadow: inset 0 0 0 1px #f8c9d3; }
.wf-danger.armed { background: #c81e4a; color: #fff !important; animation: armPulse 1s ease-in-out infinite; }
.wf-link { border: 0; background: none; color: var(--wf-caramel-2); font-weight: 700; font-size: 13px; padding: 8px 4px; min-height: 44px; text-decoration: underline; text-decoration-color: rgba(194, 106, 26, 0.35); text-underline-offset: 3px; }
.wf-icon-btn { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; border: 1px solid var(--wf-line); background: var(--wf-paper); color: var(--wf-soft); display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background 0.15s, color 0.15s, transform 0.15s var(--wf-ease), border-color 0.15s; }
.wf-icon-btn svg { width: 18px; height: 18px; }
.wf-icon-btn:active { transform: scale(0.94); }

/* ---------- menu ---------- */
.wf-hello p { font-size: 13px; font-weight: 600; color: var(--wf-mute); }
.wf-hello h2 { font-size: 25px; margin-top: 2px; }
.wf-search { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 0 6px 0 14px; min-height: 50px; border-radius: 16px; background: var(--wf-paper); border: 1px solid var(--wf-line); box-shadow: var(--wf-shadow); transition: border-color 0.2s, box-shadow 0.2s; }
.wf-search:focus-within { border-color: var(--wf-gold); box-shadow: 0 0 0 4px rgba(234, 162, 59, 0.18); }
.wf-search > svg { width: 18px; height: 18px; color: var(--wf-mute); flex-shrink: 0; }
.wf-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; min-height: 44px; color: var(--wf-cocoa); }
.wf-search input::-webkit-search-cancel-button { display: none; }
.wf .wf-search input:focus-visible { outline: none; }
.wf-search-x { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--wf-butter); display: inline-flex; align-items: center; justify-content: center; color: var(--wf-caramel-2); }
.wf-search-x svg { width: 15px; height: 15px; }
.wf-chips { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 2px 16px 4px; scrollbar-width: none; }
.wf-chips::-webkit-scrollbar { display: none; }
.wf-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--wf-line); background: var(--wf-paper); font-size: 13.5px; font-weight: 700; color: var(--wf-soft); transition: background 0.2s var(--wf-ease), color 0.2s, border-color 0.2s, transform 0.15s var(--wf-ease); }
.wf-chip span { font-size: 11px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--wf-butter); color: var(--wf-caramel-2); display: inline-flex; align-items: center; justify-content: center; }
.wf-chip.on { background: var(--wf-cocoa); border-color: var(--wf-cocoa); color: #fff8ec; }
.wf-chip.on span { background: rgba(255, 255, 255, 0.18); color: #fff; }
.wf-chip:active { transform: scale(0.96); }
.wf-h3 { font-family: var(--wf-display); font-size: 17px; font-weight: 800; margin: 20px 2px 12px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.wf-h3 span { font-family: var(--font); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--wf-butter); color: var(--wf-caramel-2); }

.wf-hero { position: relative; display: flex; align-items: center; gap: 4px; margin-top: 16px; padding: 18px 8px 18px 18px; border-radius: var(--wf-r-lg); color: #fff; cursor: pointer; overflow: hidden; background: radial-gradient(circle at 85% 30%, rgba(255, 226, 150, 0.55), transparent 45%), linear-gradient(135deg, #f0a335 0%, #d4731c 55%, #a8500f 100%); box-shadow: 0 14px 30px rgba(194, 106, 26, 0.3); transition: transform 0.25s var(--wf-ease), box-shadow 0.25s; }
.wf-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, 0.07) 2px, transparent 2px), linear-gradient(90deg, rgba(255, 255, 255, 0.07) 2px, transparent 2px); background-size: 22px 22px; pointer-events: none; }
.wf-hero-copy { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wf-eyebrow { align-self: flex-start; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); }
.wf-hero h2 { font-family: var(--wf-display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-shadow: 0 2px 0 rgba(120, 50, 0, 0.2); }
.wf-hero p { font-size: 12.5px; line-height: 1.4; opacity: 0.92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wf-hero-foot { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.wf-hero-foot b { font-size: 20px; font-family: var(--wf-display); }
.wf-hero-art { position: relative; width: 136px; flex-shrink: 0; filter: drop-shadow(0 10px 14px rgba(90, 40, 0, 0.35)); }

.wf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wf-card { position: relative; display: flex; flex-direction: column; text-align: left; min-width: 0; border-radius: 22px; background: var(--wf-paper); border: 1px solid var(--wf-line); box-shadow: var(--wf-shadow); cursor: pointer; overflow: hidden; transition: transform 0.25s var(--wf-ease), box-shadow 0.25s, border-color 0.2s; }
.wf-card:active { transform: scale(0.98); }
.wf-card-art { position: relative; padding: 14px 14px 4px; }
.wf-card-art .wf-art { max-width: 150px; margin: 0 auto; }
.wf-card-tags { position: absolute; top: 8px; left: 8px; right: 44px; display: flex; flex-wrap: wrap; gap: 4px; }
.wf-card-tags.wf-static { position: static; }
.wf-tag { font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: var(--wf-caramel-2); box-shadow: 0 1px 3px rgba(120, 66, 18, 0.12); white-space: nowrap; }
.wf-tag-vegan { color: var(--wf-mint); }
.wf-tag-popular { color: #c2410c; }
.wf-tag-new { color: #7c3aed; }
.wf-mini-btn { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, 0.92); color: var(--wf-caramel-2); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(120, 66, 18, 0.15); transition: transform 0.15s var(--wf-ease), background 0.15s; }
.wf-mini-btn svg { width: 15px; height: 15px; }
.wf-mini-btn::after { content: ""; position: absolute; inset: -4px; }
.wf-mini-btn:active { transform: scale(0.92); }
.wf-card-body { display: flex; flex-direction: column; gap: 4px; padding: 6px 12px 12px; flex: 1; }
.wf-card-name { font-family: var(--wf-display); font-size: 15px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.wf-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 11.5px; color: var(--wf-mute); font-weight: 600; }
.wf-card-meta > span + span::before { content: "·"; margin-right: 8px; }
.wf-rate { color: #c27a0e; font-weight: 800; }
.wf-yours { color: #7c3aed; font-weight: 800; }
.wf-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.wf-price { font-family: var(--wf-display); font-size: 17px; font-weight: 800; }
.wf-add { width: 44px; height: 44px; border-radius: 15px; border: 0; color: #fff; background: linear-gradient(135deg, #e08a2a, var(--wf-caramel)); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(194, 106, 26, 0.35); transition: transform 0.25s var(--wf-spring), box-shadow 0.2s; }
.wf-add svg { width: 20px; height: 20px; stroke-width: 2.6; }
.wf-add:active { transform: scale(0.88); }
.wf-new { align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 18px 14px; min-height: 240px; border: 2px dashed #ebcf9f; background: repeating-linear-gradient(45deg, transparent 0 12px, rgba(246, 207, 134, 0.12) 12px 24px), var(--wf-paper); box-shadow: none; }
.wf-new b { font-family: var(--wf-display); font-size: 15px; }
.wf-new span:last-child { font-size: 12px; color: var(--wf-mute); line-height: 1.4; }
.wf-new-plus { width: 54px; height: 54px; border-radius: 18px; background: var(--wf-butter); color: var(--wf-caramel); display: inline-flex; align-items: center; justify-content: center; transition: transform 0.3s var(--wf-spring); }
.wf-new-plus svg { width: 26px; height: 26px; }
.wf-flash { border-color: var(--wf-gold); box-shadow: 0 0 0 3px rgba(234, 162, 59, 0.35), var(--wf-shadow-lg); }
.wf-side { display: none; }

/* skeletons + empty states */
.wf-skel { border-radius: 22px; background: linear-gradient(100deg, #fbeed7 30%, #fff7e8 50%, #fbeed7 70%); background-size: 300% 100%; animation: wfShimmer 1.3s linear infinite; }
.wf-grid .wf-skel { height: 240px; }
.wf-skel > * { display: none; }
.wf-skel-hero { height: 170px; margin-top: 16px; border-radius: var(--wf-r-lg); }
.wf-skel-line { height: 84px; margin-bottom: 10px; border-radius: var(--wf-r); }
.wf-skel-track { height: 420px; border-radius: var(--wf-r-lg); }
.wf-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 18px; border-radius: var(--wf-r-lg); background: var(--wf-paper); border: 1px dashed #ebcf9f; }
.wf-empty b { font-family: var(--wf-display); font-size: 17px; }
.wf-empty p { font-size: 13px; color: var(--wf-mute); max-width: 260px; line-height: 1.45; margin-bottom: 8px; }
.wf-empty-art { width: 96px; }
.wf-empty-emoji, .wf-plate { font-size: 46px; line-height: 1; margin-bottom: 4px; width: auto; }
.wf-empty-sm { padding: 20px; }
.wf-row-c { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- cart ---------- */
.wf-cart-page { max-width: 560px; width: 100%; margin: 0 auto; }
.wf-cart-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.wf-cart-head h2 { font-size: 23px; }
.wf-count { font-size: 12px; font-weight: 700; color: var(--wf-mute); }
.wf-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wf-line { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: var(--wf-r); background: var(--wf-paper); border: 1px solid var(--wf-line); box-shadow: var(--wf-shadow); }
.wf-line-art { width: 66px; height: 66px; flex-shrink: 0; border-radius: 16px; padding: 4px; }
.wf-line-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wf-line-main > b { font-family: var(--wf-display); font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-line-sub { font-size: 12px; color: var(--wf-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-line-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.wf-line-price { font-weight: 800; font-size: 15px; }
.wf-remove { width: 40px; height: 40px; border: 0; background: none; color: var(--wf-mute); }
.wf-remove::after { content: ""; position: absolute; }
.wf-stepper { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--wf-butter); }
.wf-stepper button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--wf-paper); display: inline-flex; align-items: center; justify-content: center; color: var(--wf-caramel-2); box-shadow: 0 1px 3px rgba(120, 66, 18, 0.15); transition: transform 0.15s var(--wf-ease), background 0.15s; }
.wf-stepper button svg { width: 15px; height: 15px; stroke-width: 2.6; }
.wf-stepper button:active:not(:disabled) { transform: scale(0.88); }
.wf-stepper button:disabled { opacity: 0.4; box-shadow: none; }
.wf-stepper b { min-width: 26px; text-align: center; font-size: 15px; }
.wf-stepper-lg button { width: 44px; height: 44px; }
.wf-label { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--wf-mute); margin: 18px 2px 8px; }
.wf-slots { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.wf-slots::-webkit-scrollbar { display: none; }
.wf-slot { flex-shrink: 0; min-width: 84px; min-height: 54px; border-radius: 16px; border: 1px solid var(--wf-line); background: var(--wf-paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0 12px; transition: background 0.2s, border-color 0.2s, transform 0.15s var(--wf-ease); }
.wf-slot b { font-size: 14px; }
.wf-slot span { font-size: 10.5px; color: var(--wf-mute); font-weight: 600; }
.wf-slot.on { background: var(--wf-cocoa); border-color: var(--wf-cocoa); color: #fff8ec; }
.wf-slot.on span { color: rgba(255, 248, 236, 0.7); }
.wf-slot:active { transform: scale(0.96); }
.wf-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: #fbeed7; }
.wf-seg button { border: 0; background: none; border-radius: 12px; min-height: 44px; font-size: 13.5px; font-weight: 700; color: var(--wf-soft); transition: background 0.2s var(--wf-ease), color 0.2s, box-shadow 0.2s; }
.wf-seg button.on { background: var(--wf-paper); color: var(--wf-cocoa); box-shadow: 0 2px 8px rgba(120, 66, 18, 0.15); }
.wf-seg button:disabled { opacity: 0.45; }
.wf-totals { margin: 18px 0 14px; padding: 14px 16px; border-radius: var(--wf-r); background: var(--wf-paper); border: 1px solid var(--wf-line); display: flex; flex-direction: column; gap: 8px; }
.wf-totals div { display: flex; justify-content: space-between; font-size: 14px; color: var(--wf-soft); }
.wf-totals dt, .wf-totals dd { margin: 0; }
.wf-totals .wf-total { padding-top: 10px; border-top: 1px dashed var(--wf-line); color: var(--wf-cocoa); font-weight: 800; font-size: 17px; font-family: var(--wf-display); }

/* ---------- builder ---------- */
.wf-build { display: flex; flex-direction: column; gap: 16px; }
.wf-stage { position: sticky; top: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 10px 8px; box-shadow: inset 0 0 0 1px rgba(194, 106, 26, 0.12), 0 10px 20px -12px rgba(120, 66, 18, 0.35); border-radius: var(--wf-r-lg); background: radial-gradient(circle at 50% 46%, #fff 0 30%, transparent 62%), radial-gradient(circle at 50% 50%, #fde4b4, #f9d394 80%); }
.wf-editing { align-self: stretch; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.75); font-size: 13px; }
.wf-editing svg { width: 15px; height: 15px; color: var(--wf-caramel); flex-shrink: 0; }
.wf-editing span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-preview { position: relative; width: 100%; max-width: 150px; }
.wf-art-xl .wf-svg { filter: drop-shadow(0 8px 10px rgba(120, 60, 10, 0.22)); }
.wf-price-chip { position: absolute; top: 0; right: -18px; padding: 6px 11px; border-radius: 999px; background: var(--wf-cocoa); color: #fff8ec; font-weight: 800; font-size: 13px; box-shadow: 0 6px 14px rgba(63, 36, 19, 0.25); }
.wf-preview-name { font-family: var(--wf-display); font-weight: 800; font-size: 16px; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.01em; }
.wf-panel { display: flex; flex-direction: column; min-width: 0; }
.wf-panel > .wf-steps { display: none; }
.wf-stage > .wf-steps { align-self: stretch; margin-top: 6px; background: rgba(255, 255, 255, 0.55); }
.wf-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 20px; background: #fbeed7; }
.wf-steps::-webkit-scrollbar { display: none; }
.wf-step { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; padding: 6px 2px; border-radius: 16px; border: 0; background: none; font-size: 11px; white-space: nowrap; font-weight: 700; color: var(--wf-soft); transition: background 0.2s var(--wf-ease), color 0.2s, border-color 0.2s; }
.wf-step i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--wf-butter); color: var(--wf-caramel-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.wf-step i svg { width: 14px; height: 14px; stroke-width: 3; }
.wf-step.done i { background: var(--wf-mint); color: #fff; }
.wf-step.on { background: var(--wf-paper); color: var(--wf-cocoa); box-shadow: 0 2px 8px rgba(120, 66, 18, 0.15); }
.wf-step.on i { background: var(--wf-cocoa); color: #fff8ec; }
.wf-step-body { padding: 12px 0 4px; min-height: 260px; }
.wf-opts { display: grid; gap: 8px; }
.wf-opts-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wf-opts-batter { grid-template-columns: minmax(0, 1fr); }
.wf-opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px 12px; border-radius: var(--wf-r); border: 1.5px solid var(--wf-line); background: var(--wf-paper); font-size: 13px; transition: border-color 0.2s, background 0.2s, transform 0.15s var(--wf-ease), box-shadow 0.2s; }
.wf-opt b { font-weight: 800; }
.wf-opt > span:last-child { font-size: 11.5px; color: var(--wf-mute); font-weight: 600; }
.wf-opt-art { width: 64px; }
.wf-opt.on { border-color: var(--wf-gold); background: #fff5e0; box-shadow: 0 0 0 3px rgba(234, 162, 59, 0.2); }
.wf-opt:active { transform: scale(0.97); }
.wf-opt-row { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 8px 14px 8px 8px; min-height: 58px; text-align: left; }
.wf-opt-row b { flex: 1; min-width: 0; font-size: 14px; }
.wf-swatch { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(120, 66, 18, 0.15); display: inline-flex; align-items: center; justify-content: center; color: var(--wf-mute); font-weight: 700; }
.wf-drop-sw { border-radius: 50% 50% 50% 8px; transform: rotate(135deg); }
.wf-top-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--wf-soft); }
.wf-meter { display: inline-flex; gap: 4px; }
.wf-meter i { width: 18px; height: 8px; border-radius: 999px; background: #f6e3c0; transition: background 0.25s var(--wf-ease), transform 0.3s var(--wf-spring); }
.wf-meter i.on { background: var(--wf-gold); transform: scaleY(1.2); }
.wf-note { margin-top: 8px; font-size: 12.5px; padding: 8px 12px; border-radius: 12px; background: #fff0d6; color: #8a4a0b; font-weight: 600; }
.wf-tops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wf-top { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 84px; padding: 8px 4px; border-radius: 16px; border: 1.5px solid var(--wf-line); background: var(--wf-paper); font-size: 12px; transition: border-color 0.2s, background 0.2s, transform 0.15s var(--wf-ease), opacity 0.2s; }
.wf-top b { font-weight: 700; line-height: 1.2; text-align: center; }
.wf-top > span:not(.wf-top-emoji) { font-size: 11px; color: var(--wf-mute); font-weight: 600; }
.wf-top-emoji { font-size: 26px; line-height: 1.1; transition: transform 0.3s var(--wf-spring); }
.wf-top.on { border-color: var(--wf-gold); background: #fff5e0; }
.wf-top.on .wf-top-emoji { transform: scale(1.12) rotate(-6deg); }
.wf-top:active:not(:disabled) { transform: scale(0.95); }
.wf-top:disabled { opacity: 0.4; cursor: not-allowed; }
.wf-top-n { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; background: var(--wf-gold); color: #fff; font-size: 11px; font-weight: 800; font-style: normal; display: inline-flex; align-items: center; justify-content: center; }
.wf-name-row { display: flex; gap: 8px; }
.wf-input { width: 100%; min-height: 50px; border: 1.5px solid var(--wf-line); background: var(--wf-paper); border-radius: 14px; padding: 0 14px; font-size: 16px; font-weight: 600; color: var(--wf-cocoa); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.wf-input:focus { border-color: var(--wf-gold); box-shadow: 0 0 0 4px rgba(234, 162, 59, 0.18); }
.wf-textarea { padding: 12px 14px; min-height: 76px; resize: vertical; font-size: 14px; font-weight: 500; font-family: inherit; }
.wf-dice { width: 50px; height: 50px; font-size: 22px; }
.wf-summary { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--wf-soft); padding: 12px 14px; border-radius: 14px; background: #fff5e0; }
.wf-build-actions { display: grid; gap: 8px; margin-top: 14px; }
.wf-buildbar { position: sticky; bottom: 86px; z-index: 15; display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 8px 8px 16px; border-radius: 22px; background: var(--wf-cocoa); color: #fff8ec; box-shadow: 0 12px 28px rgba(63, 36, 19, 0.3); }
.wf-buildbar-price { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wf-buildbar-price b { font-family: var(--wf-display); font-size: 19px; font-weight: 800; }
.wf-buildbar-price span { font-size: 11px; opacity: 0.65; white-space: nowrap; }
.wf-buildbar .wf-icon-btn { background: rgba(255, 255, 255, 0.12); border-color: transparent; color: #fff8ec; }
.wf-buildbar .wf-btn { padding: 0 16px; }

/* ---------- orders ---------- */
.wf-orders { display: flex; flex-direction: column; gap: 6px; }
.wf-page-title { font-size: 23px; margin-bottom: 12px; }
.wf-tracks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.wf-orders > section { min-width: 0; }
.wf-track { min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: var(--wf-r-lg); background: linear-gradient(180deg, #fff, var(--wf-paper)); border: 1px solid var(--wf-line); box-shadow: var(--wf-shadow); }
.wf-track-head { display: flex; align-items: flex-start; gap: 10px; }
.wf-track-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wf-track-head .wf-eyebrow { background: var(--wf-butter); color: var(--wf-caramel-2); }
.wf-track-head h3 { font-size: 21px; }
.wf-track-head p { font-size: 13px; color: var(--wf-mute); }
.wf-pickup { display: flex; flex-direction: column; align-items: center; padding: 8px 12px; border-radius: 14px; background: var(--wf-cocoa); color: #fff8ec; font-weight: 800; font-size: 14px; white-space: nowrap; }
.wf-pickup small { font-size: 10px; opacity: 0.65; font-weight: 600; }
.wf-griddle { position: relative; height: 170px; border-radius: 20px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; background: radial-gradient(circle at 50% 100%, rgba(255, 140, 40, 0.28), transparent 60%), linear-gradient(180deg, #fff6e4, #fde6bf); }
.wf-iron { position: absolute; left: 50%; bottom: 14px; width: 190px; height: 30px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #5a4a40, #2c221c 70%); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25); }
.wf-griddle-art { position: relative; z-index: 1; width: 140px; margin-bottom: 18px; }
.wf-st-received .wf-griddle-art { filter: saturate(0.35) brightness(1.18); opacity: 0.85; }
.wf-st-ready .wf-griddle { background: radial-gradient(circle at 50% 70%, rgba(255, 220, 120, 0.65), transparent 60%), linear-gradient(180deg, #fffbe9, #fdebc4); }
.wf-steam, .wf-sizzle { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: none; }
.wf-st-griddle .wf-steam, .wf-st-topping .wf-steam, .wf-st-griddle .wf-sizzle { display: block; }
.wf-steam i { position: absolute; bottom: 70px; width: 10px; height: 46px; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95)); filter: blur(2.5px); opacity: 0; }
.wf-steam i:nth-child(1) { left: calc(50% - 40px); }
.wf-steam i:nth-child(2) { left: calc(50% - 5px); height: 56px; }
.wf-steam i:nth-child(3) { left: calc(50% + 30px); }
.wf-sizzle i { position: absolute; bottom: 30px; width: 5px; height: 5px; border-radius: 50%; background: #ffb340; opacity: 0; }
.wf-sizzle i:nth-child(1) { left: calc(50% - 88px); }
.wf-sizzle i:nth-child(2) { left: calc(50% - 60px); }
.wf-sizzle i:nth-child(3) { left: calc(50% + 62px); }
.wf-sizzle i:nth-child(4) { left: calc(50% + 86px); }
.wf-sizzle i:nth-child(5) { left: calc(50% + 20px); bottom: 22px; }
.wf-progress { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.wf-progress::before, .wf-progress::after { content: ""; position: absolute; top: 17px; left: 12.5%; height: 4px; border-radius: 999px; }
.wf-progress::before { right: 12.5%; background: #f6e3c0; }
.wf-progress::after { width: calc(75% * var(--p)); background: linear-gradient(90deg, var(--wf-gold), var(--wf-caramel)); transition: width 0.8s var(--wf-ease); }
.wf-progress li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 11px; font-weight: 700; color: var(--wf-mute); line-height: 1.2; padding: 0 2px; }
.wf-progress li i { font-style: normal; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--wf-paper); border: 2px solid #f6e3c0; font-size: 16px; filter: grayscale(1); opacity: 0.7; transition: all 0.3s var(--wf-ease); }
.wf-progress li.done i { background: var(--wf-gold); border-color: var(--wf-gold); color: #fff; filter: none; opacity: 1; }
.wf-progress li.done i svg { width: 16px; height: 16px; stroke-width: 3; }
.wf-progress li.cur { color: var(--wf-cocoa); }
.wf-progress li.cur i { border-color: var(--wf-caramel); background: #fff5e0; filter: none; opacity: 1; box-shadow: 0 0 0 5px rgba(234, 162, 59, 0.2); }
.wf-order-items { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px dashed var(--wf-line); display: flex; flex-direction: column; gap: 8px; }
.wf-order-items li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.wf-order-items b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-order-items small, .wf-past small { display: block; font-size: 11.5px; color: var(--wf-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-mini-art { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: #fdecc8; padding: 2px; }
.wf-track-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wf-track-total { flex: 1; min-width: 140px; font-family: var(--wf-display); font-size: 20px; font-weight: 800; display: flex; flex-direction: column; }
.wf-track-total small { font-family: var(--font); font-size: 11.5px; font-weight: 600; color: var(--wf-mute); }
.wf-pasts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wf-past { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: var(--wf-r); background: var(--wf-paper); border: 1px solid var(--wf-line); }
.wf-past b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-past-arts { display: flex; }
.wf-past-arts .wf-mini-art + .wf-mini-art { margin-left: -16px; box-shadow: -2px 0 0 var(--wf-paper); }

/* ---------- detail sheet ---------- */
.wf-sheet-host { position: fixed; inset: 0; z-index: 70; pointer-events: none; font-family: var(--font); }
.wf-sheet-host.in-device { position: absolute; border-radius: inherit; overflow: hidden; }
.wf-backdrop { position: absolute; inset: 0; background: rgba(63, 36, 19, 0.42); backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.3s; }
.wf-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 92%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; background: var(--wf-cream); border-radius: 28px 28px 0 0; transform: translateY(100%); transition: transform 0.38s cubic-bezier(0.2, 0.9, 0.25, 1); box-shadow: 0 -12px 40px rgba(63, 36, 19, 0.25); }
.wf-sheet-host.open { pointer-events: auto; }
.wf-sheet-host.open .wf-backdrop { opacity: 1; }
.wf-sheet-host.open .wf-sheet { transform: none; }
.wf-grab { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; justify-content: center; padding: 10px 0; }
.wf-grab i { width: 42px; height: 5px; border-radius: 999px; background: rgba(63, 36, 19, 0.22); }
.wf-sheet-art { position: relative; display: flex; align-items: center; justify-content: center; height: 236px; padding: 22px 0 6px; }
.wf-art-sheet { width: 214px; filter: drop-shadow(0 12px 14px rgba(120, 60, 10, 0.22)); }
.wf-size-tag { position: absolute; bottom: 12px; right: 16px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); font-size: 12px; font-weight: 800; color: var(--wf-caramel-2); }
.wf-detail { padding: 16px 18px 22px; display: flex; flex-direction: column; }
.wf-sheet-host.in-device .wf-detail { padding-bottom: 34px; }
.wf-detail-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.wf-detail-head h2 { font-size: 24px; overflow-wrap: anywhere; }
.wf-detail-head .wf-card-meta { margin-top: 4px; font-size: 12.5px; }
.wf-desc { font-size: 14px; line-height: 1.55; color: var(--wf-soft); margin-top: 10px; }
.wf-ingredients { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-ingredients span { font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 999px; background: var(--wf-paper); border: 1px solid var(--wf-line); }
.wf-seg-size button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 52px; }
.wf-seg-size button span { font-size: 11.5px; font-weight: 600; color: var(--wf-mute); }
.wf-extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wf-extra { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; min-height: 56px; padding: 8px 30px 8px 10px; border-radius: 16px; border: 1.5px solid var(--wf-line); background: var(--wf-paper); transition: border-color 0.2s, background 0.2s, transform 0.15s var(--wf-ease); }
.wf-extra > span { grid-row: span 2; font-size: 22px; }
.wf-extra b { font-size: 13px; line-height: 1.2; }
.wf-extra small { font-size: 11.5px; color: var(--wf-mute); font-weight: 600; }
.wf-extra i { position: absolute; top: 50%; right: 8px; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; border: 1.5px solid var(--wf-line); display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: all 0.2s var(--wf-ease); }
.wf-extra i svg { width: 12px; height: 12px; stroke-width: 3.5; }
.wf-extra.on { border-color: var(--wf-gold); background: #fff5e0; }
.wf-extra.on i { background: var(--wf-gold); border-color: var(--wf-gold); color: #fff; transform: scale(1.1); }
.wf-extra:active { transform: scale(0.97); }
.wf-own { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.wf-own .wf-btn svg { width: 15px; height: 15px; }
.wf-remix { align-self: flex-start; margin-top: 10px; }
.wf-sheet-cta { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; margin: 16px -18px -22px; padding: 12px 18px 22px; background: linear-gradient(180deg, rgba(255, 248, 236, 0), var(--wf-cream) 30%); }
.wf-sheet-host.in-device .wf-sheet-cta { margin-bottom: -34px; padding-bottom: 34px; }
.wf-sheet-cta .wf-btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 700px) {
  .wf-sheet-host:not(.in-device) .wf-sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 520px; max-height: 88vh; border-radius: 28px; transform: translate(-50%, -44%) scale(0.97); opacity: 0; transition: transform 0.3s var(--wf-ease), opacity 0.2s; }
  .wf-sheet-host.open:not(.in-device) .wf-sheet { transform: translate(-50%, -50%); opacity: 1; }
  .wf-sheet-host:not(.in-device) .wf-grab { display: none; }
}

/* Flying waffle on quick add. */
.wf-ghost { position: fixed; z-index: 9999; pointer-events: none; display: block; }
.wf-ghost .wf-svg { transition: none; }

/* ---------- hover (pointer devices only) ---------- */
@media (hover: hover) {
  .wf-tab:hover:not(.on) { background: rgba(253, 236, 200, 0.6); color: var(--wf-cocoa); }
  .wf-tab:hover .wf-tab-ico { filter: none; }
  .wf-btn:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 8px 20px rgba(194, 106, 26, 0.35); transform: translateY(-1px); }
  .wf-btn-soft:hover:not(:disabled) { box-shadow: inset 0 0 0 1px rgba(194, 106, 26, 0.35); background: #fbe2b0; }
  .wf-danger:hover:not(:disabled) { background: #ffe3e8; }
  .wf-danger.armed:hover { background: #a8173c; }
  .wf-icon-btn:hover { background: var(--wf-butter); color: var(--wf-caramel-2); border-color: #ebcf9f; }
  .wf-remove:hover { background: #ffe8ec; color: #c81e4a; }
  .wf-chip:hover:not(.on) { border-color: #ebcf9f; color: var(--wf-cocoa); background: #fff5e0; }
  .wf-card:hover { transform: translateY(-4px); box-shadow: var(--wf-shadow-lg); border-color: #ebcf9f; }
  .wf-card:hover .wf-card-art .wf-svg { transform: scale(calc(var(--s) * 1.06)) rotate(-5deg); }
  .wf-new:hover .wf-new-plus { transform: rotate(90deg) scale(1.08); }
  .wf-add:hover { transform: rotate(90deg) scale(1.06); box-shadow: 0 8px 18px rgba(194, 106, 26, 0.45); }
  .wf-mini-btn:hover { background: #fff; transform: scale(1.06); }
  .wf-hero:hover { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(194, 106, 26, 0.38); }
  .wf-hero:hover .wf-hero-art .wf-svg { transform: scale(1.05) rotate(6deg); }
  .wf-opt:hover:not(.on), .wf-top:hover:not(.on):not(:disabled), .wf-extra:hover:not(.on), .wf-slot:hover:not(.on) { border-color: #ebcf9f; background: #fffaf0; }
  .wf-step:hover:not(.on) { border-color: #ebcf9f; color: var(--wf-cocoa); }
  .wf-seg button:hover:not(.on):not(:disabled) { color: var(--wf-cocoa); background: rgba(255, 255, 255, 0.5); }
  .wf-stepper button:hover:not(:disabled) { background: #fff; }
  .wf-link:hover { text-decoration-color: currentColor; }
  .wf-traybar:hover { filter: brightness(1.08); }
  .wf-past:hover { border-color: #ebcf9f; }
}

/* ---------- motion ---------- */
@keyframes wfShimmer { to { background-position: -150% 0; } }
@keyframes wfRise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes wfPop { 0% { opacity: 0; transform: translateY(16px) scale(0.96); } 100% { opacity: 1; transform: none; } }
@keyframes wfFade { from { opacity: 0; transform: translateY(6px); } }
@keyframes wfDrop { 0% { opacity: 0; transform: translateY(-70px) scale(1.15); } 55% { opacity: 1; transform: translateY(4px) scale(0.95, 1.05); } 75% { transform: translateY(-5px); } 100% { transform: none; } }
@keyframes wfPour { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes wfBob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes wfSteam { 0% { opacity: 0; transform: translateY(10px) scaleX(0.8); } 30% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(-60px) scaleX(1.6) translateX(6px); } }
@keyframes wfSizzle { 0%, 60%, 100% { opacity: 0; transform: none; } 70% { opacity: 1; transform: translateY(-8px) scale(1.2); } 85% { opacity: 0.5; transform: translate(4px, -16px) scale(0.6); } }
@keyframes wfPulse { 0%, 100% { box-shadow: 0 0 0 5px rgba(234, 162, 59, 0.2); } 50% { box-shadow: 0 0 0 10px rgba(234, 162, 59, 0); } }
@keyframes wfRing { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } 50% { transform: rotate(0); } }
@keyframes wfFlash { 0% { box-shadow: 0 0 0 0 rgba(234, 162, 59, 0.6); } 100% { box-shadow: 0 0 0 14px rgba(234, 162, 59, 0); } }
@media (prefers-reduced-motion: no-preference) {
  .wf-enter .wf-hello, .wf-enter .wf-search, .wf-enter .wf-chips, .wf-enter .wf-hero, .wf-enter .wf-stage, .wf-enter .wf-panel, .wf-enter .wf-cart-head, .wf-enter .wf-track, .wf-enter .wf-page-title, .wf-enter .wf-empty { animation: wfFade 0.4s var(--wf-ease) both; }
  .wf-enter .wf-search { animation-delay: 40ms; }
  .wf-enter .wf-chips { animation-delay: 80ms; }
  .wf-enter .wf-hero, .wf-enter .wf-panel { animation-delay: 110ms; }
  .wf-enter .wf-card, .wf-enter .wf-line, .wf-enter .wf-past { animation: wfPop 0.45s var(--wf-ease) both; animation-delay: calc(120ms + var(--i, 0) * 45ms); }
  .wf-hero-art { animation: wfBob 5s ease-in-out infinite; }
  .wf-drop .wf-pc { animation: wfDrop 0.6s var(--wf-ease) both; animation-delay: calc(var(--k, 0) * 55ms); transform-box: fill-box; transform-origin: 50% 100%; }
  .wf-pour path[pathLength] { stroke-dasharray: 1; animation: wfPour 1.1s ease-out both; }
  .wf-pour ellipse { animation: wfFade 0.4s 0.8s both; }
  .wf-steam i { animation: wfSteam 2.2s ease-out infinite; }
  .wf-steam i:nth-child(2) { animation-delay: 0.7s; }
  .wf-steam i:nth-child(3) { animation-delay: 1.4s; }
  .wf-sizzle i { animation: wfSizzle 1.6s ease-out infinite; }
  .wf-sizzle i:nth-child(2) { animation-delay: 0.4s; }
  .wf-sizzle i:nth-child(3) { animation-delay: 0.8s; }
  .wf-sizzle i:nth-child(4) { animation-delay: 1.1s; }
  .wf-sizzle i:nth-child(5) { animation-delay: 0.2s; }
  .wf-st-griddle .wf-griddle-art { animation: wfBob 2.6s ease-in-out infinite; }
  .wf-progress li.cur i { animation: wfPulse 1.6s ease-in-out infinite; }
  .wf-st-ready .wf-progress li.cur i { animation: wfRing 1.4s ease-in-out infinite; }
  .wf-flash { animation: wfFlash 0.8s ease-out 2; }
}
@media (prefers-reduced-motion: reduce) {
  .wf *, .wf-sheet-host * { transition-duration: 0.01ms !important; animation: none !important; }
}

/* ---------- tablet + desktop ---------- */
@container site (min-width: 640px) {
  .wf { gap: 18px; }
  .wf-head > .wf-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 18px; background: #fbeed7; }
  .wf-head .wf-tab { flex-direction: row; min-height: 44px; padding: 0 14px; gap: 7px; font-size: 13.5px; border-radius: 14px; }
  .wf-head .wf-tab-ico { font-size: 16px; }
  .wf-head .wf-tab.on { background: var(--wf-paper); color: var(--wf-cocoa); box-shadow: 0 2px 8px rgba(120, 66, 18, 0.14); }
  .wf-head .wf-badge { position: static; box-shadow: none; }
  .wf-foot { display: none; }
  .wf-menu { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
  .wf-side { display: block; position: sticky; top: 12px; padding: 16px; border-radius: var(--wf-r-lg); background: var(--wf-paper); border: 1px solid var(--wf-line); box-shadow: var(--wf-shadow); max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin; }
  .wf-side .wf-cart-head h2 { font-size: 19px; }
  .wf-side .wf-line { padding: 8px; box-shadow: none; background: #fff; }
  .wf-side .wf-line-art { width: 52px; height: 52px; }
  .wf-side .wf-slots { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; }
  .wf-side .wf-slot { min-width: 0; flex: 1 0 74px; }
  .wf-side .wf-empty { border: 0; padding: 18px 6px; }
  .wf-side .wf-totals { background: #fff; }
  .wf-chips { margin: 12px 0 0; padding: 2px 0 4px; flex-wrap: wrap; }
  .wf-hero { padding: 24px 18px 24px 26px; }
  .wf-hero h2 { font-size: 30px; }
  .wf-hero p { font-size: 13.5px; }
  .wf-hero-art { width: 170px; }
  .wf-build { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
  .wf-stage { top: 12px; padding: 22px 18px; min-height: 380px; justify-content: center; }
  .wf-stage > .wf-steps { display: none; }
  .wf-panel > .wf-steps { display: grid; }
  .wf-preview { max-width: 300px; }
  .wf-step { font-size: 12px; min-height: 60px; }
  .wf-preview-name { font-size: 19px; }
  .wf-buildbar { bottom: 12px; }
  .wf-opts-batter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wf-tops { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wf-slots { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; }
  .wf-orders { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .wf-orders .wf-h3 { margin-top: 6px; }
  .wf-griddle { height: 200px; }
  .wf-griddle-art { width: 160px; }
}
@container site (min-width: 900px) {
  .wf-menu { grid-template-columns: minmax(0, 1fr) 330px; }
  .wf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wf-opts-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .wf-preview { max-width: 340px; }
}
