:root {
  --ink: #111210;
  --muted: #686b65;
  --paper: #eeeee8;
  --surface: #fafaf7;
  --line: #d5d6cf;
  --soft-line: #e5e6df;
  --blue: #4f66dd;
  --blue-soft: #e8ebff;
  --green: #4eaf77;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--paper); }
button, input, select { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgb(238 238 232 / 92%);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 780; letter-spacing: -0.02em; }
.brand small { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0.02em; }
.brand-mark { position: relative; width: 22px; height: 22px; display: block; border-radius: 47% 53% 48% 52%; background: var(--ink); transform: rotate(-7deg); }
.brand-mark i { position: absolute; top: 6px; width: 4px; height: 8px; border-radius: 50%; background: white; }
.brand-mark i:first-child { left: 7px; }
.brand-mark i:last-child { left: 13px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.component-stats { color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.quiet-action, .download-action { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 12px; font-weight: 720; }
.quiet-action { padding: 0 11px; border: 1px solid var(--line); background: var(--surface); }
.download-action { gap: 14px; padding: 0 13px; color: white; background: var(--ink); }
.download-action span { color: #aeb9ff; }

main { width: 100%; }
.studio {
  min-height: calc(100svh - 58px);
  display: grid;
  grid-template-columns: minmax(350px, 0.95fr) minmax(450px, 1.25fr) minmax(380px, 1fr);
  border-bottom: 1px solid var(--line);
}
.studio-panel { min-width: 0; padding: 22px; background: var(--surface); }
.studio-panel + .studio-panel { border-left: 1px solid var(--line); }
.controls-panel, .output-panel { background: #f7f7f3; }
.controls-panel { max-height: calc(100svh - 58px); overflow-y: auto; }
.panel-heading { min-height: 48px; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; margin-bottom: 18px; }
.step-number { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--ink); font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.panel-heading h1, .panel-heading h2 { margin: 0; font-size: 19px; font-weight: 780; letter-spacing: -0.035em; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.quick-editor { display: grid; gap: 15px; }
.quick-editor fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.quick-editor legend, .field > span, .range-control > span { margin-bottom: 9px; color: var(--muted); font-size: 13px; font-weight: 720; }
.quick-editor legend { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.quick-editor legend span { color: #92958e; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.field > span { display: block; width: 100%; }
.field small { float: right; color: #9a9d96; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.field select, .field input[type="color"] { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font-size: 13px; }
.field select { padding: 0 9px; }
.field input[type="color"] { padding: 4px; cursor: pointer; }

.state-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.state-grid button { position: relative; min-width: 0; min-height: 58px; display: flex; align-items: center; gap: 8px; padding: 7px 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; text-align: left; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease; }
.state-grid button:hover { border-color: #aeb0aa; transform: translateY(-1px); }
.state-grid button.is-active { color: white; border-color: var(--blue); background: var(--blue); }
.state-grid button.has-sequence-step:not(.is-active) { border-color: #aab3e5; }
.state-grid morph-bot { flex: 0 0 auto; pointer-events: none; }
.state-grid .state-option-copy { min-width: 0; display: grid; gap: 2px; }
.state-grid strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.state-grid code { overflow: hidden; color: inherit; font-size: 10px; opacity: 0.72; text-overflow: ellipsis; white-space: nowrap; }
.state-role-markers { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; }
.state-role-markers:empty { display: none; }
.state-role-markers i { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; font-style: normal; font-weight: 850; box-shadow: 0 1px 4px rgb(17 18 16 / 14%); }
.state-role-markers .sequence-role { color: white; background: var(--ink); }
.state-role-markers .sequence-role.is-selected { background: var(--blue); }
.state-grid button.is-active .state-role-markers i { color: var(--ink); background: white; }
.catalog-note { margin: 9px 1px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.shape-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.shape-grid button { min-width: 0; min-height: 58px; display: flex; align-items: center; gap: 8px; padding: 7px 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; cursor: pointer; }
.shape-grid button:hover { border-color: #aeb0aa; }
.shape-grid button.is-active { color: var(--ink); border-color: var(--blue); background: var(--blue-soft); }
.shape-grid morph-bot { flex: 0 0 auto; pointer-events: none; }
.shape-grid span { min-width: 0; display: grid; gap: 2px; text-align: left; }
.shape-grid strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.shape-grid code { overflow: hidden; color: inherit; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.advanced-controls { border-top: 1px solid var(--line); }
.advanced-controls summary { display: flex; justify-content: space-between; padding: 15px 0 0; color: var(--muted); font-size: 13px; font-weight: 720; cursor: pointer; list-style: none; }
.advanced-controls summary::-webkit-details-marker { display: none; }
.advanced-controls[open] summary span { transform: rotate(45deg); }
.advanced-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 8px; padding-top: 14px; }
.range-control { grid-column: 1 / -1; display: grid; grid-template-columns: 35px 1fr 38px; align-items: center; gap: 8px; }
.range-control > span { margin: 0; }
.range-control input { width: 100%; accent-color: var(--blue); }
.range-control output { color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; text-align: right; }
.toggle { min-height: 40px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.toggle input { accent-color: var(--blue); }
.pause-action { height: 40px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font-size: 12px; cursor: pointer; }
.pause-action.is-paused { color: white; border-color: var(--blue); background: var(--blue); }

.preview-panel { position: relative; display: grid; grid-template-rows: auto auto auto minmax(390px, 1fr); background: #ecece6; }
.preview-heading { margin-bottom: 10px; }
.context-tabs { width: fit-content; display: flex; gap: 3px; margin: 0 auto 14px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #dedfd8; }
.context-tabs button { min-width: 64px; height: 34px; padding: 0 10px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.context-tabs button.is-active { color: var(--ink); background: white; box-shadow: 0 1px 4px rgb(17 18 16 / 9%); }

.sequence-builder { display: grid; gap: 10px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7f7f3; }
.sequence-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sequence-heading p { display: grid; gap: 2px; margin: 0; }
.sequence-heading strong { font-size: 13px; }
.sequence-heading span { color: var(--muted); font-size: 11px; }
.sequence-heading label { min-height: 34px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.sequence-heading input { accent-color: var(--blue); }
.sequence-list { display: grid; gap: 6px; }
.sequence-step { position: relative; display: grid; grid-template-columns: minmax(120px, 1.3fr) minmax(58px, 0.55fr) minmax(96px, 0.9fr) minmax(58px, 0.55fr) auto; gap: 6px; align-items: stretch; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: white; transition: border-color 150ms ease, box-shadow 150ms ease; }
.sequence-step.is-selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(79 102 221 / 11%); }
.sequence-step.is-playing { border-color: var(--green); box-shadow: 0 0 0 3px rgb(78 175 119 / 12%); }
.sequence-identity { min-width: 0; display: grid; grid-template-columns: 22px 34px minmax(0, 1fr); gap: 7px; align-items: center; padding: 3px; border: 0; border-radius: 7px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.sequence-identity:hover { background: var(--blue-soft); }
.sequence-number { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--ink); font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; font-weight: 800; }
.sequence-step.is-selected .sequence-number { background: var(--blue); }
.sequence-step.is-playing .sequence-number { background: var(--green); }
.sequence-identity morph-bot { pointer-events: none; }
.sequence-identity span:last-child { min-width: 0; display: grid; gap: 2px; }
.sequence-identity strong, .sequence-identity code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sequence-identity strong { font-size: 12px; }
.sequence-identity code { color: var(--muted); font-size: 10px; }
.sequence-field { min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px; align-items: end; padding: 3px 0; }
.sequence-field > span { grid-column: 1 / -1; color: var(--muted); font-size: 10px; font-weight: 720; }
.sequence-field input { min-width: 0; width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: white; font-size: 11px; }
.sequence-field input { padding: 0 6px; }
.sequence-field i { color: var(--muted); font-size: 10px; font-style: normal; }
.sequence-field.is-disabled { opacity: 0.42; }
.sequence-morph-readout { min-width: 0; display: grid; align-content: center; gap: 2px; padding: 3px 5px; border-left: 1px solid var(--soft-line); }
.sequence-morph-readout span { color: var(--muted); font-size: 10px; font-weight: 720; }
.sequence-morph-readout strong, .sequence-morph-readout code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sequence-morph-readout strong { font-size: 11px; }
.sequence-morph-readout code { color: var(--muted); font-size: 10px; }
.sequence-actions { display: grid; grid-template-columns: repeat(2, 25px); gap: 3px; align-content: center; }
.sequence-actions button { width: 25px; height: 25px; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: white; font-size: 11px; cursor: pointer; }
.sequence-actions button:last-child { grid-column: 1 / -1; width: 53px; }
.sequence-actions button:hover:not(:disabled) { color: var(--ink); border-color: #aeb0aa; }
.sequence-actions button:disabled { cursor: default; opacity: 0.28; }
.sequence-morph-picker { min-width: 0; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
.sequence-morph-picker legend { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 2px; color: var(--muted); font-size: 10px; font-weight: 720; }
.sequence-morph-picker output { color: var(--blue); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.sequence-morph-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding-top: 6px; }
.sequence-morph-grid button { min-width: 0; min-height: 38px; display: grid; align-content: center; gap: 1px; padding: 4px 5px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; text-align: left; cursor: pointer; }
.sequence-morph-grid button:hover { border-color: #aeb0aa; }
.sequence-morph-grid button.is-selected { color: white; border-color: var(--blue); background: var(--blue); }
.sequence-morph-grid strong, .sequence-morph-grid code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sequence-morph-grid strong { font-size: 11px; }
.sequence-morph-grid code { color: inherit; font-size: 10px; opacity: 0.72; }
.sequence-action-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 7px; align-items: center; }
.sequence-action-row > span { color: var(--muted); font-size: 10px; text-align: center; }
.sequence-action-row button { min-height: 38px; padding: 0 11px; border-radius: 8px; font-size: 11px; font-weight: 760; cursor: pointer; }
.add-sequence-step, .stop-sequence { border: 1px solid var(--line); color: var(--ink); background: white; }
.stop-sequence:disabled { cursor: default; opacity: 0.38; }
.preview-sequence { border: 0; color: white; background: var(--blue); }
.preview-sequence span { margin-right: 4px; }

.preview-stage { position: relative; min-height: 390px; margin: 0; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fdfdfb; box-shadow: 0 15px 45px rgb(17 18 16 / 6%); }
.stage-grid { position: absolute; inset: 0; opacity: 0.38; background-image: linear-gradient(var(--soft-line) 1px, transparent 1px), linear-gradient(90deg, var(--soft-line) 1px, transparent 1px); background-size: 24px 24px; mask-image: radial-gradient(circle, black, transparent 75%); }
.preview-object { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; transition: padding 180ms ease, background-color 180ms ease, border-radius 180ms ease, box-shadow 180ms ease; }
.context-copy { display: none; }
.context-copy strong, .context-copy span { display: block; }
.preview-stage[data-context="button"] .preview-object { gap: 10px; padding: 11px 16px; border: 1px solid #aeb8f2; border-radius: 10px; color: var(--ink); background: #dfe4ff; box-shadow: 0 10px 26px rgb(79 102 221 / 14%); }
.preview-stage[data-context="button"] .context-copy { display: block; }
.preview-stage[data-context="button"] .context-copy strong { font-size: 14px; }
.preview-stage[data-context="button"] .context-copy span { display: none; }
.preview-stage[data-context="card"] .preview-object { min-width: min(340px, calc(100% - 40px)); justify-content: flex-start; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 12px 32px rgb(17 18 16 / 8%); }
.preview-stage[data-context="card"] .context-copy { display: block; }
.preview-stage[data-context="card"] .context-copy strong { margin-bottom: 4px; font-size: 15px; }
.preview-stage[data-context="card"] .context-copy span { color: var(--muted); font-size: 12px; }
.preview-stage[data-context="page"] .preview-object { min-width: min(390px, calc(100% - 40px)); min-height: 270px; flex-direction: column; gap: 18px; padding: 28px; border-radius: 16px; background: #e8e9e3; }
.preview-stage[data-context="page"] .context-copy { display: block; text-align: center; }
.preview-stage[data-context="page"] .context-copy strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.preview-stage[data-context="page"] .context-copy span { display: none; }
.preview-stage figcaption { position: absolute; z-index: 2; left: 13px; right: 13px; bottom: 11px; display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.preview-stage figcaption strong { font-size: 11px; }
.preview-stage figcaption code { font-size: 10px; }

.first-use { margin-bottom: 14px; padding: 12px; border: 1px solid #ccd1ed; border-radius: 10px; background: var(--blue-soft); }
.first-use-label { display: block; margin-bottom: 6px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.first-use p { margin: 0 0 11px; color: #555a6f; font-size: 12px; line-height: 1.55; }
.first-use code { color: var(--ink); }
.first-use a { min-height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-radius: 8px; color: white; background: var(--ink); font-size: 12px; font-weight: 760; }
.first-use a span { color: #aeb9ff; }

.code-card { overflow: hidden; border: 1px solid #252724; border-radius: 12px; color: #e7e9e3; background: #131513; box-shadow: 0 15px 36px rgb(17 18 16 / 11%); }
.code-card-bar { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; border-bottom: 1px solid #2b2d2a; }
.code-mode-tabs { display: flex; gap: 3px; }
.code-mode-tabs button { height: 30px; padding: 0 9px; border: 0; border-radius: 6px; color: #989b95; background: transparent; font-size: 11px; cursor: pointer; }
.code-mode-tabs button.is-active { color: white; background: #2c302c; }
.sync-indicator { display: flex; align-items: center; gap: 5px; color: #86d3a5; font-size: 10px; }
.sync-indicator i { width: 5px; height: 5px; border-radius: 50%; background: #65c98d; box-shadow: 0 0 0 3px rgb(101 201 141 / 12%); }
.code-card pre { min-height: 240px; max-height: 360px; margin: 0; padding: 17px; overflow: auto; color: #d6c3ac; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.code-card > button { width: calc(100% - 20px); min-height: 44px; margin: 0 10px 10px; border: 0; border-radius: 8px; color: var(--ink); background: #f1f1ea; font-size: 13px; font-weight: 800; cursor: pointer; }
.code-card > button:hover { background: white; }
.code-card > button.is-copied { color: white; background: var(--green); }

.use-checklist { display: grid; gap: 7px; margin-top: 14px; padding: 0 2px; }
.use-checklist p { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; }
.use-checklist span { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; background: white; }
.runtime-details { margin-top: 15px; border-top: 1px solid var(--line); }
.runtime-details summary { display: flex; justify-content: space-between; gap: 10px; padding: 14px 0; color: var(--muted); font-size: 12px; font-weight: 720; cursor: pointer; list-style: none; }
.runtime-details summary::-webkit-details-marker { display: none; }
.runtime-details summary span { color: var(--blue); }
.runtime-details pre { margin: 0; padding: 14px; overflow: auto; border-radius: 9px; color: #c7d1ff; background: var(--ink); font-size: 12px; line-height: 1.65; }

.below-studio { width: min(1180px, calc(100% - 44px)); margin: 0 auto; padding: 72px 0 82px; }
.below-studio > header { display: grid; grid-template-columns: 120px minmax(260px, 1fr) minmax(260px, 0.7fr); gap: 24px; align-items: baseline; margin-bottom: 30px; }
.below-studio header p { margin: 0; color: var(--blue); font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; font-weight: 760; letter-spacing: 0.06em; text-transform: uppercase; }
.below-studio header h2 { margin: 0; font-size: clamp(27px, 3.4vw, 44px); letter-spacing: -0.055em; line-height: 1; }
.below-studio header > span { color: var(--muted); font-size: 13px; line-height: 1.6; }
.below-studio header code { color: var(--ink); }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.example-grid article { min-height: 210px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.example-grid article > div { grid-column: 1 / -1; align-self: stretch; display: flex; align-items: center; justify-content: center; border-radius: 9px; background: #e8e9e3; }
.example-grid article > strong { font-size: 13px; }
.example-grid article > code { color: var(--muted); font-size: 11px; }
.button-example button { min-height: 42px; display: inline-flex; align-items: center; gap: 9px; padding: 0 15px; border: 0; border-radius: 9px; color: white; background: var(--blue); font-size: 12px; font-weight: 720; opacity: 1; }
.card-example { gap: 12px; }
.card-example p { display: grid; gap: 3px; margin: 0; }
.card-example b { font-size: 13px; }
.card-example span { color: var(--muted); font-size: 11px; }
.page-example { flex-direction: column; gap: 10px; }
.page-example span { color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; letter-spacing: 0.08em; }

footer { width: min(1180px, calc(100% - 44px)); min-height: 76px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer a { color: var(--ink); font-weight: 720; }

button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (max-width: 1280px) {
  .studio { grid-template-columns: minmax(250px, 0.78fr) minmax(380px, 1.22fr); }
  .output-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 220px minmax(390px, 1fr) 190px; gap: 16px; border-top: 1px solid var(--line); border-left: 0 !important; }
  .output-panel .panel-heading { grid-column: 1 / -1; margin-bottom: 0; }
  .output-panel .first-use, .output-panel .code-card, .output-panel .use-checklist { margin: 0; }
  .runtime-details { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .app-header { position: relative; padding: 11px 16px; }
  .component-stats, .quiet-action { display: none; }
  .download-action { min-height: 36px; }
  .studio { display: block; }
  .studio-panel { padding: 19px 16px; }
  .studio-panel + .studio-panel { border-top: 1px solid var(--line); border-left: 0; }
  .preview-panel { display: grid; min-height: 590px; }
  .preview-stage { min-height: 460px; }
  .sequence-step { grid-template-columns: minmax(150px, 1fr) 84px minmax(120px, 0.8fr) 84px auto; }
  .output-panel { display: block; }
  .output-panel .panel-heading { margin-bottom: 18px; }
  .output-panel .first-use, .output-panel .code-card, .output-panel .use-checklist { margin-bottom: 14px; }
  .below-studio { width: calc(100% - 32px); padding: 52px 0 58px; }
  .below-studio > header { grid-template-columns: 1fr; gap: 10px; }
  .example-grid { grid-template-columns: 1fr; }
  .example-grid article { min-height: 210px; }
  footer { width: calc(100% - 32px); align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
}

@media (max-width: 420px) {
  .brand small { display: none; }
  .state-grid, .shape-grid { grid-template-columns: repeat(2, 1fr); }
  .context-tabs { width: 100%; }
  .context-tabs button { flex: 1; min-width: 0; }
  .sequence-step { grid-template-columns: minmax(0, 1fr) 74px; }
  .sequence-identity { grid-column: 1 / -1; }
  .sequence-field:nth-of-type(2) { grid-column: 1 / -1; }
  .sequence-actions { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .sequence-actions button, .sequence-actions button:last-child { grid-column: auto; width: 100%; }
  .sequence-morph-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sequence-action-row { grid-template-columns: 1fr 1fr; }
  .sequence-action-row > span { order: -1; grid-column: 1 / -1; }
  .preview-sequence { grid-column: 1 / -1; }
  .preview-stage[data-context="card"] .preview-object { min-width: calc(100% - 26px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; }
}
