/* Layout concept: a print shop's light table. Navy brand bar on top, the form on the left,
   the flyer pages on a cool paper-gray table on the right. Square corners, like the print system. */
:root {
  --bg: #ECEAF1;          /* the light table the pages sit on */
  --panel: #ffffff;
  --panel-2: #f5f6f8;
  --line: #d6dbe3;
  --line-2: #c3cad5;
  --text: #172033;
  --muted: #586378;
  --brand: #3E3979;
  --brand-2: #524C99;
  --on-brand: #ffffff;
  --gold: #A85F00;        /* gold darkened for text contrast on white */
  --gold-soft: #F9A532;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --tip-bg: #EFEDF8;
  --ok: #17663f;
  --shadow-page: 0 1px 2px rgba(16, 24, 40, .10), 0 8px 24px rgba(16, 24, 40, .10);
  --focus: 0 0 0 3px rgba(62, 57, 121, .35);
  --r: 3px;
  --font: "Gilroy", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* Always light: the app no longer follows the computer's dark mode. */


* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#app { height: 100%; display: flex; flex-direction: column; }

/* ---------- Brand bar ---------- */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: linear-gradient(180deg, #463F87 0%, #3E3979 100%);
  color: #fff; min-height: 64px; display: flex; align-items: center; gap: 14px;
  padding-block: 10px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  box-shadow: inset 0 -3px 0 #F9A532, 0 1px 0 rgba(0,0,0,.04);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: #3E3979; }
.bar-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex-shrink: 0; border-radius: 2px; }
.bar-brand:focus-visible { outline: 2px solid #F9A532; outline-offset: 4px; }
/* App logo: a flyer-page mark and the MRI Flyer Studio wordmark */
.bar-mark { width: 34px; height: 17px; flex-shrink: 0; display: block; }
.bar-word { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; line-height: 1; }
.bar-word b { font-size: 20px; font-weight: 800; letter-spacing: .02em; color: #fff; }
.bar-word span { font-size: 17px; font-weight: 600; letter-spacing: -.005em; color: #FCE3B4; }
@media (max-width: 420px) { .bar-word span { display: none; } }
.bar-title { font-weight: 700; font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar-sep { width: 1px; align-self: stretch; background: rgba(195, 173, 116, .55); margin: 6px 2px; }
.bar-spacer { flex: 1; }
.bar .save-state { font-size: 13px; color: #DCD8EC; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.bar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.bar .btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-weight: 700; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; touch-action: manipulation; }
.btn:hover { background: var(--panel-2); border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: #F9A532; border-color: #F9A532; color: #27224F; }
.btn-primary:hover { background: #FBBC5E; border-color: #FBBC5E; }
.btn-blue { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-blue:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--panel-2); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 36px; min-height: 36px; padding: 0; }
.btn-icon.btn-sm { width: 32px; min-height: 32px; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Home ---------- */
.home { flex: 1; overflow: auto; padding-block: 32px 72px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.home-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; }
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: center; gap: 24px; padding: 40px 44px; border-radius: 6px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #4A4490 0%, rgba(62,57,121,0) 55%), linear-gradient(100deg, #2F2B63 0%, #3E3979 60%, #4A4490 100%); box-shadow: inset 0 -4px 0 #F9A532; }
.hero-kicker { margin: 0 0 12px; font-size: 15px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: #F9A532; }
.hero h1 { margin: 0; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; max-width: 16ch; }
.hero-sub { margin: 12px 0 24px; font-size: 17px; line-height: 1.45; color: #E6E3F2; max-width: 50ch; }
.hero-cta { min-height: 52px; padding: 0 24px; font-size: 17px; background: #F9A532; border-color: #F9A532; color: #27224F; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.hero-cta:hover { background: #FBBC5E; border-color: #FBBC5E; }
.hero-cta svg { width: 20px; height: 20px; }
.hero-art { position: relative; height: 210px; }
.hero-sheet { position: absolute; top: 10px; width: 132px; height: 170px; padding: 10px; background: #fff; border-radius: 3px; box-shadow: 0 14px 30px rgba(20, 16, 60, .35); display: grid; place-items: stretch; }
.hero-sheet .mini { width: 100%; height: 100%; }
.hero-sheet.s1 { left: 6px; transform: rotate(-9deg); top: 26px; }
.hero-sheet.s2 { left: 150px; transform: rotate(8deg); top: 26px; }
.hero-sheet.s3 { left: 78px; transform: rotate(-1deg); top: 4px; z-index: 2; }
.lib { display: flex; flex-direction: column; gap: 16px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lib-head h2 { margin: 0; font-size: 22px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 10px; }
.lib-n { font-size: 13px; font-weight: 800; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.lib-search { width: min(280px, 100%); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: var(--line-2); box-shadow: 0 10px 28px rgba(16,24,40,.12); transform: translateY(-2px); }
.card-open { all: unset; cursor: pointer; display: flex; flex-direction: column; }
.card-open:focus-visible { box-shadow: inset var(--focus); }
.card-thumb { aspect-ratio: 8.5 / 11; background: var(--bg); position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.ct-page { position: absolute; left: 0; top: 0; width: 816px; height: 1056px; transform: scale(var(--k, 0.28)); transform-origin: 0 0; pointer-events: none; }
.card-body { padding: 14px 16px 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-name { font-weight: 800; font-size: 17px; line-height: 1.25; color: var(--text); overflow-wrap: anywhere; }
.card-addr { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 10px 16px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.card-when { display: flex; gap: 8px; align-items: center; }
.card-pages { font-weight: 700; color: var(--text); }
.card-acts { display: flex; gap: 2px; margin-left: auto; }
.card-acts .btn { gap: 5px; padding: 0 8px; color: var(--muted); }
.card-acts .btn svg { width: 15px; height: 15px; }
.card-acts .btn:hover { color: var(--text); }
.card-acts .btn-danger:hover { color: var(--danger); }
@media (max-width: 760px) { .hero { grid-template-columns: minmax(0, 1fr); padding: 28px 24px; } .hero-art { display: none; } .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; } }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--muted); border-radius: 2px; }
.empty { border: 1px dashed var(--line-2); background: var(--panel); padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; border-radius: var(--r); }
.empty h2 { margin: 0; font-size: 22px; color: var(--text); }
.empty p { margin: 0; color: var(--muted); max-width: 46ch; }

/* ---------- Editor ---------- */
.editor { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); }
.form { overflow: auto; background: var(--panel); border-right: 1px solid var(--line); min-width: 0; }
.preview { overflow: auto; min-width: 0; display: flex; flex-direction: column; }
.tabs { display: none; }

.sec { border-bottom: 1px solid var(--line); }
/* Step flow: one step of the form at a time */
.form { display: flex; flex-direction: column; }
.step-top { position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 6px; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; font-size: 14px; }
.step:hover { color: var(--text); background: var(--panel-2); }
.step.is-on { color: var(--text); border-bottom-color: var(--brand); }
.step-n { flex-shrink: 0; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-2); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.step-n svg { width: 14px; height: 14px; }
.step.is-on .step-n { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.step.is-done:not(.is-on) .step-n { border-color: var(--ok); color: var(--ok); }
.step-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-body { flex: 1; }
.step-nav { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; background: var(--panel); border-top: 1px solid var(--line); }
.step-nav .btn { min-height: 42px; padding: 0 18px; font-size: 15px; }
.sec.is-static { border-bottom: 1px solid var(--line); }
.sec-st { margin: 0; padding: 18px 18px 8px; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sec.is-static .sec-b { padding-top: 6px; }
.more { border-top: 1px solid var(--line); }
.more:first-child { border-top: 0; }
.more-t { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; background: none; border: 0; text-align: left; font-weight: 700; font-size: 14px; color: var(--brand); }
.more-t .chev { display: inline-flex; transform: rotate(-90deg); transition: transform .15s; }
.more-t[aria-expanded="true"] .chev { transform: none; }
.more-b { display: flex; flex-direction: column; gap: 12px; padding: 2px 0 14px; }
.quick-cta { margin: 16px 18px 0; display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: calc(100% - 36px); text-align: left; background: var(--tip-bg); border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--text); }
.quick-cta:hover { border-color: var(--brand); }
.quick-cta > svg { flex-shrink: 0; color: var(--brand); width: 22px; height: 22px; }
.quick-cta span span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.quick-cta b { font-size: 14.5px; }
.seg .sel-seg { width: auto; flex: 0 0 auto; min-height: 34px; height: 34px; font-weight: 700; font-size: 13.5px; padding-right: 28px; }
.sel-seg.is-on { background-color: var(--brand); color: var(--on-brand); border-color: var(--brand); }
@media (max-width: 420px) { .step-l { font-size: 12.5px; } .step { gap: 5px; } }
.sec-h { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: none; border: 0; text-align: left; }
.sec-h:hover { background: var(--panel-2); }
.sec-title { font-weight: 800; font-size: 15px; flex: 1; display: flex; align-items: center; gap: 8px; }
.sec-sub { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%; }
.sec-h .chev { transition: transform .2s; color: var(--muted); }
.sec[data-open="true"] .sec-h .chev { transform: rotate(180deg); }
.sec-b { padding: 4px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--muted); }
.count.bad { background: var(--danger-bg); color: var(--danger); border-color: transparent; }

.row { display: grid; gap: 10px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1.6fr .7fr 1fr; }
.row-price { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 13px; font-weight: 700; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.inp, .sel, .ta {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--panel); color: var(--text); font-weight: 600; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.inp::placeholder, .ta::placeholder { color: var(--muted); opacity: .75; font-weight: 500; }
.inp:hover, .sel:hover, .ta:hover { border-color: var(--muted); }
.inp:focus, .sel:focus, .ta:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.ta { resize: vertical; min-height: 96px; line-height: 1.45; }
.sel { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.inp.is-flag { border-color: var(--danger); }
.prefix { position: relative; }
.prefix > span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.prefix > .inp { padding-left: 22px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; min-height: 32px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--r); font-weight: 700; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.li-n { font-size: 12px; font-weight: 800; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.li-act { display: flex; gap: 2px; }
.li-act .btn { color: var(--muted); }
.li-act .btn:hover { color: var(--text); }
.stat-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.space-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 90px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.fact-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 6px; align-items: center; }
.charc { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.charc.over { color: var(--warn); font-weight: 700; }
.addrow { align-self: flex-start; }
.note { font-size: 13px; color: var(--muted); background: var(--panel-2); border-left: 3px solid var(--gold-soft); padding: 8px 10px; }

/* Photos */
.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); background: var(--panel-2); transition: border-color .15s, background .15s; }
.drop.is-over { border-color: var(--brand); background: var(--tip-bg); color: var(--text); }
.drop strong { color: var(--text); }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ph { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); display: flex; flex-direction: column; min-width: 0; }
.ph.is-hero { border-color: var(--gold-soft); box-shadow: inset 0 3px 0 var(--gold-soft); }
.ph-img { position: relative; aspect-ratio: 4 / 3; background: var(--panel-2); overflow: hidden; }
.ph-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-img img.is-plan { object-fit: contain; background: #fff; }
.ph-badges { position: absolute; left: 6px; top: 6px; right: 6px; display: flex; gap: 4px; flex-wrap: wrap; pointer-events: none; }
.badge { height: 20px; padding: 0 6px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; letter-spacing: .04em; border-radius: 2px; background: rgba(1, 34, 72, .86); color: #fff; }
.badge.gold { background: #F9A532; color: #27224F; }
.badge.warn { background: #fff1c7; color: #6b4600; }
.ph-b { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ph-b .inp, .ph-b .sel { min-height: 34px; font-size: 13.5px; padding: 5px 8px; }
.ph-b .sel { padding-right: 26px; }
.ph-acts { display: flex; gap: 2px; justify-content: space-between; flex-wrap: wrap; }
.ph-acts .ph-txt { flex: 1 1 40%; justify-content: flex-start; padding: 0 6px; gap: 4px; font-size: 12.5px; font-weight: 700; }
.ph-acts .ph-txt svg { width: 15px; height: 15px; }
.ph-acts .btn { color: var(--muted); }
.ph-acts .btn:hover { color: var(--text); }
.ph-acts .btn[aria-pressed="true"] { color: var(--gold); }
.adj { grid-column: 1 / -1; border: 1px solid var(--brand); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); }
.adj-stage { position: relative; background: #fff; border: 1px solid var(--line); user-select: none; touch-action: none; cursor: crosshair; }
.adj-stage img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: contain; pointer-events: none; }
.adj-dot { position: absolute; width: 22px; height: 22px; transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 0 0 2px #3E3979, 0 1px 6px rgba(0,0,0,.4); border-radius: 50%; pointer-events: none; }
.adj-pin { position: absolute; transform: translate(-50%, calc(-100% - 6px)); pointer-events: none; background: #3E3979; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 5px 11px; border: 2px solid #fff; border-radius: 999px; box-shadow: 0 2px 6px rgba(4,18,40,.35); }
.adj-pin::after { content: ''; position: absolute; left: 50%; top: 100%; width: 8px; height: 8px; margin: 2px 0 0 -4px; border-radius: 50%; background: #F9A532; border: 2px solid #fff; box-sizing: border-box; }
.adj-pin.is-poi::after { background: #3E3979; }
.adj-pin.is-traffic::after { display: none; }
.adj-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adj-row input[type=range] { flex: 1; accent-color: var(--brand); min-width: 120px; }

/* Pages */
.pages-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); }
.pg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line); }
.pg:last-child { border-bottom: 0; }
.pg-name { font-weight: 700; font-size: 14px; }
.pg-sub { font-size: 12.5px; color: var(--muted); }
.pg.is-missing .pg-name { color: var(--muted); }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 11px; background: var(--line-2); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.switch input:disabled + span { opacity: .45; }

/* ---------- Preview ---------- */
.pv-head { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 14px 24px 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pv-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tpls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tpl { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; padding: 9px 10px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); min-width: 0; }
.tpl:hover { border-color: var(--line-2); }
.tpl[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.tpl-name { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tpl-why { font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.tpl-pick { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #27224F; background: #F9A532; padding: 2px 5px; border-radius: 2px; }
.mini { width: 44px; height: 57px; background: #fff; border: 1px solid #c9ced8; display: flex; flex-direction: column; overflow: hidden; }
.mini i { display: block; flex-shrink: 0; }
.mini .ph1 { background: #F6B84C; }
.mini .bd { background: #3E3979; }
.mini .tx { background: #dfe3ea; margin: 2px 4px 0; height: 3px; }
.mini .split { flex: 1; display: grid; grid-template-columns: 42% 1fr; gap: 3px; margin-top: 3px; }
.mini .split i:first-child { background: #F6B84C; }
.mini .split i:last-child { background: repeating-linear-gradient(#dfe3ea 0 3px, transparent 3px 6px); margin-top: 1px; }
.mini .ft { margin-top: auto; height: 6px; background: #3E3979; }
.auto-note { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.issues { display: flex; flex-direction: column; gap: 6px; }
.issue { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; padding: 7px 10px; border-radius: var(--r); background: var(--tip-bg); text-align: left; border: 0; width: 100%; color: var(--text); font-weight: 600; }
.issue.warn { background: var(--warn-bg); }
.issue.block { background: var(--danger-bg); }
.issue svg { margin-top: 1px; }
.issue.warn svg { color: var(--warn); }
.issue.block svg { color: var(--danger); }
.issue.tip svg { color: var(--brand); }
.issues-toggle { font-size: 13px; font-weight: 700; color: var(--muted); background: none; border: 0; padding: 0; display: inline-flex; gap: 6px; align-items: center; }

.pv-pages { padding: 24px 24px 80px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.pv-item { display: flex; flex-direction: column; gap: 8px; }
.pv-cap { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pv-cap .over { color: var(--danger); letter-spacing: 0; text-transform: none; font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.pv-scaler { position: relative; box-shadow: var(--shadow-page); background: #fff; overflow: hidden; }
.pv-zoom { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.pv-divider { display: flex; flex-direction: column; gap: 2px; border-top: 2px solid var(--line-2); padding-top: 14px; margin-top: 8px; }
.pv-divider span { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.pv-divider small { color: var(--muted); font-size: 13px; }
.pv-item.is-over .pv-scaler { outline: 2px solid var(--danger); outline-offset: 3px; }
.zoom { display: flex; gap: 4px; }

/* ---------- Menus, toasts, overlays ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: min(340px, calc(100vw - 32px)); background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 16px 40px rgba(16,24,40,.22); padding: 6px; display: flex; flex-direction: column; }
.menu button { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; padding: 10px; border: 0; background: none; border-radius: var(--r); }
.menu button:hover, .menu button:focus-visible { background: var(--panel-2); }
.menu b { display: block; font-size: 14.5px; }
.menu small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

.toast-wrap { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100vw - 32px)); }
.toast { pointer-events: auto; background: #27224F; color: #fff; border-left: 4px solid #F9A532; padding: 10px 12px 10px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 12px 30px rgba(0,0,0,.25); font-weight: 600; font-size: 14px; animation: toast-in .22s ease-out; max-width: 100%; }
.toast.err { border-left-color: #ff8a7a; }
.toast .linkish { color: #FCE3B4; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(8, 14, 24, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: var(--panel); color: var(--text); width: min(440px, 100%); border-radius: var(--r); border-top: 4px solid #F9A532; padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.dialog h2 { margin: 0; font-size: 20px; }
.dialog p { margin: 0; color: var(--muted); }
.dialog-acts { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.progress { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); transition: width .25s ease-out; }

.banner { background: var(--warn-bg); color: var(--text); padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); font-size: 14px; font-weight: 600; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }

.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Narrow screens: Edit / Preview tabs ---------- */
@media (max-width: 1000px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  /* Kept laid out off screen, not removed: the flyer still fits itself, warns when too full, and downloads correctly from the Edit tab */
  .editor[data-tab="edit"] .preview { position: fixed; left: -20000px; top: 0; width: 100vw; height: 100vh; visibility: hidden; pointer-events: none; }
  .editor[data-tab="preview"] .form { display: none; }
  .form { border-right: 0; }
  .tabs { display: flex; gap: 4px; background: var(--panel); border-bottom: 1px solid var(--line); padding: 6px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px)); }
  .tabs button { flex: 1; min-height: 40px; border: 0; background: none; font-weight: 800; border-bottom: 3px solid transparent; color: var(--muted); }
  .tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
  .pv-head { padding: 12px 16px; position: static; backdrop-filter: none; background: var(--bg); }
  .pv-pages { padding: 16px 16px 80px; }
}
@media (max-width: 560px) {
  .tpl { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 6px; padding: 8px; }
  .tpl .tpl-why { display: none !important; }
  .mini { width: 34px; height: 44px; }
  .zoom { display: none; }
  .bar-title, .bar-sep { display: none; }
  .bar .save-state span { display: none; }
  .photos { grid-template-columns: minmax(0, 1fr); }
  .row-3, .row-price { grid-template-columns: 1fr 1fr; }
  .row-3 > :first-child, .row-price > :first-child { grid-column: 1 / -1; }
  .stat-row { grid-template-columns: 92px minmax(0, 1fr) auto; }
  .space-row { grid-template-columns: minmax(0, 1fr) 80px auto; }
  .space-row .sp-rate { display: none; }
  .btn-label-wide { display: none; }
}
/* Reduced motion: see the motion system at the end of this file. */

/* ---------- Print: just the pages, at true size ---------- */
@page { size: letter; margin: 0; }
@media print {
  html, body { height: auto; background: #fff; }
  body::before { display: none; }
  .bar, .form, .tabs, .pv-head, .pv-cap, .toast-wrap, .banner, .overlay { display: none !important; }
  #app, .editor, .preview { display: block !important; height: auto !important; overflow: visible !important; }
  .pv-pages { padding: 0 !important; gap: 0 !important; display: block !important; }
  .pv-social, .pv-divider { display: none !important; }
  .pv-item { display: block !important; break-after: page; page-break-after: always; }
  .pv-item.is-lastpage { break-after: auto; page-break-after: auto; }
  .pv-scaler { width: 8.5in !important; height: 11in !important; box-shadow: none !important; outline: 0 !important; }
  .pv-zoom { transform: none !important; }
}

/* Preview header: one-line layout summary */
.layout-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.layout-line b { font-size: 15px; }
.layout-line .auto-note { font-size: 13px; }

/* AI helpers */
.ai-card { background: linear-gradient(0deg, var(--panel), var(--panel)), var(--panel); }
.ai-card .sec-b { padding-top: 16px; }
.ai-head { display: flex; gap: 12px; align-items: flex-start; }
.ai-head b { font-size: 15px; }
.ai-mark { flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center; background: var(--tip-bg); color: var(--brand); border: 1px solid var(--line); border-radius: var(--r); }
.ai-mark svg { width: 17px; height: 17px; }
.ai-checks { display: block; margin-top: 4px; }
.draft { display: flex; flex-direction: column; gap: 12px; }
.draft-part { border: 1px solid var(--line); border-left: 3px solid var(--gold-soft); padding: 10px 12px; background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.draft-part ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.draft-part p { margin: 0; font-size: 14px; line-height: 1.5; }
.draft-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.review li { border: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.review li.is-done { opacity: .6; }
.review-f { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.review-fix { color: var(--ok); font-weight: 600; }
.review-a .hint { display: inline-flex; align-items: center; gap: 4px; }
.review-a .hint svg { width: 14px; height: 14px; }
.pdf-row { display: flex; gap: 8px; align-items: center; }
.pdf-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 13.5px; font-weight: 600; max-width: 100%; }
.pdf-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog .inp { width: 100%; }

/* Type-aware suggestions */
.sugg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; background: var(--panel-2); border-left: 3px solid var(--gold-soft); }
.sugg-l { width: 100%; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border: 1px dashed var(--line-2); background: var(--panel); color: var(--text); font-weight: 700; font-size: 13px; border-radius: 999px; }
.chip svg { width: 13px; height: 13px; color: var(--brand); }
.chip:hover { border-style: solid; border-color: var(--brand); }

/* "Filled by Claude" tags */

/* Review step */
.sum { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.sum-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sum-l { font-weight: 800; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.sum-v { min-width: 0; overflow-wrap: anywhere; }
.sum-v.is-empty { color: var(--warn); font-weight: 700; }
.issue.ready { color: var(--ok); }
.ai-unchecked .linkish { margin-left: 6px; }
.dl { display: flex; flex-direction: column; gap: 8px; }
.dl button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--r); cursor: pointer; }
.dl button svg { flex-shrink: 0; width: 22px; height: 22px; }
.dl button b { display: block; font-size: 15px; }
.dl button small { display: block; font-size: 13px; font-weight: 500; margin-top: 2px; }
.dl-main { background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand); min-height: 64px; }
.dl-main small { color: color-mix(in srgb, var(--on-brand) 80%, transparent); }
.dl-main:hover:not(:disabled) { background: var(--brand-2); }
.dl-alt { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); }
.dl-alt small { color: var(--muted); }
.dl-alt svg { color: var(--brand); }
.dl-alt:hover:not(:disabled) { border-color: var(--brand); }
.dl button:disabled { opacity: .55; cursor: progress; }
.settings-in { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.sub-h { margin: 4px 0 0; font-size: 14px; font-weight: 800; }

/* Preview: the spot on the flyer for the field being edited */
.pv-pages .pv-focus { outline: 6px solid #f0b400; outline-offset: 5px; background-color: rgba(255, 214, 102, .22); border-radius: 2px; transition: outline-color .2s; }

/* Cover layout picker (preview header) */
.layout-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.layout-pick .pv-label { margin-right: 4px; }
.lp { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; min-height: 44px; border: 1.5px solid var(--line-2); background: var(--panel); border-radius: var(--r); color: var(--text); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.lp:hover { border-color: var(--brand); }
.lp.is-on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--tip-bg); }
.lp .mini { width: 26px; height: 34px; flex-shrink: 0; }
.lp-best { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6b4e00; background: #fff4d6; border: 1px solid #ecd9a3; padding: 1px 6px; border-radius: 999px; }

/* Pages list */
.pg-check { width: 20px; height: 20px; accent-color: var(--brand); flex-shrink: 0; margin: 0; cursor: pointer; }
.pg-check:disabled { cursor: default; }
.pg.is-off .pg-name { color: var(--muted); text-decoration: line-through; }
.pg-per { display: flex; flex-direction: column; gap: 6px; }
.pg-more { padding-top: 2px; }

/* Optional sub-sections shown open */
.more.is-flat { border-top: 1px solid var(--line); padding-top: 12px; }
.more.is-flat:first-child { border-top: 0; padding-top: 0; }
.more.is-flat > .more-b { padding-bottom: 8px; }
.ai-act { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

.pv-item { scroll-margin-top: var(--pv-head, 140px); }

/* Top-bar download: one click for the PDF, arrow for other formats */
.split { display: flex; }


/* ==========================================================================
   Motion
   One set of tokens. Motion only explains something: where you are going
   (steps, views), what just appeared (menus, dialogs, pages, results), or
   what just changed (AI-filled fields). Only transform and opacity animate.
   ========================================================================== */
:root {
  /* Durations: NN/g (100ms presses, 200-300ms panels, under 400ms for views), IBM Carbon, Material 3.
     Mid-range rather than fast, because the people using this are not power users. Exits ~0.6-0.7x enters. */
  --t-press: 100ms;     /* button press */
  --t-fast: 150ms;      /* menus; small things leaving */
  --t-med: 260ms;       /* steps, dialogs, cards, toasts */
  --t-slow: 320ms;      /* whole views */
  /* Easing: IBM Carbon "productive" curves, made for task-focused interfaces. */
  --ease-out: cubic-bezier(0, 0, 0.38, 0.9);      /* entering: quick start, gentle stop */
  --ease-in: cubic-bezier(0.2, 0, 1, 0.9);        /* leaving: gets out of the way */
  --ease-move: cubic-bezier(0.2, 0, 0.38, 0.9);   /* moving on screen */
  --d-1: 6px;           /* small rise */
  --d-2: 24px;          /* step slide (Material shared axis uses 30dp) */
  --s-pop: 0.97;        /* menu/dialog start scale */
}
@media (prefers-reduced-motion: reduce) {
  /* Keep gentle fades (they explain change without movement); remove travel and scaling. */
  :root { --d-1: 0px; --d-2: 0px; --s-pop: 1; --t-med: 150ms; --t-slow: 150ms; }
  .card:hover { transform: none; }
  .btn:active, .chip:active, .lp:active, .dl button:active { transform: none !important; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(var(--d-1)); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(var(--s-pop)) translateY(calc(var(--d-1) * -0.5)); } to { opacity: 1; transform: none; } }
@keyframes slide-fwd { from { opacity: 0; transform: translateX(var(--d-2)); } to { opacity: 1; transform: none; } }
@keyframes slide-back { from { opacity: 0; transform: translateX(calc(var(--d-2) * -1)); } to { opacity: 1; transform: none; } }
@keyframes fall-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(var(--d-1)); } }
/* "Yellow fade": show at once, hold ~1s, fade ~1.2s. Color only, so it works with reduced motion too. */
@keyframes glow { 0% { background-color: rgba(255, 214, 102, 0); box-shadow: 0 0 0 0 rgba(240, 180, 0, 0); } 6%, 45% { background-color: rgba(255, 214, 102, .45); box-shadow: 0 0 0 3px rgba(240, 180, 0, .5); } 100% { background-color: rgba(255, 214, 102, 0); box-shadow: 0 0 0 0 rgba(240, 180, 0, 0); } }

/* Views: home and editor settle in */
.home-inner { animation: rise-in var(--t-slow) var(--ease-out) backwards; }
.editor { animation: fade-in var(--t-slow) var(--ease-out) backwards; }

/* Home cards: a short stagger on first load only (not while searching), capped so a big library doesn't wait */
.grid.is-filtering .card { animation: none; }
.card { animation: rise-in var(--t-med) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 35ms + 80ms); }
.card { transition: border-color .15s, box-shadow var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out); }

/* Steps: content slides in the direction you're going; the underline glides */
.stepper { position: relative; }
.step { border-bottom-color: transparent !important; }
.step-ind { position: absolute; left: 0; bottom: 0; width: 25%; height: 3px; background: var(--brand); transform: translateX(calc(var(--at, 0) * 100%)); transition: transform var(--t-med) var(--ease-move); pointer-events: none; }
.step-body { animation: fade-in var(--t-med) var(--ease-out) backwards; }
.step-body[data-dir="fwd"] { animation-name: slide-fwd; }
.step-body[data-dir="back"] { animation-name: slide-back; }

/* Menus, dialogs, toasts: appear from where they belong; leave faster than they arrive */
.menu { transform-origin: top right; animation: pop-in var(--t-fast) var(--ease-out) backwards; }
.overlay { animation: fade-in var(--t-fast) var(--ease-out) backwards; }
.overlay .dialog { animation: pop-in var(--t-med) var(--ease-out) backwards; }
.toast { animation: rise-in var(--t-med) var(--ease-out) backwards; }
.toast.is-leaving { animation: fall-out var(--t-fast) var(--ease-in) forwards; }

/* Preview: a new page, or a new cover layout, fades in where it lands */
.pv-item { animation: fade-in var(--t-med) var(--ease-out) backwards; }
.issues { animation: rise-in var(--t-fast) var(--ease-out) backwards; }
.lp, .chip { transition: border-color .15s, background-color .15s, transform var(--t-press) var(--ease-out); }

/* Things that just opened or arrived */
#sec-quick, .draft-part, .review li, .ai-card .issue, #sec-quick .issue { animation: rise-in var(--t-med) var(--ease-out) backwards; }
.draft-part:nth-child(2), .review li:nth-child(2) { animation-delay: 50ms; }
.draft-part:nth-child(3), .review li:nth-child(3) { animation-delay: 100ms; }
.review li:nth-child(n+4) { animation-delay: 150ms; }
.ph { animation: fade-in var(--t-fast) var(--ease-out) backwards; }
.save-state > * { animation: fade-in var(--t-fast) var(--ease-out) backwards; }

/* Presses: a small, quick response */
.btn, .dl button { transition: background .15s, border-color .15s, color .15s, transform var(--t-press) var(--ease-out); }
.btn:active:not(:disabled), .chip:active, .lp:active, .dl button:active:not(:disabled) { transform: scale(0.98); }

/* What the AI (or a fix) just filled in: a soft gold glow that fades over a second */
.flash { animation: glow 2400ms linear; animation-delay: var(--flash-delay, 0ms); border-radius: var(--r); }

/* De-bloat: quieter preview header, compact photo bar, single cover label */
.pv-head { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.pv-zoom-t { color: var(--muted); }
.pv-zoom-t svg { width: 16px; height: 16px; }
.drop.is-compact { flex-direction: row; justify-content: flex-start; padding: 10px 12px; gap: 10px; }
.drop.is-compact > svg { width: 18px; height: 18px; color: var(--muted); }
.drop-t { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.ph-is-cover { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 6px; font-size: 12.5px; font-weight: 800; color: var(--gold); flex: 1 1 40%; }
.ph-is-cover svg { width: 15px; height: 15px; }
.chip-more { border-style: solid; color: var(--brand); }

/* Marker editor */
.adj-stage.is-marking { cursor: copy; }
.adj-stage .adj-pin { pointer-events: auto; cursor: grab; white-space: nowrap; max-width: 60%; overflow: visible; text-overflow: ellipsis; z-index: 1; }
.adj-stage .adj-pin:active { cursor: grabbing; }
.adj-pin.is-poi { background: #fff; color: #172033; letter-spacing: 0; text-transform: none; font-weight: 800; }
.adj-pin.is-traffic { transform: translate(-50%, -50%); background: #F9A532; color: #2F2B63; }
.adj-pin.is-sel { box-shadow: 0 0 0 3px #f0b400, 0 2px 8px rgba(0,0,0,.35); z-index: 2; }
.mk-kinds { display: flex; flex-direction: column; gap: 6px; }
.mk-kinds .seg button { display: inline-flex; align-items: center; gap: 6px; }
.mk-sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
.mk-sw.is-site { background: #3E3979; border-radius: 50%; box-shadow: inset 0 0 0 2px #F9A532; }
.mk-sw.is-poi { background: #fff; border: 2px solid #3E3979; border-radius: 50%; }
.mk-sw.is-traffic { background: #F9A532; }
.mk-edit { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--panel-2); border-left: 3px solid #f0b400; animation: rise-in var(--t-fast) var(--ease-out) backwards; }
.mk-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-chip.is-sel { border-color: #f0b400; box-shadow: 0 0 0 2px rgba(240, 180, 0, .35); }
.mk-edit .inp { flex: 1 1 100% !important; }

/* Aerial tools */
.ph-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.ph-mono { font-size: 13px; min-height: 28px; }
img.is-mono { filter: grayscale(1) contrast(1.12) brightness(1.04); }

/* One sign-off per step for everything AI filled in */
.ai-step { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 12px; background: #fff8e6; border: 1px solid #f0d68a; border-radius: 10px; font-size: 14px; color: var(--text); }
.ai-step > span:nth-child(2) { flex: 1 1 180px; }
/* A PDF dragged over the AI box */
.ta.is-over { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(62, 57, 121, .18); background: #F6F4FB; }
/* The rotate button stands out when the photo check says the picture is sideways */
.ph-txt.is-nudge { color: #8a5a00; background: #fff4d6; }

/* ---------- Editor header: one calm bar, a slim connected stepper ---------- */
.bar .bar-back { border-color: transparent; padding-left: 8px; padding-right: 10px; color: #E6E3F2; }
.bar .bar-back:hover { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.bar.is-editor .bar-sep { margin: 10px 2px; background: rgba(255, 255, 255, .22); }
.bar .btn-primary:disabled { background: rgba(255, 255, 255, .1); border-color: transparent; color: rgba(255, 255, 255, .5); opacity: 1; }
.bar-tabs { display: none; }
.stepper { display: flex; align-items: center; gap: 0; padding: 0 18px; }
.step { flex: 0 0 auto; min-height: 50px; padding: 0 2px; gap: 8px; border-bottom: 0 !important; border-radius: 8px; }
.step.is-on { color: var(--text); }
.step:hover .step-l { color: var(--text); }
.step-n { transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.step-line { flex: 1 1 12px; min-width: 10px; height: 2px; margin: 0 10px; border-radius: 1px; background: var(--line-2); transition: background var(--t-med) var(--ease-out); }
.step-line.is-past { background: var(--brand); }
@media (max-width: 1000px) {
  .bar.is-editor .bar-word span { display: none; }
  .bar-tabs { display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, .12); flex-shrink: 0; }
  .bar-tabs button { min-height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: #E6E3F2; font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
  .bar-tabs button[aria-selected="true"] { background: #fff; color: #27224F; }
  .bar-tabs-n { min-width: 18px; padding: 0 5px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: 11.5px; line-height: 18px; text-align: center; }
  .bar-tabs button[aria-selected="true"] .bar-tabs-n { background: rgba(39, 34, 79, .1); }
  .stepper { max-width: 640px; margin: 0 auto; }
}
@media (max-width: 560px) {
  .bar.is-editor .bar-word { display: none; }
  .bar-tabs button { padding: 0 10px; }
  .step-l { font-size: 13px; }
  .step-line { margin: 0 6px; }
}
@media (max-width: 420px) { .step:not(.is-on) .step-l { display: none; } }

/* Photos step: the offer to fetch aerials */
.aerial-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding: 14px 16px; border: 1px solid #D5D0EA; border-left: 4px solid var(--brand); border-radius: 10px; background: #F6F4FB; }
.aerial-ic { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--brand); color: #fff; }
.aerial-ic svg { width: 20px; height: 20px; }
.aerial-t { flex: 1 1 220px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.aerial-t b { font-size: 15.5px; font-weight: 800; color: var(--text); }
.aerial-t span { font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.aerial-card .btn { min-height: 40px; padding: 0 16px; flex-shrink: 0; }

/* Photos step: adding photos is the main action; the aerial offer sits beside it as a helper */
.drop { flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 14px; text-align: left; padding: 16px; border: 2px dashed #B3ACD6; border-radius: 10px; background: #fff; }
.drop.is-over { border-color: var(--brand); background: #F6F4FB; }
.drop-ic { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--brand); color: #fff; }
.drop-ic svg { width: 20px; height: 20px; }
.drop-t { flex: 1 1 220px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.drop-t b { font-size: 20px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.drop-t span { font-size: 13.5px; line-height: 1.4; color: var(--muted); font-weight: 500; }
.drop .btn { min-height: 40px; padding: 0 16px; flex-shrink: 0; }
.aerial-card { border: 1px solid var(--line); background: #fff; box-shadow: 0 1px 2px rgba(39, 34, 79, .05); padding: 16px; }
.aerial-ic { background: #EAE7F5; color: var(--brand); }

/* AI helper buttons that deserve a second look */
.btn-ai { min-height: 40px; padding: 0 16px; font-size: 14.5px; border-color: var(--brand); color: var(--brand); background: #F6F4FB; }
.btn-ai:hover { background: #EAE7F5; border-color: var(--brand); }
.btn-ai svg { color: var(--brand); }
.ph-tools { margin-top: 12px; }

/* Editor bar: the flyer's name gets the spare room */
.bar.is-editor .bar-title { flex: 1 1 0; min-width: 72px; }
.bar.is-editor .bar-spacer { flex: 0 0 2px; }
@media (max-width: 900px) { .bar.is-editor .save-state span { display: none; } }
@media (max-width: 760px) { .bar.is-editor .bar-back .btn-label-wide { display: none; } }

/* Editor bar on narrow screens: drop the name and the word "Download" before anything gets cut off */
@media (max-width: 720px) {
  .bar.is-editor .bar-title, .bar.is-editor .bar-sep { display: none; }
  .bar.is-editor .bar-spacer { flex: 1 1 2px; }
}
@media (max-width: 480px) { .bar.is-editor .bar-tabs-n { display: none; } .bar.is-editor .save-state { display: none; } }
#f-status:focus { outline: 2px solid #f0b400; outline-offset: 3px; border-radius: 4px; }

/* Editor bar on phones: tighter spacing so nothing is cut off, down to 320px wide */
@media (max-width: 480px) {
  .bar.is-editor { gap: 6px; padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
  .bar.is-editor .bar-back { padding-left: 6px; padding-right: 6px; }
  .bar.is-editor .bar-tabs button { padding: 0 9px; font-size: 13px; }
}
@media (max-width: 420px) { .bar.is-editor .bar-brand { display: none; } }

/* Photos waiting to be sorted */
.note.note-wait { background: #fff8e6; border-left-color: #f0b400; color: var(--text); }
.badge.wait { background: #27224F; color: #fff; }
.review-a { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }


/* ---- CHL additions ---- */
[hidden] { display: none !important; }
.bar-logo { height: 30px; width: auto; display: block; }
.mini.chl { background: linear-gradient(115deg, #FDD27A 0%, #F6B84C 62%, #5B4B86 100%); border-color: #d9b25a; padding: 5px 4px 0; }
.mini.chl i { background: #3E3979; height: 3px; margin: 0 0 3px; border-radius: 1px; }
.mini.chl i.w { background: rgba(255, 255, 255, .7); height: 9px; margin-top: 3px; }
.mini.chl.is-purple { background: linear-gradient(160deg, #6C5BA6, #2C2861); }
.mini.chl.is-purple i { background: #fff; }
.mini.chl.is-purple i.w { background: #F9A532; }
.lp img.lp-art { width: 26px; height: 34px; object-fit: cover; object-position: 72% 40%; display: block; border: 1px solid var(--line-2); flex-shrink: 0; }
.lp i.lp-sw { width: 26px; height: 34px; display: block; border: 1px solid var(--line-2); flex-shrink: 0; }
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kinds button { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; min-height: 44px; border: 1.5px solid var(--line-2); background: var(--panel); border-radius: var(--r); font-weight: 800; font-size: 14px; color: var(--text); transition: border-color .15s, background-color .15s; }
.kinds button small { font-weight: 500; font-size: 12px; color: var(--muted); line-height: 1.3; }
.kinds button:hover { border-color: var(--brand); }
.kinds button[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--tip-bg); }
.kinds-h { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 -4px; }
.picked { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; color: var(--brand); }
.alt { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.checkline { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.point { display: flex; flex-direction: column; gap: 6px; }
.reads { font-size: 13.5px; padding: 9px 12px; background: var(--tip-bg); border-radius: var(--r); color: var(--text); font-weight: 600; }
.offstage { position: absolute; left: -99999px; top: 0; }
.ct-page.is-wide { transform: scale(calc(var(--k, 0.28) * 0.7727)); top: 22%; }

.hero-notes { display: block; width: 100%; max-width: 560px; min-height: 92px; font: 500 16.5px/1.45 var(--font); padding: 13px 15px; border: 0; border-radius: 6px; resize: vertical; background: #fff; color: var(--text); margin: 0 0 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.hero-notes:focus { outline: 3px solid #F9A532; outline-offset: 1px; }
.hero-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-blank { background: none; border: 0; padding: 0; color: #E6E3F2; font-weight: 700; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.hero-blank:hover { color: #fff; }
.hero .hero-sub { margin-bottom: 16px; }
.say { padding: 10px 18px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); }
.say-row { display: flex; align-items: center; gap: 8px; }
.say-row > svg { flex-shrink: 0; color: var(--brand); width: 18px; height: 18px; }
.say-row .inp { flex: 1; min-width: 0; }
.capbox { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.capbox label { font-size: 13px; font-weight: 700; }
.capbox .ta { min-height: 110px; font-size: 14.5px; }
.logo-chip { width: 44px; height: 44px; object-fit: contain; background: #fff; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px; }
.dl .more-t { align-self: flex-start; }
.dl .dl-main + .dl-main { background: var(--panel); color: var(--brand); border: 2px solid var(--brand); }
.dl .dl-main + .dl-main small { color: var(--muted); }
.dl .dl-main + .dl-main:hover:not(:disabled) { background: var(--tip-bg); }

/* Icon picker on list items */
.li.has-ico { grid-template-columns: 40px minmax(0, 1fr) auto; }
.icopick { position: relative; }
.icobtn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #F59200; color: #fff; display: grid; place-items: center; padding: 0; }
.icobtn:hover { box-shadow: 0 0 0 3px rgba(245, 146, 0, .3); }
.icobtn svg, .icomenu svg { width: 21px; height: 21px; }
.icomenu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: 340px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 14px 34px rgba(39, 34, 79, .2); }
.icomenu button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid transparent; background: none; border-radius: 6px; color: var(--brand); }
.icomenu button:hover { background: var(--panel-2); }
.icomenu button.is-on { border-color: var(--brand); background: var(--tip-bg); }
.icomenu small { font-size: 10.5px; line-height: 1.15; color: var(--muted); text-align: center; }
.icomenu .auto { font-weight: 800; font-size: 13px; height: 21px; display: grid; place-items: center; }

/* Click-to-change on the flyer: a soft hover outline says "this can be changed"; the field's words glow while you type */
.pv-pages.is-pickable .fl-page { cursor: pointer; }
.pv-pages .pv-hover { outline: 4px solid rgba(245, 146, 0, .55); outline-offset: 4px; border-radius: 3px; }
.pv-pages .pv-focus { outline: 5px solid #F59200; outline-offset: 5px; background-color: rgba(253, 227, 167, .35); border-radius: 3px; }
.pv-tip { align-self: center; display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 12px; padding: 7px 14px; border-radius: 999px; background: #FFF6E0; color: #7A4B00; font-weight: 700; font-size: 13.5px; box-shadow: 0 0 0 1px #F5D58F; animation: rise-in var(--t-med) var(--ease-out) 600ms backwards; }
.pv-tip svg { width: 16px; height: 16px; }

.sec-note { margin: -4px 0 4px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.kind-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 15px; }
.kind-line .kind-l { color: var(--muted); font-weight: 600; }
.ready-card { display: flex; gap: 14px; align-items: flex-start; margin: 16px 20px 0; padding: 14px 16px; background: #F1FAF3; border: 1px solid #BFE3C8; border-radius: 8px; animation: rise-in var(--t-slow) var(--ease-out) 150ms backwards; }
.ready-card b { display: block; font-size: 16px; color: #1D5A2E; margin-bottom: 2px; }
.ready-card span { font-size: 14px; color: #2F4A36; line-height: 1.45; }
.ready-mark { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #2E8B4A; color: #fff; display: grid; place-items: center; animation: pop-check 420ms var(--ease-out) 300ms backwards; }
.ready-mark svg { width: 18px; height: 18px; stroke: #fff; }
@keyframes pop-check { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: none; } }
.dl .is-done { border-color: #2E8B4A !important; }
.dl .dl-main.is-done { background: #2E8B4A !important; color: #fff; }
.dl .is-done svg { animation: pop-check 380ms var(--ease-out) backwards; }
.review-wait { display: flex; gap: 6px; padding: 4px 2px; }
.review-wait i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); opacity: .25; animation: dot 1.1s ease-in-out infinite; }
.review-wait i:nth-child(2) { animation-delay: .15s; } .review-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .review-wait i { animation: none; opacity: .6; } .ready-mark, .dl .is-done svg { animation: none; } }

/* What AI just changed glows on the flyer too, in a quick ripple, then fades */
@keyframes flyer-glow { 0% { outline-color: rgba(245, 146, 0, 0); background-color: rgba(253, 227, 167, 0); } 12%, 50% { outline-color: rgba(245, 146, 0, .85); background-color: rgba(253, 227, 167, .45); } 100% { outline-color: rgba(245, 146, 0, 0); background-color: rgba(253, 227, 167, 0); } }
.pv-pages .pv-glow { outline: 5px solid rgba(245, 146, 0, 0); outline-offset: 5px; border-radius: 3px; animation: flyer-glow 2200ms linear backwards; animation-delay: var(--glow-delay, 0ms); }
/* A step that's done gets its check with a small pop */
.step.is-done:not(.is-on) .step-n svg { animation: pop-check 360ms var(--ease-out) backwards; }
/* Switching looks: the new design settles in instead of snapping */
.pv-page { animation: look-in var(--t-slow) var(--ease-out) backwards; }
@keyframes look-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pv-page { animation: fade-in 150ms ease-out backwards; } .step.is-done .step-n svg { animation: none; } }

/* Talk / add a photo: quiet text buttons under the notes box, so the main button stays the main button */
.hero-tools, .fill-tools, .say-tools { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 16px; }
.fill-tools { margin: 0; } .say-tools { margin: 6px 0 0; }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 2px; border: 0; background: none; font: 700 14px/1.2 var(--font); color: var(--brand); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(62, 57, 121, .3); text-underline-offset: 3px; }
.tool-btn svg { width: 17px; height: 17px; flex: none; }
.tool-btn.is-dark { color: #F4F1FF; text-decoration-color: rgba(255, 255, 255, .35); }
.tool-btn:hover { text-decoration-color: currentColor; }
.tool-btn.is-on { text-decoration: none; color: #B42318; }
.tool-btn.is-dark.is-on { color: #FFD7D2; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #E5484D; box-shadow: 0 0 0 0 rgba(229, 72, 77, .6); animation: rec 1.4s ease-out infinite; }
@keyframes rec { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 70% { box-shadow: 0 0 0 9px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }
.pic-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 4px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); font-weight: 700; font-size: 13.5px; animation: pop-in var(--t-med) var(--ease-out) backwards; }
.pic-chip.is-dark { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }
.pic-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; }
.pic-chip button { border: 0; background: none; color: inherit; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; border-radius: 6px; }
.pic-chip button svg { width: 15px; height: 15px; }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }

/* While the app checks whether AI is on, hold the space instead of flashing the wrong buttons */
.hero-wait { height: 200px; }
.ready-card .ready-check { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid #CFE8D5; }
.ready-card .ready-check b { display: inline; font-size: 14px; }

/* Ideas and quick rewrites: small chips, quiet until you want them */
.ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.chip-idea { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 11px; border-radius: 999px; border: 1px dashed var(--line-2); background: var(--panel); color: var(--text); font: 700 13px/1 var(--font); cursor: pointer; animation: pop-in var(--t-med) var(--ease-out) backwards; transition: border-color .15s, background-color .15s, transform var(--t-press) var(--ease-out); }
.chip-idea svg { width: 13px; height: 13px; }
.chip-idea:hover { border-style: solid; border-color: var(--brand); background: #F4F2FB; }
.chip-idea:active { transform: scale(.96); }
.chip-idea.is-ai { border-style: solid; border-color: #D9D4F0; color: var(--brand); }
.chip-idea:disabled { opacity: .6; cursor: default; }
.chip-idea .spin { width: 11px; height: 11px; }
.ideas .chip-idea:nth-child(3) { animation-delay: 30ms; } .ideas .chip-idea:nth-child(4) { animation-delay: 60ms; } .ideas .chip-idea:nth-child(n+5) { animation-delay: 90ms; }
.rewrites { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.rewrites > svg { width: 15px; height: 15px; color: var(--brand); margin-right: 2px; }
/* A new row in a list slides in instead of appearing */
.list .li { animation: rise-in var(--t-med) var(--ease-out) backwards; }
.mic-icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); color: var(--brand); cursor: pointer; }
.mic-icon svg { width: 17px; height: 17px; }
.mic-icon:hover { border-color: var(--brand); }
.mic-icon.is-on { border-color: #E5484D; background: #FFF1F0; }
.fit-btn { margin-left: auto; flex: none; }
.issue.block { align-items: center; }

/* ---------- Set up once ---------- */
.me-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; animation: rise-in var(--t-med) var(--ease-out) backwards; }
.me-head h2 { margin: 0; font-size: 20px; color: var(--brand); }
.me-head p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.me-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; }
.me-f { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 13.5px; }
.me-acts { display: flex; gap: 8px; }
.me-line { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.me-line > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-line b { font-size: 15px; } .me-line span { color: var(--muted); font-size: 13.5px; }
.me-logo { height: 36px; width: auto; max-width: 90px; object-fit: contain; }

/* ---------- Pick a design ---------- */
.picker-wrap { align-items: center; }
.picker { background: var(--panel); border-radius: 10px; padding: 24px 26px 22px; width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: pop-in var(--t-med) var(--ease-out) backwards; }
.picker h2 { margin: 0; font-size: 22px; color: var(--brand); }
.picker > p { margin: 4px 0 18px; color: var(--muted); }
.pk-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.pk { --w: 260px; border: 2px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 10px; align-items: center; cursor: pointer; animation: rise-in var(--t-med) var(--ease-out) backwards; animation-delay: calc(var(--i) * 70ms + 80ms); transition: border-color .15s, transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out); }
.pk:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: 0 12px 26px rgba(39, 34, 79, .16); }
.pk.is-on { border-color: var(--brand); }
.pk-thumb { width: 260px; height: 336px; position: relative; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.14); background: #fff; }
.pk-page { position: absolute; left: 0; top: 0; width: 816px; height: 1056px; transform-origin: 0 0; transform: scale(.3187); pointer-events: none; }
@media (max-width: 640px) { .pk-thumb { width: 150px; height: 194px; } .pk-page { transform: scale(.1839); } }
.pk-name { font-weight: 800; font-size: 15px; color: var(--brand); }

/* ---------- The kit ---------- */
.form.is-kit { padding-bottom: 24px; }
.kit { display: flex; flex-direction: column; gap: 4px; }
.kit .ready-card { margin-bottom: 4px; }
.kit .issues { padding: 12px 20px 0; }
.kit-sec { padding: 16px 20px 6px; }
.kit-sec h2 { margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kit-sec .say { padding: 0; border: 0; background: none; }
.kit-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; }
.back-kit { display: inline-flex; align-items: center; gap: 6px; margin: 12px 20px 0; font-weight: 700; }
.back-kit svg { width: 16px; height: 16px; }
.count { font-size: 12.5px; color: #8A5A00; font-weight: 700; margin-top: 2px; }

/* ---------- Change words right on the flyer ---------- */
.pv-pages { position: relative; }
.pop { position: absolute; z-index: 20; background: var(--panel); border-radius: 10px; padding: 14px 14px 12px; box-shadow: 0 18px 44px rgba(39, 34, 79, .28), 0 0 0 1px var(--line); animation: pop-in var(--t-med) var(--ease-out) backwards; transform-origin: top center; cursor: default; }
.pop .field { margin: 0; }
.pop-acts { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ---------- Welcome (first visit) ---------- */
.welcome-inner { max-width: 860px; margin: 0 auto; padding: 48px 24px 64px; display: flex; flex-direction: column; gap: 10px; animation: rise-in var(--t-slow) var(--ease-out) backwards; }
.welcome-inner .hero-kicker { color: var(--gold, #F59200); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; margin: 0; }
.welcome-inner h1 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; color: var(--brand); }
.welcome-sub { margin: 0 0 14px; font-size: 17px; color: var(--muted); max-width: 60ch; }
.welcome .me-card { padding: 26px 28px; box-shadow: 0 10px 30px rgba(39, 34, 79, .08); }
.welcome-skip { align-self: flex-start; margin-top: 6px; color: var(--muted); }

/* ---------- Template picker ---------- */
.tpick { width: min(1080px, calc(100vw - 32px)); }

/* ---------- Details (one list) ---------- */
.details-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0 10px; }
.details-h h2 { margin: 0; font-size: 18px; color: var(--brand); }
.details-top { padding: 14px 20px 6px; }
/* Home artwork: three real templates instead of placeholder sheets */
.hero-sheet { padding: 0; overflow: hidden; border-radius: 2px; }
.hero-page { position: absolute; left: 0; top: 0; width: 816px; height: 1056px; transform-origin: 0 0; transform: scale(.1618); pointer-events: none; }
/* Kit, refined: change first, then download; one main download and three small ones */
.kit-hint { margin: -4px 0 10px; font-size: 14px; color: var(--muted); }
.kit-sec .kit-links { padding: 10px 0 0; }
.dl-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.dl-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 10px 11px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); text-align: left; cursor: pointer; font: inherit; color: var(--text); transition: border-color .15s, background .15s, transform var(--t-press) var(--ease-out); }
.dl-tile:hover { border-color: var(--brand); }
.dl-tile:active { transform: scale(.98); }
.dl-tile svg { width: 18px; height: 18px; color: var(--brand); margin-bottom: 2px; }
.dl-tile b { font-size: 14px; }
.dl-tile small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.dl-tile.is-done { border-color: #2E8B4A; background: #F1FAF3; }
.dl-tile.is-done svg { color: #2E8B4A; animation: pop-check 380ms var(--ease-out) backwards; }
/* Jump between the flyer, the post and the slide */
#pv-flyer, #pv-post, #pv-slide { scroll-margin-top: 70px; }
.dl .dl-tile { justify-content: flex-start; align-items: flex-start; min-height: 0; text-align: left; }
/* Several flyers made at once */
.card { position: relative; }

/* =====================================================================
   Plainer pass: no small-caps labels, no pill chips, fewer identical boxes.
   ===================================================================== */
/* Labels read as normal words */
.hero-kicker, .pv-label, .pv-cap, .pv-divider span, .draft-h, .review-f, .ideas-l, .kit-sec h2, .kinds-h, .sum-l, .lp-best, .tag, .tpl-pick {
  text-transform: none !important; letter-spacing: 0 !important; }
.kit-sec h2 { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.pv-label { font-size: 13.5px; font-weight: 700; }
.pv-cap { font-size: 14px; font-weight: 700; }
.pv-divider span { font-size: 15px; font-weight: 800; }
.review-f { font-size: 13px; font-weight: 700; }
.draft-h { font-size: 13.5px; font-weight: 800; }

/* Home and welcome headings without an eyebrow line */
.hero h1 { max-width: 18ch; }
.hero-sub { margin-top: 10px; }
.welcome-inner h1 { margin-top: 8px; }

/* Suggestions and rewrites as plain links in a sentence */
.rewrites, .ideas { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin-top: 6px; font-size: 14px; }
.rewrites > svg { display: none; }

/* Jump links above the preview */

/* Template picker: pictures with names, not a grid of boxes */

/* Library: "New" is a word in the title */

/* Downloads: one main button, the rest a short list */

/* Proofread: a plain section, not an icon card */
.ai-card .ai-head { gap: 0; }
/* No gold accent lines under the bar and the panel; the flyer count is just a number */
.bar { box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.hero { box-shadow: none; }
.lib-n { background: none; border: 0; padding: 0; font-size: 16px; font-weight: 600; }
/* "Changed by AI": a quiet note after the label, not a pill */
.inp.sel { appearance: auto; max-width: 320px; }

/* ---------- Preview switch: Flyer / Social post / Slide ---------- */
.seg-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #E6E3EF; }
.seg-switch button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: none; font: 700 14px/1 var(--font); color: #5A5568; cursor: pointer; transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out); }
.seg-switch button svg { width: 16px; height: 16px; }
.seg-switch button:hover { color: var(--brand); }
.seg-switch button[aria-selected="true"] { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(39, 34, 79, .18); }
.pv-set { display: flex; flex-direction: column; align-items: center; gap: 28px; width: 100%; animation: fade-in var(--t-med) var(--ease-out) backwards; }
/* The pieces not shown stay laid out off screen, so they still fit themselves and download whole */
.pv-set:not(.is-on) { position: absolute; left: -20000px; top: 0; animation: none; }
.pv-note { margin: 0; font-size: 14px; color: var(--muted); }
.capbox { display: flex; flex-direction: column; gap: 8px; }
.capbox label { font-weight: 800; font-size: 15px; }
.capbox-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-mark-i { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 6px; background: #FFF1D6; color: #B06E00; vertical-align: -3px; }
.ai-mark-i svg { width: 12px; height: 12px; }

/* ---------- Text box with a Rewrite tool inside ---------- */
.aitext-box { position: relative; }
.aitext-box .ta { padding-bottom: 44px; }
.aitext-tool { position: absolute; right: 8px; bottom: 8px; }
.aitext-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: 1px solid #E2D9F7; border-radius: 8px; background: #F6F3FF; color: var(--brand); font: 700 13px/1 var(--font); cursor: pointer; }
.aitext-btn:hover:not(:disabled) { border-color: var(--brand); }
.aitext-btn svg { width: 14px; height: 14px; }
.aitext-btn .spin { width: 12px; height: 12px; }
.aitext-menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; min-width: 170px; padding: 6px; border-radius: 10px; background: var(--panel); box-shadow: 0 12px 30px rgba(39, 34, 79, .22), 0 0 0 1px var(--line); display: flex; flex-direction: column; transform-origin: bottom right; animation: pop-in var(--t-fast) var(--ease-out) backwards; }
.aitext-menu button { text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 7px; font: 600 14px/1.2 var(--font); color: var(--text); cursor: pointer; }
.aitext-menu button:hover { background: #F4F2FB; color: var(--brand); }
.aitext-offer { margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: #FBF9FF; border: 1px solid #E2D9F7; border-left: 3px solid var(--brand); animation: rise-in var(--t-med) var(--ease-out) backwards; }
.aitext-offer-h { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; color: var(--brand); }
.aitext-offer-h svg { width: 14px; height: 14px; }
.aitext-offer p { margin: 6px 0 10px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.aitext-offer-acts { display: flex; gap: 8px; }

/* =====================================================================
   Three steps: Template, Check, Download.
   CHL purple as the one accent, white surfaces, thin lines, an 8px grid,
   a short set of type sizes.
   ===================================================================== */
:root {
  --hair: rgba(23, 32, 51, .1);
  --fill: #F2F1F6;        /* quiet gray behind controls and the stage */
  --rr: 12px;             /* surfaces */
  --rs: 8px;              /* controls */
}

/* ---- Step indicator: three plain steps joined by a line ---- */
.stagenav { display: flex; align-items: center; gap: 0; margin: 0; padding: 16px 24px 0; }
.stagenav button { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px; border: 0; background: none; font: 600 13px/1 var(--font); color: var(--muted); cursor: pointer; }
.stagenav button + button::before { content: ''; width: 24px; height: 1px; margin-right: 8px; background: var(--line-2); }
.stagenav b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 12px; font-weight: 700; color: var(--muted); transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.stagenav button:hover { color: var(--text); }
.stagenav button.is-on { color: var(--text); font-weight: 700; }
.stagenav button.is-on b { background: var(--brand); color: #fff; box-shadow: none; }

/* ---- Step panels ---- */
.stage-panel { gap: 0; min-height: 100%; }
.stage-panel .kit-sec { padding: 24px 24px 0; }
.stage-panel .kit-sec + .kit-sec { margin-top: 0; }
.stage-h { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.stage-panel .kit-hint { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.look-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 17px; font-weight: 800; color: var(--text); }
.look-h span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.look { list-style: none; margin: 0; padding: 0; border-radius: var(--rr); box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden; }
.look li { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; font-size: 15px; line-height: 1.35; }
.look li + li { border-top: 1px solid var(--hair); }
.look li > svg { width: 18px; height: 18px; color: var(--warn); }
.look li.is-note > svg { color: var(--brand); }
.look li > span { flex: 1; min-width: 0; }
.look li .btn { flex: none; }
.stage-panel .kit-links { padding: 24px 24px 0; gap: 8px; }
.stage-foot { position: sticky; bottom: 0; margin-top: auto; padding: 16px 24px; background: #fff; border-top: 1px solid var(--hair); display: flex; gap: 8px; }
.stage-panel > .kit-sec:last-of-type { padding-bottom: 24px; }
.stage-next { flex: 1; min-height: 48px; border-radius: var(--rs); font-size: 17px; }
.stage-next svg { width: 18px; height: 18px; }
.stage-foot .btn:not(.stage-next) { min-height: 44px; border-radius: var(--rs); }
.warn-t { color: var(--warn); }
.warn-t .linkish { margin-left: 4px; color: var(--warn); }

/* ---- Download step: each piece with its own button ---- */
.pieces { display: flex; flex-direction: column; gap: 0; }
.stage-panel .pieces { padding-top: 16px; }
.piece { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--hair); }
.piece:first-child { border-top: 1px solid var(--hair); }
.piece-thumb { flex: none; position: relative; padding: 0; border: 0; border-radius: 4px; overflow: hidden; background: #fff; cursor: pointer; box-shadow: 0 0 0 1px var(--hair), 0 2px 8px rgba(23, 32, 51, .08); transition: box-shadow var(--t-fast) var(--ease-out); }
.piece-thumb > span { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.piece-thumb:hover, .piece.is-shown .piece-thumb { box-shadow: 0 0 0 2px var(--brand), 0 2px 8px rgba(23, 32, 51, .08); }
.piece-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.piece-txt b { font-size: 17px; font-weight: 800; }
.piece-txt > span { font-size: 13px; color: var(--muted); }
.piece-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.piece-acts .btn { border-radius: var(--rs); }
.btn.is-done { color: var(--ok); border-color: rgba(23, 102, 63, .35); }
.btn-blue.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.more-dl { padding-bottom: 8px; }
.more-dl summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; font-size: 15px; font-weight: 700; color: var(--brand); cursor: pointer; }
.more-dl summary::-webkit-details-marker { display: none; }
.more-dl summary::after { content: ''; width: 7px; height: 7px; margin: -3px 0 0 4px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(45deg); transition: transform var(--t-fast) var(--ease-out); }
.more-dl[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.more-dl[open] { padding-bottom: 8px; }
.more-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 8px; border: 0; border-bottom: 1px solid var(--hair); background: none; text-align: left; cursor: pointer; border-radius: 0; }
.more-row:first-of-type { margin-top: 8px; border-top: 1px solid var(--hair); }
.more-row:hover { background: var(--fill); }
.more-row svg { color: var(--brand); }
.more-row span { display: flex; flex-direction: column; gap: 2px; }
.more-row b { font-size: 15px; font-weight: 700; }
.more-row small { font-size: 13px; color: var(--muted); }

/* ---- Template step: one big page on the left, the choices in a rail ---- */
.tstage { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; top: 64px; display: grid; grid-template-columns: minmax(0, 1fr) 400px; background: var(--fill); animation: fade-in var(--t-med) var(--ease-out) backwards; }
.ts-stage { display: grid; place-items: center; padding: 32px; min-width: 0; overflow: hidden; }
.ts-page { position: relative; overflow: hidden; background: #fff; border-radius: 2px; box-shadow: 0 1px 2px rgba(23, 32, 51, .08), 0 24px 48px -12px rgba(23, 32, 51, .25); animation: rise-in var(--t-med) var(--ease-out) backwards; }
.ts-page > span { position: absolute; left: 0; top: 0; width: 816px; height: 1056px; transform-origin: 0 0; }
.ts-rail { display: flex; flex-direction: column; min-height: 0; background: #fff; border-left: 1px solid var(--hair); }
.ts-head { padding: 32px 24px 16px; }
.ts-head h2 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.ts-head p { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.ts-list { flex: 1; min-height: 0; overflow: auto; padding: 0 16px 16px; }
.ts-group + .ts-group { margin-top: 16px; }
.ts-group h3 { margin: 0; padding: 8px 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.ts-opt { display: flex; align-items: center; gap: 16px; width: 100%; padding: 8px; border: 0; border-radius: var(--rr); background: none; text-align: left; cursor: pointer; transition: background var(--t-fast) var(--ease-out); }
.ts-opt:hover { background: var(--fill); }
.ts-opt.is-on { background: #EFEDF8; }
.ts-thumb { flex: none; position: relative; width: 57px; height: 74px; overflow: hidden; border-radius: 3px; background: #fff; box-shadow: 0 0 0 1px var(--hair), 0 1px 4px rgba(23, 32, 51, .1); }
.ts-thumb > span { position: absolute; left: 0; top: 0; width: 816px; height: 1056px; transform: scale(.07); transform-origin: 0 0; pointer-events: none; }
.ts-opt.is-on .ts-thumb { box-shadow: 0 0 0 2px var(--brand); }
.ts-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ts-txt b { font-size: 15px; font-weight: 700; }
.ts-txt small { font-size: 13px; line-height: 1.35; color: var(--muted); }
.ts-tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--brand); opacity: 0; transform: scale(.6); transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.ts-tick svg { width: 13px; height: 13px; stroke-width: 2.6; }
.ts-opt.is-on .ts-tick { opacity: 1; transform: none; }
.ts-foot { display: flex; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--hair); }
.ts-foot .btn { min-height: 48px; border-radius: var(--rs); font-size: 17px; }
.ts-use { flex: 1; }

@media (max-width: 860px) {
  .tstage { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .ts-stage { display: none; }
  .ts-rail { border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tstage, .ts-page { animation: none; }
}
.form.is-kit:has(.stage-panel) { padding-bottom: 0; }
.kit-sec .stage-h { font-size: 28px; font-weight: 800; margin: 0; }
.look li.is-ai > svg { color: var(--brand); }
.look li.is-ok > svg { color: var(--ok); }
.look li.is-ok { color: var(--muted); }
.look li.is-wait { color: var(--muted); }
.look li.is-wait .spin { width: 16px; height: 16px; flex: none; }
.look-fix { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--ok); }
.piece { display: grid; grid-template-columns: 96px minmax(0, 1fr); }
.piece-thumb { justify-self: center; }

/* ---------- Menus that open from a field: one look for all of them ---------- */
.say-menu, .addbox-list, .kmenu-list {
  position: absolute; z-index: 35; left: 0; right: 0; top: calc(100% + 6px);
  padding: 6px; border-radius: var(--rr); background: #fff;
  box-shadow: 0 0 0 1px var(--hair), 0 16px 32px -8px rgba(23, 32, 51, .22);
  display: flex; flex-direction: column; max-height: 320px; overflow: auto;
  transform-origin: top center; animation: pop-in var(--t-fast) var(--ease-out) backwards; }
.addbox-h { padding: 6px 10px 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.say-menu button, .addbox-list button, .kmenu-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: var(--rs);
  background: none; text-align: left; font: 600 15px/1.3 var(--font); color: var(--text); cursor: pointer; }
.say-menu button:hover, .addbox-list button:hover, .addbox-list button.is-hi, .kmenu-list button.is-hi { background: #F1EFF8; }
.addbox-list button svg { width: 16px; height: 16px; color: var(--brand); }

/* Tell AI what to change: examples drop down from the box */
.say-field { position: relative; flex: 1; min-width: 0; }
.say-field .inp { width: 100%; }
.say-menu button { color: var(--brand); }

/* Add an item: one box that suggests as you type */
.addbox { position: relative; }
.addbox-row { display: flex; align-items: center; gap: 8px; }
.addbox-plus { display: grid; place-items: center; width: 20px; flex: none; color: var(--brand); }
.addbox-plus svg { width: 16px; height: 16px; }
.addbox-row .inp { flex: 1; min-width: 0; border-style: dashed; background: #FCFCFE; }
.addbox-row .inp:focus { border-style: solid; background: #fff; }
.li.has-ico + .addbox .addbox-plus, .li.has-ico ~ .addbox .addbox-plus { width: 36px; }

/* Event kind: a menu with an icon and a line for each */
.kmenu { position: relative; max-width: 420px; }
.kmenu-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--rs); background: #fff; text-align: left; cursor: pointer; transition: border-color var(--t-fast) var(--ease-out); }
.kmenu-btn:hover, .kmenu-btn.is-open { border-color: var(--brand); }
.kmenu-btn > svg:last-child { margin-left: auto; color: var(--muted); transition: transform var(--t-fast) var(--ease-out); }
.kmenu-btn.is-open > svg:last-child { transform: rotate(180deg); }
.kmenu-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--rs); background: #F1EFF8; color: var(--brand); }
.kmenu-ico svg { width: 20px; height: 20px; }
.kmenu-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kmenu-txt b { font-size: 15px; font-weight: 700; }
.kmenu-txt small { font-size: 13px; font-weight: 500; color: var(--muted); }
.kmenu-list { max-height: 400px; }
.kmenu-list button { padding: 8px; }
.kmenu-list button > svg:last-child { margin-left: auto; color: var(--brand); }
.kmenu-list button[aria-selected="true"] .kmenu-ico { background: var(--brand); color: #fff; }

/* A field AI changed: a gold edge on the box and a small mark by the label */
.field.is-ai .inp, .field.is-ai .ta, .field.is-ai .kmenu-btn { border-color: #E8B04F; box-shadow: inset 3px 0 0 #F9A532; }
.field.is-ai .list .inp { box-shadow: none; }
.field.is-ai .list { padding-left: 10px; border-left: 3px solid #F9A532; }

/* Library: what was just made sits on top, apart from the rest */
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.lib-sub { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.lib-fresh { padding-bottom: 8px; }
.lib-fresh .card { border-color: rgba(62, 57, 121, .35); }
.libs { display: flex; flex-direction: column; gap: 40px; }
.libs:empty { display: none; }
/* An open field menu sits above the sticky footer */
.step-body:has(.kmenu-list, .addbox-list), .sec:has(.kmenu-list, .addbox-list) { position: relative; z-index: 4; }
.step-top { z-index: 5; }

/* ---------- Magic Flyer: a carousel of every template, landing on AI's pick ---------- */
.rv { position: fixed; z-index: 90; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; color: #fff; overflow: hidden;
  background: radial-gradient(90% 110% at 50% 50%, #5A4FA0 0%, #3E3979 45%, #221E4F 100%); animation: fade-in .35s var(--ease-out) backwards; }
.rv-head { text-align: center; padding: 0 24px; }
.rv-kicker { font-size: 15px; font-weight: 700; color: #FCD58F; }
.rv-title { margin: 8px 0 0; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.1; font-weight: 600; letter-spacing: -.01em; min-height: 1.1em; }
.rv-title b { font-weight: 800; }
.rv-track { position: relative; width: 100%; }
.rv-card { position: relative; flex: none; padding: 0; border: 0; border-radius: 4px; overflow: hidden; background: #fff; cursor: pointer; opacity: .42; transform: scale(.86);
  box-shadow: 0 18px 40px rgba(10, 6, 40, .45); transition: opacity .45s var(--ease-out), transform .45s var(--ease-out), box-shadow .45s var(--ease-out), filter .45s; }
.rv-acts { display: flex; align-items: center; gap: 18px; opacity: 0; transform: translateY(10px); transition: opacity .4s var(--ease-out), transform .4s var(--ease-out); }
.rv-acts.is-on { opacity: 1; transform: none; }
.rv-use { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 28px; border: 0; border-radius: 28px; background: #F9A532; color: #27224F; font: 800 18px/1 var(--font); cursor: pointer; box-shadow: 0 10px 30px rgba(249, 165, 50, .4); transition: transform .15s var(--ease-out); }
.rv-use:hover:not(:disabled) { transform: scale(1.04); }
.rv-use svg { width: 20px; height: 20px; stroke-width: 2.8; }
/* Both flyers ready */
.rv-outro { gap: 18px; }
.rv-done { display: flex; gap: 40px; margin-bottom: 14px; }
.rv-mini { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: ms-rise .6s var(--ease-out) backwards; }
.rv-mini:nth-child(2) { animation-delay: .15s; }
.rv-mini-page { position: relative; overflow: hidden; border-radius: 4px; background: #fff; box-shadow: 0 24px 60px rgba(10, 6, 40, .55); }
.rv-mini-page > span { position: absolute; left: 0; top: 0; width: 816px; height: 1056px; transform-origin: 0 0; }
.rv-mini-tick { position: absolute; top: -14px; right: -14px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #F9A532; color: #27224F; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); animation: ms-pop .45s .5s cubic-bezier(.3, 1.4, .5, 1) backwards; }
.rv-mini-tick svg { width: 22px; height: 22px; stroke-width: 3; }
.rv-mini b { font-size: 16px; font-weight: 700; color: #fff; }
.rv-sub { margin: 0; font-size: 19px; color: #E4E0F3; }
.rv-outro .rv-use { margin-top: 10px; }
@keyframes ms-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes ms-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
/* One at a time */
.queue-line { padding: 16px 24px 0; font-size: 13px; font-weight: 700; color: var(--brand); }
.queue-line + .stagenav { padding-top: 6px; }

/* ---------- Magic Flyer at work ---------- */
.mg { gap: 26px; z-index: 89; }
.mg-cards { position: relative; width: 150px; height: 170px; margin-bottom: 8px; }
.mg-cards i { position: absolute; left: 30px; top: 10px; width: 90px; height: 116px; border-radius: 6px; background: #fff; box-shadow: 0 16px 36px rgba(10, 6, 40, .45);
  background-image: linear-gradient(#3E3979 0 0), linear-gradient(#F9A532 0 0), linear-gradient(#E4E0F3 0 0), linear-gradient(#E4E0F3 0 0), linear-gradient(#E4E0F3 0 0);
  background-size: 54px 9px, 36px 7px, 64px 5px, 58px 5px, 46px 5px; background-position: 18px 22px, 18px 40px, 13px 62px, 16px 74px, 22px 86px; background-repeat: no-repeat;
  animation: mg-shuffle 2.4s cubic-bezier(.45, 0, .2, 1) infinite; }
.mg-cards i:nth-child(1) { animation-delay: 0s; }
.mg-cards i:nth-child(2) { animation-delay: -.8s; }
.mg-cards i:nth-child(3) { animation-delay: -1.6s; }
@keyframes mg-shuffle {
  0% { transform: translateX(-46px) rotate(-12deg); z-index: 1; opacity: .75; }
  33% { transform: translateX(0) translateY(-8px) rotate(0) scale(1.08); z-index: 3; opacity: 1; }
  66% { transform: translateX(46px) rotate(12deg); z-index: 2; opacity: .75; }
  100% { transform: translateX(-46px) rotate(-12deg); z-index: 1; opacity: .75; }
}
.mg-line { animation: ms-rise .45s var(--ease-out) backwards; }
.mg-bar { width: min(420px, 70vw); height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.mg-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #F9A532, #FCD58F); box-shadow: 0 0 16px rgba(249, 165, 50, .6); transition: width .35s var(--ease-out); }
.mg-sub { margin: 0; font-size: 15px; color: #DCD8EC; }
@media (prefers-reduced-motion: reduce) { .mg-cards i { animation: none; } }
/* The loading screen already covers the page, so the carousel appears without a fade */
.rv:not(.mg) { animation: none; }

/* ---------- Magic Flyer's reveal: the row of templates, the wave, the pick, the big flyer ---------- */
.rv { gap: 18px; }
.rv-sub { margin: 8px 0 0; min-height: 1.4em; font-size: 16px; color: #DCD8EC; opacity: 0; transition: opacity .4s .25s; }
.rv-sub.is-on { opacity: 1; }
.rv-big { position: relative; flex: none; border-radius: 4px; transform-origin: 0 0; opacity: 0; }
.rv-scan.is-done .rv-big { opacity: 1; box-shadow: 0 0 0 4px #F9A532, 0 0 80px 14px rgba(249, 165, 50, .45), 0 30px 70px rgba(10, 6, 40, .6); }
.rv-face { position: absolute; inset: 0; overflow: hidden; border-radius: 4px; background: #fff; opacity: 0; transition: opacity .28s ease-out; text-align: left; }
.rv-face.is-cur { opacity: 1; }
.rv-face > span, .rv-th-page > span { position: absolute; left: 0; top: 0; width: 816px; height: 1056px; transform-origin: 0 0; pointer-events: none; }
.rv-row { display: flex; padding: 4px; transform-origin: 50% 50%; transition: transform .76s cubic-bezier(.3, 0, .12, 1); }
.rv-th { position: relative; padding: 0; border: 0; background: none; border-radius: 4px; cursor: pointer; text-align: left; transition: opacity .3s ease-out, transform .3s ease-out; }
.rv-th:disabled { cursor: default; }
.rv-th-page { position: relative; display: block; overflow: hidden; border-radius: 3px; background: #fff; box-shadow: 0 6px 14px rgba(10, 6, 40, .4); transition: box-shadow .3s ease-out; }
/* in: dealt out one after another */
.rv-scan.is-in .rv-th { animation: rv-deal .55s cubic-bezier(.2, .9, .3, 1) backwards; animation-delay: var(--d); }
@keyframes rv-deal { from { opacity: 0; transform: translateY(26px) scale(.9); } }
/* think: one wave along the row */
.rv-scan.is-think .rv-th { animation: rv-wave .62s ease-in-out backwards; animation-delay: var(--w); }
.rv-scan.is-think .rv-th-page { animation: rv-wave-glow .62s ease-in-out backwards; animation-delay: var(--w); }
@keyframes rv-wave { 45% { transform: translateY(-7px); } }
@keyframes rv-wave-glow { 45% { box-shadow: 0 0 0 1.5px rgba(249, 165, 50, .9), 0 0 18px 3px rgba(249, 165, 50, .45), 0 10px 18px rgba(10, 6, 40, .4); } }
/* pick: the one it chose */
.rv-scan.is-pick .rv-th { opacity: .4; }
.rv-scan.is-pick .rv-th.is-pick { opacity: 1; transform: translateY(-6px) scale(1.07); }
.rv-scan.is-pick .rv-th.is-pick .rv-th-page { box-shadow: 0 0 0 2px #F9A532, 0 0 26px 6px rgba(249, 165, 50, .55); }
/* done: the strip under the big flyer */
.rv-scan.is-done .rv-th { opacity: .5; }
.rv-scan.is-done .rv-th:hover { opacity: .85; }
.rv-scan.is-done .rv-th.is-cur { opacity: 1; transform: translateY(-4px); }
.rv-scan.is-done .rv-th.is-cur .rv-th-page { box-shadow: 0 0 0 3px #F9A532, 0 8px 18px rgba(10, 6, 40, .45); }
.rv-scan.is-done .rv-th.is-pick:not(.is-cur) { opacity: .8; }
/* The pick keeps a small mark, so it's clear which one Magic Flyer chose after you pick another */
.rv-mark { position: absolute; top: -9px; right: -9px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #F9A532; color: #27224F; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); opacity: 0; transform: scale(.5); transition: opacity .3s .5s, transform .3s .5s cubic-bezier(.3, 1.4, .5, 1); }
.rv-mark svg { width: 13px; height: 13px; stroke-width: 2.2; }
.rv-scan.is-done .rv-mark { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv-row { transition: none; } .rv-scan .rv-th, .rv-scan .rv-th-page { animation: none !important; } }
.rv-skip { border: 0; background: none; padding: 4px 0; font: 600 15px/1.3 var(--font); color: #DCD8EC; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; opacity: 0; transition: opacity .4s; }
.rv-skip.is-on { opacity: 1; }
.rv-skip:hover { color: #fff; }
@media (max-width: 600px) { .rv-done { gap: 16px; } .rv-mini-page { zoom: .55; } .rv-use { height: 50px; padding: 0 20px; font-size: 16px; } }

/* ---------- The details panel: one left edge, one line per heading, quieter help text ---------- */
.back-kit { margin: 16px 24px 0; }
.details-top { padding: 14px 24px 14px; }
.details-h { align-items: center; padding: 0 0 12px; }
.details-h h2 { min-width: 0; font-size: 20px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.details-h .linkish { flex: none; white-space: nowrap; font-size: 14px; }
.details-top .say { padding: 0; border: 0; background: none; }
.form .sec.is-static .sec-st { padding: 22px 24px 6px; font-size: 17px; }
.form .sec.is-static .sec-b { padding: 6px 24px 24px; gap: 16px; }
.form .sec-note { margin: 0; padding: 0 24px 6px; font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--muted); }
.form .field label { font-size: 14px; font-weight: 700; }
.form .field .hint { font-size: 13px; line-height: 1.4; }
.qr-hint .linkish { font-weight: 600; font-size: 13px; }
.form .checkline { font-size: 15px; gap: 12px; }
.form .step-nav { padding: 12px 24px; }

/* ---------- Change the template: a grid of pictures, each with its name ---------- */
.ts-head:has(h2:only-child) { padding-bottom: 20px; }
.ts-grid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 20px 16px; padding: 4px 24px 24px; }
.ts-opt.ts-card { flex-direction: column; align-items: stretch; gap: 10px; padding: 0; border-radius: 6px; background: none; }
.ts-opt.ts-card:hover, .ts-opt.ts-card.is-on { background: none; }
.ts-pic { position: relative; display: block; width: 168px; height: 217px; overflow: hidden; border-radius: 4px; background: #fff; box-shadow: 0 0 0 1px var(--hair), 0 2px 10px rgba(23, 32, 51, .12); transition: box-shadow var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.ts-pic > span:first-child { position: absolute; left: 0; top: 0; width: 816px; height: 1056px; transform: scale(.2059); transform-origin: 0 0; pointer-events: none; text-align: left; }
.ts-card:hover .ts-pic { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--hair), 0 8px 20px rgba(23, 32, 51, .18); }
.ts-card.is-on .ts-pic { box-shadow: 0 0 0 3px var(--brand), 0 8px 20px rgba(23, 32, 51, .18); }
.ts-card .ts-tick { position: absolute; right: 8px; top: 8px; }
.ts-card .ts-txt { align-items: center; }
.ts-card .ts-txt b { font-size: 15px; font-weight: 700; text-align: center; }
.ts-card.is-on .ts-txt b { color: var(--brand); }
@media (max-width: 860px) { .ts-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); justify-items: center; } }
.ts-grid { grid-template-columns: repeat(2, 168px); justify-content: space-between; overflow-x: hidden; padding: 4px 20px 24px; }

/* ---------- Glow background color: Automatic, then the swatches ---------- */
.tints { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tint { display: inline-flex; align-items: center; gap: 8px; padding: 3px; border: 0; border-radius: 999px; background: none; cursor: pointer; font: 700 14px/1 var(--font); color: var(--text); box-shadow: inset 0 0 0 1px transparent; }
.tint i { display: block; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.tint.is-auto { padding: 3px 14px 3px 3px; box-shadow: inset 0 0 0 1px var(--line-2); }
.tint small { font-weight: 500; font-size: 13px; color: var(--muted); }
.tint:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.tint.is-on { box-shadow: inset 0 0 0 2px var(--brand); }
