:root {
  --bg: #f5f0e6;
  --paper: #fffdf8;
  --ink: #1b1d2b;
  --muted: #6e6a62;
  --line: #e6dfd0;
  --line-2: #d9d0bd;
  --indigo: #22306a;
  --indigo-2: #2f3f86;
  --indigo-deep: #151d45;
  --indigo-soft: #e7e9f4;
  --madder: #b8452f;
  --madder-soft: #f6e3dc;
  --gold: #d69b2d;
  --gold-soft: #fbf0d9;
  --success: #2e7d5b;
  --danger: #b3261e;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(27, 29, 43, .05), 0 8px 24px rgba(27, 29, 43, .06);
  --shadow-lg: 0 24px 60px rgba(21, 29, 69, .18);
  --display: "Fraunces", Georgia, serif;
  --ui: "Manrope", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
p { margin: 0; }
code { font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ic { flex: none; display: block; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--madder); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-primary { background: var(--indigo); color: #fff; box-shadow: 0 6px 16px rgba(34, 48, 106, .22); }
.btn-primary:hover:not(:disabled) { background: var(--indigo-2); }
.btn-accent { background: var(--madder); color: #fff; box-shadow: 0 6px 16px rgba(184, 69, 47, .25); }
.btn-accent:hover:not(:disabled) { background: #a33b27; }
.btn-soft { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-soft:hover:not(:disabled) { border-color: var(--line-2); background: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--indigo-soft); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--paper); font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--indigo); }
.chip.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--indigo-soft); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--indigo); }
.seg button.on { background: var(--paper); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); color: var(--ink); }

.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 700; color: var(--muted); }
.input, select.input, textarea.input {
  height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; width: 100%;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
input[type="range"] { accent-color: var(--indigo); width: 100%; }
input[type="checkbox"] { accent-color: var(--indigo); width: 16px; height: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13.5px; }
.check small { display: block; color: var(--muted); font-size: 12px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- App header ---------- */
.app-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 18px; background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 5;
}
.brand { display: flex; gap: 14px; align-items: center; text-decoration: none; min-width: 0; flex: 1 1 220px; }
.brand > div { min-width: 0; }
.brand h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header .stepper { flex: none; }
.brand svg { border-radius: 12px; box-shadow: 0 4px 12px rgba(21, 29, 69, .2); flex: none; }
.brand h1 { font-size: 22px; line-height: 1.1; }
.brand p { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .eyebrow { font-size: 10px; margin-bottom: 1px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex: 1 1 auto; justify-content: flex-end; }
.credit-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--indigo-deep); color: #fff; border: 0; cursor: pointer; font-size: 13px;
}
.credit-pill b { color: var(--gold); }
.credit-pill span { opacity: .85; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--gold); background: var(--indigo);
  color: #fff; font-weight: 800; cursor: pointer; display: grid; place-items: center;
}

.stepper { display: flex; align-items: flex-start; }
.step { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 118px; position: relative; font-size: 11.5px; font-weight: 700; color: var(--muted); text-decoration: none; }
.step:not(:first-child)::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.step.done::before, .step.current::before { background: var(--indigo); }
.step .dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--line-2); font-size: 12px; }
.step.done .dot { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.step.current { color: var(--ink); }
.step.current .dot { border-color: var(--indigo); color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); }
.step:hover .dot { border-color: var(--indigo); }

/* ---------- Studio layout ---------- */
.studio { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.studio-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: var(--paper);
  border-bottom: 1px solid var(--line); min-height: 58px;
}
.tb-sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.tb-spacer { flex: 1; }
.zoom-ctl { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.zoom-ctl span { min-width: 56px; text-align: center; font-weight: 700; font-size: 13px; }
.swatch-ctl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.swatch-ctl input[type="color"] { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }
.swatch-ctl input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.swatch-ctl input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.tb-options { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tb-options input[type="range"] { width: 140px; }
.tb-options b { color: var(--ink); min-width: 26px; }

.studio-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 62px minmax(0, 1fr) 300px; gap: 12px; padding: 12px; }
.toolkit {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; overflow-y: auto;
}
.toolkit-label { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; color: var(--muted); margin-bottom: 4px; }
.toolkit-sep { width: 70%; height: 1px; background: var(--line); margin: 4px 0; }
.tool {
  width: 42px; height: 42px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: var(--ink); transition: all .12s;
}
.tool:hover:not(:disabled) { border-color: var(--indigo); }
.tool.active { background: var(--indigo); color: #fff; border-color: var(--indigo); box-shadow: 0 4px 12px rgba(34, 48, 106, .3); }
.tool:disabled { opacity: .35; cursor: not-allowed; }

.viewport {
  position: relative; overflow: hidden; border-radius: 16px; border: 1px solid var(--line);
  background-color: #ece6d8;
  background-image:
    linear-gradient(45deg, rgba(34, 48, 106, .045) 25%, transparent 25%, transparent 50%, rgba(34, 48, 106, .045) 50%, rgba(34, 48, 106, .045) 75%, transparent 75%);
  background-size: 14px 14px;
  touch-action: none;
}
.vp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewport.grabbing, .viewport.tool-pan { cursor: grab; }
.viewport.grabbing { cursor: grabbing; }
.viewport.tool-crosshair { cursor: crosshair; }
.viewport.tool-none { cursor: default; }

.inspector { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.inspector h3 { font-size: 18px; }
.inspector h4 { font-family: var(--ui); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 800; margin-bottom: 8px; }
.panel-sec { display: grid; gap: 10px; }
.panel-sec + .panel-sec { border-top: 1px solid var(--line); padding-top: 14px; }
.kv { margin: 0; display: grid; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; text-align: right; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-grid .btn { padding: 0 8px; font-size: 12.5px; }
.shortcuts { font-size: 12px; color: var(--muted); display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.shortcuts kbd { font: 11px ui-monospace, monospace; background: #fff; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--ink); justify-self: start; }
.meter { height: 10px; border-radius: 99px; background: var(--indigo-soft); overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; background: var(--indigo); }
.note { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.note .ic { margin-top: 2px; }
.warn-box { background: var(--gold-soft); border: 1px solid #efd9a7; border-radius: 12px; padding: 10px 12px; font-size: 13px; color: #7a5410; }
.warn-box ul { margin: 6px 0 0; padding-left: 18px; }
.ok-box { background: #e5f2ec; border: 1px solid #bfdccd; border-radius: 12px; padding: 10px 12px; font-size: 13px; color: #1f5a41; }
.err-box { background: var(--madder-soft); border: 1px solid #ecc3b6; border-radius: 12px; padding: 10px 12px; font-size: 13px; color: #8a2f1e; }

.status-bar { display: flex; gap: 18px; padding: 6px 16px; font-size: 12px; color: var(--muted); background: var(--paper); border-top: 1px solid var(--line); flex-wrap: wrap; }
.status-bar .grow { flex: 1; }
.status-bar b { color: var(--ink); font-weight: 700; }
.footer-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: var(--paper); border-top: 1px solid var(--line); }
.footer-nav .right { display: flex; gap: 10px; }

.dropzone {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
}
.dropzone-card {
  width: min(460px, 90%); padding: 34px 28px; text-align: center; background: var(--paper); border-radius: 20px;
  border: 2px dashed #b9bfdc; box-shadow: var(--shadow-lg); display: grid; gap: 10px; justify-items: center;
}
.dropzone-card h2 { font-size: 24px; }
.dropzone-card .icon-wrap { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); }
.dropzone-card .formats { font-size: 11.5px; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.dropzone-card .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.viewport.drag-over .dropzone-card, .viewport.drag-over { border-color: var(--indigo); }
.drop-hint { position: absolute; inset: 10px; border: 2px dashed var(--indigo); border-radius: 14px; display: none; place-items: center; background: rgba(231, 233, 244, .7); z-index: 4; font-weight: 800; color: var(--indigo); }
.viewport.drag-over .drop-hint { display: grid; }

.empty-state { flex: 1; display: grid; place-items: center; padding: 40px 16px; text-align: center; }
.empty-state > div { display: grid; gap: 12px; justify-items: center; max-width: 440px; }
.empty-state .icon-wrap { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); }
.empty-state h2 { font-size: 26px; }
.empty-state p { color: var(--muted); }

/* role cards */
.role-card { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.role-card.active { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.role-card .role-name { font-family: var(--display); font-weight: 600; font-size: 15px; line-height: 1.1; }
.role-card small { display: block; color: var(--muted); font-size: 11px; }
.role-card input[type="color"] { width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0; cursor: pointer; background: none; }
.role-card input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.role-card input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.icon-btn.on { background: var(--indigo); color: #fff; }

/* sizing */
.sizing-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; padding: 12px; }
.preview-wrap { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.preview-wrap .viewport { flex: 1; min-height: 300px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.input-lock { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: end; }
.input-lock .icon-btn { margin-bottom: 3px; border: 1px solid var(--line); }
.result-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-big div { background: var(--indigo-deep); color: #fff; border-radius: 14px; padding: 12px 14px; }
.result-big b { display: block; font-family: var(--display); font-size: 26px; line-height: 1.1; color: var(--gold); }
.result-big span { font-size: 12px; opacity: .8; }

/* ---------- Modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(21, 29, 69, .4); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 100; padding: 16px; opacity: 0; transition: opacity .16s; }
.modal-backdrop.in { opacity: 1; }
.modal-backdrop.out { opacity: 0; }
.modal { position: relative; width: min(440px, 100%); background: var(--paper); border-radius: 22px; padding: 30px 28px 24px; box-shadow: var(--shadow-lg); transform: translateY(8px) scale(.98); transition: transform .18s; max-height: 90vh; overflow: auto; }
.modal.wide { width: min(620px, 100%); }
.modal-backdrop.in .modal { transform: none; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal h2 { font-size: 26px; margin-bottom: 6px; }
.modal .center { text-align: center; display: grid; justify-items: center; gap: 10px; }
.modal .icon-wrap { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-actions.center { justify-content: center; }
.toast-root { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: var(--indigo-deep); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; display: flex; gap: 8px; align-items: center; }
.toast.error { background: var(--danger); }
.toast.success .ic { color: #8fe0b9; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Home ---------- */
.home { max-width: 1180px; margin: 0 auto; padding: 48px 20px 60px; }
.home-head { display: flex; align-items: center; gap: 20px; margin-bottom: 36px; }
.home-head svg { border-radius: 18px; box-shadow: 0 8px 24px rgba(21, 29, 69, .25); flex: none; }
.home-head h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.02; color: var(--indigo-deep); }
.home-head p { color: var(--muted); font-size: 17px; margin-top: 6px; }
.home-head .header-actions { margin-left: auto; }
.studio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.studio-card {
  position: relative; text-align: left; display: grid; align-content: start; gap: 8px; padding: 30px; min-height: 240px; border-radius: 24px;
  background: var(--paper); border: 1px solid var(--line); text-decoration: none; cursor: pointer; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.studio-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.studio-card .sc-icon { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); margin-bottom: 18px; }
.studio-card h2 { font-size: 30px; color: var(--indigo-deep); }
.studio-card p { color: var(--muted); font-size: 15.5px; max-width: 44ch; }
.studio-card .sc-link { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; color: var(--indigo); margin-top: 10px; }
.studio-card.dark { background: radial-gradient(120% 140% at 100% 0%, #34458f 0%, var(--indigo) 45%, var(--indigo-deep) 100%); border-color: transparent; }
.studio-card.dark h2 { color: #fff; }
.studio-card.dark h2 em { font-style: normal; color: var(--gold); }
.studio-card.dark p { color: rgba(255, 255, 255, .78); }
.studio-card.dark .sc-link { color: var(--gold); }
.studio-card.dark .sc-icon { background: rgba(255, 255, 255, .12); color: var(--gold); }
.studio-card.madder { background: radial-gradient(120% 140% at 100% 0%, #d0634a 0%, var(--madder) 50%, #8c3221 100%); border-color: transparent; }
.studio-card.madder h2 { color: #fff; }
.studio-card.madder p { color: rgba(255, 255, 255, .82); }
.studio-card.madder .sc-link { color: #ffe2a8; }
.studio-card.madder .sc-icon { background: rgba(255, 255, 255, .14); color: #ffe2a8; }
.studio-card .badge { position: absolute; top: 20px; right: 20px; }
.studio-card .deco { position: absolute; right: -30px; bottom: -30px; width: 200px; height: 200px; opacity: .14; pointer-events: none; }
.badge { display: inline-flex; padding: 4px 10px; border-radius: 99px; background: var(--gold-soft); color: #8a5c0c; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.badge.indigo { background: var(--indigo-soft); color: var(--indigo); }
.badge.green { background: #e2f1ea; color: #23664a; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 44px 0 14px; }
.sec-head h3 { font-size: 22px; }
.sec-head a { font-weight: 700; color: var(--indigo); text-decoration: none; }

/* design cards (history / recent) */
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.design-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.design-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.design-card .thumb { aspect-ratio: 4 / 3; background: #ece6d8; display: grid; place-items: center; overflow: hidden; }
.design-card .thumb img { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.design-card .thumb.empty { color: var(--muted); }
.design-card .body { padding: 14px 16px 16px; display: grid; gap: 6px; flex: 1; }
.design-card h4 { font-size: 17px; display: flex; gap: 6px; align-items: center; }
.design-card h4 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.design-card .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.design-card .meta span { display: inline-flex; gap: 4px; align-items: center; }
.design-card .actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.design-card .actions .grow { flex: 1; }

/* history */
.page-wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button { border: 0; background: none; padding: 12px 2px; font-weight: 700; font-size: 16px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--indigo); border-color: var(--indigo); }
.tabs .count { font-size: 12px; background: var(--indigo-soft); color: var(--indigo); padding: 1px 7px; border-radius: 99px; margin-left: 6px; }
.toolbar-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; max-width: 520px; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 42px; height: 46px; border-radius: 14px; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.pager button { min-width: 42px; }

/* ---------- Create ---------- */
.create-wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.create-main { padding: 28px; }
.create-main h2 { font-size: clamp(28px, 3.4vw, 44px); color: var(--indigo-deep); margin: 22px 0 16px; line-height: 1.08; }
.create-side { padding: 24px; position: sticky; top: 16px; display: grid; gap: 16px; }
.create-side .side-title { font-family: var(--display); font-size: 20px; }
.group { display: grid; gap: 10px; padding: 14px 0; }
.group + .group { border-top: 1px dashed var(--line-2); }
.group-title { font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.group-title small { font-weight: 600; color: var(--muted); }
.validation { font-size: 12.5px; color: var(--madder); font-weight: 700; }
.interpret { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 12px; }
.interpret .tag { background: var(--indigo-soft); color: var(--indigo); border-radius: 8px; padding: 3px 9px; font-weight: 700; font-size: 12.5px; }
details.customize { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
details.customize summary { cursor: pointer; font-weight: 800; color: var(--indigo); font-size: 16px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.customize summary::-webkit-details-marker { display: none; }
details.customize[open] summary .ic { transform: rotate(180deg); }
.custom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.range-field { display: grid; gap: 4px; }
.range-field .top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); }
.range-field .top b { color: var(--ink); }
.upload-box { border: 2px dashed #b9bfdc; border-radius: 14px; padding: 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; background: #f7f7fb; transition: border-color .15s; }
.upload-box:hover, .upload-box.drag-over { border-color: var(--indigo); }
.upload-box b { display: block; font-size: 15px; }
.upload-box small { color: var(--muted); font-size: 12px; }
.upload-box .ic { color: var(--madder); }
.insp-preview { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; }
.insp-preview img { width: 74px; height: 74px; object-fit: cover; border-radius: 10px; }
.cost-line { text-align: center; font-size: 12.5px; color: var(--muted); }
.results { grid-column: 1 / -1; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.concept { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.concept .art { background: #fff; aspect-ratio: 1; display: grid; place-items: center; border-bottom: 1px solid var(--line); overflow: hidden; }
.concept .art canvas, .concept .art img { max-width: 100%; max-height: 100%; display: block; }
.concept .body { padding: 12px 14px 14px; display: grid; gap: 10px; }
.concept .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.concept .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.concept .acts .btn { padding: 0 8px; font-size: 12.5px; }
.concept .acts .full { grid-column: 1 / -1; }
.skeleton { background: linear-gradient(100deg, #efe9dc 30%, #f8f4ec 50%, #efe9dc 70%); background-size: 300% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- Landing ---------- */
.lp { overflow-x: hidden; }
.lp-nav { position: sticky; top: 0; z-index: 20; background: rgba(245, 240, 230, .86); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(230, 223, 208, .7); }
.lp-nav-in { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 28px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark b { font-family: var(--display); font-size: 24px; color: var(--indigo-deep); letter-spacing: -.02em; }
.wordmark small { display: block; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--madder); font-weight: 800; margin-top: -2px; }
.lp-links { display: flex; gap: 24px; margin-left: auto; }
.lp-links a { text-decoration: none; font-weight: 600; font-size: 14px; color: #3d3f50; }
.lp-links a:hover { color: var(--indigo); }
.lp-section { max-width: 1200px; margin: 0 auto; padding: 90px 20px; }
.lp-section.tight { padding-top: 40px; }
.lp-title { text-align: center; max-width: 760px; margin: 0 auto 46px; display: grid; gap: 12px; }
.lp-title h2 { font-size: clamp(30px, 4.2vw, 50px); line-height: 1.05; color: var(--indigo-deep); }
.lp-title h2 em { font-style: italic; color: var(--madder); }
.lp-title p { color: var(--muted); font-size: 17px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; padding-top: 56px; padding-bottom: 70px; }
.hero h1 { font-size: clamp(40px, 5.6vw, 74px); line-height: 1.0; color: var(--indigo-deep); letter-spacing: -.025em; margin: 14px 0 20px; }
.hero h1 em { font-style: italic; color: var(--madder); font-weight: 500; }
.hero .lead { font-size: 18px; color: #4a4a55; max-width: 52ch; }
.hero-ctas { display: flex; gap: 12px; margin: 28px 0 18px; flex-wrap: wrap; }
.hero-bullets { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 600; }
.hero-bullets span { display: inline-flex; gap: 6px; align-items: center; }
.hero-bullets .ic { color: var(--success); }
.hero-visual { position: relative; aspect-ratio: 1 / 1.02; }
.hv-card { position: absolute; background: var(--paper); border-radius: 22px; padding: 10px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.hv-card canvas { display: block; width: 100%; height: auto; border-radius: 14px; image-rendering: pixelated; }
.hv-card .hv-label { display: flex; align-items: center; gap: 8px; padding: 8px 6px 2px; font-size: 12.5px; font-weight: 800; }
.hv-card .hv-label i { width: 22px; height: 22px; border-radius: 50%; background: var(--indigo); color: #fff; font-style: normal; display: grid; place-items: center; font-size: 11px; }
.hv-1 { width: 48%; left: 0; top: 4%; transform: rotate(-4deg); animation: float 7s ease-in-out infinite; }
.hv-2 { width: 48%; right: 0; top: 0; transform: rotate(3deg); animation: float 8s ease-in-out infinite reverse; }
.hv-3 { width: 60%; left: 20%; bottom: 0; animation: float 9s ease-in-out infinite; z-index: 2; }
@keyframes float { 50% { translate: 0 -8px; } }
.journey { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--indigo-deep); color: #fff; border-radius: 22px; padding: 18px; }
.journey div { display: flex; gap: 12px; align-items: center; padding: 8px 14px; font-weight: 700; font-size: 14px; }
.journey div + div { border-left: 1px solid rgba(255, 255, 255, .14); }
.journey b { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--indigo-deep); display: grid; place-items: center; flex: none; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.way { padding: 28px; display: grid; gap: 10px; align-content: start; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.way:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.way .num { font-family: var(--display); font-size: 44px; color: var(--gold); line-height: 1; }
.way h3 { font-size: 26px; color: var(--indigo-deep); }
.way p { color: var(--muted); }
.way .go { font-weight: 800; color: var(--indigo); display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.compare > div { padding: 28px; border-radius: 22px; }
.compare .old { background: #ebe5d9; border: 1px solid var(--line-2); }
.compare .new { background: var(--indigo-deep); color: #fff; }
.compare h4 { font-family: var(--ui); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 16px; }
.compare .new h4 { color: var(--gold); }
.compare ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.compare li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .55); font-weight: 600; }
.compare .new li { background: rgba(255, 255, 255, .08); }
.compare li b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #d8d0bf; flex: none; }
.compare .new li b { background: var(--gold); color: var(--indigo-deep); }
.compare .old li { color: #6b6455; text-decoration: line-through; text-decoration-color: rgba(184, 69, 47, .5); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 26px; display: grid; gap: 8px; align-content: start; }
.feature .fi { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--madder-soft); color: var(--madder); margin-bottom: 8px; }
.feature h3 { font-size: 21px; color: var(--indigo-deep); }
.feature p { color: var(--muted); font-size: 14.5px; }
.steps4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; }
.steps4 > div { padding: 24px; border-top: 3px solid var(--indigo); background: var(--paper); border-radius: 0 0 18px 18px; box-shadow: var(--shadow); }
.steps4 b { font-family: var(--display); font-size: 40px; color: var(--madder); line-height: 1; }
.steps4 h3 { font-size: 22px; margin: 10px 0 6px; color: var(--indigo-deep); }
.steps4 p { color: var(--muted); font-size: 14.5px; }
.audience { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.audience > div { padding: 24px; display: grid; gap: 8px; align-content: start; }
.audience h3 { font-size: 20px; color: var(--indigo-deep); }
.audience p { color: var(--muted); font-size: 14px; }
.ctable { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.ctable th, .ctable td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--line); font-size: 15px; }
.ctable th { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: #f9f5ec; }
.ctable th:last-child, .ctable td:last-child { background: var(--indigo-soft); text-align: center; color: var(--indigo); font-weight: 800; }
.ctable td:nth-child(2), .ctable th:nth-child(2) { text-align: center; color: var(--muted); }
.ctable tr:last-child td { border-bottom: 0; }
.gallery-filter { display: flex; justify-content: center; gap: 8px; margin: -20px 0 28px; flex-wrap: wrap; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.g-item { position: relative; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); aspect-ratio: 1; box-shadow: var(--shadow); }
.g-item.wide { grid-column: span 2; aspect-ratio: 2.06; }
.g-item canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.g-item .g-over { position: absolute; inset: auto 0 0 0; padding: 40px 14px 12px; background: linear-gradient(transparent, rgba(21, 29, 69, .88)); color: #fff; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; opacity: 0; transition: opacity .2s; }
.g-item:hover .g-over, .g-item:focus-within .g-over { opacity: 1; }
.g-over small { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 800; }
.g-over b { font-family: var(--display); font-size: 18px; }
.cta-band { background: radial-gradient(120% 160% at 0% 0%, #34458f, var(--indigo-deep) 60%); color: #fff; border-radius: 30px; padding: 70px 30px; text-align: center; display: grid; gap: 16px; justify-items: center; position: relative; overflow: hidden; }
.cta-band h2 { font-size: clamp(32px, 4.6vw, 56px); line-height: 1.05; }
.cta-band h2 em { color: var(--gold); }
.cta-band p { opacity: .8; font-size: 17px; }
.lp-footer { max-width: 1200px; margin: 0 auto; padding: 30px 20px 50px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }

.fatal { padding: 40px; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .app-header .header-actions .btn span { display: none; }
  .app-header .header-actions .btn { padding: 0 10px; }
}
@media (max-width: 1180px) {
  .step { width: 92px; }
  .step span:last-child { font-size: 10.5px; }
  .studio-body { grid-template-columns: 62px minmax(0, 1fr) 260px; }
}
@media (max-width: 980px) {
  .app-header .stepper { order: 3; flex: 1 1 100%; justify-content: center; }
  .header-actions .btn span { display: none; }
  .studio { height: auto; min-height: 100vh; }
  .studio-body { grid-template-columns: 1fr; }
  .toolkit { flex-direction: row; flex-wrap: wrap; justify-content: center; overflow: visible; }
  .toolkit-label, .toolkit-sep { display: none; }
  .viewport { height: 62vh; }
  .sizing-body { grid-template-columns: 1fr; }
  .preview-wrap .viewport { height: 55vh; flex: none; }
  .create-wrap { grid-template-columns: 1fr; }
  .create-side { position: static; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 540px; width: 100%; margin: 0 auto; }
  .three, .features { grid-template-columns: 1fr 1fr; }
  .steps4, .audience { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .journey { grid-template-columns: 1fr 1fr; }
  .journey div:nth-child(3) { border-left: 0; }
  .lp-links { display: none; }
}
@media (max-width: 640px) {
  .studio-cards, .three, .features, .steps4, .audience, .compare, .custom-grid { grid-template-columns: 1fr; }
  .home-head { flex-wrap: wrap; }
  .home-head .header-actions { margin-left: 0; }
  .step { width: 70px; }
  .step span:last-child { display: none; }
  .brand p { display: none; }
  .brand h1 { font-size: 18px; }
  .credit-pill span { display: none; }
  .lp-section { padding: 60px 16px; }
  .gallery { grid-template-columns: 1fr; }
  .g-item.wide { grid-column: auto; }
  .g-item .g-over { opacity: 1; }
  .journey { grid-template-columns: 1fr; }
  .journey div + div { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .14); }
  .ctable th, .ctable td { padding: 12px 10px; font-size: 13px; }
  .create-main { padding: 18px; }
  .footer-nav .btn { padding: 0 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Guide ---------- */
.g-hero { max-width: 1200px; margin: 0 auto; padding: 64px 20px 34px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.g-hero h1 { font-size: clamp(38px, 5.4vw, 66px); line-height: 1.02; color: var(--indigo-deep); }
.g-hero h1 em { font-style: italic; color: var(--madder); font-weight: 500; }
.g-hero > p { color: var(--muted); font-size: 18px; max-width: 60ch; }
.g-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.g-flow-step { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); cursor: pointer; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.g-flow-step:hover { transform: translateY(-2px); border-color: var(--indigo); }
.g-flow-step b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--indigo); color: #fff; font-size: 13px; }
.g-flow-arrow { color: var(--gold); }
.g-layout { max-width: 1200px; margin: 0 auto; padding: 20px 20px 60px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
.g-toc { position: sticky; top: 84px; display: grid; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 14px; max-height: calc(100vh - 110px); overflow-y: auto; }
.g-toc-title { display: flex; gap: 8px; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 4px 10px 10px; }
.g-toc button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #4a4a55; cursor: pointer; }
.g-toc button:hover { background: var(--indigo-soft); color: var(--indigo); }
.g-toc button.on { background: var(--indigo); color: #fff; }
.g-body { display: grid; gap: 22px; min-width: 0; }
.g-sec { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 30px 32px; box-shadow: var(--shadow); scroll-margin-top: 90px; }
.g-sec h2 { font-size: clamp(26px, 3vw, 34px); color: var(--indigo-deep); margin-bottom: 10px; }
.g-sec h3 { font-family: var(--ui); font-size: 15px; font-weight: 800; color: var(--ink); margin: 22px 0 8px; }
.g-sec p { color: #3f404c; line-height: 1.65; }
.g-sec p + p { margin-top: 10px; }
.g-step-tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--madder); background: var(--madder-soft); padding: 4px 10px; border-radius: 99px; margin-bottom: 10px; }
.g-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: #3f404c; line-height: 1.6; }
.g-steps { margin: 0; padding: 0; list-style: none; counter-reset: gs; display: grid; gap: 10px; }
.g-steps li { counter-increment: gs; position: relative; padding: 12px 14px 12px 52px; background: #faf7f0; border: 1px solid var(--line); border-radius: 14px; line-height: 1.55; color: #3f404c; }
.g-steps li::before { content: counter(gs); position: absolute; left: 12px; top: 11px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--indigo); color: #fff; font-weight: 800; font-size: 13px; }
.g-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 14px; display: block; overflow-x: auto; }
.g-table tbody { display: table; width: 100%; }
.g-table th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: #f6f1e6; padding: 10px 12px; }
.g-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; color: #3f404c; line-height: 1.5; }
kbd { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: #fff; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--ink); white-space: nowrap; }
.g-tip { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; background: var(--indigo-soft); color: var(--indigo); border-radius: 14px; padding: 12px 14px; }
.g-tip p { color: inherit; margin: 0; font-size: 14px; }
.g-tip .ic { margin-top: 3px; }
.g-tip.warn { background: var(--madder-soft); color: #8a2f1e; }
.g-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.g-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.g-cards > div { background: #faf7f0; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 6px; align-content: start; }
.g-cards span { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--madder-soft); color: var(--madder); }
.g-cards p { font-size: 13.5px; color: var(--muted); }
.g-formula { margin-top: 14px; background: var(--indigo-deep); color: #fff; border-radius: 18px; padding: 18px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-formula > div { background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.g-formula span { font-size: 12px; opacity: .75; }
.g-formula b { color: var(--gold); font-family: var(--display); font-size: 20px; font-weight: 600; }
.g-formula p { grid-column: 1 / -1; color: rgba(255, 255, 255, .85); font-size: 14px; margin: 0; }
.g-gloss { margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-gloss > div { background: #faf7f0; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.g-gloss dt { font-weight: 800; color: var(--indigo-deep); margin-bottom: 4px; }
.g-gloss dd { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.g-short { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.g-short > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #faf7f0; font-size: 13px; }
.g-short span { margin-left: auto; color: var(--muted); }
.g-faq { display: grid; gap: 8px; margin-top: 8px; }
.g-faq details { border: 1px solid var(--line); border-radius: 14px; background: #faf7f0; }
.g-faq summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq details[open] summary .ic { transform: rotate(180deg); }
.g-faq details p { padding: 0 16px 14px; margin: 0; }
.g-cta { padding: 46px 24px; }
.lp-links a[aria-current="page"] { color: var(--madder); }
.machine-row { display: flex; gap: 8px; align-items: center; }
.machine-row select { flex: 1; min-width: 0; }
.machine-row .btn { height: 40px; flex: none; }
.machine-note { font-size: 12px; color: var(--muted); }
@media (max-width: 980px) {
  .g-layout { grid-template-columns: 1fr; gap: 16px; }
  .g-toc { position: static; max-height: none; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .g-toc-title { grid-column: 1 / -1; }
  .g-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .g-sec { padding: 22px 18px; }
  .g-cards, .g-formula, .g-gloss, .g-short { grid-template-columns: 1fr; }
  .g-flow-arrow { display: none; }
}

.wordmark b em { font-style: normal; color: var(--madder); }
