/* ═══════════════════════════════════════════════════════════════════════════
 * 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);
  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: #FFF6E5; border: 1px solid #F5D9A8; 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; }

/* ── 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);
}
