/* ============================================================
   Surfex Demo — Shared Styles
   Design tokens locked in docs/DESIGN.md
   ============================================================ */

:root {
  /* Cloud White theme (surfex-admin-variant-21-cloud-white) */
  --ink-950:#1E232B; --ink-800:#2C333D; --ink-600:#5C6470;
  --ink-400:#939AA5; --ink-300:#939AA5; --ink-200:#D3D6DB; --ink-100:#E5E7EA;
  --paper:#F7F8F9; --paper-alt:#FFFFFF;
  --gold-700:#334155; --gold-600:#475569; --gold-500:#64748B; --gold-100:#E2E8F0;
  --copper:#B45309;
  --success:#1E8F5A; --success-bg:#DFF3E9;
  --warn:#C77B1B; --warn-bg:#FBEAD3;
  --danger:#B0331A; --danger-bg:#F7DED5;
  --info:#2C6ECB; --info-bg:#DDE8F8;

  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:22px; --r-pill:999px;
  --shadow-sm:0 1px 2px rgba(30,35,43,.06);
  --shadow-md:0 4px 12px rgba(30,35,43,.08);
  --shadow-lg:0 12px 32px rgba(30,35,43,.10);

  --font-ui:'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display:'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   Cloud White theme overrides
   Base tokens use --ink-950 for both text AND sidebar bg. Cloud
   White needs light surfaces with dark text, so we explicitly
   restore contrast where the token collision would break things.
   ============================================================ */
body { color: #1E232B; background: #F7F8F9; }
.a-header h1, h1, h2, h3, .h1, .h2, .h3,
.body-strong, .tval, .stat, .stat-lg, .display,
.l-title, .modal .m-head h2,
.a-header .row select, table.dtl td, .field label { color: #1E232B; }
.small, .muted, .sub, .l-sub, .delta, .tlbl { color: #5C6470 !important; }
.dim { color: #939AA5; }
.micro { color: #5C6470; }
.sku { color: #939AA5; }

.card, .panel, .tile, .table-wrap, .topbar, .modal, .m-tabbar {
  background: #FFFFFF; border-color: #E5E7EA;
}
.panel .p-head, .modal .m-head, .modal .m-foot,
.table-toolbar { border-color: #E5E7EA; }

/* Sidebar keeps the Surfex dark signature */
.side { background: #1E232B; color: #F7F8F9; }
.side .brand { border-color: #3A424E; }
.side .grp-label { color: #9AA1AC; }
.side .side-foot { color: #9AA1AC; border-color: #3A424E; }
.side .nav-item { color: #9AA1AC; }
.side .nav-item:hover { background: #2C333D; color: #F7F8F9; }
.side .nav-item.active { background: #2C333D; color: #F7F8F9; border-left-color: #475569; }

table.dtl th { background: #E9EAED; color: #5C6470; border-color: #E5E7EA; }
table.dtl td { border-color: #E5E7EA; }
table.dtl tr:hover td { background: #F7F8F9; }
.list-row { border-bottom-color: #E5E7EA; }
hr.hairline, .hairline { background: #E5E7EA; }

input, textarea, select { background: #FFFFFF; color: #1E232B; border-color: #D3D6DB; }
input:focus, textarea:focus, select:focus { border-color: #475569; box-shadow: 0 0 0 3px #E2E8F0; }
::placeholder { color: #939AA5; }

.btn { color: #1E232B; }
.btn-primary { background: #475569; color: #FFFFFF; border-color: #475569; }
.btn-primary:hover { background: #334155; box-shadow: 0 0 0 3px #E2E8F0; }
.btn-accent { background: #475569; color: #FFFFFF; }
.btn-accent:hover { background: #334155; }
.btn-ghost { color: #1E232B; border-color: #D3D6DB; background: transparent; }
.btn-ghost:hover { background: #F7F8F9; border-color: #1E232B; }

.chip { background: #E9EAED; color: #1E232B; }
.chip.gold { background: #E2E8F0; color: #334155; }
.chip.dark { background: #1E232B; color: #F7F8F9; }

.topbar { background: #FFFFFF; border-color: #E5E7EA; }

table.dtl .thumb, .p-thumb, .thumb { box-shadow: inset 0 0 0 1px #E5E7EA; }

.tile.accent .tval { color: #334155; }

.overlay { background: rgba(0,0,0,0.6); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  font-family: var(--font-ui);
  color: var(--ink-950);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
img, svg { display:block; max-width:100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
input, textarea, select {
  font: inherit; color: inherit;
  background: var(--paper-alt);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  padding: 12px 14px;
  outline: none;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--ink-950);
  box-shadow: 0 0 0 3px var(--gold-100);
}
::placeholder { color: var(--ink-400); }

/* ============================================================
   Typography helpers
   ============================================================ */
.display  { font-family: var(--font-display); font-size: 34px; line-height: 40px; font-weight:700; letter-spacing:.5px; }
.h1       { font-size: 24px; line-height: 32px; font-weight: 700; }
.h2       { font-size: 20px; line-height: 28px; font-weight: 600; }
.h3       { font-size: 17px; line-height: 24px; font-weight: 600; }
.body     { font-size: 15px; line-height: 22px; }
.body-strong { font-size:15px; line-height:22px; font-weight:600; }
.small    { font-size: 13px; line-height: 18px; color: var(--ink-600); }
.micro    { font-size: 11px; line-height: 16px; font-weight:600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-600); }
.stat     { font-size: 28px; line-height: 32px; font-weight:700; }
.stat-lg  { font-size: 40px; line-height: 44px; font-weight:700; }
.muted    { color: var(--ink-600); }
.dim      { color: var(--ink-400); }

/* ============================================================
   Layout helpers
   ============================================================ */
.row { display:flex; gap:12px; align-items:center; }
.row.between { justify-content:space-between; }
.col { display:flex; flex-direction:column; gap:12px; }
.grow { flex:1; }
.center { display:flex; align-items:center; justify-content:center; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:48px; padding: 0 20px; border-radius: var(--r-md);
  border:1px solid transparent; background:transparent; color: var(--ink-950);
  font-weight: 600; text-decoration:none; transition: transform .15s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ink-950); color: var(--paper); }
.btn-primary:hover { background: var(--ink-800); box-shadow: 0 0 0 3px var(--gold-100); }
.btn-accent { background: var(--gold-600); color:#fff; }
.btn-accent:hover { background: var(--gold-700); }
.btn-ghost { background: transparent; border-color: var(--ink-200); color: var(--ink-950); }
.btn-ghost:hover { border-color: var(--ink-950); background: var(--paper-alt); }
.btn-danger { background: var(--danger); color:#fff; }
.btn-danger:hover { background: #91291C; }
.btn-sm { height:36px; padding: 0 14px; font-size:14px; border-radius: var(--r-sm); }
.btn-lg { height:56px; padding: 0 24px; font-size:16px; }
.btn-block { width:100%; }
.btn-icon { width:44px; height:44px; padding:0; border-radius: var(--r-pill); }

/* ============================================================
   Cards & Surfaces
   ============================================================ */
.card {
  background: var(--paper-alt);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  padding: 20px;
}
.card.shadow { box-shadow: var(--shadow-sm); }
.card.dark { background: var(--ink-950); color: var(--paper); border-color: var(--ink-800); }
.hairline { height:1px; background: var(--ink-200); border:0; margin: 16px 0; }

/* ============================================================
   Chips / badges
   ============================================================ */
.chip {
  display:inline-flex; align-items:center; gap:6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase;
  background: var(--ink-100); color: var(--ink-800);
}
.chip.gold    { background: var(--gold-100); color: var(--gold-700); }
.chip.success { background: var(--success-bg); color: var(--success); }
.chip.warn    { background: var(--warn-bg); color: var(--warn); }
.chip.danger  { background: var(--danger-bg); color: var(--danger); }
.chip.info    { background: var(--info-bg); color: var(--info); }
.chip.dark    { background: var(--ink-950); color: var(--paper); }
.chip.large   { padding: 6px 14px; font-size:12px; }

.status-dot { width:8px; height:8px; border-radius:50%; background: currentColor; display:inline-block; }
.pulse::before {
  content:""; position:absolute; inset:-4px; border-radius:50%;
  background: currentColor; opacity:.3; animation: pulse 1.4s infinite ease-out;
}
@keyframes pulse { 0% { transform: scale(1); opacity:.4;} 100% { transform: scale(1.8); opacity:0;} }

/* ============================================================
   Icons
   ============================================================ */
.i { width:20px; height:20px; stroke: currentColor; fill:none; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.i-lg { width:24px; height:24px; }
.i-xl { width:32px; height:32px; }

/* ============================================================
   Phone Frame (Sales demo)
   ============================================================ */
.stage {
  min-height:100vh; display:flex; gap:32px; padding:40px 24px;
  align-items:flex-start; justify-content:center; flex-wrap:wrap;
  background: linear-gradient(180deg, var(--paper) 0%, #E5E7EA 100%);
}
.stage-side { flex: 0 0 260px; max-width:260px; position:sticky; top:40px; }
.stage-side h4 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink-950); }
.stage-side .flow-item {
  display:flex; align-items:center; gap:10px; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--paper-alt); border:1px solid var(--ink-200); margin-bottom:8px;
  cursor:pointer; transition: all .15s;
}
.stage-side .flow-item:hover { border-color: var(--ink-950); }
.stage-side .flow-item.active { background: var(--ink-950); color: var(--paper); border-color: var(--ink-950); }
.stage-side .flow-item .idx { font-family: var(--font-display); font-weight:700; opacity:.6; width:24px; }

.phone {
  width: 380px; height: 780px; background: var(--ink-950); border-radius: 44px;
  padding: 12px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--ink-800) inset;
  flex-shrink:0;
}
.phone-screen {
  width:100%; height:100%; background: var(--paper); border-radius: 34px;
  overflow: hidden; position: relative;
  display:flex; flex-direction:column;
}
.phone-notch {
  position:absolute; top:8px; left:50%; transform: translateX(-50%);
  width: 100px; height: 22px; background: var(--ink-950); border-radius: 0 0 14px 14px; z-index:10;
}

/* Mobile screen */
.m-screen { display:none; flex:1; flex-direction:column; overflow:hidden; }
.m-screen.active { display:flex; }

.m-topbar {
  padding: 40px 20px 12px; display:flex; align-items:center; gap:12px; background: var(--paper);
  border-bottom: 1px solid transparent;
}
.m-topbar .back { width:36px; height:36px; border-radius: var(--r-pill); border:1px solid var(--ink-200); background: var(--paper-alt); display:flex; align-items:center; justify-content:center; }
.m-topbar .title { font-weight:600; font-size:17px; }
.m-body { flex:1; overflow-y:auto; padding: 12px 20px 100px; }
.m-body::-webkit-scrollbar { display:none; }

.m-tabbar {
  position:absolute; bottom:0; left:0; right:0;
  height:76px; padding: 8px 12px 20px; background: var(--paper-alt);
  border-top: 1px solid var(--ink-200); display:flex; justify-content:space-around;
}
.m-tab { flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; color: var(--ink-400); text-decoration:none; padding:4px 0; cursor:pointer; background:transparent; border:0; }
.m-tab .lbl { font-size:11px; font-weight:600; }
.m-tab.active { color: var(--ink-950); }
.m-tab.active .i { color: var(--gold-600); }

.avatar {
  width:40px; height:40px; border-radius:50%;
  background: linear-gradient(135deg, var(--gold-500), var(--copper));
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:700; font-size:15px;
}
.avatar-lg { width:56px; height:56px; font-size:18px; }
.avatar-sm { width:32px; height:32px; font-size:12px; }

/* Product card (mobile) */
.p-card { display:flex; gap:14px; padding:12px; background: var(--paper-alt); border-radius: var(--r-lg); border:1px solid var(--ink-200); margin-bottom:10px; cursor:pointer; transition: all .15s; }
.p-card:hover { border-color: var(--ink-950); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.p-thumb { width:80px; height:80px; border-radius: var(--r-md); background-size:cover; background-position:center; flex-shrink:0; }
.p-info { flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.p-info .sku { font-size:11px; color: var(--ink-400); letter-spacing:.06em; text-transform:uppercase; font-weight:600; }
.p-info .name { font-weight:600; font-size:15px; }
.p-info .cat  { font-size:12px; color: var(--ink-600); }
.p-info .row  { margin-top:4px; }

/* Stat card */
.s-card { padding:16px; border-radius: var(--r-lg); border:1px solid var(--ink-200); background: var(--paper-alt); flex:1; }
.s-card .lbl { font-size:12px; color: var(--ink-600); text-transform:uppercase; letter-spacing:.06em; font-weight:600; }
.s-card .val { font-size:32px; font-weight:700; margin-top:4px; color: var(--ink-950); }
.s-card .val .g { color: var(--gold-600); }

/* Segmented control */
.seg { display:flex; background: var(--ink-100); padding:4px; border-radius: var(--r-pill); gap:2px; }
.seg button { flex:1; border:0; background:transparent; padding: 8px 14px; border-radius: var(--r-pill); font-weight:600; color: var(--ink-600); font-size:13px; }
.seg button.active { background: var(--paper-alt); color: var(--ink-950); box-shadow: var(--shadow-sm); }

.tabs { display:flex; gap:20px; border-bottom: 1px solid var(--ink-200); margin-bottom: 12px; }
.tabs button { border:0; background:transparent; padding: 12px 0; font-weight:600; color: var(--ink-400); border-bottom: 2px solid transparent; cursor:pointer; }
.tabs button.active { color: var(--ink-950); border-bottom-color: var(--gold-600); }

/* Countdown */
.countdown {
  display:inline-flex; align-items:baseline; gap:4px; font-weight:700; font-family:var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.countdown .n { font-size:22px; }
.countdown .u { font-size:12px; color: currentColor; opacity:.7; margin-right:4px; }
.countdown.warn { color: var(--warn); }
.countdown.danger { color: var(--danger); }

.timeline { border-left: 2px dashed var(--ink-200); padding-left: 16px; margin-left: 8px; }
.timeline .step { position:relative; padding-bottom: 16px; }
.timeline .step::before { content:""; position:absolute; left:-24px; top:4px; width:12px; height:12px; border-radius:50%; background: var(--paper-alt); border:2px solid var(--ink-200); }
.timeline .step.done::before { background: var(--success); border-color: var(--success); }
.timeline .step.current::before { background: var(--gold-600); border-color: var(--gold-600); box-shadow: 0 0 0 4px var(--gold-100); }

/* Brand strip */
.brand-strip { display:flex; gap:8px; overflow-x:auto; padding: 4px 0; }
.brand-strip::-webkit-scrollbar { display:none; }
.brand-chip { flex-shrink:0; padding:8px 14px; border-radius: var(--r-pill); background: var(--paper-alt); border:1px solid var(--ink-200); font-size:12px; font-weight:600; }
.brand-chip.active { background: var(--ink-950); color: var(--paper); border-color: var(--ink-950); }

/* Sticky bottom action bar */
.m-sticky-bar {
  position:absolute; left:0; right:0; bottom:0;
  padding: 12px 20px 20px; background: var(--paper-alt); border-top: 1px solid var(--ink-200);
}

/* ============================================================
   Admin Web Layout
   ============================================================ */
.admin-shell { display:grid; grid-template-columns: 260px 1fr; min-height:100vh; background: var(--paper); }
.side {
  background: var(--ink-950); color: var(--paper); padding: 24px 20px 16px;
  display:flex; flex-direction:column; gap:8px; position:sticky; top:0; height:100vh;
}
.side .side-scroll { flex:1; overflow-y:auto; margin: 0 -6px; padding: 0 6px; }
.side .side-scroll::-webkit-scrollbar { width: 6px; }
.side .side-scroll::-webkit-scrollbar-thumb { background: var(--ink-800); border-radius: 6px; }
.side .brand { display:flex; align-items:center; gap:10px; padding: 4px 4px 20px; border-bottom:1px solid var(--ink-800); margin-bottom:12px; }
.side .brand svg { height: 28px; }
.side .brand svg text { fill: var(--paper); }
.side .brand svg path[stroke="#0E1113"] { stroke: var(--paper); }
.side .grp-label { font-size:10px; color: var(--ink-400); letter-spacing:.1em; text-transform:uppercase; margin: 16px 4px 4px; font-weight:700; }
.side .nav-item {
  display:flex; align-items:center; gap:12px; padding: 10px 12px; border-radius: var(--r-md);
  color: var(--ink-300); text-decoration:none; font-weight:500; font-size:14px;
  cursor:pointer; background:transparent; border:0; text-align:left; width:100%;
}
.side .nav-item:hover { background: var(--ink-800); color: var(--paper); }
.side .nav-item.active { background: var(--ink-800); color: var(--paper); border-left: 3px solid var(--gold-600); padding-left: 9px; }
.side .nav-item.sub { padding-left: 34px; font-size: 13px; color: var(--ink-400); }
.side .nav-item.sub .i { width:14px; height:14px; }
.side .nav-item.sub.active { padding-left: 31px; }
.side .side-foot { margin-top:auto; padding-top:16px; border-top:1px solid var(--ink-800); font-size:12px; color: var(--ink-400); }

.main { display:flex; flex-direction:column; min-width:0; }
.topbar {
  display:flex; align-items:center; gap:16px; padding: 16px 32px;
  background: var(--paper-alt); border-bottom: 1px solid var(--ink-200);
}
.topbar .search { flex:1; max-width: 520px; position:relative; }
.topbar .search input { padding-left: 40px; height: 40px; }
.topbar .search .i { position:absolute; left: 12px; top: 10px; color: var(--ink-400); }
.topbar .actions { margin-left:auto; display:flex; align-items:center; gap:12px; }

.a-screen { display:none; padding: 24px 32px 40px; flex:1; overflow-y:auto; }
.a-screen.active { display:block; }
.a-header { display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom: 20px; }
.a-header h1 { margin:0; font-size:26px; font-weight:700; }
.a-header .sub { color: var(--ink-600); font-size: 14px; margin-top: 4px; }

/* Stat tiles grid */
.tiles { display:grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 24px; }
.tile { background: var(--paper-alt); border:1px solid var(--ink-200); border-radius: var(--r-lg); padding: 18px 20px; }
.tile .tlbl { font-size:11px; color: var(--ink-600); text-transform:uppercase; letter-spacing:.08em; font-weight:700; }
.tile .tval { font-size:28px; font-weight:700; margin-top:6px; }
.tile.accent .tval { color: var(--gold-700); }
.tile.warn .tval { color: var(--warn); }
.tile .delta { font-size:12px; margin-top:6px; color: var(--ink-600); }

.panels { display:grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: var(--paper-alt); border:1px solid var(--ink-200); border-radius: var(--r-lg); overflow:hidden; }
.panel .p-head { padding: 16px 20px; border-bottom: 1px solid var(--ink-200); display:flex; align-items:center; justify-content:space-between; }
.panel .p-head h3 { margin:0; font-size:16px; font-weight:600; }
.panel .p-body { padding: 8px 0; }

.list-row { display:flex; align-items:center; padding: 12px 20px; gap:12px; border-bottom:1px solid var(--ink-100); }
.list-row:last-child { border-bottom:0; }
.list-row .l-main { flex:1; min-width:0; }
.list-row .l-main .l-title { font-weight:600; font-size:14px; }
.list-row .l-main .l-sub { font-size:12px; color: var(--ink-600); margin-top:2px; }

/* Table */
.table-wrap { background: var(--paper-alt); border:1px solid var(--ink-200); border-radius: var(--r-lg); overflow:hidden; }
.table-toolbar { display:flex; gap:8px; padding:16px 20px; border-bottom:1px solid var(--ink-200); align-items:center; flex-wrap:wrap; }
.table-toolbar .search { flex:1; max-width:320px; position:relative; }
.table-toolbar .search .i { position:absolute; left:12px; top:12px; color:var(--ink-400); }
.table-toolbar .search input { padding-left:38px; }
.select {
  padding: 10px 32px 10px 14px; border-radius: var(--r-md); border:1px solid var(--ink-200); background: var(--paper-alt);
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23939AA5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
table.dtl { width:100%; border-collapse: collapse; }
table.dtl th { text-align:left; padding: 12px 20px; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color: var(--ink-600); background: var(--paper); border-bottom:1px solid var(--ink-200); font-weight:700; }
table.dtl td { padding: 14px 20px; border-bottom: 1px solid var(--ink-100); font-size: 14px; vertical-align: middle; }
table.dtl tr:hover td { background: var(--paper); }
table.dtl tr:last-child td { border-bottom:0; }
table.dtl .thumb { width:44px; height:44px; border-radius: var(--r-sm); background-size:cover; background-position:center; }
table.dtl .sku { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size:12px; color: var(--ink-600); }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* Modal */
.overlay {
  position: fixed; inset:0; background: rgba(14,17,19,.55); z-index: 200;
  display:none; align-items:center; justify-content:center; padding: 24px;
}
.overlay.active { display:flex; }
.modal {
  background: var(--paper-alt); border-radius: var(--r-xl); max-width: 720px; width:100%;
  max-height: 90vh; overflow: hidden; display:flex; flex-direction:column;
  box-shadow: var(--shadow-lg);
}
.modal .m-head { padding: 20px 24px; border-bottom:1px solid var(--ink-200); display:flex; align-items:center; justify-content:space-between; }
.modal .m-head h2 { margin:0; font-size:20px; font-weight:700; }
.modal .m-content { padding: 20px 24px; overflow-y:auto; }
.modal .m-foot { padding: 16px 24px; border-top:1px solid var(--ink-200); display:flex; gap:12px; justify-content:flex-end; }

/* Two column form */
.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.field label { display:block; font-size:12px; color:var(--ink-600); font-weight:600; text-transform:uppercase; letter-spacing:.06em; margin-bottom:6px; }

/* Landing page */
.landing {
  min-height: 100vh; display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding: 40px 24px; text-align:center;
  background: radial-gradient(ellipse at top, #EFE9DA 0%, var(--paper) 40%, #E4DFD3 100%);
}
.landing .brand-logo { margin-bottom: 40px; }
.landing .brand-logo svg { width: 320px; height:auto; }
.landing .tag { font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--ink-600); font-style: italic; margin-bottom: 48px; max-width: 480px; }
.landing .roles { display:grid; grid-template-columns: repeat(3, 300px); gap: 20px; }
.landing .role {
  background: var(--paper-alt); border:1px solid var(--ink-200); border-radius: var(--r-xl);
  padding: 32px 28px; text-align:left; text-decoration:none; color: var(--ink-950);
  transition: all .2s; box-shadow: var(--shadow-sm);
}
.landing .role:hover { border-color: var(--gold-600); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.landing .role .icon-wrap { width: 56px; height: 56px; border-radius: var(--r-md); background: var(--gold-100); color: var(--gold-700); display:flex; align-items:center; justify-content:center; margin-bottom: 20px; }
.landing .role h3 { margin:0; font-size:22px; font-weight:700; font-family: var(--font-display); }
.landing .role p { margin: 8px 0 0; color: var(--ink-600); font-size: 14px; line-height: 22px; }
.landing .role .flow { margin-top: 20px; font-size:12px; color: var(--ink-400); font-weight:600; text-transform: uppercase; letter-spacing:.08em; }
.landing .foot { margin-top: 60px; font-size: 12px; color: var(--ink-400); }
.variants-link {
  margin-top: 32px; display:flex; align-items:center; gap:16px; flex-wrap:wrap;
  padding: 14px 20px; border-radius: var(--r-pill);
  background: var(--paper-alt); border: 1px solid var(--ink-200);
  text-decoration: none; color: var(--ink-950);
  transition: all .2s; box-shadow: var(--shadow-sm);
}
.variants-link:hover { border-color: var(--gold-600); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.variants-link .v-badge { font-size: 10px; font-weight: 700; letter-spacing:.08em; text-transform:uppercase; padding: 4px 10px; border-radius: var(--r-pill); background: var(--ink-950); color: var(--paper); }
.variants-link .v-title { font-weight: 600; font-size: 14px; }
.variants-link .v-sub { font-size: 12px; color: var(--ink-600); }
.variants-link .v-swatches { display:flex; margin-left:auto; border-radius: var(--r-pill); overflow:hidden; box-shadow: inset 0 0 0 1px var(--ink-200); }
.variants-link .v-swatches span { width: 18px; height: 18px; display:block; }

/* Fade transitions on screens */
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity:1; transform: translateY(0);} }
.m-screen.active, .a-screen.active { animation: fade .28s ease-out; }

/* Credit footer — appears on every screen */
.app-footer {
  flex-shrink: 0; padding: 12px 32px;
  text-align: center; font-size: 11px; color: var(--ink-400);
  border-top: 1px solid var(--ink-100); background: var(--paper-alt);
  letter-spacing: .08em; font-weight: 500; text-transform: uppercase;
}
.app-footer b { color: var(--ink-600); font-weight: 700; }
.app-footer a { color: inherit; text-decoration: none; }

.stage-footer {
  width: 100%; padding: 24px 24px 32px; text-align: center;
  font-size: 11px; color: var(--ink-400); letter-spacing: .08em;
  font-weight: 500; text-transform: uppercase;
}
.stage-footer b { color: var(--ink-800); font-weight: 700; }

/* Utility */
.mt-4 { margin-top:4px; } .mt-8 { margin-top:8px; } .mt-12 { margin-top:12px; } .mt-16 { margin-top:16px; } .mt-20 { margin-top:20px; } .mt-24 { margin-top:24px; }
.mb-4 { margin-bottom:4px; } .mb-8 { margin-bottom:8px; } .mb-12 { margin-bottom:12px; } .mb-16 { margin-bottom:16px; } .mb-20 { margin-bottom:20px; }
.gap-4 { gap:4px; } .gap-8 { gap:8px; } .gap-12 { gap:12px; }
.text-center { text-align:center; }
.hide { display:none !important; }

/* Responsive tweaks */
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .panels { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction:row; overflow-x:auto; }
  .side .nav-item { white-space: nowrap; }
  .side .grp-label { display:none; }
  .stage { flex-direction:column; align-items:center; }
  .stage-side { position:static; max-width:100%; flex: 1 1 auto; width: 380px; }
  .landing .roles { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Mobile phone-frame typography scale-down
   Content inside the phone shell needs smaller sizes than the
   shared desktop scale — otherwise everything reads oversized
   in the 356px inner viewport.
   ============================================================ */
.phone-screen { font-size: 13px; line-height: 19px; }
.phone-screen .display     { font-size: 26px; line-height: 32px; }
.phone-screen .h1          { font-size: 19px; line-height: 26px; }
.phone-screen .h2          { font-size: 16px; line-height: 22px; }
.phone-screen .h3          { font-size: 14px; line-height: 20px; }
.phone-screen .body        { font-size: 13px; line-height: 19px; }
.phone-screen .body-strong { font-size: 13px; line-height: 19px; }
.phone-screen .small       { font-size: 11px; line-height: 15px; }
.phone-screen .micro       { font-size: 10px; line-height: 14px; }
.phone-screen .stat        { font-size: 22px; line-height: 26px; }
.phone-screen .stat-lg     { font-size: 30px; line-height: 34px; }

.phone-screen h1 { font-size: 19px; line-height: 26px; }
.phone-screen h2 { font-size: 16px; line-height: 22px; }
.phone-screen h3 { font-size: 14px; line-height: 20px; }
.phone-screen h4 { font-size: 13px; line-height: 19px; }
.phone-screen p  { font-size: 13px; line-height: 19px; margin: 6px 0; }

.phone-screen .m-topbar { padding: 34px 16px 10px; gap: 10px; }
.phone-screen .m-topbar .title { font-size: 15px; }
.phone-screen .m-topbar .back { width: 32px; height: 32px; }
.phone-screen .m-body { padding: 10px 16px 96px; }

.phone-screen .btn      { height: 42px; padding: 0 16px; font-size: 13px; }
.phone-screen .btn-sm   { height: 32px; padding: 0 12px; font-size: 12px; }
.phone-screen .btn-lg   { height: 48px; padding: 0 20px; font-size: 14px; }

.phone-screen input,
.phone-screen textarea,
.phone-screen select { padding: 10px 12px; font-size: 13px; }

.phone-screen .chip       { font-size: 10px; padding: 3px 8px; }
.phone-screen .chip.large { font-size: 11px; padding: 4px 10px; }

.phone-screen .p-card  { padding: 10px; gap: 12px; }
.phone-screen .p-thumb { width: 64px; height: 64px; }
.phone-screen .p-info .sku  { font-size: 10px; }
.phone-screen .p-info .name { font-size: 13px; }
.phone-screen .p-info .cat  { font-size: 11px; }

.phone-screen .s-card { padding: 12px; }
.phone-screen .s-card .lbl { font-size: 10px; }
.phone-screen .s-card .val { font-size: 24px; }

.phone-screen .avatar    { width: 34px; height: 34px; font-size: 13px; }
.phone-screen .avatar-lg { width: 48px; height: 48px; font-size: 15px; }
.phone-screen .avatar-sm { width: 28px; height: 28px; font-size: 11px; }

.phone-screen .seg button    { padding: 6px 12px; font-size: 12px; }
.phone-screen .tabs button   { padding: 10px 0; font-size: 13px; }
.phone-screen .brand-chip    { padding: 6px 12px; font-size: 11px; }

.phone-screen .countdown .n  { font-size: 18px; }
.phone-screen .countdown .u  { font-size: 10px; }

.phone-screen .m-tabbar { height: 68px; padding: 6px 10px 16px; }
.phone-screen .m-tab .lbl { font-size: 10px; }

.phone-screen .m-sticky-bar { padding: 10px 16px 16px; }

.phone-screen .list-row .l-main .l-title { font-size: 13px; }
.phone-screen .list-row .l-main .l-sub   { font-size: 11px; }

.phone-screen .field label { font-size: 11px; }

.phone-screen .i    { width: 18px; height: 18px; }
.phone-screen .i-lg { width: 20px; height: 20px; }
.phone-screen .i-xl { width: 26px; height: 26px; }
