/* ═══════════════════════════════════════════════════════════════════════════
 * SIGNATURE EDITOR — brand skin (owner's Figma language, Aug 25).
 * Loads LAST on index.html only. The owner's editor frames are deliberately
 * incomplete shells; per NEXT-TASKS the agent applies the brand language over
 * the EXISTING working editor. Kill-the-blue phase 3: token remap retires
 * every var()-driven blue, the rules below retire the literals.
 * The rendered signature inside #mockWrap is untouched — it carries its own
 * inline styles (email doctrine) and must keep looking like real output.
 * ═══════════════════════════════════════════════════════════════════════ */

:root {
  --blue: #FB8221;
  --blue-soft: #FFF3E7;
  --accent: #FB8221;
  --accent-strong: #F4761B;   /* AA-safe orange for small text on light */
  --accent-deep: #FE6111;
  --grad: linear-gradient(90deg, #FB8221, #FA962B);
  --eb-line: #FCD9B6;
  --eb-soft: #FFF6EE;
  --eb-shadow: rgba(251, 130, 33, .28);
}

/* type: 42dot Sans is the default face (owner type rule) */
body, button, input, select, textarea { font-family: '42dot Sans', -apple-system, system-ui, sans-serif; }

/* ── brand lockup, top-left (owner #6) ── */
.brand-logo-link { display: block; min-width: 0; }
.brand-logo-link img { height: 24px; width: auto; max-width: 100%; object-fit: contain; display: block; }
@media (max-width: 1080px) {
  .brand-logo-link img { height: 20px; }
}
@media (max-width: 740px) {
  .brand-logo-link { flex: 0 0 auto; }
  .brand-logo-link img { height: 18px; width: auto; max-width: 110px; }
}

/* ── sidebar tabs: the frame's outlined pill with a soft orange wash ── */
.tab.active {
  background: linear-gradient(150deg, rgba(251, 130, 33, .12), rgba(255, 255, 255, .03) 62%);
  border-color: var(--eb-line);
}
.tab.active .tab-ic { background: var(--grad); color: #fff; box-shadow: 0 4px 10px var(--eb-shadow); }
.dash-link:hover { background: var(--eb-soft); color: var(--accent-strong); }
.sig-actions button:hover { background: var(--blue-soft); color: var(--blue); border-color: var(--eb-line); }

/* ── inputs, switches, chips ── */
.txt:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(251, 130, 33, .13); }
.switch input:checked + .knob { background: var(--grad); box-shadow: 0 0 10px rgba(251, 130, 33, .5); }
.switch input:focus-visible + .knob { box-shadow: 0 0 0 3px rgba(251, 130, 33, .45); }
.chip.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(251, 130, 33, .15); }
.btn-chip.selected { border: 1px solid var(--blue); box-shadow: 0 0 0 3px rgba(251, 130, 33, .12); }

/* ── section headers: soft orange icon tile (frame) ── */
.sec-chip { background: var(--blue-soft); color: var(--blue); }

/* ── primary CTAs ── */
.primary {
  background: var(--grad);
  color: var(--on-brand, #FFFFFF);
  box-shadow: 0 0 0 4px rgba(251, 130, 33, .15), 0 6px 16px rgba(251, 130, 33, .32);
}
#quickSave.attention {
  border-color: var(--blue); color: var(--blue);
  box-shadow: 0 0 0 3px rgba(251, 130, 33, .18);
}

/* ── export modal v2 (owner task #5): Safari notice, Gmail preview with a
   Desktop/Mobile toggle, three actions ── */
.modal.export-v2 { max-width: 660px; width: calc(100vw - 28px); }
.export-v2 .xm-top { display: flex; align-items: center; gap: 10px; padding-right: 34px; }
.export-v2 .xm-top h2 { flex: 1; min-width: 0; margin: 0; }
.xm-tut { margin: 0; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 12.5px; flex: 0 0 auto; }
.xm-warn {
  display: flex; align-items: center; gap: 9px; margin: 12px 0;
  background: #FFF4EA; border: 1px solid #FBD4AE; color: #8A5B00;
  border-radius: 10px; padding: 10px 13px; font-size: 12.5px; font-weight: 600;
}
.xm-warn svg { flex: 0 0 auto; }
.xm-prevwrap { position: relative; margin-bottom: 14px; }
.xm-seg { position: absolute; top: 8px; right: 8px; z-index: 2; }
.xm-stage { display: flex; justify-content: center; }
.xm-frame {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; background: #fff;
  overflow: hidden; box-shadow: 0 10px 30px rgba(16, 24, 40, .08);
}
.xm-frame.phone { width: 320px; border-radius: 24px; border-width: 6px; border-color: #16181d; }
.xm-ghead {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: #fff;
  font-weight: 700; font-size: 13.5px; color: #5f6368;
}
.xm-subject { padding: 12px 14px 4px; font-weight: 800; font-size: 15px; }
.xm-chip { background: #EFEFF1; color: var(--ink-2); border-radius: 5px; font-size: 10px; font-weight: 600; padding: 2px 7px; vertical-align: 2px; }
.xm-sender { display: flex; gap: 9px; padding: 8px 14px; font-size: 12px; }
.xm-sender small { color: var(--ink-2); }
.xm-av {
  width: 30px; height: 30px; border-radius: 50%; background: #1a73e8; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto;
}
.xm-skel { padding: 6px 14px 2px; }
.xm-skel i { display: block; height: 8px; border-radius: 5px; background: #EFEFF1; margin-bottom: 7px; }
.xm-sig { padding: 12px 14px 16px; overflow: hidden; }
.xm-sig-inner { display: inline-block; }
.xm-main { display: flex; gap: 10px; }
.xm-main .primary.big { flex: 1; }
.ghost-btn.big { padding: 12px 22px; font-size: 14px; margin: 0; }
.xm-share { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.xm-share-btn { margin: 10px 0 0; }

/* ── AI Video (Pro, Aug 26): panel controls + generate/preview modal ── */
.ai-gen-btn, .ai-regen-btn { width: 100%; margin-top: 8px; justify-content: center; display: inline-flex; align-items: center; gap: 7px; }
.ai-regen-btn { font-size: 12.5px; }
.modal.ai-video-modal { max-width: 560px; width: calc(100vw - 28px); }
.ai-video-modal .xm-top { display: flex; align-items: center; gap: 10px; padding-right: 34px; }
.ai-video-modal .xm-top h2 { flex: 1; min-width: 0; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--blue); }
.avm-hero { display: flex; gap: 16px; align-items: flex-start; margin: 6px 0 4px; }
.avm-thumb {
  width: 96px; height: 96px; object-fit: cover; border-radius: 14px; flex: 0 0 auto;
  border: 1px solid var(--eb-line); box-shadow: 0 6px 18px rgba(251, 130, 33, .14);
}
.avm-lead h3 { margin: 2px 0 6px; font-size: 16.5px; }
.avm-lead p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; color: var(--ink-2, #6B7280); }
.avm-count { margin: 10px 0 4px; font-size: 12.5px; }
.avm-count b { color: var(--accent-strong); }
.avm-empty { margin: 12px 0 4px; font-size: 13px; line-height: 1.55; background: var(--eb-soft); border: 1px solid var(--eb-line); border-radius: 12px; padding: 12px 14px; }
.avm-empty a { color: var(--accent-strong); font-weight: 700; }
.avm-gen { text-align: center; padding: 26px 8px 12px; }
.avm-bar {
  height: 8px; border-radius: 999px; background: var(--blue-soft);
  overflow: hidden; margin: 6px 0 16px; position: relative;
}
.avm-bar i {
  position: absolute; inset: 0; border-radius: 999px; background: var(--grad); width: 40%;
  animation: avmSlide 1.4s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}
@keyframes avmSlide { from { left: -10%; } to { left: 70%; } }
@media (prefers-reduced-motion: reduce) { .avm-bar i { animation: none; width: 100%; left: 0; opacity: .6; } }
.avm-status { font-weight: 700; font-size: 14px; min-height: 20px; }
.avm-result { text-align: center; }
.avm-video {
  max-width: 100%; max-height: 300px; border-radius: 14px; background: #000;
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(16, 24, 40, .1);
}
.ai-video-modal .modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ai-video-modal .primary.big { flex: 1; min-width: 200px; }
.ai-video-modal .primary.big small { display: block; font-size: 10.5px; font-weight: 600; opacity: .85; margin-top: 2px; }

/* ── layout cards + the AI Animated chip (frame: orange fade) ── */
.ai-badge {
  background: var(--grad);
  box-shadow: 0 3px 8px var(--eb-shadow);
}
.layout-card:hover { border-color: var(--eb-line); }
.layout-card.selected {
  border-color: var(--blue);
  background: linear-gradient(150deg, rgba(251, 130, 33, .12), rgba(255, 255, 255, .03) 62%);
  box-shadow: 0 0 0 3px rgba(251, 130, 33, .16), 0 10px 26px rgba(251, 130, 33, .12);
}
.layout-card.selected::after {
  background: var(--grad);
  box-shadow: 0 0 0 7px rgba(255, 255, 255, .6), 0 10px 24px rgba(251, 130, 33, .45);
}
