/* Mockup studio chrome: neutral dark UI so it never competes with the themed product. */
:root {
  --st-bg: #0D0F13; --st-panel: #15181E; --st-elev: #1D2128; --st-elev2: #252A33; --st-border: #2A2F38;
  --st-text: #E8EAEE; --st-muted: #9AA1AD; --st-accent: #A5B4FC; --st-bar-h: 56px; --st-panel-w: 372px;
  --st-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--st-bg); font-family: var(--st-font); color: var(--st-text); }

/* ---------- top bar ---------- */
#st-bar { position: fixed; inset: 0 0 auto 0; height: var(--st-bar-h); z-index: 100; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 14px;
  background: var(--st-panel); border-bottom: 1px solid var(--st-border); font-size: 13px; }
:where(#st-bar, #st-panel, #st-modal) button { font: inherit; color: inherit; cursor: pointer; }
.st-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0; }
.st-brand b { display: block; font-size: 13px; letter-spacing: -.01em; }
.st-brand small { display: block; color: var(--st-muted); font-size: 11px; }
.st-logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #34D399, #059669); color: #fff; }
.st-center { flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; }
.st-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.st-nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
#st-screen { height: 34px; max-width: 290px; min-width: 120px; padding: 0 30px 0 12px; border-radius: 9px; border: 1px solid var(--st-border); background: var(--st-elev);
  color: var(--st-text); font: 500 13px var(--st-font); appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--st-muted) 50%), linear-gradient(135deg, var(--st-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
#st-screen:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 1px; }
.st-count { color: var(--st-muted); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
.st-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--st-muted); }
.st-icon:hover { background: var(--st-elev); color: var(--st-text); }
.st-btn { height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--st-border); background: var(--st-elev); color: var(--st-text); font-weight: 500; white-space: nowrap; }
.st-btn:hover { background: var(--st-elev2); }
.st-btn.on { border-color: #FACC15; color: #FDE68A; background: rgba(250, 204, 21, .1); }
.st-btn.primary { background: var(--st-text); color: #0D0F13; border-color: var(--st-text); font-weight: 600; }
.st-btn.primary.on { background: var(--st-accent); border-color: var(--st-accent); color: #0D0F13; }
.st-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--st-bg); border: 1px solid var(--st-border); }
.st-seg button { height: 28px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border-radius: 7px; border: 0; background: transparent; color: var(--st-muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.st-seg button:hover { color: var(--st-text); }
.st-seg button.on { background: var(--st-elev2); color: var(--st-text); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.st-seg.full { display: flex; width: 100%; }
.st-seg.full button { flex: 1; padding: 0 6px; }
.st-dots { display: flex; gap: 5px; padding: 0 6px; }
.st-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--st-panel); padding: 0;
  background: conic-gradient(var(--a) 0 50%, var(--b) 0 75%, var(--c) 0); box-shadow: 0 0 0 1px var(--st-border); transition: transform .12s; }
.st-dot:hover { transform: scale(1.12); }
.st-dot.on { box-shadow: 0 0 0 2px var(--st-text); }

/* ---------- stage + device ---------- */
#st-stage { position: fixed; top: var(--st-bar-h); left: 0; right: 0; bottom: 0; overflow: hidden; transition: right .25s ease;
  background: radial-gradient(circle at 1px 1px, #242832 1px, transparent 0) 0 0 / 22px 22px, #101217; }
body.panel-open #st-stage { right: var(--st-panel-w); }
#st-device { position: absolute; inset: 0; --sbh: 0px; }
#st-device #frame { position: absolute; top: var(--sbh); left: 0; right: 0; bottom: 0; }
#st-statusbar { display: none; }
body[data-device="tablet"] #st-device, body[data-device="mobile"] #st-device {
  inset: auto; transform-origin: top center; overflow: hidden; background: var(--surface);
  box-shadow: 0 0 0 10px #050608, 0 0 0 11px #343944, 0 40px 90px -10px rgba(0, 0, 0, .75); }
body[data-device="tablet"] #st-device { border-radius: 26px; --sbh: 26px; }
body[data-device="mobile"] #st-device { border-radius: 46px; --sbh: 44px; }
body[data-device="tablet"] #st-statusbar, body[data-device="mobile"] #st-statusbar {
  display: flex; position: absolute; top: 0; left: 0; right: 0; height: var(--sbh); align-items: center; justify-content: space-between;
  padding: 0 28px 0 32px; font: 600 14px var(--st-font); color: var(--text); background: var(--surface); z-index: 2; }
body[data-device="mobile"] #st-statusbar { padding-top: 6px; }
body[data-device="mobile"] #st-statusbar::after { content: ''; position: absolute; left: 50%; top: 10px; width: 110px; height: 30px; margin-left: -55px; border-radius: 20px; background: #000; }
.sb-icons { display: flex; align-items: flex-end; gap: 3px; }
.sb-icons i { width: 4px; background: currentColor; border-radius: 1px; }
.sb-icons i:nth-child(1) { height: 5px; } .sb-icons i:nth-child(2) { height: 8px; } .sb-icons i:nth-child(3) { height: 11px; }
.sb-icons b { width: 24px; height: 11px; border: 1.5px solid currentColor; border-radius: 3px; margin-left: 5px; position: relative; opacity: .9; }
.sb-icons b::after { content: ''; position: absolute; inset: 1.5px 6px 1.5px 1.5px; background: currentColor; border-radius: 1px; }

body[data-device="tablet"] #frame .main, body[data-device="mobile"] #frame .main { scrollbar-width: none; }
body[data-device="tablet"] #frame .main::-webkit-scrollbar, body[data-device="mobile"] #frame .main::-webkit-scrollbar { display: none; }

/* ---------- present mode ---------- */
body.present #st-bar, body.present #st-panel { display: none; }
body.present #st-stage { top: 0; right: 0; }
#st-exit { display: none; position: fixed; top: 10px; right: 10px; z-index: 200; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(13, 15, 19, .72); color: #fff; font: 500 12px var(--st-font); cursor: pointer; opacity: .25; transition: opacity .2s; backdrop-filter: blur(8px); }
#st-exit:hover { opacity: 1; }
body.present #st-exit { display: block; }

/* ---------- panel ---------- */
#st-panel { position: fixed; top: var(--st-bar-h); right: 0; bottom: 0; width: var(--st-panel-w); z-index: 99; overflow-y: auto; overscroll-behavior: contain;
  background: var(--st-panel); border-left: 1px solid var(--st-border); transform: translateX(100%); transition: transform .25s ease; font-size: 13px; }
body.panel-open #st-panel { transform: none; }
#st-panel::-webkit-scrollbar { width: 10px; } #st-panel::-webkit-scrollbar-thumb { background: var(--st-elev2); border-radius: 10px; border: 3px solid var(--st-panel); }
.st-p-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 12px 18px; background: var(--st-panel); border-bottom: 1px solid var(--st-border); }
.st-p-head b { display: block; font-size: 15px; }
.st-p-head small { display: block; color: var(--st-muted); font-size: 12px; margin-top: 2px; }
.st-sec { padding: 16px 18px; border-bottom: 1px solid var(--st-border); display: flex; flex-direction: column; gap: 12px; }
.st-sec h4 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--st-muted); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.st-sec h4 span { text-transform: none; letter-spacing: 0; font-weight: 400; color: #6B7280; font-size: 11.5px; }
.st-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-theme { display: flex; flex-direction: column; gap: 8px; padding: 6px; border-radius: 12px; border: 1px solid var(--st-border); background: var(--st-elev); text-align: left; transition: border-color .15s, transform .15s; }
.st-theme:hover { border-color: #3B4250; transform: translateY(-1px); }
.st-theme.on { border-color: var(--st-text); box-shadow: 0 0 0 1px var(--st-text); }
.st-theme-meta { padding: 0 4px 2px; }
.st-theme-meta b { display: block; font-size: 12.5px; }
.st-theme-meta b em { font-style: normal; font-weight: 500; color: #FDE68A; font-size: 11px; }
.st-theme-meta small { display: block; color: var(--st-muted); font-size: 11px; line-height: 1.35; margin-top: 1px; }
/* mini preview, colored by each theme's own tokens */
.st-mini { height: 78px; border-radius: 8px; overflow: hidden; display: flex; background: var(--bg); border: 1px solid rgba(255,255,255,.06); }
.st-mini .m-chrome { flex: 0 0 24%; background: var(--chrome-bg); display: flex; flex-direction: column; gap: 5px; padding: 7px 6px; border-right: 1px solid var(--chrome-border); }
.st-mini .m-chrome i { height: 4px; border-radius: 3px; background: var(--chrome-muted); opacity: .45; }
.st-mini .m-chrome i.logo { width: 10px; height: 10px; border-radius: 3px; background: var(--chrome-mark-bg); opacity: 1; margin-bottom: 2px; }
.st-mini .m-chrome i.a { height: 7px; background: var(--chrome-active-bg); opacity: 1; }
.st-mini.top { flex-direction: column; }
.st-mini.top .m-chrome { flex: 0 0 18px; flex-direction: row; align-items: center; padding: 0 6px; border-right: 0; border-bottom: 1px solid var(--chrome-border); }
.st-mini.top .m-chrome i { width: 14px; }
.st-mini.top .m-chrome i.logo { width: 8px; height: 8px; margin: 0 4px 0 0; }
.st-mini.top .m-chrome i.a { width: 18px; height: 6px; }
.st-mini .m-body { flex: 1; padding: 6px 7px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.st-mini .m-aa { font-family: var(--font-heading); font-weight: var(--h-weight); color: var(--text); font-size: 15px; line-height: 1; letter-spacing: var(--h-tracking); }
.st-mini .m-cards { flex: 1; display: flex; gap: 4px; }
.st-mini .m-card { flex: 1; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: min(var(--r), 7px); }
.st-mini .m-card::before { content: ''; position: absolute; left: 3px; top: 3px; width: 9px; height: 4px; border-radius: 2px; background: var(--accent); }
.st-mini .m-card em { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 6px; border-radius: min(var(--r-btn), 6px); background: var(--primary); }

.st-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.st-sw { aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); position: relative; transition: transform .12s; display: grid; place-items: center; color: var(--st-muted); }
.st-sw:hover { transform: scale(1.1); }
.st-sw.on { box-shadow: 0 0 0 2px var(--st-panel), 0 0 0 4px var(--st-text); }
.st-sw.custom { cursor: pointer; background: var(--c); border: 1px dashed #4B5260; overflow: hidden; }
.st-sw.custom:not(.on) { background: conic-gradient(from 90deg, #F87171, #FBBF24, #34D399, #60A5FA, #A78BFA, #F472B6, #F87171); color: #fff; border: 0; }
.st-sw.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.st-sw.custom svg { pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.st-hex { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 9px; background: var(--st-bg); border: 1px solid var(--st-border); }
.st-hex-dot { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); flex-shrink: 0; }
.st-hex input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--st-text); font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.st-hex-hint { font-size: 10.5px; color: #6B7280; letter-spacing: .08em; }
.st-hex:focus-within { border-color: var(--st-accent); }
.st-tones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.st-tone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--st-border); background: var(--st-elev); font-size: 12px; color: var(--st-muted); }
.st-tone.on { border-color: var(--st-text); color: var(--st-text); }
.tone-sw { display: flex; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.tone-sw i { width: 12px; height: 20px; }
.st-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.st-font { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--st-border); background: var(--st-elev); text-align: left; min-width: 0; }
.st-font .aa { font-size: 20px; line-height: 1; width: 30px; flex-shrink: 0; }
.st-font .nm { font-size: 12px; color: var(--st-muted); line-height: 1.25; }
.st-font.on { border-color: var(--st-text); }
.st-font.on .nm { color: var(--st-text); }
.st-field { display: flex; flex-direction: column; gap: 6px; }
.st-field > span { font-size: 12px; color: var(--st-muted); }
.st-row { display: flex; align-items: center; gap: 12px; min-height: 30px; }
.st-row > span { flex: 1; color: var(--st-text); }
.st-row input[type=range] { width: 140px; accent-color: var(--st-accent); }
.st-row output { width: 38px; text-align: right; font: 500 12px ui-monospace, Menlo, monospace; color: var(--st-muted); }
.st-toggle { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.st-toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.st-toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--st-elev2); transition: .2s; box-shadow: inset 0 0 0 1px var(--st-border); }
.st-toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.st-toggle input:checked + span { background: var(--st-accent); }
.st-toggle input:checked + span::after { transform: translateX(16px); }
.st-checks { display: flex; justify-content: space-between; font-size: 12px; color: var(--st-muted); }
.st-checks b { font-weight: 600; font-variant-numeric: tabular-nums; }
.st-checks b.ok { color: #6EE7B7; } .st-checks b.mid { color: #FCD34D; } .st-checks b.bad { color: #FCA5A5; }
.st-actions { flex-direction: row; display: flex; gap: 8px; align-items: center; }
.st-actions button { flex: 1; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; border: 1px solid var(--st-border); background: var(--st-elev); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.st-actions button:hover { background: var(--st-elev2); }
.st-actions button.primary { background: var(--st-text); color: #0D0F13; border-color: var(--st-text); font-weight: 600; }
.st-keys { margin: 0; padding: 14px 18px 22px; color: #6B7280; font-size: 11.5px; line-height: 2; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; margin: 0 2px; border-radius: 5px; border: 1px solid var(--st-border); background: var(--st-elev); color: var(--st-muted); font: 500 10.5px/16px ui-monospace, Menlo, monospace; text-align: center; }

/* ---------- export modal ---------- */
.st-modal-wrap { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; }
.st-modal-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.st-modal { position: relative; width: min(720px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 12px; padding: 0 0 16px; border-radius: 16px; background: var(--st-panel); border: 1px solid var(--st-border); box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.st-modal .st-p-head { padding: 16px 16px 12px 20px; }
.st-modal .st-seg { margin: 0 20px; align-self: flex-start; }
.st-modal textarea { margin: 0 20px; height: 380px; resize: vertical; padding: 14px; border-radius: 10px; border: 1px solid var(--st-border); background: var(--st-bg); color: #C7D2FE; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; outline: none; }
.st-modal .st-actions { padding: 0 20px; justify-content: flex-end; }
.st-modal .st-actions button { flex: 0 0 auto; padding: 0 16px; }
.st-copied { flex: 1; color: #6EE7B7; font-size: 12px; }

@media (max-width: 1200px) { body.panel-open #st-stage { right: 0; } .st-count { display: none; } }
@media (max-width: 1100px) { .st-brand div, .st-btn span, .st-seg button span { display: none; } .st-btn { padding: 0 9px; } .st-dots { display: none; } }
@media (max-width: 640px) { :root { --st-panel-w: 100vw; } #st-screen { max-width: 150px; } .st-center { justify-content: flex-start; } #st-bar .st-seg { display: none; } }
