:root {
  --bg: #080b14;
  --panel: rgba(14, 20, 34, 0.84);
  --panel-strong: rgba(18, 27, 45, 0.94);
  --line: rgba(134, 168, 214, 0.18);
  --line-bright: rgba(90, 210, 255, 0.38);
  --text: #eef6ff;
  --muted: #9fb1ca;
  --cyan: #32d7ff;
  --blue: #4b86ff;
  --purple: #9b5cff;
  --yellow: #ffc857;
  --pink: #ff4f8b;
  --green: #35e69b;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.34);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(50, 215, 255, 0.18), transparent 34%),
    radial-gradient(circle at 84% 18%, rgba(155, 92, 255, 0.15), transparent 32%),
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 38px 38px, 38px 38px, auto;
}

body,
.stat-number,
.run-state strong,
#progressLabel,
.data-summary strong,
.run-summary strong {
  font-variant-numeric: tabular-nums;
}

button,
select,
input {
  font: inherit;
}

button,
select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

button {
  min-height: 42px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--line-bright);
  background: rgba(50, 215, 255, 0.12);
  box-shadow: 0 0 20px rgba(50, 215, 255, 0.12);
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.header-help {
  min-height: 34px;
  padding-inline: 12px;
}

.primary {
  border-color: rgba(50, 215, 255, 0.58);
  background: linear-gradient(135deg, rgba(50, 215, 255, 0.24), rgba(75, 134, 255, 0.26));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 20, 0.78);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand strong,
footer strong {
  letter-spacing: 0.16em;
}

.brand span,
.header-status,
.eyebrow,
.panel-kicker {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
  text-transform: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: 28px;
  padding: 54px 0 34px;
}

.hero h1 {
  max-width: 760px;
  margin: 8px 0 12px;
  font-size: clamp(2.7rem, 8vw, 6.4rem);
  line-height: 0.95;
}

.hero-lead {
  margin: 0;
  color: #d9e8ff;
  font-size: clamp(1.05rem, 2.5vw, 1.42rem);
  font-weight: 700;
}

.hero-korean {
  max-width: 640px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-mini {
  height: 220px;
  display: flex;
  align-items: end;
  gap: 13px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  box-shadow: var(--shadow);
}

.hero-mini span {
  flex: 1;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  box-shadow: 0 0 20px rgba(50, 215, 255, 0.2);
  animation: pulseBar 2.4s ease-in-out infinite;
}

.hero-mini span:nth-child(1) { height: 42%; }
.hero-mini span:nth-child(2) { height: 78%; animation-delay: 160ms; }
.hero-mini span:nth-child(3) { height: 56%; animation-delay: 320ms; }
.hero-mini span:nth-child(4) { height: 90%; animation-delay: 480ms; }
.hero-mini span:nth-child(5) { height: 66%; animation-delay: 640ms; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
}

.visualizer-card,
.stats-card,
.operation-card,
.control-panel,
.explanation-card,
.complexity-card,
.comparison-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: riseIn 420ms ease both;
}

.visualizer-card {
  min-width: 0;
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-heading h2,
.operation-card h2,
.explanation-card h2,
.complexity-card h2,
.comparison-card h2 {
  margin: 5px 0 0;
  font-size: 1.35rem;
}

.run-state {
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.run-state span,
.stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.run-state strong {
  display: block;
  margin-top: 3px;
}

.array-stage {
  height: 410px;
  position: relative;
  display: block;
  padding: 0;
  border: 1px solid rgba(134, 168, 214, 0.12);
  border-radius: var(--radius);
  background: rgba(3, 8, 18, 0.42);
  overflow: hidden;
}

.visualizer-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 28px 28px;
}

.visualizer-bars {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 18px;
  bottom: 28px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: clamp(2px, 0.55vw, 7px);
}

.visualizer-baseline {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 28px;
  z-index: 2;
  height: 1px;
  background: rgba(148, 163, 184, 0.28);
  box-shadow: 0 0 10px rgba(50, 215, 255, 0.08);
  pointer-events: none;
}

.bar-wrap {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.empty-state {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 100%;
  color: #d8e7fb;
  text-align: center;
  font-weight: 800;
  line-height: 1.6;
}

.empty-state span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 500;
}

.bar {
  width: 100%;
  min-height: 3px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  box-shadow: 0 -2px 10px rgba(50, 215, 255, 0.14);
  transition: height 180ms ease, background 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  position: relative;
  align-self: flex-end;
}

.bar::after {
  content: attr(data-value);
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  color: var(--muted);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: clamp(0.5rem, 1vw, 0.68rem);
  opacity: var(--value-opacity, 1);
}

.bar.compare {
  background: linear-gradient(180deg, #ffe08a, var(--yellow));
  box-shadow: 0 -2px 14px rgba(255, 200, 87, 0.28);
  filter: brightness(1.08);
}

.bar.swap {
  background: linear-gradient(180deg, #ff83b1, var(--pink));
  box-shadow: 0 -2px 16px rgba(255, 79, 139, 0.32);
  filter: brightness(1.12);
}

.bar.sorted {
  background: linear-gradient(180deg, #7dffc8, var(--green));
  box-shadow: 0 -2px 14px rgba(53, 230, 155, 0.26);
}

.bar.pivot {
  background: linear-gradient(180deg, #c9a8ff, var(--purple));
  box-shadow: 0 -2px 16px rgba(155, 92, 255, 0.32);
}

.side-panels {
  display: grid;
  gap: 18px;
}

.stats-card,
.operation-card,
.quick-card {
  padding: 20px;
}

.stats-card h2 {
  margin: 0 0 15px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stats-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
}

.stat-number {
  display: block;
  margin-top: 6px;
  color: #f7fbff;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 1.45rem;
  transition: color 150ms ease, transform 150ms ease;
}

.stat-number.bump {
  color: var(--cyan);
  transform: translateY(-2px);
}

.operation-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
}

#operationFormula {
  margin: 12px 0 8px;
  color: var(--yellow);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-weight: 700;
  min-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#operationDetail {
  color: var(--muted);
  line-height: 1.7;
  min-height: 54px;
  max-height: 54px;
  overflow: hidden;
}

.operation-meta {
  color: #c6d8ef;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.82rem;
  min-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-explanation {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(50, 215, 255, 0.22);
  border-radius: var(--radius);
  color: #dcecff;
  background: rgba(50, 215, 255, 0.07);
  line-height: 1.65;
  min-height: 86px;
  max-height: 120px;
  overflow: auto;
}

.operation-card button {
  margin-top: auto;
}

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

.quick-card ol {
  margin: 14px 0;
  padding-left: 22px;
  color: #d8e7fb;
  line-height: 1.8;
}

.recommend-badge {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(53, 230, 155, 0.28);
  border-radius: 999px;
  color: var(--green);
  background: rgba(53, 230, 155, 0.08);
  font-size: 0.76rem;
  font-weight: 800;
}

.control-panel {
  display: grid;
  grid-template-columns: 180px minmax(280px, 1fr) minmax(180px, 240px) minmax(180px, 240px) minmax(190px, 240px);
  gap: 14px;
  align-items: end;
  margin: 18px 0;
  padding: 18px;
}

.progress-panel {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
}

#progressLabel {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 1.22rem;
  min-width: 58px;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  box-shadow: 0 0 18px rgba(75, 134, 255, 0.28);
  transition: width 130ms ease;
}

.field,
.slider-field {
  display: grid;
  gap: 8px;
}

.field span,
.slider-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.slider-field small {
  color: var(--muted);
  font-family: "JetBrains Mono", Consolas, monospace;
  min-height: 18px;
}

select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background-color: #10182a;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row button {
  flex: 1 1 auto;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.sound-panel {
  display: grid;
  gap: 10px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.sound-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sound-toggle {
  min-height: 34px;
  padding-inline: 11px;
  white-space: nowrap;
}

.volume-field {
  display: grid;
  gap: 6px;
}

.volume-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.sound-meter {
  width: 54px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(50, 215, 255, 0.18);
  border-radius: 999px;
  background: rgba(50, 215, 255, 0.06);
}

.sound-meter span {
  width: 4px;
  height: 7px;
  border-radius: 999px;
  background: rgba(50, 215, 255, 0.45);
  transition: height 120ms ease, background 120ms ease;
}

.sound-meter.playing span {
  background: var(--cyan);
  animation: soundPulse 460ms ease-in-out infinite;
}

.sound-meter.playing span:nth-child(2) {
  animation-delay: 90ms;
}

.sound-meter.playing span:nth-child(3) {
  animation-delay: 180ms;
}

.sound-meter.playing span:nth-child(4) {
  animation-delay: 270ms;
}

.sound-meter.off {
  opacity: 0.45;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 18px;
  margin-bottom: 18px;
}

.explanation-card,
.complexity-card,
.comparison-card {
  padding: 20px;
}

.explanation-card p {
  color: #c7d7ed;
  line-height: 1.75;
}

.complexity-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.complexity-list div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.complexity-list span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.complexity-list strong {
  display: block;
  margin-top: 6px;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.complexity-row,
.comparison-row {
  display: grid;
  grid-template-columns: 130px 1fr 86px;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.complexity-track,
.comparison-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
}

.complexity-fill,
.comparison-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
}

.complexity-row span,
.comparison-row span {
  color: var(--muted);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.8rem;
}

.comparison-card {
  margin-bottom: 18px;
}

.analytics-section {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.analytics-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.analytics-heading h2 {
  margin: 4px 0 0;
}

.data-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.data-summary div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
}

.data-summary span,
.run-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.data-summary strong {
  display: block;
  margin-top: 6px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 1.3rem;
  min-width: 70px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chart-card {
  position: relative;
  min-height: 236px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 10, 21, 0.42);
}

.chart-card h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
}

.chart-card canvas {
  display: block;
  width: 100%;
  height: 180px;
}

.chart-empty {
  position: absolute;
  inset: 52px 14px 14px;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
  background: rgba(5, 10, 21, 0.58);
}

.chart-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 20px;
  color: var(--muted);
  font-size: 0.78rem;
}

.cyan-dot,
.pink-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.cyan-dot {
  background: #22d3ee;
}

.pink-dot {
  background: #f472b6;
}

.run-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.run-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
}

.run-summary strong {
  display: block;
  margin-top: 5px;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.completion-card {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid rgba(53, 230, 155, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(53, 230, 155, 0.1), rgba(50, 215, 255, 0.05)), var(--panel);
  box-shadow: var(--shadow);
}

.completion-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.completion-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
}

.completion-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.completion-summary strong {
  display: block;
  margin-top: 5px;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.tutorial-modal,
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(2, 6, 14, 0.68);
  backdrop-filter: blur(10px);
}

.tutorial-modal {
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card,
.tutorial-card {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  background: rgba(12, 18, 31, 0.94);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}

.modal-card p,
.tutorial-card p {
  color: #d8e7fb;
  line-height: 1.7;
}

.modal-card ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tutorial-overlay {
  pointer-events: auto;
}

.spotlight-box {
  position: fixed;
  border: 2px solid var(--cyan);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(1, 5, 12, 0.72), 0 0 30px rgba(50, 215, 255, 0.35);
  transition: inset 220ms ease, width 220ms ease, height 220ms ease, transform 220ms ease;
}

.tutorial-card {
  position: fixed;
  right: clamp(14px, 5vw, 56px);
  bottom: clamp(14px, 5vw, 46px);
}

.legend-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.legend-list div {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #d8e7fb;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.term {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 5px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: help;
  position: relative;
}

.term::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: 230px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #dcecff;
  background: #0b1220;
  box-shadow: var(--shadow);
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.term:hover::after,
.term:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: center;
  padding: 34px 16px 44px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

footer small {
  color: #d5e8ff;
}

@keyframes pulseBar {
  0%, 100% { transform: translateY(0); filter: brightness(1); }
  50% { transform: translateY(-8px); filter: brightness(1.22); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes soundPulse {
  0%, 100% { height: 6px; }
  50% { height: 16px; }
}

@media (max-width: 1020px) {
  .hero,
  .workspace,
  .info-grid,
  .control-panel {
    grid-template-columns: 1fr;
  }

  .control-panel {
    align-items: stretch;
  }
}

@media (max-width: 680px) {
  main {
    width: min(100% - 20px, 1240px);
  }

  .site-header {
    position: static;
    align-items: start;
    flex-direction: column;
  }

  .brand {
    flex-direction: column;
    gap: 4px;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .hero-mini {
    height: 150px;
  }

  .panel-heading,
  .button-row {
    flex-direction: column;
  }

  .run-state {
    width: 100%;
  }

  .array-stage {
    height: 330px;
  }

  .bar::after {
    opacity: 0;
  }

  .stats-grid,
  .complexity-list,
  .completion-summary,
  .data-summary,
  .run-summary {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-grid,
  .progress-panel {
    grid-template-columns: 1fr;
  }

  .complexity-row,
  .comparison-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tutorial-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }
}
