*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0f1117;
  --surface:      #1a1d27;
  --surface2:     #22263a;
  --border:       #2d3147;
  --accent:       #5865f2;
  --accent-dim:   #3d4596;
  --accent-glow:  rgba(88, 101, 242, 0.18);
  --text:         #e2e8f0;
  --text-muted:   #8892b0;
  --green:        #43d675;
  --green-dim:    rgba(67, 214, 117, 0.14);
  --red:          #f87171;
  --red-dim:      rgba(248, 113, 113, 0.14);
  --yellow:       #fbbf24;
  --yellow-dim:   rgba(251, 191, 36, 0.14);
  --radius:       8px;
  --radius-sm:    4px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.88em;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  color: #a5d6ff;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ─── Header ─────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -1px;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.nav-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.header-nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: all 0.12s;
  text-decoration: none;
}

.nav-link:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.nav-link.active { color: var(--accent); background: var(--accent-glow); }

/* ─── Footer ─────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ─── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-easy   { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(67,214,117,0.3); }
.badge-medium { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(251,191,36,0.3); }
.badge-hard   { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(248,113,113,0.3); }

.category-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ─── Problem List Page ───────────────────────────────── */
.page-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 18px;
}

.page-title h1 { font-size: 1.5rem; font-weight: 700; }

.stats {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 4px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filters select,
.filters input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
}

.filters input { flex: 1; min-width: 160px; }

.filters select:focus,
.filters input:focus { border-color: var(--accent); }

.problem-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 40px;
}

.problem-table thead { background: var(--surface2); }

.problem-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.problem-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.problem-table tbody tr:last-child td { border-bottom: none; }

.problem-row { cursor: pointer; transition: background 0.12s; }
.problem-row:hover { background: var(--surface2); }
.problem-row.solved td:first-child { border-left: 3px solid var(--green); }

.col-id { width: 52px; color: var(--text-muted); font-size: 0.88rem; }
.col-title a { color: var(--text); font-weight: 500; }
.col-title a:hover { color: var(--accent); text-decoration: none; }
.col-difficulty { width: 90px; }
.col-category { width: 110px; }
.col-status { width: 56px; text-align: center; }

.solved-mark {
  color: var(--green);
  font-size: 1rem;
  font-weight: 700;
}

.loading, .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 0.95rem;
}

/* ─── Roadmap ────────────────────────────────────────── */
.roadmap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0 16px;
}

.roadmap-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.roadmap-stages {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.roadmap-stage {
  flex: 1;
  min-width: 130px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.roadmap-stage:hover { border-color: var(--accent); }
.roadmap-stage.active { border-color: var(--accent); background: var(--accent-glow); }

.stage-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.stage-easy   { color: var(--green); }
.stage-medium { color: var(--yellow); }
.stage-hard   { color: var(--red); }

.stage-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

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

.stage-tags span {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 7px;
}

.roadmap-arrow {
  color: var(--border);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ─── Problem Page ────────────────────────────────────── */
.problem-page main { padding-bottom: 60px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text); }

.problem-header {
  margin-bottom: 20px;
}

.problem-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.problem-id-label {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.problem-main-title {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.3;
}

.problem-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.match-mode-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 20px;
}

.problem-desc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  line-height: 1.75;
}

.problem-desc-card strong { color: var(--yellow); }

.section-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

/* ─── Test Cases Table ───────────────────────────────── */
.cases-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.cases-table thead { background: var(--surface2); }

.cases-table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.cases-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.cases-table tbody tr:last-child td { border-bottom: none; }

.case-row { transition: background 0.1s; }
.case-pass { background: rgba(67,214,117,0.05); border-left: 3px solid var(--green); }
.case-fail { background: rgba(248,113,113,0.05); border-left: 3px solid var(--red); }

.case-str code { font-size: 0.88rem; color: var(--text); }

.expect-match  { color: var(--green);  font-size: 0.82rem; font-weight: 600; }
.expect-nomatch { color: var(--red);   font-size: 0.82rem; font-weight: 600; }

.case-status {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
}

.case-status.pending { color: var(--text-muted); }
.case-status.pass    { color: var(--green); background: var(--green-dim); }
.case-status.fail    { color: var(--red);   background: var(--red-dim); }

/* ─── Regex Input ─────────────────────────────────────── */
.solver-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.regex-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  transition: border-color 0.15s;
  margin-bottom: 12px;
}

.regex-input-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.regex-delim {
  color: var(--accent);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  user-select: none;
  line-height: 1;
  padding: 12px 0;
}

#pattern-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #a5d6ff;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 1rem;
  padding: 12px 4px;
  caret-color: var(--accent);
}

#pattern-input::placeholder { color: var(--text-muted); font-style: italic; opacity: 0.6; }

.flags-group {
  display: flex;
  gap: 4px;
  padding: 6px 0;
}

.flag-label {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.12s;
  border: 1px solid transparent;
}

.flag-label:hover { color: var(--accent); border-color: var(--border); }
.flag-label:has(.flag-cb:checked) { color: var(--accent); background: var(--accent-glow); border-color: var(--accent); }

.flag-cb { display: none; }

#error-msg {
  font-size: 0.85rem;
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid rgba(248,113,113,0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: none;
  font-family: 'JetBrains Mono', monospace;
}

.solver-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.progress-text {
  font-size: 0.9rem;
  font-weight: 600;
}

.progress-text.muted    { color: var(--text-muted); }
.progress-text.error    { color: var(--red); }
.progress-text.partial  { color: var(--yellow); }
.progress-text.all-pass { color: var(--green); }

#submit-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

#submit-btn:hover:not(:disabled) { background: var(--accent-dim); }
#submit-btn:disabled { opacity: 0.45; cursor: default; }

/* ─── Engine badge ───────────────────────────────────── */
.engine-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(88,101,242,0.3);
  border-radius: 99px;
  padding: 2px 10px;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

/* ─── Explainer ───────────────────────────────────────── */
.explainer-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-bottom: 12px;
}

.explainer-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.explainer-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.explainer-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.ex-token {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ex-token code {
  font-size: 0.9em;
  background: var(--surface2);
  color: #a5d6ff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.ex-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* ─── Case match highlight ────────────────────────────── */
mark.case-match {
  background: rgba(88, 101, 242, 0.22);
  color: #a5d6ff;
  border-radius: 2px;
  padding: 0 1px;
  border-bottom: 2px solid var(--accent);
  font-style: normal;
}

.case-fail mark.case-match {
  background: rgba(248, 113, 113, 0.2);
  color: var(--red);
  border-bottom-color: var(--red);
}

.case-pass mark.case-match {
  background: rgba(67, 214, 117, 0.15);
  color: var(--green);
  border-bottom-color: var(--green);
}

.fail-reason {
  display: block;
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 3px;
}

.empty-match {
  color: var(--yellow);
  font-style: italic;
  font-size: 0.8em;
}

/* ─── Result Banner ───────────────────────────────────── */
.result-banner {
  display: none;
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.result-banner.success {
  background: var(--green-dim);
  border: 1px solid rgba(67,214,117,0.35);
  color: var(--green);
}

.result-banner.fail {
  background: var(--red-dim);
  border: 1px solid rgba(248,113,113,0.35);
  color: var(--red);
}

/* ─── Hints ──────────────────────────────────────────── */
.hints-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.hints-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

#hint-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.12s;
}

#hint-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
#hint-btn:disabled { opacity: 0.4; cursor: default; }

#hints-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}

#hints-list li {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

#hints-list li:first-child { border-top: none; }

/* ─── Problem Navigation ─────────────────────────────── */
.problem-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  gap: 10px;
}

.problem-nav a {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  text-decoration: none;
}

.problem-nav a:hover { border-color: var(--accent); color: var(--accent); }
.problem-nav .to-list { color: var(--text-muted); }

/* ─── Guide Page ─────────────────────────────────────── */
.guide-page { padding-bottom: 60px; }

.guide-hero {
  text-align: center;
  padding: 40px 0 32px;
}

.guide-hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }
.guide-hero p  { color: var(--text-muted); font-size: 1rem; line-height: 1.7; }

.guide-section { margin-bottom: 48px; }

.guide-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.guide-section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* Tester */
.tester-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.tester-top { margin-bottom: 16px; }

#guide-input-row { margin-bottom: 10px; }

#guide-pattern {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #a5d6ff;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 1rem;
  padding: 12px 4px;
  caret-color: var(--accent);
}

#guide-pattern::placeholder { color: var(--text-muted); font-style: italic; opacity: 0.6; }

.guide-error {
  font-size: 0.85rem;
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid rgba(248,113,113,0.3);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
}

.tester-meta { display: flex; align-items: center; gap: 10px; min-height: 22px; }

.match-count { font-size: 0.85rem; font-weight: 600; }
.match-count.has-match { color: var(--green); }
.match-count.no-match  { color: var(--text-muted); }

.tester-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.tester-col-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.result-tip {
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--yellow);
  opacity: 0.8;
}

.test-textarea {
  width: 100%;
  min-height: 140px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.88rem;
  padding: 12px;
  resize: vertical;
  outline: none;
  line-height: 1.6;
  transition: border-color 0.15s;
}

.test-textarea:focus { border-color: var(--accent); }

.match-result {
  width: 100%;
  min-height: 140px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.88rem;
  padding: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-muted);
}

mark.regex-match {
  background: rgba(251, 191, 36, 0.28);
  color: var(--yellow);
  border-radius: 2px;
  padding: 0 1px;
  border-bottom: 2px solid var(--yellow);
  font-style: normal;
}

/* Match list */
.match-list-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 4px;
}

.match-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  padding: 4px 0;
}

.match-list-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0;
}

.match-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.match-chip code {
  color: var(--yellow);
  background: none;
  padding: 0;
  font-size: 0.82rem;
}

/* Quick patterns */
.quick-patterns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-bottom: 14px;
}

.quick-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.quick-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 99px;
  padding: 4px 13px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.quick-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* Cheat sheet */
.cheatsheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.cs-card-wide { grid-column: 1 / -1; }

.cs-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.cs-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.cs-desc strong { color: var(--yellow); font-weight: 600; }

.cs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cs-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.cs-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
  color: var(--text-muted);
}

.cs-table tbody tr:last-child td { border-bottom: none; }
.cs-table td:first-child { white-space: nowrap; }
.cs-table td code { font-size: 0.85em; }

.cs-note {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}

.cs-note strong { color: var(--text); }

/* CTA */
.guide-cta {
  text-align: center;
  padding: 32px 0 8px;
  border-top: 1px solid var(--border);
}

.guide-cta p { color: var(--text-muted); margin-bottom: 14px; font-size: 1rem; }

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s;
}

.cta-btn:hover { background: var(--accent-dim); text-decoration: none; }

/* Responsive */
@media (max-width: 640px) {
  .tester-body { grid-template-columns: 1fr; }
  .cheatsheet-grid { grid-template-columns: 1fr; }
  .cs-card-wide { grid-column: 1; }
  .guide-hero h1 { font-size: 1.5rem; }
}

/* ─── 404 Page ───────────────────────────────────────── */
.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 16px;
}

.page-404 .code-404 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 5rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.6;
  line-height: 1;
}

.page-404 h2 { font-size: 1.4rem; }
.page-404 p { color: var(--text-muted); }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .problem-table th.col-category,
  .problem-table td.col-category { display: none; }

  .regex-input-row { padding: 0 8px; }
  #pattern-input { font-size: 0.9rem; }

  .problem-nav a { max-width: 140px; font-size: 0.8rem; }
  .problem-main-title { font-size: 1.25rem; }
}
