/* video-maker: the look of the videos section of new-studio (frontend/video/src/styles/tokens.css
   and v5.css): one question per screen, borderless cards with a soft shadow, big rounded
   controls and a fixed bar at the bottom with the next action. Light by default; dark with the
   system or with <html data-theme="dark">. */

:root {
  color-scheme: light;
  --bg: #f7f7fa;
  --surface: #fff;
  --surface-2: #f1f0f6;
  --text: #16151d;
  --muted: #6b6880;
  --faint: #8b88a0;
  --line: #e7e5ef;
  --line-strong: #cfcbdc;
  --accent: #6d4aff;
  --accent-2: #ff5c8a;
  --accent-soft: #efeaff;
  --ok: #12a574;
  --warn: #e8930c;
  --warn-text: #b86e00;
  --warn-soft: #fff3df;
  --danger: #d93f5c;
  --danger-soft: #fdebef;
  --shadow: 0 1px 2px rgb(22 21 29 / 6%), 0 8px 24px rgb(22 21 29 / 7%);
  --shadow-up: 0 2px 4px rgb(22 21 29 / 8%), 0 18px 40px rgb(22 21 29 / 14%);
  --r: 18px;
  --top-h: 68px;
  --page-w: 1280px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0f0e14;
    --surface: #191822;
    --surface-2: #22202d;
    --text: #f3f2f8;
    --muted: #9f9bb4;
    --faint: #7c7893;
    --line: #2c2a39;
    --line-strong: #45425a;
    --accent: #8a6dff;
    --accent-soft: #2a2245;
    --warn-text: #f0b450;
    --warn-soft: #3a2c14;
    --danger: #ff7a93;
    --danger-soft: #3a1d27;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 35%);
    --shadow-up: 0 2px 4px rgb(0 0 0 / 50%), 0 18px 40px rgb(0 0 0 / 55%);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f0e14;
  --surface: #191822;
  --surface-2: #22202d;
  --text: #f3f2f8;
  --muted: #9f9bb4;
  --faint: #7c7893;
  --line: #2c2a39;
  --line-strong: #45425a;
  --accent: #8a6dff;
  --accent-soft: #2a2245;
  --warn-text: #f0b450;
  --warn-soft: #3a2c14;
  --danger: #ff7a93;
  --danger-soft: #3a1d27;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 35%);
  --shadow-up: 0 2px 4px rgb(0 0 0 / 50%), 0 18px 40px rgb(0 0 0 / 55%);
}

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

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 15px/1.5 var(--font); }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-16 { width: 16px; height: 16px; }
.icon-28 { width: 28px; height: 28px; }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--page-w); height: 100%; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.top-tabs { display: flex; gap: 4px; align-self: stretch; }
/* The active one: bold, its icon in the accent and a gradient line under it, intense in the centre. */
.top-tab { display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 16px; color: var(--muted); font-weight: 700; transition: color 0.15s ease-out; }
.top-tab:hover { color: var(--text); text-decoration: none; }
.top-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -6px; border-radius: 10px; }
.top-tab[aria-current='page'] { color: var(--text); font-weight: 800; background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent) bottom / 100% 2px no-repeat; }
.top-tab[aria-current='page'] svg { color: var(--accent); }

/* ---------- Page ---------- */
.page { max-width: var(--page-w); margin: 0 auto; padding: 32px 32px 140px; animation: in 0.25s ease; }
.h1 { font-size: 32px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; }
.ask { font-size: 30px; line-height: 1.2; letter-spacing: -0.025em; font-weight: 800; margin-bottom: 8px; }
.ask-sub { color: var(--muted); font-size: 16px; margin-bottom: 24px; max-width: 70ch; }
.head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.section-label { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 22px 0 10px; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 24px; border: 0; border-radius: 14px; font-weight: 700; font-size: 16px; color: var(--text); background: none; cursor: pointer; white-space: nowrap; transition: filter 0.12s, background 0.12s, box-shadow 0.12s; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); box-shadow: var(--shadow); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-big { height: 60px; padding: 0 34px; font-size: 17px; border-radius: 16px; }
.btn-sm { height: 42px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.icon-btn { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: none; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.btn .spinner { display: none; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .icon { display: none; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toggle pills */
.tg { height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--surface-2); font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tg:hover { color: var(--text); }
.tg[aria-pressed='true'], .tg[aria-checked='true'] { background: var(--accent-soft); color: var(--accent); }
.tgs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Wizard ---------- */
.wiz-head { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.progress { flex: 1; display: flex; gap: 8px; }
.progress span { flex: 1; height: 6px; border-radius: 99px; background: var(--line); transition: background 0.2s; }
.progress span.on { background: var(--accent); }
.wiz-step { animation: in 0.25s ease; }
.wiz-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--surface); border-top: 1px solid var(--line); }
.wiz-bar-in { max-width: var(--page-w); margin: 0 auto; padding: 14px 32px; display: flex; align-items: center; gap: 14px; }
.hint { color: var(--muted); font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint.bad { color: var(--danger); }

/* Big inputs */
.big-input { width: 100%; min-height: 150px; border-radius: 20px; border: 2px solid var(--line); background: var(--surface); padding: 20px 22px; font: 500 19px/1.5 var(--font); color: var(--text); resize: vertical; box-shadow: var(--shadow); }
.big-input:focus, .big-url:focus { outline: none; border-color: var(--accent); }
.big-url { width: 100%; height: 64px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); padding: 0 22px; font: 600 18px var(--font); color: var(--text); box-shadow: var(--shadow); }
.input, .select, .textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: 500 15px/1.4 var(--font); padding: 10px 14px; }
.input, .select { height: 46px; padding-top: 0; padding-bottom: 0; }
.textarea { resize: vertical; min-height: 64px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); }
.label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.field-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.color-pair { display: flex; gap: 8px; }
.color-pair input { width: 54px; height: 46px; padding: 4px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }

/* Choices */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.choice { position: relative; display: flex; align-items: center; gap: 18px; width: 100%; padding: 18px 22px; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); text-align: left; color: var(--text); cursor: pointer; outline: 3px solid transparent; transition: transform 0.15s, box-shadow 0.15s; }
.choice:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); }
.choice[aria-checked='true'] { outline-color: var(--accent); }
.choice .ic { width: 60px; height: 60px; flex: none; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.choice .name { display: block; font-weight: 800; font-size: 17px; }
.choice .sub { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.choice .check { position: absolute; right: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; }
.choice[aria-checked='true'] .check { display: grid; }

/* Drop zone of the reference */
.drop { display: flex; align-items: center; gap: 22px; min-height: 230px; padding: 24px; border-radius: 24px; border: 2px dashed var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.drop .plus { width: 64px; height: 64px; flex: none; border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.drop b { display: block; font-size: 19px; }
.drop small { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.drop video { width: 112px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 14px; background: #000; flex: none; }

/* Slots (person, logo) */
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 20px; }
.slot { position: relative; display: block; width: 100%; padding: 14px; border: 0; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); text-align: left; color: var(--text); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.slot:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); }
.slot-head { display: flex; align-items: center; gap: 10px; font-weight: 800; margin-bottom: 12px; }
.slot-head .ic { width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.slot-head .opt { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.slot-empty, .slot-body { aspect-ratio: 4 / 3; border-radius: 16px; }
.slot-empty { border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 700; }
.slot-empty .plus { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.slot:hover .slot-empty { border-color: var(--accent); color: var(--accent); }
.slot-body { display: block; position: relative; overflow: hidden; background: var(--surface-2) center / cover no-repeat; }
.slot-body.contain { background-size: contain; background-origin: content-box; padding: 18px; }
.slot-change { position: absolute; right: 10px; top: 10px; height: 34px; padding: 0 12px; border-radius: 10px; background: rgb(255 255 255 / 95%); color: #16151d; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

/* Summary line */
.summary { margin-top: 22px; display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); font-size: 16px; font-weight: 600; }
.summary .icon, .summary b { color: var(--accent); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.chip { min-height: 40px; padding: 6px 14px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); font-weight: 600; text-align: left; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.chip:hover { color: var(--accent); }

/* Notices */
.notice { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.notice.warn { background: var(--warn-soft); color: var(--warn-text); box-shadow: none; }
.notice.bad { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.notices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.error { color: var(--danger); font-weight: 600; font-size: 13px; }
.error:empty { display: none; }

/* ---------- Thumbs and video grid ---------- */
.thumb { position: relative; overflow: hidden; border-radius: var(--r); background: var(--surface-2); aspect-ratio: 9 / 16; }
.thumb > img, .thumb > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb > .bg { position: absolute; inset: -20%; background-size: 160% 160%; }
.thumb .state { position: absolute; left: 10px; top: 10px; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 99px; background: rgb(255 255 255 / 92%); color: #16151d; font-size: 12px; font-weight: 700; }
.thumb .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 46px 16px 14px; color: #fff; font-weight: 700; font-size: 16px; line-height: 1.3; background: linear-gradient(transparent, rgb(0 0 0 / 65%)); }
.thumb .label small { display: block; font-weight: 500; font-size: 13px; opacity: 0.85; }
.thumb .dur { position: absolute; right: 10px; bottom: 10px; padding: 3px 8px; border-radius: 8px; background: rgb(0 0 0 / 60%); color: #fff; font-size: 12px; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.run { background: var(--accent); animation: blink 1s infinite; }
.dot.bad { background: var(--danger); }
.dot.idle { background: var(--line-strong); }
@keyframes blink { 50% { opacity: 0.3; } }
.g1 { background-image: linear-gradient(135deg, #f7b267, #f25f5c 50%, #7b2cbf); }
.g2 { background-image: linear-gradient(135deg, #00c2a8, #0077b6 55%, #03045e); }
.g3 { background-image: linear-gradient(135deg, #ffd166, #ef476f 60%, #3a0ca3); }
.g4 { background-image: linear-gradient(135deg, #b8f2e6, #5e60ce 60%, #240046); }
.g5 { background-image: linear-gradient(135deg, #ffafcc, #cdb4db 40%, #3d5a80); }
.g6 { background-image: linear-gradient(135deg, #2ec4b6, #ff9f1c 60%, #e71d36); }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; align-items: start; }
.vid { display: block; color: inherit; transition: transform 0.2s; }
.vid:hover { transform: translateY(-4px); text-decoration: none; }
.vid .thumb { box-shadow: var(--shadow); }
.vid .meta { margin-top: 10px; font-weight: 700; overflow-wrap: anywhere; }
.vid .meta small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 10px; margin: 22px 0 24px; flex-wrap: wrap; }
.tab { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; color: var(--muted); }
.tab:hover { color: var(--text); text-decoration: none; }
.tab b { font-size: 13px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); }
.tab.on { background: var(--text); color: var(--bg); }
.tab.on b { background: rgb(255 255 255 / 18%); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 60px 20px; border-radius: 24px; border: 2px dashed var(--line); color: var(--muted); text-align: center; }
.empty b { color: var(--text); font-size: 18px; }
.empty-ic { width: 64px; height: 64px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }

/* Hero of the start */
.hero { display: flex; align-items: center; gap: 28px; padding: 32px 40px; border-radius: 28px; color: #fff; margin: 22px 0 8px; background: radial-gradient(120% 140% at 0% 0%, #8e6bff 0%, transparent 55%), radial-gradient(90% 120% at 100% 100%, #ff6e95 0%, transparent 55%), linear-gradient(135deg, #5b3bf5, #b348d8); box-shadow: var(--shadow-up); transition: transform 0.2s; }
.hero:hover { transform: translateY(-3px); text-decoration: none; }
.hero-ic { width: 76px; height: 76px; flex: none; border-radius: 22px; background: rgb(255 255 255 / 18%); display: grid; place-items: center; }
.hero-title { font-size: 30px; font-weight: 800; letter-spacing: -0.025em; }
.hero-sub { display: block; font-size: 15px; font-weight: 600; opacity: 0.9; margin-top: 2px; }
.hero-arrow { margin-left: auto; width: 60px; height: 60px; flex: none; border-radius: 50%; background: #fff; color: var(--accent); display: grid; place-items: center; }

/* ---------- Proposal ---------- */
.review, .gen { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px; align-items: start; }
.gen { align-items: center; }
.preview-col { position: sticky; top: calc(var(--top-h) + 20px); }
.phone { width: 100%; padding: 10px; border-radius: 30px; background: #16151d; box-shadow: var(--shadow-up); }
.phone .thumb { border-radius: 22px; }
.phone video { object-fit: contain; background: #000; }
.title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.title-row .ask { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.clips { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.clip { padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.clip.editing { outline: 3px solid var(--accent); }
.clip-top { display: flex; gap: 18px; }
.clip-thumb { position: relative; width: 84px; flex: none; align-self: flex-start; }
.clip-thumb .thumb { border-radius: 12px; }
.clip-n { position: absolute; left: 7px; top: 7px; width: 24px; height: 24px; border-radius: 8px; background: rgb(255 255 255 / 95%); color: #16151d; font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.clip-d { position: absolute; left: 7px; bottom: 7px; padding: 2px 7px; border-radius: 8px; background: rgb(0 0 0 / 60%); color: #fff; font-weight: 700; font-size: 11px; }
.clip-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.clip-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.clip-head b { font-size: 17px; letter-spacing: -0.01em; }
.kind { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.kind.paid { background: var(--accent-soft); color: var(--accent); }
.clip-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.clip-cost { color: var(--muted); font-size: 13px; font-weight: 700; }
.edit-btn { width: 38px; height: 38px; border: 0; border-radius: 11px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.edit-btn:hover, .edit-btn[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); }
.cf { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; align-items: start; }
.cf .lbl { display: inline-flex; align-items: center; gap: 6px; padding-top: 3px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.cf p { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.cf p.none { color: var(--muted); font-style: italic; }
.quote { display: inline-block; padding: 5px 11px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.cf textarea, .cf input { width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); color: var(--text); font: 500 15px/1.4 var(--font); resize: vertical; }
.cf textarea:focus, .cf input:focus { outline: none; border-color: var(--accent); }
.count { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.count.over { color: var(--danger); }
.clip .edit-only { display: none; }
.clip.editing .edit-only { display: block; }
.clip.editing .view-only { display: none; }
.panel { margin-top: 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.panel > summary { display: flex; align-items: center; gap: 10px; padding: 16px 18px; cursor: pointer; list-style: none; font-weight: 800; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary .chev { margin-left: auto; transition: transform 0.15s; color: var(--muted); }
.panel[open] > summary .chev { transform: rotate(180deg); }
.panel-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.beats { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.beat .thumb { border-radius: 10px; }
.beat p { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.overlay-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 76px 76px; gap: 8px; align-items: end; }
.ask-change { display: flex; gap: 12px; margin-top: 12px; }
.ask-change textarea { flex: 1; min-height: 58px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); padding: 12px 16px; font: 500 15px/1.4 var(--font); color: var(--text); resize: vertical; box-shadow: var(--shadow); }
.ask-change textarea:focus { outline: none; border-color: var(--accent); }
.ask-change .btn { height: auto; min-height: 52px; }
.bar-cost { position: relative; }
.bar-cost > button { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--surface-2); font-weight: 700; cursor: pointer; }
.bar-cost > button b { color: var(--accent); }
.cost-pop { position: absolute; right: 0; bottom: calc(100% + 10px); width: min(380px, 90vw); padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-up); }
.cost-lines { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.cost-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cost-lines li span:last-child { white-space: nowrap; font-weight: 700; }
.cost-lines li:last-child { border-bottom: 0; }

/* Waiting and generating */
.wait { min-height: 56vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.wait-ic { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-up); animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.wait .ask { margin: 22px 0 6px; }
.wait-now { font-size: 18px; font-weight: 600; color: var(--muted); }
.wait-steps { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding: 0; margin: 20px 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.wait-steps li { display: flex; align-items: center; gap: 6px; }
.wait-steps li.current { color: var(--accent); }
.wait-steps li.done { color: var(--text); }
.gen-bar { height: 14px; margin: 18px 0 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.gen-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.5s; }
.gen-text { color: var(--muted); font-weight: 600; }
.gen-steps { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 10px; }
.gen-steps li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--muted); }
.gen-steps li.pending { opacity: 0.6; }
.gen-steps li.done { color: var(--text); }
.gen-steps li.current { color: var(--accent); }
.gen-steps li.failed { color: var(--danger); }
.gen-thumbs { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.gen-thumbs img { width: 64px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow); animation: in 0.3s ease; }
.gen-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- Create image ---------- */
.make { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 28px; align-items: start; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.pic { position: relative; border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.pic img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); }
.pic.logo img { object-fit: contain; padding: 10px; }
.pic-actions { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity 0.15s; }
.pic:hover .pic-actions, .pic:focus-within .pic-actions { opacity: 1; }
.pic-actions a, .pic-actions button { flex: 1; height: 34px; border: 0; border-radius: 10px; background: rgb(255 255 255 / 95%); color: #16151d; font-size: 12px; font-weight: 700; display: grid; place-items: center; cursor: pointer; }
.pic-actions button { flex: none; width: 34px; color: var(--danger); }
.pic-actions a:hover { text-decoration: none; }

/* ---------- Dialogs and toasts ---------- */
.dialog { border: 0; padding: 0; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-up); width: min(560px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgb(15 14 20 / 55%); backdrop-filter: blur(6px); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }
.dialog h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.015em; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; max-height: 300px; overflow-y: auto; padding: 3px; }
.picker button { padding: 0; aspect-ratio: 1; border: 0; border-radius: 14px; overflow: hidden; background: var(--surface-2); cursor: pointer; outline: 3px solid transparent; }
.picker button:hover, .picker button:focus-visible { outline-color: var(--accent); }
.picker img { width: 100%; height: 100%; object-fit: cover; }
.toasts { position: fixed; right: 24px; bottom: 96px; z-index: 50; display: flex; flex-direction: column; gap: 10px; }
.toast { max-width: 420px; box-shadow: var(--shadow-up); animation: in 0.2s ease; }

/* ---------- Accounts: login, settings, brands ---------- */
.icon-btn[aria-current] { color: var(--accent); background: var(--accent-soft); }
/* ---- Entrar y crear cuenta: a pantalla completa, sobre degradados de la marca ---- */
.auth { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; overflow: hidden; isolation: isolate; }
.auth-bg { position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 10%, var(--bg)) 0%, var(--bg) 60%); }
.auth-bg span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; animation: auth-float 22s ease-in-out infinite alternate; }
.auth-bg span:nth-child(1) { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: var(--accent); }
.auth-bg span:nth-child(2) { width: 40vmax; height: 40vmax; right: -12vmax; bottom: -16vmax; background: var(--accent-2); animation-duration: 26s; animation-direction: alternate-reverse; }
.auth-bg span:nth-child(3) { width: 28vmax; height: 28vmax; right: 14vmax; top: -10vmax; background: #3fb6ff; opacity: 0.35; animation-duration: 30s; }
/* Una rejilla muy suave encima de los degradados, que se apaga hacia los bordes. */
.auth-bg::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(70% 60% at 50% 45%, #000 0%, transparent 100%); }
@keyframes auth-float { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vmax, 4vmax) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .auth-bg span { animation: none; } }
.auth-theme { position: absolute; top: 20px; right: 20px; }
.auth-wrap { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--text); }
.auth-brand:hover { text-decoration: none; }
.auth-brand .brand-mark { width: 40px; height: 40px; border-radius: 13px; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent); }
.auth-card { width: 100%; display: flex; flex-direction: column; gap: 16px; padding: 32px; border-radius: 24px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(18px) saturate(1.2); border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent); box-shadow: 0 24px 60px rgb(20 16 40 / 14%), 0 1px 0 rgb(255 255 255 / 40%) inset; }
.auth-head { display: flex; flex-direction: column; gap: 6px; text-align: center; margin-bottom: 4px; }
.auth-head h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; }
.auth-head p { color: var(--muted); font-size: 15px; }
.auth-card .btn-big { width: 100%; justify-content: center; margin-top: 4px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); }
.auth-switch a { font-weight: 700; }
.auth-foot { max-width: 34ch; text-align: center; font-size: 13px; color: var(--muted); }
@media (max-width: 480px) { .auth-card { padding: 24px 20px; } .auth-theme { top: 12px; right: 12px; } }
.settings { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.settings.wide { max-width: none; }
.settings-intro { margin: 0; max-width: 64ch; }
.settings-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.key-list { display: flex; flex-direction: column; gap: 16px; }
.key-card { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.key-card .label { margin-top: 8px; }
.key-head { display: flex; align-items: center; gap: 10px; }
.key-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.key-name { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.key-name .opt, .opt { font-size: 12px; font-weight: 600; color: var(--muted); }
.key-input { display: flex; gap: 8px; align-items: center; }
.key-input .input { flex: 1; min-width: 0; }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.tab b.warn-count { background: var(--warn-soft); color: var(--warn-text); }
.spend { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.spend .label { margin: 0; }
.spend-num { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.spend p { margin: 0; }
.meter { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.meter.near > span { background: var(--warn); }
.meter.full > span { background: var(--danger); }
.cost-table { display: flex; flex-direction: column; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.cost-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 18px; color: inherit; font-weight: 600; }
.cost-row + .cost-row { border-top: 1px solid var(--line); }
.cost-row:hover { background: var(--surface-2); text-decoration: none; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.brand-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.brand-logo { width: 64px; height: 64px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; font-size: 26px; font-weight: 800; color: var(--accent); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.brand-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.brand-info b { overflow-wrap: anywhere; }
.brand-colors { display: flex; align-items: center; gap: 6px; }
.swatch { width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%); }
.brand-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.saved-brands { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.saved-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px 6px 6px; border: 0; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); font-weight: 700; cursor: pointer; }
.saved-brand .brand-logo { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.saved-brand .brand-logo img { padding: 3px; }
.saved-brand[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.check-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-weight: 600; color: var(--muted); cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.vid-wrap { position: relative; }
.vid-del { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border: 0; border-radius: 10px; display: grid; place-items: center; background: rgb(0 0 0 / 55%); color: #fff; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.vid-wrap:hover .vid-del, .vid-del:focus-visible { opacity: 1; }
.vid-del:hover { background: var(--danger); }
.vid-del .spinner { display: none; }
.vid-del.loading .spinner { display: block; }
.vid-del.loading .icon { display: none; }
@media (hover: none) { .vid-del { opacity: 1; } }

/* ---------- Phones and tablets ---------- */
@media (max-width: 900px) {
  .top-in { padding: 0 16px; gap: 10px; }
  .brand > span:last-child { display: none; }
  .wiz-bar-in > .btn-ghost:first-child { font-size: 0; gap: 0; padding: 0 14px; }
  .bar-cost > button b { white-space: nowrap; }
  .top-tab span { display: none; }
  .page { padding: 22px 16px 130px; }
  .h1 { font-size: 26px; }
  .ask { font-size: 24px; }
  .choices, .field-row, .field-row.two, .slots, .review, .gen, .make { grid-template-columns: minmax(0, 1fr); }
  .preview-col { position: static; width: 100%; max-width: 220px; margin: 0 auto; }
  .wiz-bar-in { padding: 10px 16px; }
  .wiz-bar-in .btn-big { height: 52px; padding: 0 18px; font-size: 15px; }
  .hint { display: none; }
  .big-input { font-size: 17px; padding: 16px; }
  .drop { flex-direction: column; text-align: center; min-height: 0; }
  .cf { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .overlay-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero { padding: 24px; gap: 16px; }
  .hero-ic { width: 56px; height: 56px; }
  .hero-title { font-size: 22px; }
  .hero-arrow { display: none; }
  .clip-thumb { width: 64px; }
  .bar-cost > button span { display: none; }
  .auth-card { padding: 24px 18px; }
  .key-card { padding: 16px; }
}

/* ---- Mis marcas: la ficha de una marca y sus elementos ---- */
.brand-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 20px; }
.brand-edit-logo { display: flex; gap: 16px; align-items: flex-start; }
.brand-logo.big { width: 96px; height: 96px; border-radius: 20px; cursor: pointer; color: var(--muted); flex: none; }
.brand-logo.big:hover { outline: 2px solid var(--accent); }
.brand-elements { display: flex; gap: 6px; margin-top: 2px; }
.brand-elements img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: var(--surface-2); }
.element-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.element-card { position: relative; display: flex; flex-direction: column; border-radius: 16px; background: var(--surface-2); overflow: hidden; }
.element-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.element-card-info { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; }
.element-card .icon-btn { position: absolute; top: 6px; right: 6px; background: rgb(255 255 255 / 92%); color: #16151d; }
.element-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; border: 2px dashed var(--line); border-radius: 16px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.element-add:hover { border-color: var(--accent); color: var(--accent); }
.element-dialog { width: min(600px, calc(100vw - 32px)); }
.element-preview { aspect-ratio: 4 / 3; max-height: 220px; border-radius: 14px; background: var(--surface-2) center / contain no-repeat; }
.picker button.on { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (max-width: 860px) { .brand-edit { grid-template-columns: 1fr; } }

/* ---- Paso 2: persona, logo y productos y lugares en una sola fila ---- */
.slots-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.slots-elements { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; padding: 14px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.slots-elements .slot-head .opt { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.slots-elements .element-grid { flex: 1; margin-top: 0; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.slots-elements .element-add { min-height: 0; height: 100%; }
.auth-remember { margin-top: 0; font-size: 14px; }
