/* Task Elites Toolbox — operator look (warm dark / yellow).
 *
 * NOT the premium member-page palette. This is the OPERATOR-facing app:
 * warm dark surfaces, single bright yellow accent, plain Anton/Archivo,
 * big tap targets, sunlight contrast. See TOOLBOX-BUILD-SPEC.md §1.
 *
 * Phone-first; sidebar appears at ≥820px. One responsive codebase.
 */

:root {
  --bg:        #0c0b09;
  --bg2:       #15130f;
  --card:      #1c1915;
  --card2:     #211e1a;
  --line:      rgba(245, 241, 232, 0.12);
  --gold:      #f5b800;
  --gold-d:    #d49a00;
  --accent-ink: #f5b800;   /* gold used as TEXT/icons; deepened in light mode for contrast */
  --text:      #f5f1e8;
  --muted:     #a39c8e;
  --green:     #5cc46a;
  --blue:      #5b9bd5;
  --purple:    #b58be0;
  --red:       #e0795b;

  /* Theme-aware roles (flip in light mode). Subtle surface fills, input fields,
     and the translucent topbar/bottomnav chrome. */
  --fill:      rgba(245, 241, 232, 0.05);
  --fill-2:    rgba(245, 241, 232, 0.08);
  --field:     rgba(0, 0, 0, 0.25);
  --chrome:    rgba(12, 11, 9, 0.95);

  --bottomnav-h: 84px;   /* measured actual height (was 72 — too tight; mic overlapped on phone) */
  --sidebar-w:   240px;
  --topbar-h:    58px;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

/* Light mode — warm cream surfaces, dark text, same yellow accent. Toggle lives
   in Business Information; persisted to localStorage and set on <html> before
   paint (see index.html) so there's no flash. */
:root[data-theme="light"] {
  --bg:        #ece6d9;
  --bg2:       #e4ddcd;
  --card:      #faf6ee;
  --card2:     #f3ecdf;
  --line:      rgba(20, 17, 13, 0.18);
  --accent-ink: #8a6300;   /* deep readable gold for text/icons on light surfaces */
  --text:      #1a1611;
  --muted:     #6f6757;
  --green:     #2e9e48;
  --blue:      #2f6fb0;
  --purple:    #8a55c4;
  --red:       #c14a2a;
  --fill:      rgba(20, 17, 13, 0.045);
  --fill-2:    rgba(20, 17, 13, 0.08);
  --field:     #ffffff;
  --chrome:    rgba(250, 248, 243, 0.92);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Boot splash — covers everything until the auth check finishes (no flash of
   the toolbox before login). Shown by default; app.js hides it. */
#splash {
  position: fixed; inset: 0; z-index: 9999; background: #0c0b09;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
}
.splash-brand {
  font-family: 'Anton', Impact, sans-serif; font-size: 30px; letter-spacing: 0.08em;
  color: #f5f1e8; text-transform: uppercase;
}
.splash-brand span { color: #f5b800; }
.splash-spin {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid rgba(245, 241, 232, 0.18); border-top-color: #f5b800;
  animation: splash-spin 0.9s linear infinite;
}
@keyframes splash-spin { to { transform: rotate(360deg); } }
/* Centred login — a full-screen overlay so the app's grid can't squash it into
   the (hidden) sidebar column. */
.login-wrap {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: auto;
}
.login-box { width: 100%; max-width: 420px; }
.login-box .adc-input { width: 100%; }
html, body { height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  font-size: 15px;
  overflow-x: hidden;
}
.display { font-family: 'Anton', Impact, sans-serif; text-transform: uppercase; letter-spacing: 0.01em; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */

#app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) {
  #app {
    grid-template-columns: var(--sidebar-w) 1fr;
  }
}

/* ---------- Sidebar (PC) ---------- */

#sidebar {
  display: none;
  background: var(--bg2);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
@media (min-width: 820px) { #sidebar { display: flex; } }

#sidebar .brand {
  font-family: 'Anton', sans-serif; font-size: 19px; letter-spacing: 0.1em;
  padding: 0 8px 22px; text-transform: uppercase;
}
#sidebar .brand .a { color: var(--accent-ink); }
#sidebar .brand small {
  display: block; font-family: 'Archivo', sans-serif; font-size: 8px;
  letter-spacing: 0.3em; color: var(--muted); font-weight: 700; margin-top: 3px;
}

#sidebar .navitem {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--muted); font-size: 14px; font-weight: 600;
  margin-bottom: 4px; transition: background 0.15s, color 0.15s;
}
#sidebar .navitem:hover { background: var(--fill); color: var(--text); }
#sidebar .navitem.active { background: rgba(245, 184, 0, 0.12); color: var(--accent-ink); }
#sidebar .navitem svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
#sidebar .navitem .soon {
  margin-left: auto; font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--fill-2); color: var(--muted);
  padding: 2px 6px; border-radius: 3px;
}
/* My Page sub-pages (Landing / Thank You / Disqualification).
   Always visible so the operator can see (and reach) every page at a glance. */
#sidebar .navcaret { display: none; }
#sidebar .navsubs { display: block; margin: 2px 0 6px 14px; }
#sidebar .navsub {
  padding: 9px 12px 9px 26px; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--muted); font-size: 13px; font-weight: 600;
  border-left: 2px solid var(--fill-2); margin-bottom: 2px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#sidebar .navsub:hover { background: var(--fill); color: var(--text); }
#sidebar .navsub.active {
  color: var(--accent-ink); border-left-color: var(--accent-ink);
  background: rgba(245, 184, 0, 0.08);
}
/* Nested expandable (Ads Generator → Videos / Images) */
#sidebar .navsub-exp { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#sidebar .navcaret2 { width: 13px; height: 13px; fill: currentColor; opacity: 0.55; transition: transform 0.15s; flex: 0 0 auto; }
#sidebar .navsub-exp.open .navcaret2 { transform: rotate(180deg); }
#sidebar .navsub-children { display: none; }
/* Clearly a nested dropdown: indented under "Ads Generator", with a guide line,
   and the items smaller + dimmer than the top-level rows. */
#sidebar .navsub-children.open {
  display: block;
  margin: 1px 0 5px 22px;
  border-left: 1px solid rgba(245, 184, 0, 0.22);
  padding-left: 2px;
}
#sidebar .navsub-deep {
  padding: 6px 10px 6px 14px;
  font-size: 12px;
  color: var(--muted);
  border-left: 0;
  margin-bottom: 0;
  border-radius: 6px;
}
#sidebar .navsub-deep:hover { background: var(--fill); color: var(--text); }
#sidebar .navsub-deep.active { color: var(--accent-ink); background: rgba(245, 184, 0, 0.08); }
#sidebar .nav-sep {
  font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); padding: 16px 12px 8px; font-weight: 700;
}
#sidebar .who {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 8px 0; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
#sidebar .who .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--gold);
  color: var(--bg); display: flex; align-items: center; justify-content: center;
  font-family: 'Anton', sans-serif; font-size: 14px;
}
.logout-btn {
  margin: 10px 8px 4px; padding: 9px 12px; width: calc(100% - 16px);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  background: var(--fill); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 700; text-align: center;
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }
.logout-top {
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  background: var(--fill); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 7px 12px;
}
.logout-top:hover { border-color: var(--red); color: var(--red); }

/* ---------- Topbar ---------- */

#topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--chrome);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
#topbar .title { font-family: 'Anton', sans-serif; font-size: 18px; text-transform: uppercase; margin-right: auto; }
@media (min-width: 820px) { #topbar .title { font-size: 20px; } }
/* group the right-hand top-bar buttons (voice + logout) together */
#topbar .voice-toggle { margin-left: 12px; }
#topbar .logout-top { margin-left: 10px; }

#topbar .voice-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 700;
  border: 1px solid var(--gold); padding: 7px 12px; border-radius: 6px;
  background: transparent;
}
#topbar .voice-toggle svg { width: 14px; height: 14px; fill: var(--accent-ink); }
#topbar .voice-toggle.off { color: var(--muted); border-color: var(--muted); }
#topbar .voice-toggle.off svg { fill: var(--muted); }
.voice-pill {
  font-family: 'Anton', sans-serif;
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--fill-2); color: var(--muted);
  padding: 3px 7px; border-radius: 4px; margin-left: 6px;
}
.voice-pill.premium {
  background: rgba(245, 184, 0, 0.18); color: var(--accent-ink);
}

/* ---------- Main + view ---------- */

#main {
  display: flex; flex-direction: column;
  min-height: 100vh;
  /* leave room for the fixed bottom nav on phones */
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 820px) { #main { padding-bottom: 0; } }

#view { flex: 1; padding: 18px; max-width: 1180px; width: 100%; margin: 0 auto; }
@media (min-width: 820px) { #view { padding: 24px 28px; } }

/* ---------- Bottom nav (phone) ---------- */

#bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--chrome);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 10px 6px calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 9;
  backdrop-filter: blur(8px);
}
@media (min-width: 820px) { #bottomnav { display: none; } }

#bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); font-size: 11px; font-weight: 700;
  padding: 6px 0; text-transform: uppercase; letter-spacing: 0.03em;
}
#bottomnav a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
#bottomnav a.active { color: var(--accent-ink); }

/* ---------- Greeting ---------- */

.greet { margin-bottom: 18px; }
.greet h1 {
  font-family: 'Anton', sans-serif; font-size: 28px;
  text-transform: uppercase; line-height: 1; margin-bottom: 6px;
}
.greet h1 .a { color: var(--accent-ink); }
.greet p { color: var(--muted); font-size: 15px; }
@media (min-width: 820px) { .greet h1 { font-size: 34px; } }

/* ---------- The big talk button ---------- */

.talkbig {
  margin: 6px 0 18px;
  background: linear-gradient(180deg, #23201b, #161410);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.talkbig:active { transform: scale(0.985); }
.talkbig .ring {
  width: 92px; height: 92px; border-radius: 50%; background: var(--gold);
  margin: 0 auto 14px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 40px rgba(245, 184, 0, 0.35);
  position: relative;
}
.talkbig .ring::after {
  content: ''; position: absolute; inset: -8px; border-radius: 50%;
  border: 3px solid var(--gold); opacity: 0; animation: ring 2.6s ease-out infinite;
}
.talkbig.recording .ring::after { animation-duration: 0.9s; opacity: 1; }
@keyframes ring {
  0% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35); }
}
.talkbig .ring svg { width: 40px; height: 40px; fill: var(--bg); }
.talkbig .t {
  font-family: 'Anton', sans-serif; font-size: 22px; text-transform: uppercase; line-height: 1.05;
}
.talkbig .s { color: var(--muted); font-size: 14px; margin-top: 7px; }
.talkbig .egs {
  display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 14px;
}
.talkbig .eg {
  background: var(--fill);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 12px; font-size: 12.5px; color: var(--text);
}
.talkbig.recording { border-color: var(--accent-ink); }
.talkbig .heard {
  margin-top: 12px; font-size: 13px; color: var(--text);
  background: rgba(245, 184, 0, 0.08);
  border: 1px solid rgba(245, 184, 0, 0.3);
  border-radius: 10px; padding: 8px 12px; text-align: left;
  display: none;
}
.talkbig.has-heard .heard { display: block; }

/* ---------- Win strip ---------- */

.win {
  background: linear-gradient(135deg, rgba(92, 196, 106, 0.22), rgba(245, 184, 0, 0.12));
  border: 1px solid rgba(92, 196, 106, 0.4);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px;
}
.win .ic {
  width: 44px; height: 44px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.win .ic svg { width: 22px; height: 22px; fill: #fff; }
.win .t { font-family: 'Anton', sans-serif; font-size: 17px; text-transform: uppercase; line-height: 1; }
.win .s { font-size: 13.5px; color: var(--text); margin-top: 4px; }

/* ---------- Section labels ---------- */

.section-label {
  font-family: 'Anton', sans-serif; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); margin: 6px 0 12px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 800;
  color: var(--accent-ink); margin-bottom: 14px;
}
.eyebrow .pip {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---------- Action cards ("Do these today") ---------- */

.action {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}
.action .top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.action .av {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Anton', sans-serif; font-size: 17px;
}
.action .av.lead { background: rgba(92, 196, 106, 0.18); color: var(--green); }
.action .av.quote { background: rgba(245, 184, 0, 0.16); color: var(--accent-ink); }
.action .av.ad { background: rgba(91, 155, 213, 0.16); color: var(--blue); }
.action .ti { flex: 1; min-width: 0; }
.action .ti .n { font-size: 16px; font-weight: 700; }
.action .ti .d { font-size: 13.5px; color: var(--muted); margin-top: 1px; }

.ai-said {
  background: rgba(245, 184, 0, 0.07);
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 11px 14px;
  font-size: 14px; color: var(--text);
  margin-bottom: 12px; line-height: 1.5;
}
.ai-said b { color: var(--accent-ink); }

.big-btn {
  width: 100%; background: var(--gold); color: var(--bg); border: 0;
  padding: 15px; border-radius: 12px;
  font-family: 'Anton', sans-serif; font-size: 16px; text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform 0.15s, background 0.15s;
}
.big-btn:hover { background: var(--gold-d); }
.big-btn:active { transform: scale(0.98); }
.big-btn svg { width: 19px; height: 19px; fill: var(--bg); }

.row2 { display: flex; gap: 8px; margin-top: 8px; }
.row2 button {
  flex: 1; background: transparent;
  border: 1.5px solid var(--line); color: var(--text);
  padding: 12px; border-radius: 12px;
  font-size: 13.5px; font-weight: 700;
}
.row2 button:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

/* ---------- Money line ---------- */

.moneyline {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: center;
  margin-bottom: 18px;
}
.moneyline .big {
  font-family: 'Anton', sans-serif; font-size: 28px;
  color: var(--green); line-height: 1;
}
.moneyline .lbl { font-size: 13.5px; color: var(--muted); margin-top: 8px; }

/* ---------- Leads board ---------- */

.board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) { .board { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .board { grid-template-columns: repeat(5, 1fr); } }

.col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 180px;
}
.col h4 {
  font-family: 'Anton', sans-serif;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  margin-bottom: 10px;
  display: flex; justify-content: space-between;
}
.col h4 .cnt { color: var(--accent-ink); }

.leadcard {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 11px; margin-bottom: 8px;
}
.leadcard.stage-won { border-left-color: var(--green); }
.leadcard.stage-lost { border-left-color: var(--red); opacity: 0.7; }
.leadcard strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.leadcard .meta { font-size: 11.5px; color: var(--muted); }
.leadcard .val {
  display: inline-block; margin-top: 6px;
  font-family: 'Anton', sans-serif; font-size: 13.5px; color: var(--green);
}
.leadcard .book {
  margin-top: 8px;
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  color: var(--accent-ink);
  border-top: 1px solid var(--line); padding-top: 8px;
  cursor: pointer;
}
.leadcard .book svg { width: 12px; height: 12px; fill: var(--accent-ink); }
.leadcard .booked {
  margin-top: 8px; font-size: 10px; color: var(--green);
  border-top: 1px solid var(--line); padding-top: 8px;
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700;
}

.board-empty {
  color: var(--muted); font-size: 13px; text-align: center; padding: 28px 0;
}

.pavaro-credit {
  margin-top: 18px; padding: 12px;
  background: var(--card); border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 12px; color: var(--muted); text-align: center;
}
.pavaro-credit b { color: var(--text); }

/* ---------- Ads ---------- */

.ads-list { margin-top: 6px; }
.ad-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.ad-thumb {
  width: 54px; height: 54px; background: #000;
  border: 1px solid var(--line); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; border-radius: 6px;
}
.ad-thumb svg { width: 22px; height: 22px; fill: var(--accent-ink); }
.ad-row .info { flex: 1; min-width: 0; }
.ad-row .info strong { display: block; font-size: 14px; margin-bottom: 2px; }
.ad-row .info span { font-size: 12px; color: var(--muted); }

.status-pill {
  font-family: 'Anton', sans-serif;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  padding: 6px 11px; border-radius: 6px;
}
.status-pill.live { background: rgba(92, 196, 106, 0.15); color: var(--green); }
.status-pill.paused { background: rgba(245, 184, 0, 0.12); color: var(--accent-ink); }

.ad-toggle {
  font-family: 'Anton', sans-serif;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--gold); color: var(--bg);
  border: 0; padding: 10px 16px; border-radius: 8px;
}
.ad-toggle.off { background: transparent; color: var(--text); border: 1.5px solid var(--line); }

.ad-tired-note {
  margin-top: 10px;
  background: rgba(245, 184, 0, 0.08);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  font-size: 13px; color: var(--text);
}

.prime-note {
  background: linear-gradient(135deg, rgba(245, 184, 0, 0.14), rgba(245, 184, 0, 0.03));
  border: 1px solid rgba(245, 184, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13.5px; color: var(--text);
}
.prime-note b { color: var(--accent-ink); }

/* ---------- My Page ---------- */

.page-editor {
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
@media (min-width: 900px) { .page-editor { grid-template-columns: 1fr 360px; } }

.page-sections {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 12px;
}
.page-sec {
  background: var(--bg2);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px; margin-bottom: 8px;
  cursor: pointer;
  display: flex; align-items: center; gap: 12px;
}
.page-sec:hover { border-color: rgba(245, 184, 0, 0.5); }
.page-sec.picked { border-color: var(--accent-ink); background: rgba(245, 184, 0, 0.07); }
.page-sec.locked { opacity: 0.55; cursor: not-allowed; }
.page-sec .id {
  font-family: 'Anton', sans-serif; font-size: 11px;
  letter-spacing: 0.06em; color: var(--muted);
  background: var(--fill);
  border-radius: 4px; padding: 3px 7px; flex-shrink: 0;
}
.page-sec.picked .id { background: var(--gold); color: var(--bg); }
.page-sec .meta { flex: 1; min-width: 0; }
.page-sec .meta strong { font-size: 14px; display: block; }
.page-sec .meta span { font-size: 12px; color: var(--muted); }

.page-chat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column;
  min-height: 340px;
}
.page-chat .head {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.page-chat .head h3 { font-family: 'Anton', sans-serif; font-size: 15px; text-transform: uppercase; }
.page-chat .head p { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.page-chat .picked-chip {
  margin: 12px 16px 0; padding: 9px 12px;
  background: rgba(245, 184, 0, 0.1); border: 1px solid rgba(245, 184, 0, 0.3);
  border-radius: 8px; font-size: 12px; color: var(--accent-ink);
}
.page-chat .picked-chip.none {
  background: var(--fill); border-color: var(--line); color: var(--muted);
}
.page-chat .messages {
  flex: 1; overflow-y: auto;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
}
.page-chat .msg {
  font-size: 13.5px; line-height: 1.5;
  padding: 10px 12px; border-radius: 8px; max-width: 92%;
}
.page-chat .msg.you {
  background: rgba(91, 155, 213, 0.12); border: 1px solid rgba(91, 155, 213, 0.3);
  align-self: flex-end;
}
.page-chat .msg.bot { background: var(--bg2); align-self: flex-start; }
.page-chat .msg.bot .who {
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 700; margin-bottom: 5px;
}
.page-chat .msg.bot .keep-row {
  margin-top: 10px; display: flex; gap: 7px;
}
.page-chat .mini {
  font-family: 'Anton', sans-serif; text-transform: uppercase;
  font-size: 10px; letter-spacing: 0.05em; padding: 6px 11px; border: 0;
  border-radius: 6px;
}
.page-chat .mini.keep { background: var(--green); color: var(--bg); }
.page-chat .mini.un { background: transparent; border: 1.5px solid var(--line); color: var(--text); }
.page-chat .inputbar {
  padding: 12px 16px; border-top: 1px solid var(--line);
}
.page-chat .inputrow {
  display: flex; gap: 8px; align-items: center;
  border: 1px solid var(--line); background: var(--bg2);
  padding: 7px 9px; border-radius: 8px;
}
.page-chat .inputrow input {
  flex: 1; background: transparent; border: 0; color: var(--text);
  font-family: inherit; font-size: 13.5px; outline: none;
}
.page-chat .mic {
  width: 34px; height: 34px; border-radius: 50%; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 0;
}
.page-chat .mic svg { width: 15px; height: 15px; fill: var(--bg); }
.page-chat .mic.recording { animation: micPulse 1s infinite; }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 184, 0, 0.6); }
  70%      { box-shadow: 0 0 0 10px rgba(245, 184, 0, 0); }
}
.page-chat .publish-row {
  padding: 10px 16px 14px; display: flex; gap: 8px;
}
.page-chat .publish-row button {
  flex: 1; padding: 12px; border: 0; border-radius: 8px;
  font-family: 'Anton', sans-serif; font-size: 13px; text-transform: uppercase;
}
.page-chat .publish-row .publish { background: var(--gold); color: var(--bg); }
.page-chat .publish-row .preview { background: transparent; color: var(--text); border: 1.5px solid var(--line); }

/* ---------- Brand chip (My Page header) ---------- */

.brand-chip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
}
.brand-chip .label {
  font-family: 'Anton', sans-serif; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.brand-chip .mood {
  font-family: 'Anton', sans-serif; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-ink);
}
.brand-chip .swatches { display: flex; gap: 6px; align-items: center; }
.brand-chip .swatch {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.brand-chip .fonts {
  font-size: 12px; color: var(--muted);
  margin-left: auto;
}
.brand-chip .fonts b { color: var(--text); font-weight: 600; }
.brand-chip .using-defaults {
  font-size: 11px; color: var(--muted); font-style: italic;
}
.brand-chip .bg-preview {
  width: 100%; max-width: 100%; height: 110px;
  border-radius: 10px;
  margin-top: 12px;
  background-size: cover; background-position: center;
  border: 1px solid var(--line);
  position: relative;
  flex-basis: 100%;
}
.brand-chip .bg-preview .pill {
  position: absolute; left: 10px; bottom: 10px;
  font-family: 'Anton', sans-serif;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  background: rgba(12, 11, 9, 0.7); color: var(--text);
  padding: 5px 10px; border-radius: 4px;
}

/* ---------- My Page rebuild (iframe preview + talk panel) ---------- */
/*
 * Per MY-PAGE-BUILD-BRIEF.md: the operator sees their REAL landing
 * page (premium gunmetal/gold from the iframe), framed inside the
 * Toolbox chrome (warm dark/yellow operator look). Two aesthetics on
 * purpose. The premium look comes from master-template.html via
 * /api/page/render; everything below styles the chrome around it.
 */

.mp-root {
  display: flex;
  width: 100%;
  /* Eat the #view padding so the iframe goes edge-to-edge. */
  margin: -18px;
  /* On phone, clear topbar AND the global bottomnav so nothing overlaps. */
  min-height: calc(100vh - var(--topbar-h) - var(--bottomnav-h) - env(safe-area-inset-bottom, 0px));
}
@media (min-width: 820px) {
  .mp-root {
    margin: -24px -28px;
    height: calc(100vh - var(--topbar-h));
    min-height: 540px;
  }
}

.mp-preview {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: #08090b;
  overflow: hidden;
}
.mp-preview-bar {
  height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
}
.mp-preview-bar .mp-url { display: flex; align-items: center; gap: 8px; }
.mp-preview-bar .mp-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
}
.mp-preview-bar .mp-url-tag { color: var(--muted); }
.mp-preview-bar .mp-point { color: var(--accent-ink); font-weight: 700; }

.mp-iframe {
  flex: 1; width: 100%; border: 0; background: #0a0b0d;
  /* The iframe content is the operator's actual landing page —
     no scrollbar styling needed; the iframe handles its own scroll. */
}

.mp-talk {
  width: 380px; flex-shrink: 0;
  background: var(--bg2);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
}
.mp-talk-head {
  padding: 16px 18px 0;
  position: relative;
}
.mp-talk-head h2 {
  font-family: 'Anton', sans-serif;
  font-size: 18px; text-transform: uppercase;
  padding-right: 96px;
}
.mp-talk-head p {
  font-size: 12.5px; color: var(--muted); margin-top: 3px;
  line-height: 1.4; padding-right: 96px;
}
.mp-publish {
  position: absolute; top: 14px; right: 16px;
  font-family: 'Anton', sans-serif;
  font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--gold); color: var(--bg);
  border: 0; padding: 10px 18px; border-radius: 8px;
}
.mp-publish:active { transform: scale(0.97); }

.mp-talkbig {
  margin: 14px 18px;
  background: linear-gradient(180deg, #23201b, #15120e);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
  cursor: pointer; user-select: none;
}
.mp-talkbig:active { transform: scale(0.99); }
.mp-talkbig .mp-ring {
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--gold); margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 30px rgba(245, 184, 0, 0.34);
  position: relative;
}
.mp-talkbig .mp-ring svg { width: 30px; height: 30px; fill: var(--bg); }
.mp-talkbig .mp-ring::after {
  content: ''; position: absolute; inset: -7px;
  border-radius: 50%; border: 3px solid var(--gold);
  opacity: 0;
}
.mp-talkbig.recording .mp-ring::after {
  animation: mp-ringpulse 1s infinite; opacity: 1;
}
@keyframes mp-ringpulse {
  0%   { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 0; }
}
.mp-talkbig .mp-talk-title {
  font-family: 'Anton', sans-serif;
  font-size: 18px; text-transform: uppercase;
}
.mp-talkbig .mp-talk-sub {
  font-size: 12.5px; color: var(--muted); margin-top: 5px;
}
.mp-egs {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; margin-top: 12px;
}
.mp-eg {
  background: var(--fill);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 6px 11px; font-size: 11.5px; color: var(--text);
  cursor: pointer;
}
.mp-eg:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

.mp-picked-chip {
  margin: 0 18px 8px;
  padding: 8px 12px; border-radius: 8px;
  font-size: 12px;
  background: rgba(245, 184, 0, 0.1);
  border: 1px solid rgba(245, 184, 0, 0.3);
  color: var(--accent-ink);
}
.mp-picked-chip.none {
  background: var(--fill);
  border-color: var(--line); color: var(--muted);
}
.mp-picked-chip b { color: var(--accent-ink); }

.mp-feed {
  flex: 1; overflow-y: auto;
  padding: 6px 18px 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.mp-msg {
  font-size: 13.5px; line-height: 1.5;
  padding: 10px 12px; border-radius: 9px; max-width: 92%;
}
.mp-msg.you {
  background: rgba(91, 155, 213, 0.12);
  border: 1px solid rgba(91, 155, 213, 0.3);
  align-self: flex-end;
}
.mp-msg.bot {
  background: var(--card); align-self: flex-start;
}
.mp-who {
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 700; margin-bottom: 5px;
  display: flex; align-items: center; gap: 6px;
}
.mp-live {
  font-size: 8px; letter-spacing: 0.08em; color: var(--green);
  background: rgba(92, 196, 106, 0.12);
  padding: 1px 5px; border-radius: 3px;
}
.mp-diff {
  margin-top: 8px;
  background: rgba(245, 184, 0, 0.06);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 9px 11px; font-size: 12.5px;
  line-height: 1.55;
}
.mp-diff b { color: var(--accent-ink); }
.mp-fail {
  margin-top: 8px;
  background: rgba(224, 121, 91, 0.12);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 8px 10px;
  font-size: 12px; white-space: pre-wrap;
}
.mp-keep { margin-top: 11px; display: flex; gap: 7px; }
.mp-mini-keep, .mp-mini-undo {
  font-family: 'Anton', sans-serif;
  text-transform: uppercase; font-size: 10px;
  letter-spacing: 0.05em; padding: 7px 13px; border-radius: 6px;
  border: 0; cursor: pointer;
}
.mp-mini-keep { background: var(--green); color: #06210a; }
.mp-mini-undo {
  background: transparent; border: 1.5px solid var(--line); color: var(--text);
}

.mp-input {
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}
.mp-input-row {
  display: flex; gap: 8px; align-items: center;
  border: 1px solid var(--line); background: var(--card);
  padding: 7px 8px 7px 12px; border-radius: 10px;
}
.mp-input-row input {
  flex: 1; background: transparent; border: 0;
  outline: none; color: var(--text);
  font-family: inherit; font-size: 13.5px;
}
.mp-mic {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; border: 0; cursor: pointer;
}
.mp-mic svg { width: 15px; height: 15px; fill: var(--bg); }
.mp-mic.recording {
  animation: mp-micpulse 1s infinite;
}
@keyframes mp-micpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 184, 0, 0.6); }
  70%      { box-shadow: 0 0 0 9px rgba(245, 184, 0, 0); }
}

/* Publish success overlay */
#mp-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 8, 6, 0.86);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 70; padding: 24px;
}
.mp-overlay-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 34px;
  text-align: center; max-width: 380px;
}
.mp-tick {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-family: 'Anton', sans-serif;
  font-size: 36px; color: #06210a;
}
.mp-overlay-box h3 {
  font-family: 'Anton', sans-serif;
  font-size: 22px; text-transform: uppercase;
  margin-bottom: 8px;
}
.mp-overlay-box p {
  color: var(--muted); font-size: 14px;
  margin-bottom: 20px; line-height: 1.5;
}
.mp-overlay-box code {
  font-family: monospace; font-size: 12px;
  background: var(--bg2); padding: 2px 6px; border-radius: 4px;
  color: var(--text); display: inline-block; margin-top: 4px;
}
.mp-overlay-close {
  font-family: 'Anton', sans-serif; font-size: 13px;
  text-transform: uppercase; background: var(--gold); color: var(--bg);
  padding: 11px 22px; border-radius: 8px; border: 0; cursor: pointer;
}

/* Phone: stack — preview on top, talk below.
 *
 * The reference (my-page-rebuild.html) lets the whole page scroll on
 * phone — we match that. Preview is a fixed slice on top; talk takes
 * its natural height below. The global #bottomnav stays fixed; #main's
 * padding-bottom keeps content clear of it. Operator scrolls the page
 * naturally to reach the input row when the chat fills up. */
@media (max-width: 900px) {
  .mp-root {
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  .mp-preview {
    height: 42vh; min-height: 280px;
    flex: 0 0 auto;
  }
  .mp-talk {
    width: auto;
    flex: 0 0 auto;     /* natural height, page scrolls as it grows */
    border-left: 0; border-top: 1px solid var(--line);
    overflow: visible;
  }
  .mp-talk-head h2,
  .mp-talk-head p { padding-right: 88px; }
  .mp-talk-head h2 { font-size: 17px; }
  .mp-publish { top: 12px; right: 14px; padding: 9px 14px; font-size: 12px; }
  .mp-talkbig { margin: 12px 14px; padding: 14px; }
  .mp-talkbig .mp-ring { width: 56px; height: 56px; margin-bottom: 10px; }
  .mp-talkbig .mp-ring svg { width: 24px; height: 24px; }
  .mp-talkbig .mp-talk-title { font-size: 16px; }
  .mp-egs { margin-top: 10px; }
  .mp-eg { padding: 6px 10px; font-size: 11.5px; }
  .mp-picked-chip { margin: 0 14px 8px; padding: 8px 12px; font-size: 12px; }
  .mp-feed {
    padding: 6px 14px 8px;
    max-height: 320px;  /* keeps chat history bounded; long histories scroll */
  }
  .mp-msg { font-size: 14px; }
  .mp-input { padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); }
}

/* ===========================================================
   My Page v2 — block-and-atom editor (.mpv2-*)
   Per MY-PAGE-BUILD-BRIEF-v2.md / my-page-editor-v2.html.
   Two aesthetics, on purpose: the operator-look Toolbox chrome
   (warm dark + yellow accent) wraps the premium member page
   (gunmetal + gold) which lives inside the iframe.
   =========================================================== */

.mpv2-root {
  display: flex;
  width: 100%;
  margin: -18px;
  min-height: calc(100vh - var(--topbar-h) - var(--bottomnav-h) - env(safe-area-inset-bottom, 0px));
}
@media (min-width: 820px) {
  .mpv2-root {
    margin: -24px -28px;
    height: calc(100vh - var(--topbar-h));
    min-height: 540px;
  }
}

/* ---- Preview (iframe column) ---- */
.mpv2-preview {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: #08090b; overflow: hidden;
}
.mpv2-preview-bar {
  height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
}
.mpv2-url { display: flex; align-items: center; gap: 7px; }
.mpv2-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
}

/* Funnel switcher (multiple landing pages) */
.mpv2-funnel { position: relative; }
.mpv2-funnel-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--fill); color: var(--text);
  font-family: inherit; font-size: 13.5px; font-weight: 700; max-width: 240px;
}
.mpv2-funnel-btn:hover { border-color: var(--gold); }
.mpv2-funnel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpv2-funnel-dots { color: var(--muted); font-weight: 800; letter-spacing: 1px; }
.mpv2-funnel-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 240px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); padding: 6px; display: none;
}
.mpv2-funnel-menu.show { display: block; }
.mpv2-funnel-mlabel {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 6px 10px 4px;
}
.mpv2-funnel-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text); font-family: inherit; font-size: 14px; text-align: left;
}
.mpv2-funnel-item:hover { background: var(--fill); }
.mpv2-funnel-item.on { color: var(--accent-ink); font-weight: 700; }
.mpv2-funnel-tick { color: var(--accent-ink); }
.mpv2-funnel-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.mpv2-funnel-act {
  width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text); font-family: inherit; font-size: 14px; font-weight: 600;
}
.mpv2-funnel-act:hover { background: var(--fill); }
.mpv2-funnel-act.danger { color: var(--red); }
.mpv2-newform { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.mpv2-newnote { font-size: 13px; color: var(--muted); margin-top: 4px; }
.mpv2-newdup-link { color: var(--accent-ink); text-decoration: underline; font-size: 13.5px; margin-top: 6px; display: inline-block; }
/* "Writing your page" loader (generation takes ~a minute). */
.mpv2-genload { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 26px 10px; text-align: center; }
.mpv2-genspin {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--gold);
  animation: mpv2-spin 0.9s linear infinite;
}
@keyframes mpv2-spin { to { transform: rotate(360deg); } }
.mpv2-genmsg { color: var(--text); font-weight: 700; font-size: 15px; }
.mpv2-url-sep { color: var(--line); }
.mpv2-point { color: var(--accent-ink); font-weight: 700; }

/* Attention pulse — fires when the user hits mic / Ask-AI with no
   atom selected, so they see WHERE to click instead of getting a quiet
   message in the bot panel. Short, no layout shift. */
.mpv2-preview.attn {
  box-shadow: inset 0 0 0 2px #f5b800;
  animation: mpv2-attn-pulse 1.4s ease-out;
}
.mpv2-point.attn {
  animation: mpv2-attn-tag 1.4s ease-out;
}
@keyframes mpv2-attn-pulse {
  0%   { box-shadow: inset 0 0 0 2px rgba(245, 184, 0, 0.95); }
  50%  { box-shadow: inset 0 0 0 4px rgba(245, 184, 0, 0.55); }
  100% { box-shadow: inset 0 0 0 2px rgba(245, 184, 0, 0.00); }
}
@keyframes mpv2-attn-tag {
  0%   { transform: scale(1.0); color: var(--accent-ink); }
  35%  { transform: scale(1.18); color: #fff; }
  100% { transform: scale(1.0); color: var(--accent-ink); }
}
.mpv2-bar-actions { display: flex; align-items: center; gap: 8px; }
.mpv2-addbtn {
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  font-weight: 700; color: var(--bg);
  background: var(--gold); border: 0;
  padding: 6px 11px; border-radius: 6px;
}
.mpv2-addbtn:active { transform: scale(0.97); }

/* Theme button — sits next to "Add a block". Quiet by default; the
   four-colour ring tells the operator what it controls without a label. */
.mpv2-themebtn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  font-weight: 700; color: var(--text);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  padding: 6px 11px; border-radius: 6px; cursor: pointer;
}
.mpv2-themebtn:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.mpv2-themebtn:active { transform: scale(0.97); }
.mpv2-theme-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: conic-gradient(#1f242b 0 25%, #c9a24b 25% 50%, #f4f5f7 50% 75%, #0a0b0d 75% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* Theme picker sheet — grid of swatch cards, no free picker. */
/* Bounded scroll area so all 52 themes are reachable inside the centred
   sheet (the heading + Cancel stay put; only the cards scroll). */
.mpv2-theme-scroller {
  max-height: 58vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin: 0 -4px; padding: 2px 4px 6px;
}
.mpv2-themes-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.mpv2-theme-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; color: var(--text); position: relative;
  transition: border-color 0.15s, transform 0.1s;
}
.mpv2-theme-card:hover { border-color: var(--accent-ink); }
.mpv2-theme-card:active { transform: scale(0.99); }
.mpv2-theme-card.active { border-color: var(--accent-ink); background: rgba(245, 184, 0, 0.06); }
.mpv2-theme-card strong { font-size: 14px; color: var(--text); }
.mpv2-theme-desc {
  font-size: 12px; color: var(--muted); line-height: 1.4;
}
.mpv2-theme-swatches { display: flex; gap: 4px; }
.mpv2-theme-sw {
  flex: 1; height: 28px; border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.mpv2-theme-tick {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bg); background: var(--gold);
  padding: 2px 7px; border-radius: 999px; font-weight: 700;
}
.mpv2-iframe {
  flex: 1; width: 100%; border: 0; background: #0a0b0d;
}
/* Stage wraps the iframe so we can swap desktop (fill) ↔ phone (centred frame). */
.mpv2-stage { flex: 1 1 auto; min-height: 0; display: flex; }
.mpv2-stage > .mpv2-iframe { flex: 1 1 auto; width: 100%; }
/* Phone view = a clean narrow column at phone width (the page reflows to its
   mobile layout). No heavy device bezel — just a tidy stream, full height. */
.mpv2-preview.phone .mpv2-stage {
  background: #0a0b0d; align-items: stretch; justify-content: center;
}
.mpv2-preview.phone .mpv2-stage > .mpv2-iframe {
  flex: 0 0 auto; width: 390px; max-width: 100%; height: 100%;
  border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.45); background: #000;
}
/* Desktop / Phone segmented toggle */
.mpv2-view-toggle { display: inline-flex; border: 1px solid var(--line);
  border-radius: 9px; overflow: hidden; margin-right: 4px; }
.mpv2-view-btn { background: var(--card); border: 0; color: var(--muted);
  font-size: 14px; line-height: 1; padding: 7px 11px; cursor: pointer; }
.mpv2-view-btn + .mpv2-view-btn { border-left: 1px solid var(--line); }
.mpv2-view-btn.active { background: rgba(245, 184, 0, 0.14); color: var(--accent-ink); }

/* ---- Talk panel ---- */
.mpv2-talk {
  width: 380px; flex-shrink: 0;
  background: var(--bg2);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
}
.mpv2-talk-head { padding: 14px 18px 0; position: relative; }
.mpv2-talk-head h2 {
  font-family: 'Anton', sans-serif; font-size: 17px;
  text-transform: uppercase; padding-right: 96px;
}
.mpv2-talk-head p {
  font-size: 12px; color: var(--muted); margin-top: 3px;
  line-height: 1.4; padding-right: 96px;
}
.mpv2-publish {
  position: absolute; top: 12px; right: 16px;
  font-family: 'Anton', sans-serif; font-size: 13px;
  letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--gold); color: var(--bg);
  border: 0; padding: 9px 16px; border-radius: 8px;
}
.mpv2-publish:active { transform: scale(0.97); }

/* ---- Editing bar (Type it / Ask AI / Suggest) ---- */
.mpv2-edit-bar {
  margin: 12px 18px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 13px;
}
.mpv2-edit-bar.none { opacity: 0.6; }
.mpv2-what {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 9px;
}
.mpv2-what b { color: var(--accent-ink); }
.mpv2-acts {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px;
}
.mpv2-act {
  font-family: 'Archivo', sans-serif; font-weight: 700;
  font-size: 11.5px;
  border: 1.5px solid var(--line); background: transparent; color: var(--text);
  padding: 10px 6px; border-radius: 9px;
  text-align: center; cursor: pointer;
}
.mpv2-act:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.mpv2-act.primary {
  background: var(--gold); color: var(--bg); border-color: var(--accent-ink);
}
.mpv2-edit-bar.none .mpv2-acts { display: none; }

/* ---- Big talk button (voice / hold-and-talk) ---- */
.mpv2-talkbig {
  margin: 12px 18px;
  background: linear-gradient(180deg, #23201b, #15120e);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  text-align: center; cursor: pointer; user-select: none;
}
.mpv2-talkbig:active { transform: scale(0.99); }
.mpv2-ring {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--gold); margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 26px rgba(245, 184, 0, 0.32);
  position: relative;
}
.mpv2-ring svg { width: 24px; height: 24px; fill: var(--bg); }
.mpv2-ring::after {
  content: ''; position: absolute; inset: -6px;
  border-radius: 50%; border: 3px solid var(--gold); opacity: 0;
}
.mpv2-talkbig.rec .mpv2-ring::after {
  animation: mpv2-pulse 1s infinite; opacity: 1;
}
@keyframes mpv2-pulse {
  0%   { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 0; }
}
.mpv2-talk-title {
  font-family: 'Anton', sans-serif; font-size: 16px; text-transform: uppercase;
}
.mpv2-talk-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---- Chat feed ---- */
.mpv2-feed {
  flex: 1; overflow-y: auto;
  padding: 4px 18px 8px;
  display: flex; flex-direction: column; gap: 9px;
  max-height: 50vh;
}
.mpv2-msg {
  font-size: 13.5px; line-height: 1.5;
  padding: 10px 12px; border-radius: 9px; max-width: 93%;
}
.mpv2-msg.you {
  background: rgba(91, 155, 213, 0.12);
  border: 1px solid rgba(91, 155, 213, 0.3);
  align-self: flex-end;
}
.mpv2-msg.bot { background: var(--card); align-self: flex-start; }
.mpv2-who {
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 700; margin-bottom: 5px;
}
.mpv2-diff {
  margin-top: 8px;
  background: rgba(245, 184, 0, 0.06);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 9px 11px; font-size: 12.5px; line-height: 1.55;
}
.mpv2-diff b { color: var(--accent-ink); }
.mpv2-fail {
  margin-top: 8px;
  background: rgba(224, 121, 91, 0.12);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 8px 10px; font-size: 12px;
  white-space: pre-wrap;
}
.mpv2-sugg { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.mpv2-sugg-opt {
  text-align: left;
  background: var(--fill);
  border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 13px;
  padding: 9px 11px; border-radius: 7px;
  cursor: pointer;
}
.mpv2-sugg-opt:hover { border-color: var(--accent-ink); }
.mpv2-sugg-opt.bad { border-color: var(--red); opacity: 0.7; }
.mpv2-keep { margin-top: 10px; display: flex; gap: 7px; }
.mpv2-keep-yes, .mpv2-keep-undo {
  font-family: 'Anton', sans-serif; text-transform: uppercase;
  font-size: 10px; letter-spacing: 0.05em;
  padding: 7px 13px; border-radius: 6px;
  border: 0; cursor: pointer;
}
.mpv2-keep-yes { background: var(--green); color: #06210a; }
.mpv2-keep-undo {
  background: transparent; border: 1.5px solid var(--line); color: var(--text);
}

/* ---- Input row ---- */
.mpv2-input {
  padding: 11px 18px calc(11px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}
.mpv2-input-row {
  display: flex; gap: 8px; align-items: center;
  border: 1px solid var(--line); background: var(--card);
  padding: 6px 7px 6px 12px; border-radius: 10px;
}
.mpv2-input-row input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--text); font-family: inherit; font-size: 13.5px;
}
.mpv2-mic {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 0; cursor: pointer;
}
.mpv2-mic svg { width: 15px; height: 15px; fill: var(--bg); }
.mpv2-mic.recording { animation: mpv2-micpulse 1s infinite; }
@keyframes mpv2-micpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 184, 0, 0.6); }
  70%      { box-shadow: 0 0 0 9px rgba(245, 184, 0, 0); }
}

/* ---- Add Block sheet (reuses the global Sheet container) ---- */
.mpv2-blocks-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (max-width: 600px) { .mpv2-blocks-grid { grid-template-columns: 1fr; } }
.mpv2-block-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 15px;
  text-align: left; cursor: pointer;
  font-family: inherit; color: var(--text);
}
.mpv2-block-card:hover { border-color: var(--accent-ink); }
.mpv2-block-card strong { display: block; font-size: 14px; }
.mpv2-block-card span {
  display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px;
}

/* ---- Publish success overlay ---- */
#mpv2-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 8, 6, 0.86); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 90; padding: 24px;
}
.mpv2-overlay-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 32px;
  text-align: center; max-width: 360px;
}
.mpv2-tick {
  width: 60px; height: 60px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-family: 'Anton', sans-serif; font-size: 30px; color: #06210a;
}
.mpv2-overlay-box h3 {
  font-family: 'Anton', sans-serif; font-size: 20px;
  text-transform: uppercase; margin-bottom: 8px;
}
.mpv2-overlay-box p {
  color: var(--muted); font-size: 13.5px;
  margin-bottom: 18px; line-height: 1.5;
}
.mpv2-overlay-box code {
  font-family: monospace; font-size: 12px;
  background: var(--bg2); padding: 2px 6px; border-radius: 4px;
  color: var(--text); display: inline-block; margin-top: 4px;
}
.mpv2-overlay-close {
  font-family: 'Anton', sans-serif; font-size: 13px;
  text-transform: uppercase; background: var(--gold); color: var(--bg);
  padding: 11px 22px; border-radius: 8px; border: 0; cursor: pointer;
}

/* ---- Phone responsive (match reference: stack, page scrolls) ---- */
@media (max-width: 900px) {
  .mpv2-root { flex-direction: column; height: auto; min-height: 0; }
  .mpv2-preview { height: 56vh; min-height: 320px; flex: 0 0 auto; }
  .mpv2-talk {
    width: auto; flex: 0 0 auto;
    border-left: 0; border-top: 1px solid var(--line);
  }
  .mpv2-feed { max-height: 30vh; }
  .mpv2-block-card { padding: 12px; }
  /* Full-width solo editor fills the screen on mobile too. */
  .mpv2-root.mpv2-solo .mpv2-preview { height: auto; flex: 1 1 auto; min-height: 70vh; }
  .mpv2-wizard { right: 10px; left: 10px; bottom: 10px; width: auto; max-height: 78vh; }
}

/* ---------- Full-width editor + floating AI help wizard ---------- */
/* The page preview IS the editor and takes the whole panel; the AI is a
   small pop-up helper, opened on demand, never in the way. */
.mpv2-root.mpv2-solo .mpv2-preview { flex: 1 1 auto; }
.mpv2-barbtn, .mpv2-helpbtn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 7px 13px; font-family: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer;
}
.mpv2-barbtn:hover, .mpv2-helpbtn:hover { border-color: var(--accent-ink); }
.mpv2-help-dot { width: 8px; height: 8px; border-radius: 50%;
  background: #3ad17a; box-shadow: 0 0 8px #3ad17a; }
.mpv2-type-aa { font-weight: 800; font-size: 12px; line-height: 1;
  color: var(--accent-ink); letter-spacing: 0.02em; }
/* In the top bar the Publish button is in-flow (the base .mpv2-publish is
   absolutely positioned for the old panel; override that here or it floats
   off-screen and looks "missing"). */
.mpv2-publish-bar {
  position: static; top: auto; right: auto;
  padding: 8px 16px; font-size: 13px; border-radius: 9px; cursor: pointer;
}
/* Floating Ask-AI button (bottom-right), out of the top bar. */
.mpv2-ai-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 69;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg2, #14161a); border: 1px solid var(--line); color: var(--text);
  border-radius: 24px; padding: 11px 18px; font-family: inherit; font-size: 14px;
  font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.mpv2-ai-fab:hover { border-color: var(--accent-ink); }
.mpv2-ai-fab.active { border-color: var(--accent-ink); background: rgba(245, 184, 0, 0.12); }

.mpv2-wizard {
  position: fixed; right: 18px; bottom: 18px; z-index: 70;
  width: min(380px, 92vw); max-height: 72vh;
  background: var(--bg2, #14161a); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  display: none; flex-direction: column; overflow: hidden;
}
.mpv2-wizard.open { display: flex; }
.mpv2-wiz-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.mpv2-wiz-title {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Anton', sans-serif; text-transform: uppercase;
  letter-spacing: 0.04em; font-size: 15px; color: var(--text);
}
.mpv2-wiz-dot { width: 8px; height: 8px; border-radius: 50%;
  background: #3ad17a; box-shadow: 0 0 8px #3ad17a; }
.mpv2-wiz-close {
  background: transparent; border: 0; color: var(--muted);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.mpv2-wiz-close:hover { color: var(--text); }
.mpv2-wiz-lede { color: var(--muted); font-size: 12.5px; line-height: 1.5;
  padding: 10px 14px 0; margin: 0; flex-shrink: 0; }
.mpv2-wizard .mpv2-feed { flex: 1 1 auto; overflow-y: auto; max-height: none;
  padding: 12px 14px; }
.mpv2-wizard .mpv2-input { padding: 10px 12px; border-top: 1px solid var(--line);
  flex-shrink: 0; }
.mpv2-wizard .mpv2-talkbig { margin: 10px 14px 0; flex-shrink: 0; }

/* When the settings sidebar is open, shrink the preview so it all still fits
   beside the sidebar (nothing hidden, the × stays reachable). */
.mpv2-root { transition: padding-right 0.2s ease-out; }
.mpv2-root.settings-open { padding-right: min(360px, 94vw); }
@media (max-width: 900px) { .mpv2-root.settings-open { padding-right: 0; } }

/* Per-section settings: a full-height docked sidebar (GHL-style). */
.mpv2-settings {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 72;
  width: min(360px, 94vw);
  background: var(--bg2, #14161a); border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(100%); transition: transform 0.2s ease-out;
}
.mpv2-settings.open { transform: translateX(0); }
.mpv2-set-dot { width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.mpv2-set-body { flex: 1 1 auto; overflow-y: auto; padding: 4px 14px 20px; }
.mpv2-set-list { display: flex; flex-direction: column; gap: 8px; }
.mpv2-set-add {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px 14px; font-family: inherit; font-size: 14px;
  font-weight: 600; text-align: left; cursor: pointer;
}
.mpv2-set-add:hover { border-color: var(--accent-ink); }
.mpv2-set-add:disabled { opacity: 0.5; }
.mpv2-rev-steps {
  margin: 4px 0 12px; padding-left: 20px; color: var(--muted);
  font-size: 12.5px; line-height: 1.6;
}
.mpv2-rev-steps li { margin-bottom: 7px; }
.mpv2-set-sep {
  margin: 18px 0 10px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px;
}

/* ---- Builder guided tour (coach marks) ---- */
#te-tour { position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
#te-tour.te-dim { background: rgba(12, 11, 9, 0.66); }
.te-tour-ring {
  position: fixed; display: none; border-radius: 10px;
  border: 2px solid var(--gold); box-shadow: 0 0 0 9999px rgba(12, 11, 9, 0.66), 0 0 18px rgba(245, 184, 0, 0.6);
  transition: top 0.18s, left 0.18s, width 0.18s, height 0.18s; pointer-events: none;
}
.te-tour-card {
  position: fixed; width: 320px; max-width: calc(100vw - 28px); pointer-events: auto;
  background: var(--card, #1a1815); color: var(--text, #f5f1e8);
  border: 1px solid var(--gold); border-radius: 14px; padding: 18px 18px 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5); z-index: 9001;
}
.te-tour-step { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); font-weight: 700; }
.te-tour-card h3 { margin: 6px 0 8px; font-size: 18px; }
.te-tour-card p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--muted, #b8b2a6); }
.te-tour-nav { display: flex; align-items: center; gap: 8px; }
.te-tour-skip { margin-right: auto; background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; }
.te-tour-btn {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 9px 16px; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.te-tour-btn:disabled { opacity: 0.4; cursor: default; }
.te-tour-btn.primary { background: var(--gold); border-color: var(--accent-ink); color: #241a06; }
.mpv2-set-input {
  width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 13px; font-family: inherit; font-size: 14px;
  margin-bottom: 10px;
}
.mpv2-set-photos {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px;
}
.mpv2-set-photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: #0c0d10; }
.mpv2-set-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mpv2-set-photo-ctrls {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 2px;
  padding: 4px; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.mpv2-set-photo-ctrls button {
  flex: 1; background: rgba(12,11,9,0.85); border: 1px solid rgba(255,255,255,0.18);
  color: #fff; border-radius: 5px; font-size: 13px; line-height: 1; padding: 4px 0; cursor: pointer;
}
.mpv2-set-photo-ctrls button.rm { color: #e06b4f; border-color: rgba(224,107,79,0.6); }
.mpv2-set-photo-ctrls button:disabled { opacity: 0.35; }
/* Survey builder — centered modal popup */
.te-modal-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px); z-index: 90; }
.te-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(620px, 94vw); max-height: 86vh; z-index: 91;
  background: var(--bg2, #14161a); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; overflow: hidden;
}
.te-modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.te-modal-head h3 { font-family: 'Anton', sans-serif; text-transform: uppercase;
  font-size: 19px; margin: 0; }
.te-modal-lede { color: var(--muted); font-size: 13px; line-height: 1.5; padding: 12px 18px 0; margin: 0; }
.te-modal-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 18px 18px; }
.te-sb-step { border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px;
  background: var(--card); margin-bottom: 12px; }
.te-sb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.te-sb-head strong { font-family: 'Anton', sans-serif; text-transform: uppercase; letter-spacing: 0.04em; }
.te-sb-rm { background: transparent; border: 1px solid rgba(224,107,79,0.6); color: #e06b4f;
  border-radius: 7px; font-size: 12px; padding: 5px 10px; cursor: pointer; }
.te-sb-q { color: var(--muted); font-size: 13px; margin-bottom: 10px; line-height: 1.4; }
.te-sb-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; }
.te-sb-opt.dq { border-color: rgba(224,107,79,0.55); background: rgba(224,107,79,0.06); }
.te-sb-optlabel { font-size: 14px; }
.te-sb-optctrls { display: flex; align-items: center; gap: 8px; }
.te-sb-dq { border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 20px; font-size: 11px; font-weight: 700; padding: 4px 11px; cursor: pointer; }
.te-sb-dq.on { border-color: #e06b4f; color: #e06b4f; background: rgba(224,107,79,0.12); }
.te-sb-x { background: transparent; border: 0; color: #e06b4f; font-size: 13px; cursor: pointer; }
.te-sb-add { background: transparent; border: 1px dashed var(--line); color: var(--text);
  border-radius: 8px; padding: 8px; font-size: 13px; cursor: pointer; width: 100%; }
.te-sb-add:hover { border-color: var(--accent-ink); }
.te-sb-addstep { background: var(--gold); color: var(--bg); border: 0; border-radius: 9px;
  padding: 11px 16px; font-weight: 700; cursor: pointer; width: 100%; margin-top: 4px; }
@media (max-width: 900px) {
  .mpv2-settings { width: min(360px, 94vw); }
}

/* ---------- AI Chase & Wes shell ---------- */

.ai-shell {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 24px; text-align: center;
}
.ai-shell .ico {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-family: 'Anton', sans-serif; font-size: 30px; color: var(--bg);
}
.ai-shell h2 {
  font-family: 'Anton', sans-serif; font-size: 22px;
  text-transform: uppercase; margin-bottom: 8px;
}
.ai-shell p { color: var(--text); font-size: 14.5px; max-width: 560px; margin: 0 auto 8px; line-height: 1.55; }
.ai-shell .coming {
  display: inline-block; margin-top: 14px;
  font-family: 'Anton', sans-serif;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-ink); border: 1px solid var(--gold); border-radius: 6px;
  padding: 6px 12px;
}
.ai-pick {
  display: grid; gap: 14px; grid-template-columns: 1fr; margin: 18px 0;
}
@media (min-width: 700px) { .ai-pick { grid-template-columns: 1fr 1fr; } }
.ai-pick .card {
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 18px; text-align: center;
}
.ai-pick .card .face {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Anton', sans-serif; font-size: 22px; color: var(--bg);
}
.ai-pick .card h3 { font-family: 'Anton', sans-serif; font-size: 17px; text-transform: uppercase; }
.ai-pick .card .role {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 700; margin-top: 3px;
}
.ai-pick .card p { color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.45; }
.ai-pick .card.sel { border-color: var(--accent-ink); background: rgba(245, 184, 0, 0.06); }
.ai-pick .card { cursor: pointer; }

/* AI chat surface (functional shell) */
.ai-chat-real {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
}
.ai-messages {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 120px; max-height: 50vh; overflow-y: auto;
  padding: 4px 2px 8px;
}
.ai-msg-real {
  font-size: 14.5px; line-height: 1.5;
  padding: 11px 14px; border-radius: 10px; max-width: 92%;
}
.ai-msg-real.you {
  background: rgba(91, 155, 213, 0.12);
  border: 1px solid rgba(91, 155, 213, 0.3);
  align-self: flex-end;
}
.ai-msg-real.bot {
  background: var(--bg2);
  align-self: flex-start;
}
.ai-msg-real.bot .who {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 700; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.ai-msg-real.bot .live-pill {
  font-size: 9px; letter-spacing: 0.08em; color: var(--green);
  background: rgba(92, 196, 106, 0.12); padding: 1px 6px; border-radius: 4px;
  font-weight: 700;
}

/* "Try this" chips */
.ai-tries {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 2px 0;
}
.ai-tries .try-chip {
  background: var(--fill);
  border: 1px solid var(--line); color: var(--text);
  padding: 9px 13px; border-radius: 20px;
  font-size: 13px;
}
.ai-tries .try-chip:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

.ai-input {
  padding-top: 12px; margin-top: 10px;
  border-top: 1px solid var(--line);
}
.ai-input .inputrow {
  display: flex; gap: 8px; align-items: center;
  border: 1px solid var(--line); background: var(--bg2);
  padding: 7px 9px; border-radius: 8px;
}
.ai-input .inputrow input {
  flex: 1; background: transparent; border: 0; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
}
.ai-input .mic {
  width: 36px; height: 36px; border-radius: 50%; background: var(--gold);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 0; cursor: pointer;
}
.ai-input .mic svg { width: 16px; height: 16px; fill: var(--bg); }
.ai-input .mic.recording { animation: micPulse 1s infinite; }

/* ---------- PC dashboard widgets (Home expanded) ---------- */

.dash-stats {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-bottom: 18px;
}
@media (min-width: 820px) { .dash-stats { display: grid; } }
.dash-stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 16px;
}
.dash-stat .lbl { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.dash-stat .v {
  font-family: 'Anton', sans-serif; font-size: 26px; margin-top: 6px;
}
.dash-stat .v.green { color: var(--green); }
.dash-stat .v.gold { color: var(--accent-ink); }

/* ---------- Toast / status bar ---------- */

#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bottomnav-h) + 18px);
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; font-size: 13px;
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
@media (min-width: 820px) { #toast { bottom: 24px; } }
#toast.show { opacity: 1; }
#toast.success { border-color: var(--green); }
#toast.error { border-color: var(--red); color: var(--red); }

/* ---------- Sheet (slide-up modal for book-a-time, ad flip, etc.) ---------- */

#sheet-scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 60;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s;
}
#sheet-scrim.show { opacity: 1; pointer-events: auto; }

#sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 61;
  max-height: 80vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.22s ease-out;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.55);
}
@media (min-width: 700px) {
  #sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(520px, 92vw);
    border-radius: 18px;
    border: 1px solid var(--line);
    max-height: 85vh;
  }
  #sheet.show { transform: translate(-50%, -50%) scale(1); }
}
/* Mobile only — the bottom-sheet slide-up. Scoped so it can't override the
   desktop centred transform above (that bug parked the sheet bottom-right). */
@media (max-width: 699.98px) {
  #sheet.show { transform: translateY(0); }
}
#sheet h3 {
  font-family: 'Anton', sans-serif; font-size: 20px;
  text-transform: uppercase; margin-bottom: 4px;
}
#sheet .lede { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
#sheet .chips {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
#sheet .chips button {
  background: var(--card); border: 1.5px solid var(--line); color: var(--text);
  padding: 16px 12px; border-radius: 12px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  text-align: left; line-height: 1.3;
}
#sheet .chips button .when {
  display: block;
  font-family: 'Anton', sans-serif; font-size: 16px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text); margin-bottom: 4px;
}
#sheet .chips button .meta { color: var(--muted); font-size: 12px; }
#sheet .chips button.picked {
  border-color: var(--accent-ink); background: rgba(245, 184, 0, 0.08);
}
#sheet .chips button.picked .when { color: var(--accent-ink); }
#sheet input, #sheet textarea {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  color: var(--text); padding: 12px 14px; border-radius: 10px;
  font-family: inherit; font-size: 14px;
  margin-bottom: 14px;
}
#sheet .actions {
  display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 6px;
}
#sheet .actions .ghost {
  background: transparent; border: 1.5px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 14px; font-family: inherit; font-size: 14px; font-weight: 700;
}
#sheet .actions .primary {
  background: var(--gold); color: var(--bg); border: 0;
  border-radius: 12px; padding: 14px;
  font-family: 'Anton', sans-serif; font-size: 15px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
#sheet .actions .primary:disabled { opacity: 0.4; }
#sheet .warn {
  background: rgba(245, 184, 0, 0.08);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  font-size: 13px; margin-bottom: 14px;
}
#sheet .warn b { color: var(--accent-ink); }

/* ---------- Loading skeleton ---------- */

.loading {
  color: var(--muted); font-size: 13px; padding: 14px 0; text-align: center;
}

/* ---------- Ad Creator (item 5) ---------- */

.adc-root { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; }
.adc-input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.adc-input label {
  font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.adc-ta {
  width: 100%; min-height: 80px; padding: 11px 12px;
  background: var(--field); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 14px; line-height: 1.5; resize: vertical;
}
.adc-ta:focus { outline: none; border-color: var(--accent-ink); }
/* Colour-scheme swatches — pick a palette so two operators never look the same. */
.adc-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; }
.adc-sw {
  position: relative; width: 38px; height: 38px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; padding: 0; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.adc-sw .adc-sw-dot {
  position: absolute; right: 4px; bottom: 4px; width: 11px; height: 11px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.adc-sw.on { border-color: var(--accent-ink); }
/* Per-card story boxes — a line on each carousel photo, in order. */
.adc-cards { margin-top: 14px; }
.adc-card {
  display: flex; align-items: flex-start; gap: 10px; position: relative;
  padding: 8px; margin-bottom: 8px;
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
}
.adc-card-order {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  background: var(--gold); color: var(--bg); font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.adc-card-thumb {
  flex: 0 0 auto; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #000;
}
.adc-card-note {
  flex: 1 1 auto; min-height: 44px; padding: 8px 10px;
  background: var(--field); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 14px; line-height: 1.45; resize: vertical;
}
.adc-card-note:focus { outline: none; border-color: var(--accent-ink); }
.adc-card-note.te-need { border-color: var(--rust, #a8431a); background: rgba(168, 67, 26, 0.12); }
.adc-card-x {
  flex: 0 0 auto; width: 24px; height: 24px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.1); color: var(--text-dim, #aaa); font-size: 16px; line-height: 1;
}
.adc-card-x:hover { background: var(--rust, #a8431a); color: #fff; }
.adc-actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.adc-gen {
  background: var(--gold); color: var(--bg); border: 0;
  padding: 11px 18px; border-radius: 8px;
  font-family: 'Anton', sans-serif; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.adc-gen:disabled { opacity: 0.5; cursor: wait; }
.adc-gen svg { width: 14px; height: 14px; fill: currentColor; }
.adc-status { color: var(--muted); font-size: 13px; }

.adc-results { display: flex; flex-direction: column; gap: 14px; }
.adc-results-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  margin-top: 8px; flex-wrap: wrap;
}
.adc-results-head h2 { font-family: 'Anton', sans-serif; font-size: 20px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); }
.adc-results-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.adc-download {
  background: var(--gold); color: var(--bg); padding: 10px 16px;
  border-radius: 8px; text-decoration: none;
  font-family: 'Anton', sans-serif; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.adc-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

/* ---------- Ad Creator upload zone (drag-and-drop + click) ---------- */

.adc-drop {
  margin-top: 6px; padding: 24px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed var(--line); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; text-align: center;
  transition: border-color 0.15s, background 0.15s;
  color: var(--muted);
}
.adc-drop:hover, .adc-drop:focus-visible {
  border-color: var(--accent-ink); color: var(--text); outline: none;
}
.adc-drop.is-drag {
  border-color: var(--accent-ink); background: rgba(245, 184, 0, 0.06); color: var(--text);
}
.adc-drop.is-uploading { cursor: progress; border-color: var(--accent-ink); background: rgba(245, 184, 0, 0.05); pointer-events: none; }
.te-spin {
  display: inline-block; width: 14px; height: 14px; box-sizing: border-box;
  border: 2px solid rgba(245, 184, 0, 0.3); border-top-color: var(--accent-ink);
  border-radius: 50%; vertical-align: -2px; margin-right: 7px;
  animation: splash-spin 0.7s linear infinite;
}
/* ----- Launch card (Setup: generate page → connect domain → ads) ----- */
.launch-card {
  margin-top: 14px; padding: 6px 20px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--fill);
}
.launch-card-ads { margin-top: 16px; }
.launch-step { display: flex; gap: 16px; padding: 18px 0; }
.launch-card .launch-step + .launch-step { border-top: 1px solid var(--line); }
.launch-num {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #14110d;
  font-family: 'Anton', sans-serif; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.launch-body { flex: 1 1 auto; min-width: 0; }
.launch-title {
  font-family: 'Anton', sans-serif; font-size: 18px; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--text);
}
.launch-sub { font-size: 14px; color: var(--muted); margin-top: 3px; }
.domain-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.domain-row .domain-input { flex: 1 1 240px; height: auto; min-width: 0; }
.domain-row .adc-gen, .domain-row .btn-ghost { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 560px) { .domain-row .adc-gen, .domain-row .btn-ghost { flex: 1 1 100%; } }
.domain-sep {
  margin: 16px 0 4px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 10px;
}
.domain-sep::before, .domain-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.domain-results { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.domain-result {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--fill);
}
.domain-result-name { font-weight: 600; color: var(--text); }
.domain-price { color: var(--muted); font-size: 13px; }
.domain-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent-ink); border: 1px solid var(--accent-ink); border-radius: 5px; padding: 1px 6px;
}
.domain-taken { font-size: 13px; color: var(--muted); margin-left: auto; }
.domain-bought { font-size: 13px; color: #3aaf5c; margin-left: auto; font-weight: 600; }
.domain-buy { margin-left: auto; padding: 7px 18px; }
.adc-drop-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(245, 184, 0, 0.14); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
}
.adc-drop-icon svg { width: 16px; height: 16px; fill: currentColor; }
.adc-drop-title {
  font-family: 'Anton', sans-serif; font-size: 16px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text);
}
.adc-drop-sub { font-size: 13px; }
.adc-drop-link { color: var(--accent-ink); text-decoration: underline; }

.adc-uploads-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  margin-top: 4px;
}
.adc-uploads-grid:empty { display: none; }

/* Cold / Warm / Hot variant headers */
.adc-temp-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.adc-temp-badge {
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
}
.adc-temp-badge.temp-cold { color: #5db0e6; border-color: rgba(93, 176, 230, 0.5); background: rgba(93, 176, 230, 0.1); }
.adc-temp-badge.temp-warm { color: #e0a24f; border-color: rgba(224, 162, 79, 0.5); background: rgba(224, 162, 79, 0.1); }
.adc-temp-badge.temp-hot  { color: #e0644f; border-color: rgba(224, 100, 79, 0.5); background: rgba(224, 100, 79, 0.1); }
.adc-temp-desc { font-size: 12px; color: var(--muted); }
.adc-upload-tile {
  position: relative; aspect-ratio: 1;
  background: #0c0d10; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden;
}
.adc-upload-media {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: #000;
}
.adc-upload-badge {
  position: absolute; top: 6px; left: 6px;
  background: rgba(0, 0, 0, 0.7); color: #f5b800;
  font-size: 9px; letter-spacing: 0.08em; font-weight: 700;
  padding: 2px 5px; border-radius: 3px;
}
.adc-upload-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 4px 6px; font-size: 10px; color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adc-upload-x {
  position: absolute; top: 5px; right: 5px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.adc-upload-x:hover { background: #e0644f; }
.adc-upload-x:disabled { opacity: 0.5; }
.adc-upload-tile.te-sel { outline: 3px solid var(--gold); outline-offset: -1px; }

/* Ads Generator video tiles: a vertical card with a clear "Get transcript"
   action (wider than the square photo tiles so the button reads). */
.adc-upload-tile[data-kind="video"] {
  aspect-ratio: auto; overflow: visible; grid-column: span 2;
  display: flex; flex-direction: column;
}
.adc-upload-tile[data-kind="video"] .adc-upload-media { order: 0; aspect-ratio: 16 / 9; height: auto; }
.adc-upload-tile[data-kind="video"] .adc-upload-name {
  order: 1; position: static; background: none; color: var(--muted);
}
.adc-tx-btn {
  order: 2; margin: 8px; padding: 9px 12px; border: 1px solid var(--gold);
  background: rgba(245, 184, 0, 0.12); color: var(--accent-ink);
  border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.adc-tx-btn:hover { background: rgba(245, 184, 0, 0.2); }
.adc-tx-btn:disabled { opacity: 0.6; cursor: default; }
.adc-tx-status { order: 3; padding: 0 10px 9px; font-size: 11.5px; color: var(--muted); }
.adc-tx-status.working { color: var(--accent-ink); }
.adc-tx-status.ok { color: #5ac26a; }
.adc-tx-status.err { color: #e06b4f; }

/* ---------- Onboarding thumbs + compose/publish bars ---------- */
.adc-thumb-wrap {
  position: relative; aspect-ratio: 1;
  background: #0c0d10; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.adc-thumb { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.adc-thumb-x {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,0.7); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer;
}
.adc-cell {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
}
.adc-publish-bar { border-top: 1px solid var(--line); padding-top: 8px; }

/* Operators panel (admin master controls). */
.op-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.op-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
.op-row.on { border-color: var(--gold); background: rgba(245, 184, 0, 0.06); }
.op-meta { min-width: 0; }
.op-name { font-weight: 800; font-size: 15px; color: var(--text); }
.op-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.op-badge { color: var(--accent-ink); font-weight: 800; font-size: 13px; white-space: nowrap; }

/* Light / dark segmented toggle (Appearance in Business Information). */
.theme-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.theme-seg-btn {
  padding: 10px 20px; background: transparent; color: var(--muted); border: 0;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.theme-seg-btn.on { background: var(--gold); color: #241a06; }
.theme-seg-btn:not(.on):hover { background: var(--fill); color: var(--text); }

/* Manual copy editor (✎ Edit on each ad card / carousel). */
.adc-edit-btn {
  margin-left: auto; padding: 5px 11px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--fill); color: var(--text);
  font-family: inherit; font-size: 12.5px; font-weight: 700;
}
.adc-edit-btn:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.adc-cell-editing { gap: 8px; }
.adc-editform { display: flex; flex-direction: column; gap: 6px; }
.adc-edit-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px;
}
.adc-edit-input, .adc-edit-ta {
  width: 100%; padding: 9px 11px; background: var(--field); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 14px; line-height: 1.5;
}
.adc-edit-ta { resize: vertical; min-height: 120px; }
.adc-edit-input:focus, .adc-edit-ta:focus { outline: none; border-color: var(--accent-ink); }
.adc-edit-caprow { display: flex; align-items: center; gap: 8px; }
.adc-edit-capnum {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold); color: var(--bg); font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.adc-edit-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Clean per-ad footer: route note + Regenerate / Push, pinned to the bottom
   so the buttons line up across the Cold / Warm / Hot cards. */
.adc-card-foot {
  margin-top: auto; display: flex; flex-direction: column; gap: 9px;
  border-top: 1px solid var(--line); padding-top: 11px;
}
.adc-route-note { font-size: 12px; color: var(--muted); line-height: 1.45; }
.adc-card-actions { display: flex; gap: 8px; }
.adc-card-btn {
  padding: 11px 12px; border-radius: 9px; font-family: inherit;
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line); background: var(--fill); color: var(--text);
}
.adc-card-btn.ghost { flex: 0 0 auto; }
.adc-card-btn.primary { flex: 1; background: var(--gold); border-color: var(--accent-ink); color: #241a06; }
.adc-card-btn:hover { filter: brightness(1.08); }
.adc-card-btn:disabled { opacity: 0.6; cursor: default; }
.adc-status.working { color: var(--accent-ink); }
.adc-status.ok { color: #5ac26a; }
.adc-status.err { color: #e06b4f; }

/* Per-ad still-image creative picker */
.adc-imgad { display: flex; flex-direction: column; gap: 8px; }
.adc-imgad-label { font-size: 12.5px; font-weight: 700; color: var(--text); }
.adc-imgad-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.adc-imgad-thumb {
  width: 52px; height: 52px; object-fit: cover; border-radius: 7px;
  border: 2px solid var(--line); cursor: pointer; opacity: 0.85; transition: opacity 0.12s, border-color 0.12s;
}
.adc-imgad-thumb:hover { opacity: 1; }
.adc-imgad-thumb.sel { border-color: var(--accent-ink); opacity: 1; }
.adc-imgad-out { font-size: 12px; color: var(--muted); }
.adc-imgad-out.working { color: var(--accent-ink); }
.adc-imgad-out.err { color: #e06b4f; }
.adc-imgad-preview {
  width: 100%; max-width: 240px; border-radius: 10px; display: block; margin-bottom: 6px;
  border: 1px solid var(--line);
}

/* ---------- Media Library (My Files) ---------- */
.media-quotas { display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.media-quota { flex: 1; min-width: 220px; }
.media-quota-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.media-quota-full { color: #e0644f; font-weight: 700; }
.media-quota-bar { height: 8px; background: var(--fill-2); border-radius: 5px; overflow: hidden; }
.media-quota-fill { height: 100%; background: var(--gold); transition: width 0.2s; }
.media-quota-fill.full { background: #e0644f; }
.media-folder {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
}
.media-folder-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.media-folder-head h2 { font-family: 'Anton', sans-serif; font-size: 18px; text-transform: uppercase; letter-spacing: 0.04em; }
.media-folder-count { font-size: 12px; color: var(--muted); }
.media-folder-actions { margin-left: auto; }
.media-empty { font-size: 13px; color: var(--muted); padding: 6px 0; }

/* Hero photo reposition control */
.mpv2-pos-box {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: #000;
  cursor: grab; touch-action: none; user-select: none;
}
.mpv2-pos-box:active { cursor: grabbing; }
.mpv2-pos-box.contain { cursor: default; }
.mpv2-pos-box img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mpv2-hero-sync {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  font-size: 13px; color: var(--text); line-height: 1.4;
}
.mpv2-hero-sync input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent-ink); flex: 0 0 auto; }

/* "Choose from My Files" picker */
.te-picker {
  position: fixed; inset: 0; z-index: 9200; background: rgba(12, 11, 9, 0.7);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.te-picker-box {
  width: 720px; max-width: 100%; max-height: 84vh; overflow: auto;
  background: var(--card, #1a1815); border: 1px solid var(--line); border-radius: 14px;
}
.te-picker-head {
  position: sticky; top: 0; background: var(--card, #1a1815);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.te-picker-head h3 { margin: 0; font-size: 16px; }
.te-picker-x { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
.te-picker-tile {
  position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  cursor: pointer; background: #0c0d10; transition: border-color 0.12s;
}
.te-picker-tile:hover { border-color: var(--accent-ink); }
.te-picker-tile img, .te-picker-tile video { width: 100%; height: 96px; object-fit: cover; display: block; }
.te-picker-name {
  font-size: 10px; color: #fff; padding: 4px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  position: absolute; bottom: 0; left: 0; right: 0;
}

/* ---------- Facebook feed mock card ---------- */
/* These are the actual Facebook News Feed proportions + colours so a
   member can see exactly how the ad will read in the wild. Strictly
   for preview — no actual Meta integration. */
.fbm-card {
  background: #fff; color: #1c1e21; border-radius: 8px;
  overflow: hidden; border: 1px solid #e4e6eb;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
}
.fbm-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.fbm-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #1877f2; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.fbm-avatar-letter { background: #1877f2; }
.fbm-meta { display: flex; flex-direction: column; min-width: 0; }
.fbm-meta strong { font-size: 14px; color: #050505; font-weight: 600; }
.fbm-sponsored { font-size: 12px; color: #65676b; }
.fbm-bodywrap { padding: 6px 14px 10px; }
.fbm-body {
  font-size: 14px; line-height: 1.45; color: #050505;
  white-space: pre-wrap; margin: 0;
}
/* Clamp to a fixed 6-line block (and reserve that height) so the video preview
   and CTA line up across the Cold / Warm / Hot cards — like Facebook's own
   truncation. min-height keeps short copy from riding up out of line. */
.fbm-body.clamp {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6;
  overflow: hidden; min-height: calc(6 * 1.45em);
}
.fbm-seemore {
  margin-top: 2px; padding: 0; border: 0; background: none; cursor: pointer;
  color: #65676b; font-size: 14px; font-weight: 600; font-family: inherit;
}
.fbm-seemore:hover { text-decoration: underline; }
.fbm-creative {
  position: relative; aspect-ratio: 1.91/1; background: #0c0b09; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 18px 22px;
  background-image: radial-gradient(circle at 30% 35%, rgba(245, 184, 0, 0.20), transparent 55%),
                    radial-gradient(circle at 75% 70%, rgba(168, 132, 47, 0.25), transparent 50%),
                    linear-gradient(180deg, #1f1a14 0%, #0c0b09 100%);
}
/* Composed image ad: show the full ad image at its natural shape (it's already
   the finished creative — logo, brand + headline baked in), not cropped. */
.fbm-creative.fbm-creative-img { padding: 0; background: #000; aspect-ratio: auto; min-height: 180px; }
.fbm-creative-img img { width: 100%; height: auto; object-fit: contain; display: block; }
.fbm-composing { color: #b9b2a4; font-size: 13px; text-align: center; padding: 44px 20px; }

/* Image-ad format toggle (Single / Before & After / Recent work) */
.adc-fmt-bar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.adc-fmt-btn {
  padding: 8px 14px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 999px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.adc-fmt-btn.active { background: var(--gold); border-color: var(--accent-ink); color: #241a06; }
.te-order {
  position: absolute; top: 5px; left: 5px; z-index: 4;
  width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #241a06;
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
/* Swipeable carousel preview in the feed mock — peek of the next card + dots,
   so it reads like a real Facebook carousel. */
.fbm-creative.fbm-carousel { padding: 0; aspect-ratio: auto; background: #0c0b09; display: block; }
.fbm-carousel-track {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 10px 10px 4px; scrollbar-width: none;
}
.fbm-carousel-track::-webkit-scrollbar { display: none; }
.fbm-ccard {
  position: relative; flex: 0 0 86%; scroll-snap-align: center;
  border-radius: 8px; overflow: hidden; background: #000;
}
.fbm-ccard img { width: 100%; height: auto; display: block; }
.fbm-ccard-label {
  position: absolute; top: 10px; left: 10px; background: rgba(0, 0, 0, 0.72); color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 4px;
}
.fbm-cdots { display: flex; gap: 6px; justify-content: center; padding: 8px 0 12px; }
.fbm-cdot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); transition: background 0.15s; }
.fbm-cdot.on { background: var(--gold); }
/* Prev/next arrows over the carousel so every card is checkable without swiping. */
.fbm-carousel { position: relative; }
.fbm-carrow {
  position: absolute; top: 42%; transform: translateY(-50%); z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, opacity 0.15s;
}
.fbm-carrow:hover { background: rgba(0, 0, 0, 0.82); }
.fbm-carrow-prev { left: 8px; }
.fbm-carrow-next { right: 8px; }
.fbm-carrow.hide { opacity: 0; pointer-events: none; }
.fbm-creative-play {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(245, 184, 0, 0.92); color: #1a1408;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.fbm-creative-play svg { width: 22px; height: 22px; fill: currentColor; margin-left: 3px; }
.fbm-creative-headline {
  font-family: 'Anton', Impact, sans-serif; font-size: 22px;
  text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.1;
  color: #fff; max-width: 86%;
}
.fbm-creative-tag {
  position: absolute; bottom: 12px; left: 14px;
  font-size: 11px; letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.55);
}
.fbm-cta-bar {
  display: flex; align-items: center; gap: 10px;
  background: #f0f2f5; padding: 10px 14px;
}
.fbm-cta-url { flex: 1; min-width: 0; }
.fbm-cta-domain { font-size: 11px; color: #65676b; text-transform: uppercase; letter-spacing: 0.04em; }
.fbm-cta-headline {
  font-size: 14px; font-weight: 600; color: #050505;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fbm-cta-btn {
  background: #e4e6eb; border: 0; border-radius: 6px;
  padding: 8px 14px; font-weight: 600; color: #050505; cursor: pointer;
  font-family: inherit; font-size: 14px;
}
.fbm-angle-tag {
  padding: 8px 14px; font-size: 11px; color: var(--muted);
  letter-spacing: 0.05em; text-transform: uppercase;
  background: #fff; border-top: 1px solid #e4e6eb;
}
