:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f9fbff;
  --surface-strong: #eef4ff;
  --text: #172033;
  --muted: #5e6a7d;
  --faint: #7b8496;
  --border: #dfe6f2;
  --border-strong: #cbd7ea;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #e9f1ff;
  --teal: #0f766e;
  --teal-soft: #e8faf7;
  --success: #166534;
  --success-soft: #dcfce7;
  --success-border: #86efac;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --danger-border: #fca5a5;
  --amber: #b45309;
  --amber-soft: #fff7e6;
  --rose: #be123c;
  --rose-soft: #fff0f3;
  --code-bg: #111827;
  --code-text: #e5edf8;
  --shadow: 0 16px 42px rgba(23, 32, 51, 0.08);
  --shadow-soft: 0 10px 24px rgba(23, 32, 51, 0.06);
  --radius: 8px;
  --container: 1160px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101522;
  --surface: #171e2d;
  --surface-soft: #1c2535;
  --surface-strong: #1e2d47;
  --text: #eef3ff;
  --muted: #b9c3d4;
  --faint: #8f9aae;
  --border: #2c374b;
  --border-strong: #3a4860;
  --primary: #78a6ff;
  --primary-strong: #a9c5ff;
  --primary-soft: #1f3354;
  --teal: #5eead4;
  --teal-soft: #143b39;
  --success: #86efac;
  --success-soft: #14351f;
  --success-border: #2f6b43;
  --danger: #fca5a5;
  --danger-soft: #431b1f;
  --danger-border: #7f2b34;
  --amber: #fbbf24;
  --amber-soft: #402f13;
  --rose: #fda4af;
  --rose-soft: #48202b;
  --code-bg: #0a101d;
  --code-text: #ecf3ff;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select,
input,
textarea {
  color: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  max-width: 100%;
}

pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92rem;
}

ul,
ol {
  padding-left: 1.2rem;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -52px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--surface);
  font-weight: 800;
}

.skip-link:focus {
  top: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-flex;
  width: 40px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.nav-links a,
.footer-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.nav-links a:hover,
.nav-links a.active,
.footer-links a:hover,
.footer-links a.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

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

.theme-toggle,
.nav-toggle {
  min-width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.theme-toggle:hover,
.nav-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.nav-toggle {
  display: none;
}

.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: currentColor;
}

.hero-section {
  padding: 72px 0 54px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.85fr);
  align-items: center;
  gap: 46px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-strong);
  font-size: 0.88rem;
  font-weight: 900;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.45rem, 5vw, 4.8rem);
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.5rem);
}

h3 {
  font-size: 1.12rem;
}

h4 {
  font-size: 0.98rem;
}

.hero-text {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.14rem;
}

.hero-actions,
.button-row,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-stats span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.button,
button.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 900;
  text-align: center;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.18);
}

.button.primary:hover {
  background: var(--primary-strong);
}

.button.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button.secondary:hover {
  border-color: var(--border-strong);
  color: var(--primary-strong);
}

.button.ghost {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.button.success {
  border-color: var(--success-border);
  background: var(--success-soft);
  color: var(--success);
}

.button.success:hover {
  border-color: var(--success);
}

.button.danger {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.button.danger:hover {
  border-color: var(--danger);
}

.button.small {
  min-height: 38px;
  padding: 0 13px;
  font-size: 0.9rem;
}

.sql-window,
.feature-card,
.concept-card,
.problem-card,
.problem-detail-card,
.copy-card,
.legal-content,
.contact-card,
.stat-card,
.mini-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.sql-window {
  overflow: hidden;
  box-shadow: var(--shadow);
}

.window-bar {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--border-strong);
}

.window-bar span:first-child {
  background: #f87171;
}

.window-bar span:nth-child(2) {
  background: #fbbf24;
}

.window-bar span:nth-child(3) {
  background: #34d399;
}

.window-body {
  padding: 24px;
}

.window-body h2 {
  font-size: 1.25rem;
}

.query-label {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 900;
}

.window-body pre,
.detail-section pre {
  margin: 18px 0 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-text);
}

.query-result {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.query-result p {
  margin: 0;
  color: var(--muted);
}

.section {
  padding: 72px 0;
}

.section.alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-heading {
  max-width: 790px;
  margin-bottom: 30px;
}

.section-heading.center {
  margin-inline: auto;
  text-align: center;
}

.section-heading.inline {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
}

.intro-copy p,
.copy-card p,
.legal-content p,
.contact-card p,
.concept-card p,
.feature-card p {
  color: var(--muted);
}

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

.stat-card {
  padding: 20px;
}

.stat-card strong {
  display: block;
  color: var(--primary-strong);
  font-size: 1.9rem;
  line-height: 1.1;
}

.stat-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.concept-card,
.copy-card,
.contact-card {
  padding: 22px;
}

.feature-card h2,
.concept-card h2,
.copy-card h2,
.contact-card h2 {
  font-size: 1.18rem;
}

.feature-card,
.concept-card {
  min-height: 220px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.feature-card:hover,
.concept-card:hover,
.problem-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.feature-icon {
  display: inline-flex;
  min-width: 44px;
  height: 34px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.feature-card:nth-child(3n + 2) .feature-icon {
  background: var(--teal-soft);
  color: var(--teal);
}

.feature-card:nth-child(3n) .feature-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.concept-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.concept-card p {
  margin: 0;
}

.concept-card .button {
  margin-top: auto;
  align-self: flex-start;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.source-card,
.concept-block,
.toc-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.source-card {
  padding: 20px;
}

.source-card h2 {
  font-size: 1.08rem;
}

.source-card p {
  color: var(--muted);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.28fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.toc-box {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 6px;
  padding: 18px;
}

.toc-box strong {
  margin-bottom: 6px;
}

.toc-box a {
  min-height: 36px;
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--muted);
  font-weight: 900;
}

.toc-box a:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.concept-stack {
  display: grid;
  gap: 18px;
}

.concept-block {
  padding: 26px;
  scroll-margin-top: 92px;
}

.concept-block h2 {
  margin-bottom: 14px;
}

.concept-block p,
.concept-block li {
  color: var(--muted);
}

.concept-block pre {
  margin: 18px 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-text);
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.source-list a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-size: 0.86rem;
  font-weight: 900;
}

.source-list a:hover {
  border-color: var(--border-strong);
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.category-button {
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.category-button:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  color: var(--primary-strong);
}

.problem-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(140px, 0.7fr));
  gap: 12px;
  margin-bottom: 16px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.field input,
.field select,
.query-lab {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 13px;
}

.field input:hover,
.field select:hover,
.query-lab:hover {
  border-color: var(--border-strong);
}

.problem-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  color: var(--muted);
}

.problem-summary strong {
  color: var(--text);
}

.practice-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 0.24fr)) minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
  margin: 18px 0;
}

.practice-progress > div:not(.progress-track) {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.practice-progress strong {
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}

.practice-progress span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
  transition: width 0.18s ease;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.problem-card {
  display: flex;
  min-height: 278px;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.problem-card p {
  margin: 0;
  color: var(--muted);
}

.problem-card.status-solved {
  border-color: var(--success-border);
}

.problem-card.status-review {
  border-color: var(--danger-border);
}

.problem-card > .button {
  margin-top: auto;
  align-self: flex-start;
}

.problem-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.card-topline,
.problem-meta,
.detail-badges,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.card-topline {
  justify-content: space-between;
}

.problem-number,
.problem-meta span,
.detail-badges span,
.tag,
.difficulty,
.status-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.problem-number,
.problem-meta span,
.detail-badges span {
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--border);
}

.status-chip.status-solved,
.problem-meta .status-solved,
.detail-badges .status-solved {
  border-color: var(--success-border);
  background: var(--success-soft);
  color: var(--success);
}

.status-chip.status-review,
.problem-meta .status-review,
.detail-badges .status-review {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.status-chip.status-unsolved,
.problem-meta .status-unsolved,
.detail-badges .status-unsolved {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--muted);
}

.difficulty.beginner {
  background: var(--teal-soft);
  color: var(--teal);
}

.difficulty.intermediate {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.difficulty.advanced {
  background: var(--rose-soft);
  color: var(--rose);
}

.tag {
  background: var(--surface-strong);
  color: var(--primary-strong);
}

.tag.concept {
  background: var(--teal-soft);
  color: var(--teal);
}

.no-results {
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.problem-detail {
  scroll-margin-top: 92px;
}

.problem-detail[hidden],
.no-results[hidden],
.back-to-top[hidden] {
  display: none;
}

.problem-detail-card,
.detail-empty {
  padding: 26px;
}

.detail-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

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

.detail-badges {
  justify-content: flex-end;
  max-width: 260px;
}

.detail-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.detail-section:last-of-type {
  border-bottom: 0;
}

.detail-section h3 {
  margin-bottom: 12px;
}

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

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  background: var(--surface);
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.86rem;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.table-group + .table-group {
  margin-top: 18px;
}

.table-group h4 {
  margin-bottom: 8px;
  color: var(--muted);
}

.query-lab-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.query-lab {
  min-height: 130px;
  padding: 14px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.check-list {
  display: grid;
  gap: 9px;
  margin: 0;
  color: var(--muted);
}

.answer-check .button {
  margin-top: 16px;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.answer-note {
  max-width: 720px;
}

.answer-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.answer-panel[hidden] {
  display: none;
}

.answer-panel h4 {
  margin: 22px 0 8px;
}

.answer-panel h4:first-child {
  margin-top: 0;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-links a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-weight: 900;
}

.related-links a:hover {
  border-color: var(--border-strong);
}

.muted-text {
  color: var(--muted);
}

.seo-grid,
.trust-grid,
.content-grid,
.feature-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.trust-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.copy-card h3,
.contact-card h2 {
  margin-bottom: 10px;
}

.copy-card p:last-child,
.legal-content p:last-child,
.contact-card p:last-child,
.feature-card p:last-child {
  margin-bottom: 0;
}

.mini-panel {
  padding: 18px;
  background: var(--surface-soft);
}

.page-hero {
  padding: 58px 0 38px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-hero p:not(.eyebrow) {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.legal-content {
  padding: 30px;
}

.legal-content h2 {
  margin: 30px 0 10px;
  font-size: 1.35rem;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content li {
  color: var(--muted);
  margin: 8px 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.report-form,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

.report-form h2,
.panel h2 {
  margin-bottom: 14px;
  font-size: 1.35rem;
}

.report-form label {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 900;
}

.report-form input,
.report-form select,
.report-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 13px;
}

.report-form textarea {
  min-height: 150px;
  padding: 13px;
  resize: vertical;
}

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.form-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.panel p {
  color: var(--muted);
}

.note-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}

.report-preview {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-text);
  white-space: pre-wrap;
}

.contact-list {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.contact-list li {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.text-link {
  color: var(--primary-strong);
  font-weight: 900;
}

.text-link:hover {
  text-decoration: underline;
}

.sitemap-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.sitemap-list a {
  display: flex;
  min-height: 46px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-weight: 900;
}

.site-footer {
  padding: 46px 0 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
}

.footer-grid p {
  max-width: 560px;
  margin: 16px 0 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
}

.footer-bottom {
  margin-top: 26px;
  color: var(--faint);
  font-size: 0.92rem;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary-strong);
  box-shadow: var(--shadow-soft);
  font-weight: 900;
}

@media (max-width: 980px) {
  .hero-grid,
  .intro-grid,
  .contact-grid,
  .content-layout,
  .split-section {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .concept-grid,
  .source-grid,
  .problem-grid,
  .seo-grid,
  .content-grid,
  .feature-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-strip,
  .stat-grid,
  .trust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .problem-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .practice-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-track {
    grid-column: 1 / -1;
  }

  .toc-box {
    position: static;
  }
}

@media (max-width: 780px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .nav {
    min-height: 64px;
  }

  .nav-toggle {
    display: inline-block;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    right: 14px;
    left: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
  }

  .theme-toggle {
    min-width: 58px;
  }

  .hero-section {
    padding-top: 52px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .section {
    padding: 54px 0;
  }

  .section-heading.inline,
  .problem-summary,
  .detail-heading,
  .footer-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-badges,
  .footer-links {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .hero-actions,
  .button-row,
  .detail-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .feature-grid,
  .concept-grid,
  .source-grid,
  .problem-grid,
  .seo-grid,
  .trust-grid,
  .content-grid,
  .feature-detail-grid,
  .category-strip,
  .stat-grid,
  .problem-toolbar,
  .practice-progress,
  .form-row,
  .sitemap-list {
    grid-template-columns: 1fr;
  }

  .progress-track {
    grid-column: auto;
  }

  .problem-detail-card,
  .legal-content {
    padding: 20px;
  }

  .window-body {
    padding: 18px;
  }

  .brand span:last-child {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
