@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&family=Space+Grotesk:wght@500;700&display=swap");

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f7f7fb;
  color: #111;
}

.top {
  background: #1f2937;
  color: white;
  padding: 32px 20px;
  text-align: center;
}

.top h1 {
  margin: 0 0 8px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.control-group {
  min-width: 0;
}

.title-group {
  flex: 1 1 0;
}

.contest-group {
  flex: 0 0 260px;
}

.contest-input-wrap {
  position: relative;
}

.controls input,
.contest-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #cfd4dc;
  border-radius: 10px;
  background: white;
  box-sizing: border-box;
}

.expression-panel,
.topic-panel {
  background: white;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  margin-bottom: 18px;
}

.expression-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.expression-header h2 {
  margin: 0;
  font-size: 18px;
}

.expression-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary-btn {
  border: 1px solid #cfd4dc;
  background: white;
  color: #111;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.secondary-btn:hover {
  background: #f3f4f6;
}

.clear-btn {
  border: none;
  background: #ef4444;
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.clear-btn:hover {
  background: #dc2626;
}

.topic-input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.topic-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 16px;
  border: 2px solid #cfd4dc;
  border-radius: 12px;
  background: white;
  outline: none;
}

.topic-input:focus {
  border-color: #2563eb;
}

.topic-input.invalid {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

.topic-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 30;
  max-height: 250px;
  overflow-y: auto;
}

.topic-suggestions.hidden {
  display: none;
}

.contest-suggestions {
  top: calc(100% + 8px);
  bottom: auto;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: #e8f0ff;
}

.suggestion-main {
  color: #111;
  font-weight: 600;
}

.suggestion-meta {
  color: #555;
  font-size: 12px;
  white-space: nowrap;
}

.operator-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  margin-left: auto;
}

.operator-label {
  font-size: 14px;
  color: #444;
  font-weight: 600;
}

.builder-btn {
  border: 1px solid #cfd4dc;
  background: white;
  color: #111;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.builder-btn:hover {
  background: #eef2ff;
  border-color: #93c5fd;
}

.difficulty-panel {
  margin-top: 15px;
}

.difficulty-label-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}

.difficulty-label {
  font-weight: 700;
  color: #111;
}

.difficulty-range-text {
  color: #2563eb;
  font-weight: 700;
}

.dual-range {
  position: relative;
  height: 5px;
}

.dual-range-track,
.dual-range-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 999px;
}

.dual-range-track {
  left: 0;
  right: 0;
  background: #e5e7eb;
}

.dual-range-fill {
  background: #2563eb;
  left: 0;
  right: 0;
}

.range-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 5px;
  margin: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
}

.range-input::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  pointer-events: auto;
}

.range-input::-moz-range-track {
  height: 6px;
  background: transparent;
}

.range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  pointer-events: auto;
}

.search-btn {
  width: 100%;
  margin-top: 18px;
  padding: 12px 16px;
  border: none;
  background: #111827;
  color: white;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}

.search-btn:hover {
  background: #0f172a;
}

.topic-status {
  margin-top: 8px;
  font-size: 14px;
  color: #555;
}

.topic-status.ok {
  color: #166534;
}

.topic-status.error {
  color: #b91c1c;
}

.topic-top-buttons {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.field-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.field-tab {
  border: 1px solid #cfd4dc;
  background: #f9fafb;
  color: #111;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.field-tab.active {
  background: #111827;
  color: white;
  border-color: #111827;
}

.topic-help {
  margin: 0 0 14px;
  color: #555;
  font-size: 14px;
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-pill {
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.15s ease;
}

.topic-pill:hover {
  background: #eef2ff;
  border-color: #93c5fd;
}

.topic-pill.field-pill {
  background: #f3f4f6;
  font-weight: 700;
}

.problem-list {
  display: grid;
  gap: 16px;
  transition: opacity 0.24s ease, transform 0.24s ease;
  will-change: opacity, transform;
}

.problem-list.is-animating {
  pointer-events: none;
}

.problem-list.page-exit.page-forward {
  opacity: 0;
  transform: translateX(-20px);
}

.problem-list.page-exit.page-backward {
  opacity: 0;
  transform: translateX(20px);
}

.problem-list.page-enter.page-forward {
  opacity: 0;
  transform: translateX(20px);
}

.problem-list.page-enter.page-backward {
  opacity: 0;
  transform: translateX(-20px);
}

.pagination-nav {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 8px;
}

.pagination-nav.hidden {
  display: none;
}

.pagination-nav.is-disabled {
  pointer-events: none;
  opacity: 0.72;
}

.pagination-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 44px;
  padding: 9px 12px;
  border: 1px solid #b8c3d3;
  border-radius: 10px;
  background: white;
  color: #0f172a;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: #eef2ff;
  border-color: #93c5fd;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

.pagination-btn:disabled,
.pagination-btn.is-disabled {
  opacity: 0.72;
  cursor: default;
}

.pagination-page.is-current {
  background: #111827;
  border-color: #111827;
  color: white;
  opacity: 1;
}

.pagination-nav-btn {
  min-width: 86px;
}

.pagination-ellipsis {
  letter-spacing: 0.08em;
}

.pagination-jump-form {
  margin: 0;
}

.pagination-jump-input {
  width: 70px;
  padding: 9px 10px;
  border: 1px solid #cfd4dc;
  border-radius: 10px;
  background: white;
  color: #111;
  box-sizing: border-box;
  text-align: center;
  font-weight: 700;
}

.pagination-jump-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.problem-card {
  background: white;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.problem-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.meta {
  font-size: 14px;
  color: #555;
  margin-bottom: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.statement {
  margin-bottom: 12px;
  line-height: 1.6;
}

.choice-list {
  margin: 0 0 14px 22px;
  padding: 0;
}

.choice-list li {
  margin-bottom: 6px;
}

.choice-list-images {
  margin-left: 26px;
}

.choice-list-images li {
  margin-bottom: 12px;
}

.choice-image {
  display: block;
  max-width: min(100%, 220px);
  height: auto;
}

.solution-btn {
  margin-top: 10px;
  padding: 9px 14px;
  border: none;
  background: #2563eb;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.solution-btn:hover {
  background: #1d4ed8;
}

.solution {
  margin-top: 12px;
  padding: 14px;
  background: #eef4ff;
  border-radius: 10px;
  display: none;
}

.solution.show {
  display: block;
}

.solution-answer {
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.solution-text {
  line-height: 1.7;
  white-space: pre-wrap;
}

.empty-state,
.invalid-state {
  background: white;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.invalid-state {
  color: #b91c1c;
}

@media (max-width: 800px) {
  .controls {
    flex-direction: column;
  }

  .contest-group {
    flex: 1 1 auto;
  }
}

@media (max-width: 700px) {
  .expression-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .difficulty-label-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .topic-top-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .operator-row {
    margin-left: 0;
  }

  .problem-detail-nav {
    flex-direction: column;
    align-items: stretch;
  }
}

.problem-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.problem-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

.problem-row-main {
  min-width: 0;
  flex: 1 1 auto;
}

.problem-row-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.problem-row-meta {
  font-size: 14px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.problem-row-sep {
  margin: 0 6px;
  color: #9ca3af;
}

.problem-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.problem-row-tag {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  padding: 9px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.back-link:hover {
  background: #dbeafe;
  text-decoration: none;
}

.problem-detail-shell {
  display: grid;
  gap: 16px;
  transition: opacity 0.24s ease, transform 0.24s ease;
  will-change: opacity, transform;
}

.problem-detail-shell.is-animating {
  pointer-events: none;
}

.problem-detail-shell.problem-exit.problem-forward {
  opacity: 0;
  transform: translateX(-20px);
}

.problem-detail-shell.problem-exit.problem-backward {
  opacity: 0;
  transform: translateX(20px);
}

.problem-detail-shell.problem-enter.problem-forward {
  opacity: 0;
  transform: translateX(20px);
}

.problem-detail-shell.problem-enter.problem-backward {
  opacity: 0;
  transform: translateX(-20px);
}

.problem-detail-card {
  background: white;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.problem-detail-title {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.2;
}

.problem-detail-meta {
  font-size: 15px;
  color: #555;
  margin-bottom: 14px;
}

.problem-detail-section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 18px 0 10px;
}

.problem-detail-body {
  display: grid;
  gap: 22px;
}

.problem-detail-body.has-images {
  grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr);
  align-items: start;
}

.problem-detail-copy {
  min-width: 0;
}

.problem-detail-media {
  width: 100%;
  max-width: 280px;
  justify-self: end;
}

.problem-detail-media .problem-image-gallery {
  margin-top: 0;
  gap: 12px;
}

.problem-detail-media .problem-image {
  width: 100%;
  max-width: 100%;
}

.problem-detail-text {
  line-height: 1.7;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .problem-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .problem-row-title,
  .problem-row-meta {
    white-space: normal;
  }

  .problem-row-tags {
    justify-content: flex-start;
  }

  .problem-detail-title {
    font-size: 24px;
  }

  .problem-detail-body.has-images {
    grid-template-columns: 1fr;
  }

  .problem-detail-media {
    max-width: none;
    justify-self: stretch;
  }
}

.problem-page .top {
  padding: 10px 16px;
  text-align: left;
}

.problem-page .top h1 {
  margin: 0;
  font-size: 18px;
}

.problem-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.problem-nav-btn,
.problem-back-link {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.problem-nav-btn {
  background: #111827;
  color: white;
}

.problem-nav-btn:hover {
  background: #0f172a;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.problem-nav-btn.disabled {
  background: #d1d5db;
  color: #6b7280;
  pointer-events: none;
  box-shadow: none;
}

.problem-back-link {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.problem-back-link:hover {
  background: #dbeafe;
  text-decoration: none;
}

.katex-display {
  margin: 0.75em 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.problem-image-gallery {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.problem-figure {
  margin: 0;
}

.problem-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
  border: 1px solid #d1d5db;
  background: white;
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
}

.problem-figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: #555;
}

.problem-credit {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  font-size: 14px;
  color: #555;
}

:root {
  color-scheme: light;
  --theme-toggle-track: linear-gradient(135deg, #dbeafe 0%, #fde68a 100%);
  --theme-toggle-track-border: rgba(37, 99, 235, 0.18);
  --theme-toggle-thumb-bg: #ffffff;
  --theme-toggle-thumb-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
  --theme-toggle-glow-sun: rgba(245, 158, 11, 0.38);
  --theme-toggle-glow-moon: rgba(37, 99, 235, 0.18);
  --theme-toggle-sun: #f59e0b;
  --theme-toggle-moon: #1e3a8a;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --theme-toggle-track: linear-gradient(135deg, #152746 0%, #29466f 100%);
  --theme-toggle-track-border: rgba(124, 180, 255, 0.28);
  --theme-toggle-thumb-bg: #0f172a;
  --theme-toggle-thumb-shadow: 0 10px 24px rgba(2, 6, 23, 0.48);
  --theme-toggle-glow-sun: rgba(251, 191, 36, 0.18);
  --theme-toggle-glow-moon: rgba(191, 219, 254, 0.34);
  --theme-toggle-sun: #fbbf24;
  --theme-toggle-moon: #bfdbfe;
}

body,
.top,
.controls input,
.contest-select,
.expression-panel,
.topic-panel,
.secondary-btn,
.clear-btn,
.topic-input,
.topic-suggestions,
.builder-btn,
.search-btn,
.field-tab,
.topic-pill,
.problem-card,
.tag,
.solution-btn,
.solution,
.empty-state,
.invalid-state,
.problem-row,
.problem-row-title,
.problem-row-meta,
.problem-row-tag,
.back-link,
.problem-detail-card,
.problem-nav-btn,
.problem-back-link,
.problem-image,
.problem-credit,
.dual-range-track,
.dual-range-fill,
.theme-toggle-text {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.top {
  position: relative;
}

.top p {
  margin: 0;
}

.top-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 46px;
  padding-right: 0;
}

.top-copy {
  max-width: 760px;
  margin: 0 auto;
}

.theme-toggle {
  position: fixed;
  left: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  z-index: 200;
}

.theme-toggle:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 4px;
  border-radius: 999px;
}

.theme-toggle-track {
  position: relative;
  width: 54px;
  height: 28px;
  border-radius: 999px;
  background: var(--theme-toggle-track);
  border: 1px solid var(--theme-toggle-track-border);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.12);
  overflow: hidden;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.theme-toggle-glow {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translateY(-50%);
  filter: blur(1px);
  transition: background 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
}

.theme-toggle-glow-sun {
  left: 8px;
  background: var(--theme-toggle-glow-sun);
}

.theme-toggle-glow-moon {
  right: 8px;
  background: var(--theme-toggle-glow-moon);
  opacity: 0.55;
}

html[data-theme="dark"] .theme-toggle-glow-sun {
  opacity: 0.35;
  transform: translateY(-50%) scale(0.82);
}

html[data-theme="dark"] .theme-toggle-glow-moon {
  opacity: 0.95;
  transform: translateY(-50%) scale(1.08);
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--theme-toggle-thumb-bg);
  box-shadow: var(--theme-toggle-thumb-shadow);
  display: grid;
  place-items: center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.35s ease, box-shadow 0.35s ease;
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(28px);
}

.theme-toggle-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  transition: opacity 0.28s ease, transform 0.35s ease;
}

.theme-toggle-sun {
  color: var(--theme-toggle-sun);
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle-moon {
  color: var(--theme-toggle-moon);
  opacity: 0;
  transform: rotate(-45deg) scale(0.5);
}

html[data-theme="dark"] .theme-toggle-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.45);
}

html[data-theme="dark"] .theme-toggle-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.problem-page .top-inner {
  padding-right: 0;
  min-height: 36px;
}

html[data-theme="dark"] body {
  background: #0d1526;
  color: #e5edf8;
}

html[data-theme="dark"] .top {
  background: #101b31;
  color: #f8fbff;
}

html[data-theme="dark"] .top p {
  color: rgba(229, 237, 248, 0.78);
}

html[data-theme="dark"] .controls input,
html[data-theme="dark"] .contest-select,
html[data-theme="dark"] .topic-input {
  background: #14203a;
  color: #e5edf8;
  border-color: #2d4369;
}

html[data-theme="dark"] .controls input::placeholder,
html[data-theme="dark"] .topic-input::placeholder {
  color: #9cadc5;
  opacity: 0.8;
}

html[data-theme="dark"] .topic-input:focus {
  border-color: #7cb4ff;
}

html[data-theme="dark"] .topic-input.invalid {
  border-color: #f87171;
  background: #3a1f2b;
  color: #fecaca;
}

html[data-theme="dark"] .expression-panel,
html[data-theme="dark"] .topic-panel,
html[data-theme="dark"] .problem-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .invalid-state,
html[data-theme="dark"] .problem-row,
html[data-theme="dark"] .problem-detail-card {
  background: #14203a;
  border: 1px solid #223a5e;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.34);
}

html[data-theme="dark"] .topic-suggestions {
  background: #14203a;
  border-color: #35527f;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.42);
}

html[data-theme="dark"] .suggestion-item:hover,
html[data-theme="dark"] .suggestion-item.active {
  background: #1a2f51;
}

html[data-theme="dark"] .suggestion-main {
  color: #e5edf8;
}

html[data-theme="dark"] .suggestion-meta,
html[data-theme="dark"] .topic-help,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .problem-row-meta,
html[data-theme="dark"] .problem-detail-meta,
html[data-theme="dark"] .problem-figcaption,
html[data-theme="dark"] .problem-credit,
html[data-theme="dark"] .topic-status {
  color: #9cadc5;
}

html[data-theme="dark"] .topic-status.ok {
  color: #6ee7b7;
}

html[data-theme="dark"] .topic-status.error,
html[data-theme="dark"] .invalid-state {
  color: #fca5a5;
}

html[data-theme="dark"] .secondary-btn,
html[data-theme="dark"] .builder-btn,
html[data-theme="dark"] .field-tab,
html[data-theme="dark"] .topic-pill {
  background: #182640;
  color: #e5edf8;
  border-color: #2d4369;
}

html[data-theme="dark"] .secondary-btn:hover {
  background: #1c2d49;
}

html[data-theme="dark"] .builder-btn:hover,
html[data-theme="dark"] .topic-pill:hover {
  background: #203659;
  border-color: #567bb5;
}

html[data-theme="dark"] .field-tab.active {
  background: #24395d;
  color: #f8fbff;
  border-color: #24395d;
}

html[data-theme="dark"] .topic-pill.field-pill {
  background: #1c2d49;
}

html[data-theme="dark"] .clear-btn {
  background: #f87171;
}

html[data-theme="dark"] .clear-btn:hover {
  background: #ef4444;
}

html[data-theme="dark"] .difficulty-label {
  color: #e5edf8;
}

html[data-theme="dark"] .difficulty-range-text,
html[data-theme="dark"] .back-link,
html[data-theme="dark"] .problem-back-link {
  color: #7cb4ff;
}

html[data-theme="dark"] .back-link,
html[data-theme="dark"] .problem-back-link {
  background: #16253f;
  border-color: #2d4369;
}

html[data-theme="dark"] .dual-range-track {
  background: #26405f;
}

html[data-theme="dark"] .dual-range-fill {
  background: #7cb4ff;
}

html[data-theme="dark"] .range-input::-webkit-slider-thumb {
  background: #7cb4ff;
  border-color: #14203a;
}

html[data-theme="dark"] .range-input::-moz-range-thumb {
  background: #7cb4ff;
  border-color: #14203a;
}

html[data-theme="dark"] .search-btn,
html[data-theme="dark"] .problem-nav-btn {
  background: #24395d;
  color: #f8fbff;
}

html[data-theme="dark"] .search-btn:hover,
html[data-theme="dark"] .problem-nav-btn:hover {
  background: #2f4b78;
}

html[data-theme="dark"] .problem-nav-btn.disabled {
  background: #3c4f6d;
  color: #9fb0c7;
}

html[data-theme="dark"] .problem-row-title,
html[data-theme="dark"] .problem-detail-section-title {
  color: #f8fbff;
}

html[data-theme="dark"] .problem-row-sep {
  color: #6f84a3;
}

html[data-theme="dark"] .tag,
html[data-theme="dark"] .problem-row-tag {
  background: #1a2f51;
  color: #d3e5ff;
}

html[data-theme="dark"] .solution-btn {
  background: #7cb4ff;
  color: #0f172a;
}

html[data-theme="dark"] .solution-btn:hover {
  background: #9bc7ff;
}

html[data-theme="dark"] .solution {
  background: #1a2d4d;
}

html[data-theme="dark"] .problem-row:hover {
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.42);
}

html[data-theme="dark"] .pagination-btn,
html[data-theme="dark"] .pagination-jump-input {
  background: #182640;
  color: #e5edf8;
  border-color: #2d4369;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.28);
}

html[data-theme="dark"] .pagination-btn:hover:not(:disabled) {
  background: #203659;
  border-color: #567bb5;
}

html[data-theme="dark"] .pagination-page.is-current {
  background: #24395d;
  border-color: #24395d;
  color: #f8fbff;
}

html[data-theme="dark"] .pagination-jump-input:focus {
  border-color: #7cb4ff;
  box-shadow: 0 0 0 3px rgba(124, 180, 255, 0.16);
}

html[data-theme="dark"] .problem-image {
  background: #eef6ff;
  border-color: #35527f;
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.32);
  filter: brightness(0.78) contrast(1.04) saturate(0.92);
}

html[data-theme="dark"] .choice-image {
  filter: brightness(0.78) contrast(1.04) saturate(0.92);
}

html[data-theme="dark"] .problem-credit {
  border-top-color: #26405f;
}

.problem-row {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

@media (max-width: 700px) {
  .theme-toggle {
    left: 14px;
    bottom: 14px;
  }
}

.top-link {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: white;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.top-link:hover {
  background: rgba(255, 255, 255, 0.22);
}

.home-page {
  font-family: "Manrope", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 212, 127, 0.42), transparent 30%),
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.24), transparent 34%),
    linear-gradient(180deg, #fff9ef 0%, #eef4ff 38%, #f6f9ff 100%);
  color: #132033;
  overflow-x: hidden;
}

.home-page h1,
.home-page h2,
.home-page h3,
.home-page .home-brand {
  font-family: "Space Grotesk", "Manrope", Arial, sans-serif;
}

.home-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.home-hero {
  position: relative;
  padding: 28px 0 54px;
}

.home-hero::before,
.home-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.home-hero::before {
  width: 320px;
  height: 320px;
  top: -110px;
  right: -60px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 68%);
}

.home-hero::after {
  width: 260px;
  height: 260px;
  bottom: -40px;
  left: -90px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18), transparent 70%);
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 54px;
}

.home-brand,
.home-nav-link,
.hero-btn,
.search-preview-cta,
.highlight-card,
.hero-mini-card,
.search-preview-card,
.search-preview-input,
.preview-token,
.quick-start-panel,
.shortcut-card,
.top-link {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.25s ease;
}

.home-brand {
  color: #132033;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.home-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: #132033;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(19, 32, 51, 0.08);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.12);
  backdrop-filter: blur(12px);
}

.home-nav-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(37, 99, 235, 0.18);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: 32px;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-eyebrow,
.section-kicker,
.shortcut-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 18px;
  max-width: 10ch;
  font-size: clamp(3.1rem, 6vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 640px;
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.7;
  color: #42536a;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-btn-primary {
  color: white;
  background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.26);
}

.hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 46px rgba(37, 99, 235, 0.32);
}

.hero-btn-secondary {
  color: #173055;
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(37, 99, 235, 0.14);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.hero-btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.84);
}

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

.hero-mini-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(12px);
}

.hero-mini-card strong {
  font-size: 15px;
}

.hero-mini-card span {
  color: #4b5f79;
  font-size: 14px;
  line-height: 1.55;
}

.hero-mini-card code {
  font-family: "Space Grotesk", monospace;
  font-size: 0.95em;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  padding: 1px 6px;
  border-radius: 999px;
}

.hero-preview {
  display: flex;
  justify-content: flex-end;
}

.search-preview-card {
  width: min(100%, 420px);
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(241, 246, 255, 0.96)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0));
  box-shadow: 0 32px 54px rgba(37, 99, 235, 0.16);
  backdrop-filter: blur(18px);
  animation: homeFloat 6s ease-in-out infinite;
}

.search-preview-top,
.quick-start-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-preview-top {
  margin-bottom: 18px;
}

.search-preview-badge,
.search-preview-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.search-preview-badge {
  color: #eff6ff;
  background: #173055;
}

.search-preview-note {
  color: #1d4ed8;
  background: rgba(191, 219, 254, 0.72);
}

.search-preview-block {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.search-preview-label {
  color: #5b6e87;
  font-size: 13px;
  font-weight: 700;
}

.search-preview-input,
.search-preview-expression {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.search-preview-input {
  display: flex;
  align-items: center;
  font-weight: 700;
}

.search-preview-expression {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-token,
.preview-operator {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.preview-token {
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.9);
}

.preview-operator {
  color: #173055;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.search-preview-slider {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(191, 219, 254, 0.64);
  overflow: hidden;
}

.search-preview-slider-fill {
  position: absolute;
  top: 0;
  left: 16%;
  width: 58%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d4ed8, #60a5fa);
}

.search-preview-range {
  color: #4b5f79;
  font-size: 14px;
  font-weight: 700;
}

.search-preview-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #173055 0%, #2563eb 100%);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.22);
}

.search-preview-cta:hover {
  transform: translateY(-2px);
}

.home-main {
  padding: 8px 0 88px;
}

.home-section {
  margin-top: 28px;
}

.home-section-heading {
  margin-bottom: 20px;
}

.home-section-heading h2,
.quick-start-copy h2 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

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

.highlight-card,
.shortcut-card,
.quick-start-panel {
  border-radius: 24px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.highlight-card {
  padding: 22px;
}

.highlight-card:hover,
.shortcut-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 50px rgba(37, 99, 235, 0.14);
}

.highlight-number {
  margin: 0 0 12px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.highlight-card h3,
.shortcut-card strong {
  display: block;
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.highlight-card p:last-child,
.quick-start-copy p,
.shortcut-card span:last-child {
  margin: 0;
  color: #4b5f79;
  line-height: 1.65;
}

.quick-start-panel {
  padding: 26px;
  margin-bottom: 18px;
}

.quick-start-copy p {
  max-width: 620px;
}

.quick-start-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.shortcut-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
}

@keyframes homeFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

html[data-theme="dark"] .top-link {
  color: #e5edf8;
  background: rgba(20, 32, 58, 0.82);
  border-color: rgba(124, 180, 255, 0.16);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.3);
}

html[data-theme="dark"] .top-link:hover {
  background: rgba(29, 47, 82, 0.94);
}

html[data-theme="dark"] .home-page {
  background:
    radial-gradient(circle at top left, rgba(250, 204, 21, 0.1), transparent 28%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 34%),
    linear-gradient(180deg, #0d1526 0%, #111c31 44%, #0d1728 100%);
  color: #e5edf8;
}

html[data-theme="dark"] .home-brand,
html[data-theme="dark"] .home-section-heading h2,
html[data-theme="dark"] .quick-start-copy h2,
html[data-theme="dark"] .highlight-card h3,
html[data-theme="dark"] .shortcut-card strong,
html[data-theme="dark"] .hero-title {
  color: #f8fbff;
}

html[data-theme="dark"] .hero-text,
html[data-theme="dark"] .hero-mini-card span,
html[data-theme="dark"] .quick-start-copy p,
html[data-theme="dark"] .highlight-card p:last-child,
html[data-theme="dark"] .shortcut-card span:last-child,
html[data-theme="dark"] .search-preview-range,
html[data-theme="dark"] .search-preview-label {
  color: #9cadc5;
}

html[data-theme="dark"] .hero-eyebrow,
html[data-theme="dark"] .section-kicker,
html[data-theme="dark"] .shortcut-label {
  color: #8ec5ff;
}

html[data-theme="dark"] .home-nav-link,
html[data-theme="dark"] .hero-btn-secondary,
html[data-theme="dark"] .hero-mini-card,
html[data-theme="dark"] .search-preview-card,
html[data-theme="dark"] .search-preview-input,
html[data-theme="dark"] .search-preview-expression,
html[data-theme="dark"] .highlight-card,
html[data-theme="dark"] .quick-start-panel,
html[data-theme="dark"] .shortcut-card {
  background: rgba(20, 32, 58, 0.82);
  border-color: rgba(124, 180, 255, 0.14);
  box-shadow: 0 24px 44px rgba(2, 6, 23, 0.3);
}

html[data-theme="dark"] .home-nav-link,
html[data-theme="dark"] .hero-btn-secondary,
html[data-theme="dark"] .search-preview-note {
  color: #d3e5ff;
}

html[data-theme="dark"] .hero-btn-primary,
html[data-theme="dark"] .search-preview-cta {
  background: linear-gradient(135deg, #24395d 0%, #4b84d6 100%);
  box-shadow: 0 20px 40px rgba(3, 10, 24, 0.34);
}

html[data-theme="dark"] .hero-btn-primary:hover,
html[data-theme="dark"] .search-preview-cta:hover,
html[data-theme="dark"] .home-nav-link:hover,
html[data-theme="dark"] .hero-btn-secondary:hover,
html[data-theme="dark"] .highlight-card:hover,
html[data-theme="dark"] .shortcut-card:hover {
  box-shadow: 0 28px 48px rgba(2, 6, 23, 0.38);
}

html[data-theme="dark"] .hero-mini-card code,
html[data-theme="dark"] .preview-token {
  color: #d3e5ff;
  background: rgba(59, 130, 246, 0.18);
}

html[data-theme="dark"] .preview-operator {
  color: #e5edf8;
  background: rgba(24, 38, 64, 0.9);
  border-color: rgba(124, 180, 255, 0.14);
}

html[data-theme="dark"] .search-preview-badge {
  background: #7cb4ff;
  color: #0f172a;
}

html[data-theme="dark"] .search-preview-note {
  background: rgba(36, 57, 93, 0.92);
}

html[data-theme="dark"] .search-preview-slider {
  background: rgba(36, 57, 93, 0.88);
}

html[data-theme="dark"] .search-preview-slider-fill {
  background: linear-gradient(90deg, #7cb4ff, #4b84d6);
}

@media (max-width: 960px) {
  .hero-grid,
  .highlight-grid,
  .shortcut-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    max-width: none;
  }

  .hero-preview {
    justify-content: stretch;
  }

  .search-preview-card {
    width: 100%;
  }

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

  .quick-start-panel {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .search-page .top-inner,
  .problem-page .top-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .search-page .top-copy,
  .problem-page .top-copy {
    margin: 0;
  }

  .top-link {
    position: static;
    transform: none;
  }

  .home-hero {
    padding-top: 20px;
  }

  .home-nav {
    margin-bottom: 28px;
  }

  .hero-title {
    font-size: clamp(2.5rem, 15vw, 4rem);
  }

  .hero-actions,
  .quick-start-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-btn {
    width: 100%;
  }

  .search-preview-card,
  .highlight-card,
  .quick-start-panel,
  .shortcut-card {
    border-radius: 22px;
  }
}

.site-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo {
  display: block;
  height: 84px;
  max-width: 420px;
  width: auto;
  object-fit: contain;
}

.site-logo-home {
  height: 96px;
  max-width: 480px;
}

.search-page .top,
.problem-page .top {
  padding: 18px 20px;
  text-align: left;
}

.search-page .top-inner,
.problem-page .top-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 84px;
}

.page-header-copy {
  display: grid;
  gap: 2px;
}

.page-header-eyebrow,
.page-header-description {
  margin: 0;
}

.page-header-eyebrow {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.page-header-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
}

.home-page {
  background: #f4f7fb;
  color: #132033;
}

.home-header {
  padding: 22px 0 10px;
}

.home-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-nav-btn,
.home-action-btn,
.home-link-card,
.home-summary-card,
.home-note-panel,
.home-hero-copy-simple {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.22s ease;
}

.home-nav-btn,
.home-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 800;
}

.home-nav-btn {
  color: #173055;
  background: #ffffff;
  border-color: #d8e1ef;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.home-nav-btn:hover,
.home-link-card:hover {
  transform: translateY(-2px);
}

.home-main-simple {
  padding: 12px 0 78px;
}

.home-hero-simple {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 380px);
  gap: 22px;
  align-items: start;
  padding: 18px 0 10px;
}

.home-hero-copy-simple,
.home-summary-card,
.home-link-card,
.home-note-panel {
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.home-hero-copy-simple {
  padding: 34px;
}

.home-kicker {
  margin: 0 0 14px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-title-simple,
.home-section-heading-simple h2,
.home-note-panel h2,
.home-summary-card h2 {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", Arial, sans-serif;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.home-title-simple {
  max-width: 12ch;
  font-size: clamp(2.7rem, 5vw, 4.4rem);
  margin-bottom: 16px;
}

.home-intro-simple {
  max-width: 700px;
  margin: 0 0 22px;
  color: #4b5f79;
  font-size: 17px;
  line-height: 1.7;
}

.home-primary-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.home-action-btn-primary {
  color: white;
  background: #173055;
  box-shadow: 0 14px 30px rgba(23, 48, 85, 0.2);
}

.home-action-btn-primary:hover {
  transform: translateY(-2px);
  background: #1e3a63;
}

.home-action-btn-secondary {
  color: #173055;
  background: #edf4ff;
  border-color: #cfe0fb;
}

.home-action-btn-secondary:hover {
  transform: translateY(-2px);
  background: #e2edff;
}

.home-summary-card {
  padding: 28px;
}

.home-summary-card h2 {
  margin-bottom: 14px;
  font-size: 30px;
}

.home-summary-list {
  margin: 0;
  padding-left: 20px;
  color: #4b5f79;
  line-height: 1.75;
}

.home-summary-list code {
  font-family: "Space Grotesk", monospace;
  color: #1d4ed8;
}

.home-section-simple {
  margin-top: 24px;
}

.home-section-heading-simple {
  margin-bottom: 16px;
}

.home-section-heading-simple h2,
.home-note-panel h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  max-width: 15ch;
}

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

.home-link-card {
  display: grid;
  gap: 10px;
  padding: 24px;
  color: inherit;
  text-decoration: none;
}

.home-link-card strong {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.home-link-card p {
  margin: 0;
  color: #4b5f79;
  line-height: 1.65;
}

.home-link-card-static {
  cursor: default;
}

.home-link-card-static:hover {
  transform: none;
}

.home-link-label {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-note-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
}

.home-note-panel p {
  margin: 12px 0 0;
  color: #4b5f79;
  line-height: 1.65;
}

.home-guide-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: 24px;
  align-items: center;
  padding: 30px;
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.home-guide-copy h2 {
  max-width: 18ch;
  margin: 0;
  font-family: "Space Grotesk", "Manrope", Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.home-guide-copy p:not(.home-kicker) {
  max-width: 680px;
  margin: 14px 0 0;
  color: #4b5f79;
  font-size: 17px;
  line-height: 1.7;
}

.home-guide-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

html[data-theme="dark"] .page-header-eyebrow {
  color: #bfdbfe;
}

html[data-theme="dark"] .page-header-description {
  color: #dbe7f8;
}

html[data-theme="dark"] .home-page {
  background: #0d1526;
  color: #e5edf8;
}

html[data-theme="dark"] .home-nav-btn,
html[data-theme="dark"] .home-hero-copy-simple,
html[data-theme="dark"] .home-summary-card,
html[data-theme="dark"] .home-link-card,
html[data-theme="dark"] .home-note-panel,
html[data-theme="dark"] .home-guide-panel {
  background: #14203a;
  border-color: #223a5e;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.28);
}

html[data-theme="dark"] .home-nav-btn,
html[data-theme="dark"] .home-action-btn-secondary {
  color: #d3e5ff;
}

html[data-theme="dark"] .home-action-btn-primary {
  background: #7cb4ff;
  color: #0f172a;
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.28);
}

html[data-theme="dark"] .home-action-btn-primary:hover {
  background: #9bc7ff;
}

html[data-theme="dark"] .home-action-btn-secondary {
  background: #1a2f51;
  border-color: #35527f;
}

html[data-theme="dark"] .home-action-btn-secondary:hover {
  background: #203659;
}

html[data-theme="dark"] .home-kicker,
html[data-theme="dark"] .home-link-label {
  color: #8ec5ff;
}

html[data-theme="dark"] .home-intro-simple,
html[data-theme="dark"] .home-summary-list,
html[data-theme="dark"] .home-link-card p,
html[data-theme="dark"] .home-note-panel p,
html[data-theme="dark"] .home-guide-copy p:not(.home-kicker) {
  color: #9cadc5;
}

html[data-theme="dark"] .home-summary-list code {
  color: #bfdbfe;
}

@media (max-width: 900px) {
  .home-hero-simple,
  .home-link-grid {
    grid-template-columns: 1fr;
  }

  .home-note-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-guide-panel {
    grid-template-columns: 1fr;
  }

  .home-guide-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .site-logo {
    height: 50px;
    max-width: 252px;
  }

  .site-logo-home {
    height: 58px;
    max-width: 288px;
  }

  .page-header-copy {
    gap: 4px;
  }

  .page-header-description {
    font-size: 13px;
  }

  .home-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-hero-copy-simple,
  .home-summary-card,
  .home-link-card,
  .home-note-panel,
  .home-guide-panel {
    border-radius: 20px;
  }

  .home-hero-copy-simple,
  .home-summary-card,
  .home-link-card,
  .home-note-panel,
  .home-guide-panel {
    padding: 22px;
  }

  .home-primary-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .home-action-btn,
  .home-nav-btn,
  .home-guide-actions .home-action-btn {
    width: 100%;
  }
}

.contest-info-page {
  --contest-section-bg: #ffffff;
  --contest-section-border: #d8e1ef;
  --contest-section-shadow: 0 20px 46px rgba(15, 23, 42, 0.08);
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 6%, rgba(96, 165, 250, 0.18), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(250, 204, 21, 0.12), transparent 26%),
    linear-gradient(180deg, #f4f7fb 0%, #eaf1fb 100%);
  color: #132033;
}

html:has(.contest-info-page) {
  scroll-behavior: smooth;
}

.contest-info-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.contest-info-header {
  padding: 22px 0 10px;
}

.contest-info-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.contest-info-header-actions,
.contest-guide-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.contest-info-main {
  padding: 12px 0 86px;
}

.contest-guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 22px;
  align-items: stretch;
}

.contest-guide-copy,
.contest-guide-panel,
.contest-table-wrap,
.contest-info-card {
  background: var(--contest-section-bg);
  border: 1px solid var(--contest-section-border);
  border-radius: 26px;
  box-shadow: var(--contest-section-shadow);
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.22s ease;
}

.contest-guide-copy {
  padding: 38px;
}

.contest-guide-copy h1,
.contest-section-heading h2,
.contest-info-card h2 {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", Arial, sans-serif;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.contest-guide-copy h1 {
  max-width: 12ch;
  margin-bottom: 16px;
  font-size: clamp(2.8rem, 5.6vw, 5rem);
}

.contest-guide-copy p:not(.home-kicker) {
  margin: 0;
  color: #4b5f79;
  font-size: 17px;
  line-height: 1.7;
}

.contest-guide-copy p:not(.home-kicker) {
  max-width: 720px;
  margin-bottom: 24px;
}

.contest-guide-panel {
  display: grid;
  align-content: space-between;
  gap: 22px;
  padding: 30px;
  overflow: hidden;
  position: relative;
}

.contest-guide-panel::before {
  content: "";
  position: absolute;
  inset: auto -42px -54px auto;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.2), transparent 68%);
}

.contest-guide-note::before {
  display: none;
}

.contest-guide-note {
  align-content: center;
}

.contest-guide-note h2 {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.contest-guide-note p:not(.home-kicker) {
  margin: 0;
  color: #4b5f79;
  font-size: 17px;
  line-height: 1.7;
}

.contest-section-heading h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.55rem);
}

.contest-overview-section {
  margin-top: 28px;
}

.contest-section-heading {
  margin-bottom: 16px;
}

.contest-section-heading h2 {
  max-width: none;
}

.contest-table-wrap {
  overflow-x: auto;
}

.contest-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.contest-table th,
.contest-table td {
  padding: 18px;
  text-align: left;
  border-bottom: 1px solid #d8e1ef;
  vertical-align: top;
}

.contest-table th {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contest-table td {
  color: #4b5f79;
  line-height: 1.55;
}

.contest-table td:first-child {
  color: #132033;
  font-weight: 800;
}

.contest-table-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid rgba(37, 99, 235, 0.28);
}

.contest-table-link:hover {
  color: #2563eb;
  border-bottom-color: currentColor;
}

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

.contest-card-grid {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.contest-info-card {
  padding: 28px;
  scroll-margin-top: 24px;
}

.contest-info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 52px rgba(37, 99, 235, 0.12);
}

.contest-info-card-featured {
  border-color: var(--contest-section-border);
  background: var(--contest-section-bg);
}

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

.contest-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.contest-info-card h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.contest-card-search-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: #173055;
  background: #edf4ff;
  border: 1px solid #cfe0fb;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.contest-card-search-link:hover {
  transform: translateY(-1px);
  background: #dceaff;
}

.contest-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.contest-chip-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  font-weight: 800;
}

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

.contest-detail-grid div {
  padding: 16px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid #e2eaf5;
}

.contest-detail-grid dt {
  margin-bottom: 7px;
  color: #173055;
  font-weight: 900;
}

.contest-detail-grid dd {
  margin: 0;
  color: #4b5f79;
  line-height: 1.65;
}

html[data-theme="dark"] .contest-info-page {
  --contest-section-bg: #14203a;
  --contest-section-border: #223a5e;
  --contest-section-shadow: 0 20px 46px rgba(2, 6, 23, 0.34);
  background:
    radial-gradient(circle at 8% 6%, rgba(59, 130, 246, 0.18), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(124, 180, 255, 0.11), transparent 26%),
    linear-gradient(180deg, #0d1526 0%, #111c31 100%);
  color: #e5edf8;
}

html[data-theme="dark"] .contest-guide-copy,
html[data-theme="dark"] .contest-guide-panel,
html[data-theme="dark"] .contest-table-wrap,
html[data-theme="dark"] .contest-info-card {
  background: var(--contest-section-bg);
  border-color: var(--contest-section-border);
  box-shadow: var(--contest-section-shadow);
}

html[data-theme="dark"] .contest-info-card-featured {
  background: var(--contest-section-bg);
  border-color: var(--contest-section-border);
}

html[data-theme="dark"] .contest-guide-copy p:not(.home-kicker),
html[data-theme="dark"] .contest-guide-note p:not(.home-kicker),
html[data-theme="dark"] .contest-table td,
html[data-theme="dark"] .contest-detail-grid dd {
  color: #9cadc5;
}

html[data-theme="dark"] .contest-table th {
  color: #8ec5ff;
}

html[data-theme="dark"] .contest-detail-grid div {
  background: rgba(24, 38, 64, 0.88);
  border-color: rgba(124, 180, 255, 0.16);
}

html[data-theme="dark"] .contest-table td:first-child,
html[data-theme="dark"] .contest-detail-grid dt {
  color: #f8fbff;
}

html[data-theme="dark"] .contest-table-link:hover {
  color: #8ec5ff;
}

html[data-theme="dark"] .contest-table th,
html[data-theme="dark"] .contest-table td {
  border-bottom-color: rgba(124, 180, 255, 0.16);
}

html[data-theme="dark"] .contest-card-search-link {
  color: #d3e5ff;
  background: #1a2f51;
  border-color: #35527f;
}

html[data-theme="dark"] .contest-card-search-link:hover {
  background: #203659;
}

html[data-theme="dark"] .contest-chip-row span {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(124, 180, 255, 0.22);
}

@media (max-width: 900px) {
  .contest-guide-hero {
    grid-template-columns: 1fr;
  }

  .contest-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .contest-info-header-inner,
  .contest-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .contest-info-header-actions,
  .contest-guide-actions,
  .contest-card-actions {
    width: 100%;
  }

  .contest-info-header-actions .home-nav-btn,
  .contest-guide-actions .home-action-btn,
  .contest-card-actions .contest-card-search-link,
  .contest-card-search-link {
    width: 100%;
  }

  .contest-guide-copy,
  .contest-guide-panel,
  .contest-info-card {
    padding: 22px;
    border-radius: 20px;
  }
}
