/* ==========================================================================
   DVP Campaign Engine — interface design system
   Screening-room dark · brass gold · ember accent · signal cyan
   Pink is reserved for crop-risk / platform-UI danger zones only.
   ========================================================================== */

:root {
  /* Surfaces */
  --ink: #070806;
  --ink-deep: #040504;
  --surface-0: rgba(13, 15, 13, .92);     /* page panels */
  --surface-1: rgba(20, 23, 20, .88);     /* nested panels */
  --surface-2: rgba(255, 255, 255, .04);  /* chips, items */
  --surface-input: rgba(0, 0, 0, .32);

  /* Lines */
  --hairline: rgba(255, 243, 216, .1);
  --hairline-strong: rgba(255, 243, 216, .18);
  --line-gold: rgba(216, 170, 69, .3);

  /* Ink */
  --cream: #fff3d8;
  --text: #f2ead8;
  --muted: #b4a68d;
  --quiet: #847a67;

  /* Brand */
  --gold: #d8aa45;
  --gold-hot: #f0c95c;
  --accent: #ff7338;
  --accent-soft: rgba(255, 115, 56, .12);
  --cyan: #53e7de;
  --cyan-soft: rgba(83, 231, 222, .1);

  /* Semantics */
  --ok: #6fd394;
  --warn: #f4a55a;
  --danger: #ff2d78;             /* crop / platform-UI zones only */

  /* System */
  --radius-s: 7px;
  --radius-m: 11px;
  --radius-l: 16px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .32);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .45), 0 22px 64px rgba(0, 0, 0, .42);
  --control-h: 38px;
  --speed: .16s;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --rail: 1180px;
  --rail-wide: 1400px;

  --font-ui: 'DM Sans', -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bebas Neue', 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --brand-accent: #d8aa45;
  --brand-text: #f7efe1;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60rem 38rem at 12% -10%, rgba(216, 170, 69, .14), transparent),
    radial-gradient(50rem 30rem at 96% -4%, rgba(255, 115, 56, .09), transparent),
    linear-gradient(180deg, #090b09 0%, #0b0e0c 44%, var(--ink-deep) 100%);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(216, 170, 69, .32); color: #fff; }

/* Thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(216, 170, 69, .35) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(216, 170, 69, .3); }
*::-webkit-scrollbar-thumb:hover { background: rgba(216, 170, 69, .5); }

/* Focus is always visible, never default-outlined */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -64px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-m);
  background: var(--gold);
  color: #100b02;
  font-weight: 700;
  text-decoration: none;
  transition: top var(--speed) var(--ease);
}
.skip-link:focus-visible { top: 16px; }

/* ==========================================================================
   Site chrome — header / footer
   ========================================================================== */

.container { max-width: var(--rail); margin: 0 auto; padding: 0 24px; position: relative; }

header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  background: rgba(7, 8, 6, .82);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.header-inner .brand { display: inline-flex; align-items: center; text-decoration: none; }
.header-inner .brand img { height: 32px; width: auto; display: block; }

.header-actions { display: flex; gap: 8px; }
.header-actions a {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
.header-actions a:hover { border-color: var(--line-gold); background: rgba(216, 170, 69, .1); color: var(--gold-hot); }
.header-actions a.primary { border-color: transparent; background: var(--gold); color: #100b02; }
.header-actions a.primary:hover { background: var(--gold-hot); color: #100b02; }

.ver-badge {
  padding: 3px 8px;
  border: 1px solid rgba(255, 115, 56, .25);
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

footer { margin-top: 56px; padding: 24px 0 28px; border-top: 1px solid var(--hairline); }
.fi { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.fc { color: var(--muted); font-family: var(--font-mono); font-size: .68rem; }
.flinks { display: flex; gap: 16px; flex-wrap: wrap; }
.flink { color: var(--accent); font-family: var(--font-mono); font-size: .68rem; text-decoration: none; }
.flink:hover { text-decoration: underline; }

.view-counter-row { display: flex; justify-content: center; margin-top: 18px; }
.view-counter { display: inline-flex; overflow: hidden; border-radius: 5px; font-family: var(--font-mono); font-size: 11px; }
.vc-label { padding: 3px 8px; background: #08090d; color: var(--muted); }
.vc-value { padding: 3px 8px; background: var(--accent); color: #fff; }

/* ==========================================================================
   Masthead
   ========================================================================== */

.tool-hero { padding: 30px 0 18px; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 400;
  line-height: .92;
  letter-spacing: .015em;
  text-transform: uppercase;
}

.hero-sub { max-width: 620px; margin: 10px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

.hero-side { display: grid; gap: 8px; justify-items: end; padding-bottom: 4px; }

.app-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.app-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--quiet); transition: background var(--speed) var(--ease); }
.app-status.is-saved .app-status-dot { background: var(--ok); box-shadow: 0 0 8px rgba(111, 211, 148, .6); }
.app-status.is-saving .app-status-dot { background: var(--gold); }

.hero-kbd-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.hero-kbd-btn:hover { color: var(--cream); border-color: var(--line-gold); }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 1px solid var(--hairline-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
}

/* ==========================================================================
   Stepper — the signature rail (Plan / Create / Refine / Ship)
   ========================================================================== */

.tabs {
  position: sticky;
  top: 57px;
  z-index: 50;
  display: flex;
  gap: 10px;
  max-width: var(--rail);
  margin: 6px auto 18px;
  padding: 10px 24px;
  overflow-x: auto;
  background: linear-gradient(180deg, rgba(7, 8, 6, .94), rgba(7, 8, 6, .78));
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

.tab-group {
  display: grid;
  gap: 5px;
  padding: 7px 8px 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  background: var(--surface-2);
}

.tab-group-label {
  padding-left: 6px;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.tab-group-buttons { display: flex; gap: 5px; }

.tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.tab-num {
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  transition: color var(--speed) var(--ease);
}

.tab-name { color: inherit; }

.tab-btn:hover { background: rgba(255, 243, 216, .06); color: var(--cream); }
.tab-btn:hover .tab-num { color: var(--gold); }

.tab-btn.active {
  border-color: rgba(216, 170, 69, .55);
  background: linear-gradient(180deg, rgba(216, 170, 69, .22), rgba(216, 170, 69, .1));
  color: var(--cream);
  box-shadow: inset 0 1px 0 rgba(255, 243, 216, .14);
}
.tab-btn.active .tab-num { color: var(--gold-hot); }

/* readiness tick set by the UI layer */
.tab-btn[data-ready="true"] .tab-num::after {
  content: "✓";
  margin-left: 4px;
  color: var(--ok);
}

/* ==========================================================================
   Status deck — summary + readiness
   ========================================================================== */

.summary-bar, .readiness-bar { max-width: var(--rail); margin: 0 auto 10px; padding: 0 24px; }
.readiness-bar { margin-bottom: 22px; }

.summary-inner, .readiness-inner {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  background: var(--surface-0);
  box-shadow: var(--shadow-1);
}
.summary-inner { grid-template-columns: repeat(6, 1fr); }
.readiness-inner { grid-template-columns: repeat(4, 1fr); }

.summary-item, .readiness-item {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-m);
  background: var(--surface-2);
}

.summary-item strong, .readiness-item strong {
  display: block;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.summary-item span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--cream);
  font-size: 12.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.readiness-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }

.readiness-item { transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease); }
.readiness-item.ready { border-color: rgba(111, 211, 148, .35); background: rgba(111, 211, 148, .07); }
.readiness-item.ready strong { color: var(--ok); }
.readiness-item.ready span { color: var(--text); }
.readiness-item.warning { border-color: rgba(244, 165, 90, .3); background: rgba(244, 165, 90, .055); }
.readiness-item.warning strong { color: var(--warn); }

/* ==========================================================================
   Stages
   ========================================================================== */

.stage { display: none; }
.stage.active { display: block; animation: stageIn .3s var(--ease) both; }

@keyframes stageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-label {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--rail);
  margin: 26px auto 14px;
  padding: 0 24px;
}
.stage-step {
  margin: 0 0 5px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.section-label h2 {
  margin: 0;
  color: var(--cream);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .01em;
}
.section-label > p { max-width: 420px; margin: 0; color: var(--quiet); font-size: 12px; line-height: 1.5; text-align: right; }

.help-card { max-width: var(--rail); margin: 0 auto 14px; padding: 0 24px; }
.help-card-inner {
  display: grid;
  gap: 6px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 115, 56, .22);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-m);
  background: linear-gradient(180deg, rgba(255, 115, 56, .07), rgba(255, 115, 56, .025));
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
}
.help-card-inner strong { color: var(--accent); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }

.helper-copy { max-width: var(--rail); margin: 0 auto 16px; padding: 0 24px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.stage-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--rail);
  margin: 4px auto 36px;
  padding: 0 24px;
}

/* ==========================================================================
   Panels and form controls
   ========================================================================== */

.builder, .workshop, .export-panel, .campaign-check { margin: 0 auto 26px; padding: 0 24px; }
.builder, .export-panel, .campaign-check { max-width: var(--rail); }
.workshop { max-width: var(--rail-wide); }

.builder-inner,
.panel,
.edit-preview-card,
.vault-import-panel,
.export-actions,
.export-checklist,
.campaign-check-inner,
.copy-pack-panel,
.creative-tool-panel {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 56%), var(--surface-0);
  box-shadow: var(--shadow-1);
}

.builder-inner {
  display: grid;
  grid-template-columns: minmax(250px, 1.35fr) repeat(4, minmax(125px, .5fr));
  gap: 14px;
  align-items: end;
  padding: 18px;
}

.workshop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }

.panel { display: grid; gap: 13px; align-content: start; padding: 16px; }
.panel h2 {
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--hairline);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.field { display: grid; gap: 6px; min-width: 0; }
.field label {
  color: var(--quiet);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

select, input, textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: 8px 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-m);
  background: var(--surface-input);
  color: var(--cream);
  font: inherit;
  font-size: 13px;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease);
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23b4a68d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input[type="checkbox"] { width: 16px; min-height: 0; height: 16px; accent-color: var(--gold); cursor: pointer; }

select:hover, input:hover, textarea:hover { border-color: rgba(255, 243, 216, .26); }
select:focus, input:focus, textarea:focus,
select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--gold);
  background: rgba(0, 0, 0, .42);
  box-shadow: 0 0 0 3px rgba(216, 170, 69, .16);
}

::placeholder { color: var(--quiet); }

.format-readout {
  display: grid;
  align-items: center;
  min-height: var(--control-h);
  padding: 0 4px;
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .04em;
}

.toggle-row { display: flex; gap: 9px; align-items: center; min-height: var(--control-h); color: var(--muted); font-size: 12.5px; cursor: default; }

.hint { color: var(--quiet); font-size: 11.5px; line-height: 1.55; }
.hint.ok { color: var(--ok); font-weight: 600; }
.hint.warn { color: var(--warn); font-weight: 600; }
.warning { min-height: 18px; color: var(--warn); font-size: 11.5px; line-height: 1.4; }

/* ==========================================================================
   Buttons
   ========================================================================== */

button { font-family: var(--font-ui); }

.action-btn,
.stage-nav button,
.button-row button,
.mini-actions button,
.small-btn,
.project-actions button,
.copy-pack-actions button,
.creative-tool-actions button,
.check-fix,
.dl,
.footer button.card-jump {
  display: inline-grid;
  place-items: center;
  min-height: var(--control-h);
  padding: 0 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-m);
  background: var(--surface-2);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease),
              color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.action-btn:hover, .stage-nav button:hover, .button-row button:hover,
.mini-actions button:hover, .small-btn:hover, .project-actions button:hover,
.copy-pack-actions button:hover, .creative-tool-actions button:hover,
.check-fix:hover, .dl:hover, .footer button.card-jump:hover {
  border-color: var(--line-gold);
  background: rgba(216, 170, 69, .1);
  color: var(--gold-hot);
}

.action-btn:active, .stage-nav button:active, .small-btn:active { transform: translateY(1px); }

.action-btn, .stage-nav button.primary, .button-row .action-btn {
  width: 100%;
  border-color: transparent;
  background: var(--gold);
  color: #100b02;
  box-shadow: 0 1px 0 rgba(255, 243, 216, .25) inset, 0 6px 18px rgba(216, 170, 69, .18);
}
.action-btn:hover, .stage-nav button.primary:hover, .button-row .action-btn:hover {
  background: var(--gold-hot);
  color: #100b02;
}

.action-btn.ghost-btn {
  border-color: var(--hairline-strong);
  background: var(--surface-2);
  color: var(--gold);
  box-shadow: none;
}
.action-btn.ghost-btn:hover { border-color: var(--line-gold); background: rgba(216, 170, 69, .1); color: var(--gold-hot); }

.stage-nav button { min-width: 132px; width: auto; }
.stage-nav button.primary { min-width: 180px; }

.button-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mini-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-actions button { padding: 0 8px; font-size: 10px; }
.project-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.copy-pack-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.creative-tool-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }

/* ==========================================================================
   Quick Start + Template galleries
   ========================================================================== */

.choice-grid, .template-grid {
  display: grid;
  gap: 14px;
  max-width: var(--rail);
  margin: 0 auto 28px;
  padding: 0 24px;
}
.choice-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.template-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.choice-card, .template-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 56%), var(--surface-0);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.choice-card { min-height: 176px; display: grid; align-content: space-between; }

.choice-card:hover, .template-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-gold);
  box-shadow: var(--shadow-2);
}
.choice-card:active, .template-card:active { transform: translateY(0); }

.choice-art {
  position: relative;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-s);
  background:
    linear-gradient(135deg, rgba(216, 170, 69, .26), rgba(255, 115, 56, .08)),
    #060706;
}
.choice-art::before { content: ""; position: absolute; inset: 18% 12%; border: 1px dashed rgba(216, 170, 69, .65); border-radius: 3px; }
.choice-art.wide { height: 50px; }
.choice-art.tall { height: 92px; width: 56px; }

.choice-card strong, .template-card strong {
  display: block;
  margin-top: 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.template-card strong { margin-top: 0; }
.choice-card span, .template-card span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }

/* ==========================================================================
   AI Brain stage
   ========================================================================== */

.ai-brain-panel { border-color: rgba(255, 115, 56, .28); background: linear-gradient(180deg, rgba(255, 115, 56, .06), transparent 42%), var(--surface-0); }

.ai-provider-grid, .ai-cost-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.ai-provider-card, .ai-cost-card {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-m);
  background: var(--surface-2);
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.4;
}
.ai-provider-card strong, .ai-cost-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.ai-provider-card.is-live { border-color: rgba(255, 115, 56, .4); background: var(--accent-soft); color: var(--text); }
.ai-provider-card.is-live strong { color: var(--accent); }
.ai-cost-card { border-color: rgba(83, 231, 222, .16); background: var(--cyan-soft); }
.ai-cost-card strong { color: var(--cyan); }
.ai-cost-card.is-billed { border-color: rgba(255, 115, 56, .38); background: var(--accent-soft); }
.ai-cost-card.is-billed strong { color: var(--accent); }

.ai-key-grid { display: grid; gap: 8px; }
.ai-key-grid .byok-panel { padding: .75rem; }
.ai-key-grid .byok-help { display: none; }
.ai-key-grid .byok-label { margin-bottom: .4rem; }
.ai-key-grid .byok-input { min-width: 9rem; }

.handoff-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.handoff-steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-m);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.handoff-steps b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 115, 56, .4);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
}
.handoff-steps strong { display: block; color: var(--cream); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }

.slide-ai-panel { border-color: rgba(83, 231, 222, .22); background: linear-gradient(180deg, rgba(83, 231, 222, .05), transparent 42%), var(--surface-0); }
.slide-ai-panel h2 { color: var(--cyan); border-bottom-color: rgba(83, 231, 222, .14); }
.slide-ai-panel textarea[readonly] { min-height: 128px; color: var(--muted); }

.ai-preview-list { display: grid; gap: 7px; }
.ai-preview-item {
  padding: 9px 11px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-m);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}
.ai-preview-item strong { display: block; color: var(--cream); font-size: 11.5px; }
.ai-preview-item span { display: block; margin-top: 3px; color: var(--quiet); }

/* ==========================================================================
   Vault import
   ========================================================================== */

.vault-import-panel {
  display: grid;
  grid-template-columns: minmax(180px, .55fr) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  max-width: var(--rail);
  margin: 0 auto 16px;
  padding: 16px;
  border-color: rgba(83, 231, 222, .22);
}
.vault-import-panel h3 { margin: 0 0 6px; color: var(--cyan); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.vault-import-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.vault-import-panel textarea { min-height: 92px; }
.vault-import-panel .hint { grid-column: 2 / -1; }

/* ==========================================================================
   Edit stage — live preview + editor
   ========================================================================== */

.edit-preview-shell { max-width: var(--rail); margin: 0 auto 18px; padding: 0 24px; }
.edit-preview-card { display: grid; gap: 12px; justify-items: center; padding: 16px; }
.edit-preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.edit-preview-meta strong { margin-right: 10px; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.edit-preview-meta span { color: var(--muted); font-size: 12px; }
.active-preview { width: min(100%, 340px); }
.active-preview .card { border-color: rgba(216, 170, 69, .5); box-shadow: 0 0 0 1px rgba(216, 170, 69, .18), var(--shadow-2); }

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 60px;
  padding: 14px;
  border: 1px dashed rgba(216, 170, 69, .4);
  border-radius: var(--radius-m);
  background: rgba(216, 170, 69, .045);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), color var(--speed) var(--ease);
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging {
  border-color: var(--gold);
  background: rgba(216, 170, 69, .1);
  color: var(--cream);
}

.visually-hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.advanced-panel { padding-top: 10px; border-top: 1px solid var(--hairline); }
.advanced-panel summary {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.advanced-panel summary:hover { color: var(--gold-hot); }
.advanced-panel .field { margin-top: 12px; }
.advanced-panel button { margin-top: 10px; }

/* ==========================================================================
   Check stage + slide grid (live canvas)
   ========================================================================== */

.campaign-check-inner, .export-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  padding: 12px;
}
.export-checklist { margin-bottom: 14px; }

.check-item {
  padding: 11px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-m);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.check-item strong { display: block; margin-bottom: 4px; color: var(--cream); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.check-item.ready { border-color: rgba(111, 211, 148, .32); background: rgba(111, 211, 148, .06); }
.check-item.ready strong { color: var(--ok); }
.check-item.warning { border-color: rgba(244, 165, 90, .32); background: rgba(244, 165, 90, .055); }
.check-item.warning strong { color: var(--warn); }

.check-fix { display: none; width: 100%; margin-top: 9px; min-height: 30px; padding: 0 8px; font-size: 9.5px; }
.check-item.warning .check-fix, .check-fix.always { display: inline-grid; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  max-width: var(--rail-wide);
  margin: 0 auto;
  padding: 0 24px 48px;
}

.card {
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  background: var(--surface-0);
  box-shadow: var(--shadow-1);
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.card:hover { transform: translateY(-2px); border-color: var(--line-gold); box-shadow: var(--shadow-2); }
.card.active-card { border-color: rgba(216, 170, 69, .65); box-shadow: 0 0 0 1px rgba(216, 170, 69, .25), var(--shadow-2); }

.frame { position: relative; overflow: hidden; aspect-ratio: var(--preview-ratio, 9 / 16); background: #060706; }
.card img { display: block; width: 100%; height: 100%; object-fit: cover; }

.footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--hairline); background: rgba(0, 0, 0, .22); }
.label { overflow: hidden; color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.dl, .footer button.card-jump { min-height: 30px; padding: 0 11px; font-size: 10px; flex-shrink: 0; }
.footer button.card-jump { border-color: rgba(255, 115, 56, .32); color: var(--accent); }
.footer button.card-jump:hover { border-color: rgba(255, 115, 56, .55); background: var(--accent-soft); color: #ff8a52; }

/* Safe-area overlays (gold = safe, pink = danger). Drawn by the engine. */
.safe-overlay { position: absolute; inset: 0; display: block; pointer-events: none; z-index: 2; }
.safe-overlay[hidden] { display: none; }
.safe-edge, .safe-text, .safe-zone, .safe-cross-x, .safe-cross-y { position: absolute; box-sizing: border-box; }
.safe-edge { inset: 0; border: 1px solid rgba(255, 255, 255, .3); }
.safe-text { border: 1px dashed rgba(216, 170, 69, .9); background: rgba(216, 170, 69, .05); }
.safe-zone { border: 1px solid rgba(255, 45, 120, .85); background: rgba(255, 45, 120, .1); }
.safe-cross-x { top: 50%; right: 0; left: 0; border-top: 1px solid rgba(255, 255, 255, .15); }
.safe-cross-y { top: 0; bottom: 0; left: 50%; border-left: 1px solid rgba(255, 255, 255, .15); }
.safe-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border: 1px solid rgba(216, 170, 69, .45);
  border-radius: 4px;
  background: rgba(4, 5, 4, .76);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.safe-note {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: 72%;
  color: rgba(247, 239, 225, .76);
  font-size: 9px;
  line-height: 1.3;
  text-align: right;
  text-shadow: 0 1px 2px #040504;
}

/* Slide text layers (also baked into canvas exports) */
.text-layer {
  position: absolute;
  right: 8%;
  bottom: 10%;
  left: 8%;
  z-index: 3;
  display: grid;
  gap: .32em;
  color: var(--brand-text, #f7efe1);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .8);
  pointer-events: none;
}
.text-layer.top { top: 10%; bottom: auto; }
.text-layer.center { top: 50%; bottom: auto; transform: translateY(-50%); }
.text-layer.split { top: 9%; bottom: auto; max-width: 62%; }

.kicker {
  width: max-content;
  max-width: 100%;
  padding: .3em .55em;
  border: 1px solid var(--brand-accent, #d8aa45);
  border-radius: 4px;
  background: rgba(4, 5, 4, .64);
  color: var(--brand-accent, #d8aa45);
  font-size: clamp(9px, 2.5vw, 13px);
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.headline {
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(18px, 7vw, 48px);
  font-weight: 400;
  line-height: .94;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.deck { max-width: 34em; color: rgba(247, 239, 225, .86); font-size: clamp(10px, 3vw, 17px); line-height: 1.35; }
.cta-pill {
  width: max-content;
  max-width: 100%;
  margin-top: .3em;
  padding: .45em .7em;
  border-radius: 4px;
  background: var(--brand-accent, #d8aa45);
  color: #100b02;
  font-size: clamp(9px, 2.3vw, 12px);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.brand-mark {
  position: absolute;
  top: 6%;
  right: 7%;
  z-index: 3;
  width: clamp(54px, 13%, 86px);
  overflow: hidden;
  border-radius: 12px;
  pointer-events: none;
}
.brand-mark img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .55)); }

/* Platform preview badge (pink = simulated platform UI) */
.platform-preview .card { border-color: rgba(255, 45, 120, .4); }
.platform-preview .frame::after {
  content: attr(data-platform);
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 4;
  padding: 4px 7px;
  border: 1px solid rgba(255, 45, 120, .55);
  border-radius: 4px;
  background: rgba(4, 5, 4, .76);
  color: #ffb1cb;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  pointer-events: none;
}

/* ==========================================================================
   Export stage
   ========================================================================== */

.export-panel > .help-card-inner { margin-bottom: 14px; }

.export-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  padding: 14px;
}

.copy-pack-panel, .creative-tool-panel { display: grid; gap: 12px; margin-top: 14px; padding: 16px; }
.copy-pack-panel { border-color: rgba(255, 115, 56, .22); }
.creative-tool-panel { border-color: rgba(83, 231, 222, .2); }
.copy-pack-panel h3, .creative-tool-panel h3 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.copy-pack-panel h3 { color: var(--accent); }
.creative-tool-panel h3 { color: var(--cyan); }

.copy-pack-grid, .creative-tool-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; align-items: start; }
.copy-pack-grid textarea, .creative-tool-grid textarea { min-height: 150px; }

.creative-tool-actions button { color: var(--cyan); }
.creative-tool-actions button:hover { border-color: rgba(83, 231, 222, .4); background: var(--cyan-soft); color: #8df2ec; }
.copy-pack-actions button { color: var(--accent); }
.copy-pack-actions button:hover { border-color: rgba(255, 115, 56, .45); background: var(--accent-soft); color: #ff8a52; }

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-stack {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 300;
  display: grid;
  gap: 8px;
  justify-items: center;
  width: min(92vw, 460px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: rgba(22, 25, 22, .94);
  box-shadow: var(--shadow-2);
  color: var(--cream);
  font-size: 12.5px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: toastIn .26s var(--ease) both;
}
.toast::before { content: ""; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--gold); }
.toast.is-leaving { animation: toastOut .22s var(--ease) both; }
.toast--warn::before { background: var(--warn); box-shadow: 0 0 8px rgba(244, 165, 90, .55); }

@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ==========================================================================
   Shortcuts sheet
   ========================================================================== */

.kbd-sheet {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 5, 4, .62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.kbd-sheet[hidden] { display: none; }

.kbd-sheet-card {
  width: min(100%, 420px);
  padding: 20px 22px 18px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-l);
  background: var(--surface-1);
  box-shadow: var(--shadow-2);
  animation: stageIn .24s var(--ease) both;
}
.kbd-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.kbd-sheet-head h2 { margin: 0; color: var(--cream); font-size: 15px; font-weight: 700; }
.kbd-sheet-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.kbd-sheet-close:hover { color: var(--cream); border-color: var(--line-gold); }

.kbd-list { display: grid; gap: 9px; margin: 0; }
.kbd-list > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.kbd-list dt { display: flex; gap: 4px; margin: 0; }
.kbd-list dd { margin: 0; color: var(--muted); font-size: 12.5px; }
.kbd-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--hairline); color: var(--quiet); font-size: 11.5px; line-height: 1.55; }

/* ==========================================================================
   Motion preferences
   ========================================================================== */

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .summary-inner { grid-template-columns: repeat(3, 1fr); }
  .readiness-inner { grid-template-columns: repeat(2, 1fr); }
  .builder-inner { grid-template-columns: repeat(2, 1fr); }
  .builder-inner .field:first-child { grid-column: 1 / -1; }
  .vault-import-panel { grid-template-columns: 1fr; }
  .vault-import-panel .hint { grid-column: 1; }
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { justify-items: start; grid-auto-flow: column; align-items: center; }
  .section-label { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-label > p { max-width: none; text-align: left; }
  .tabs { top: 0; }
  header { position: static; }
  .copy-pack-grid, .creative-tool-grid { grid-template-columns: 1fr; }
  .workshop-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 13.5px; }
  .container, .summary-bar, .readiness-bar, .section-label, .help-card,
  .builder, .workshop, .export-panel, .campaign-check, .choice-grid,
  .template-grid, .grid, .stage-nav, .edit-preview-shell, .helper-copy,
  .vault-import-panel { padding-left: 16px; padding-right: 16px; }
  .tabs { padding: 8px 16px; }
  .summary-inner { grid-template-columns: 1fr 1fr; }
  .readiness-inner { grid-template-columns: 1fr; }
  .builder-inner { grid-template-columns: 1fr; padding: 14px; }
  .control-row, .project-actions, .button-row, .copy-pack-actions,
  .creative-tool-actions { grid-template-columns: 1fr; }
  .mini-actions { grid-template-columns: 1fr 1fr; }
  .ai-provider-grid, .ai-cost-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .stage-nav { flex-wrap: wrap; }
  .stage-nav button { flex: 1; min-width: 0; }
  .hero-kbd-btn { display: none; }
}
