:root {
  --navy-950: #070f1d;
  --navy-900: #0b1628;
  --navy-800: #132239;
  --blue-600: #2770b8;
  --blue-700: #1f5d9a;
  --blue-50: #eef5fc;
  --sky-400: #4abbeb;
  --green-500: #52b947;
  --green-50: #edf8ec;
  --amber-600: #b45309;
  --amber-50: #fff7e6;
  --red-600: #c2410c;
  --red-50: #fdeee8;
  --ink: #0f1e33;
  --ink-muted: #4a5a72;
  --ink-soft: #7a879a;
  --line: #e1e7ef;
  --line-strong: #c9d3e0;
  --bg: #f4f6fa;
  --paper: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 30, 51, 0.04), 0 4px 16px rgba(15, 30, 51, 0.05);
  --topbar-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-600); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 28px; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.muted { color: var(--ink-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--blue-600); color: #fff; box-shadow: 0 1px 2px rgba(39, 112, 184, 0.3); }
.btn--primary:hover:not(:disabled) { background: var(--blue-700); }
.btn--secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover:not(:disabled) { border-color: var(--blue-600); color: var(--blue-700); }
.btn--ghost { background: transparent; color: var(--ink-muted); }
.btn--ghost:hover:not(:disabled) { background: #e9eef5; color: var(--ink); }
.btn--danger { background: #fff; color: var(--red-600); border-color: #f0c2b4; }
.btn--danger:hover:not(:disabled) { background: var(--red-50); }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 8px; padding: 18px; border: 1px solid #f0c2b4; border-radius: 14px; background: #fff8f6; }
.danger-zone strong { display: block; margin-bottom: 4px; }
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(7, 15, 29, 0.55); }
.modal__card { width: min(480px, 100%); display: grid; gap: 14px; padding: 28px; border-radius: 16px; background: #fff; box-shadow: 0 24px 60px rgba(7, 15, 29, 0.3); }
.modal__card h2 { font-size: 22px; }
.modal__card .actions { justify-content: flex-end; }
.btn--ghost-dark { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.14); }
.btn--ghost-dark:hover { background: rgba(255, 255, 255, 0.16); }
.btn--sm { min-height: 34px; padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.btn--lg { min-height: 50px; padding: 14px 26px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--google { width: 100%; min-height: 50px; background: #fff; color: var(--ink); border-color: var(--line-strong); font-size: 16px; }
.btn--google:hover { border-color: var(--blue-600); }
.btn--google svg { width: 20px; height: 20px; }

.icon-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.icon-btn:hover { background: #eef2f7; color: var(--ink); }
.icon-btn--danger:hover { background: var(--red-50); color: var(--red-600); }
.icon-btn--text { font-size: 13px; }

/* ---------- pills, alerts ---------- */
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #e9eef5; color: var(--ink-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.pill--live { background: var(--green-50); color: #237a2b; }
.pill--warn { background: var(--amber-50); color: var(--amber-600); }
.pill--dark { background: rgba(255, 255, 255, 0.12); color: #d5deea; }
.topbar .pill--live { background: rgba(82, 185, 71, 0.2); color: #9be08f; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.alert--error { background: var(--red-50); color: var(--red-600); }
.alert--warn { background: var(--amber-50); color: var(--amber-600); }
.alert--info { background: var(--blue-50); color: var(--blue-700); }
.alert--ok { background: var(--green-50); color: #237a2b; }
.alert .btn { margin-left: 8px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--topbar-h);
  padding: 0 20px;
  background: var(--navy-900);
  color: #fff;
}
.topbar__brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; flex-shrink: 0; }
.topbar__brand img { height: 22px; width: auto; }
.topbar__brand span { padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.2); color: #c8d3e2; font-weight: 600; font-size: 14px; }
.topbar__event { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.topbar__back { color: #a9b7ca; text-decoration: none; font-size: 14px; flex-shrink: 0; }
.topbar__back:hover { color: #fff; }
.topbar__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.topbar__user { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }
.topbar__user form { margin: 0; }
.topbar__email { color: #a9b7ca; font-size: 13px; }
.topbar__event + .topbar__user .topbar__email { display: none; }
.save-state { margin-left: auto; color: #a9b7ca; font-size: 13px; white-space: nowrap; }
.save-state.is-ok { color: #9be08f; }
.save-state.is-error { color: #ffb4a0; }

/* ---------- login ---------- */
.login { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(ellipse at top right, rgba(39, 112, 184, 0.35), transparent 55%), radial-gradient(ellipse at bottom left, rgba(82, 185, 71, 0.18), transparent 50%), var(--navy-900); }
.login__card { width: 100%; max-width: 400px; padding: 40px 36px; border-radius: 18px; background: #fff; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5); display: grid; gap: 16px; text-align: center; }
.login__logo { height: 30px; margin: 0 auto 8px; }
.login__hint { color: var(--ink-soft); font-size: 13px; }

/* ---------- list + new ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 36px 24px 80px; }
.page--narrow { max-width: 640px; }
.page__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; }
.page__head p { margin-top: 6px; }
.group-title { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin: 28px 0 14px; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.event-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.event-card::before { content: ""; position: absolute; inset: 0 0 auto; z-index: 1; height: 3px; background: linear-gradient(90deg, var(--sky-400), var(--blue-600) 45%, var(--green-500)); transform: scaleX(0); transform-origin: left; transition: transform 0.25s; }
.event-card__thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 8; background: linear-gradient(135deg, var(--navy-800), var(--navy-900)); color: #8fa0b8; text-decoration: none; font-size: 13px; overflow: hidden; }
.event-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.event-card__date { position: absolute; left: 12px; bottom: 12px; display: grid; justify-items: center; padding: 7px 12px 6px; border-radius: 10px; background: #fff; box-shadow: 0 6px 16px -6px rgba(11, 22, 40, 0.45); font-size: 11px; font-weight: 700; line-height: 1.1; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.event-card__date strong { font-size: 20px; letter-spacing: -0.02em; color: var(--blue-600); }
.event-card__body { display: grid; flex: 1; align-content: start; gap: 8px; padding: 18px; }
.event-card__body .pill { justify-self: start; }
.event-card h3 { font-size: 18px; }
.event-card h3 a { color: inherit; text-decoration: none; }
.event-card h3 a:hover { color: var(--blue-700); }
.event-card__meta { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.event-card__meta li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-muted); }
.event-card__meta svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--blue-600); }
.event-card__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
@media (hover: hover) {
  .event-card:hover { transform: translateY(-3px); border-color: rgba(39, 112, 184, 0.35); box-shadow: 0 20px 40px -20px rgba(11, 22, 40, 0.35); }
  .event-card:hover::before { transform: scaleX(1); }
  .event-card:hover .event-card__thumb img { transform: scale(1.04); }
}
.empty { padding: 60px 24px; border: 2px dashed var(--line-strong); border-radius: 18px; text-align: center; display: grid; gap: 12px; justify-items: center; background: var(--paper); }
.back { display: inline-block; margin-bottom: 14px; color: var(--ink-muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }
.page--narrow h1 + .muted { margin: 6px 0 22px; }
.panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.panel--soft { padding: 22px; background: #f8fafd; box-shadow: none; gap: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- editor layout ---------- */
.editor { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.editor--preview { grid-template-columns: 230px minmax(0, 1fr) minmax(360px, 42%); }
.editor--assistant { grid-template-columns: 220px minmax(0, 1fr) 380px; }
.editor--preview.editor--assistant { grid-template-columns: 76px minmax(0, 1fr) minmax(280px, 1fr) 340px; }
.editor--assistant .assistant { grid-column: 3; }
.editor--preview.editor--assistant .editor__preview { grid-column: 3; }
.editor--preview.editor--assistant .assistant { grid-column: 4; }
.editor__nav { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 24px 14px; border-right: 1px solid var(--line); background: var(--paper); }
.editor__nav-title { margin: 0 10px 10px; color: var(--ink-soft); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
#steps-nav { display: grid; gap: 2px; }
.nav-step { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-muted); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.nav-step:hover { background: #f1f4f8; color: var(--ink); }
.nav-step.is-current { background: var(--blue-50); color: var(--blue-700); font-weight: 700; }
.nav-step__icon { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.nav-step--done .nav-step__icon { border-color: var(--green-500); background: var(--green-500); color: #fff; }
.nav-step--warn .nav-step__icon { border-color: #f0b54a; background: var(--amber-50); color: var(--amber-600); }
.nav-step--live .nav-step__icon { border-color: var(--green-500); color: var(--green-500); }
.nav-step.is-current .nav-step__icon { border-color: var(--blue-600); }
.nav-step--done.is-current .nav-step__icon { background: var(--blue-600); border-color: var(--blue-600); }

.editor__main { min-width: 0; padding: 36px 40px 60px; }
.step { max-width: 720px; margin: 0 auto; }
.step__head { margin-bottom: 26px; }
.step__count { color: var(--blue-600); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.step__head .muted { margin-top: 8px; font-size: 16px; }
.step__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.step__foot { display: flex; justify-content: space-between; gap: 12px; max-width: 720px; margin: 22px auto 0; }
.sub { font-size: 17px; margin-top: 6px; }
.group { display: grid; gap: 16px; padding: 18px; border-radius: 12px; background: #f8fafd; border: 1px solid var(--line); }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.field label, .field > label { font-size: 14px; font-weight: 600; color: var(--ink); }
.optional { color: var(--ink-soft); font-weight: 500; font-size: 13px; }
.field__help { color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
input[type="text"], input[type="url"], input[type="email"], input[type="date"], input[type="time"], input:not([type]), select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a879a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(39, 112, 184, 0.15); }
input::placeholder, textarea::placeholder { color: #a3aebd; }
.counter { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter--over { color: var(--amber-600); font-weight: 700; }
.prefixed { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; }
.prefixed:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(39, 112, 184, 0.15); }
.prefix { display: flex; align-items: center; padding: 0 4px 0 12px; background: #f4f6fa; color: var(--ink-soft); font-size: 14px; white-space: nowrap; border-right: 1px solid var(--line); padding-right: 10px; }
.prefixed input { border: 0; border-radius: 0; box-shadow: none !important; }
.combo { position: relative; }
.combo-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.combo__list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow: auto; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; box-shadow: 0 16px 40px rgba(15, 30, 51, 0.16); }
.combo__group { padding: 8px 10px 4px; color: var(--ink-soft); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.combo__option { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.combo__option.is-active { background: var(--blue-50); }
.combo__option.is-selected { font-weight: 700; }
.combo__empty, .combo__more { padding: 8px 10px; color: var(--ink-soft); font-size: 13px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-2--time { grid-template-columns: 200px 1fr; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; }
.add-question { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.item-card__head .pill { margin-left: 2px; vertical-align: 1px; }

/* switch */
.switch { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; flex-shrink: 0; width: 44px; height: 26px; margin-top: 1px; border-radius: 999px; background: var(--line-strong); transition: background-color 0.15s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.switch input:checked + .switch__track { background: var(--blue-600); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px rgba(39, 112, 184, 0.25); }
.switch__text { display: grid; gap: 2px; }
.switch__text strong { font-size: 15px; }

/* segmented + chips */
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: #eef2f7; justify-self: start; }
.segmented button { padding: 7px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.segmented button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 30, 51, 0.12); }
.segmented--dark { background: rgba(255, 255, 255, 0.08); }
.segmented--dark button { color: #b7c3d4; }
.segmented--dark button.is-on { background: rgba(255, 255, 255, 0.18); color: #fff; box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip.is-on { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-700); }
.utm-builder { gap: 12px; }
.utm-builder .chip { padding: 4px 10px; font-size: 13px; }
@media (max-width: 640px) { .utm-builder .row-2 { grid-template-columns: 1fr; } }

/* repeatable lists */
.string-list { display: grid; gap: 8px; }
.string-list__row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; }
.string-list__row textarea { min-height: 64px; }
.add-link { justify-self: start; padding: 6px 0; border: 0; background: none; color: var(--blue-600); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.add-link:hover { color: var(--blue-700); text-decoration: underline; }
.card-list { display: grid; gap: 14px; }
.card-list__empty { padding: 22px; border-radius: 12px; background: #f8fafd; color: var(--ink-soft); text-align: center; font-size: 14px; }
.item-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.item-card__head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; background: #f8fafd; border-bottom: 1px solid var(--line); }
.item-card__head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.item-card__num { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; background: var(--navy-900); color: #fff; font-size: 12px; font-weight: 700; }
.item-card__tools { display: flex; gap: 2px; flex-shrink: 0; }
.item-card__body { display: grid; gap: 16px; padding: 18px 16px; }
.item-card.is-collapsed .item-card__head { border-bottom: 0; }
.item-card__head--toggle { cursor: pointer; padding-left: 8px; }
.item-card__head--toggle:hover { background: #f1f5fa; }
.item-card__chevron { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; margin-right: -6px; border: 0; border-radius: 6px; background: none; color: var(--ink-muted); font-size: 20px; line-height: 1; cursor: pointer; transition: transform 0.15s; }
.item-card__chevron[aria-expanded="true"] { transform: rotate(90deg); }
.item-card__chevron:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 1px; }
.add-card { padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: transparent; color: var(--blue-600); font: inherit; font-weight: 700; cursor: pointer; }
.add-card:hover { border-color: var(--blue-600); background: var(--blue-50); }

/* advanced */
.advanced { border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.advanced summary { padding: 14px 16px; color: var(--ink-muted); font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "▸"; display: inline-block; width: 18px; color: var(--ink-soft); transition: transform 0.15s; }
.advanced[open] summary::before { transform: rotate(90deg); }
.advanced__body { display: grid; gap: 16px; padding: 4px 16px 18px; }

/* auto labels */
.auto-box { padding: 16px 18px; border-radius: 12px; background: var(--blue-50); }
.auto-box__title { color: var(--blue-700); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.auto-box dl { display: grid; gap: 8px; margin: 0; }
.auto-box dl div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; }
.auto-box dt { color: var(--ink-soft); font-size: 13px; }
.auto-box dd { margin: 0; font-size: 14px; font-weight: 600; }

/* uploads */
.upload-btn { position: relative; margin-top: 10px; cursor: pointer; }
.upload-btn.is-busy { opacity: 0.6; pointer-events: none; }
.upload-hero { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: center; }
.upload-hero img, .upload-hero__empty { width: 100%; aspect-ratio: 3 / 2; border-radius: 12px; object-fit: cover; }
.upload-hero__empty { display: grid; place-items: center; border: 1.5px dashed var(--line-strong); color: var(--ink-soft); background: #f8fafd; font-size: 14px; }
.upload-hero strong, .upload-logo strong { font-size: 15px; display: block; margin-bottom: 4px; }
.upload-logo { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: center; padding-top: 6px; }
.upload-logo img { width: 100%; padding: 18px; border-radius: 12px; background: var(--navy-900); }
.upload-logo--light img { background: #fff; border: 1px solid var(--line); }
.upload-logo__empty { display: grid; place-items: center; min-height: 64px; padding: 12px; border-radius: 12px; background: var(--navy-900); color: #fff; font-size: 14px; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.upload-logo--light .upload-logo__empty { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.logo--darken { filter: brightness(0); opacity: 0.82; }
.theme-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-option { display: grid; gap: 6px; align-content: start; padding: 10px 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.theme-option:hover { border-color: var(--line-strong); }
.theme-option.is-on { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(39, 112, 184, 0.15); }
.theme-option strong { font-size: 14px; padding: 4px 4px 0; }
.theme-option .field__help { padding: 0 4px; }
.theme-swatch { display: grid; grid-template-rows: 12px 44px 30px; overflow: hidden; border-radius: 9px; border: 1px solid var(--line); margin-bottom: 4px; }
.theme-swatch__nav { display: flex; align-items: center; padding: 0 6px; }
.theme-swatch__nav img { height: 6px; width: auto; }
.theme-swatch__hero { position: relative; overflow: hidden; display: grid; align-content: center; gap: 4px; padding: 0 8px; }
.theme-swatch__hero i { display: block; height: 4px; border-radius: 2px; width: 55%; }
.theme-swatch__hero i + i { width: 35%; height: 3px; }
.theme-swatch__hero b { position: absolute; right: -10px; bottom: -14px; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 45% 40%, #4abbeb, #2f86cc 45%, #1f4f8f); }
.theme-swatch__body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 7px 8px; }
.theme-swatch__body i { border-radius: 3px; }
.theme-swatch--light .theme-swatch__nav, .theme-swatch--light .theme-swatch__hero { background: #fff; }
.theme-swatch--light .theme-swatch__hero i { background: #0f1e33; }
.theme-swatch--light .theme-swatch__hero i + i { background: #2770b8; }
.theme-swatch--light .theme-swatch__body { background: #f5f7fa; }
.theme-swatch--light .theme-swatch__body i { background: #e3e8ef; }
.theme-swatch--half .theme-swatch__nav, .theme-swatch--half .theme-swatch__hero { background: #0b1628; }
.theme-swatch--half .theme-swatch__hero i { background: #fff; }
.theme-swatch--half .theme-swatch__hero i + i { background: #4abbeb; }
.theme-swatch--half .theme-swatch__body { background: #fff; }
.theme-swatch--half .theme-swatch__body i { background: #e3e8ef; }
.theme-swatch--dark .theme-swatch__nav, .theme-swatch--dark .theme-swatch__hero { background: #0b1628; }
.theme-swatch--dark .theme-swatch__hero i { background: #fff; }
.theme-swatch--dark .theme-swatch__hero i + i { background: #4abbeb; }
.theme-swatch--dark .theme-swatch__body { background: #0f1e33; }
.theme-swatch--dark .theme-swatch__body i { background: #1d2f4a; }
.speaker-edit { display: grid; grid-template-columns: 120px 1fr; gap: 20px; }
.speaker-edit__photo { display: grid; justify-items: center; align-content: start; gap: 4px; }
.speaker-edit__photo img, .speaker-edit__photo > span { display: grid; place-items: center; width: 112px; height: 112px; border-radius: 14px; object-fit: cover; background: linear-gradient(135deg, var(--navy-800), #1f4f8f); color: #fff; font-size: 28px; font-weight: 700; }
.speaker-edit__photo .upload-btn { margin-top: 6px; }
.speaker-edit__fields { display: grid; gap: 14px; min-width: 0; }

/* monday */
.board-report { display: grid; gap: 14px; padding-top: 6px; }
.board-report__name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.checks .is-ok { color: #237a2b; }
.checks .is-missing { color: var(--red-600); font-weight: 600; }

/* publish */
.publish-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px; border-radius: 14px; background: var(--navy-900); color: #fff; }
.publish-card h3 { font-size: 19px; margin-top: 4px; }
.publish-card .field__help { color: #a9b7ca; margin-top: 4px; }
.publish-card__state { color: #a9b7ca; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.publish-card.is-live .publish-card__state { color: #9be08f; }
.publish-card .btn--ghost { color: #d5deea; }
.publish-card .btn--ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.issues { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.issue { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 10px; font-size: 14px; }
.issue--block { background: var(--red-50); color: var(--red-600); font-weight: 600; }
.issue--warn { background: var(--amber-50); color: #8a4a0a; }
.url-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafd; }
.url-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.social-shots { display: flex; gap: 14px; flex-wrap: wrap; }
.social-shots a { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; text-decoration: none; }
.social-shots img { height: 140px; border-radius: 10px; border: 1px solid var(--line); }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-muted); }

/* preview */
.editor__preview[hidden] { display: none; }
.editor__preview { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); display: flex; flex-direction: column; background: var(--navy-950); border-left: 1px solid var(--line); }
.preview__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; }
.preview__stage { flex: 1; display: flex; justify-content: center; padding: 0 14px 14px; min-height: 0; }
.preview__stage iframe { width: 100%; height: 100%; border: 0; border-radius: 10px; background: #fff; }
.preview__stage--mobile iframe { width: 390px; max-width: 100%; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 100; max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 12px; background: var(--navy-900); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); transform: translate(-50%, 20px); opacity: 0; transition: opacity 0.2s, transform 0.2s; }
.toast.is-in { transform: translate(-50%, 0); opacity: 1; }
.toast--error { background: var(--red-600); }

/* ---------- assistant ---------- */
.btn--assistant { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.22); }
.btn--assistant:hover:not(:disabled), .btn--assistant.is-on { background: #fff; color: var(--navy-900); }
.editor.is-assistant .editor__main,
.editor.is-assistant .editor__nav { pointer-events: none; }
.assistant { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); min-width: 0; display: flex; flex-direction: column; background: var(--paper); border-left: 1px solid var(--line); }
.assistant[hidden] { display: none; }
.assistant__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.assistant__head strong { display: block; font-size: 16px; }
.assistant__head .field__help { margin-top: 4px; }
.assistant__log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.assistant__empty { color: var(--ink-muted); }
.assistant__msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; overflow-wrap: anywhere; }
.assistant__msg--user { align-self: flex-end; background: var(--blue-50); color: var(--ink); white-space: pre-wrap; }
.assistant__msg--assistant { align-self: flex-start; background: #f4f6fa; white-space: normal; }
.assistant__msg--error { align-self: flex-start; background: var(--red-50); color: var(--red-600); white-space: pre-wrap; }
.assistant__md p { margin: 0 0 8px; }
.assistant__md h1, .assistant__md h2, .assistant__md h3, .assistant__md h4 { margin: 0 0 6px; font-size: 15px; }
.assistant__md table { width: 100%; border-collapse: collapse; margin: 0 0 8px; font-size: 13px; }
.assistant__md th, .assistant__md td { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
.assistant__md th { background: #eef3f9; }
.assistant__md blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--line-strong); color: var(--ink-muted); }
.assistant__md ul, .assistant__md ol { margin: 0 0 8px; padding-left: 1.15em; }
.assistant__md li + li { margin-top: 3px; }
.assistant__md :last-child { margin-bottom: 0; }
.assistant__md a { font-weight: 600; }
.assistant__md code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.assistant__md p code, .assistant__md li code { padding: 0 4px; border-radius: 4px; background: #e7edf5; }
.assistant__md pre { margin: 0 0 8px; padding: 8px 10px; overflow-x: auto; border-radius: 8px; background: #e7edf5; }
.assistant__tool { align-self: stretch; display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; }
.assistant__tool-mark { display: grid; place-items: center; flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--green-500); color: #fff; font-size: 11px; font-weight: 700; }
.assistant__tool-copy { display: grid; min-width: 0; }
.assistant__tool-copy span { color: var(--ink-muted); }
.assistant__working { align-self: stretch; display: flex; align-items: center; gap: 10px; max-width: none; color: var(--ink-muted); }
.assistant__spinner { width: 16px; height: 16px; flex-shrink: 0; border: 2px solid #d5deea; border-top-color: var(--blue-600); border-radius: 50%; animation: assistant-spin 0.7s linear infinite; }
@keyframes assistant-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .assistant__spinner { animation: none; }
}
.assistant__compose { display: grid; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.assistant__compose textarea { width: 100%; min-height: 88px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; resize: vertical; }
.assistant__compose textarea:focus { outline: 2px solid var(--blue-50); border-color: var(--blue-600); }
.assistant__compose-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.assistant__hint, .assistant__status { color: var(--ink-muted); font-size: 12px; }
.assistant__hint { margin-right: auto; }

/* ---------- responsive ---------- */
@media (max-width: 1500px) {
  .editor--preview, .editor--assistant { grid-template-columns: 76px minmax(0, 1fr) minmax(300px, 380px); }
  .editor--preview.editor--assistant { grid-template-columns: 76px minmax(280px, 1fr) minmax(240px, 32%) 300px; }
  .editor--preview .nav-step__title, .editor--preview .editor__nav-title,
  .editor--assistant .nav-step__title, .editor--assistant .editor__nav-title { display: none; }
  .editor--preview .editor__nav, .editor--assistant .editor__nav { padding: 20px 10px; }
  .editor--preview .nav-step, .editor--assistant .nav-step { justify-content: center; padding: 10px 0; }
}
@media (max-width: 900px) {
  .editor, .editor--preview, .editor--assistant, .editor--preview.editor--assistant { grid-template-columns: 1fr; }
  .editor__nav { position: sticky; top: var(--topbar-h); z-index: 20; height: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .editor__nav-title { display: none; }
  #steps-nav { display: flex; overflow-x: auto; gap: 4px; }
  .nav-step { width: auto; flex-shrink: 0; }
  .editor__preview { display: none; }
  .editor__main { padding: 24px 16px 48px; }
  .step__body { padding: 20px; }
  .row-2, .row-3, .row-2--time, .upload-hero, .speaker-edit, .checks, .theme-picker { grid-template-columns: 1fr; }
  .topbar__brand span, .topbar__title, .topbar__email { display: none; }
  .editor-body .topbar__user, .editor-body .topbar__event .btn--ghost-dark { display: none; }
  .editor--assistant .assistant,
  .editor--preview.editor--assistant .assistant {
    position: static;
    height: 70vh;
    grid-column: 1;
    width: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .editor--assistant .nav-step__title,
  .editor--preview .nav-step__title { display: inline; }
  .editor--assistant .nav-step,
  .editor--preview .nav-step { justify-content: flex-start; padding: 9px 10px; }
  .save-state { font-size: 12px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .publish-card { flex-direction: column; align-items: stretch; }
}
