body.editor-active {
  --studio-ink: #121615;
  --studio-carbon: #1d2422;
  --studio-deep: #29322f;
  --studio-fog: #dce1dc;
  --studio-paper: #f7f9f5;
  --studio-white: #ffffff;
  --studio-signal: #dfff5a;
  --studio-cyan: #9ee3ef;
  --studio-coral: #ff6846;
  --studio-line: rgba(18, 22, 21, .22);
  --studio-muted: #68716d;
  color: var(--studio-ink);
  background: var(--studio-fog);
  overflow-x: clip;
}
body.editor-active #home-view, body:not(.editor-active) #editor-view { display: none !important; }
body.editor-active #editor-view { min-height: 100vh; background: var(--studio-fog); }
body.editor-active button:focus-visible,
body.editor-active a:focus-visible,
body.editor-active input:focus-visible,
body.editor-active textarea:focus-visible,
body.editor-active select:focus-visible,
body.editor-active summary:focus-visible { outline: 2px solid var(--studio-coral); outline-offset: 3px; }

.studio-commandbar {
  position: fixed; inset-block-start: 14px; inset-inline: 14px; z-index: 50;
  min-height: 54px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  color: var(--studio-paper); background: var(--studio-ink); border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 14px 38px rgba(10,14,13,.18); padding: 6px 7px;
}
.studio-exit, .studio-primary, .studio-secondary, .language-button {
  border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px;
}
.studio-exit { justify-self: start; padding-inline: 13px; font-size: 13px; transition: background .22s, color .22s; }
.studio-exit:hover { color: var(--studio-ink); background: var(--studio-signal); }
.studio-exit .icon { transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.studio-exit:hover .icon { transform: translateX(-4px); }
[dir="rtl"] .studio-exit:hover .icon { transform: scaleX(-1) translateX(-4px); }
.studio-document { display: flex; align-items: center; gap: 13px; min-width: 0; }
.studio-document img { filter: brightness(0) invert(1); width: 74px; height: auto; }
.studio-document > span { width: 1px; height: 22px; background: rgba(255,255,255,.28); }
.studio-document b { font-size: 11px; font-weight: 400; color: rgba(255,255,255,.66); white-space: nowrap; }
.studio-status { justify-self: end; display: flex; align-items: center; gap: 5px; }
.save-indicator { display: inline-flex; align-items: center; gap: 8px; padding-inline: 12px; font-size: 11px; color: rgba(255,255,255,.62); }
.save-indicator i { width: 7px; height: 7px; background: var(--studio-signal); transform: rotate(45deg); }
.save-indicator.unsaved i { background: var(--studio-coral); }
.studio-commandbar .language-button { padding-inline: 13px; color: var(--studio-paper); background: transparent; font-size: 12px; }
.studio-commandbar .language-button:hover { background: var(--studio-deep); }
.studio-primary { padding-inline: 16px; color: var(--studio-ink); background: var(--studio-signal); font-size: 13px; font-weight: 700; }
.studio-primary:hover .icon { transform: rotate(45deg); }
.studio-primary .icon { transition: transform .3s cubic-bezier(.2,.8,.2,1); }

.studio-workspace { padding: 82px 14px 14px; }
.composition-stage {
  position: relative; min-height: min(720px, calc(100vh - 96px)); overflow: hidden;
  color: var(--studio-paper); background: var(--studio-carbon); isolation: isolate;
}
.stage-tools { position: absolute; z-index: 5; inset-inline-end: 24px; inset-block-start: 34px; display: flex; flex-direction: column; gap: 1px; background: rgba(255,255,255,.12); padding: 1px; }
.stage-tools button { width: 122px; min-height: 48px; border: 0; display: flex; align-items: center; gap: 12px; padding-inline: 13px; color: var(--studio-paper); background: var(--studio-deep); font-size: 11px; transition: width .28s cubic-bezier(.16,1,.3,1), color .2s, background .2s; }
.stage-tools button:hover, .stage-tools button.active { width: 142px; color: var(--studio-ink); background: var(--studio-signal); }

.specimen-library { padding: clamp(48px,7vw,104px) clamp(18px,4vw,64px) 80px; background: var(--studio-paper); }
.library-heading { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end; border-bottom: 1px solid var(--studio-ink); padding-bottom: 28px; }
.library-heading h2 { font-size: clamp(40px,6vw,88px); line-height: .9; font-weight: 400; }
.library-heading p { max-width: 490px; margin-top: 18px; color: var(--studio-muted); font-size: 14px; line-height: 1.7; }
.view-switch { display: flex; border: 1px solid var(--studio-ink); }
.view-switch .icon-button { border-radius: 0; width: 48px; height: 44px; }
.view-switch .icon-button + .icon-button { border-inline-start: 1px solid var(--studio-ink); }
.view-switch .active { color: var(--studio-paper); background: var(--studio-ink); }
.library-console { display: grid; grid-template-columns: auto 1fr; align-items: stretch; border-bottom: 1px solid var(--studio-ink); }
.source-tabs { display: flex; align-items: stretch; }
.source-tabs button { min-height: 62px; padding-inline: 20px; border: 0; border-inline-end: 1px solid var(--studio-ink); display: inline-flex; align-items: center; gap: 9px; font-size: 12px; transition: background .2s; }
.source-tabs button:hover { background: var(--studio-fog); }
.source-tabs button.active { background: var(--studio-signal); font-weight: 700; }
.source-tabs b { min-width: 19px; height: 19px; display: grid; place-items: center; color: var(--studio-paper); background: var(--studio-ink); font: 9px/1 ui-monospace,monospace; }
.font-filters { display: grid; grid-template-columns: 1fr 170px auto; }
.search-field { min-height: 62px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; padding-inline: 18px; border-inline-end: 1px solid var(--studio-ink); }
.search-field:focus-within { background: var(--studio-white); box-shadow: inset 0 -4px var(--studio-cyan); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--studio-ink); font-size: 13px; }
.font-filters select { border: 0; border-inline-end: 1px solid var(--studio-ink); padding-inline: 14px; background: transparent; color: var(--studio-ink); font-size: 12px; }
.studio-secondary { padding-inline: 16px; border: 0; background: var(--studio-cyan); color: var(--studio-ink); }
.results-ledger { min-height: 46px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--studio-line); color: var(--studio-muted); font: 10px/1.3 ui-monospace,SFMono-Regular,monospace; }
#catalog-status { margin-inline-end: auto; }.ledger-action { border: 0; text-decoration: underline; text-underline-offset: 4px; font: inherit; }
.specimen-field { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-inline-start: 1px solid var(--studio-ink); }
.specimen-field.list-view { grid-template-columns: 1fr; }
.result-card { position: relative; min-width: 0; border-inline-end: 1px solid var(--studio-ink); border-bottom: 1px solid var(--studio-ink); background: var(--studio-white); overflow: hidden; }
.result-card::before { content: ""; position: absolute; z-index: 4; inset-block-start: 0; inset-inline-start: 0; width: 0; height: 4px; background: var(--studio-signal); transition: width .5s cubic-bezier(.16,1,.3,1); }
.result-card:hover::before, .result-card:focus-within::before { width: 100%; }
.card-preview { min-height: 310px; display: grid; place-items: center; padding: 42px 28px 22px; background: var(--preview-bg,var(--studio-white)); transition: transform .55s cubic-bezier(.16,1,.3,1); transform-origin: center; }
.result-card:hover .card-preview { transform: scale(1.025); }
.card-preview .composition { width: 100%; }
.specimen-field.list-view .result-card { display: grid; grid-template-columns: minmax(0,1fr) 230px; }
.specimen-field.list-view .card-preview { min-height: 250px; }
.specimen-strip { position: relative; z-index: 5; min-height: 66px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 11px 14px 11px 18px; border-top: 1px solid var(--studio-ink); background: var(--studio-paper); }
.font-info { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.font-info bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.font-info small { color: var(--studio-muted); font: 9px/1.3 ui-monospace,monospace; white-space: nowrap; }
.card-actions { display: flex; gap: 1px; background: var(--studio-ink); border: 1px solid var(--studio-ink); }
.card-actions .icon-button { width: 38px; height: 38px; color: var(--studio-ink); background: var(--studio-paper); border-radius: 0; }
.card-actions .icon-button:hover { background: var(--studio-cyan); }
.card-actions .fav-active { background: var(--studio-signal); }
.snapshot-tag { position: absolute; z-index: 6; top: 14px; inset-inline-start: 14px; padding: 7px 9px; background: var(--studio-signal); font: 9px/1 ui-monospace,monospace; }
.restore-action { width: 100%; min-height: 42px; border: 0; border-top: 1px solid var(--studio-ink); display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--studio-cyan); font-size: 11px; }
.font-error .card-preview { opacity: .55; }
.studio-load-more { width: 100%; min-height: 62px; border: 1px solid var(--studio-ink); border-top: 0; background: transparent; font-size: 13px; transition: background .2s; }
.studio-load-more:hover { background: var(--studio-signal); }
.empty-state { padding: 70px 20px; text-align: center; border: 1px solid var(--studio-ink); border-top: 0; }
.empty-state .illustration { width: 180px; margin-bottom: 25px; }.empty-state h2 { font-size: 30px; font-weight: 400; }.empty-state p { max-width: 440px; margin: 12px auto 22px; color: var(--studio-muted); line-height: 1.7; }

.control-surface { position: fixed; z-index: 80; inset-block: 14px; inset-inline-end: 14px; width: min(430px,calc(100vw - 28px)); overflow: auto; color: var(--studio-ink); background: var(--studio-paper); box-shadow: -24px 0 70px rgba(0,0,0,.25); transform: translateX(calc(100% + 40px)); visibility: hidden; transition: transform .48s cubic-bezier(.16,1,.3,1), visibility .48s; }
[dir="rtl"] .control-surface { transform: translateX(calc(-100% - 40px)); }
.settings-open .control-surface { transform: translateX(0); visibility: visible; }
.control-head { position: sticky; top: 0; z-index: 3; min-height: 84px; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; color: var(--studio-paper); background: var(--studio-ink); }
.control-head > div > span { font: 9px/1 ui-monospace,monospace; color: var(--studio-cyan); letter-spacing: .08em; }.control-head h2 { margin-top: 7px; font-size: 24px; font-weight: 400; }.control-head .icon-button { color: var(--studio-paper); border: 1px solid rgba(255,255,255,.35); border-radius: 0; }
.settings-group { border-bottom: 1px solid var(--studio-ink); }
.settings-group summary { min-height: 58px; display: grid; grid-template-columns: 26px 1fr 22px; align-items: center; gap: 12px; padding-inline: 18px; cursor: pointer; list-style: none; font-size: 13px; }
.settings-group summary::-webkit-details-marker { display:none; }.settings-group summary .icon-chevron { transition: transform .25s; }.settings-group[open] summary .icon-chevron { transform: rotate(90deg); }.settings-type[open] summary { background: var(--studio-signal); }.settings-symbol[open] summary { background: var(--studio-cyan); }.settings-layout[open] summary { color: var(--studio-paper); background: var(--studio-deep); }
.settings-content { padding: 20px 18px 26px; background: var(--studio-white); }
.field-label { display: block; margin-bottom: 8px; color: var(--studio-muted); font-size: 10px; }
#logo-name { width: 100%; min-height: 88px; resize: vertical; border: 0; border-bottom: 1px solid var(--studio-ink); outline: 0; padding: 12px; background: var(--studio-fog); color: var(--studio-ink); font-size: 28px; line-height: 1.2; }
#logo-name:focus { box-shadow: inset 0 -4px var(--studio-cyan); }
.range-control { margin-top: 20px; }.range-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; font-size: 11px; }.range-label output { font: 10px/1 ui-monospace,monospace; color: var(--studio-muted); }
.range-control input { width: 100%; height: 18px; accent-color: var(--studio-ink); }
.upload-zone { width: 100%; min-height: 118px; display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; align-items: center; text-align: start; border: 1px dashed var(--studio-ink); padding: 18px; background: var(--studio-fog); }
.upload-zone #svg-mini { grid-row: 1/3; width: 42px; height: 42px; display: grid; place-items: center; background: var(--studio-ink); color: var(--studio-paper); }.upload-zone small { color: var(--studio-muted); font-size: 9px; }.upload-zone.dragging { background: var(--studio-signal); }
.symbol-actions { display: flex; gap: 1px; margin-top: 1px; background: var(--studio-ink); }.symbol-actions button { flex: 1; border: 0; min-height: 38px; background: var(--studio-paper); font-size: 11px; }
.position-options, .segmented { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--studio-ink); }.segmented { grid-template-columns: repeat(3,1fr); margin-bottom: 20px; }.position-options button, .segmented button { min-height: 40px; border: 0; border-inline-end: 1px solid var(--studio-ink); font-size: 10px; }.position-options button:last-child,.segmented button:last-child { border-inline-end: 0; }.position-options .active,.segmented .active { background: var(--studio-signal); }
.color-controls { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--studio-ink); }.color-control { min-width: 0; padding: 10px; border-inline-end: 1px solid var(--studio-ink); font-size: 9px; }.color-control:last-child { border-inline-end: 0; }.color-control input { width: 100%; height: 36px; border: 0; padding: 0; background: none; }.color-control span { display: block; margin-top: 6px; }
.control-footer { padding: 20px 18px 28px; }.control-footer p { margin-bottom: 18px; color: var(--studio-muted); font-size: 10px; line-height: 1.7; }.reset-control { border: 0; display: flex; align-items: center; gap: 9px; padding: 0; font-size: 11px; text-decoration: underline; text-underline-offset: 5px; }

.export-dialog { width: min(620px,calc(100vw - 28px)); padding: 0; border: 1px solid var(--studio-ink); border-radius: 0; color: var(--studio-ink); background: var(--studio-paper); box-shadow: 20px 20px 0 var(--studio-deep); }
.export-dialog::backdrop { background: rgba(10,14,13,.72); }.dialog-header { display:flex; align-items:center; justify-content:space-between; padding:18px; color:var(--studio-paper); background:var(--studio-ink); }.dialog-header h2{font-size:24px;font-weight:400}.export-dialog>p,.export-preview,.export-formats,.check-label,.font-notice,#export-confirm{margin-inline:20px}.export-dialog>p{margin-block:20px}.export-preview{min-height:180px;display:grid;place-items:center;background:var(--studio-white);border:1px solid var(--studio-ink)}.export-formats{display:grid;grid-template-columns:1fr 1fr;padding:0;border:1px solid var(--studio-ink);margin-block:18px}.export-formats label{padding:15px}.export-formats label+label{border-inline-start:1px solid var(--studio-ink)}.export-formats small{display:block;color:var(--studio-muted);font-size:10px}.check-label{display:flex;gap:10px}.font-notice{font-size:10px;color:var(--studio-muted);line-height:1.6}#export-confirm{width:calc(100% - 40px);min-height:52px;margin-block:20px;border:0;background:var(--studio-signal);color:var(--studio-ink)}
.toast { position: fixed; z-index: 120; left: 50%; bottom: 22px; transform: translate(-50%,30px); opacity: 0; padding: 12px 18px; color: var(--studio-paper); background: var(--studio-ink); box-shadow: 6px 6px 0 var(--studio-cyan); font-size: 12px; transition: .25s; }.toast.visible { transform: translate(-50%,0); opacity: 1; }

@media (max-width: 900px) {
  .studio-commandbar { grid-template-columns: auto 1fr auto; }.studio-document b,.save-indicator{display:none}.studio-document{justify-self:center}.studio-primary span:last-child{display:none}.studio-primary{width:42px;padding:0}
  .composition-stage{min-height:680px}.stage-tools{inset-inline:32px;inset-block-start:auto;bottom:22px;flex-direction:row;justify-content:center}.stage-tools button{width:auto;min-width:88px}.stage-tools button:hover,.stage-tools button.active{width:auto}
  .library-console{grid-template-columns:1fr}.source-tabs{border-bottom:1px solid var(--studio-ink)}.source-tabs button{flex:1;justify-content:center}.font-filters{grid-template-columns:1fr 150px}.specimen-field{grid-template-columns:1fr}.card-preview{min-height:280px}
}
@media (max-width: 600px) {
  .studio-commandbar{inset:8px;min-height:50px}.studio-workspace{padding:66px 8px 8px}.studio-exit span:last-child,.studio-document>span,.studio-document b{display:none}.studio-document img{width:58px}.composition-stage{min-height:620px}.stage-tools{inset-inline:18px;bottom:18px}.stage-tools button{min-width:0;flex:1;padding-inline:9px;font-size:9px}.specimen-library{padding:44px 12px 60px}.library-heading{grid-template-columns:1fr}.library-heading h2{font-size:48px}.view-switch{justify-self:end}.source-tabs button{padding-inline:8px;font-size:10px}.font-filters{grid-template-columns:1fr}.font-filters select{min-height:48px;border-top:1px solid var(--studio-ink);border-inline-end:0}.results-ledger{flex-wrap:wrap;padding-block:10px}.font-info{display:block}.font-info small{display:block;margin-top:4px}.specimen-strip{grid-template-columns:1fr auto}.specimen-field.list-view .result-card{display:block}.control-surface{inset:8px;width:calc(100vw - 16px)}
}
@media (prefers-reduced-motion: reduce) {
  .stage-tools button,.result-card::before,.card-preview,.control-surface { transition-duration: .01ms !important; }
}

/* Output arrives as a working tray rather than a centred app modal. */
.export-dialog[open] {
  position: fixed; inset: auto 14px 14px; width: auto; max-width: none; margin: 0;
  display: grid; grid-template-columns: minmax(360px,1.35fr) minmax(300px,.65fr);
  grid-template-areas: "head head" "preview intro" "preview formats" "preview transparent" "preview notice" "preview action";
  gap: 0; box-shadow: 14px 14px 0 var(--studio-cyan);
}
.export-dialog .dialog-header { grid-area: head; }.export-dialog > p:first-of-type { grid-area: intro; align-self:end; }.export-dialog .export-preview { grid-area: preview; margin: 0; min-height: 380px; border: 0; border-inline-end: 1px solid var(--studio-ink); }.export-dialog .export-formats { grid-area: formats; }.export-dialog .check-label { grid-area: transparent; }.export-dialog .font-notice { grid-area: notice; }.export-dialog #export-confirm { grid-area: action; align-self:end; }
@media (max-width: 720px) {
  .export-dialog[open] { inset: 8px; grid-template-columns: 1fr; grid-template-areas: "head" "intro" "preview" "formats" "transparent" "notice" "action"; overflow:auto; }
  .export-dialog .export-preview { min-height:220px; border-inline-end:0; border-block:1px solid var(--studio-ink); }
}

/* Cohesion pass — share the public site's exact palette and visual weight. */
body.editor-active {
  --studio-ink: #151918;
  --studio-carbon: #ebeee6;
  --studio-deep: #151918;
  --studio-fog: #ebeee6;
  --studio-paper: #fffef8;
  --studio-white: #fffef8;
  --studio-signal: #cfe8a6;
  --studio-cyan: #3154ff;
  --studio-coral: #ff6a3d;
  --studio-line: rgba(21,25,24,.18);
  --studio-muted: #59615e;
}
.studio-commandbar {
  inset-block-start: 12px;
  min-height: 84px;
  padding: 10px 12px;
  color: var(--studio-ink);
  background: var(--studio-paper);
  border-color: var(--studio-ink);
  box-shadow: 0 10px 26px rgba(21,25,24,.1);
}
.studio-document img { width: 116px; filter: none; }
.studio-document > span { height: 30px; background: var(--studio-line); }
.studio-document b, .save-indicator { color: var(--studio-muted); font-size: 12px; }
.studio-commandbar .language-button { color: var(--studio-ink); min-height: 48px; }
.studio-commandbar .language-button:hover { color: var(--studio-paper); background: var(--studio-ink); }
.studio-exit { min-height: 48px; padding-inline: 18px; }
.studio-exit:hover { color: var(--studio-paper); background: var(--studio-ink); }
.studio-primary { min-height: 52px; padding-inline: 20px; color: var(--studio-paper); background: var(--studio-ink); }
.studio-primary:hover { color: var(--studio-ink); background: var(--studio-pistachio, #cfe8a6); }
.save-indicator i { background: var(--studio-blue, #3154ff); }
.studio-workspace { padding: 108px 14px 14px; }
.composition-stage { min-height: min(610px, calc(100vh - 124px)); color: var(--studio-ink); background: var(--studio-fog); border: 1px solid var(--studio-ink); }
.stage-tools { inset-block-start: 32px; background: var(--studio-ink); }
.stage-tools button { color: var(--studio-paper); background: var(--studio-ink); }
.stage-tools button:hover, .stage-tools button.active { width: 136px; color: var(--studio-paper); background: var(--studio-cyan); }
.specimen-library { padding: 58px clamp(18px,3vw,48px) 64px; background: var(--studio-paper); }
.library-heading { padding-bottom: 22px; }
.library-heading h2 { font-size: clamp(42px,5vw,72px); }
.library-heading p { margin-top: 12px; }
.source-tabs button.active { color: var(--studio-paper); background: var(--studio-cyan); }
.source-tabs b { background: var(--studio-ink); }
.search-field:focus-within { box-shadow: inset 0 -4px var(--studio-cyan); }
.studio-secondary { color: var(--studio-paper); background: var(--studio-cyan); }
.specimen-field { grid-template-columns: repeat(3,minmax(0,1fr)); }
.card-preview { min-height: 184px; padding: 22px 18px 12px; }
.result-card:hover .card-preview { transform: translateY(-2px); }
.result-card::before { height: 3px; background: var(--studio-cyan); }
.specimen-strip { min-height: 56px; gap: 10px; padding: 8px 9px 8px 12px; }
.font-info { display: block; }
.font-info bdi { font-size: 13px; }
.font-info small { display: block; margin-top: 3px; font-size: 8px; }
.card-actions .icon-button { width: 33px; height: 33px; }
.card-actions .icon-button:hover { color: var(--studio-paper); background: var(--studio-cyan); }
.card-actions .fav-active { color: var(--studio-ink); background: var(--studio-signal); }
.control-head { min-height: 92px; }.settings-type[open] summary { color: var(--studio-paper); background: var(--studio-cyan); }.settings-symbol[open] summary { background: var(--studio-signal); }.settings-layout[open] summary { background: var(--studio-ink); }
.export-dialog[open] { box-shadow: 10px 10px 0 var(--studio-signal); }
#export-confirm { color: var(--studio-paper); background: var(--studio-cyan); }
.toast { box-shadow: 5px 5px 0 var(--studio-signal); }
@media (max-width: 1100px) {
  .specimen-field { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .studio-commandbar { min-height: 76px; }
  .studio-workspace { padding-top: 100px; }
  .composition-stage { min-height: 620px; }
  .card-preview { min-height: 178px; }
}
@media (max-width: 600px) {
  .studio-commandbar { inset: 8px; min-height: 66px; }
  .studio-document img { width: 78px; }
  .studio-workspace { padding-top: 82px; }
  .composition-stage { min-height: 590px; }
  .specimen-field { grid-template-columns: 1fr; }
  .card-preview { min-height: 165px; }
}

/* Compact comparison field: fixed optical height, denser scanning. */
.specimen-field:not(.list-view) { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card-preview { min-height: 0; height: 190px; padding: 14px 12px 8px; }
.card-preview > svg { display: block; width: 100%; height: 100%; }
.specimen-field.list-view .card-preview { min-height: 0; height: 210px; }
@media (max-width: 700px) {
  .specimen-field:not(.list-view) { grid-template-columns: 1fr; }
  .card-preview { height: 170px; }
}

/* Compact working stage — preview first, without a second-page hero. */
.composition-stage {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr) 118px;
  align-items: stretch;
  gap: 24px;
  padding: 24px 28px;
}
.stage-tools {
  position: relative;
  inset: auto;
  grid-column: 3;
  align-self: center;
  width: 100%;
}
.stage-tools button { width: 100%; min-height: 54px; padding-inline: 11px; }
.stage-tools button:hover, .stage-tools button.active { width: 100%; }
@media (max-width: 900px) {
  .composition-stage {
    min-height: 0;
    grid-template-columns: 1fr 104px;
    grid-template-rows: auto 250px;
    gap: 18px;
    padding: 24px;
  }
  .stage-tools { grid-column: 2; grid-row: 2; inset: auto; display: flex; flex-direction: column; }
  .stage-tools button { min-width: 0; flex: 1; }
}
@media (max-width: 600px) {
  .composition-stage { grid-template-columns: 1fr; grid-template-rows: auto 210px auto; padding: 18px; }
  .stage-tools { grid-column: 1; grid-row: 3; flex-direction: row; }
  .stage-tools button { min-height: 48px; }
}

/* Final stage reduction: retain context and tools, remove the decorative canvas. */
.composition-stage {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 12px 10px 22px;
  background: var(--studio-paper);
  border: 1px solid var(--studio-ink);
}
.compact-study { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.compact-study span { color: var(--studio-muted); font-size: 10px; }
.compact-study strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 22px; font-weight: 400; }
.stage-tools {
  position: relative;
  inset: auto;
  width: auto;
  display: flex;
  flex-direction: row;
  align-self: center;
  gap: 1px;
}
.stage-tools button { width: auto; min-height: 48px; padding-inline: 14px; }
.stage-tools button:hover, .stage-tools button.active { width: auto; }
@media (max-width: 700px) {
  .composition-stage { min-height: 0; display: block; padding: 14px; }
  .compact-study { margin-bottom: 12px; }
  .compact-study strong { font-size: 19px; }
  .stage-tools { width: 100%; }
  .stage-tools button { flex: 1; min-width: 0; padding-inline: 8px; font-size: 9px; }
}

/* Predictable specimen density: never more than four previews per row. */
.specimen-field:not(.list-view) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1439px) {
  .specimen-field:not(.list-view) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 999px) {
  .specimen-field:not(.list-view) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .specimen-field:not(.list-view) { grid-template-columns: 1fr; }
}

/* Header parity with the public site. */
.studio-commandbar {
  position: relative;
  inset: auto;
  min-height: 84px;
  grid-template-columns: 1fr auto 1fr;
  padding: 0 clamp(22px, 4.5vw, 76px);
  color: var(--studio-ink);
  background: var(--studio-fog);
  border: 0;
  border-bottom: 1px solid var(--studio-ink);
  box-shadow: none;
}
.studio-brand { width: max-content; display: inline-flex; align-items: center; }
.studio-brand img { display: block; width: 138px; filter: none; }
.studio-nav { display: flex; align-items: stretch; align-self: stretch; border-inline: 1px solid var(--studio-ink); }
.studio-nav > a, .studio-nav > .save-indicator {
  min-width: 158px;
  display: grid;
  place-items: center;
  padding-inline: 22px;
  color: var(--studio-ink);
  font-size: 13px;
}
.studio-nav > .save-indicator { grid-template-columns: auto auto; gap: 10px; color: var(--studio-muted); border-inline-start: 1px solid var(--studio-ink); }
.studio-nav > a { transition: color .25s, background .25s; }
.studio-nav > a:hover { color: var(--studio-paper); background: var(--studio-ink); }
.studio-status { gap: 26px; }
.studio-commandbar .language-button { min-height: auto; padding: 10px 0; text-decoration: underline; text-underline-offset: 6px; }
.studio-commandbar .language-button:hover { color: var(--studio-ink); background: transparent; }
.studio-primary { min-height: 42px; gap: 28px; padding: 8px 18px; border: 1px solid var(--studio-ink); }
.studio-workspace { padding: 14px; }
@media (max-width: 900px) {
  .studio-commandbar { min-height: 76px; grid-template-columns: 1fr auto; padding-inline: 20px; }
  .studio-nav { display: none; }
  .studio-status { gap: 16px; }
  .studio-primary { width: 44px; padding: 0; }
  .studio-primary span:first-child { display: none; }
  .studio-workspace { padding: 10px; }
}
@media (max-width: 600px) {
  .studio-commandbar { inset: auto; min-height: 70px; padding-inline: 14px; }
  .studio-brand img { width: 108px; }
  .studio-workspace { padding: 8px; }
}

/* Soft, separated workspace surfaces. */
body.editor-active #editor-view { padding: 1px; background: var(--studio-fog); }
.studio-commandbar {
  position: sticky;
  inset-block-start: 12px;
  width: auto;
  min-height: 78px;
  margin: 12px;
  padding-inline: clamp(18px, 3.6vw, 58px);
  border: 1px solid var(--studio-line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--studio-paper) 96%, transparent);
  box-shadow: 0 10px 32px rgba(21,25,24,.09);
  overflow: hidden;
  backdrop-filter: blur(16px);
}
.studio-nav { border-color: var(--studio-line); }
.studio-nav > .save-indicator { border-color: var(--studio-line); }
.studio-primary { border-radius: 10px; }
.studio-workspace { padding: 0 12px 18px; }
.composition-stage {
  border-color: var(--studio-line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(21,25,24,.05);
}
.stage-tools { border-radius: 12px; overflow: hidden; }
.stage-tools button { border-radius: 0; }
.specimen-library {
  margin-top: 12px;
  border: 1px solid var(--studio-line);
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(21,25,24,.055);
  overflow: hidden;
}
.library-heading { border-color: var(--studio-line); }
.view-switch { border-color: var(--studio-line); border-radius: 12px; overflow: hidden; }
.view-switch .icon-button + .icon-button { border-color: var(--studio-line); }
.library-console {
  margin-top: 24px;
  border: 1px solid var(--studio-line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--studio-white);
}
.source-tabs button, .search-field, .font-filters select { border-color: var(--studio-line); }
.source-tabs button.active { box-shadow: inset 0 0 0 1px rgba(21,25,24,.08); }
.search-field:focus-within { box-shadow: inset 0 -3px var(--studio-cyan); }
.results-ledger { border-color: var(--studio-line); }
.specimen-field, .specimen-field:not(.list-view) {
  gap: 12px;
  padding-top: 12px;
  border: 0;
}
.result-card {
  border: 1px solid var(--studio-line);
  border-radius: 14px;
  box-shadow: 0 5px 16px rgba(21,25,24,.045);
}
.specimen-strip { border-color: var(--studio-line); }
.card-actions { border-color: var(--studio-line); border-radius: 9px; overflow: hidden; background: var(--studio-line); }
.card-actions .icon-button { border-radius: 0; }
.studio-load-more { margin-top: 14px; border: 1px solid var(--studio-line); border-radius: 12px; }
.control-surface { inset-block: 12px; inset-inline-end: 12px; border-radius: 18px; box-shadow: -18px 8px 54px rgba(21,25,24,.22); }
.control-head { border-radius: 18px 18px 0 0; }
.upload-zone, #logo-name { border-radius: 11px; }
.position-options, .segmented, .color-controls { border-color: var(--studio-line); border-radius: 10px; overflow: hidden; }
.position-options button, .segmented button, .color-control { border-color: var(--studio-line); }
.export-dialog, .export-dialog[open] { border-color: var(--studio-line); border-radius: 18px; box-shadow: 0 22px 70px rgba(21,25,24,.22); overflow: hidden; }
.toast { border-radius: 10px; box-shadow: 0 8px 30px rgba(21,25,24,.18); }
@media (max-width: 900px) {
  .studio-commandbar { position: sticky; inset-block-start: 8px; margin: 8px; border-radius: 15px; }
  .studio-workspace { padding: 0 8px 12px; }
  .specimen-library { border-radius: 15px; }
}
@media (max-width: 600px) {
  .studio-commandbar { inset-block-start: 6px; margin: 6px; border-radius: 14px; }
  .studio-workspace { padding: 0 5px 8px; }
  .composition-stage { border-radius: 13px; }
  .specimen-library { border-radius: 14px; }
  .library-console { border-radius: 11px; }
}

/* Neutral floating editor — quiet structure, clearer controls. */
body.editor-active {
  --studio-ink: #171a19;
  --studio-carbon: #242827;
  --studio-deep: #171a19;
  --studio-fog: #f1f2f1;
  --studio-paper: #ffffff;
  --studio-white: #ffffff;
  --studio-signal: #d8efb6;
  --studio-cyan: #3154ff;
  --studio-coral: #ff6a3d;
  --studio-line: rgba(23, 26, 25, .09);
  --studio-muted: #69716e;
  background: #f1f2f1;
}
body.editor-active #editor-view { background: #f1f2f1; }
body.editor-active .icon { width: 18px; height: 18px; flex: 0 0 18px; }

.studio-commandbar {
  min-height: 74px;
  padding-inline: clamp(18px, 3vw, 48px);
  overflow: visible;
  border: 0;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 36px rgba(23,26,25,.075);
}
.studio-nav {
  align-self: center;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 0;
  border-radius: 12px;
  background: #f4f5f4;
}
.studio-nav > a,
.studio-nav > .save-indicator {
  min-width: 142px;
  min-height: 38px;
  padding-inline: 16px;
  border: 0;
  border-radius: 9px;
}
.studio-nav > a:hover { color: var(--studio-ink); background: #fff; box-shadow: 0 3px 12px rgba(23,26,25,.06); }
.studio-nav > .save-indicator { border: 0; }
.save-indicator i { width: 6px; height: 6px; border-radius: 50%; transform: none; }
.studio-status { gap: 10px; }
.studio-commandbar .language-button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  text-decoration: none;
}
.studio-commandbar .language-button:hover { color: var(--studio-ink); background: #f1f2f1; }
.studio-primary {
  min-height: 44px;
  gap: 11px;
  padding-inline: 16px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--studio-ink);
  box-shadow: 0 5px 14px rgba(23,26,25,.12);
}
.studio-primary:hover { color: #fff; background: var(--studio-cyan); transform: translateY(-1px); }
.studio-primary:hover .icon { transform: rotate(12deg); }

.studio-workspace { padding: 0 12px 20px; }
.composition-stage {
  min-height: 72px;
  padding: 10px 10px 10px 20px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23,26,25,.055);
}
.compact-study span { color: #7a817e; }
.compact-study strong { font-size: 20px; }
.stage-tools {
  gap: 7px;
  padding: 0;
  overflow: visible;
  background: transparent;
}
.stage-tools button {
  min-height: 44px;
  gap: 9px;
  padding-inline: 13px;
  border: 0;
  border-radius: 11px;
  color: var(--studio-ink);
  background: #f2f3f2;
  transition: transform .2s, color .2s, background .2s, box-shadow .2s;
}
.stage-tools button:hover,
.stage-tools button.active {
  width: auto;
  color: #fff;
  background: var(--studio-ink);
  box-shadow: 0 5px 14px rgba(23,26,25,.12);
  transform: translateY(-1px);
}

.specimen-library {
  margin-top: 12px;
  padding: 46px clamp(18px,3vw,48px) 58px;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(23,26,25,.055);
}
.library-heading { padding-bottom: 8px; border: 0; }
.library-heading h2 { font-size: clamp(40px,5vw,68px); }
.view-switch {
  gap: 5px;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: #f1f2f1;
}
.view-switch .icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9px;
  color: var(--studio-muted);
  background: transparent;
}
.view-switch .icon-button + .icon-button { border: 0; }
.view-switch .icon-button:hover { color: var(--studio-ink); background: #fff; }
.view-switch .active { color: #fff; background: var(--studio-ink); box-shadow: 0 4px 10px rgba(23,26,25,.1); }

.library-console {
  grid-template-columns: auto minmax(0,1fr);
  gap: 8px;
  margin-top: 22px;
  padding: 8px;
  border: 0;
  border-radius: 15px;
  overflow: visible;
  background: #f2f3f2;
}
.source-tabs { gap: 5px; }
.source-tabs button {
  min-height: 48px;
  padding-inline: 15px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}
.source-tabs button:hover { background: #fff; }
.source-tabs button.active {
  color: #fff;
  background: var(--studio-ink);
  box-shadow: 0 4px 12px rgba(23,26,25,.1);
}
.source-tabs b { border-radius: 6px; color: var(--studio-ink); background: rgba(255,255,255,.84); }
.font-filters { grid-template-columns: minmax(160px,1fr) 170px auto; gap: 7px; }
.search-field,
.font-filters select {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: #fff;
}
.search-field { padding-inline: 14px; }
.search-field:focus-within { box-shadow: 0 0 0 2px rgba(49,84,255,.22); }
.font-filters select { padding-inline: 13px; }
.studio-secondary {
  min-height: 48px;
  padding-inline: 15px;
  border-radius: 10px;
  color: #fff;
  background: var(--studio-cyan);
}
.studio-secondary:hover { background: #2446e6; transform: translateY(-1px); }
.results-ledger { min-height: 52px; border: 0; }

.specimen-field,
.specimen-field:not(.list-view) {
  gap: 16px;
  padding-top: 8px;
  border: 0;
}
.result-card {
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23,26,25,.07);
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s cubic-bezier(.16,1,.3,1);
}
.result-card:hover,
.result-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(23,26,25,.11);
}
.result-card::before { display: none; }
.result-card:hover .card-preview { transform: none; }
.card-preview { background: var(--preview-bg,#f7f8f7); }
.specimen-strip {
  min-height: 62px;
  padding: 10px 10px 10px 14px;
  border: 0;
  background: #fff;
}
.card-actions {
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
.card-actions .icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  color: var(--studio-muted);
  background: #f1f2f1;
  transition: transform .2s, color .2s, background .2s;
}
.card-actions .icon-button:hover {
  color: #fff;
  background: var(--studio-ink);
  transform: translateY(-2px);
}
.card-actions .fav-active { color: #fff; background: var(--studio-cyan); }
.studio-load-more {
  min-height: 54px;
  margin-top: 18px;
  border: 0;
  border-radius: 13px;
  background: #f1f2f1;
}
.studio-load-more:hover { color: #fff; background: var(--studio-ink); }

.control-surface { padding: 8px; border: 0; background: #fff; }
.control-head {
  min-height: 78px;
  margin-bottom: 8px;
  padding: 14px 16px;
  border-radius: 13px;
}
.control-head .icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 9px;
}
.control-head .icon-button:hover { color: var(--studio-ink); background: #fff; }
.settings-group {
  margin-bottom: 7px;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f4f5f4;
}
.settings-group summary { min-height: 52px; border-radius: 11px; }
.settings-group summary:hover { background: #e9ebe9; }
.settings-type[open] summary,
.settings-symbol[open] summary,
.settings-layout[open] summary {
  color: var(--studio-ink);
  background: #eceeec;
}
.settings-content { padding: 18px 13px 20px; background: #fff; }
#logo-name,
.upload-zone { border: 0; border-radius: 11px; background: #f4f5f4; }
#logo-name:focus { box-shadow: 0 0 0 2px rgba(49,84,255,.22); }
.upload-zone { outline: 1px dashed #c8ceca; outline-offset: -7px; }
.symbol-actions { gap: 7px; margin-top: 8px; border: 0; background: transparent; }
.symbol-actions button { border-radius: 9px; background: #f1f2f1; }
.symbol-actions button:hover { color: #fff; background: var(--studio-ink); }
.position-options,
.segmented,
.color-controls { gap: 6px; padding: 5px; border: 0; background: #f3f4f3; }
.position-options button,
.segmented button,
.color-control { border: 0; border-radius: 7px; background: #fff; }
.position-options .active,
.segmented .active { color: #fff; background: var(--studio-ink); }

@media (max-width: 900px) {
  .studio-primary span:last-child { display: inline-flex; }
  .library-console { grid-template-columns: 1fr; }
  .source-tabs { border: 0; }
  .font-filters { grid-template-columns: minmax(0,1fr) 150px; }
  .studio-secondary { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .composition-stage { padding: 12px; }
  .stage-tools { gap: 5px; }
  .stage-tools button { min-height: 42px; padding-inline: 8px; }
  .specimen-library { padding: 34px 14px 44px; }
  .font-filters { grid-template-columns: 1fr; }
  .font-filters select { min-height: 46px; }
  .studio-secondary { grid-column: auto; }
}

/* Keep only useful separators: each result is a distinct object. */
.library-console { border: 1px solid #e4e7e5; }
.results-ledger {
  margin-bottom: 12px;
  border-bottom: 1px solid #e4e7e5;
}
.specimen-field,
.specimen-field:not(.list-view) {
  gap: 18px;
  padding: 16px;
  border: 0;
  border-radius: 18px;
  background: #f4f5f4;
}
.result-card {
  border: 1px solid #dfe3e0;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(23,26,25,.055);
}
.result-card:hover,
.result-card:focus-within {
  transform: translateY(-3px);
  border-color: #c5cbc7;
  box-shadow: 0 13px 26px rgba(23,26,25,.11);
}
.card-preview { background: #fff; }
.specimen-strip { border-top: 1px solid #e7eae8; }
.card-actions .icon-button { border: 1px solid #e7eae8; }
.card-actions .icon-button:hover,
.card-actions .fav-active { border-color: transparent; }
@media (max-width: 700px) {
  .specimen-field,
  .specimen-field:not(.list-view) { gap: 12px; padding: 10px; border-radius: 14px; }
}

/* Non-modal controls: compare and edit in the same view. */
.studio-workspace { transition: margin-inline-end .32s cubic-bezier(.16,1,.3,1); }
.settings-open .studio-workspace { margin-inline-end: 416px; }
.control-surface {
  position: fixed;
  inset-block: 100px 12px;
  inset-inline-end: 12px;
  width: 392px;
  max-height: calc(100vh - 112px);
  margin: 0;
  border: 1px solid #e1e5e2;
  border-radius: 16px;
  box-shadow: 0 14px 38px rgba(23,26,25,.12);
  transform: translateX(calc(100% + 32px));
  transition: transform .32s cubic-bezier(.16,1,.3,1), visibility .32s;
  scroll-margin-top: 100px;
}
[dir="rtl"] .control-surface { transform: translateX(calc(-100% - 32px)); }
.settings-open .control-surface { visibility: visible; transform: translateX(0); }
.settings-open .library-console { grid-template-columns: 1fr; }
.settings-open .source-tabs { border: 0; }
.settings-open .font-filters { grid-template-columns: minmax(0,1fr) 150px; }
.settings-open .studio-secondary { grid-column: 1 / -1; }
.settings-open .specimen-field:not(.list-view) { grid-template-columns: repeat(2,minmax(0,1fr)); }
@media (min-width: 1650px) {
  .settings-open .specimen-field:not(.list-view) { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 1200px) {
  .settings-open .studio-workspace { margin-inline-end: 344px; }
  .control-surface { width: 320px; }
  .settings-open .specimen-field:not(.list-view) { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .settings-open .studio-workspace { margin-inline-end: 0; }
  .control-surface,
  [dir="rtl"] .control-surface {
    display: none;
    position: relative;
    inset: auto;
    width: 100%;
    max-height: none;
    margin-top: 18px;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(23,26,25,.08);
    transform: none;
    visibility: visible;
  }
  .settings-open .control-surface { display: block; transform: none; }
  .settings-open .library-console { grid-template-columns: auto minmax(0,1fr); }
  .settings-open .font-filters { grid-template-columns: minmax(0,1fr) 150px auto; }
  .settings-open .studio-secondary { grid-column: auto; }
  .settings-open .specimen-field:not(.list-view) { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .settings-open .library-console { grid-template-columns: 1fr; }
  .settings-open .font-filters { grid-template-columns: minmax(0,1fr) 150px; }
  .settings-open .studio-secondary { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .settings-open .font-filters { grid-template-columns: 1fr; }
  .settings-open .studio-secondary { grid-column: auto; }
  .settings-open .specimen-field:not(.list-view) { grid-template-columns: 1fr; }
}

/* A consistent control language across type, symbol and layout settings. */
.settings-content .field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
}
.settings-content .field-label .icon { width: 15px; height: 15px; flex-basis: 15px; }
#type-controls,
#symbol-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.range-control {
  min-width: 0;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 11px;
  border: 1px solid #e6e9e6;
  border-radius: 11px;
  background: #f7f8f7;
}
.range-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
}
.range-title label { cursor: pointer; }
.range-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--studio-ink);
  background: #fff;
}
.settings-content .range-icon .icon { width: 16px; height: 16px; flex-basis: 16px; }
.range-control output {
  display: block;
  margin-top: auto;
  padding-block: 9px 5px;
  color: var(--studio-muted);
  font: 12px/1 ui-monospace, SFMono-Regular, monospace;
  direction: ltr;
  text-align: start;
}
.range-control input[type="range"] { width: 100%; height: 18px; margin: 0; accent-color: var(--studio-ink); }
.range-control:focus-within { border-color: #8d9cff; box-shadow: 0 0 0 2px rgba(49,84,255,.12); }
.position-options { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 16px; }
.position-options button,
.segmented button {
  min-height: 51px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px;
}
.position-options .icon,
.segmented .icon { width: 17px; height: 17px; flex-basis: 17px; }
.segmented button { flex-direction: column; gap: 4px; min-height: 60px; }
.color-control { display: flex; flex-direction: column; gap: 9px; padding: 9px; }
.color-control .color-title { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 40px; margin-top: 0; }
.color-control .color-title span { margin-top: 0; }
.color-title .icon { width: 17px; height: 17px; flex-basis: 17px; }
.color-control input { height: 30px; border-radius: 5px; }

/* Edit the live wordmark directly from the compact work bar. */
.composition-stage { padding-inline-start: clamp(18px, 3vw, 48px); }
.compact-study { flex: 1; max-width: 100%; align-items: center; gap: 10px; }
.compact-study label {
  flex: 0 0 auto;
  color: var(--studio-muted);
  font-size: 11px;
  cursor: text;
}
.name-edit {
  min-width: 0;
  max-width: calc(100% - 58px);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 5px 4px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #f3f4f3;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.name-edit:hover { border-color: #d6dcd8; background: #fff; }
.name-edit:focus-within { border-color: #3154ff; background: #fff; box-shadow: 0 0 0 3px rgba(49,84,255,.11); }
#workspace-name {
  width: clamp(180px, 28vw, 350px);
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  height: 35px;
  padding: 0 7px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--studio-ink);
  font-family: inherit;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  text-align: start;
}
#workspace-name::placeholder { color: #909894; font-size: 14px; }
body.editor-active #workspace-name:focus-visible { outline: 0; }
.typing-indicator {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--studio-cyan);
  background: #fff;
  overflow: hidden;
}
.typing-indicator .icon { width: 19px; height: 19px; animation: typingCursorTravel 1.5s steps(4,end) infinite; }
.typing-indicator::after {
  content: "";
  position: absolute;
  inset-block-end: 5px;
  inset-inline-end: 6px;
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  animation: typingCursorBlink .8s steps(2,end) infinite;
}
.name-edit:focus-within .typing-indicator { color: #fff; background: var(--studio-cyan); }
.name-edit:focus-within .typing-indicator .icon { animation-duration: .7s; }
@keyframes typingCursorTravel {
  0%,100% { transform: translateX(4px) rotate(-8deg); }
  50% { transform: translateX(-4px) rotate(8deg); }
}
@keyframes typingCursorBlink { 50% { opacity: .15; } }
@media (max-width: 700px) {
  .studio-commandbar { padding-inline: 20px; }
  .composition-stage { padding-inline-start: 14px; }
  .compact-study { margin-bottom: 12px; }
  #workspace-name { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .typing-indicator .icon,
  .typing-indicator::after { animation: none; }
}

/* Tool buttons: quiet card surface with a distinct lavender icon tile. */
.stage-tools { gap: 8px; }
.stage-tools button {
  min-height: 52px;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 18px;
  color: var(--studio-ink);
  background: #f7f7f8;
  box-shadow: none;
  text-align: start;
}
.stage-tools button [data-icon] {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #7452ab;
  background: #eee8f8;
  transition: color .2s, background .2s, transform .2s;
}
.stage-tools button [data-icon] .icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  stroke-width: 1.8;
}
.stage-tools button:hover,
.stage-tools button.active {
  color: var(--studio-ink);
  background: #f4f1f9;
  box-shadow: none;
}
.stage-tools button:hover [data-icon] { transform: rotate(-5deg); }
.stage-tools button.active [data-icon] { color: #fff; background: #7452ab; }
.stage-tools button:focus-visible { outline: 2px solid #7452ab; outline-offset: 2px; }
@media (max-width: 700px) {
  .stage-tools { gap: 5px; }
  .stage-tools button { min-height: 48px; gap: 5px; padding: 5px; font-size: 9px; line-height: 1.3; }
  .stage-tools button [data-icon] { width: 31px; height: 31px; flex-basis: 31px; border-radius: 9px; }
  .stage-tools button [data-icon] .icon { width: 17px; height: 17px; flex-basis: 17px; }
}

/* Preview-only guides and a fixed two-result comparison. */
.alignment-guide * { vector-effect: non-scaling-stroke; }
.guide-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #dfe3e0;
  border-radius: 12px;
  background: #fff;
  text-align: start;
  transition: border-color .2s, background .2s;
}
.guide-toggle[aria-pressed="true"] { border-color: #bba7de; background: #f6f2fb; }
.guide-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 10px; color: #7452ab; background: #eee8f8; }
.guide-icon .icon { width: 20px; height: 20px; }
.guide-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.guide-copy strong { font-size: 12px; font-weight: 600; }
.guide-copy small { color: var(--studio-muted); font-size: 10px; line-height: 1.4; }
.guide-switch { width: 32px; height: 19px; flex: 0 0 32px; border-radius: 999px; background: #d6d9d7; position: relative; transition: background .2s; }
.guide-switch::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; }
.guide-toggle[aria-pressed="true"] .guide-switch { background: #7452ab; }
.guide-toggle[aria-pressed="true"] .guide-switch::after { inset-inline-start: 16px; }

.card-actions .compare-active { color: #fff; background: #7452ab; border-color: transparent; }
.comparison-panel { margin: 18px 0 20px; padding: 18px; border: 1px solid #e0e4e1; border-radius: 18px; background: #f5f6f5; scroll-margin-top: 108px; }
.comparison-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.comparison-head h3 { font-size: clamp(20px, 2vw, 27px); font-weight: 500; }
.comparison-head p { margin-top: 4px; color: var(--studio-muted); font-size: 12px; }
.comparison-clear { flex: 0 0 auto; padding: 9px 13px; border: 1px solid #dde1de; border-radius: 9px; background: #fff; font-size: 11px; }
.comparison-clear:hover { border-color: #7452ab; color: #7452ab; }
.comparison-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.comparison-slot { min-width: 0; overflow: hidden; border: 1px solid #e1e5e2; border-radius: 13px; background: #fff; }
.comparison-slot-head { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 12px; color: var(--studio-muted); font-size: 11px; }
.comparison-slot-head button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: #f1f2f1; }
.comparison-slot-head button:hover { color: #fff; background: var(--studio-ink); }
.comparison-slot-head .icon { width: 16px; height: 16px; }
.comparison-preview { display: grid; place-items: center; aspect-ratio: 560 / 300; padding: 10px; background: #fff; }
.comparison-preview > svg { width: 100%; height: 100%; }
.comparison-font { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid #eceeed; font-size: 12px; }
.comparison-font bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comparison-font small { color: var(--studio-muted); }
.comparison-empty { display: grid; place-content: center; gap: 10px; padding: 16px; border-style: dashed; color: var(--studio-muted); text-align: center; }
.comparison-empty span { color: var(--studio-ink); font-size: 12px; }
.comparison-empty p { max-width: 180px; font-size: 12px; line-height: 1.5; }
@media (max-width: 700px) {
  .comparison-panel { padding: 12px; }
  .comparison-head { align-items: start; }
  .comparison-head p { max-width: 210px; }
  .comparison-slots { gap: 7px; }
  .comparison-slot-head { padding-inline: 7px; font-size: 10px; }
  .comparison-preview { padding: 4px; }
  .comparison-font { padding-inline: 7px; font-size: 10px; }
}
