:root {
  color-scheme: light;
  --bg: #f6f1e8;
  --surface: #fff7ee;
  --surface-2: #ffffff;
  --ink: #1c1a16;
  --muted: #5d554b;
  --accent: #ff6b35;
  --accent-2: #1f9e8a;
  --accent-3: #2f5bff;
  --stroke: rgba(28, 26, 22, 0.12);
  --shadow: 0 16px 40px rgba(28, 26, 22, 0.08);
  --code-bg: #f2f4f7;
  --code-border: rgba(28, 26, 22, 0.14);
  --code-text: #2a2620;
  --code-comment: #6b7280;
  --code-keyword: #d97706;
  --code-string: #0f766e;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --surface: #1d1c1a;
  --surface-2: #1f1e1c;
  --ink: #f2f1ee;
  --muted: #bdb7ac;
  --accent: #ff8a5b;
  --accent-2: #5bd6c2;
  --accent-3: #7ba3ff;
  --stroke: rgba(255, 255, 255, 0.12);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --code-bg: #0b0e13;
  --code-border: rgba(255, 255, 255, 0.1);
  --code-text: #f0f0f0;
  --code-comment: #b7c0cc;
  --code-keyword: #ffb077;
  --code-string: #8ff0a4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", sans-serif;
  background: radial-gradient(circle at top left, #ffe9d2, var(--bg) 45%),
    radial-gradient(circle at 70% 20%, #e6f5ff, transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

[data-theme="dark"] body {
  background: radial-gradient(circle at top left, rgba(255, 138, 91, 0.15), var(--bg) 45%),
    radial-gradient(circle at 70% 20%, rgba(123, 163, 255, 0.15), transparent 60%),
    var(--bg);
}

.glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(255, 107, 53, 0.12), transparent 40%),
    radial-gradient(circle at 15% 85%, rgba(31, 158, 138, 0.1), transparent 45%);
  z-index: 0;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding: 32px;
  background: var(--surface-2);
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--stroke);
  animation: rise 0.8s ease-out both;
}

.hero--stacked {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.hero--stacked .hero-actions {
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.hero--stacked .hero-actions-left,
.hero--stacked .hero-actions-right {
  justify-content: flex-end;
}

.hero--compact {
  grid-template-columns: 1fr;
}

.hero--compact .hero-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero--compact .hero-actions {
  margin-left: 4px;
}

.hero-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions-left,
.hero-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions-right .ghost {
  height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
}

@media (max-width: 720px) {
  .hero--stacked {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-actions-right {
    width: 100%;
    justify-content: flex-start;
  }
}

.user-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(28, 26, 22, 0.08);
}

.icon-button {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(28, 26, 22, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(28, 26, 22, 0.18);
}

.icon-button svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.icon-button > span {
  line-height: 1;
}

.icon-button .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
  color: inherit;
}

.lang-select {
  width: auto;
  min-width: 120px;
  padding-right: 28px;
}

.lang-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-trigger {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(28, 26, 22, 0.1);
}

.lang-icon {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor !important;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none !important;
  opacity: 1;
}

.lang-emoji {
  font-size: 18px;
  line-height: 1;
  display: block;
}

.lang-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
  display: none;
  z-index: 30;
}

.lang-menu.is-open .lang-popover {
  display: block;
}

.lang-option {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.lang-option:hover {
  background: rgba(148, 163, 184, 0.16);
}

.lang-option.is-active {
  background: rgba(59, 130, 246, 0.18);
  font-weight: 600;
}

.eyebrow {
  text-transform: uppercase;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--accent-2);
  margin: 0 0 8px;
}

.hero h1 {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(28px, 3.2vw, 40px);
}

.hero-title {
  white-space: nowrap;
}

.subhead {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.hero-card {
  background: linear-gradient(160deg, rgba(255, 107, 53, 0.08), rgba(31, 158, 138, 0.08));
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(31, 158, 138, 0.2);
}

.hero-card ul {
  padding-left: 18px;
  margin: 12px 0 0;
  color: var(--muted);
}

.hero-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  margin: 0;
}

.layout {
  display: grid;
  gap: 36px;
  margin-top: 40px;
}

.section-header h2 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0 0 6px;
}

.section-header p {
  margin: 0;
  color: var(--muted);
}

.lesson {
  animation: rise 0.8s ease-out 0.1s both;
}

.lesson-sections {
  display: grid;
  gap: 20px;
  margin-top: 16px;
}

.reference-sections {
  display: grid;
  gap: 24px;
  margin-top: 20px;
}

.algorithm-sections {
  display: grid;
  gap: 26px;
  margin-top: 20px;
}

.algorithm-header h3 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
}

.algorithm-header p {
  margin: 0 0 12px;
  color: var(--muted);
}

.algorithm-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.algorithm-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.algorithm-card {
  background: var(--surface-2);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--stroke);
  box-shadow: 0 8px 20px rgba(28, 26, 22, 0.06);
}

.algorithm-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.algorithm-code {
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--code-text);
}

.algorithm-code code,
.algorithm-code .hljs {
  background: transparent;
  padding: 0;
  color: inherit;
}

.algorithm-visual .visual-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.algorithm-visual .visual-code {
  display: grid;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 12px;
  padding: 10px 12px;
}

.algorithm-visual .code-line {
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--code-text);
}

.algorithm-visual .code-line.indent-1 {
  margin-left: 16px;
}

.algorithm-visual .code-line.indent-2 {
  margin-left: 32px;
}

.algorithm-visual .code-line.indent-3 {
  margin-left: 48px;
}

.algorithm-visual .code-line.active {
  background: rgba(90, 101, 231, 0.15);
  color: var(--text);
  font-weight: 600;
}

.algorithm-visual .visual-state {
  display: grid;
  gap: 8px;
  align-content: start;
}

.algorithm-visual .visual-array {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 8px;
}

.algorithm-visual .visual-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.algorithm-visual .legend-item {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
}

.algorithm-visual .legend-item.current {
  border-color: rgba(59, 130, 246, 0.6);
  color: rgb(30, 64, 175);
}

.algorithm-visual .legend-item.max {
  border-color: rgba(16, 185, 129, 0.6);
  color: rgb(4, 120, 87);
}

.algorithm-visual .legend-item.target {
  border-color: rgba(16, 185, 129, 0.6);
  color: rgb(4, 120, 87);
}

.algorithm-visual .legend-item.min {
  border-color: rgba(244, 114, 182, 0.6);
  color: rgb(157, 23, 77);
}

.algorithm-visual .legend-item.pointer {
  border-color: rgba(59, 130, 246, 0.6);
  color: rgb(30, 64, 175);
}

.algorithm-visual .legend-item.sorted {
  border-color: rgba(148, 163, 184, 0.6);
  color: rgb(71, 85, 105);
}

.algorithm-visual .array-item {
  padding: 10px 6px;
  text-align: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--stroke);
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, border 0.2s ease;
}

.algorithm-visual .array-value {
  font-size: 14px;
}

.algorithm-visual .array-tag {
  font-size: 10px;
  margin-top: 4px;
  min-height: 12px;
  color: var(--muted);
}

.algorithm-visual .array-item.current {
  border-color: rgba(59, 130, 246, 0.7);
  background: rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.algorithm-visual .array-item.max {
  border-color: rgba(16, 185, 129, 0.7);
  background: rgba(16, 185, 129, 0.18);
}

.algorithm-visual .array-item.min {
  border-color: rgba(244, 114, 182, 0.7);
  background: rgba(244, 114, 182, 0.15);
}

.algorithm-visual .array-item.pointer {
  border-color: rgba(59, 130, 246, 0.7);
  background: rgba(59, 130, 246, 0.12);
}

.algorithm-visual .array-item.target {
  border-color: rgba(16, 185, 129, 0.7);
  background: rgba(16, 185, 129, 0.12);
}

.algorithm-visual .array-item.sorted {
  border-color: rgba(148, 163, 184, 0.7);
  background: rgba(148, 163, 184, 0.12);
}

.algorithm-visual .prefix-array {
  border: 1px dashed var(--stroke);
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
}

.algorithm-visual .visual-status {
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}

.algorithm-visual .visual-metrics {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--text);
}

.algorithm-visual .visual-metrics strong {
  color: var(--muted);
  font-weight: 600;
  margin-right: 6px;
}

.algorithm-visual .visual-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.algorithm-visual .visual-controls .icon-button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reference-section h3 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.reference-card {
  background: var(--surface-2);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--stroke);
  box-shadow: 0 8px 20px rgba(28, 26, 22, 0.06);
}

.reference-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.reference-desc {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.reference-code {
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--code-text);
}

.group-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.group-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
}

.group-row .group-input {
  margin: 0;
}

.group-actions {
  display: inline-flex;
  gap: 8px;
}

.reference-code code,
.reference-code .hljs {
  background: transparent;
  padding: 0;
  color: inherit;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.lesson-section {
  margin-top: 20px;
}

.lesson-section:first-child {
  margin-top: 0;
}

.lesson-section-header h3 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
}

.lesson-section-header p {
  margin: 0;
  color: var(--muted);
}

.lesson-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--stroke);
  box-shadow: 0 8px 24px rgba(28, 26, 22, 0.06);
}

.lesson-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.lesson-summary {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.lesson-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.lesson-code {
  margin: 12px 0 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(28, 26, 22, 0.08);
  padding: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.workspace {
  animation: rise 0.8s ease-out 0.2s both;
}

.category-bar {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-button {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-button:hover {
  border-color: rgba(47, 91, 255, 0.4);
  color: var(--ink);
}

.category-button.active {
  background: var(--accent-3);
  color: #fff;
  border-color: var(--accent-3);
  box-shadow: 0 8px 16px rgba(47, 91, 255, 0.25);
}

.category-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2.2fr);
  gap: 20px;
  margin-top: 20px;
}

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exercise-item {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.exercise-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 53, 0.4);
  box-shadow: 0 8px 18px rgba(255, 107, 53, 0.12);
}

.exercise-item.active {
  border-color: rgba(47, 91, 255, 0.5);
  box-shadow: 0 10px 20px rgba(47, 91, 255, 0.2);
}

.exercise-item h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.exercise-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.exercise-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.14);
  color: var(--accent);
  font-weight: 600;
}

.exercise-solved {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(31, 158, 138, 0.18);
  color: var(--accent-2);
  font-weight: 600;
}

.exercise-item.done {
  border-color: rgba(31, 158, 138, 0.35);
  box-shadow: 0 8px 18px rgba(31, 158, 138, 0.12);
}

.exercise-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.editor-panel {
  background: var(--surface-2);
  border-radius: 22px;
  padding: 22px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.editor-header h3 {
  margin: 0;
  font-size: 20px;
}

.editor-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(31, 158, 138, 0.14);
  color: var(--accent-2);
  font-weight: 600;
}

.setup-block {
  margin-top: 16px;
  background: rgba(31, 158, 138, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px dashed rgba(31, 158, 138, 0.3);
}

.input-block {
  background: rgba(255, 107, 53, 0.08);
  border-color: rgba(255, 107, 53, 0.3);
}

.setup-label {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}

.setup-block pre {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

.editor-label {
  margin-top: 18px;
  display: inline-block;
  font-weight: 600;
}

textarea {
  margin-top: 10px;
  width: 100%;
  min-height: 180px;
  border-radius: 16px;
  border: 1px solid rgba(28, 26, 22, 0.18);
  padding: 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f7f4 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 20px rgba(28, 26, 22, 0.08);
  color: #1c1a16;
  line-height: 1.6;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: rgba(47, 91, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(47, 91, 255, 0.2);
}

.CodeMirror {
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid rgba(28, 26, 22, 0.18);
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 20px rgba(28, 26, 22, 0.08);
  height: auto;
  min-height: 180px;
}

.CodeMirror-scroll {
  min-height: 180px;
}

.CodeMirror-focused {
  border-color: rgba(47, 91, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(47, 91, 255, 0.2);
}

.editor-panel pre,
.setup-block pre,
.output-panel pre,
.lesson-code {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(28, 26, 22, 0.12);
  box-shadow: none;
}

.editor-panel pre,
.setup-block pre,
.output-panel pre {
  border-radius: 16px;
  padding: 12px 14px;
}

.lesson-code,
.setup-block pre,
.state-panel pre {
  border-radius: 16px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 12px 14px;
  color: var(--code-text);
}

.lesson-code code,
.lesson-code .hljs,
.setup-block pre code,
.setup-block pre .hljs,
.state-panel pre code,
.state-panel pre .hljs {
  background: transparent;
  padding: 0;
  color: inherit;
}

.hljs-comment,
.hljs-quote {
  color: var(--code-comment) !important;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-type {
  color: var(--code-keyword) !important;
}

.hljs-string,
.hljs-number,
.hljs-literal {
  color: var(--code-string) !important;
}

.output-panel pre {
  border-radius: 16px;
  padding: 12px 14px;
}
.controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.input,
select.input,
textarea.input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(28, 26, 22, 0.18);
  padding: 10px 12px;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(28, 26, 22, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus,
select.input:focus,
textarea.input:focus {
  outline: none;
  border-color: rgba(47, 91, 255, 0.5);
  box-shadow: 0 12px 24px rgba(47, 91, 255, 0.18);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(28, 26, 22, 0.18);
  background: #fff;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(28, 26, 22, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(28, 26, 22, 0.12);
  border-color: rgba(28, 26, 22, 0.3);
}

.button.ghost {
  background: #fff;
  color: var(--muted);
}

.admin-panel,
.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
}

.table-check-head,
.admin-table td:first-child {
  width: 36px;
}

.table-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-3);
}

.admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.8);
}

.bulk-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 16px;
}

.bulk-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bulk-select {
  width: auto;
  min-width: 160px;
}

.bulk-count {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.8);
}

.admin-table tr:hover td {
  background: rgba(248, 250, 252, 0.7);
}

.admin-empty {
  padding: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-size: 14px;
}

.account-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}

.account-link:hover {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
}

.admin-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  margin-bottom: 20px;
}

.admin-topbar .brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.admin-topbar .nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-link {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.admin-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-title {
  margin: 0;
  font-size: 18px;
  font-family: "Space Grotesk", sans-serif;
}

.panel-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.panel-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button.is-active {
  background: var(--accent-3);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 24px rgba(47, 91, 255, 0.2);
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
  font-size: 13px;
  color: var(--muted);
}

button {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  cursor: pointer;
}

.controls .ghost {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  border: 1px solid rgba(28, 26, 22, 0.2);
  color: var(--muted);
  background: #fff;
}

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(255, 107, 53, 0.25);
}

button.ghost {
  background: #fff;
  border: 1px solid rgba(28, 26, 22, 0.2);
  color: var(--muted);
}

.output-panel {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  background: rgba(47, 91, 255, 0.06);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(47, 91, 255, 0.2);
}

.state-panel,
.error-panel {
  display: none;
}

.error-panel {
  border-top: 1px dashed rgba(214, 69, 69, 0.4);
  padding-top: 10px;
}

.output-label {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-3);
}

.output-panel pre {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  min-height: 48px;
}

.result {
  font-weight: 600;
}

.result.ok {
  color: var(--accent-2);
}

.result.error {
  color: #d64545;
}

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

@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .exercise-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .exercise-item {
    min-width: 200px;
  }
}

@media (max-width: 640px) {
  .app {
    padding: 32px 16px 60px;
  }

  .hero {
    padding: 24px;
  }

  .editor-header {
    flex-direction: column;
  }

  .controls {
    flex-direction: column;
  }
}
