/* Menu3D design system — shared by the site, the dashboard, the guest menu and the scanner.
   Identity: near-black canvas, 1px hairlines, a masked grid, mono micro-labels, one warm orange accent
   and the dish always framed like an object on a workbench. Dashboard also has a light theme. */

:root {
  /* colour */
  --bg: #07070a;
  --bg-2: #0b0b0e;
  --panel: #0f0f13;
  --panel-2: #15151a;
  --panel-3: #1c1c22;
  --line: #222229;
  --line-2: #2e2e36;
  --fg: #f5f5f6;
  --muted: #a3a3ad;
  --subtle: #6e6e78;
  --accent: #ff9f43;
  --accent-2: #ffb46b;
  --accent-ink: #1b0f03;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #60a5fa;
  --overlay: rgb(5 5 7 / 0.72);
  --grid-line: rgb(255 255 255 / 0.045);
  --stage: radial-gradient(120% 90% at 50% 38%, #2a241c 0%, #15130f 42%, #0b0b0d 78%);
  --shadow-1: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 1px 0 rgb(255 255 255 / 0.05) inset, 0 12px 32px -12px rgb(0 0 0 / 0.7);
  --shadow-3: 0 30px 80px -20px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(255 255 255 / 0.04);

  /* type */
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  --t-xs: 0.75rem; --t-sm: 0.8125rem; --t-base: 0.9375rem; --t-md: 1.0625rem; --t-lg: 1.25rem;
  --t-xl: 1.5rem; --t-2xl: 2rem; --t-3xl: clamp(2rem, 4.2vw, 2.9rem); --t-4xl: clamp(2.5rem, 6.4vw, 4.6rem);

  /* spacing (4px scale) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px;
  --s9: 48px; --s10: 64px; --s11: 80px; --s12: 112px;

  /* shape & motion */
  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);

  /* legacy aliases */
  --ink: var(--bg);
  --radius: var(--r);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f6f3;
  --bg-2: #efefeb;
  --panel: #ffffff;
  --panel-2: #f7f7f5;
  --panel-3: #efefec;
  --line: #e6e5e0;
  --line-2: #d6d5cf;
  --fg: #141416;
  --muted: #55555e;
  --subtle: #85858e;
  --accent: #f28a2e;
  --accent-2: #f7a04f;
  --accent-ink: #1b0f03;
  --overlay: rgb(20 20 22 / 0.45);
  --grid-line: rgb(0 0 0 / 0.05);
  --stage: radial-gradient(120% 90% at 50% 38%, #ffffff 0%, #f1efe9 55%, #e6e3db 100%);
  --shadow-1: 0 1px 2px rgb(20 20 20 / 0.06);
  --shadow-2: 0 1px 2px rgb(20 20 20 / 0.05), 0 10px 30px -14px rgb(20 20 20 / 0.18);
  --shadow-3: 0 30px 80px -24px rgb(20 20 20 / 0.28), 0 0 0 1px rgb(0 0 0 / 0.04);
  --good: #16a34a; --warn: #b45309; --bad: #dc2626; --info: #2563eb;
  color-scheme: light;
}

/* ---------- reset & type ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--t-base)/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-xs); }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: var(--t-4xl); letter-spacing: -0.045em; }
h2 { font-size: var(--t-3xl); letter-spacing: -0.04em; }
h3 { font-size: var(--t-lg); letter-spacing: -0.02em; line-height: 1.25; }
h4 { font-size: var(--t-md); letter-spacing: -0.015em; line-height: 1.3; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; }
b, strong { font-weight: 600; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.fg { color: var(--fg); }
.accent { color: var(--accent); }
.small { font-size: var(--t-sm); }
.xs { font-size: var(--t-xs); }
.mono { font-family: var(--mono); font-feature-settings: normal; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.error { color: var(--bad); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 720px) { .wrap { padding: 0 var(--s6); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* mono micro-label */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: var(--s4);
  font: 500 0.6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.16em; color: var(--subtle);
}
.eyebrow .dot, .eyebrow::before { flex: none; }
.eyebrow.ticked::before { content: ""; width: 14px; height: 1px; background: var(--accent); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.live { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* masked grid background */
.bg-grid {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
}

/* icons (sprite: /icons.svg) */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 22px; height: 22px; }
.i.xl { width: 28px; height: 28px; stroke-width: 1.5; }

/* logo: isometric cube with an accent core */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.06rem; letter-spacing: -0.03em; color: var(--fg); text-decoration: none; }
.logo svg { width: 26px; height: 26px; }
.logo .word b { font-weight: 650; color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  --h: 40px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--fg); box-shadow: var(--shadow-1);
  font: 500 var(--t-sm)/1 var(--font); letter-spacing: -0.005em; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s, opacity 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--panel-3); border-color: color-mix(in srgb, var(--fg) 18%, var(--line-2)); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .i { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: color-mix(in srgb, var(--accent) 80%, #000);
  color: var(--accent-ink); font-weight: 600;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.35) inset, 0 8px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-2) 85%, #fff), var(--accent-2)); border-color: var(--accent); }
.btn-solid { background: var(--fg); border-color: var(--fg); color: var(--bg); font-weight: 600; box-shadow: none; }
.btn-solid:hover { background: color-mix(in srgb, var(--fg) 88%, var(--bg)); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); border-color: transparent; color: var(--fg); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 8%, var(--panel-2)); }
.btn-sm { --h: 32px; padding: 0 11px; font-size: var(--t-xs); border-radius: 7px; gap: 6px; }
.btn-sm .i { width: 14px; height: 14px; }
.btn-lg { --h: 48px; padding: 0 22px; font-size: var(--t-base); border-radius: 10px; }
.btn-xl { --h: 56px; padding: 0 28px; font-size: var(--t-md); border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn .arrow { transition: transform 0.18s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; animation: spin 0.7s linear infinite;
}
.btn-primary.is-loading::after { border-color: var(--accent-ink) transparent var(--accent-ink) transparent; }
.link { color: var(--accent); text-decoration: none; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------- forms ---------- */
.field { display: block; margin: 0 0 var(--s5); }
.field > .label, .label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: var(--t-sm); font-weight: 500; color: var(--fg); }
.label .opt { font-weight: 400; color: var(--subtle); font-size: var(--t-xs); }
.input, .select, .textarea,
.field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .field select, .field textarea {
  display: block; width: 100%; height: 42px; padding: 0 12px;
  background: var(--bg-2); color: var(--fg); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font: 400 var(--t-base)/1.4 var(--font); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
:root[data-theme="light"] .input, :root[data-theme="light"] .field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),
:root[data-theme="light"] .field select, :root[data-theme="light"] .field textarea { background: var(--panel); }
.field textarea, .textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field select, .select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
}
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: var(--subtle); }
.field input:hover, .field select:hover, .field textarea:hover, .input:hover { border-color: color-mix(in srgb, var(--fg) 22%, var(--line-2)); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.field .hint, .hint { display: block; margin-top: 7px; font-size: var(--t-xs); color: var(--subtle); line-height: 1.5; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--panel-2); color: var(--subtle); font: 400 var(--t-sm) var(--mono); white-space: nowrap; }
.input-group input { border-radius: 0 var(--r-sm) var(--r-sm) 0 !important; min-width: 0; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 52px !important; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); font: 500 var(--t-xs) var(--mono); pointer-events: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s4); }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.row > .field { flex: 1 1 170px; }
.stack { display: grid; gap: var(--s3); }
.spacer { flex: 1; }

.check { display: flex; align-items: center; gap: 10px; font-size: var(--t-sm); cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }

/* switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { flex: none; position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2); transition: background 0.2s, border-color 0.2s; }
.switch .track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--fg); transition: transform 0.2s var(--ease); box-shadow: 0 1px 2px rgb(0 0 0 / 0.4); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: var(--focus); }

/* selectable chips (multi-select) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-size: var(--t-sm); cursor: pointer; user-select: none; transition: all 0.15s; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { color: var(--fg); border-color: color-mix(in srgb, var(--fg) 22%, var(--line-2)); }
.chip:has(input:checked) { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: var(--accent-soft); }
.chip:has(input:checked)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip:has(input:focus-visible) { box-shadow: var(--focus); }

/* segmented control */
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.segmented button, .segmented a { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 500 var(--t-xs) var(--font); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.segmented .on, .segmented [aria-pressed="true"] { background: var(--panel); color: var(--fg); box-shadow: var(--shadow-1); }
:root:not([data-theme="light"]) .segmented .on, :root:not([data-theme="light"]) .segmented [aria-pressed="true"] { background: var(--panel-3); }

/* colour input */
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 42px; height: 42px; padding: 3px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; }
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.swatches button.on { box-shadow: 0 0 0 2px var(--fg); }

/* dropzone / image picker */
.dropzone {
  position: relative; display: flex; align-items: center; gap: var(--s4); padding: var(--s4);
  border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--bg-2); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
:root[data-theme="light"] .dropzone { background: var(--panel-2); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .preview { flex: none; width: 64px; height: 64px; border-radius: 10px; background: var(--panel-2) center / contain no-repeat; border: 1px solid var(--line); display: grid; place-items: center; color: var(--subtle); }
.dropzone .preview.cover { background-size: cover; }
.dropzone strong { display: block; font-size: var(--t-sm); font-weight: 500; }
.dropzone span { font-size: var(--t-xs); color: var(--subtle); }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-pad { padding: var(--s6); }
@media (max-width: 560px) { .card-pad { padding: var(--s5); } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.card-head h3, .card-head h4 { margin: 0; }
.card-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); padding: var(--s4) var(--s5); border-top: 1px solid var(--line); }
.cells { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cells > * { background: var(--panel); }
.divider { height: 1px; background: var(--line); margin: var(--s5) 0; border: 0; }

/* framed stage: the dish on a workbench, corner ticks + mono labels */
.frame { position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; box-shadow: var(--shadow-3); }
.frame-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); height: 40px; padding: 0 var(--s4); border-bottom: 1px solid var(--line); font: 500 0.6875rem var(--mono); letter-spacing: 0.06em; color: var(--subtle); text-transform: uppercase; }
.frame-bar .dots { display: flex; gap: 6px; }
.frame-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.stage { position: relative; background: var(--stage); }
.stage .ticks::before, .stage .ticks::after, .stage .ticks i::before, .stage .ticks i::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-color: color-mix(in srgb, var(--fg) 30%, transparent); border-style: solid; pointer-events: none; z-index: 2;
}
.stage .ticks::before { left: 14px; top: 14px; border-width: 1px 0 0 1px; }
.stage .ticks::after { right: 14px; top: 14px; border-width: 1px 1px 0 0; }
.stage .ticks i::before { left: 14px; bottom: 14px; border-width: 0 0 1px 1px; }
.stage .ticks i::after { right: 14px; bottom: 14px; border-width: 0 1px 1px 0; }
.stage .ticks { position: absolute; inset: 0; pointer-events: none; }
.stage .label { position: absolute; z-index: 2; font: 500 0.625rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--subtle); }
.stage .model-slot { position: absolute; inset: 0; }
.stage model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
.stage .poster-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 8%; transition: opacity 0.6s var(--ease); }
.stage.model-ready .poster-img { opacity: 0; pointer-events: none; }
.frame-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); height: 40px; padding: 0 var(--s4); border-top: 1px solid var(--line); font: 500 0.6875rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--subtle); }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; white-space: nowrap;
  font: 500 0.6875rem/1 var(--font); letter-spacing: 0.01em; border: 1px solid var(--line-2); color: var(--muted); background: var(--panel-2);
}
.badge .dot { width: 6px; height: 6px; background: currentColor; }
.badge.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 30%, transparent); background: color-mix(in srgb, var(--good) 9%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.badge.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); background: color-mix(in srgb, var(--info) 9%, transparent); }
.badge.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 38%, transparent); background: var(--accent-soft); }
.badge.mono { font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.625rem; }
.badge.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.badge.busy .dot { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel-2); font-size: var(--t-sm); line-height: 1.5; }
.alert .i { margin-top: 1px; }
.alert.warn { border-color: color-mix(in srgb, var(--warn) 32%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--panel)); }
.alert.warn .i { color: var(--warn); }
.alert.bad { border-color: color-mix(in srgb, var(--bad) 32%, transparent); background: color-mix(in srgb, var(--bad) 7%, var(--panel)); color: color-mix(in srgb, var(--bad) 70%, var(--fg)); }
.alert.info { border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); }
.alert.info .i { color: var(--accent); }

/* tabs (underline) */
.tabs { display: flex; gap: var(--s5); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { flex: none; height: 42px; padding: 0; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--subtle); font: 500 var(--t-sm) var(--font); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.tabs button:hover, .tabs a:hover { color: var(--fg); }
.tabs .on { color: var(--fg); border-bottom-color: var(--accent); }

/* toasts */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px 11px 13px; border-radius: 12px;
  background: color-mix(in srgb, var(--panel-3) 92%, transparent); border: 1px solid var(--line-2); color: var(--fg);
  font-size: var(--t-sm); font-weight: 500; box-shadow: var(--shadow-3); backdrop-filter: blur(14px);
  animation: toast-in 0.28s var(--ease); pointer-events: auto;
}
:root[data-theme="light"] .toast { background: #18181b; color: #fafafa; border-color: #18181b; }
.toast .i { color: var(--good); }
.toast.bad .i { color: var(--bad); }
.toast.out { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@media (max-width: 860px) { body.has-tabbar .toasts { bottom: calc(env(safe-area-inset-bottom) + 84px); } }

/* empty states */
.empty { display: grid; justify-items: center; text-align: center; padding: var(--s10) var(--s5); border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: color-mix(in srgb, var(--panel) 50%, transparent); }
.empty .empty-art { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: var(--s4); border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--accent); box-shadow: var(--shadow-2); }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto var(--s5); }

/* skeletons */
.skeleton { position: relative; overflow: hidden; background: var(--panel-2); border-radius: var(--r-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--fg) 6%, transparent), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton.line { height: 12px; border-radius: 6px; }

/* dialogs & bottom sheets */
dialog {
  border: 1px solid var(--line-2); border-radius: var(--r-xl); background: var(--panel); color: var(--fg);
  padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-3); overflow: auto;
}
dialog[open] { animation: pop 0.22s var(--ease); }
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(6px); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: var(--s6) var(--s6) 0; }
.dialog-head h3 { margin: 0; font-size: var(--t-xl); }
.dialog-head p { margin: 6px 0 0; color: var(--muted); font-size: var(--t-sm); }
.dialog-body { padding: var(--s6); }
.dialog-actions { position: sticky; bottom: 0; display: flex; gap: var(--s2); justify-content: flex-end; align-items: center; padding: var(--s4) var(--s6); border-top: 1px solid var(--line); background: var(--panel); }
.x-btn { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.x-btn:hover { color: var(--fg); }
@media (max-width: 640px) {
  dialog.sheet-sm { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0; max-height: 92dvh; }
  dialog.sheet-sm[open] { animation: rise 0.3s var(--ease); }
  .dialog-head { padding: var(--s5) var(--s5) 0; }
  .dialog-body { padding: var(--s5); }
  .dialog-actions { padding: var(--s3) var(--s5) calc(env(safe-area-inset-bottom) + var(--s3)); }
}
@keyframes rise { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }

/* loaders */
.spinner { width: 32px; height: 32px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar-loader { height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.bar-loader::after { content: ""; display: block; height: 100%; width: 35%; background: var(--accent); animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.progress { height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.3s var(--ease); }

/* QR box */
.qr-box { background: #fff; border-radius: 14px; padding: 12px; line-height: 0; box-shadow: var(--shadow-2); }
.qr-box svg { width: 100%; height: auto; }

/* phone mockup */
.phone { position: relative; aspect-ratio: 9 / 19; border-radius: 46px; padding: 11px; background: linear-gradient(160deg, #2a2a30, #121216 40%, #1d1d22); box-shadow: var(--shadow-3), inset 0 0 0 1px rgb(255 255 255 / 0.08); }
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 30%; height: 22px; border-radius: 999px; background: #000; z-index: 3; }
.phone .screen-in { position: relative; width: 100%; height: 100%; border-radius: 36px; overflow: hidden; background: var(--bg); }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }

/* shared site header */
.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid transparent; transition: background 0.25s, border-color 0.25s, backdrop-filter 0.25s; }
.site-header.scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.4) blur(18px); border-bottom-color: var(--line); }
.site-header .wrap { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.site-header nav { display: flex; align-items: center; gap: 2px; }
.site-header nav a.nav-link { color: var(--muted); text-decoration: none; font-size: var(--t-sm); font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: color 0.15s; }
.site-header nav a.nav-link:hover { color: var(--fg); }
@media (max-width: 860px) { .site-header nav a.nav-link { display: none; } }

/* language switch */
.lang-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; }
.lang-switch button { height: 26px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--subtle); font: 500 0.6875rem var(--mono); letter-spacing: 0.08em; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--panel-3); color: var(--fg); }

model-viewer { --poster-color: transparent; }
model-viewer::part(default-progress-bar) { background: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* semnatura e-web, ultimul rand din subsol */
p.made-by { margin-top: 20px; text-align: center; font-size: 14px; color: var(--muted); }
p.made-by a { color: var(--accent); font-weight: 700; text-decoration: none; text-underline-offset: 4px; }
p.made-by a:hover { text-decoration: underline; }
