/* Studio editor — quiet chrome, the logo is the brightest thing on screen. */
.studio { display: flex; flex-direction: column; height: calc(100vh - 56px - 52px); height: calc(100dvh - 56px - 52px); min-height: 420px; background: var(--canvas); }
.st-empty { display: grid; place-items: center; gap: 14px; text-align: center; padding: 72px 16px; color: var(--muted); }
.st-empty svg { width: 28px; height: 28px; }

.st-toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; overflow-x: auto; scrollbar-width: none; }
.st-toolbar::-webkit-scrollbar { display: none; }
.st-toolbar .btn { flex: none; }
.st-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; flex: none; }
.st-save { font-size: .75rem; color: var(--muted); padding: 0 8px; white-space: nowrap; }
.st-save[data-state="offline"] { color: var(--bad); }
.st-save[data-state="pending"], .st-save[data-state="saving"] { color: var(--warn); }
.st-save[data-state="failed"], .st-save[data-state="auth"] { color: var(--bad); }
.st-save { display: inline-flex; align-items: center; gap: 6px; }
.st-retry { height: 28px; padding: 0 10px; font-size: .75rem; }
.st-mode { flex: none; margin-right: 6px; }
.st-mode button { padding: 0 12px; }

/* simple mode: no layer tree, no structural tools */
.st-simple .st-adv-only, .st-simple .st-left { display: none !important; }
.st-simple .st-body { grid-template-columns: minmax(0, 1fr) 340px; }
.st-detbar { display: grid; gap: 6px; margin-bottom: 10px; }
.st-dettitle { color: var(--muted); letter-spacing: .02em; }
.st-det { border-style: dashed; }
.st-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.st-fontbtn { display: grid; gap: 2px; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; min-height: 56px; }
.st-fontbtn[aria-selected="true"] { border-color: var(--action); box-shadow: 0 0 0 1px var(--action); }
.st-fontbtn:disabled { opacity: .5; cursor: not-allowed; }
.st-fontsample { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-preset { display: grid; gap: 4px; justify-items: start; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
.st-presetchips { display: flex; gap: 3px; }
.st-presetchips i { width: 18px; height: 18px; border-radius: 50%; display: block; border: 1px solid rgba(0,0,0,.08); }
.st-dl { position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }
.st-dl .btn { width: 100%; justify-content: center; }
.st-arrange .btn { gap: 6px; }
.st-sellbl text { user-select: none; }
.st-vtag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .8125rem; padding: 0 8px; white-space: nowrap; }

.st-notices:empty { display: none; }
.st-notices { padding: 8px 12px 0; }
.st-notice { align-items: center; }

.st-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 228px minmax(0, 1fr) 320px; }
.st-left, .st-right { background: var(--surface); min-height: 0; overflow: auto; }
.st-left { border-right: 1px solid var(--line); padding: 10px 0; }
.st-right { border-left: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.st-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* canvas */
.st-canvas { position: relative; flex: 1; min-height: 0; overflow: hidden; outline: none; cursor: default; touch-action: none; background:
  radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 0) 0 0 / 18px 18px, var(--canvas); }
.st-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.st-canvas.panning, .st-canvas.panning * { cursor: grab !important; }
.st-svg { display: block; position: absolute; inset: 0; user-select: none; }
.st-board { filter: drop-shadow(0 1px 2px rgba(0,0,0,.06)) drop-shadow(0 10px 30px rgba(0,0,0,.08)); }
.st-content path { cursor: pointer; }
.st-h { cursor: nwse-resize; }
.st-h-ne, .st-h-sw { cursor: nesw-resize; }
.st-h-rot { cursor: grab; }
.st-zoom { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2px; box-shadow: var(--shadow); }
.st-zoomlbl { font-size: .75rem; min-width: 44px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-bgseg { position: absolute; right: 12px; bottom: 12px; box-shadow: var(--shadow); }
.st-bgseg button { display: grid; place-items: center; padding: 6px 8px; }
.st-bgseg svg { width: 16px; height: 16px; }
.st-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: .75rem; color: var(--muted); background: color-mix(in srgb, var(--surface) 90%, transparent); border-radius: 999px; padding: 3px 10px; pointer-events: none; }
.st-hint:empty { display: none; }

/* refine */
.st-refine { flex: none; border-top: 1px solid var(--line); background: var(--surface); padding: 10px 12px 12px; }
.st-refbar { display: grid; gap: 10px; }
.st-refrow { display: flex; align-items: center; gap: 8px; }
.st-refrow > svg { width: 18px; height: 18px; color: var(--action); flex: none; }
.st-refin { flex: 1; min-width: 0; height: 40px; font-size: .9375rem; }
.st-quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.st-quick .chip { flex: none; }
.st-jobwrap { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--ink); }
.st-spin { width: 14px; height: 14px; border-radius: 50%; border: 1.6px solid var(--action); border-top-color: transparent; animation: spin .9s linear infinite; }

/* layers */
.st-phead { display: flex; align-items: center; padding: 0 12px 6px; }
.st-layers { list-style: none; margin: 0; padding: 0; }
.st-layer { display: flex; align-items: center; gap: 2px; padding-right: 6px; min-height: 32px; border-left: 2px solid transparent; }
.st-layer:hover { background: var(--action-soft); }
.st-layer.sel { background: var(--action-soft); border-left-color: var(--action); }
.st-layer.off .st-lname { opacity: .45; }
.st-lname { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; text-align: left; padding: 6px 4px; cursor: pointer; font-size: .8125rem; color: var(--ink); }
.st-lname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-lname svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.st-lacts { display: flex; }
.btn.st-mini { width: 26px; height: 26px; }
.btn.st-mini svg { width: 15px; height: 15px; }

/* panel */
.st-tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; scrollbar-width: none; }
.st-tab { flex: 1; border: 0; background: transparent; padding: 11px 10px; font-size: .8125rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.st-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.st-panel { flex: 1; overflow: auto; padding: 4px 14px 24px; }
.st-sec { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.st-sec:last-child { border-bottom: 0; }
.st-sech { margin: 0; font: 600 .6875rem/1.2 var(--ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.st-selhead { display: flex; align-items: center; gap: 8px; padding: 14px 0 4px; }
.st-selhead svg { width: 16px; height: 16px; color: var(--muted); }
.st-field { display: grid; gap: 5px; min-width: 0; }
.st-flabel { font-size: .75rem; color: var(--muted); }
.st-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.st-num { font-variant-numeric: tabular-nums; }
.st-field input[type="range"] { width: 100%; accent-color: var(--action); }
.st-field .row input[type="range"] { flex: 1; }
.st-field .row .st-num { width: 72px; flex: none; }
.st-field .seg { width: 100%; }
.st-field .seg button { flex: 1; }
.notice.small { font-size: .8125rem; padding: 8px 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.st-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.st-swatch { position: relative; width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(0,0,0,.14); cursor: pointer; padding: 0; display: grid; place-items: center; overflow: hidden; }
.st-swatch[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.st-swatch input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.st-swatch.st-custom { background: conic-gradient(#e5484d, #f5d90a, #30a46c, #0091ff, #8e4ec6, #e5484d); color: #fff; }
.st-swatch.st-custom svg { width: 14px; height: 14px; filter: drop-shadow(0 0 2px rgba(0,0,0,.6)); }
.st-swatch.big { width: 38px; height: 38px; flex: none; }
.st-palrow { display: flex; align-items: center; gap: 10px; }
.st-palid { font-size: .75rem; color: var(--muted); text-transform: capitalize; margin-bottom: 2px; }
.st-contrast { display: grid; gap: 2px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-contrast .lo { color: var(--warn); }
.st-layouts { display: flex; flex-wrap: wrap; gap: 6px; }

.st-kern summary { cursor: pointer; font-size: .8125rem; font-weight: 600; padding: 4px 0; }
.st-kerngrid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.st-kpair { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px; background: var(--canvas); }
.st-kpair.on { border-color: var(--action); }
.st-kletters { display: inline-flex; align-items: center; font-weight: 600; font-size: .875rem; padding: 0 4px; }
.st-kletters i { width: 1px; height: 12px; background: var(--action); margin: 0 2px; }
.st-kbtn { width: 22px; height: 22px; border: 0; background: transparent; cursor: pointer; border-radius: 5px; font-size: 1rem; line-height: 1; color: var(--ink); }
.st-kbtn:hover { background: var(--action-soft); }
.st-kval { font-size: .6875rem; min-width: 22px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }

.st-versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-ver { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 6px; }
.st-ver.cur { border-color: var(--action); }
.st-ver .btn { height: 30px; padding: 0 8px; font-size: .75rem; }
.st-vnote { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.st-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-check { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: .8125rem; align-items: start; }
.st-check > svg { width: 16px; height: 16px; margin-top: 2px; }
.st-check.pass > svg { color: var(--ok); }
.st-check.warn > svg { color: var(--warn); }
.st-check.fail > svg { color: var(--bad); }
.st-check .tiny { word-break: break-word; }
.st-smalls { display: grid; gap: 8px; }
.st-smallrow { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); overflow-x: auto; }
.st-smallcell { display: inline-flex; flex: none; }
.st-smallcell svg { display: block; }
.st-review { display: grid; gap: 8px; }

.st-modal-wide { width: min(980px, 100%) !important; }
.st-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-compare figure { margin: 0; display: grid; gap: 6px; text-align: center; }
.st-compare svg { width: 100%; height: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-sizing: border-box; }

/* tablet: drop the layers column */
@media (max-width: 1100px) {
  .st-body { grid-template-columns: minmax(0, 1fr) 300px; }
  .st-left { display: none; }
}
/* mobile: canvas full width, controls in a bottom sheet */
@media (max-width: 760px) {
  .studio { height: calc(100dvh - 56px - 52px - var(--kb, 0px)); overflow-x: hidden; }
  .st-body { display: flex; flex-direction: column; }
  .st-center { flex: 1 1 52%; min-height: max(220px, 45%); }
  .studio.kb-open .st-center { flex-basis: 34%; min-height: 160px; }
  .st-fonts { grid-template-columns: 1fr 1fr; }
  .st-mode button, .st-retry { min-height: 44px; }
  .st-refine { display: none; }
  .st-right { flex: 1 1 48%; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.08); }
  .st-tab { padding: 13px 12px; flex: none; }
  .st-hide-s { display: none; }
  .st-panel .btn, .st-panel .chip { min-height: 44px; }
  .st-kbtn { width: 36px; height: 36px; }
  .st-grid4 { grid-template-columns: 1fr 1fr; }
  .st-compare { grid-template-columns: 1fr; }
  .st-quick { flex-wrap: wrap; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .st-spin { animation: none; border-top-color: var(--action); } }
