/* ─────────────────────────────────────────────────────────────────────────
   White Label — Premium Editorial Token System
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* ── FIXED CHROME — never overridden by user logo ─────────────────── */
  --paper:        #FAF9F5;        /* warm off-white, primary surface */
  --paper-2:      #F4F1E8;        /* linen, secondary surface */
  --paper-3:      #ECE7D8;        /* cream, dividers / quiet zones */
  --paper-tint:   #F8F5EA;        /* hover background */

  --ink:          #0F0F0E;        /* primary text, deep coal */
  --ink-2:        #2A2925;        /* secondary text */
  --mu:           #6E6963;        /* muted, warm grey-brown */
  --mu-2:         #9F9A91;        /* tertiary text */
  --di:           #C9C3B6;        /* disabled */

  --line:         rgba(15,15,14,0.08);
  --line-2:       rgba(15,15,14,0.14);
  --line-3:       rgba(15,15,14,0.22);

  /* Neutral hospitality accents — also FIXED */
  --sage:         #C8D4C0;        /* soft sage for "ready" / produce */
  --sage-deep:    #5A7A52;
  --bone:         #E8E2D2;
  --ivory:        #F1ECDC;

  /* Semantic */
  --ok:           #5A7A52;
  --warn:         #B45309;
  --danger:       #B91C1C;
  --info:         #4A6B7C;

  /* ── BRAND ACCENT — the one variable that comes from the restaurant ── */
  --accent:       #E04E1F;        /* default: terra coral (premium-safe baseline) */
  --accent-soft:  #F8DCD0;        /* lighter wash */
  --accent-deep:  #A93915;        /* darker */
  --accent-tint:  #FBE9E0;        /* faintest tint for hovers */
  --accent-ink:   #FFFFFF;        /* text on the accent itself */

  /* ── Type ────────────────────────────────────────────────────────── */
  --serif:        "Fraunces", "Instrument Serif", Georgia, serif;
  --sans:         "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:         "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* ── Radius ──────────────────────────────────────────────────────── */
  --r-xs: 4px;   --r-sm: 8px;
  --r-md: 12px;  --r-lg: 18px;
  --r-xl: 28px;  --r-pill: 999px;

  /* ── Shadow (restrained — premium = no shadow shouting) ──────────── */
  --sh-1: 0 1px 0 rgba(15,15,14,0.04);
  --sh-2: 0 12px 32px -20px rgba(15,15,14,0.18), 0 2px 6px -2px rgba(15,15,14,0.06);
  --sh-3: 0 36px 80px -40px rgba(15,15,14,0.32), 0 12px 24px -12px rgba(15,15,14,0.10);
  --sh-press: inset 0 0 0 1px rgba(15,15,14,0.10);

  /* ── Backward-compat aliases (removed after all views are migrated) ── */
  --bg:           #FAF9F5;        /* → --paper */
  --bg-2:         #F4F1E8;        /* → --paper-2 */
  --coral:        #E04E1F;        /* → --accent */
  --coral-2:      #A93915;        /* → --accent-deep */
  --coral-pale:   #F8DCD0;        /* → --accent-soft */
  --saffron:      #FFB627;
  --forest:       #0E3A2E;
  --peach:        #FBE9E0;        /* → --accent-tint */
  --linen:        #F1ECDC;        /* → --ivory */
  --accent-tx:    #FFFFFF;        /* → --accent-ink */
  --sh-glow: 0 0 0 1px rgba(224,78,31,0.15), 0 12px 40px -12px rgba(224,78,31,0.35);
  --grad-sunset:  linear-gradient(135deg, #E04E1F 0%, #FFB627 100%);
  --grad-paper:   linear-gradient(180deg, #FAF9F5 0%, #FFFFFF 100%);
  --grad-noise:
    radial-gradient(at 12% 18%, rgba(224,78,31,0.08) 0%, transparent 42%),
    radial-gradient(at 88% 8%,  rgba(255,182,39,0.08) 0%, transparent 38%),
    radial-gradient(at 50% 100%, rgba(14,58,46,0.05) 0%, transparent 50%);

  /* ── Editorial Folklor tokens (phone.jsx / guest-screens.jsx) ─────── */
  --mf-cream:        #FBF9F4;
  --mf-cream-dark:   #F2EEE5;
  --mf-forest:       #2D4A2A;
  --mf-forest-light: #3D6438;
  --mf-ink:          #1C1B17;
  --mf-ink-soft:     #4A4740;
  --mf-ink-muted:    #8C8880;
  --mf-terra:        #B5581E;
  --mf-gold:         #C49A3C;
  --mf-green:        #5A8C50;
  --mf-rule:         #D8D3C8;
  --mf-serif:        'Instrument Serif', serif;
  --mf-sans:         'Inter Tight', sans-serif;
  --mf-gap-xs:  8px;
  --mf-gap-sm:  16px;
  --mf-gap-md:  24px;
  --mf-gap-lg:  40px;
  --mf-gap-xl:  64px;
}

/* ─── Reset ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, textarea, select { font-family: inherit; color: inherit; outline: none; }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ─── Type helpers ──────────────────────────────────────────────────── */
.serif        { font-family: var(--serif); font-weight: 400; }
.serif-italic { font-family: var(--serif); font-style: italic; font-weight: 400; }
.italic       { font-style: italic; }
.mono         { font-family: var(--mono); font-feature-settings: "tnum"; }

.eyebrow {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--mu); font-family: var(--sans);
}
.eyebrow.acc { color: var(--accent); }
.eyebrow.dot::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: 1px;
}

.display-xl { font-family: var(--serif); font-size: clamp(64px, 9vw, 140px); line-height: 0.94; letter-spacing: -0.025em; }
.display-lg { font-family: var(--serif); font-size: clamp(48px, 6vw, 96px);  line-height: 0.98; letter-spacing: -0.022em; }
.display-md { font-family: var(--serif); font-size: clamp(36px, 4vw, 64px);  line-height: 1.02; letter-spacing: -0.018em; }
.display-sm { font-family: var(--serif); font-size: clamp(28px, 3vw, 44px);  line-height: 1.08; letter-spacing: -0.015em; }
.display { font-family: var(--serif); font-weight: 400; line-height: 0.96; letter-spacing: -0.025em; text-wrap: balance; }

/* ─── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px;
  border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper);
  font-weight: 500; font-size: 13px;
  letter-spacing: -0.005em;
  transition: transform 140ms cubic-bezier(.2,.7,.3,1), background 180ms, color 180ms, border-color 180ms;
  white-space: nowrap; cursor: pointer;
  border: 1px solid var(--ink);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.32; cursor: not-allowed; transform: none; }

.btn.accent {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.btn.accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

/* coral = compat alias → accent */
.btn.coral {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 6px 18px -6px rgba(224,78,31,0.45);
}
.btn.coral:hover { background: var(--accent-deep); border-color: var(--accent-deep); box-shadow: var(--sh-glow); }

.btn.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn.ghost:hover { background: var(--paper-tint); border-color: var(--ink); }

.btn.outline-accent {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent);
}
.btn.outline-accent:hover { background: var(--accent); color: var(--accent-ink); }

.btn.lg  { height: 54px; padding: 0 30px; font-size: 14px; font-weight: 500; }
.btn.sm  { height: 32px; padding: 0 14px; font-size: 12px; }
.btn.icon    { width: 40px; height: 40px; padding: 0; }
.btn.icon.sm { width: 30px; height: 30px; }

/* ─── Inputs ────────────────────────────────────────────────────────── */
.input {
  width: 100%; height: 50px; padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--paper);
  font-size: 15px; color: var(--ink);
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
}
.input:focus { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 3px rgba(15,15,14,0.05); }
.input::placeholder { color: var(--mu-2); }

.field-label {
  font-size: 11px; color: var(--mu);
  letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; margin-bottom: 8px; display: block;
}

/* ─── Card ──────────────────────────────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.card.elev { box-shadow: var(--sh-2); }

/* ─── Chip / pill ───────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid var(--line-2);
  font-size: 11px; font-weight: 500; color: var(--ink-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip.solid         { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.accent        { color: var(--accent); border-color: var(--accent); }
.chip.accent.solid  { background: var(--accent); color: var(--accent-ink); }
.chip.sage          { background: var(--sage); color: var(--sage-deep); border-color: transparent; }

/* ─── Hairline ──────────────────────────────────────────────────────── */
.hairline        { height: 1px; background: var(--line); width: 100%; }
.hairline.dotted { background: none; border-top: 1px dashed var(--line-2); height: 0; }

/* ─── Status dot ────────────────────────────────────────────────────── */
.dot      { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot.ink  { background: var(--ink); }
.dot.accent { background: var(--accent); }
.dot.sage { background: var(--sage-deep); }
.dot.warn { background: var(--warn); }

/* ─── Seg toggle ────────────────────────────────────────────────────── */
.seg {
  display: inline-flex; padding: 3px;
  background: var(--paper-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
}
.seg button {
  padding: 6px 14px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
  color: var(--mu); transition: all 180ms;
}
.seg button.active {
  background: var(--paper); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ─── Layout helpers ────────────────────────────────────────────────── */
.row     { display: flex; align-items: center; }
.col     { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.center  { display: flex; align-items: center; justify-content: center; }
.flex-1  { flex: 1; }
.gap-xs  { gap: 6px; }  .gap-sm { gap: 12px; }
.gap-md  { gap: 20px; } .gap-lg { gap: 32px; }

.tabular { font-variant-numeric: tabular-nums; }
.balance { text-wrap: balance; }
.pretty  { text-wrap: pretty; }

/* ─── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ─── Status bar (phone mockup) ─────────────────────────────────────── */
.status-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; padding: 0 28px;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  position: relative; z-index: 6;
}
.status-bar .signal {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px;
}

/* ─── Dot grid background ───────────────────────────────────────────── */
.dot-grid {
  background-image: radial-gradient(circle, rgba(15,15,14,0.07) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ─── Animations ────────────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 600ms cubic-bezier(.2,.7,.3,1) both; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 420ms ease both; }

@media (prefers-reduced-motion: reduce) {
  .fade-up, .fade-in { animation: none !important; opacity: 1 !important; transform: none !important; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 900ms linear infinite; }

@keyframes pulse-soft { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
.pulse-soft { animation: pulse-soft 2.2s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%       { box-shadow: 0 0 0 6px transparent; opacity: 0.6; }
}
.pulse-dot { animation: pulse-dot 1.8s ease-in-out infinite; }

@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton {
  background: linear-gradient(90deg, var(--paper-2) 0%, var(--paper-3) 50%, var(--paper-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: 4px;
}

@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(0, -4px); } }
.drift { animation: drift 5s ease-in-out infinite; }

@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee { display: flex; gap: 56px; animation: marquee 38s linear infinite; width: max-content; }

/* ─── Paper grain texture ───────────────────────────────────────────── */
.paper-grain { position: relative; }
.paper-grain::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(15,15,14,0.018) 1px, transparent 0);
  background-size: 3px 3px;
  mix-blend-mode: multiply; opacity: 0.6;
}

/* ── MF Keyframes (phone.jsx / guest-screens.jsx — do not remove) ─── */
@keyframes mf-progress  { from { width: 0% }  to { width: 100% } }
@keyframes mf-row-in    { from { opacity: 0; transform: translateY(12px) }  to { opacity: 1; transform: translateY(0) } }
@keyframes mf-sweep     { from { transform: scaleX(0) }  to { transform: scaleX(1) } }
@keyframes mf-appear    { from { opacity: 0 }  to { opacity: 1 } }
@keyframes mf-drop-in   { from { opacity: 0; transform: translateY(-16px) }  to { opacity: 1; transform: translateY(0) } }
@keyframes mf-stagger   { from { opacity: 0; transform: translateY(6px) }  to { opacity: 1; transform: translateY(0) } }
@keyframes mf-count-in  { from { opacity: 0; transform: translateY(6px) }  to { opacity: 1; transform: translateY(0) } }
@keyframes mf-travel    { 0% { top: -6px; opacity: 1 }  85% { top: 42px; opacity: 1 }  100% { top: 44px; opacity: 0 } }
@keyframes mf-scan      { 0% { top: 4px; opacity: 1 }  90% { top: 112px; opacity: 1 }  100% { top: 112px; opacity: 0 } }
@keyframes mf-check-fill  { to { background: #2D5A2A; border-color: #5A8C50 } }
@keyframes mf-icon-show   { to { opacity: 1 } }
@keyframes mf-pulse-badge {
  0%,100% { background: rgba(196,154,60,.25) }
  50%     { background: rgba(196,154,60,.50) }
}

/* ── Phone screen animation hooks ── */
.ph-screen.active .mf-row              { opacity: 0; }
.ph-screen.active .mf-row:nth-child(1) { animation: mf-row-in 350ms ease forwards 200ms; }
.ph-screen.active .mf-row:nth-child(2) { animation: mf-row-in 350ms ease forwards 340ms; }
.ph-screen.active .mf-row:nth-child(3) { animation: mf-row-in 350ms ease forwards 480ms; }
.ph-screen.active .mf-row:nth-child(4) { animation: mf-row-in 350ms ease forwards 620ms; }

.ph-screen.active .mf-dish-sweep { animation: mf-sweep 700ms cubic-bezier(.2,.7,.3,1) forwards 200ms; transform: scaleX(0); transform-origin: left; }
.ph-screen.active .mf-dish-emoji { animation: mf-appear  300ms ease forwards  600ms; opacity: 0; }
.ph-screen.active .mf-dish-name  { animation: mf-stagger 400ms ease forwards  700ms; opacity: 0; }
.ph-screen.active .mf-dish-price { animation: mf-stagger 400ms ease forwards  850ms; opacity: 0; }
.ph-screen.active .mf-dish-tags  { animation: mf-stagger 400ms ease forwards  950ms; opacity: 0; }
.ph-screen.active .mf-dish-desc  { animation: mf-stagger 400ms ease forwards 1050ms; opacity: 0; }
.ph-screen.active .mf-dish-cta   { animation: mf-stagger 400ms ease forwards 1200ms; opacity: 0; }

.ph-screen.active .mf-admin-new  { animation: mf-drop-in 450ms cubic-bezier(.2,.7,.3,1) forwards 400ms; opacity: 0; }
.ph-screen.active .mf-badge-new  { animation: mf-pulse-badge 1200ms ease infinite 900ms; }

.ph-screen.active .mf-ck1 .mf-ck-box  { animation: mf-check-fill 200ms ease forwards  600ms; }
.ph-screen.active .mf-ck1 .mf-ck-icon { animation: mf-icon-show  200ms ease forwards  700ms; opacity: 0; }
.ph-screen.active .mf-ck2 .mf-ck-box  { animation: mf-check-fill 200ms ease forwards 1100ms; }
.ph-screen.active .mf-ck2 .mf-ck-icon { animation: mf-icon-show  200ms ease forwards 1200ms; opacity: 0; }

.ph-screen.active .mf-qr-scan { animation: mf-scan     1800ms ease-in-out infinite  400ms; }
.ph-screen.active .mf-qr-url  { animation: mf-count-in  400ms ease        forwards  900ms; opacity: 0; }
.ph-screen.active .mf-qr-stat { animation: mf-count-in  400ms ease        forwards 1100ms; opacity: 0; }

.mf-signal { animation: mf-travel 480ms ease-in forwards; }
