/* ============================================================
   Krevvo — local-first ad spec studio
   Design tokens, layout, components. No external assets.
   ============================================================ */

:root {
  --bg: #0b0c0f;
  --bg-soft: #0e1014;
  --panel: #121419;
  --panel-2: #171920;
  --panel-3: #1d2028;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #f2efe9;
  --ink-2: #d6d2ca;
  --muted: #918d85;
  --muted-2: #6d6a64;
  --accent: #ff5c39;
  --accent-2: #ff8a6e;
  --accent-ink: #1c0c08;
  --mint: #61f0ad;
  --mint-ink: #06140d;
  --warn: #ffb020;
  --danger: #ff5757;
  --blue: #78a6ff;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.4);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; }

::selection { background: rgba(255, 92, 57, 0.35); color: #fff; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 17px; height: 17px; flex: none; display: inline-block; }
.ic use { pointer-events: none; }

.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: -0.01em; }
.hide-sm { display: inline-flex; }

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 20px; border: 2px solid var(--panel); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ============================================================ layout */

.app {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr) 348px;
  grid-template-rows: 60px minmax(0, 1fr);
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 55% -10%, rgba(255, 92, 57, 0.055), transparent 60%),
    var(--bg);
}

.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 12, 15, 0.82);
  backdrop-filter: blur(14px);
  z-index: 30;
}

.rail {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.014), transparent 38%);
  padding: 22px 16px 14px;
  gap: 20px;
  overflow-y: auto;
}

.stage {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.inspector {
  grid-column: 3;
  grid-row: 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--panel);
  position: relative;
  z-index: 20;
}

/* ============================================================ dashboard */

.dashboard {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 0;
  overflow-y: auto;
  background:
    radial-gradient(1100px 600px at 30% -20%, rgba(255, 92, 57, 0.07), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(201, 167, 255, 0.04), transparent 55%),
    var(--bg);
}
.app[data-view="home"] .rail,
.app[data-view="home"] .stage,
.app[data-view="home"] .inspector { display: none; }
.app[data-view="home"] .dashboard { display: block; }

.dash-inner { max-width: 1380px; margin: 0 auto; padding: 30px clamp(14px, 4vw, 48px) 70px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.dash-head-copy h1 {
  margin: 7px 0 7px;
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 500;
  letter-spacing: -0.035em;
}
.dash-head-copy p { margin: 0; max-width: 480px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.dash-head-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
#dashBack .ic { transform: rotate(180deg); }

.dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 20px; }
.dash-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.008));
  padding: 13px 15px;
  min-width: 0;
}
.dash-stat span { display: block; font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 650; color: var(--muted-2); }
.dash-stat b { display: block; margin-top: 5px; font-size: 25px; line-height: 1; letter-spacing: -0.04em; font-weight: 600; }
.dash-stat em { display: block; margin-top: 5px; font-style: normal; font-size: 9.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 14px; align-items: start; }
.dash-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.16);
}
.dash-panel-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.012);
}
.dash-panel-head h2 { margin: 3px 0 0; font-size: 15px; letter-spacing: -0.025em; font-weight: 600; }
.dash-panel-head em { font-style: normal; font-size: 9px; color: var(--muted-2); }

.dash-project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.dash-project {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-soft);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.14s, transform 0.14s, background 0.14s;
}
.dash-project:hover { border-color: var(--line-2); transform: translateY(-1px); background: var(--panel-3); }
.dash-project.is-current { border-color: rgba(255,92,57,0.38); }
.dash-thumb {
  aspect-ratio: 16 / 9;
  background: #090a0d;
  display: grid; place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.dash-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-thumb .ic { width: 22px; height: 22px; color: var(--muted-2); }
.dash-project-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dash-project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.dash-project-top strong { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-project-body > em { font-style: normal; font-size: 9px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.dash-chips span {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 8px; color: var(--muted-2);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 4px;
}
.dash-project .project-del { opacity: 0.5; }
.dash-project:hover .project-del { opacity: 1; }

.dash-side { display: flex; flex-direction: column; gap: 12px; }
.dash-size-list { padding: 7px; display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow-y: auto; }
.dash-size {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 6px 7px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; text-align: left; color: var(--ink-2);
}
.dash-size:hover { background: var(--panel-3); border-color: var(--line); }
.dash-size .mono { flex: none; width: 62px; font-size: 8.5px; color: var(--muted-2); }
.dash-size strong { flex: 1; min-width: 0; font-size: 10px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-size small { font-size: 8px; color: var(--muted-2); }
.dash-size .ic { width: 11px; height: 11px; flex: none; color: var(--muted-2); }

.dash-spec-summary { padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.dash-spec-row { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 5px; border-bottom: 1px dashed var(--line); font-size: 10px; color: var(--muted); }
.dash-spec-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dash-spec-row b { font-family: var(--mono, ui-monospace, monospace); font-weight: 500; color: var(--ink-2); }

.dash-current { padding: 13px 14px; display: flex; flex-direction: column; gap: 9px; }
.dash-current .dash-current-thumb { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #090a0d; aspect-ratio: 16/9; }
.dash-current .dash-current-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-current h3 { margin: 0; font-size: 13px; font-weight: 600; }
.dash-current em { font-style: normal; font-size: 9.5px; color: var(--muted-2); line-height: 1.5; }
.dash-current-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.dash-current-actions .btn { height: 30px; font-size: 10px; }

.dash-empty { padding: 22px 16px; text-align: center; color: var(--muted-2); font-size: 10px; line-height: 1.6; }
.dash-empty strong { display: block; margin-bottom: 3px; color: var(--ink-2); font-size: 12px; }

@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) 310px; }
}
@media (max-width: 980px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .dash-current { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .dash-inner { padding: 20px 12px 50px; }
  .dash-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dash-head-actions { justify-content: flex-start; width: 100%; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .dash-project-grid { grid-template-columns: 1fr; }
  .dash-side { grid-template-columns: 1fr; }
  .dash-current { grid-column: auto; }
}

/* ============================================================ brand */

.home-tab { margin-left: -8px; flex: none; }
.home-tab:hover { color: var(--accent-2); border-color: rgba(255,92,57,0.3); }
.app[data-view="home"] .home-tab { color: var(--accent-2); border-color: rgba(255,92,57,0.32); background: rgba(255,92,57,0.07); }

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(150deg, #ff6b47, #e23d1e);
  color: #1b0a06;
  box-shadow: 0 6px 18px rgba(255, 92, 57, 0.28), inset 0 1px 0 rgba(255,255,255,0.3);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-type {
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.04em;
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.brand-type em {
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}

/* ============================================================ topbar */

.project-switch { display: flex; align-items: center; gap: 10px; min-width: 0; }
.project-btn {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid transparent;
  border-radius: 8px; padding: 7px 9px;
  color: var(--ink-2); font-size: 13px; font-weight: 550;
  max-width: 260px;
  transition: background 0.16s, border-color 0.16s;
}
.project-btn:hover { background: var(--panel-2); border-color: var(--line); }
.project-btn #projectName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-btn .ic { color: var(--muted); width: 14px; height: 14px; }
.dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(97, 240, 173, 0.12);
  flex: none;
}
.save-state {
  font-size: 10.5px; color: var(--muted-2);
  font-family: var(--mono);
  white-space: nowrap;
  transition: color 0.2s;
}
.save-state[data-state="saving"] { color: var(--warn); }
.save-state[data-state="dirty"] { color: var(--muted); }

.view-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tool {
  display: flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 550;
  transition: all 0.15s;
}
.tool:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.tool.is-on { color: var(--ink); background: var(--panel-3); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }
.tool[data-toggle="safe"].is-on { color: var(--mint); }
.tool .ic { width: 14px; height: 14px; }

.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* ============================================================ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform 0.12s var(--ease), background 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.btn:active { transform: translateY(1px); }
.btn .ic { width: 15px; height: 15px; }
.btn.primary {
  background: linear-gradient(180deg, #ff6a47, #f04a27);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 5px 18px rgba(255, 92, 57, 0.24), inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn.primary:hover { background: linear-gradient(180deg, #ff7b5b, #ff5330); box-shadow: 0 8px 24px rgba(255, 92, 57, 0.32), inset 0 1px 0 rgba(255,255,255,0.25); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { background: rgba(255,255,255,0.04); border-color: var(--line-2); }
.btn.soft { background: var(--panel-2); border-color: var(--line); color: var(--ink-2); }
.btn.soft:hover { background: var(--panel-3); }
.btn.accent { background: rgba(255, 92, 57, 0.12); border-color: rgba(255,92,57,0.28); color: var(--accent-2); }
.btn.accent:hover { background: rgba(255, 92, 57, 0.18); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 13.5px; border-radius: 11px; }
.btn.xl { height: 48px; font-size: 13.5px; border-radius: 11px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: all 0.15s;
}
.icon-btn:hover { color: var(--ink); background: var(--panel-2); border-color: var(--line-2); }

.mini-btn {
  height: 24px; padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.14s;
}
.mini-btn:hover { color: var(--ink); border-color: var(--line-2); background: rgba(255,255,255,0.03); }
.mini-btn.danger:hover { color: var(--danger); border-color: rgba(255,87,87,0.4); }
.mini-btn.is-on { color: var(--accent-2); border-color: rgba(255,92,57,0.35); background: rgba(255,92,57,0.08); }

.link-btn {
  border: 0; background: none; color: var(--muted);
  font-size: 11px; font-weight: 600; padding: 2px;
  text-decoration: underline; text-decoration-color: rgba(255,255,255,0.18);
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent-2); text-decoration-color: currentColor; }

/* ============================================================ rail */

.steps { display: flex; flex-direction: column; gap: 3px; }
.step {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  position: relative;
  transition: all 0.16s var(--ease);
}
.step:hover { background: rgba(255,255,255,0.025); color: var(--ink-2); }
.step.is-active { background: var(--panel-2); border-color: var(--line); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,0.035); }
.step.is-active::before {
  content: ""; position: absolute; left: -17px; top: 11px; bottom: 11px;
  width: 2px; border-radius: 2px; background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 92, 57, 0.5);
}
.step-no {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  color: var(--muted-2);
  border: 1px solid var(--line);
  width: 25px; height: 25px; border-radius: 7px;
  display: grid; place-items: center;
  flex: none;
}
.step.is-active .step-no { color: var(--accent-2); border-color: rgba(255,92,57,0.3); background: rgba(255,92,57,0.07); }
.step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step-text strong { font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; }
.step-text em { font-style: normal; font-size: 10px; color: var(--muted-2); }
.step-tick { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: transparent; border: 1px solid var(--line-2); }
.step-tick.is-done { background: var(--mint); border-color: var(--mint); box-shadow: 0 0 8px rgba(97,240,173,0.4); }

.rail-spacer { flex: 1; min-height: 10px; }

.rail-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  padding: 12px;
}
.rail-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rail-card-head > span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted-2); font-weight: 650; }
.brand-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.swatch { width: 26px; height: 26px; border-radius: 7px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); flex: none; }
.brand-row div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.brand-row strong { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-row em { font-style: normal; font-size: 10px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-meta { display: flex; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted-2); }
.rail-meta b { color: var(--ink-2); font-weight: 600; }

.rail-foot { display: flex; flex-direction: column; gap: 9px; }
.licence-chip {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 10.5px; font-weight: 600;
  text-align: left;
  transition: all 0.15s;
}
.licence-chip:hover { border-color: var(--line-2); color: var(--ink-2); }
.licence-chip .ic { width: 13px; height: 13px; color: var(--warn); }
.licence-chip em { margin-left: auto; font-style: normal; color: var(--accent-2); font-size: 10px; }
.licence-chip.is-licensed .ic { color: var(--mint); }
.licence-chip.is-licensed em { color: var(--mint); }
.rail-links { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--muted-2); }
.rail-links a:hover, .rail-links button:hover { color: var(--ink-2); }
.rail-links button { border: 0; background: none; padding: 0; color: inherit; font-size: inherit; }
.rail-links .ver { margin-left: auto; font-family: var(--mono); }

/* ============================================================ stage head */

.stage-head {
  flex: none;
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 20px 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 12, 15, 0.4);
}
.stage-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.eyebrow { font-size: 9px; font-weight: 650; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.eyebrow.accent { color: var(--accent-2); }
.stage-title h1 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-meta { display: flex; align-items: center; gap: 12px; flex: none; }
.dim { color: var(--muted); }
.zoom-group { display: flex; align-items: center; gap: 1px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--panel); }
.zoom-group .mini-btn { border: 0; height: 24px; min-width: 24px; padding: 0 6px; font-size: 12px; }
.zoom-val { padding: 0 7px 0 4px; color: var(--muted-2); font-size: 10px; min-width: 34px; text-align: right; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  border-radius: 20px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid transparent;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill[data-level="pass"] { color: var(--mint); background: rgba(97,240,173,0.08); border-color: rgba(97,240,173,0.22); }
.status-pill[data-level="warn"] { color: var(--warn); background: rgba(255,176,32,0.08); border-color: rgba(255,176,32,0.22); }
.status-pill[data-level="fail"] { color: var(--danger); background: rgba(255,87,87,0.08); border-color: rgba(255,87,87,0.22); }
.status-pill.sm { height: 19px; font-size: 8.5px; padding: 0 7px; }

/* ============================================================ viewport */

.viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
  padding: 22px;
  background:
    radial-gradient(620px 420px at 50% 42%, rgba(255,255,255,0.035), transparent 70%),
    linear-gradient(180deg, #0a0b0e, #0c0e12);
}
.vp-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.065) 1px, transparent 1.2px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 68% 62% at 50% 48%, #000 25%, transparent 78%);
  pointer-events: none;
  opacity: 0.55;
}

.artboard-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin: auto;
  animation: stageIn 0.4s var(--ease) both;
  position: relative;
  z-index: 2;
  flex: none;
}
.artboard {
  position: relative;
  background: #14161b;
  border-radius: 3px;
  box-shadow: var(--shadow);
  outline: 1px solid rgba(255,255,255,0.09);
  overflow: hidden;
  flex: none;
  transition: box-shadow 0.2s;
}
.artboard canvas { display: block; width: 100%; height: 100%; }
.app[data-step="place"] .artboard canvas { cursor: grab; touch-action: none; }
.app[data-step="place"] .artboard canvas:active { cursor: grabbing; }
.artboard-grid {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(97,240,173,0.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(97,240,173,0.28) 1px, transparent 1px);
  background-size: 25% 25%;
  box-shadow: inset 0 0 0 1px rgba(97,240,173,0.28);
}
.artboard-grid::after {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: rgba(97,240,173,0.45);
}
.artboard-grid::before {
  content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px;
  background: rgba(97,240,173,0.45);
}
.artboard.is-drawing { cursor: crosshair; }
.artboard.is-drawing canvas { cursor: crosshair; }

.artboard-caption {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted-2);
  font-size: 10px;
  padding: 2px 4px;
  max-width: 100%;
  white-space: nowrap;
}
.artboard-caption .mono { color: var(--muted); font-size: 10px; }
.caption-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.caption-right { margin-left: auto; }

.drop-overlay {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255, 92, 57, 0.14);
  border: 2px dashed var(--accent);
  color: #fff;
  text-align: center;
  z-index: 5;
  backdrop-filter: blur(2px);
}
.drop-overlay .ic { width: 30px; height: 30px; margin-bottom: 4px; }
.drop-overlay strong { font-size: 14px; }
.drop-overlay span { font-size: 11px; color: rgba(255,255,255,0.7); }
.app.is-dragging .drop-overlay { display: flex; }
.app.is-dragging .artboard { outline-color: var(--accent); }

.drop-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px;
  background: rgba(18,20,25,0.9);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 10.5px; color: var(--muted);
  backdrop-filter: blur(8px);
  z-index: 3;
  pointer-events: none;
}
.drop-hint .ic { width: 14px; height: 14px; }

@keyframes stageIn {
  from { opacity: 0; transform: translateY(8px) scale(0.992); }
  to { opacity: 1; transform: none; }
}

/* ============================================================ hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  width: min(100%, 1020px);
  max-height: 100%;
  padding: 10px 12px;
  margin: auto;
  position: relative;
  z-index: 2;
  animation: stageIn 0.5s var(--ease) both;
}
.hero-copy { max-width: 520px; }
.hero-copy h2 {
  margin: 14px 0 16px;
  font-size: clamp(34px, 4.3vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 650;
}
.hero-copy h2 .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.03em; color: var(--accent-2); }
.hero-copy p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
  max-width: 46ch;
}
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.hero-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 22px 0 0; }
.hero-trust li { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted-2); }
.hero-trust .ic { width: 12px; height: 12px; color: var(--mint); }

.hero-art {
  position: relative;
  height: min(52vh, 480px);
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}
.phone {
  position: absolute;
  width: clamp(128px, 15vw, 176px);
  aspect-ratio: 9 / 19;
  border-radius: 22px;
  background: #0b0c10;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 0 0 3px #16181e;
  padding: 5px;
  overflow: hidden;
}
.phone-screen {
  position: absolute; inset: 5px;
  border-radius: 17px;
  overflow: hidden;
}
.grad-a { background: linear-gradient(160deg, #201018, #0d0a10 65%); }
.grad-b { background: linear-gradient(160deg, #203042, #0c1118 70%); }
.grad-c { background: linear-gradient(160deg, #3c2410, #120c08 70%); }
.phone-back { transform: translateX(-58%) translateY(6%) rotate(-11deg) scale(0.88); opacity: 0.55; filter: blur(0.4px); }
.phone-mid { transform: translateX(56%) translateY(3%) rotate(9deg) scale(0.92); opacity: 0.72; }
.phone-front {
  transform: translateY(-2%) rotate(-1.5deg);
  z-index: 3;
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(-2%) rotate(-1.5deg); }
  50% { transform: translateY(-5%) rotate(-0.6deg); }
}
.art-kicker { position: absolute; top: 11%; left: 10%; font-size: 5.5px; letter-spacing: 0.2em; color: rgba(255,255,255,0.5); font-weight: 700; }
.art-head {
  position: absolute; left: 9%; top: 22%;
  font-size: clamp(13px, 1.6vw, 19px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #f6efe4;
}
.art-head i { color: #ff5c39; font-style: normal; }
.art-cta {
  position: absolute; left: 9%; bottom: 20%;
  background: #ff5c39; color: #170d09;
  font-size: 5.5px; font-weight: 800; letter-spacing: 0.04em;
  padding: 6px 8px; border-radius: 1px;
}
.ui-bar {
  position: absolute; left: 8%; right: 8%; height: 2.5px; border-radius: 2px;
  background: rgba(255,255,255,0.32);
}
.ui-bar.top { top: 7.5%; background: linear-gradient(90deg, rgba(255,255,255,0.7) 45%, rgba(255,255,255,0.2) 45%); }
.ui-rail { position: absolute; right: 7%; bottom: 26%; display: flex; flex-direction: column; gap: 8px; }
.ui-rail i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.55); display: block; }
.ui-caption {
  position: absolute; left: 8%; bottom: 13.5%; width: 46%; height: 14px;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.55) 0 2px, transparent 2px 5px);
  opacity: 0.6;
}
.ui-pill {
  position: absolute; left: 8%; right: 8%; bottom: 5%;
  height: 17px; border-radius: 9px;
  background: rgba(255,255,255,0.9);
  opacity: 0.9;
}
.safe-line {
  position: absolute; inset: 12% 6% 14% 6%;
  border: 1px dashed rgba(97,240,173,0.75);
  border-radius: 6px;
  box-shadow: 0 0 0 999px rgba(5,8,10,0.28);
}
.hero-badge {
  position: absolute; right: 2%; bottom: 4%;
  display: flex; align-items: center; gap: 9px;
  background: rgba(18,20,25,0.92);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 9px 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  z-index: 4;
}
.hero-badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(97,240,173,0.13); }
.hero-badge div { display: flex; flex-direction: column; gap: 1px; }
.hero-badge strong { font-size: 10.5px; font-weight: 600; }
.hero-badge em { font-style: normal; font-size: 9px; color: var(--muted-2); }

/* ============================================================ strip */

.strip {
  flex: none;
  height: 138px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  display: flex;
  min-width: 0;
}
.strip-label {
  flex: none;
  width: 92px;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
}
.strip-actions { display: flex; flex-direction: column; gap: 4px; }
.strip-actions .mini-btn { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; }
.strip-actions .ic { width: 10px; height: 10px; }
.strip-track {
  display: flex; align-items: stretch;
  gap: 7px;
  padding: 10px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  min-width: 0;
  flex: 1;
}
.pcard {
  flex: none;
  width: 98px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 9px;
  padding: 6px;
  display: flex; flex-direction: column; gap: 4px;
  text-align: left;
  color: var(--muted);
  transition: all 0.15s var(--ease);
  position: relative;
}
.pcard:hover { border-color: var(--line-2); background: var(--panel-2); }
.pcard.is-active { border-color: rgba(255,92,57,0.55); background: rgba(255,92,57,0.055); color: var(--ink); box-shadow: 0 0 0 1px rgba(255,92,57,0.12); }
.pcard.is-off { opacity: 0.45; }
.pcard-img {
  height: 62px;
  border-radius: 5px;
  background: #0a0b0e;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
}
.pcard-img canvas { max-width: 100%; max-height: 100%; display: block; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.pcard-img .ph {
  width: 28px; height: 28px; border-radius: 5px;
  border: 1px dashed rgba(255,255,255,0.16);
  display: grid; place-items: center;
  color: var(--muted-2);
}
.pcard-img .ph svg { width: 13px; height: 13px; }
.pcard-name { font-size: 9.5px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-sub { font-family: var(--mono); font-size: 8px; color: var(--muted-2); display: flex; align-items: center; gap: 4px; }
.pcard-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.pcard-dot[data-level="pass"] { background: var(--mint); }
.pcard-dot[data-level="warn"] { background: var(--warn); }
.pcard-dot[data-level="fail"] { background: var(--danger); }
.pcard-check {
  position: absolute; top: 9px; right: 9px;
  width: 13px; height: 13px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(10,12,16,0.7);
  display: grid; place-items: center;
  z-index: 2;
}
.pcard-check svg { width: 9px; height: 9px; color: var(--mint-ink); opacity: 0; }
.pcard.is-included .pcard-check { background: var(--mint); border-color: var(--mint); }
.pcard.is-included .pcard-check svg { opacity: 1; }
.pcard-group { font-size: 7.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); font-weight: 650; }
.strip-empty { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 11px; white-space: nowrap; padding-right: 20px; }
.strip-empty .ic { width: 15px; height: 15px; }

/* ============================================================ inspector */

.insp-head {
  flex: none;
  height: 68px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.insp-head h2 { margin: 2px 0 0; font-size: 17px; font-weight: 600; letter-spacing: -0.03em; }
.insp-close { display: none; }
.insp-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 18px 18px 32px; }
.panel { animation: panelIn 0.24s var(--ease) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-lede { margin: 0 0 16px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.inline-note { font-size: 10px; line-height: 1.55; color: var(--muted-2); margin-top: 8px; }

/* drop card */
.drop-card {
  border: 1px dashed rgba(255,255,255,0.17);
  border-radius: 12px;
  padding: 22px 16px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
  background:
    radial-gradient(240px 120px at 50% 0%, rgba(255,92,57,0.07), transparent 70%),
    rgba(255,255,255,0.012);
  transition: border-color 0.16s, background 0.16s;
}
.drop-card:hover { border-color: rgba(255,92,57,0.4); }
.drop-icon {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(255,92,57,0.1);
  border: 1px solid rgba(255,92,57,0.22);
  color: var(--accent-2);
  display: grid; place-items: center;
  margin-bottom: 6px;
}
.drop-icon .ic { width: 18px; height: 18px; }
.drop-card strong { font-size: 12.5px; font-weight: 600; }
.drop-card em { font-style: normal; font-size: 10px; color: var(--muted-2); margin-bottom: 10px; }
.drop-card .link-btn { margin-top: 7px; }

.asset-card {
  display: flex; gap: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px;
  background: rgba(255,255,255,0.015);
}
.asset-thumb { position: relative; width: 62px; height: 62px; border-radius: 7px; overflow: hidden; background: var(--panel-3); flex: none; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-badge { position: absolute; left: 4px; bottom: 4px; background: rgba(8,10,14,0.8); border-radius: 3px; font-family: var(--mono); font-size: 7px; padding: 2px 4px; color: var(--ink-2); }
.asset-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; justify-content: center; }
.asset-info strong { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-info em { font-style: normal; font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); }
.asset-actions { display: flex; gap: 5px; margin-top: 4px; }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field > span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 650; color: var(--muted-2); }
.field input {
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 0 10px;
  font-size: 12px;
  color: var(--ink);
  min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:hover { border-color: var(--line-2); }
.field input:focus { outline: none; border-color: rgba(255,92,57,0.55); box-shadow: 0 0 0 3px rgba(255,92,57,0.09); }
.field input::placeholder { color: var(--muted-2); }
.field input.mono { font-family: var(--mono); font-size: 10.5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.color-wrap { position: relative; display: flex; align-items: center; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); padding: 0 9px; gap: 8px; }
.color-wrap input[type="color"] { width: 20px; height: 20px; padding: 0; border: 0; background: none; border-radius: 5px; overflow: hidden; cursor: pointer; }
.color-wrap input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-wrap input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-wrap em { font-style: normal; font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.color-field .color-wrap { margin-top: 0; }
.logo-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 12px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.02); }
.logo-preview img { max-height: 34px; max-width: 150px; object-fit: contain; }

.tip-card {
  display: flex; gap: 9px;
  margin-top: 16px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,0.016);
}
.tip-dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--warn); margin-top: 5px; box-shadow: 0 0 0 3px rgba(255,176,32,0.1); }
.tip-card p { margin: 0; font-size: 10px; line-height: 1.6; color: var(--muted); }
.tip-card strong { color: var(--ink-2); font-weight: 600; }

/* zones */
.zone-actions { display: flex; gap: 7px; }
.zone-actions .btn:first-child { flex: 1; }
.preset-menu {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  margin-top: 6px; padding: 5px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2);
  animation: panelIn 0.15s var(--ease);
}
.preset-menu button {
  text-align: left; border: 0; background: transparent; color: var(--muted);
  font-size: 10.5px; padding: 7px 8px; border-radius: 6px;
}
.preset-menu button:hover { background: rgba(255,255,255,0.05); color: var(--ink); }
.zone-list { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.zone-row {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(255,255,255,0.014);
  transition: all 0.14s;
}
.zone-row:hover { border-color: var(--line-2); }
.zone-row.is-selected { border-color: rgba(255,92,57,0.45); background: rgba(255,92,57,0.05); }
.zone-grip { color: var(--muted-2); display: grid; place-items: center; width: 13px; cursor: grab; }
.zone-grip svg { width: 11px; height: 11px; }
.zone-kind { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 8px; font-weight: 700; letter-spacing: 0.02em; flex: none; }
.zone-kind[data-kind="logo"] { background: rgba(120,166,255,0.12); color: var(--blue); }
.zone-kind[data-kind="text"] { background: rgba(255,92,57,0.12); color: var(--accent-2); }
.zone-kind[data-kind="other"] { background: rgba(255,255,255,0.06); color: var(--muted); }
.zone-row input {
  border: 0; background: none; color: var(--ink-2); font-size: 11.5px; font-weight: 550;
  width: 100%; min-width: 0; padding: 2px 0;
}
.zone-row input:focus { outline: none; color: var(--ink); }
.zone-pct { font-family: var(--mono); font-size: 8.5px; color: var(--muted-2); flex: none; }
.zone-del { border: 0; background: none; color: var(--muted-2); padding: 2px; display: grid; place-items: center; opacity: 0; transition: opacity 0.14s; }
.zone-row:hover .zone-del { opacity: 1; }
.zone-del:hover { color: var(--danger); }
.zone-del svg { width: 11px; height: 11px; }

.empty-inline {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 24px 12px;
}
.empty-inline.is-hidden { display: none; }
.empty-icon { width: 34px; height: 34px; border-radius: 9px; border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--muted-2); margin-bottom: 5px; }
.empty-inline strong { font-size: 11.5px; font-weight: 600; }
.empty-inline em { font-style: normal; font-size: 10px; color: var(--muted-2); max-width: 28ch; line-height: 1.5; }

/* selected card + controls */
.selected-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  background: linear-gradient(150deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012));
  display: flex; flex-direction: column; gap: 3px;
  margin-bottom: 16px;
}
.selected-top { display: flex; align-items: center; gap: 6px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 650; margin-bottom: 2px; }
.platform-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.selected-card .status-pill { margin-left: auto; }
.selected-card strong { font-size: 16px; font-weight: 600; letter-spacing: -0.025em; }
.selected-card em { font-style: normal; color: var(--muted-2); font-size: 10px; }

.control-group { margin-bottom: 18px; }
.group-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 650; color: var(--muted-2); }
.group-label .mono { text-transform: none; letter-spacing: 0; font-size: 9px; }
.label-actions { display: flex; align-items: center; gap: 9px; }
.label-actions .link-btn { font-size: 9.5px; }

.move-tip {
  display: flex; align-items: center; gap: 9px;
  margin-top: 12px; padding: 8px 9px;
  border: 1px dashed rgba(97,240,173,0.24);
  border-radius: 8px;
  background: rgba(97,240,173,0.035);
}
.move-glyph { flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--mint); background: rgba(97,240,173,0.09); }
.move-glyph .ic { width: 13px; height: 13px; }
.move-tip span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.move-tip strong { font-size: 10px; font-weight: 600; color: var(--ink-2); }
.move-tip em { font-style: normal; font-size: 9px; line-height: 1.45; color: var(--muted-2); }

.size-mini-list { display: flex; flex-wrap: wrap; gap: 4px; }
.size-mini-empty { font-size: 9.5px; line-height: 1.55; color: var(--muted-2); padding: 8px 9px; border: 1px dashed var(--line); border-radius: 7px; }
.size-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-width: 66px; max-width: 100%;
  padding: 6px 8px; border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
  color: var(--muted);
  text-align: left;
}
.size-chip:hover { border-color: var(--line-2); color: var(--ink-2); }
.size-chip.is-active { border-color: rgba(201,167,255,0.5); background: rgba(201,167,255,0.08); color: var(--ink); }
.size-chip .mono { font-size: 8.5px; color: var(--muted-2); }
.size-chip em { font-style: normal; font-size: 9px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.segmented {
  display: flex; gap: 2px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
}
.segmented button {
  flex: 1;
  height: 29px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--muted);
  font-size: 10.5px; font-weight: 600;
  transition: all 0.14s;
}
.segmented button:hover { color: var(--ink-2); }
.segmented button.is-on { background: var(--panel-3); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05); }

.slider-row { margin-top: 13px; }
.slider-row label { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.slider-row label .mono { color: var(--ink-2); font-size: 9.5px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 16px; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,92,57,0.65), rgba(255,255,255,0.13));
}
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(255,255,255,0.15); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--panel);
  margin-top: -4.5px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4);
}
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); border: 2px solid var(--panel); }

.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.check-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  background: transparent;
}
.check-row:hover { background: rgba(255,255,255,0.02); }
.check-icon { flex: none; margin-top: 1px; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; }
.check-icon svg { width: 10px; height: 10px; }
.check-row[data-level="pass"] .check-icon { color: var(--mint); background: rgba(97,240,173,0.1); }
.check-row[data-level="warn"] .check-icon { color: var(--warn); background: rgba(255,176,32,0.1); }
.check-row[data-level="fail"] .check-icon { color: var(--danger); background: rgba(255,87,87,0.1); }
.check-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.check-text strong { font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.check-text em { font-style: normal; font-size: 9.5px; color: var(--muted-2); line-height: 1.4; }

.spec-note { font-size: 10px; line-height: 1.55; color: var(--muted); }
.spec-safe {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted-2);
  line-height: 1.7;
  background: rgba(0,0,0,0.16);
}
.spec-safe b { color: var(--ink-2); font-weight: 500; }

.check-grid { display: flex; flex-direction: column; gap: 2px; max-height: 232px; overflow-y: auto; padding-right: 2px; }
.cg-platform { font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); font-weight: 650; padding: 8px 4px 3px; }
.cg-row {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 4px;
  border-radius: 5px;
  font-size: 10.5px;
  color: var(--muted);
  cursor: pointer;
}
.cg-row:hover { background: rgba(255,255,255,0.03); color: var(--ink-2); }
.cg-row.is-selected { background: rgba(255,92,57,0.06); color: var(--ink); }
.cg-box { width: 13px; height: 13px; border-radius: 4px; border: 1px solid var(--line-2); display: grid; place-items: center; flex: none; padding: 0; background: transparent; }
.cg-box svg { width: 9px; height: 9px; color: var(--mint-ink); opacity: 0; }
.cg-row.is-included .cg-box { background: var(--mint); border-color: var(--mint); }
.cg-row.is-included .cg-box svg { opacity: 1; }
.cg-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-dim { font-family: var(--mono); font-size: 8.5px; color: var(--muted-2); }
.cg-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); flex: none; }
.cg-dot[data-level="pass"] { background: var(--mint); }
.cg-dot[data-level="warn"] { background: var(--warn); }
.cg-dot[data-level="fail"] { background: var(--danger); }

/* export panel */
.export-summary {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(97,240,173,0.055), rgba(255,255,255,0.012));
  border-radius: 11px;
  padding: 13px 15px;
  margin-bottom: 16px;
}
.sum-big { display: flex; align-items: baseline; gap: 6px; }
.sum-big strong { font-size: 30px; font-weight: 650; letter-spacing: -0.05em; line-height: 1; }
.sum-big span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.sum-small { text-align: right; font-size: 9.5px; color: var(--muted-2); line-height: 1.7; }
.sum-small b { color: var(--ink-2); font-weight: 600; }

.pack-row { display: flex; flex-wrap: wrap; gap: 4px; }
.pack-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: transparent;
  border-radius: 20px; padding: 4px 8px;
  font-size: 9.5px; font-weight: 600; color: var(--muted);
  transition: all 0.14s;
}
.pack-chip:hover { color: var(--ink); border-color: var(--line-2); background: rgba(255,255,255,0.03); }
.pack-chip em { font-style: normal; font-family: var(--mono); font-size: 8px; color: var(--muted-2); background: rgba(255,255,255,0.05); border-radius: 8px; padding: 1px 4px; }

.token-row { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 16px; }
.token {
  border: 1px solid var(--line); background: transparent;
  border-radius: 5px; padding: 3px 6px;
  font-family: var(--mono); font-size: 8.5px; color: var(--muted-2);
}
.token:hover { border-color: var(--line-2); color: var(--ink-2); }

.switch-list { display: flex; flex-direction: column; gap: 1px; margin-bottom: 16px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; cursor: pointer; }
.switch-row span { display: flex; flex-direction: column; gap: 2px; }
.switch-row strong { font-size: 11px; font-weight: 550; color: var(--ink-2); }
.switch-row em { font-style: normal; font-size: 9.5px; color: var(--muted-2); }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i {
  flex: none; width: 30px; height: 17px; border-radius: 20px;
  background: rgba(255,255,255,0.1);
  position: relative; transition: background 0.16s;
}
.switch-row i::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--muted); transition: transform 0.16s var(--ease), background 0.16s;
}
.switch-row input:checked + i { background: rgba(97,240,173,0.25); }
.switch-row input:checked + i::after { transform: translateX(13px); background: var(--mint); }
.switch-row input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.plan-card {
  display: flex; align-items: flex-start; gap: 9px;
  border: 1px solid rgba(255,176,32,0.2);
  background: rgba(255,176,32,0.055);
  border-radius: 9px;
  padding: 10px;
  margin-bottom: 12px;
}
.plan-card.is-licensed { border-color: rgba(97,240,173,0.2); background: rgba(97,240,173,0.045); }
.plan-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-top: 4px; flex: none; }
.plan-card.is-licensed .plan-dot { background: var(--mint); }
.plan-card div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-card strong { font-size: 10.5px; font-weight: 600; }
.plan-card em { font-style: normal; font-size: 9.5px; color: var(--muted); line-height: 1.5; }
.plan-card .link-btn { margin-left: auto; flex: none; font-size: 9.5px; }
.fineprint { margin: 9px 2px 0; font-size: 9px; line-height: 1.55; color: var(--muted-2); text-align: center; }
.fineprint.left { text-align: left; }

/* ============================================================ modals */

.modal {
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  border-radius: 16px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: min(88dvh, 780px);
  box-shadow: 0 40px 120px rgba(0,0,0,0.8), 0 0 0 1px rgba(0,0,0,0.4);
  overflow: hidden;
}
.modal.wide { width: min(880px, calc(100vw - 32px)); }
.modal[open] { display: flex; flex-direction: column; animation: modalIn 0.22s var(--ease); }
.modal::backdrop { background: rgba(4,5,7,0.72); backdrop-filter: blur(5px); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.modal-head h2 { margin: 5px 0 0; font-size: 21px; letter-spacing: -0.035em; font-weight: 600; }
.modal-head h2 span { color: var(--accent-2); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-lede { margin: 0 0 16px; font-size: 11.5px; line-height: 1.65; color: var(--muted); }
.modal-lede strong { color: var(--ink-2); font-weight: 600; }

.size-form { display: flex; flex-direction: column; gap: 11px; }
.size-unit-row { display: flex; align-items: center; gap: 9px; }
.size-unit-label { flex: none; font-size: 9px; letter-spacing: 0.11em; text-transform: uppercase; font-weight: 650; color: var(--muted-2); }
.size-units { flex: 1; }
.size-units button { font-size: 9.5px; padding: 0 4px; }
.size-dim-row { display: flex; align-items: flex-end; gap: 9px; }
.size-dim-row .field { flex: 1; min-width: 0; }
.size-by { color: var(--muted-2); font-size: 15px; padding-bottom: 12px; }
.size-swap {
  flex: none; width: 30px; height: 38px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-soft); color: var(--muted);
  display: grid; place-items: center;
  font-size: 14px; line-height: 1;
  transition: all 0.14s;
}
.size-swap:hover { color: var(--ink); border-color: var(--line-2); background: var(--panel-3); }
.size-swap:active { transform: scale(0.94); }
.size-unit-tag { font-style: normal; font-weight: 500; color: var(--muted-2); margin-left: 2px; }
.size-dpi-row { display: flex; align-items: flex-end; gap: 10px; }
.size-dpi-row .field { flex: 1; }
.size-dpi-row[hidden] { display: none; }
.size-convert {
  flex: 1; min-width: 0;
  align-self: center; padding-top: 14px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 9.5px; color: var(--mint, #61f0ad);
  letter-spacing: 0.01em;
}
.size-bottom-row { display: flex; align-items: flex-end; gap: 11px; }
.size-bottom-row .field { flex: 1; }
.field select {
  height: 38px; width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--ink-2);
  padding: 0 10px;
  font-size: 11.5px;
}
.field select:focus { outline: none; border-color: rgba(255,92,57,0.55); box-shadow: 0 0 0 3px rgba(255,92,57,0.09); }
.size-warn {
  border: 1px solid rgba(255,176,32,0.24);
  background: rgba(255,176,32,0.06);
  color: var(--warn);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.55;
}
.size-warn[hidden] { display: none; }
.size-library-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 8px;
  font-size: 9px; letter-spacing: 0.11em; text-transform: uppercase;
  font-weight: 650; color: var(--muted-2);
}
.size-library { display: flex; flex-direction: column; gap: 4px; }
.size-row {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(255,255,255,0.014);
}
.size-row.is-selected { border-color: rgba(201,167,255,0.45); background: rgba(201,167,255,0.05); }
.size-dim { flex: none; min-width: 66px; font-size: 9px; color: var(--muted-2); }
.size-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.size-info strong { font-size: 11px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.size-info em { font-style: normal; font-size: 9px; color: var(--muted-2); }
.size-row .mini-btn { flex: none; }
.size-del { flex: none; border: 0; background: none; color: var(--muted-2); display: grid; place-items: center; padding: 2px; }
.size-del:hover { color: var(--danger); }
.size-del .ic { width: 11px; height: 11px; }
.modal-foot {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.16);
  font-size: 10px; color: var(--muted-2);
}
.foot-actions { display: flex; gap: 8px; }

.install-steps {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.install-steps li {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 10px; background: rgba(255,255,255,0.014);
}
.install-steps li > span {
  flex: none; font-family: var(--mono); font-size: 9px; color: var(--accent);
  padding-top: 2px; letter-spacing: 0.04em;
}
.install-steps strong { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.install-steps p { margin: 2px 0 0; font-size: 10px; line-height: 1.5; color: var(--muted); }
.is-installed #installApp { display: none !important; }
.is-installed [data-install] { display: none !important; }

/* spec table */
.spec-table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 46vh; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.spec-table th {
  text-align: left; font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted-2); font-weight: 650;
  padding: 9px 11px; background: var(--panel-2);
  position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid var(--line);
}
.spec-table td { padding: 8px 11px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--muted); }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table tr:hover td { background: rgba(255,255,255,0.02); }
.spec-table td:first-child { color: var(--ink-2); font-weight: 550; }
.spec-table .mono { font-size: 9.5px; }
.spec-table .plat { display: inline-flex; align-items: center; gap: 5px; }
.spec-table .plat i { width: 5px; height: 5px; border-radius: 50%; }

/* project list */
.project-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.project-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  cursor: pointer;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: all 0.14s;
}
.project-item:hover { border-color: var(--line-2); background: rgba(255,255,255,0.02); }
.project-item.is-active { border-color: rgba(255,92,57,0.4); background: rgba(255,92,57,0.05); }
.project-thumb {
  width: 42px; height: 42px; border-radius: 6px; background: var(--panel-3);
  overflow: hidden; flex: none; display: grid; place-items: center; color: var(--muted-2);
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-thumb svg { width: 16px; height: 16px; }
.project-item div { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.project-item strong { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item em { font-style: normal; font-size: 9.5px; color: var(--muted-2); }
.project-del { color: var(--muted-2); border: 0; background: none; padding: 4px; display: grid; place-items: center; }
.project-del:hover { color: var(--danger); }
.project-del svg { width: 12px; height: 12px; }

/* licence */
.lic-state {
  display: flex; gap: 10px; align-items: center;
  border: 1px solid rgba(255,176,32,0.22);
  background: rgba(255,176,32,0.05);
  border-radius: 10px; padding: 12px; margin-bottom: 16px;
}
.lic-state.is-licensed { border-color: rgba(97,240,173,0.22); background: rgba(97,240,173,0.045); }
.lic-state > .ic { width: 18px; height: 18px; color: var(--warn); flex: none; }
.lic-state.is-licensed > .ic { color: var(--mint); }
.lic-state div { display: flex; flex-direction: column; gap: 2px; }
.lic-state strong { font-size: 11.5px; font-weight: 600; }
.lic-state em { font-style: normal; font-size: 10px; color: var(--muted); }
.lic-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; }
.lic-divider::before, .lic-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* export dialog */
.export-progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: 16px; }
.export-progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--warn)); border-radius: 4px; transition: width 0.25s var(--ease); }
.export-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 44vh; overflow-y: auto; }
.export-item { display: flex; align-items: center; gap: 9px; padding: 7px 4px; font-size: 10.5px; color: var(--muted); border-bottom: 1px solid rgba(255,255,255,0.035); }
.export-item:last-child { border-bottom: 0; }
.export-item .ei-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); flex: none; }
.export-item[data-state="working"] .ei-dot { background: var(--warn); animation: blink 1s infinite; }
.export-item[data-state="done"] .ei-dot { background: var(--mint); }
.export-item[data-state="error"] .ei-dot { background: var(--danger); }
@keyframes blink { 50% { opacity: 0.25; } }
.export-item .ei-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.export-item .ei-size { font-family: var(--mono); font-size: 9px; color: var(--muted-2); }
.export-item .ei-state { font-size: 9px; color: var(--muted-2); width: 52px; text-align: right; }

/* help */
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 18px; margin-bottom: 10px; }
.shortcut-grid div { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.shortcut-grid span { font-size: 10.5px; color: var(--muted); }
kbd {
  font-family: var(--mono); font-size: 9px; color: var(--ink-2);
  background: var(--panel-3); border: 1px solid var(--line-2);
  border-radius: 4px; padding: 3px 5px; min-width: 22px; text-align: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

/* toast */
.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: rgba(22,24,30,0.96);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 11px; color: var(--ink-2);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  animation: toastIn 0.22s var(--ease);
  max-width: min(90vw, 460px);
}
.toast .ic { width: 14px; height: 14px; color: var(--mint); }
.toast[data-type="warn"] .ic { color: var(--warn); }
.toast[data-type="error"] .ic { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* boot */
.boot {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  transition: opacity 0.4s, visibility 0.4s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot-mark { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(150deg, #ff6b47, #e23d1e); color: #1b0a06; display: grid; place-items: center; animation: bootPulse 1.4s ease-in-out infinite; }
.boot-mark svg { width: 30px; height: 30px; }
.boot-label { font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
@keyframes bootPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.94); } }

/* mobile bar */
.mobile-bar { display: none; }

/* ============================================================ responsive */

@media (max-width: 1280px) {
  .app { grid-template-columns: 218px minmax(0, 1fr) 330px; }
  .tool span { display: none; }
  .tool { padding: 7px 8px; }
}

@media (max-width: 1080px) {
  .app { grid-template-columns: 200px minmax(0, 1fr) 312px; }
  .stage-head { padding: 0 14px 0 18px; }
  .hero-art { height: 400px; }
  .save-state { display: none; }
  .brand-type em { display: none; }
}

@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); }
  .rail { display: none; }
  .stage { grid-column: 1; padding-bottom: 54px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .view-tools { margin-left: auto; }
  .inspector {
    position: fixed;
    top: 60px; right: 0; bottom: 0;
    width: min(380px, 92vw);
    transform: translateX(102%);
    transition: transform 0.28s var(--ease);
    box-shadow: -30px 0 80px rgba(0,0,0,0.6);
    border-left: 1px solid var(--line-2);
  }
  .app.panel-open .inspector { transform: none; }
  .insp-close { display: grid; }
  .mobile-bar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    height: 54px; z-index: 45;
    background: rgba(14,16,20,0.96);
    border-top: 1px solid var(--line-2);
    backdrop-filter: blur(12px);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-bar button {
    flex: 1; border: 0; background: none; color: var(--muted-2);
    font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
    border-top: 2px solid transparent;
  }
  .mobile-bar button.is-on { color: var(--ink); border-top-color: var(--accent); }
  .mobile-bar #mobilePanel { color: var(--accent-2); flex: 0.8; }
  .toast-wrap { bottom: 66px; }
  .modal { max-height: 80dvh; }
}

@media (max-width: 760px) {
  .topbar { height: 56px; }
  .brand-type { font-size: 15px; }
  .brand-mark { width: 30px; height: 30px; }
  .project-btn { max-width: 130px; font-size: 11.5px; }
  .project-switch .dot-live { display: none; }
  .view-tools { display: none; }
  .hide-sm { display: none !important; }
  .stage-head { height: 58px; padding: 0 12px; }
  .stage-title h1 { font-size: 13px; }
  .stage-title .eyebrow { font-size: 8px; }
  .zoom-group { display: none; }
  .dim { display: none; }
  .hero { grid-template-columns: 1fr; padding: 8px 4px; overflow-y: auto; align-items: start; }
  .hero-art { display: none; }
  .hero-copy h2 { font-size: 38px; margin: 10px 0 14px; }
  .hero-copy p { font-size: 12.5px; margin-bottom: 18px; }
  .hero-trust { margin-top: 16px; gap: 4px 12px; }
  .hero-trust li { font-size: 9.5px; }
  .viewport { padding: 12px; align-items: center; }
  .artboard { max-height: calc(100dvh - 250px); }
  .strip { height: 116px; }
  .strip-label { width: 70px; padding: 10px 8px; }
  .strip-label .eyebrow { font-size: 8px; }
  .strip-label .mini-btn { font-size: 8.5px; height: 20px; padding: 0 5px; }
  .strip-track { padding: 8px; gap: 6px; }
  .pcard { width: 86px; padding: 4px; }
  .pcard-img { height: 50px; }
  .pcard-name { font-size: 8.5px; }
  .pcard-sub { font-size: 7px; }
  .stage { padding-bottom: 50px; }
  .inspector { top: 56px; width: 100%; bottom: 50px; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 0; }
  .mobile-bar { height: 50px; }
  .drop-hint { display: none !important; }
  .artboard-caption { font-size: 9px; }
  .artboard-caption .mono { font-size: 9px; }
  .modal { width: calc(100vw - 20px) !important; max-height: 86dvh; border-radius: 14px; }
  .modal-head { padding: 16px 16px 13px; }
  .modal-head h2 { font-size: 18px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 11px 16px; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .export-summary { padding: 11px 12px; }
  .sum-big strong { font-size: 26px; }
  .spec-table th:nth-child(5), .spec-table td:nth-child(5) { display: none; }
  .hero-copy h2 { font-size: 34px; }
}

@media (max-width: 420px) {
  .top-actions .btn.primary span { display: none; }
  .top-actions .btn.primary { padding: 0 12px; }
  .project-btn { max-width: 96px; }
  .hero-copy h2 { font-size: 30px; }
  .hero-actions .btn { flex: 1; }
}

@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;
  }
}

/* ============================================================ redeem page */

.redeem-body {
  overflow: auto;
  min-height: 100dvh;
  background:
    radial-gradient(700px 400px at 70% -10%, rgba(255,92,57,0.10), transparent 60%),
    radial-gradient(600px 500px at 10% 100%, rgba(97,240,173,0.05), transparent 60%),
    var(--bg);
}
.redeem {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.redeem-side {
  padding: 42px clamp(24px, 5vw, 72px);
  display: flex; flex-direction: column; gap: 26px;
  border-right: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.redeem-side::after {
  content: ""; position: absolute; width: 420px; height: 420px; right: -170px; bottom: -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,92,57,0.16), transparent 65%);
  pointer-events: none;
}
.redeem-main {
  display: flex; align-items: center; justify-content: center;
  padding: 42px 24px;
}
.redeem-card { width: min(430px, 100%); }
.redeem-headline {
  margin: 26px 0 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.0;
  letter-spacing: -0.05em;
  font-weight: 650;
}
.redeem-headline .serif { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent-2); letter-spacing: -0.03em; }
.redeem-sub { color: var(--muted); font-size: 13px; line-height: 1.7; max-width: 44ch; margin: 14px 0 0; }
.redeem-list { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; }
.redeem-list li { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.redeem-list .tick { width: 18px; height: 18px; border-radius: 50%; background: rgba(97,240,173,0.1); color: var(--mint); display: grid; place-items: center; flex: none; }
.redeem-list .tick svg { width: 10px; height: 10px; }
.redeem-steps { display: flex; gap: 14px; margin-top: auto; padding-top: 30px; }
.redeem-steps div { flex: 1; border-top: 1px solid var(--line-2); padding-top: 10px; }
.redeem-steps span { display: block; font-family: var(--mono); font-size: 9px; color: var(--accent-2); margin-bottom: 4px; }
.redeem-steps strong { font-size: 10.5px; font-weight: 550; color: var(--muted); }
.redeem-card .card-head { margin-bottom: 22px; }
.redeem-card h2 { margin: 7px 0 0; font-size: 24px; letter-spacing: -0.035em; font-weight: 600; }
.redeem-card .lead { color: var(--muted); font-size: 11.5px; line-height: 1.65; margin: 8px 0 0; }
.redeem-form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.redeem-form .field { margin: 0; }
.redeem-form .field input { height: 46px; font-size: 13px; }
.redeem-form .field input.code { font-family: var(--mono); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.redeem-status { display: none; align-items: flex-start; gap: 9px; padding: 11px; border-radius: 9px; font-size: 10.5px; line-height: 1.5; margin-top: 4px; }
.redeem-status.is-error { display: flex; background: rgba(255,87,87,0.08); border: 1px solid rgba(255,87,87,0.25); color: #ffb3b3; }
.redeem-status.is-ok { display: flex; background: rgba(97,240,173,0.07); border: 1px solid rgba(97,240,173,0.25); color: #b7ffdc; }
.redeem-status .ic { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.redeem-foot { margin-top: 18px; font-size: 9.5px; color: var(--muted-2); line-height: 1.6; text-align: center; }
.redeem-card .btn.xl { height: 46px; }
.redeem-success { display: none; text-align: center; padding: 22px 0; }
.redeem-success.is-on { display: block; animation: panelIn 0.35s var(--ease); }
.redeem-success .big-tick { width: 58px; height: 58px; border-radius: 50%; background: rgba(97,240,173,0.1); border: 1px solid rgba(97,240,173,0.3); color: var(--mint); display: grid; place-items: center; margin: 0 auto 16px; }
.redeem-success .big-tick svg { width: 26px; height: 26px; }
.redeem-success h3 { font-size: 20px; margin: 0 0 8px; letter-spacing: -0.03em; }
.redeem-success p { color: var(--muted); font-size: 11.5px; line-height: 1.6; margin: 0 0 18px; }
.redeem-code-box { border: 1px dashed var(--line-2); border-radius: 9px; padding: 11px; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-bottom: 16px; word-break: break-all; background: rgba(255,255,255,0.02); }
.redeem-badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 20px; padding: 5px 10px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
.redeem-badge i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); }
@media (max-width: 860px) {
  .redeem { grid-template-columns: 1fr; }
  .redeem-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 30px 22px; }
  .redeem-headline { font-size: 34px; }
  .redeem-list, .redeem-steps { display: none; }
  .redeem-main { padding: 26px 22px 40px; align-items: flex-start; }
  .redeem-card { width: 100%; }
}
