/* SacredEarth Ad Studio — warm cream, liquid-glass UI */
:root {
  --bg: #F4EEE6;
  --blob-1: #F6E3C4;
  --blob-2: #E6EAF3;
  --blob-3: #F7E1DA;
  --glass: rgba(255, 252, 247, 0.62);
  --glass-strong: rgba(255, 253, 249, 0.82);
  --glass-inset: rgba(255, 255, 255, 0.55);
  --sheen: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.78);
  --hairline: rgba(120, 92, 56, 0.12);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 12px 32px -14px rgba(92, 64, 28, 0.22), 0 2px 6px -2px rgba(92, 64, 28, 0.08);
  --text: #2A2118;
  --muted: #6B5F52;
  --accent: #B5852F;
  --accent-2: #9C6F1F;
  --accent-soft: #F3E3C4;
  --accent-ink: #FFFFFF;
  --bar: #E6CFA6;
  --bar-hi: #C3923F;
  --ok: #1F7A45;
  --ok-soft: #E2F1E6;
  --warn: #9A5B0E;
  --warn-soft: #FBEBD3;
  --err: #A3302A;
  --err-soft: #F9E1DE;
  --ch-amazon: #C9782A;
  --ch-flipkart: #2F63B8;
  --ch-shopify: #3E7D47;
  --radius: 22px;
  --radius-sm: 14px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --display: Fraunces, Georgia, serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #16120E;
  --blob-1: #3A2A14;
  --blob-2: #1C2230;
  --blob-3: #33201C;
  --glass: rgba(40, 33, 26, 0.58);
  --glass-strong: rgba(46, 38, 30, 0.85);
  --glass-inset: rgba(255, 255, 255, 0.05);
  --sheen: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.10);
  --hairline: rgba(255, 240, 220, 0.10);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 14px 34px -16px rgba(0, 0, 0, 0.6);
  --text: #F3EBDD;
  --muted: #B7A994;
  --accent: #D7A54C;
  --accent-2: #E5B865;
  --accent-soft: #4A3818;
  --accent-ink: #1E1609;
  --bar: #5A4626;
  --bar-hi: #D7A54C;
  --ok: #7FD39B;
  --ok-soft: #1F3326;
  --warn: #F0B866;
  --warn-soft: #3D2B12;
  --err: #F19A92;
  --err-soft: #3E1E1B;
  --ch-amazon: #E39A52;
  --ch-flipkart: #6E9BEA;
  --ch-shopify: #7DBE84;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16120E; --blob-1: #3A2A14; --blob-2: #1C2230; --blob-3: #33201C; --sheen: rgba(255, 255, 255, 0.06);
    --glass: rgba(40, 33, 26, 0.58); --glass-strong: rgba(46, 38, 30, 0.85); --glass-inset: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.10); --hairline: rgba(255, 240, 220, 0.10);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 14px 34px -16px rgba(0, 0, 0, 0.6);
    --text: #F3EBDD; --muted: #B7A994; --accent: #D7A54C; --accent-2: #E5B865; --accent-soft: #4A3818; --accent-ink: #1E1609;
    --bar: #5A4626; --bar-hi: #D7A54C; --ok: #7FD39B; --ok-soft: #1F3326; --warn: #F0B866; --warn-soft: #3D2B12;
    --err: #F19A92; --err-soft: #3E1E1B; --ch-amazon: #E39A52; --ch-flipkart: #6E9BEA; --ch-shopify: #7DBE84;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(60vw 50vh at 8% -5%, var(--blob-1), transparent 60%),
    radial-gradient(50vw 45vh at 100% 0%, var(--blob-2), transparent 60%),
    radial-gradient(60vw 50vh at 70% 105%, var(--blob-3), transparent 60%),
    var(--bg);
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 10px; }
code { font-size: 13px; background: var(--glass-inset); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--hairline); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.ic { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- glass surfaces ---------- */
.glass {
  background-color: var(--glass);
  background-image: linear-gradient(180deg, var(--sheen) 0%, transparent 42%);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}
.glass-inset { background: var(--glass-inset); border: 1px solid var(--glass-border); }
.card { border-radius: var(--radius); padding: 22px; min-width: 0; position: relative; }
.card.tight { padding: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head .muted { font-size: 13.5px; margin-top: 3px; }
.card.hero { background: linear-gradient(135deg, rgba(255,248,236,.85), rgba(255,252,247,.55)); }
:root[data-theme="dark"] .card.hero { background: linear-gradient(135deg, rgba(74,56,24,.55), rgba(40,33,26,.5)); }

/* ---------- shell ---------- */
.shell { display: flex; gap: 16px; padding: 12px; min-height: 100vh; align-items: flex-start; }
.sidebar {
  position: sticky; top: 12px; width: 264px; flex: none; height: calc(100vh - 24px);
  border-radius: 26px; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; z-index: 30;
}
.brand { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 10px 8px 16px; border-bottom: 1px solid var(--hairline); margin-bottom: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 168px; height: auto; display: block; transition: transform .35s var(--ease); }
.brand:hover .brand-logo { transform: scale(1.03); }
.brand-tag { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); background: var(--accent-soft); padding: 4px 12px; border-radius: 99px; }
.logo-on-dark { display: none !important; }
:root[data-theme="dark"] .logo-on-light { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-on-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-on-dark { display: block !important; }
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0 4px; }
.auth-brand img { width: 220px; height: auto; }
.brand-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.brand-name { display: block; font-weight: 700; font-size: 17px; }
.brand-sub { display: block; font-size: 13px; color: var(--muted); }
nav { display: flex; flex-direction: column; gap: 3px; }
.nav-section { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 14px;
  color: var(--text); font: 500 15.5px var(--font); border: 1px solid transparent; background: none; cursor: pointer; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--glass-inset); text-decoration: none; }
.nav-item .ic { color: var(--muted); }
.nav-item.active { background: linear-gradient(180deg, rgba(246,226,190,.9), rgba(240,214,170,.75)); border-color: rgba(214,170,98,.55); color: #6B4710; font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 6px 16px -10px rgba(150,100,30,.45); }
.nav-item.active .ic { color: #8A5B16; }
:root[data-theme="dark"] .nav-item.active { background: linear-gradient(180deg, rgba(110,80,30,.7), rgba(80,58,22,.6)); color: #FBE3B4; border-color: rgba(215,165,76,.35); }
:root[data-theme="dark"] .nav-item.active .ic { color: #FBE3B4; }
.nav-form { margin: 0; }
.user-card { margin-top: auto; display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(160deg, #C9963E, #9C6A1C); flex: none; }
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-email { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.topbar { position: sticky; top: 12px; z-index: 20; border-radius: 24px; padding: 14px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar-title { flex: 1; min-width: 200px; }
.topbar-title h1 { font-size: 24px; font-weight: 700; }
.topbar-title .muted { font-size: 14.5px; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.content { display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 14px; font: 600 15px var(--font); cursor: pointer; border: 1px solid var(--glass-border);
  background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow); white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.02); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #C7963F, var(--accent) 55%, var(--accent-2));
  color: var(--accent-ink); border-color: rgba(140, 96, 26, .55);
  box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 -1px 0 rgba(0,0,0,.08) inset, 0 10px 22px -10px rgba(150,100,30,.7);
}
:root[data-theme="dark"] .btn.primary { background: linear-gradient(180deg, #E7BA66, var(--accent)); border-color: rgba(231,186,102,.5); }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--hairline); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--err); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; cursor: pointer; color: var(--text); background: none; border: 1px solid transparent; }
.icon-btn.menu-btn { display: none; }
.glass-btn { background: var(--glass-strong); border-color: var(--glass-border); box-shadow: var(--shadow); }
.pill-status { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 14px; background: var(--glass-strong); border: 1px solid var(--glass-border); }
.pill-status:hover { text-decoration: none; }
.pill-status .dot { width: 8px; height: 8px; border-radius: 99px; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.pill-status.ok { color: var(--ok); }
.pill-status.warn { color: var(--warn); }

.seg { display: inline-flex; gap: 4px; padding: 5px; border-radius: 16px; flex-wrap: wrap; }
.seg a, .seg button { min-height: 38px; padding: 0 16px; border-radius: 12px; display: inline-flex; align-items: center; color: var(--text); font: 500 15px var(--font); border: 1px solid transparent; background: none; cursor: pointer; }
.seg a:hover, .seg button:hover { text-decoration: none; background: var(--glass-inset); }
.seg .on, .seg [aria-pressed="true"], .seg [aria-selected="true"] { background: var(--glass-strong); border-color: var(--glass-border); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 4px 12px -6px rgba(92,64,28,.3); font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--glass-inset); border: 1px solid var(--hairline); color: var(--text); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: #7A5113; border-color: transparent; }
:root[data-theme="dark"] .chip.accent { color: #FBE3B4; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.err { background: var(--err-soft); color: var(--err); border-color: transparent; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13.5px; font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="month"], input[type="url"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 13px; border: 1px solid var(--hairline);
  background: var(--glass-strong); color: var(--text); font: 400 15px var(--font);
  box-shadow: 0 1px 2px rgba(92,64,28,.06) inset;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .nav-item:focus-visible, .seg a:focus-visible, .seg button:focus-visible, .icon-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px;
}
label.check { display: flex; gap: 10px; align-items: center; font-size: 14px; min-height: 32px; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 12px; }
legend { font-weight: 650; margin-bottom: 8px; }
fieldset label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; }

/* ---------- layout grids ---------- */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.two { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.halves { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.split { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.split > .side { flex: 0 1 390px; min-width: 0; }
@media (max-width: 1000px) { .split > .side { flex: 1 1 100%; } }
[data-format-seg] { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
[data-format-seg] button { justify-content: center; padding: 0 6px; }
.split > .grow { flex: 999 1 520px; min-width: 0; }

/* ---------- KPI ---------- */
.kpi .label { font-size: 15px; font-weight: 500; display: flex; justify-content: space-between; }
.kpi .value { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 600; padding: 2px 8px; border-radius: 99px; font-size: 12.5px; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--err-soft); color: var(--err); }
.delta.flat { background: var(--glass-inset); color: var(--muted); }

/* ---------- charts ---------- */
.chart { width: 100%; height: 260px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart text { fill: var(--muted); font: 12px var(--font); }
.chart .grid-line { stroke: var(--hairline); }
.chart .bar { fill: var(--bar); transition: fill .15s; }
.chart .bar.hi { fill: var(--bar-hi); }
.chart .bar:hover { fill: var(--bar-hi); }
.empty { display: grid; place-items: center; text-align: center; min-height: 160px; color: var(--muted); padding: 20px; gap: 10px; }
.channel-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.channel-row:first-child { border-top: 0; }
.channel-row .track { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--glass-inset); border: 1px solid var(--hairline); overflow: hidden; }
.channel-row .fill { height: 100%; border-radius: 99px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 8px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px 10px 8px 0; white-space: nowrap; }
td { padding: 12px 10px 12px 0; border-top: 1px solid var(--hairline); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.list-row { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 13px 16px; border-radius: 16px; }
.list-row + .list-row { margin-top: 8px; }

/* ---------- radar ---------- */
.live-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.live-bar .controls { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.progress-list { border-radius: 16px; padding: 4px 16px; margin-top: 14px; }
.progress-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--hairline); flex-wrap: wrap; }
.progress-row:first-child { border-top: 0; }
.progress-row .brand { flex: 0 0 120px; font-weight: 650; border: 0; padding: 0; margin: 0; }
.progress-row .step { flex: 1 1 260px; color: var(--muted); font-size: 14px; }
.spinner { width: 14px; height: 14px; border-radius: 99px; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ad-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.ad-thumb { aspect-ratio: 4 / 3; border-radius: 14px; background: var(--glass-inset); border: 1px solid var(--hairline); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-body { font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.kv { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 6px 16px; }
.kv > div { padding: 11px 0; border-top: 1px solid var(--hairline); }
.kv > div:nth-child(-n+2) { border-top: 0; }

/* ---------- products & studio ---------- */
.product-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.product-img { height: 210px; border-radius: 16px; display: grid; place-items: center; background: radial-gradient(circle at 50% 60%, #FBF1D2, #F1E2BD 70%); border: 1px solid var(--glass-border); }
:root[data-theme="dark"] .product-img { background: radial-gradient(circle at 50% 60%, #4A3B22, #2E2416 70%); }
.product-img img { max-height: 190px; max-width: 90%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(60,40,10,.25)); }
.pack-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.pack-switch button { min-height: 32px; padding: 0 10px; border-radius: 99px; font: 600 12.5px var(--font); border: 1px solid var(--hairline); background: var(--glass-inset); color: var(--text); cursor: pointer; }
.pack-switch button[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; color: #7A5113; }
:root[data-theme="dark"] .pack-switch button[aria-pressed="true"] { color: #FBE3B4; }
.note-box { border-radius: 14px; padding: 11px 13px; font-size: 13.5px; line-height: 1.5; background: var(--glass-inset); border: 1px solid var(--hairline); }
.product-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; padding: 2px; }
.product-pick label { cursor: pointer; border-radius: 14px; border: 1px solid var(--hairline); background: var(--glass-inset); padding: 8px 6px; text-align: center; font-size: 11.5px; font-weight: 600; line-height: 1.25; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.product-pick img { height: 58px; object-fit: contain; }
.product-pick input { position: absolute; opacity: 0; pointer-events: none; }
.product-pick input:checked + label { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.product-pick input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.canvas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.canvas-tile { display: flex; flex-direction: column; gap: 8px; }
.canvas-tile canvas { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--hairline); background: #fff; box-shadow: var(--shadow); }
.copy-block { border-radius: 16px; padding: 14px 16px; background: var(--glass-inset); border: 1px solid var(--hairline); }
.copy-block + .copy-block { margin-top: 10px; }
.copy-block .k { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.copy-block .v { margin-top: 4px; white-space: pre-wrap; }
.scene { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.scene:first-child { border-top: 0; }
.loading-card { display: grid; place-items: center; min-height: 260px; gap: 12px; color: var(--muted); text-align: center; }

/* ---------- uploads ---------- */
.drop { position: relative; border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--hairline)); border-radius: 18px; padding: 24px 14px; text-align: center; cursor: pointer; background: var(--glass-inset); display: flex; flex-direction: column; gap: 6px; align-items: center; font-weight: 600; }
.drop:hover, .drop.over { background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(30, 20, 10, .28); backdrop-filter: blur(4px); }
.modal.open { display: flex; }
.modal-card { width: min(860px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 26px; padding: 22px; background: var(--glass-strong); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 14px 0; }

/* ---------- feedback ---------- */
.alert { border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 80; padding: 12px 18px; border-radius: 16px; font-weight: 600; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); backdrop-filter: blur(20px); transition: .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { color: var(--err); }
.toast-inline { border-radius: 16px; padding: 12px 16px; font-weight: 600; }
.toast-inline.ok { background: var(--ok-soft); color: var(--ok); }
.toast-inline.err { background: var(--err-soft); color: var(--err); }

/* ---------- auth ---------- */
body.auth { display: grid; place-items: center; padding: 16px; background:
  radial-gradient(60vw 50vh at 8% -5%, var(--blob-1), transparent 60%),
  radial-gradient(50vw 45vh at 100% 0%, var(--blob-2), transparent 60%),
  radial-gradient(60vw 50vh at 70% 105%, var(--blob-3), transparent 60%), var(--bg); }
.auth-wrap { width: min(440px, 100%); }
.auth-card { border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-size: 24px; }
.brand-row { display: flex; gap: 12px; align-items: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }
@media (max-width: 880px) {
  .shell { padding: 8px; gap: 8px; }
  .sidebar { position: fixed; left: 8px; top: 8px; bottom: 8px; height: auto; transform: translateX(-110%); transition: transform .25s ease; background: var(--glass-strong); }
  .sidebar.open { transform: none; }
  .icon-btn.menu-btn { display: grid; }
  .topbar { top: 8px; padding: 10px 12px; border-radius: 20px; }
  .topbar-title h1 { font-size: 20px; }
  .kpi .value { font-size: 28px; }
  .card { padding: 16px; }
  .kv { grid-template-columns: 1fr; }
  .kv > div:nth-child(2n) { border-top: 0; padding-top: 0; }
}

/* ---------- motion ---------- */
.backdrop::after { content: ""; position: absolute; inset: -20%; background: radial-gradient(30vw 30vw at 30% 40%, color-mix(in srgb, var(--blob-1) 70%, transparent), transparent 70%); animation: drift 26s ease-in-out infinite alternate; opacity: .8; }
@keyframes drift { from { transform: translate3d(-6%, -4%, 0) scale(1); } to { transform: translate3d(8%, 6%, 0) scale(1.15); } }
.content > * { animation: rise .55s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .05s; } .content > *:nth-child(3) { animation-delay: .1s; } .content > *:nth-child(4) { animation-delay: .15s; } .content > *:nth-child(5) { animation-delay: .2s; } .content > *:nth-child(n+6) { animation-delay: .25s; }
@keyframes rise { from { opacity: .35; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card, .btn, .nav-item, .seg a, .seg button, .chip, .icon-btn, .pill-status, .product-pick label, .pack-switch button { transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .25s ease, border-color .25s ease, color .2s ease; }
a.card:hover, .ad-card:hover, .product-card:hover, .kpi:hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 22px 44px -18px rgba(92,64,28,.32); }
.btn:hover { transform: translateY(-1px); }
.btn:active, .icon-btn:active, .nav-item:active, .seg a:active, .seg button:active { transform: scale(.97); }
.nav-item:hover .ic { transform: translateX(2px); }
.nav-item .ic { transition: transform .3s var(--ease); }
.product-img img { transition: transform .5s var(--ease); }
.product-card:hover .product-img img { transform: translateY(-4px) rotate(-2deg) scale(1.03); }
.product-pick label:hover { transform: translateY(-2px); }
canvas[data-tile] { transition: transform .35s var(--ease); }
.canvas-tile:hover canvas { transform: scale(1.015); }
.modal.open .modal-card { animation: pop .35s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.sidebar.open { box-shadow: 0 30px 80px -20px rgba(40,25,5,.45); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
