:root {
  --b-bg: #F4F2EC; --b-panel: #FBFAF6; --b-ink: #17242D; --b-muted: #66717A; --b-line: #E3DFD4; --b-line2: #D6D0C2;
  --b-blue: #1D3B4F; --b-rust: #C9643A; --b-rust-text: #A9502B; --b-soft: #EFEBE1; --b-sel: #1D3B4F;
  --b-ease: cubic-bezier(.2,.8,.2,1);
  --panel-w: 400px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: 'Instrument Sans', system-ui, sans-serif; color: var(--b-ink); background: var(--b-bg); font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
.app { display: grid; grid-template-columns: var(--panel-w) 1fr; height: 100vh; height: 100dvh; }

/* ---------------------------------------------------------------- PANEL */
.panel { background: var(--b-panel); border-right: 1px solid var(--b-line); display: flex; flex-direction: column; min-height: 0; position: relative; z-index: 2; }
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--b-line); }
.brand-mark svg { width: 38px; height: 38px; display: block; }
.brand-name { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 1.45rem; line-height: 1; letter-spacing: -0.01em; margin: 0; }
.brand-by { display: block; font-family: 'Instrument Sans', system-ui, sans-serif; font-size: .74rem; letter-spacing: 0; color: var(--b-muted); margin-top: 4px; }
.brand-sub { font-size: .78rem; color: var(--b-muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.tag { font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: #F6E4D8; color: #9A4520; }
.panel-scroll { flex: 1; overflow-y: auto; padding: 6px 22px 0; scrollbar-width: thin; scrollbar-color: var(--b-line2) transparent; }
.intro { font-family: 'Instrument Serif', serif; font-size: 1.5rem; line-height: 1.15; margin: 18px 0 6px; letter-spacing: -0.01em; }
.intro strong { font-weight: 400; }
.intro em { color: var(--b-rust-text); }
.step { padding: 20px 0 22px; border-bottom: 1px solid var(--b-line); }
.step:last-of-type { border-bottom: 0; }
.step h2 { display: flex; align-items: center; gap: 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; margin: 0 0 12px; }
.step h2 .n { width: 22px; height: 22px; border-radius: 50%; background: var(--b-ink); color: #fff; display: grid; place-items: center; font-size: .7rem; letter-spacing: 0; }
.hint { margin: -4px 0 14px; color: var(--b-muted); font-size: .84rem; line-height: 1.45; }

/* business picker */
.bizp { position: relative; min-width: 0; }
.panel, .panel-scroll { min-width: 0; }
.bizp-cur { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border: 1.5px solid var(--b-line); background: #fff; border-radius: 14px; text-align: left; transition: border-color .25s, box-shadow .25s; }
.bizp-cur:hover, .bizp.open .bizp-cur { border-color: var(--b-sel); box-shadow: 0 0 0 3px rgba(29,59,79,.1); }
.bc-ic { width: 42px; height: 42px; flex: none; border-radius: 11px; background: var(--b-soft); color: var(--b-blue); display: grid; place-items: center; }
.bc-ic svg { width: 22px; height: 22px; }
.bc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bc-txt b { font-size: .95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-txt small { font-size: .74rem; line-height: 1.3; color: var(--b-muted); white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bc-txt small i { font-style: normal; color: var(--b-ink); opacity: .75; }
.bc-chg { display: flex; align-items: center; gap: 3px; font-size: .76rem; font-weight: 600; color: var(--b-rust-text); flex: none; }
.bc-chg svg { width: 15px; height: 15px; transition: transform .35s var(--b-ease); }
.bizp.open .bc-chg svg { transform: rotate(180deg); }
.bizp-pop { margin-top: 8px; border: 1.5px solid var(--b-line); background: #fff; border-radius: 14px; padding: 10px; box-shadow: 0 18px 40px -24px rgba(23,36,45,.45); animation: popIn .35s var(--b-ease); }
.bizp-pop[hidden] { display: none; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } }
.bizp-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 40px; border-radius: 10px; background: var(--b-soft); color: var(--b-muted); }
.bizp-search:focus-within { box-shadow: 0 0 0 2px var(--b-sel) inset; background: #fff; }
.bizp-search svg { width: 17px; height: 17px; flex: none; }
.bizp-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: .9rem; color: var(--b-ink); outline: none; }
.bizp-chips { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 5px; margin: 10px -10px 8px; padding: 2px 10px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.bizp-chips::-webkit-scrollbar { display: none; }
.bchip { flex: none; min-height: 32px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--b-line); background: #fff; border-radius: 999px; padding: 4px 9px; font-size: .72rem; font-weight: 600; color: var(--b-muted); transition: all .2s; }
.bchip svg { width: 13px; height: 13px; }
.bchip:hover { color: var(--b-ink); border-color: var(--b-line2); }
.bchip.on { background: var(--b-ink); border-color: var(--b-ink); color: #fff; }
.bizp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-height: min(252px, 38vh); overflow-y: auto; margin: 0 -4px; padding: 2px 4px; scrollbar-width: thin; scrollbar-color: var(--b-line2) transparent; }
.bgroup { grid-column: 1 / -1; margin: 8px 2px 2px; font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: var(--b-muted); font-weight: 600; }
.bgroup:first-child { margin-top: 2px; }
.btile { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 9px; padding: 7px 8px; text-align: left; font-size: .82rem; font-weight: 500; transition: background .15s; }
.btile svg { width: 18px; height: 18px; flex: none; color: var(--b-blue); }
.btile:hover { background: var(--b-soft); }
.btile.on { background: #E6EDF1; font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--b-sel); }
.btile-own { grid-column: 1 / -1; color: var(--b-rust-text); font-weight: 600; border: 1.5px dashed #E7C3AE; }
.btile-own svg { color: var(--b-rust-text); }
.bnone { grid-column: 1 / -1; margin: 6px 4px 4px; color: var(--b-muted); font-size: .8rem; }
.bizp-other { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--b-line); }
.bizp-other label { display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--b-muted); margin: 0 0 6px 2px; }
.bizp-other div { display: flex; gap: 6px; }
.bizp-other input { flex: 1; min-width: 0; height: 38px; border: 1.5px solid var(--b-line); border-radius: 10px; padding: 0 10px; font: inherit; font-size: .88rem; outline: none; }
.bizp-other input:focus { border-color: var(--b-sel); }
.bizp-other button { border: 0; border-radius: 10px; background: var(--b-ink); color: #fff; padding: 0 14px; font-weight: 600; font-size: .82rem; }
.bizp-other button:hover { background: var(--b-blue); }

/* presets */
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preset { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; border: 1.5px solid var(--b-line); background: #fff; border-radius: 14px; padding: 0; text-align: left; overflow: hidden; transition: border-color .25s, transform .35s var(--b-ease), box-shadow .35s; position: relative; }
.preset:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(23,36,45,.4); }
.preset.on { border-color: var(--b-sel); box-shadow: 0 0 0 3px rgba(29,59,79,.14); }
.preset.on::after { content: ''; position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--b-sel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/13px no-repeat; }
.pv { height: 78px; padding: 12px 12px 0; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.pv .aa { font-size: 1.9rem; line-height: 1; }
.pv .sw { display: flex; gap: 0; height: 10px; margin: 0 -12px; }
.pv .sw i { flex: 1; }
.preset .pmeta { padding: 9px 12px 11px; }
.preset .pname { font-weight: 600; font-size: .86rem; display: block; }
.preset .pdesc { font-size: .74rem; color: var(--b-muted); display: block; margin-top: 2px; line-height: 1.3; }
.surprise { margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 12px; border: 1.5px dashed var(--b-line2); background: transparent; border-radius: 12px; font-weight: 600; font-size: .88rem; transition: all .25s; }
.surprise svg { width: 20px; height: 20px; transition: transform .6s var(--b-ease); }
.surprise:hover { border-color: var(--b-rust); color: var(--b-rust-text); background: #FBF1EA; }
.surprise:hover svg, .surprise.roll svg { transform: rotate(200deg); }

/* themes */
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme { border: 1.5px solid var(--b-line); background: #fff; border-radius: 12px; padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color .25s, box-shadow .25s, transform .3s var(--b-ease); }
.theme:hover { transform: translateY(-2px); }
.theme.on { border-color: var(--b-sel); box-shadow: 0 0 0 3px rgba(29,59,79,.14); }
.theme .tchip { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem; line-height: 1; position: relative; overflow: hidden; }
.theme .tchip::after { content: ''; position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; background: var(--acc); border-top-left-radius: 6px; }
.theme span { font-size: .7rem; font-weight: 600; color: var(--b-muted); text-align: center; line-height: 1.15; }
.theme.on span { color: var(--b-ink); }

/* sections */
.sec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sec-item { border: 1px solid var(--b-line); border-radius: 14px; background: #fff; transition: opacity .3s, background .3s, box-shadow .3s; }
.sec-item.off { background: transparent; }
/* off sections: signalled by dashed outlines, never by fading text (keeps >= 4.5:1) */
.sec-item.off .var { border-style: dashed; }
.sec-item.off .var .vthumb, .sec-item.off .var svg { filter: grayscale(.7); }
.sec-item.off .var:hover, .sec-item.off .var:focus-visible { opacity: 1; }
.sec-item.moved { animation: moved .6s var(--b-ease); }
@keyframes moved { 0% { box-shadow: 0 0 0 3px rgba(201,100,58,.35); } 100% { box-shadow: 0 0 0 3px transparent; } }
.sec-top { display: flex; align-items: center; gap: 10px; padding: 12px 10px 10px 14px; }
.sw-toggle { width: 42px; height: 24px; border-radius: 24px; border: 0; background: #8A8274; position: relative; transition: background .25s; flex: none; padding: 0; }
.sw-toggle::before { content: ''; position: absolute; inset: -10px -4px; }
.sw-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .3s var(--b-ease); }
.sw-toggle[aria-checked="true"] { background: var(--b-blue); }
.sw-toggle[aria-checked="true"]::after { transform: translateX(18px); }
.sec-name { font-weight: 600; font-size: .92rem; }
.sec-vn { font-size: .76rem; color: var(--b-muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv { display: flex; gap: 2px; }
.mv button { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: var(--b-muted); transition: background .2s, color .2s; }
.mv button:hover:not(:disabled) { background: var(--b-soft); color: var(--b-ink); }
.mv button:disabled { opacity: .25; cursor: default; }
.mv svg { width: 16px; height: 16px; }
.variants { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 6px; padding: 0 10px 12px; }
.var { border: 1.5px solid var(--b-line); background: var(--b-panel); border-radius: 10px; padding: 7px 5px 6px; display: flex; flex-direction: column; align-items: center; gap: 5px; transition: border-color .2s, background .2s, transform .3s var(--b-ease); }
.var:hover { border-color: var(--b-line2); background: #fff; transform: translateY(-1px); }
.var.on { border-color: var(--b-sel); background: #fff; box-shadow: 0 0 0 2px rgba(29,59,79,.1); }
.var svg { width: 100%; height: auto; display: block; color: var(--b-ink); }
.var span { font-size: .68rem; font-weight: 600; color: var(--b-muted); line-height: 1.1; text-align: center; }
.var.on span { color: var(--b-ink); }
.panel-end { height: 24px; }

.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--b-line); background: var(--b-panel); }
.pf-sum { display: flex; flex-direction: column; min-width: 0; }
.pf-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--b-muted); font-weight: 600; }
.pf-val { font-weight: 600; font-size: .86rem; white-space: normal; line-height: 1.25; overflow-wrap: anywhere; display: block; }
.btn-primary, .btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 11px; padding: 12px 16px; font-weight: 600; font-size: .88rem; transition: transform .3s var(--b-ease), background .2s, box-shadow .3s; white-space: nowrap; }
.btn-primary { background: var(--b-blue); color: #fff; box-shadow: 0 6px 18px -8px rgba(29,59,79,.7); }
.btn-primary:hover { background: #142C3C; transform: translateY(-1px); }
.btn-primary svg, .btn-secondary svg { width: 17px; height: 17px; }
.btn-secondary { background: #fff; border: 1.5px solid var(--b-line2); }
.btn-secondary:hover { border-color: var(--b-ink); }

/* ---------------------------------------------------------------- STAGE */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--b-bg) radial-gradient(circle at 1px 1px, rgba(23,36,45,.09) 1px, transparent 0) 0 0/22px 22px; }
.stage-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 12px 20px; }
.url { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: .82rem; color: var(--b-muted); }
.url .dots { display: flex; gap: 6px; margin-right: 6px; }
.url .dots i { width: 11px; height: 11px; border-radius: 50%; background: #D9D4C8; }
.url .dots i:first-child { background: #E8A598; } .url .dots i:nth-child(2) { background: #EBCF8E; } .url .dots i:nth-child(3) { background: #A9CFA0; }
.url .lock svg { width: 13px; height: 13px; display: block; }
#urlText { background: #fff; border: 1px solid var(--b-line); padding: 6px 14px; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; transition: opacity .2s; }
.device-toggle { display: flex; background: #fff; border: 1px solid var(--b-line); border-radius: 12px; padding: 3px; gap: 2px; }
.device-toggle button { border: 0; background: transparent; display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 9px; font-weight: 600; font-size: .8rem; color: var(--b-muted); transition: background .25s, color .25s; }
.device-toggle button svg { width: 17px; height: 17px; }
.device-toggle button.on { background: var(--b-ink); color: #fff; }
.bar-actions { justify-self: end; }
.ghost { display: flex; align-items: center; gap: 7px; border: 1px solid var(--b-line); background: #fff; padding: 8px 12px; border-radius: 10px; font-size: .8rem; font-weight: 600; transition: border-color .2s; }
.ghost:hover { border-color: var(--b-ink); }
.ghost svg { width: 16px; height: 16px; }
.canvas { flex: 1; min-height: 0; padding: 0 20px 20px; display: flex; justify-content: center; align-items: stretch; }
.device { display: flex; flex-direction: column; position: relative; width: 100%; max-width: 1600px; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 30px 70px -30px rgba(23,36,45,.45), 0 0 0 1px rgba(23,36,45,.08); transition: max-width .7s var(--b-ease), border-radius .7s var(--b-ease), margin .7s var(--b-ease), box-shadow .7s; }
.frame-box { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.device iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.statusbar { display: none; height: 46px; flex: none; align-items: center; justify-content: space-between; padding: 6px 30px 0 34px; font-weight: 600; font-size: .9rem; color: var(--site-ink, #111); background: var(--site-bg, #fff); transition: background .5s, color .5s; }
.statusbar .sb-icons { display: flex; gap: 6px; align-items: center; }
.statusbar svg { height: 11px; fill: currentColor; }
.statusbar svg:last-child { height: 12px; }
.device[data-mode="mobile"] .statusbar { display: flex; }
.device[data-mode="mobile"] { max-width: 402px; max-height: 860px; align-self: center; height: 100%; border-radius: 52px; box-shadow: 0 0 0 10px #15191C, 0 0 0 11px #3A4148, 0 40px 80px -30px rgba(0,0,0,.55); margin: 14px 0; }
.device[data-mode="mobile"] iframe { border-radius: 0 0 42px 42px; }
.device[data-mode="mobile"] { background: var(--site-bg, #fff); }
.notch { position: absolute; top: 9px; left: 50%; width: 110px; height: 32px; margin-left: -55px; background: #15191C; border-radius: 20px; z-index: 3; opacity: 0; transform: scale(.6); transition: opacity .4s .3s, transform .5s .3s var(--b-ease); pointer-events: none; }
.device[data-mode="mobile"] .notch { opacity: 1; transform: none; }
.device[data-mode="mobile"] iframe { padding-top: 0; }
.frame-flash { position: absolute; inset: 0; pointer-events: none; background: var(--b-bg); opacity: 0; transition: opacity .25s; }
.device.resizing .frame-flash, .device:not(.ready) .frame-flash { opacity: 1; }
.fl-label { position: absolute; left: 50%; top: 45%; transform: translateX(-50%); font-size: .82rem; font-weight: 600; color: var(--b-muted); opacity: 0; transition: opacity .2s .4s; }
.device:not(.ready) .fl-label { opacity: 1; }

/* ---------------------------------------------------------------- DRAWER */
.scrim { position: fixed; inset: 0; background: rgba(15,24,30,.38); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 20; }
.drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100vw - 24px)); background: var(--b-panel); border-radius: 20px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.4); z-index: 21; display: flex; flex-direction: column; transform: translateX(calc(100% + 24px)); visibility: hidden; transition: transform .55s var(--b-ease), visibility 0s linear .55s; }
body.picks-open .scrim { opacity: 1; pointer-events: auto; }
body.picks-open .drawer { transform: none; visibility: visible; transition: transform .55s var(--b-ease), visibility 0s; }
.dr-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px 14px; }
.dr-kicker { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; color: var(--b-rust-text); }
.dr-head h2 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 2rem; margin: 4px 0 0; line-height: 1.05; letter-spacing: -0.01em; }
.x { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--b-line); background: #fff; display: grid; place-items: center; }
.x svg { width: 18px; }
.dr-body { flex: 1; overflow-y: auto; padding: 4px 24px 18px; }
.dr-look { display: flex; gap: 14px; align-items: center; padding: 14px; background: #fff; border: 1px solid var(--b-line); border-radius: 14px; }
.dr-look .tchip { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-size: 1.6rem; flex: none; }
.dr-look strong { display: block; font-size: 1rem; }
.dr-look small { color: var(--b-muted); font-size: .8rem; line-height: 1.4; display: block; margin-top: 2px; }
.dr-secs { list-style: none; padding: 0; margin: 14px 0; counter-reset: s; }
.dr-secs li { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--b-line); counter-increment: s; }
.dr-secs li::before { content: counter(s, decimal-leading-zero); font-family: 'Instrument Serif', serif; font-size: 1.15rem; color: var(--b-rust); width: 24px; }
.dr-secs li .thumb { width: 54px; flex: none; border: 1px solid var(--b-line); border-radius: 8px; padding: 4px; background: #fff; }
.dr-secs li .thumb svg { display: block; width: 100%; }
.dr-secs li b { font-size: .88rem; display: block; }
.dr-secs li small { color: var(--b-muted); font-size: .78rem; }
.dr-secs li.off { color: var(--b-muted); } .dr-secs li.off .thumb { opacity: .5; } .dr-secs li.off::before { content: '\2013'; }
.dr-field span { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 6px; }
.dr-field em { color: var(--b-muted); font-style: normal; font-weight: 400; }
.dr-field textarea { width: 100%; border: 1px solid var(--b-line2); border-radius: 12px; padding: 12px; font: inherit; resize: vertical; background: #fff; outline: none; }
.dr-field textarea:focus { border-color: var(--b-blue); box-shadow: 0 0 0 3px rgba(29,59,79,.12); }
.dr-raw { margin-top: 14px; font-size: .82rem; }
.dr-raw summary { cursor: pointer; color: var(--b-muted); font-weight: 600; padding: 12px 0; }
.dr-raw pre { white-space: pre-wrap; background: #fff; border: 1px solid var(--b-line); border-radius: 12px; padding: 14px; font: .76rem/1.55 'IBM Plex Mono', monospace; color: #33414A; }
.dr-foot { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 14px 24px 16px; border-top: 1px solid var(--b-line); }
.dr-fine { grid-column: 1 / -1; margin: 0; font-size: .74rem; color: var(--b-muted); text-align: center; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); background: var(--b-ink); color: #fff; padding: 13px 18px 13px 16px; border-radius: 14px; font-weight: 500; font-size: .88rem; display: flex; align-items: center; gap: 10px; opacity: 0; pointer-events: none; transition: all .45s var(--b-ease); z-index: 40; box-shadow: 0 20px 40px -12px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ok { width: 22px; height: 22px; border-radius: 50%; background: #5FBF7F; display: grid; place-items: center; flex: none; }
.toast .ok svg { width: 13px; }
.toast small { display: block; opacity: .65; font-size: .76rem; font-weight: 400; }

/* ---------------------------------------------------------------- RESPONSIVE BUILDER */
@media (max-width: 1180px) { :root { --panel-w: 360px; } .device-toggle button span, .ghost span { display: none; } }
/* ---------------------------------------------------------------- v3 ADDITIONS */
:focus-visible { outline: 2.5px solid var(--b-blue); outline-offset: 2px; }
.bizp-search input:focus-visible { outline: none; }
.device:focus-within { box-shadow: 0 0 0 3px var(--b-panel), 0 0 0 5.5px var(--b-blue), 0 30px 70px -30px rgba(23,36,45,.45); }
.btn-primary:disabled { background: #8A949B; box-shadow: none; cursor: not-allowed; transform: none; }
a.btn-primary { text-decoration: none; }
.bizp-cur { min-height: 74px; }
.bizp-count { display: block; margin: 6px 2px 0; font-size: .72rem; color: var(--b-muted); text-align: right; }
.bizp-count.max { color: var(--b-rust-text); font-weight: 600; }
.bizp-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: .76rem; color: var(--b-muted); }
.bizp-alt[hidden] { display: none; }
.bizp-alt > span { margin-right: 2px; font-weight: 600; }
.achip { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; border: 1px solid var(--b-line2); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: .74rem; font-weight: 600; color: var(--b-ink); }
.achip svg { width: 13px; height: 13px; color: var(--b-blue); }
.achip:hover { border-color: var(--b-ink); }
.linkish { display: block; margin: 8px auto 0; border: 0; background: none; padding: 10px 6px; font-size: .82rem; font-weight: 600; color: var(--b-blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(29,59,79,.35); }
.linkish:hover { text-decoration-color: currentColor; }
.fine-tune { margin-top: 12px; border: 1px solid var(--b-line); border-radius: 12px; background: #fff; }
.fine-tune summary { cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: .86rem; list-style: none; display: flex; flex-direction: column; gap: 2px; position: relative; padding-right: 40px; }
.fine-tune summary::-webkit-details-marker { display: none; }
.fine-tune summary::after { content: ''; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border: solid var(--b-muted); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); transition: transform .3s var(--b-ease); }
.fine-tune[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.fine-tune summary small { font-weight: 400; color: var(--b-muted); font-size: .76rem; }
.fine-tune .themes { padding: 0 10px 12px; }
.pv { width: 100%; }
.var.na { border-style: dashed; cursor: not-allowed; color: var(--b-muted); } .var.na .vthumb, .var.na svg { opacity: .5; }
.var.na:hover { transform: none; background: var(--b-panel); }
.presets:empty { min-height: 308px; }
.sec-list:empty { min-height: 640px; }
.dr-biz { display: flex; gap: 14px; align-items: center; padding: 14px; margin-bottom: 10px; background: #fff; border: 1px solid var(--b-line); border-radius: 14px; }
.dr-biz .bc-ic { width: 56px; height: 56px; border-radius: 12px; }
.dr-biz .bc-ic svg { width: 26px; height: 26px; }
.dr-biz strong { display: block; font-size: 1rem; }
.dr-biz small { color: var(--b-muted); font-size: .8rem; line-height: 1.4; display: block; margin-top: 2px; }
.dr-contact { border: 0; padding: 0; margin: 4px 0 14px; display: grid; gap: 10px; min-width: 0; }
.dr-contact legend { padding: 0; margin-bottom: 8px; font-family: 'Instrument Serif', serif; font-size: 1.3rem; }
.dr-field input { width: 100%; height: 44px; border: 1px solid var(--b-line2); border-radius: 12px; padding: 0 12px; font: inherit; background: #fff; outline: none; }
.dr-field input:focus { border-color: var(--b-blue); box-shadow: 0 0 0 3px rgba(29,59,79,.12); }
.dr-field input[aria-invalid], .dr-field textarea[aria-invalid] { border-color: #B3261E; box-shadow: 0 0 0 3px rgba(179,38,30,.12); }
.stage-peek, .sb-brand { display: none; }
.stage.pulse .device { animation: stagePulse .9s var(--b-ease); }
@keyframes stagePulse { 0% { box-shadow: 0 0 0 0 rgba(201,100,58,.55); } 100% { box-shadow: 0 0 0 10px rgba(201,100,58,0); } }

@media (max-width: 860px) {
  /* the preview is a fixed band: 40dvh at rest, a 92px strip while you work the controls.
     Fixed (not sticky) so collapsing never shifts the controls under your finger. */
  :root { --stage-h: 40vh; --stage-min: 92px; }
  @supports (height: 1dvh) { :root { --stage-h: 40dvh; } }
  html { scroll-padding-top: calc(var(--stage-h) + 12px); scroll-padding-bottom: 84px; }
  body.preview-min { scroll-padding-top: calc(var(--stage-min) + 12px); }
  html:has(body.preview-min) { scroll-padding-top: calc(var(--stage-min) + 12px); }
  .app { display: block; height: auto; min-height: 100dvh; }
  .panel { border-right: 0; padding-top: var(--stage-h); }
  .panel-scroll { overflow: visible; }
  .stage { position: fixed; top: 0; left: 0; right: 0; z-index: 5; height: var(--stage-h); border-bottom: 1px solid var(--b-line); transition: height .4s var(--b-ease); box-shadow: 0 8px 20px -14px rgba(23,36,45,.4); }
  body.preview-min .stage { height: var(--stage-min); }
  body.preview-min .canvas { pointer-events: none; }
  body.preview-min .stage-bar { display: none; }
  body.preview-min .canvas { padding-top: 8px; }
  .stage-peek { display: none; position: absolute; inset: 0; z-index: 4; width: 100%; border: 0; padding: 0 0 8px; align-items: flex-end; justify-content: center; gap: 4px; font: 600 .78rem/1 'Instrument Sans', system-ui, sans-serif; color: var(--b-ink); background: linear-gradient(transparent 40%, rgba(244,242,236,.96) 82%); }
  .stage-peek svg { width: 15px; height: 15px; }
  body.preview-min .stage-peek { display: flex; }
  .stage-bar { grid-template-columns: 1fr auto; padding: 8px 12px; }
  .sb-brand { display: flex; align-items: center; gap: 8px; min-width: 0; font-family: 'Instrument Serif', serif; font-size: 1.12rem; line-height: 1; }
  .sb-brand svg { width: 26px; height: 26px; flex: none; }
  .sb-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-brand i { font-style: normal; font-family: 'Instrument Sans', system-ui, sans-serif; font-size: .72rem; color: var(--b-muted); }
  .url, .device-toggle { display: none; }
  .ghost { min-height: 44px; min-width: 44px; justify-content: center; }
  .canvas { padding: 0 10px 10px; }
  .canvas { overflow: hidden; align-items: flex-start; }
  .device, .device[data-mode="mobile"] { height: calc(var(--stage-h) - 70px); flex: none; width: 100%; max-width: none; max-height: none; border-radius: 12px; box-shadow: 0 0 0 1px rgba(23,36,45,.1); margin: 0; }
  .device[data-mode="mobile"] iframe { border-radius: 0; }
  .notch, .device[data-mode="mobile"] .statusbar { display: none; }
  .brand { display: none; }
  .brand-mark svg { width: 30px; height: 30px; }
  .brand-name { font-size: 1.2rem; }
  .panel-foot { position: sticky; bottom: 0; z-index: 4; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .pf-val { white-space: normal; line-height: 1.25; }
  body.biz-open .panel-foot { display: none; }
  .bizp-grid { max-height: 34vh; max-height: 34dvh; }
  .bchip, .achip { min-height: 44px; }
  .mv button { width: 44px; height: 44px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  body.biz-open .toast { bottom: 24px; }
}
body.picks-open .toast { bottom: 112px; }
@media (pointer: coarse) { .mv button { width: 44px; height: 44px; } .bchip, .achip { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .preset:hover, .theme:hover, .var:hover, .btn-primary:hover { transform: none; }
}
#frame:focus, .device.frame-focus #frame { outline: 3px solid var(--b-blue); outline-offset: -3px; }
.device.frame-focus { box-shadow: 0 0 0 3px var(--b-panel), 0 0 0 5.5px var(--b-blue), 0 30px 70px -30px rgba(23,36,45,.45); }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- v4 ---- */
.fine-tune summary .ft-cur { color: var(--b-ink); font-weight: 600; }
.drawer.no-send .dr-foot { grid-template-columns: 1fr 1fr; }
[hidden] { display: none !important; }
/* v5: compact look cards so Fine-tune sits above the fold at 1280x800 */
.pv { height: 52px; padding: 9px 11px 0; }
.pv .aa { font-size: 1.45rem; }
.preset .pmeta { padding: 7px 11px 8px; }
.fine-tune:not([open]) summary .ft-hint { display: none; }
.fine-tune summary { padding-top: 10px; padding-bottom: 10px; }
/* v5 N10: keep the closed Fine-tune card one line tall for every look (Warm's font list wrapped to 2 lines and pushed the card 10px under the panel footer at 1280x800) */
.fine-tune summary .ft-cur { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* v6 B1: form-send states (only when FORM_ENDPOINT is set) */
.dr-status { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 10px; font-size: .82rem; line-height: 1.4; }
.dr-status.is-busy { background: #EEF2F4; color: #33414A; }
.dr-status.is-ok { background: #E6F2EA; color: #1E5631; border: 1px solid #B9D9C4; }
.dr-status.is-error { background: #FBEAE8; color: #8C1D16; border: 1px solid #EBC1BC; }
#sendBrief.is-busy { opacity: .7; cursor: progress; }
