:root {
  --ink: #17201d;
  --muted: #6c746f;
  --paper: #f5f3ed;
  --card: rgba(255, 255, 252, 0.82);
  --line: #d8d9d3;
  --green: #1f6b4d;
  --green-light: #dbe9df;
  --lime: #c9ee72;
  --orange: #ef8354;
  --blue: #8eb8c7;
  --shift: #277c9a;
  --shadow: 0 20px 60px rgba(38, 48, 43, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); font-family: Inter, "Noto Sans SC", sans-serif; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(31, 107, 77, 0.25); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.noise { position: fixed; inset: 0; pointer-events: none; opacity: 0.24; z-index: -1; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E"); }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 4vw, 64px); border-bottom: 1px solid var(--line); background: rgba(245, 243, 237, 0.88); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 21px; font-weight: 700; letter-spacing: -0.6px; }
.brand-mark { width: 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 50%; display: flex; align-items: end; justify-content: center; gap: 2px; padding-bottom: 6px; }
.brand-mark i { width: 3px; border-radius: 4px; background: var(--ink); display: block; }
.brand-mark i:nth-child(1) { height: 7px; }
.brand-mark i:nth-child(2) { height: 13px; }
.brand-mark i:nth-child(3) { height: 9px; }
.brand-dot { color: var(--green); }
.top-actions { display: flex; gap: 10px; align-items: center; }
.status-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 50px; padding: 7px 12px; background: rgba(255, 255, 255, 0.5); font-size: 12px; text-transform: uppercase; letter-spacing: 1.1px; }
.status-pill span { width: 6px; height: 6px; border-radius: 50%; background: #42a36f; box-shadow: 0 0 0 4px rgba(66, 163, 111, 0.12); }
.lang-toggle { width: 38px; height: 38px; border: 1px solid var(--line); background: transparent; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; cursor: pointer; }
.lang-toggle:hover { background: var(--ink); color: white; }

.app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); max-width: 1500px; margin: 0 auto; min-height: calc(100vh - 72px); }
.sidebar { border-right: 1px solid var(--line); padding: 42px 24px; display: flex; flex-direction: column; }
.eyebrow { margin: 0 0 18px 10px; color: #858b87; font-size: 11px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; }
#structureNav { display: flex; flex-direction: column; gap: 5px; }
.nav-item { border: 0; background: transparent; border-radius: 10px; padding: 11px 12px; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; color: #5e6662; font-size: 14px; transition: 0.2s ease; }
.nav-item:hover { background: rgba(255, 255, 255, 0.65); color: var(--ink); transform: translateX(2px); }
.nav-item.active { color: var(--green); background: var(--green-light); font-weight: 600; }
.nav-glyph { width: 26px; height: 26px; border: 1px solid currentColor; border-radius: 7px; display: grid; place-items: center; font: 500 10px "DM Mono", monospace; }
.nav-item.active .nav-glyph { background: var(--green); color: white; }
.tip-card { margin-top: auto; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: rgba(255, 255, 255, 0.4); }
.tip-icon { font-size: 24px; color: var(--green); }
.tip-card p { font-size: 12px; font-weight: 700; margin: 8px 0 5px; }
.tip-card small { color: var(--muted); font-size: 12px; line-height: 1.55; }

.workspace { padding: clamp(30px, 4vw, 58px) clamp(24px, 5vw, 72px) 70px; overflow: hidden; }
.workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.title-line { display: flex; align-items: center; gap: 12px; }
.structure-icon { width: 7px; height: 31px; border-radius: 10px; background: var(--green); }
h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -2px; line-height: 1; }
#structureDescription { margin: 12px 0 0 19px; color: var(--muted); font-size: 14px; max-width: 640px; line-height: 1.65; }
.complexity-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
.complexity-badge { min-width: 72px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, 0.42); }
.complexity-badge small { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 3px; }
.complexity-badge b { font: 500 13px "DM Mono", monospace; }

.stage-card, .control-card, .insight-card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.stage-card { border-radius: 18px; overflow: hidden; }
.stage-toolbar { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); }
.stage-label { display: flex; gap: 8px; align-items: center; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; font-size: 11px; font-weight: 700; }
.stage-label i { width: 5px; height: 5px; background: var(--orange); border-radius: 50%; }
.icon-button { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer; font-size: 12px; color: var(--muted); }
.icon-button svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.graph-editor { display: flex; align-items: end; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: rgba(231, 238, 233, 0.62); overflow-x: auto; }
.graph-editor[hidden] { display: none; }
.graph-editor-copy { min-width: 116px; align-self: center; }
.graph-editor-copy strong { display: block; font-size: 13px; }
.graph-editor-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.graph-editor-group { display: flex; align-items: end; gap: 7px; min-width: max-content; }
.graph-editor-group + .graph-editor-group { border-left: 1px solid var(--line); padding-left: 14px; }
.graph-editor label { display: block; }
.graph-editor label > span { display: block; margin: 0 0 4px 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.graph-editor input, .graph-editor select, .operation-form select { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 7px 9px; color: var(--ink); font: 12px "DM Mono", monospace; }
.graph-editor input { width: 76px; }
.graph-editor select { min-width: 86px; }
.edge-tools b { align-self: center; padding-top: 15px; color: var(--muted); }
.graph-tool { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; background: white; color: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.graph-tool.primary { border-color: var(--green); background: var(--green); color: white; }
.graph-tool.danger { color: #a33b3b; }
.graph-tool:disabled { opacity: 0.4; cursor: not-allowed; }
.visualization { min-height: 325px; padding: 40px 24px; display: grid; place-items: center; overflow: auto; position: relative; background-image: radial-gradient(#cdd1cc 0.7px, transparent 0.7px); background-size: 16px 16px; }
.visualization::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at center, transparent 25%, rgba(255, 255, 252, 0.65) 95%); }
.viz-scene { position: relative; z-index: 1; min-width: max-content; }
.array-scene { display: grid; justify-items: center; gap: 20px; width: 660px; }
.array-row, .linked-row, .stack-column, .queue-row { display: flex; align-items: center; justify-content: center; }
.array-row, .linked-row, .queue-wrap { justify-self: start; }
.array-cell { width: 64px; height: 64px; border: 1.5px solid #9ca7a0; display: grid; place-items: center; font: 500 17px "DM Mono", monospace; background: rgba(255, 255, 252, 0.92); position: relative; transition: 0.35s ease; }
.array-cell:first-child { border-radius: 9px 0 0 9px; }
.array-cell:last-child { border-radius: 0 9px 9px 0; }
.array-cell + .array-cell { border-left: 0; }
.array-cell small { position: absolute; top: 74px; font: 400 11px "DM Mono", monospace; color: var(--muted); }
.array-cell.current, .node.current, .hash-cell.current { background: var(--lime); border-color: #719b2e; transform: translateY(-8px); box-shadow: 0 9px rgba(31, 107, 77, 0.08); z-index: 2; }
.array-cell.changed, .node.changed, .hash-cell.changed { background: #fee0d4; border-color: var(--orange); animation: pop 0.38s ease; }

/* Array insertion: movement gets its own blue visual language instead of the green "search" state. */
.array-cell.empty-slot { color: transparent; background: rgba(255, 255, 255, 0.32); border-style: dashed; border-color: #aeb9b3; }
.array-cell.insert-slot { border: 2px dashed var(--orange); background: rgba(239, 131, 84, 0.08); }
.array-cell.insert-slot::after { content: attr(data-slot-label); position: absolute; top: -30px; white-space: nowrap; color: #b4542d; font: 600 11px Inter, sans-serif; letter-spacing: 0.3px; }
.array-cell.delete-slot { border: 2px dashed #c44f4f; background: rgba(196, 79, 79, 0.07); }
.array-cell.delete-slot::after { content: attr(data-slot-label); position: absolute; top: -30px; white-space: nowrap; color: #a33b3b; font: 600 11px Inter, sans-serif; letter-spacing: 0.3px; }
.array-cell.shift-destination { z-index: 3; color: #154f64; background: #d9edf4; border-color: var(--shift); box-shadow: 0 8px 20px rgba(39, 124, 154, 0.15); animation: slide-right 0.48s cubic-bezier(0.2, 0.75, 0.25, 1); }
.array-cell.shift-destination::before { content: "→"; position: absolute; left: -22px; top: 20px; color: var(--shift); font: 700 16px "DM Mono", monospace; animation: arrow-pulse 0.48s ease; }
.array-cell.shift-left-destination { z-index: 3; color: #154f64; background: #d9edf4; border-color: var(--shift); box-shadow: 0 8px 20px rgba(39, 124, 154, 0.15); animation: slide-left 0.48s cubic-bezier(0.2, 0.75, 0.25, 1); }
.array-cell.shift-left-destination::after { content: "←"; position: absolute; right: -22px; top: 20px; color: var(--shift); font: 700 16px "DM Mono", monospace; animation: arrow-pulse-left 0.48s ease; }
.shift-cue { display: flex; align-items: center; gap: 9px; min-height: 42px; box-sizing: border-box; padding: 7px 13px; border: 1px solid rgba(39, 124, 154, 0.28); border-radius: 999px; background: rgba(217, 237, 244, 0.82); color: #185b73; font-size: 12px; }
.shift-cue strong { font: 700 18px "DM Mono", monospace; }
.shift-cue small { color: #52717b; }
.shift-cue.final { border-color: rgba(239, 131, 84, 0.35); background: rgba(254, 224, 212, 0.75); color: #a64823; }
.shift-cue.delete { border-color: rgba(196, 79, 79, 0.28); background: rgba(255, 235, 235, 0.82); color: #913c3c; }
.legend-shift { background: #d9edf4; border-color: var(--shift) !important; }
@keyframes slide-right { from { transform: translateX(-64px); opacity: 0.35; } to { transform: translateX(0); opacity: 1; } }
@keyframes slide-left { from { transform: translateX(64px); opacity: 0.35; } to { transform: translateX(0); opacity: 1; } }
@keyframes arrow-pulse { 0%, 100% { opacity: 0.35; transform: translateX(-5px); } 60% { opacity: 1; transform: translateX(2px); } }
@keyframes arrow-pulse-left { 0%, 100% { opacity: 0.35; transform: translateX(5px); } 60% { opacity: 1; transform: translateX(-2px); } }
@keyframes pop { 50% { transform: scale(1.09); } }

.node { min-width: 60px; height: 52px; padding: 0 12px; border: 1.5px solid #8f9b94; border-radius: 28px; background: white; display: grid; place-items: center; font: 500 15px "DM Mono", monospace; transition: 0.3s; }
.linked-scene { display: grid; justify-items: center; gap: 24px; width: 660px; }
.pointer-cue { display: flex; align-items: center; gap: 10px; min-height: 40px; box-sizing: border-box; padding: 8px 13px; border: 1px solid rgba(39, 124, 154, 0.28); border-radius: 12px; background: rgba(217, 237, 244, 0.82); color: #185b73; font-size: 12px; white-space: nowrap; }
.pointer-cue strong { font: 700 12px "DM Mono", monospace; }
.pointer-cue.delete { border-color: rgba(196, 79, 79, 0.28); background: rgba(255, 235, 235, 0.82); color: #913c3c; }
.pointer-change .old-pointer { text-decoration: line-through; opacity: 0.72; }
.pointer-change .new-pointer { color: var(--green); font-weight: 700; }
.node.removing { background: #ffe9e7; border-color: #c44f4f; color: #a33b3b; text-decoration: line-through; }
.head-label { font: 600 11px "DM Mono", monospace; color: var(--muted); letter-spacing: 0.8px; }
.head-label.active { color: var(--shift); }
.arrow { width: 48px; height: 1px; background: #829087; position: relative; margin: 0 6px; }
.arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border-left: 7px solid #829087; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.arrow.active { height: 2px; background: var(--shift); }
.arrow.active::after { border-left-color: var(--shift); }
.arrow.old-link { height: 2px; background: #c44f4f; }
.arrow.old-link::after { border-left-color: #c44f4f; }
.head-arrow { width: 28px; }
.null-label, .front-label, .rear-label { font: 500 11px "DM Mono", monospace; color: var(--muted); letter-spacing: 1px; }
.stack-column { flex-direction: column-reverse; gap: 5px; border-bottom: 2px solid #87928c; padding: 0 9px 8px; }
.stack-column .node { border-radius: 7px; min-width: 130px; }
.stack-scene { display: grid; grid-template-rows: auto auto auto; align-items: end; justify-items: center; justify-self: center; gap: 8px; width: 190px; min-height: 0; padding: 4px 0; }
.stack-label { text-align: center; color: var(--green); }
.endpoint-cue { min-height: 38px; box-sizing: border-box; padding: 8px 12px; border: 1px solid rgba(39, 124, 154, 0.28); border-radius: 12px; background: rgba(217, 237, 244, 0.82); color: #185b73; font-size: 11px; text-align: center; }
.cue-placeholder { visibility: hidden; }
.queue-scene { display: grid; justify-items: center; gap: 20px; width: 660px; }
.queue-wrap { display: flex; align-items: center; gap: 12px; }
.queue-row { padding: 9px; gap: 4px; border-left: 2px solid var(--green); border-right: 2px solid var(--orange); }
.queue-row .node { border-radius: 7px; }
.hash-table { display: grid; grid-template-columns: 42px auto; gap: 5px 10px; align-items: center; }
.bucket-index { color: var(--muted); font: 12px "DM Mono", monospace; text-align: right; }
.hash-bucket { min-height: 38px; display: flex; align-items: center; }
.hash-bucket.active { border-radius: 8px; outline: 2px solid rgba(39, 124, 154, 0.28); outline-offset: 3px; background: rgba(217, 237, 244, 0.38); }
.bucket-index.active { color: var(--shift); font-weight: 700; }
.hash-cell { min-width: 48px; height: 36px; padding: 0 9px; display: grid; place-items: center; background: white; border: 1px solid #9ca7a0; border-radius: 6px; font: 13px "DM Mono", monospace; transition: 0.3s; }
.hash-bucket .arrow { width: 24px; }
.tree-svg, .graph-svg { overflow: visible; }
.edge { stroke: #a2aba6; stroke-width: 1.5; }
.edge.active { stroke: var(--green); stroke-width: 3; }
.edge.removing { stroke: #c44f4f; stroke-width: 3; stroke-dasharray: 6 4; }
.tree-node, .graph-node { fill: white; stroke: #77857d; stroke-width: 1.5; transition: 0.3s; }
.tree-node.current, .graph-node.current { fill: var(--lime); stroke: var(--green); stroke-width: 2.5; }
.tree-node.changed, .graph-node.changed { fill: #fee0d4; stroke: var(--orange); }
.node-text { fill: var(--ink); font: 600 13px "DM Mono", monospace; text-anchor: middle; dominant-baseline: central; pointer-events: none; user-select: none; }
.graph-scene { display: grid; justify-items: center; gap: 10px; }
.graph-svg { touch-action: none; overflow: visible; }
.graph-vertex { cursor: grab; touch-action: none; }
.graph-vertex.dragging { cursor: grabbing; }
.graph-vertex:focus .graph-node { stroke: var(--shift); stroke-width: 3; }
.graph-drag-note { margin: 0; color: var(--muted); font-size: 11px; }
.empty-state { color: var(--muted); text-align: center; }
.empty-state strong { display: block; font: 500 20px "DM Mono", monospace; color: var(--ink); margin-bottom: 8px; }

.timeline-panel { display: flex; align-items: center; gap: 18px; border-top: 1px solid var(--line); min-height: 76px; padding: 12px 22px; background: rgba(245, 243, 237, 0.58); }
.playback { display: flex; align-items: center; gap: 6px; }
.round-button, .play-button { border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: rgba(255, 255, 255, 0.7); }
.round-button { width: 29px; height: 29px; font-size: 19px; }
.play-button { width: 38px; height: 38px; background: var(--green); border-color: var(--green); }
.play-button svg { width: 19px; fill: none; stroke: white; stroke-width: 2; stroke-linecap: round; }
.play-button .play-icon { fill: white; stroke: none; }
.play-button .pause-icon, .play-button.playing .play-icon { display: none; }
.play-button.playing .pause-icon { display: block; }
.progress-wrap { flex: 1; min-width: 100px; }
.progress-wrap input { width: 100%; accent-color: var(--green); height: 3px; display: block; }
.step-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.step-meta span:first-child { color: var(--green); font-weight: 600; }
#speedSelect { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: transparent; color: var(--muted); font-size: 11px; }

.lower-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 18px; margin-top: 18px; }
.control-card, .insight-card { border-radius: 14px; padding: 22px; min-width: 0; }
.section-heading { display: flex; gap: 12px; align-items: center; }
.section-heading > span { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: white; display: grid; place-items: center; font: 11px "DM Mono", monospace; }
.section-heading h2 { font-size: 15px; margin: 0 0 3px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.operation-tabs { display: flex; gap: 4px; margin: 20px 0 14px; border-bottom: 1px solid var(--line); }
.operation-tab { border: 0; background: transparent; padding: 10px 13px; font-size: 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.operation-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 700; }
.operation-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.operation-form label span { display: block; color: var(--muted); font-size: 10px; margin: 0 0 5px 2px; text-transform: uppercase; letter-spacing: 0.8px; }
.operation-form input, .operation-form select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 9px 10px; font: 13px "DM Mono", monospace; }
.run-button { height: 42px; border: 0; border-radius: 8px; padding: 0 15px; background: var(--green); color: white; display: flex; align-items: center; gap: 18px; font-size: 12px; cursor: pointer; }
.run-button:hover { background: #16543b; transform: translateY(-1px); }
.code-strip { margin-top: 12px; padding: 10px 11px; background: #eef0eb; border-radius: 7px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 11px "DM Mono", monospace; color: #46504b; }
.code-strip > span { overflow-x: auto; white-space: nowrap; }
.code-strip button { border: 0; background: transparent; color: var(--green); font-size: 10px; cursor: pointer; }
.insight-content { display: grid; grid-template-columns: 70px 1fr; gap: 16px; align-items: center; margin: 24px 0 20px; }
.complexity-ring { width: 66px; height: 66px; border-radius: 50%; border: 5px solid var(--green-light); border-top-color: var(--green); display: grid; place-content: center; text-align: center; }
.complexity-ring span { font: 500 13px "DM Mono", monospace; }
.complexity-ring small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.insight-content h3 { font-size: 14px; margin: 0 0 7px; }
.insight-content p { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 0; }
.legend { border-top: 1px solid var(--line); padding-top: 12px; display: flex; gap: 15px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; border: 1px solid #a8aea9; }
.legend-current { background: var(--lime); }
.legend-change { background: #fee0d4; border-color: var(--orange) !important; }
.legend-default { background: white; }
footer { border-top: 1px solid var(--line); padding: 28px clamp(24px, 5vw, 64px); display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: 0.8px; }
footer p { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 20px); background: var(--ink); color: white; border-radius: 50px; padding: 11px 17px; font-size: 12px; opacity: 0; pointer-events: none; transition: 0.25s; z-index: 40; }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 22px; }
  .eyebrow, .tip-card { display: none; }
  #structureNav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .nav-item { min-width: max-content; min-height: 44px; padding: 8px 11px; }
  .workspace { padding-top: 32px; }
  .lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar { height: 62px; padding: 0 16px; }
  .brand { font-size: 19px; }
  .status-pill { display: none; }
  .sidebar { padding: 10px 12px; }
  #structureNav { gap: 4px; }
  .nav-item { font-size: 13px; }
  .workspace { padding: 22px 12px 46px; }
  .workspace-head { align-items: start; flex-direction: column; gap: 18px; margin-bottom: 22px; }
  h1 { font-size: 34px; }
  #structureDescription { margin-left: 0; font-size: 14px; }
  .complexity-badges { justify-content: start; }
  .complexity-badge { min-width: 82px; }
  .stage-toolbar { height: 52px; padding: 0 14px; }
  .graph-editor { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; overflow: visible; }
  .graph-editor-copy { min-width: 0; }
  .graph-editor-copy small { white-space: normal; }
  .graph-editor-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; min-width: 0; }
  .graph-editor-group + .graph-editor-group { border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; }
  .graph-editor input, .graph-editor select, .graph-tool { width: 100%; min-height: 44px; }
  .edge-tools b { display: none; }
  .visualization { min-height: 340px; justify-content: start; padding: 28px 16px; }
  .timeline-panel { flex-wrap: wrap; gap: 12px; padding: 14px; }
  .playback { width: 100%; justify-content: center; }
  .round-button { width: 38px; height: 38px; }
  .play-button { width: 44px; height: 44px; }
  .progress-wrap { flex-basis: 100%; min-width: 0; }
  .step-meta { line-height: 1.45; }
  .step-meta span:first-child { max-width: none; white-space: normal; overflow: visible; }
  #speedSelect { display: none; }
  .array-cell { width: 55px; height: 55px; }
  .array-cell small { top: 65px; }
  .stack-scene { width: 170px; }
  .stack-column .node { min-width: 120px; height: 48px; }
  .operation-tabs { overflow-x: auto; }
  .operation-tab { min-height: 44px; min-width: max-content; }
  .operation-form { grid-template-columns: 1fr 1fr; }
  .operation-form input, .operation-form select, .run-button { min-height: 46px; }
  .run-button { grid-column: 1 / -1; justify-content: space-between; }
  .control-card, .insight-card { padding: 18px; }
  .insight-content { grid-template-columns: 62px 1fr; gap: 13px; }
  .complexity-ring { width: 60px; height: 60px; }
  footer { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
