@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;
}

.login-nudge {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(620px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 10px 12px 10px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  color: #172033;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  transform: translateX(-50%);
  animation: loginNudgeSlideDown 260ms ease-out both;
}

.login-nudge-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.login-nudge-copy strong {
  font-size: 14px;
  line-height: 1.2;
}

.login-nudge-copy span {
  font-size: 13px;
  line-height: 1.35;
  color: #475569;
}

.login-nudge-link {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.login-nudge-link:hover {
  background: #1d4ed8;
}

.login-nudge-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid #d8e1ef;
  border-radius: 50%;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.login-nudge-close:hover {
  background: #eaf1fb;
}

@keyframes loginNudgeSlideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -125%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.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: 0;
  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: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  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 {
  display: block;
  margin: 0 0 14px;
  color: #555;
  font-size: 14px;
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-select-wrap {
  display: none;
  flex: 1 1 320px;
  max-width: 440px;
  margin-top: 14px;
}

.topic-select {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: 0 40px 0 12px;
  border: 1px solid #cfd4dc;
  border-radius: 10px;
  background:
    linear-gradient(45deg, transparent 50%, #64748b 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #64748b 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    #ffffff;
  color: #132033;
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
}

.topic-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

.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;
}

.saved-filter-btn {
  border: 1px solid #cfd4dc;
  background: white;
  color: #111827;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.saved-filter-btn:hover {
  background: #f3f4f6;
}

.saved-filter-btn.is-active,
.saved-filter-btn[aria-pressed="true"] {
  background: #111827;
  border-color: #111827;
  color: white;
}

.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;
}

.problem-topic-tags {
  margin-top: 10px;
  margin-bottom: 0;
}

.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) {
  .login-nudge {
    position: static;
    align-items: flex-start;
    gap: 8px;
    width: calc(100% - 24px);
    margin: 12px auto 0;
    padding: 10px;
    transform: none;
    animation: none;
  }

  .login-nudge-copy span {
    font-size: 12px;
  }

  .login-nudge-link {
    min-height: 32px;
    padding: 0 10px;
  }

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

  .expression-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .saved-filter-btn,
  .clear-btn {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .difficulty-label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .topic-top-buttons {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 8px;
  }

  .field-tabs,
  .topic-pills {
    display: none;
  }

  .topic-select-wrap {
    display: block;
    flex: none;
    width: 100%;
    max-width: none;
    margin-top: 10px;
  }

  .topic-select {
    min-height: 40px;
    font-size: 14px;
  }

  .operator-row {
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    margin-left: 0;
    margin-top: 8px;
    gap: 7px;
    padding-bottom: 0;
  }

  .field-tab,
  .topic-pill,
  .builder-btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
    line-height: 1.2;
  }

  .topic-help {
    display: none;
  }

  .topic-pills {
    gap: 7px;
    padding-bottom: 6px;
  }

  .topic-input {
    min-height: 44px;
    padding: 10px 12px;
  }

  .problem-detail-nav {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .problem-detail-nav > * {
    min-width: 0;
  }

  .problem-nav-btn,
  .problem-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    box-sizing: border-box;
    padding: 5px 8px;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
  }

  .problem-nav-btn {
    flex: 0.9 1 0;
  }

  .problem-back-link {
    flex: 1.2 1 0;
  }
}

@media (max-width: 360px) {
  .problem-detail-nav {
    gap: 6px;
  }

  .problem-nav-btn,
  .problem-back-link {
    min-height: 32px;
    padding: 4px 5px;
    font-size: 12px;
  }
}

.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-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

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

.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-meta-link {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.problem-detail-meta-link:hover {
  color: #2563eb;
}

.problem-mark-panel {
  display: grid;
  justify-items: end;
  gap: 8px;
  margin-top: 0;
}

.problem-mark-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.problem-report-open-btn {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  background: #f9fafb;
  color: #173055;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.problem-report-open-btn:hover {
  background: #edf4ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.problem-mark-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #cfd4dc;
  border-radius: 12px;
  background: #f9fafb;
  color: #173055;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.problem-mark-btn:hover {
  background: #edf4ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.problem-mark-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 12;
  min-width: max-content;
  padding: 7px 9px;
  border-radius: 8px;
  background: #111827;
  color: white;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2px);
}

.problem-mark-btn.is-tooltip-visible::after,
.problem-mark-btn:focus-visible:not(.is-tooltip-hidden)::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.problem-mark-btn.is-tooltip-hidden::after {
  opacity: 0;
  transform: translate(-50%, -2px);
}

.problem-mark-btn[data-tooltip=""]::after {
  display: none;
}

.problem-mark-btn:disabled {
  cursor: default;
  transform: none;
}

.problem-mark-btn.is-mark-settling {
  transition: none;
}

.problem-mark-btn[data-problem-mark-kind="favorite"].is-active {
  background: #fbbf24;
  border-color: #f59e0b;
  color: #111827;
}

.problem-mark-btn[data-problem-mark-kind="solved"].is-active {
  background: #16a34a;
  border-color: #15803d;
  color: white;
}

.problem-mark-message {
  max-width: 190px;
  min-height: 18px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.problem-mark-message:empty {
  min-height: 0;
  margin-bottom: 0;
}

.problem-mark-message[data-message-type="success"] {
  color: #166534;
}

.problem-mark-message[data-message-type="error"] {
  color: #b91c1c;
}

.problem-mark-message a {
  color: inherit;
  text-decoration: underline;
}

body.is-problem-report-open {
  overflow: hidden;
}

.problem-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
}

.problem-report-overlay[hidden] {
  display: none;
}

.problem-report-modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  box-sizing: border-box;
  border-radius: 8px;
  background: white;
  color: #172033;
  padding: 22px;
  font-family: Arial, sans-serif;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

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

.problem-report-head h2 {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.problem-report-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid #d7dde6;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.problem-report-close:hover {
  background: #edf4ff;
  border-color: #93c5fd;
}

.problem-report-copy {
  margin: 0 0 16px;
  color: #475569;
  line-height: 1.45;
}

.problem-report-reasons {
  display: grid;
  gap: 10px;
}

.problem-report-reason {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d7dde6;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.problem-report-reason:hover {
  background: #edf4ff;
  border-color: #93c5fd;
}

.problem-report-form {
  display: grid;
  gap: 10px;
}

.problem-report-label {
  color: #172033;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.problem-report-textarea {
  width: 100%;
  min-height: 170px;
  box-sizing: border-box;
  resize: vertical;
  padding: 12px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: white;
  color: #172033;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
}

.problem-report-textarea:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.problem-report-form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.problem-report-back {
  border: 0;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
}

.problem-report-back:hover {
  text-decoration: underline;
}

.problem-report-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.problem-report-submit {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #173055;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.problem-report-submit:hover {
  background: #24456f;
}

.problem-report-submit:disabled {
  cursor: progress;
  opacity: 0.68;
}

.problem-report-status {
  min-height: 18px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.problem-report-status:empty {
  min-height: 0;
}

.problem-report-status[data-message-type="error"] {
  color: #b91c1c;
}

body.is-site-feedback-open {
  overflow: hidden;
}

.site-feedback-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  display: grid;
  justify-items: end;
  gap: 8px;
  font-family: "Manrope", Arial, sans-serif;
}

.site-feedback-toggle {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  background: #173055;
  color: white;
  cursor: pointer;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.site-feedback-toggle:hover,
.site-feedback-toggle[aria-expanded="true"] {
  background: #24456f;
}

.site-feedback-menu {
  display: grid;
  gap: 6px;
  min-width: 190px;
  padding: 8px;
  border: 1px solid #d8e1ef;
  border-radius: 12px;
  background: white;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  font-family: "Manrope", Arial, sans-serif;
}

.site-feedback-menu[hidden] {
  display: none;
}

.site-feedback-menu button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #173055;
  cursor: pointer;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.site-feedback-menu button:hover {
  background: #edf4ff;
}

.site-feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
}

.site-feedback-modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  box-sizing: border-box;
  padding: 22px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: white;
  color: #172033;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  font-family: "Manrope", Arial, sans-serif;
}

.site-feedback-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.site-feedback-kicker {
  margin: 0;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-feedback-head h2 {
  margin: 4px 0 0;
  color: #172033;
  font-size: 26px;
  line-height: 1.2;
}

.site-feedback-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid #d7dde6;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.site-feedback-close:hover {
  background: #edf4ff;
  border-color: #93c5fd;
}

.site-feedback-copy {
  margin: 0 0 16px;
  color: #5f7089;
  line-height: 1.5;
}

.site-feedback-form {
  display: grid;
  gap: 10px;
}

.site-feedback-label {
  color: #173055;
  font-weight: 800;
}

.site-feedback-label span {
  color: #5f7089;
  font-size: 13px;
  font-weight: 700;
}

.site-feedback-textarea,
.site-feedback-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #f8fbff;
  color: #172033;
  font: inherit;
}

.site-feedback-textarea {
  min-height: 150px;
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

.site-feedback-input {
  min-height: 42px;
  padding: 0 12px;
}

.site-feedback-textarea:focus,
.site-feedback-input:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.site-feedback-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.site-feedback-form-meta {
  display: flex;
  justify-content: flex-end;
  color: #5f7089;
  font-size: 13px;
  font-weight: 700;
}

.site-feedback-status {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.site-feedback-status:empty {
  display: none;
}

.site-feedback-status[data-message-type="success"] {
  color: #047857;
}

.site-feedback-status[data-message-type="error"] {
  color: #b91c1c;
}

.site-feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.site-feedback-secondary,
.site-feedback-submit {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.site-feedback-secondary {
  border: 1px solid #d8e1ef;
  background: #f8fbff;
  color: #173055;
}

.site-feedback-submit {
  border: 0;
  background: #173055;
  color: white;
}

.site-feedback-secondary:hover {
  background: #edf4ff;
  border-color: #93c5fd;
}

.site-feedback-submit:hover {
  background: #24456f;
}

.site-feedback-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.site-feedback-contact-list {
  display: grid;
  gap: 10px;
}

.site-feedback-contact-list a,
.site-feedback-contact-list span {
  display: block;
  padding: 12px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
  color: #173055;
  font-weight: 800;
  text-decoration: none;
}

.site-feedback-contact-list a:hover {
  background: #edf4ff;
  border-color: #93c5fd;
}

.practice-container,
.practice-test-container {
  display: grid;
  gap: 22px;
}

.practice-test-container {
  gap: 14px;
}

.practice-test-container > .back-link {
  margin-bottom: 0;
}

.practice-intro,
.practice-panel,
.practice-test-toolbar,
.practice-problem-card,
.practice-result-banner {
  background: white;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.practice-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.practice-intro h1 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 32px;
  line-height: 1.15;
}

.practice-intro p,
.practice-muted {
  margin: 0;
  color: #5f7089;
  line-height: 1.5;
}

.practice-panel {
  padding: 20px;
}

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

.practice-section-heading h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  line-height: 1.2;
}

.practice-section-heading .practice-muted {
  font-size: 14px;
  text-align: right;
}

.practice-contest-grid,
.practice-year-grid,
.practice-ongoing-list {
  display: grid;
  gap: 12px;
}

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

.practice-year-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.practice-year-section-list {
  display: grid;
  gap: 18px;
}

.practice-year-section {
  display: grid;
  gap: 10px;
}

.practice-year-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.practice-year-section-head h3 {
  margin: 0;
  color: #172033;
  font-size: 17px;
  line-height: 1.2;
}

.practice-year-section-head span {
  color: #5f7089;
  font-size: 13px;
  font-weight: 800;
}

.practice-contest-card,
.practice-year-card,
.practice-ongoing-card {
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
  color: #172033;
}

.practice-contest-card,
.practice-year-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.practice-contest-card:hover,
.practice-year-card:hover {
  background: #edf4ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.practice-contest-card:disabled,
.practice-contest-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.practice-contest-card:disabled:hover,
.practice-contest-card.is-disabled:hover {
  background: #f8fbff;
  border-color: #d8e1ef;
  transform: none;
}

.practice-contest-card strong,
.practice-year-card strong {
  font-size: 22px;
  line-height: 1.15;
}

.practice-year-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.practice-year-card-title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.practice-year-edition {
  white-space: nowrap;
}

.practice-complete-check {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #16a34a;
  color: white;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.practice-complete-check::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: 180px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #111827;
  color: white;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.practice-complete-check:hover::after {
  opacity: 1;
}

.practice-contest-card span,
.practice-year-card span {
  color: #5f7089;
  font-size: 14px;
  font-weight: 700;
}

.practice-year-card .practice-complete-check {
  color: white;
  font-size: 16px;
  font-weight: 900;
}

.practice-kicker {
  margin: 0;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.practice-year-panel {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #d8e1ef;
}

.practice-ongoing-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}

.practice-ongoing-card h3 {
  margin: 0 0 4px;
  color: #172033;
  font-size: 18px;
}

.practice-ongoing-card p {
  margin: 0;
  color: #5f7089;
  font-size: 14px;
  line-height: 1.4;
}

.practice-ongoing-actions,
.practice-bottom-actions,
.practice-setup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.practice-primary-link,
.practice-secondary-link,
.practice-submit-btn,
.practice-small-btn,
.practice-text-btn {
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.practice-primary-link,
.practice-submit-btn {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  background: #173055;
  color: white;
  cursor: pointer;
}

.practice-primary-link:hover,
.practice-submit-btn:hover {
  background: #24456f;
}

.practice-secondary-link {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d8e1ef;
  background: #f8fbff;
  color: #173055;
}

.practice-text-btn,
.practice-small-btn {
  border: 1px solid #d8e1ef;
  background: #f8fbff;
  color: #173055;
  cursor: pointer;
}

.practice-text-btn {
  min-height: 42px;
  padding: 0 12px;
}

.practice-small-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.practice-text-btn:hover,
.practice-small-btn:hover,
.practice-secondary-link:hover {
  background: #edf4ff;
  border-color: #93c5fd;
}

.practice-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
}

.practice-modal-overlay[hidden] {
  display: none;
}

.practice-setup-modal {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  box-sizing: border-box;
  padding: 22px;
  border-radius: 8px;
  background: white;
  color: #172033;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.practice-setup-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.practice-setup-head h2 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.2;
}

.practice-modal-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid #d7dde6;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.practice-rules-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding-left: 20px;
  color: #334155;
  line-height: 1.5;
}

.practice-mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.practice-mode-picker button {
  min-height: 44px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
  color: #173055;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.practice-mode-picker button.is-active {
  background: #173055;
  border-color: #173055;
  color: white;
}

.practice-runner-shell {
  display: grid;
  gap: 18px;
}

.practice-timer-anchor {
  position: fixed;
  top: var(--practice-timer-top, 10px);
  right: 44px;
  z-index: 12;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.practice-timer-anchor .practice-timer-box {
  pointer-events: auto;
}

.practice-test-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 18px;
  padding: 18px;
}

.practice-test-title-block h1 {
  margin: 2px 0 4px;
  color: #172033;
  font-size: 30px;
  line-height: 1.15;
}

.practice-test-title-block p:last-child {
  margin: 0;
  color: #5f7089;
  line-height: 1.4;
}

.practice-timer-box {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 140px;
  text-align: right;
}

.practice-timer-label {
  color: #5f7089;
  font-size: 13px;
  font-weight: 800;
}

.practice-timer-value {
  color: #172033;
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.practice-result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.practice-result-label {
  margin: 0 0 4px;
  color: #047857;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.practice-result-banner h2 {
  margin: 0;
  color: #14532d;
  font-size: 34px;
  line-height: 1;
}

.practice-result-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.practice-result-stats span {
  padding: 7px 10px;
  border-radius: 999px;
  background: white;
  color: #14532d;
  font-size: 13px;
  font-weight: 800;
}

.practice-problem-list {
  display: grid;
  gap: 16px;
}

.practice-problem-card {
  padding: 20px;
}

.practice-problem-card.is-correct {
  border-color: #86efac;
}

.practice-problem-card.is-wrong {
  border-color: #fecaca;
}

.practice-problem-card.is-blank {
  border-color: #fde68a;
}

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

.practice-problem-heading h2 {
  margin: 0 0 4px;
  color: #172033;
  font-size: 22px;
  line-height: 1.2;
}

.practice-problem-heading p {
  margin: 0;
  color: #5f7089;
  font-size: 14px;
  font-weight: 700;
}

.practice-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.practice-problem-actions {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: min(230px, 100%);
}

.practice-report-btn {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
  color: #173055;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.practice-report-btn:hover {
  background: #edf4ff;
  border-color: #93c5fd;
}

.practice-report-status {
  max-width: 230px;
  margin: 0;
  color: #5f7089;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  text-align: right;
}

.practice-report-status:empty {
  display: none;
}

.practice-report-status[data-message-type="error"] {
  color: #b91c1c;
}

.practice-report-status a {
  color: inherit;
  text-decoration: underline;
}

.practice-solution-toggle {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
  color: #173055;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.practice-solution-toggle:hover {
  background: #edf4ff;
  border-color: #93c5fd;
}

.practice-result-pill {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.practice-result-pill.is-correct {
  background: #dcfce7;
  color: #166534;
}

.practice-result-pill.is-wrong {
  background: #fee2e2;
  color: #991b1b;
}

.practice-result-pill.is-blank {
  background: #fef3c7;
  color: #92400e;
}

.practice-problem-body {
  display: grid;
  gap: 18px;
  margin-bottom: 16px;
}

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

.practice-problem-text {
  color: #172033;
  font-size: 17px;
  line-height: 1.65;
  white-space: pre-line;
}

.rated-practice-page .practice-problem-text {
  font-family: Arial, sans-serif;
}

.practice-image-gallery {
  display: grid;
  gap: 12px;
}

.practice-figure {
  margin: 0;
}

.practice-image,
.practice-choice-image {
  max-width: 100%;
  height: auto;
}

.practice-image {
  display: block;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: white;
}

.practice-figcaption {
  margin-top: 6px;
  color: #5f7089;
  font-size: 13px;
  line-height: 1.35;
}

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

.practice-choice-btn {
  display: flex;
  flex: 1 1 130px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
  color: #172033;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.practice-choice-row.has-images .practice-choice-btn {
  align-items: flex-start;
  flex-basis: 160px;
}

.practice-choice-btn.is-selected {
  background: #dbeafe;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.practice-choice-btn:hover:not(:disabled):not(.is-selected) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.practice-choice-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.practice-choice-btn:disabled {
  cursor: default;
}

.practice-choice-letter {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e2e8f0;
  color: #173055;
  font-size: 13px;
  font-weight: 800;
}

.practice-choice-text {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.practice-choice-btn.is-correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}

.practice-choice-btn.is-wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.practice-choice-btn.is-correct .practice-choice-letter {
  background: #22c55e;
  color: white;
}

.practice-choice-btn.is-wrong .practice-choice-letter {
  background: #ef4444;
  color: white;
}

.practice-number-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.practice-number-input {
  width: min(220px, 100%);
  min-height: 44px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: white;
  color: #172033;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}

.practice-number-input:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.practice-number-input.is-correct {
  border-color: #22c55e;
  background: #dcfce7;
  color: #14532d;
}

.practice-number-input.is-wrong {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

.practice-number-input.is-blank {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.practice-correct-number {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  padding: 0 14px;
  border-radius: 8px;
  background: #dcfce7;
  color: #14532d;
  font-weight: 800;
}

.practice-solution {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
}

.practice-solution[hidden] {
  display: none;
}

.practice-solution-answer {
  color: #173055;
  font-weight: 800;
  line-height: 1.5;
}

.practice-solution-text {
  color: #172033;
  line-height: 1.7;
  white-space: pre-wrap;
}

.practice-unsupported-answer {
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #5f7089;
  font-weight: 700;
}

.practice-bottom-actions {
  padding: 8px 0 26px;
}

.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-header {
    grid-template-columns: 1fr;
  }

  .problem-mark-actions {
    justify-content: flex-start;
  }

  .problem-mark-panel {
    justify-items: start;
  }

  .problem-mark-message {
    max-width: none;
    text-align: left;
  }

  .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;
  box-sizing: border-box;
  padding: 7px 12px;
  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"] .login-nudge {
  border-color: #2d4369;
  background: rgba(20, 32, 58, 0.98);
  color: #e5edf8;
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.38);
}

html[data-theme="dark"] .login-nudge-copy span {
  color: #9cadc5;
}

html[data-theme="dark"] .login-nudge-link {
  background: #3b82f6;
}

html[data-theme="dark"] .login-nudge-link:hover {
  background: #60a5fa;
  color: #08111f;
}

html[data-theme="dark"] .login-nudge-close {
  border-color: #2d4369;
  background: #0f1a2f;
  color: #dbe7f6;
}

html[data-theme="dark"] .login-nudge-close:hover {
  background: #1f3354;
}

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"] .topic-select {
  background:
    linear-gradient(45deg, transparent 50%, #9cadc5 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #9cadc5 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    #14203a;
  color: #e5edf8;
  border-color: #2d4369;
}

html[data-theme="dark"] .topic-select:focus {
  border-color: #7cb4ff;
  box-shadow: 0 0 0 4px rgba(124, 180, 255, 0.16);
}

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"] .problem-detail-meta-link:hover {
  color: #93c5fd;
}

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,
html[data-theme="dark"] .saved-filter-btn,
html[data-theme="dark"] .problem-report-open-btn,
html[data-theme="dark"] .problem-mark-btn {
  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,
html[data-theme="dark"] .saved-filter-btn:hover,
html[data-theme="dark"] .problem-report-open-btn:hover,
html[data-theme="dark"] .problem-mark-btn:hover {
  background: #203659;
  border-color: #567bb5;
}

html[data-theme="dark"] .saved-filter-btn.is-active,
html[data-theme="dark"] .saved-filter-btn[aria-pressed="true"] {
  background: #7cb4ff;
  border-color: #7cb4ff;
  color: #0f172a;
}

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"] .problem-mark-btn[data-problem-mark-kind="favorite"].is-active {
  background: #fbbf24;
  border-color: #f59e0b;
  color: #111827;
}

html[data-theme="dark"] .problem-mark-btn[data-problem-mark-kind="solved"].is-active {
  background: #34d399;
  border-color: #10b981;
  color: #0f172a;
}

html[data-theme="dark"] .problem-mark-message[data-message-type="success"] {
  color: #6ee7b7;
}

html[data-theme="dark"] .problem-mark-message[data-message-type="error"] {
  color: #fca5a5;
}

html[data-theme="dark"] .problem-report-modal {
  background: #14203a;
  color: #f8fbff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .problem-report-copy,
html[data-theme="dark"] .problem-report-form-meta {
  color: #b6c5db;
}

html[data-theme="dark"] .problem-report-close,
html[data-theme="dark"] .problem-report-reason,
html[data-theme="dark"] .problem-report-textarea {
  background: #182640;
  color: #e5edf8;
  border-color: #2d4369;
}

html[data-theme="dark"] .problem-report-close:hover,
html[data-theme="dark"] .problem-report-reason:hover {
  background: #203659;
  border-color: #567bb5;
}

html[data-theme="dark"] .problem-report-label {
  color: #f8fbff;
}

html[data-theme="dark"] .problem-report-back {
  color: #7cb4ff;
}

html[data-theme="dark"] .problem-report-submit {
  background: #7cb4ff;
  color: #0f172a;
}

html[data-theme="dark"] .problem-report-submit:hover {
  background: #9bc7ff;
}

html[data-theme="dark"] .problem-report-status[data-message-type="error"] {
  color: #fca5a5;
}

html[data-theme="dark"] .site-feedback-toggle {
  background: #7cb4ff;
  color: #0f172a;
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.34);
}

html[data-theme="dark"] .site-feedback-toggle:hover,
html[data-theme="dark"] .site-feedback-toggle[aria-expanded="true"] {
  background: #9bc7ff;
}

html[data-theme="dark"] .site-feedback-menu,
html[data-theme="dark"] .site-feedback-modal {
  background: #14203a;
  border-color: #223a5e;
  color: #e5edf8;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .site-feedback-menu button,
html[data-theme="dark"] .site-feedback-head h2,
html[data-theme="dark"] .site-feedback-label,
html[data-theme="dark"] .site-feedback-contact-list a,
html[data-theme="dark"] .site-feedback-contact-list span {
  color: #e5edf8;
}

html[data-theme="dark"] .site-feedback-menu button:hover,
html[data-theme="dark"] .site-feedback-close:hover,
html[data-theme="dark"] .site-feedback-secondary:hover,
html[data-theme="dark"] .site-feedback-contact-list a:hover {
  background: #203659;
  border-color: #567bb5;
}

html[data-theme="dark"] .site-feedback-kicker {
  color: #7cb4ff;
}

html[data-theme="dark"] .site-feedback-copy,
html[data-theme="dark"] .site-feedback-label span,
html[data-theme="dark"] .site-feedback-form-meta {
  color: #aebdd3;
}

html[data-theme="dark"] .site-feedback-close,
html[data-theme="dark"] .site-feedback-secondary,
html[data-theme="dark"] .site-feedback-textarea,
html[data-theme="dark"] .site-feedback-input,
html[data-theme="dark"] .site-feedback-contact-list a,
html[data-theme="dark"] .site-feedback-contact-list span {
  background: #182640;
  color: #e5edf8;
  border-color: #2d4369;
}

html[data-theme="dark"] .site-feedback-submit {
  background: #7cb4ff;
  color: #0f172a;
}

html[data-theme="dark"] .site-feedback-submit:hover {
  background: #9bc7ff;
}

html[data-theme="dark"] .site-feedback-status[data-message-type="success"] {
  color: #86efac;
}

html[data-theme="dark"] .site-feedback-status[data-message-type="error"] {
  color: #fca5a5;
}

html[data-theme="dark"] .practice-intro,
html[data-theme="dark"] .practice-panel,
html[data-theme="dark"] .practice-test-toolbar,
html[data-theme="dark"] .practice-problem-card {
  background: #14203a;
  border-color: #223a5e;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.22);
}

html[data-theme="dark"] .practice-intro h1,
html[data-theme="dark"] .practice-section-heading h2,
html[data-theme="dark"] .practice-year-section-head h3,
html[data-theme="dark"] .practice-ongoing-card h3,
html[data-theme="dark"] .practice-test-title-block h1,
html[data-theme="dark"] .practice-problem-heading h2,
html[data-theme="dark"] .practice-problem-text {
  color: #f8fbff;
}

html[data-theme="dark"] .practice-intro p,
html[data-theme="dark"] .practice-muted,
html[data-theme="dark"] .practice-contest-card span,
html[data-theme="dark"] .practice-year-card span,
html[data-theme="dark"] .practice-year-section-head span,
html[data-theme="dark"] .practice-ongoing-card p,
html[data-theme="dark"] .practice-test-title-block p:last-child,
html[data-theme="dark"] .practice-timer-label,
html[data-theme="dark"] .practice-problem-heading p,
html[data-theme="dark"] .practice-figcaption,
html[data-theme="dark"] .practice-unsupported-answer {
  color: #aebdd3;
}

html[data-theme="dark"] .practice-kicker {
  color: #7cb4ff;
}

html[data-theme="dark"] .practice-contest-card,
html[data-theme="dark"] .practice-year-card,
html[data-theme="dark"] .practice-ongoing-card,
html[data-theme="dark"] .practice-secondary-link,
html[data-theme="dark"] .practice-text-btn,
html[data-theme="dark"] .practice-small-btn,
html[data-theme="dark"] .practice-solution-toggle,
html[data-theme="dark"] .practice-report-btn,
html[data-theme="dark"] .practice-mode-picker button,
html[data-theme="dark"] .practice-choice-btn,
html[data-theme="dark"] .practice-number-input,
html[data-theme="dark"] .practice-modal-close {
  background: #182640;
  color: #e5edf8;
  border-color: #2d4369;
}

html[data-theme="dark"] .practice-contest-card:hover,
html[data-theme="dark"] .practice-year-card:hover,
html[data-theme="dark"] .practice-secondary-link:hover,
html[data-theme="dark"] .practice-text-btn:hover,
html[data-theme="dark"] .practice-small-btn:hover,
html[data-theme="dark"] .practice-solution-toggle:hover,
html[data-theme="dark"] .practice-report-btn:hover,
html[data-theme="dark"] .practice-choice-btn:hover:not(:disabled):not(.is-selected),
html[data-theme="dark"] .practice-modal-close:hover {
  background: #203659;
  border-color: #567bb5;
}

html[data-theme="dark"] .practice-report-status {
  color: #aebdd3;
}

html[data-theme="dark"] .practice-report-status[data-message-type="error"] {
  color: #fca5a5;
}

html[data-theme="dark"] .practice-choice-btn.is-selected {
  background: #1e3a5f;
  border-color: #7cb4ff;
  box-shadow: 0 0 0 2px rgba(124, 180, 255, 0.18);
}

html[data-theme="dark"] .practice-year-card .practice-complete-check {
  background: #22c55e;
  color: #052e16;
}

html[data-theme="dark"] .practice-complete-check::after {
  background: #e5edf8;
  color: #0f172a;
}

html[data-theme="dark"] .practice-year-panel {
  border-color: #223a5e;
}

html[data-theme="dark"] .practice-primary-link,
html[data-theme="dark"] .practice-submit-btn,
html[data-theme="dark"] .practice-mode-picker button.is-active {
  background: #7cb4ff;
  color: #0f172a;
}

html[data-theme="dark"] .practice-primary-link:hover,
html[data-theme="dark"] .practice-submit-btn:hover {
  background: #9bc7ff;
}

html[data-theme="dark"] .practice-setup-modal {
  background: #14203a;
  color: #f8fbff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .practice-rules-list {
  color: #d5e0ef;
}

html[data-theme="dark"] .practice-timer-value {
  color: #f8fbff;
}

html[data-theme="dark"] .practice-result-banner {
  background: #123021;
  border-color: #166534;
}

html[data-theme="dark"] .practice-result-label,
html[data-theme="dark"] .practice-result-banner h2,
html[data-theme="dark"] .practice-result-stats span {
  color: #bbf7d0;
}

html[data-theme="dark"] .practice-result-stats span {
  background: #17462c;
}

html[data-theme="dark"] .practice-image {
  background: #0f172a;
  border-color: #2d4369;
}

html[data-theme="dark"] .practice-choice-letter {
  background: #2d4369;
  color: #d3e5ff;
}

html[data-theme="dark"] .practice-choice-btn.is-correct,
html[data-theme="dark"] .practice-number-input.is-correct,
html[data-theme="dark"] .practice-correct-number {
  background: #14532d;
  border-color: #22c55e;
  color: #bbf7d0;
}

html[data-theme="dark"] .practice-choice-btn.is-wrong,
html[data-theme="dark"] .practice-number-input.is-wrong {
  background: #4b1515;
  border-color: #ef4444;
  color: #fecaca;
}

html[data-theme="dark"] .practice-number-input.is-blank {
  background: #422f10;
  border-color: #f59e0b;
  color: #fde68a;
}

html[data-theme="dark"] .practice-result-pill.is-blank {
  background: #422f10;
  color: #fde68a;
}

html[data-theme="dark"] .practice-choice-btn.is-correct .practice-choice-letter {
  background: #22c55e;
  color: #052e16;
}

html[data-theme="dark"] .practice-choice-btn.is-wrong .practice-choice-letter {
  background: #ef4444;
  color: white;
}

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"] .practice-solution {
  background: #182640;
  border-color: #2d4369;
}

html[data-theme="dark"] .practice-solution-answer,
html[data-theme="dark"] .practice-solution-text {
  color: #e5edf8;
}

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: 10px;
    bottom: 10px;
    transform: scale(0.9);
    transform-origin: left bottom;
  }

  .site-feedback-widget {
    right: 8px;
    bottom: 8px;
  }

  .site-feedback-toggle {
    width: auto;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 999px;
  }

  .site-feedback-toggle::before {
    content: none;
  }

  .site-feedback-menu {
    min-width: min(220px, calc(100vw - 28px));
  }

  .site-feedback-actions {
    flex-direction: column-reverse;
  }

  .site-feedback-secondary,
  .site-feedback-submit {
    width: 100%;
  }
}

.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,
  .practice-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,
.practice-page .top {
  padding: 18px 20px;
  text-align: left;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.top-actions .home-nav-btn {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
}

.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);
}

[hidden] {
  display: none !important;
}

.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-account {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-account:not([data-auth-ready="true"]) {
  visibility: hidden;
}

.home-nav-btn,
.home-action-btn,
.home-link-card,
.home-summary-card,
.home-feature-item,
.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 {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  text-align: center;
  font-weight: 800;
  white-space: normal;
}

.home-nav-btn {
  color: #173055;
  background: #ffffff;
  border-color: #d8e1ef;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.home-account-btn {
  min-width: 0;
  cursor: pointer;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.home-account-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  min-width: 166px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
}

.home-account-menu button {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 0 12px;
  color: #173055;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.home-account-menu a {
  display: flex;
  align-items: center;
  width: auto;
  box-sizing: border-box;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  color: #173055;
  border-radius: 8px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.home-account-menu a:hover,
.home-account-menu button:hover {
  background: #edf4ff;
}

.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: stretch;
  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-feature-snapshot {
  display: grid;
  align-content: start;
  height: 100%;
  box-sizing: border-box;
}

.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-feature-list {
  display: grid;
}

.home-feature-item {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid #e2eaf5;
  color: inherit;
  text-decoration: none;
}

.home-feature-item:first-child {
  border-top: 0;
  padding-top: 2px;
}

.home-feature-item:last-child {
  padding-bottom: 0;
}

.home-feature-item strong {
  min-width: 0;
  color: #173055;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.home-feature-item small {
  min-width: 0;
  color: #4b5f79;
  font-size: 12px;
  line-height: 1.35;
}

.home-feature-item:hover,
.home-feature-item:focus-visible {
  transform: translateX(3px);
}

.home-feature-item:hover strong,
.home-feature-item:focus-visible strong {
  color: #1d4ed8;
}

.home-feature-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 4px;
}

.home-feature-more {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid #e2eaf5;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
}

.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-account-menu {
  background: #14203a;
  border-color: #223a5e;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.36);
}

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

html[data-theme="dark"] .home-account-menu button {
  color: #d3e5ff;
}

html[data-theme="dark"] .home-account-menu a {
  color: #d3e5ff;
}

html[data-theme="dark"] .home-account-menu a:hover,
html[data-theme="dark"] .home-account-menu button:hover {
  background: #203659;
}

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-feature-item small,
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;
}

html[data-theme="dark"] .home-feature-item {
  border-color: #223a5e;
}

html[data-theme="dark"] .home-feature-more {
  border-color: #223a5e;
  color: #8ec5ff;
}

html[data-theme="dark"] .home-feature-item strong {
  color: #e5edf8;
}

html[data-theme="dark"] .home-feature-item:hover strong,
html[data-theme="dark"] .home-feature-item:focus-visible strong {
  color: #9bc7ff;
}

.dashboard-page {
  --field-algebra: #2563EB;
  --field-geometry: #0D9488;
  --field-number-theory: #7C3AED;
  --field-combinatorics: #F97316;
  min-height: 100vh;
  font-family: "Manrope", Arial, sans-serif;
  background: #f4f7fb;
  color: #132033;
}

.personal-profile-page,
.rated-practice-page {
  min-height: 100vh;
  font-family: "Manrope", Arial, sans-serif;
  background: #f4f7fb;
  color: #132033;
}

.dashboard-page[data-dashboard-auth="checking"] .dashboard-container {
  visibility: hidden;
}

.personal-profile-page[data-profile-auth="checking"] .profile-form-container,
.rated-practice-page[data-rated-auth="checking"] .rated-practice-container {
  visibility: hidden;
}

.dashboard-page .top,
.personal-profile-page .top,
.rated-practice-page .top {
  padding: 18px 20px;
  text-align: left;
}

.dashboard-page .top-inner,
.personal-profile-page .top-inner,
.rated-practice-page .top-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 84px;
}

.dashboard-container {
  max-width: 1120px;
  padding-top: 24px;
  padding-bottom: 72px;
}

.dashboard-card {
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.dashboard-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 24px;
}

.dashboard-welcome-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dashboard-welcome-card h1,
.dashboard-section-heading h2,
.dashboard-card h2,
.dashboard-card h3 {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", Arial, sans-serif;
  letter-spacing: 0;
  line-height: 1.08;
}

.dashboard-welcome-card h1 {
  font-size: 3.2rem;
}

.dashboard-welcome-card p:not(.home-kicker) {
  max-width: 720px;
  margin: 14px 0 0;
  color: #4b5f79;
  font-size: 17px;
  line-height: 1.65;
}

.dashboard-welcome-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.dashboard-section {
  margin-bottom: 18px;
}

.dashboard-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.dashboard-section-heading h2 {
  font-size: 2rem;
}

.dashboard-card-grid,
.dashboard-layout {
  display: grid;
  gap: 16px;
}

.dashboard-card-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.dashboard-profile-saved-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
}

.dashboard-saved-stack {
  display: grid;
  gap: 16px;
}

.dashboard-practice-column {
  display: grid;
  gap: 16px;
}

.dashboard-practice-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-profile-card {
  align-self: start;
}

.dashboard-profile-top-slot:empty,
.dashboard-profile-bottom-section:empty {
  display: none;
}

.dashboard-profile-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.dashboard-profile-card-main .dashboard-card-link {
  margin-top: 0;
  white-space: nowrap;
}

.dashboard-profile-card.is-complete {
  padding: 16px 18px;
}

.dashboard-profile-card.is-complete p {
  margin-top: 8px;
}

.dashboard-profile-card.is-complete .dashboard-card-link {
  min-height: 36px;
  margin-top: 12px;
}

.dashboard-profile-card.is-complete [data-dashboard-profile-preview] {
  display: none;
}

.dashboard-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.dashboard-card {
  min-width: 0;
  padding: 20px;
}

.dashboard-card h2 {
  font-size: 1.55rem;
}

.dashboard-card h3 {
  margin-top: 6px;
  font-size: 1.25rem;
}

.dashboard-card p {
  margin: 12px 0 0;
  color: #51647d;
  line-height: 1.62;
}

.dashboard-card-label {
  margin: 0;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-count-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef6f0;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-wide-card {
  grid-column: span 2;
}

.dashboard-skill-visual {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 18px 0 4px;
}

.dashboard-skill-ring {
  --dashboard-skill-gradient: conic-gradient(
    var(--field-algebra) 0 25%,
    var(--field-geometry) 25% 50%,
    var(--field-combinatorics) 50% 75%,
    var(--field-number-theory) 75% 100%
  );
  position: relative;
  display: grid;
  place-items: center;
  width: 154px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #d8e1ef;
}

.dashboard-skill-arc-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dashboard-skill-arc {
  fill: none;
  stroke-width: 19;
  cursor: pointer;
  outline: none;
  pointer-events: stroke;
}

.dashboard-skill-arc:hover,
.dashboard-skill-arc:focus-visible {
  filter: brightness(1.08);
}

.dashboard-skill-ring span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  color: #173055;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px #d8e1ef;
}

.dashboard-skill-legend {
  display: grid;
  gap: 9px;
}

.dashboard-skill-legend span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.dashboard-skill-legend strong {
  margin-left: auto;
  color: #173055;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.dashboard-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dashboard-dot-algebra {
  background: var(--field-algebra);
}

.dashboard-dot-geometry {
  background: var(--field-geometry);
}

.dashboard-dot-combo {
  background: var(--field-combinatorics);
}

.dashboard-dot-nt {
  background: var(--field-number-theory);
}

.dashboard-rule-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.dashboard-rule-list div,
.dashboard-placeholder-form span {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
}

.dashboard-rule-list strong {
  color: #173055;
  font-size: 14px;
}

.dashboard-rule-list span,
.dashboard-placeholder-form span {
  color: #51647d;
  font-size: 14px;
  line-height: 1.45;
}

.dashboard-placeholder-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.dashboard-card-link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 40px;
  margin-top: 16px;
  padding: 0 13px;
  border: 1px solid #bfd3f0;
  border-radius: 8px;
  color: #1d4ed8;
  background: #edf4ff;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-card-link:hover {
  background: #dbeafe;
}

.dashboard-skill-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.dashboard-skill-action-row .dashboard-card-link {
  margin-top: 0;
}

.dashboard-skill-action-row span {
  color: #51647d;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.dashboard-problem-list-card {
  padding-bottom: 14px;
}

.dashboard-problem-list {
  margin-top: 14px;
}

.dashboard-contest-list {
  margin-top: 14px;
}

.dashboard-problem-scroll {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
}

.dashboard-contest-scroll {
  max-height: 192px;
  overflow-y: auto;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
}

.dashboard-solved-graph-card {
  overflow: visible;
}

.dashboard-solved-graph {
  margin-top: 14px;
}

.dashboard-solved-graph-scroll {
  overflow: visible;
  padding: 0 2px 6px;
}

.dashboard-solved-graph-wrap {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.dashboard-solved-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 220px;
  padding-right: 2px;
  color: #51647d;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-solved-chart {
  min-width: 0;
}

.dashboard-solved-bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--difficulty-count), minmax(0, 1fr));
  align-items: end;
  gap: clamp(2px, 0.65vw, 7px);
  height: 220px;
  padding: 0 0 0 8px;
  border-left: 1px solid #c9d7ea;
  border-bottom: 1px solid #c9d7ea;
  background:
    linear-gradient(to bottom, rgba(148, 163, 184, 0.22) 1px, transparent 1px) 0 0 / 100% 50%,
    linear-gradient(to bottom, transparent, transparent);
}

.dashboard-solved-bar-shell {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  min-width: 0;
  outline: none;
}

.dashboard-solved-bar {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 5px 5px 0 0;
  background: #e2ebf7;
}

.dashboard-solved-segment {
  display: block;
  width: 100%;
}

.dashboard-solved-segment-algebra {
  background: var(--field-algebra);
}

.dashboard-solved-segment-geometry {
  background: var(--field-geometry);
}

.dashboard-solved-segment-number-theory {
  background: var(--field-number-theory);
}

.dashboard-solved-segment-combinatorics {
  background: var(--field-combinatorics);
}

.dashboard-solved-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  display: grid;
  gap: 6px;
  width: max-content;
  max-width: 240px;
  padding: 10px 11px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  font-size: 12px;
  line-height: 1.25;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
  pointer-events: none;
}

.dashboard-solved-tooltip::after {
  content: "";
  position: absolute;
  left: var(--tooltip-arrow-left, 50%);
  width: 10px;
  height: 10px;
  border: inherit;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.dashboard-solved-tooltip[data-placement="top"]::after {
  bottom: -6px;
  border-left: 0;
  border-top: 0;
}

.dashboard-solved-tooltip[data-placement="bottom"]::after {
  top: -6px;
  border-right: 0;
  border-bottom: 0;
}

.dashboard-solved-tooltip[hidden] {
  display: none;
}

.dashboard-solved-tooltip strong {
  position: relative;
  z-index: 1;
  color: #0f172a;
  font-size: 12px;
}

.dashboard-solved-tooltip-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  font-weight: 800;
}

.dashboard-solved-tooltip-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.dashboard-solved-bar-shell:focus-visible .dashboard-solved-bar {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.dashboard-solved-x-axis {
  display: grid;
  grid-template-columns: repeat(var(--difficulty-count), minmax(0, 1fr));
  gap: clamp(2px, 0.65vw, 7px);
  margin-top: 8px;
  padding-left: 8px;
}

.dashboard-solved-x-axis span {
  color: #51647d;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.dashboard-solved-x-axis span:empty {
  visibility: hidden;
}

.dashboard-solved-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 14px;
  margin-top: 12px;
}

.dashboard-solved-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.dashboard-solved-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dashboard-problem-row,
.dashboard-view-all,
.dashboard-contest-row {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  color: #173055;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  border-bottom: 1px solid #e2ebf7;
}

.dashboard-contest-row {
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
}

.dashboard-contest-row small {
  color: #51647d;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-problem-row:hover,
.dashboard-view-all:hover,
.dashboard-contest-row:hover {
  background: #edf4ff;
  color: #1d4ed8;
}

.dashboard-contest-row:hover small {
  color: #1d4ed8;
}

.dashboard-view-all {
  justify-content: center;
  color: #1d4ed8;
  background: #ffffff;
  border-bottom: 0;
}

.dashboard-list-message {
  margin: 0;
  padding: 14px 12px;
  color: #51647d;
  font-size: 14px;
  line-height: 1.45;
}

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

html[data-theme="dark"] .personal-profile-page,
html[data-theme="dark"] .rated-practice-page {
  background: #0d1526;
  color: #e5edf8;
}

html[data-theme="dark"] .dashboard-card {
  background: #14203a;
  border-color: #223a5e;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.28);
}

html[data-theme="dark"] .dashboard-welcome-card p:not(.home-kicker),
html[data-theme="dark"] .dashboard-card p,
html[data-theme="dark"] .dashboard-skill-legend span,
html[data-theme="dark"] .dashboard-skill-action-row span,
html[data-theme="dark"] .dashboard-rule-list span,
html[data-theme="dark"] .dashboard-placeholder-form span,
html[data-theme="dark"] .dashboard-list-message {
  color: #9cadc5;
}

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

html[data-theme="dark"] .dashboard-count-pill {
  background: #163822;
  color: #86efac;
}

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

html[data-theme="dark"] .dashboard-rule-list div,
html[data-theme="dark"] .dashboard-placeholder-form span,
html[data-theme="dark"] .dashboard-problem-scroll,
html[data-theme="dark"] .dashboard-contest-scroll {
  background: #101b31;
  border-color: #223a5e;
}

html[data-theme="dark"] .dashboard-solved-y-axis,
html[data-theme="dark"] .dashboard-solved-x-axis span,
html[data-theme="dark"] .dashboard-solved-legend span {
  color: #9cadc5;
}

html[data-theme="dark"] .dashboard-solved-bars {
  border-color: #35527f;
  background:
    linear-gradient(to bottom, rgba(86, 123, 181, 0.28) 1px, transparent 1px) 0 0 / 100% 50%,
    linear-gradient(to bottom, transparent, transparent);
}

html[data-theme="dark"] .dashboard-solved-bar {
  background: #223a5e;
}

html[data-theme="dark"] .dashboard-solved-tooltip {
  background: #111827;
  border-color: #334155;
  color: #e5edf8;
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.36);
}

html[data-theme="dark"] .dashboard-solved-tooltip strong {
  color: #f8fafc;
}

html[data-theme="dark"] .dashboard-solved-tooltip-row {
  color: #cbd5e1;
}

html[data-theme="dark"] .dashboard-problem-row,
html[data-theme="dark"] .dashboard-view-all,
html[data-theme="dark"] .dashboard-contest-row {
  color: #d3e5ff;
  border-color: #223a5e;
}

html[data-theme="dark"] .dashboard-problem-row:hover,
html[data-theme="dark"] .dashboard-view-all:hover,
html[data-theme="dark"] .dashboard-contest-row:hover {
  background: #203659;
  color: #8ec5ff;
}

html[data-theme="dark"] .dashboard-contest-row small {
  color: #9cadc5;
}

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

html[data-theme="dark"] .dashboard-view-all {
  background: #14203a;
  color: #8ec5ff;
}

html[data-theme="dark"] .dashboard-rule-list strong,
html[data-theme="dark"] .dashboard-skill-legend strong,
html[data-theme="dark"] .dashboard-skill-ring span {
  color: #d3e5ff;
}

html[data-theme="dark"] .dashboard-skill-ring {
  border-color: #223a5e;
  background: #14203a;
}

html[data-theme="dark"] .dashboard-skill-ring span {
  background: #14203a;
  box-shadow: inset 0 0 0 1px #35527f;
}

@media (max-width: 960px) {
  .dashboard-top-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card-grid-three,
  .dashboard-card-grid-two,
  .dashboard-profile-saved-grid,
  .dashboard-practice-summary-grid,
  .dashboard-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-wide-card {
    grid-column: span 2;
  }

  .dashboard-rule-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .dashboard-page .top-inner,
  .personal-profile-page .top-inner,
  .rated-practice-page .top-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .dashboard-page .top-actions,
  .personal-profile-page .top-actions,
  .rated-practice-page .top-actions {
    width: auto;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .dashboard-page .site-logo-link,
  .personal-profile-page .site-logo-link,
  .rated-practice-page .site-logo-link {
    min-width: 0;
    order: 1;
  }

  .dashboard-page .site-logo,
  .personal-profile-page .site-logo,
  .rated-practice-page .site-logo {
    height: 44px;
    max-width: min(44vw, 154px);
  }

  .dashboard-page .page-header-copy,
  .personal-profile-page .page-header-copy,
  .rated-practice-page .page-header-copy {
    width: 100%;
    order: 3;
  }

  .dashboard-page .top-actions,
  .personal-profile-page .top-actions,
  .rated-practice-page .top-actions {
    order: 2;
  }

  .dashboard-page .top-actions .home-account,
  .personal-profile-page .top-actions .home-account,
  .rated-practice-page .top-actions .home-account {
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .dashboard-page .top-actions .home-nav-btn,
  .personal-profile-page .top-actions .home-nav-btn,
  .rated-practice-page .top-actions .home-nav-btn {
    width: auto;
    min-height: 38px;
    padding: 0 9px;
    border-radius: 11px;
    flex: 0 1 auto;
    font-size: 13px;
  }

  .dashboard-page .top-actions .home-account-menu,
  .rated-practice-page .top-actions .home-account-menu,
  .personal-profile-page .top-actions .home-account-menu {
    left: auto;
    right: 0;
    width: min(180px, calc(100vw - 32px));
    min-width: 0;
  }

  .dashboard-card {
    padding: 18px;
  }

  .dashboard-welcome-card h1 {
    font-size: 2.35rem;
  }

  .dashboard-welcome-actions,
  .dashboard-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-card-head {
    align-items: flex-start;
    flex-direction: row;
  }

  .dashboard-problem-list-card .dashboard-card-head {
    align-items: flex-start;
    flex-direction: row;
  }

  .dashboard-problem-list-card .dashboard-count-pill {
    margin-left: auto;
  }

  .dashboard-welcome-actions .home-action-btn {
    width: 100%;
  }

  .dashboard-card-grid-three,
  .dashboard-card-grid-two,
  .dashboard-profile-saved-grid,
  .dashboard-practice-summary-grid,
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-wide-card {
    grid-column: auto;
  }

  .dashboard-skill-visual {
    grid-template-columns: 1fr;
  }

  .dashboard-profile-card-main {
    grid-template-columns: 1fr;
  }

  .dashboard-profile-card-main .dashboard-card-link {
    width: 100%;
    white-space: normal;
  }
}

.profile-form-container {
  max-width: 960px;
  padding-bottom: 72px;
}

.profile-form-card,
.profile-example-card {
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.profile-form-card {
  display: grid;
  gap: 22px;
  margin-top: 16px;
  padding: 24px;
}

.profile-form-heading h1 {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", Arial, sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  letter-spacing: 0;
  line-height: 1.04;
}

.profile-form-heading p:not(.home-kicker),
.profile-section-note {
  margin: 10px 0 0;
  color: #51647d;
  line-height: 1.62;
}

.profile-form-section {
  display: grid;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid #d8e1ef;
}

.profile-form-section h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.profile-section-title-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-section-title-line .profile-section-note {
  margin: 0;
  font-size: 14px;
}

.profile-field {
  display: grid;
  gap: 8px;
  color: #173055;
  font-weight: 800;
}

.profile-field select {
  width: 100%;
  min-height: 42px;
  padding: 0 40px 0 12px;
  color: #132033;
  background:
    linear-gradient(45deg, transparent 50%, #64748b 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #64748b 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    #ffffff;
  border: 1px solid #cfd4dc;
  border-radius: 10px;
  box-sizing: border-box;
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
}

.profile-field select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

.profile-grade-input {
  width: 100%;
  padding: 10px 12px;
  color: #132033;
  background: #ffffff;
  border: 1px solid #cfd4dc;
  border-radius: 10px;
  box-sizing: border-box;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  outline: none;
}

.profile-grade-input:focus {
  border-color: #2563eb;
}

.profile-option-grid,
.profile-checkbox-grid,
.profile-rank-list {
  display: grid;
  gap: 10px;
}

.profile-option-grid-target {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.profile-checkbox-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.profile-rank-list {
  grid-template-columns: 1fr;
}

.profile-choice,
.profile-checkbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.profile-choice input,
.profile-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-choice:has(input:checked),
.profile-checkbox:has(input:checked) {
  background: #edf4ff;
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.profile-choice:has(input:focus-visible),
.profile-checkbox:has(input:focus-visible) {
  box-shadow:
    inset 0 0 0 1px #2563eb,
    0 0 0 4px rgba(37, 99, 235, 0.12);
}

.profile-choice span,
.profile-checkbox span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-choice strong,
.profile-checkbox span {
  font-family: "Manrope", Arial, sans-serif;
  font-weight: 800;
  color: #173055;
  font-size: 13px;
  line-height: 1.3;
}

.profile-choice small {
  color: #51647d;
  font-size: 13px;
  line-height: 1.4;
}

.profile-example-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #f8fbff;
}

.profile-example-card p {
  margin: 0;
  color: #51647d;
  line-height: 1.55;
}

.profile-example-statement {
  padding: 14px;
  white-space: pre-wrap;
  color: #132033;
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.65;
}

.profile-example-choices {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 30px;
  color: #132033;
  line-height: 1.5;
}

.profile-rank-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
  color: #173055;
  cursor: grab;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.profile-rank-item:active {
  cursor: grabbing;
}

.profile-rank-item.is-dragging {
  opacity: 0.72;
  transform: scale(0.99);
  border-color: #2563eb;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
}

.profile-rank-position {
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #edf4ff;
  color: #1d4ed8;
}

.profile-rank-name {
  min-width: 0;
}

.profile-rank-grip {
  color: #94a3b8;
  font-family: Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
}

.profile-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.profile-form-actions .home-action-btn {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
}

html[data-theme="dark"] .profile-form-card,
html[data-theme="dark"] .profile-example-card {
  background: #14203a;
  border-color: #223a5e;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.28);
}

html[data-theme="dark"] .profile-form-heading p:not(.home-kicker),
html[data-theme="dark"] .profile-section-note,
html[data-theme="dark"] .profile-choice small,
html[data-theme="dark"] .profile-example-card p {
  color: #9cadc5;
}

html[data-theme="dark"] .profile-form-section {
  border-color: #223a5e;
}

html[data-theme="dark"] .profile-field,
html[data-theme="dark"] .profile-choice strong,
html[data-theme="dark"] .profile-checkbox span {
  color: #d3e5ff;
}

html[data-theme="dark"] .profile-field select {
  color: #e5edf8;
  background:
    linear-gradient(45deg, transparent 50%, #9cadc5 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #9cadc5 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    #0f1a30;
  border-color: #35527f;
}

html[data-theme="dark"] .profile-field select:focus {
  border-color: #7cb4ff;
  box-shadow: 0 0 0 4px rgba(124, 180, 255, 0.16);
}

html[data-theme="dark"] .profile-grade-input {
  color: #e5edf8;
  background: #14203a;
  border-color: #2d4369;
}

html[data-theme="dark"] .profile-grade-input::placeholder {
  color: #9cadc5;
  opacity: 0.8;
}

html[data-theme="dark"] .profile-grade-input:focus {
  border-color: #7cb4ff;
}

html[data-theme="dark"] .profile-choice,
html[data-theme="dark"] .profile-checkbox,
html[data-theme="dark"] .profile-example-card,
html[data-theme="dark"] .profile-rank-item {
  background: #101b31;
  border-color: #223a5e;
}

html[data-theme="dark"] .profile-choice:has(input:checked),
html[data-theme="dark"] .profile-checkbox:has(input:checked) {
  background: #1a2f51;
  border-color: #7cb4ff;
  box-shadow: inset 0 0 0 1px #7cb4ff;
}

html[data-theme="dark"] .profile-example-statement,
html[data-theme="dark"] .profile-example-choices {
  color: #e5edf8;
}

html[data-theme="dark"] .profile-example-statement {
  background: #0f1a30;
  border-color: #223a5e;
}

html[data-theme="dark"] .profile-rank-item {
  color: #d3e5ff;
}

html[data-theme="dark"] .profile-rank-item.is-dragging {
  border-color: #7cb4ff;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.34);
}

html[data-theme="dark"] .profile-rank-position {
  background: #1a2f51;
  color: #8ec5ff;
}

html[data-theme="dark"] .profile-rank-grip {
  color: #64748b;
}

@media (max-width: 860px) {
  .profile-option-grid-target,
  .profile-checkbox-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .profile-form-card {
    padding: 18px;
  }

  .dashboard-profile-card-main {
    grid-template-columns: 1fr;
  }

  .dashboard-profile-card-main .dashboard-card-link {
    width: 100%;
  }

  .profile-option-grid-target,
  .profile-option-grid-level,
  .profile-checkbox-grid,
  .profile-rank-list {
    grid-template-columns: 1fr;
  }

  .profile-form-actions .home-action-btn {
    width: 100%;
  }
}

.rated-practice-container {
  max-width: 1120px;
  padding-top: 24px;
  padding-bottom: 72px;
}

.rated-practice-shell {
  display: grid;
  gap: 16px;
}

.rated-summary-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 16px;
}

.rated-overall-card,
.rated-field-card,
.rated-setup-card,
.rated-set-head,
.rated-result-banner {
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.rated-overall-card {
  display: grid;
  align-content: center;
  min-height: 132px;
  padding: 20px;
}

.rated-overall-card h1 {
  margin: 4px 0 0;
  color: #173055;
  font-size: 3.1rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

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

.rated-field-card {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
}

.rated-field-card span {
  color: #51647d;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.rated-field-card strong {
  color: #173055;
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.rated-setup-card {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.rated-setup-head,
.rated-count-row,
.rated-set-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rated-setup-head h2,
.rated-set-head h2 {
  margin: 4px 0 0;
  color: #172033;
  font-size: 1.7rem;
  line-height: 1.15;
}

.rated-control-section {
  display: grid;
  gap: 10px;
}

.rated-control-section h3 {
  margin: 0;
  color: #173055;
  font-size: 1rem;
  line-height: 1.2;
}

.rated-option-grid {
  display: grid;
  gap: 10px;
}

.rated-field-options {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.rated-level-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rated-choice {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #f8fbff;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.rated-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rated-choice span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rated-choice strong {
  color: #173055;
  font-size: 14px;
  line-height: 1.25;
}

.rated-choice small {
  color: #51647d;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.rated-choice:has(input:checked) {
  background: #edf4ff;
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.rated-choice:has(input:focus-visible) {
  box-shadow:
    inset 0 0 0 1px #2563eb,
    0 0 0 4px rgba(37, 99, 235, 0.12);
}

.rated-count-row label {
  display: grid;
  gap: 7px;
  color: #173055;
  font-weight: 800;
}

.rated-count-field {
  width: min(190px, 100%);
}

.rated-count-wrap {
  width: 100%;
}

.rated-count-input {
  cursor: pointer;
}

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

.rated-count-row select {
  min-width: 116px;
  min-height: 42px;
  padding: 0 40px 0 12px;
  color: #132033;
  background:
    linear-gradient(45deg, transparent 50%, #64748b 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #64748b 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    #ffffff;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  box-sizing: border-box;
  appearance: none;
  font: inherit;
  font-weight: 800;
}

.rated-count-row select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

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

.rated-set-head {
  padding: 18px 20px;
}

.rated-set-head span {
  color: #51647d;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.rated-result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.rated-result-banner h2 {
  margin: 0;
  color: #14532d;
  font-size: 34px;
  line-height: 1;
}

.rated-result-main {
  display: grid;
  gap: 8px;
}

.rated-field-change-list {
  display: grid;
  gap: 5px;
  color: #166534;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.rated-field-change-list span {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.rated-field-change-list strong {
  min-width: 118px;
  color: #14532d;
}

.rated-field-change-list em {
  color: #047857;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.rated-bottom-actions {
  padding-top: 2px;
}

html[data-theme="dark"] .rated-overall-card,
html[data-theme="dark"] .rated-field-card,
html[data-theme="dark"] .rated-setup-card,
html[data-theme="dark"] .rated-set-head {
  background: #14203a;
  border-color: #223a5e;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.28);
}

html[data-theme="dark"] .rated-overall-card h1,
html[data-theme="dark"] .rated-field-card strong,
html[data-theme="dark"] .rated-setup-head h2,
html[data-theme="dark"] .rated-control-section h3,
html[data-theme="dark"] .rated-choice strong,
html[data-theme="dark"] .rated-count-row label,
html[data-theme="dark"] .rated-set-head h2 {
  color: #d3e5ff;
}

html[data-theme="dark"] .rated-field-card span,
html[data-theme="dark"] .rated-choice small,
html[data-theme="dark"] .rated-set-head span {
  color: #9cadc5;
}

html[data-theme="dark"] .rated-choice {
  background: #101b31;
  border-color: #223a5e;
}

html[data-theme="dark"] .rated-choice:has(input:checked) {
  background: #1a2f51;
  border-color: #7cb4ff;
  box-shadow: inset 0 0 0 1px #7cb4ff;
}

html[data-theme="dark"] .rated-count-row select {
  color: #e5edf8;
  background:
    linear-gradient(45deg, transparent 50%, #9cadc5 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #9cadc5 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    #0f1a30;
  border-color: #35527f;
}

html[data-theme="dark"] .rated-count-row select:focus {
  border-color: #7cb4ff;
  box-shadow: 0 0 0 4px rgba(124, 180, 255, 0.16);
}

html[data-theme="dark"] .rated-result-banner {
  background: rgba(20, 83, 45, 0.2);
  border-color: rgba(134, 239, 172, 0.35);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.28);
}

html[data-theme="dark"] .rated-result-banner h2 {
  color: #bbf7d0;
}

html[data-theme="dark"] .rated-field-change-list {
  color: #bbf7d0;
}

html[data-theme="dark"] .rated-field-change-list strong {
  color: #dcfce7;
}

html[data-theme="dark"] .rated-field-change-list em {
  color: #86efac;
}

@media (max-width: 860px) {
  .rated-summary-grid,
  .rated-field-options,
  .rated-level-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .rated-summary-grid {
    grid-template-columns: 1fr;
  }

  .rated-overall-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 0;
    padding: 14px 16px;
  }

  .rated-overall-card h1 {
    margin: 0;
    font-size: 2.2rem;
  }

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

  .rated-field-card {
    min-height: 0;
    padding: 12px;
  }

  .rated-field-card strong {
    font-size: 1.45rem;
  }

  .rated-field-options .rated-choice span {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .rated-level-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rated-choice {
    padding: 10px;
  }

  .rated-choice strong {
    font-size: 13px;
  }

  .rated-choice small {
    font-size: 12px;
  }

  .rated-setup-head {
    align-items: flex-start;
    flex-direction: row;
  }

  .rated-setup-head .practice-secondary-link {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .rated-count-row,
  .rated-set-head,
  .rated-result-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .rated-setup-actions,
  .rated-setup-actions .practice-submit-btn,
  .rated-setup-actions .practice-text-btn,
  .rated-bottom-actions .practice-submit-btn,
  .rated-bottom-actions .practice-text-btn {
    width: 100%;
  }
}

.auth-page {
  min-height: 100vh;
  background: #f4f7fb;
  color: #132033;
}

.auth-main {
  display: grid;
  place-items: start center;
  min-height: calc(100vh - 92px);
  padding: 28px 20px 80px;
}

.account-main {
  place-items: start center;
}

.auth-card {
  box-sizing: border-box;
  width: min(100%, 460px);
  padding: 32px;
  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;
}

.auth-card h1 {
  margin: 0 0 22px;
  font-family: inherit;
  font-size: clamp(2.3rem, 7vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.02;
}

.account-card {
  width: min(100%, 720px);
}

.account-settings {
  display: grid;
  gap: 22px;
}

.account-form {
  padding-top: 20px;
  border-top: 1px solid #d8e1ef;
}

.account-form h2 {
  margin: 0;
  color: #132033;
  font-size: 22px;
  line-height: 1.2;
}

.account-inline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.account-inline-row .auth-field input {
  width: 100%;
}

.account-inline-submit {
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

.account-note {
  margin: 0 0 18px;
  color: #4b5f79;
  font-weight: 700;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 8px;
  color: #173055;
  font-weight: 800;
}

.auth-field input {
  width: calc(100% - 10px);
  box-sizing: border-box;
  min-height: 48px;
  padding: 0 14px;
  color: #132033;
  background: #f8fbff;
  border: 1px solid #cfe0fb;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  outline: none;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.auth-field input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.auth-submit {
  width: calc(100% - 10px);
  margin-top: 6px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.auth-forgot-btn {
  justify-self: start;
  margin-top: -6px;
  padding: 0;
  color: #1d4ed8;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.auth-forgot-btn:hover {
  text-decoration: underline;
}

.auth-message {
  min-height: 24px;
  margin: 16px 0 0;
  color: #4b5f79;
  font-weight: 700;
  line-height: 1.5;
}

.auth-message:empty {
  display: none;
}

.auth-message[data-message-type="success"] {
  color: #047857;
}

.auth-message[data-message-type="error"] {
  color: #b91c1c;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.auth-links a {
  color: #1d4ed8;
  font-weight: 800;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

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

html[data-theme="dark"] .auth-card {
  background: #14203a;
  border-color: #223a5e;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.28);
}

html[data-theme="dark"] .account-form {
  border-color: #223a5e;
}

html[data-theme="dark"] .account-form h2 {
  color: #e5edf8;
}

html[data-theme="dark"] .account-note {
  color: #9cadc5;
}

html[data-theme="dark"] .auth-field {
  color: #d3e5ff;
}

html[data-theme="dark"] .auth-field input {
  color: #e5edf8;
  background: #0f1a30;
  border-color: #35527f;
}

html[data-theme="dark"] .auth-field input:focus {
  background: #101d35;
  border-color: #8ec5ff;
  box-shadow: 0 0 0 4px rgba(142, 197, 255, 0.16);
}

html[data-theme="dark"] .auth-message {
  color: #9cadc5;
}

html[data-theme="dark"] .auth-message[data-message-type="success"] {
  color: #86efac;
}

html[data-theme="dark"] .auth-message[data-message-type="error"] {
  color: #fca5a5;
}

html[data-theme="dark"] .auth-forgot-btn {
  color: #8ec5ff;
}

html[data-theme="dark"] .auth-links a {
  color: #8ec5ff;
}

@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-page .home-header-inner {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .home-page .site-logo-link {
    min-width: 0;
  }

  .home-page .site-logo-home {
    height: 44px;
    max-width: min(44vw, 154px);
  }

  .home-page .home-header-actions {
    min-width: 0;
    margin-left: auto;
  }

  .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%;
  }

  .home-account,
  .home-account-menu {
    width: 100%;
  }

  .home-account-menu {
    left: 0;
    right: auto;
  }

  .home-page .home-account {
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .home-page .home-account-menu {
    left: auto;
    right: 0;
    width: min(180px, calc(100vw - 32px));
  }

  .home-page .home-header .home-nav-btn {
    width: auto;
    min-height: 38px;
    padding: 0 9px;
    border-radius: 11px;
    flex: 0 0 auto;
    font-size: 13px;
  }

  .auth-main {
    padding-top: 18px;
    padding-inline: 16px;
  }

  .auth-card {
    width: 100%;
    padding: 24px;
    border-radius: 20px;
  }

  .account-inline-row {
    grid-template-columns: 1fr;
  }

  .account-inline-submit {
    width: calc(100% - 10px);
  }
}

.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-upcoming-panel {
  align-content: start;
}

.contest-upcoming-panel::before {
  display: none;
}

.contest-upcoming-panel h2 {
  margin: 0;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0;
  line-height: 1.2;
}

.contest-upcoming-list {
  display: grid;
  gap: 8px;
}

.contest-upcoming-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2eaf5;
  border-radius: 8px;
  background: #f8fbff;
  color: #173055;
  text-decoration: none;
}

.contest-upcoming-item:hover {
  border-color: #bfdbfe;
  background: #edf4ff;
}

.contest-upcoming-item span {
  min-width: 0;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.contest-upcoming-item time,
.contest-upcoming-empty {
  color: #4b5f79;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.contest-upcoming-item time {
  text-align: right;
  white-space: nowrap;
}

.contest-upcoming-empty {
  margin: 0;
}

.contest-guide-note-strip {
  box-sizing: border-box;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid var(--contest-section-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.contest-guide-note-strip p {
  margin: 0;
  color: #4b5f79;
  font-size: 14px;
  line-height: 1.55;
}

.contest-guide-note-strip strong {
  color: #173055;
}

.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;
  -webkit-overflow-scrolling: touch;
}

.contest-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  table-layout: fixed;
}

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

.contest-table th:nth-child(1),
.contest-table td:nth-child(1) {
  width: 15%;
}

.contest-table th:nth-child(2),
.contest-table td:nth-child(2) {
  width: 17%;
}

.contest-table th:nth-child(3),
.contest-table td:nth-child(3) {
  width: 18%;
}

.contest-table th:nth-child(4),
.contest-table td:nth-child(4) {
  width: 32%;
}

.contest-table th:nth-child(5),
.contest-table td:nth-child(5) {
  width: 18%;
}

.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-title-row {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.contest-card-title-row h2 {
  min-width: 0;
}

.contest-card-actions {
  flex: 0 0 auto;
  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 {
  box-sizing: border-box;
  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;
  text-align: center;
  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-guide-note-strip p,
html[data-theme="dark"] .contest-table td,
html[data-theme="dark"] .contest-detail-grid dd {
  color: #9cadc5;
}

html[data-theme="dark"] .contest-guide-note-strip {
  background: rgba(20, 32, 58, 0.72);
  border-color: var(--contest-section-border);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.22);
}

html[data-theme="dark"] .contest-guide-note-strip strong,
html[data-theme="dark"] .contest-upcoming-item span {
  color: #f8fbff;
}

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

html[data-theme="dark"] .contest-upcoming-item:hover {
  background: #203659;
  border-color: #35527f;
}

html[data-theme="dark"] .contest-upcoming-item time,
html[data-theme="dark"] .contest-upcoming-empty {
  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-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .contest-info-header-inner {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .contest-info-page .site-logo-link {
    min-width: 0;
  }

  .contest-info-page .site-logo {
    height: 44px;
    max-width: min(44vw, 154px);
  }

  .contest-info-header-actions {
    width: auto;
    min-width: 0;
    margin-left: auto;
    flex-wrap: nowrap;
  }

  .contest-info-header-actions .home-account {
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .contest-info-header-actions .home-account-menu {
    left: auto;
    right: 0;
    width: min(180px, calc(100vw - 32px));
  }

  .contest-info-header-actions .home-nav-btn {
    width: auto;
    min-height: 38px;
    padding: 0 9px;
    border-radius: 11px;
    flex: 0 0 auto;
    font-size: 13px;
  }

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

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

  .contest-card-title-row {
    width: 100%;
    align-items: flex-start;
    gap: 10px;
  }

  .contest-card-official-link {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 0 11px;
    border-radius: 12px;
    font-size: 13px;
  }

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

  .contest-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .contest-table thead {
    display: none;
  }

  .contest-table tbody {
    display: grid;
    gap: 10px;
  }

  .contest-table tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #d8e1ef;
    border-radius: 12px;
    background: #f8fbff;
  }

  .contest-table th:nth-child(n),
  .contest-table td:nth-child(n) {
    width: auto;
  }

  .contest-table td {
    display: block;
    padding: 0;
    border-bottom: 0;
    font-size: 13px;
    line-height: 1.35;
  }

  .contest-table td::before {
    display: none;
  }

  .contest-table td[colspan] {
    display: block;
  }

  .contest-table td[colspan]::before {
    display: none;
  }

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

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

@media (max-width: 700px) {
  .search-page .top-inner,
  .problem-page .top-inner,
  .practice-page .top-inner,
  .dashboard-page .top-inner,
  .personal-profile-page .top-inner,
  .rated-practice-page .top-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .search-page .top .site-logo-link,
  .problem-page .top .site-logo-link,
  .practice-page .top .site-logo-link,
  .dashboard-page .top .site-logo-link,
  .personal-profile-page .top .site-logo-link,
  .rated-practice-page .top .site-logo-link {
    min-width: 0;
    order: 1;
  }

  .search-page .top .site-logo,
  .problem-page .top .site-logo,
  .practice-page .top .site-logo,
  .dashboard-page .top .site-logo,
  .personal-profile-page .top .site-logo,
  .rated-practice-page .top .site-logo {
    height: 44px;
    max-width: min(44vw, 154px);
  }

  .search-page .page-header-copy,
  .practice-page .page-header-copy,
  .dashboard-page .page-header-copy,
  .personal-profile-page .page-header-copy,
  .rated-practice-page .page-header-copy {
    width: 100%;
    order: 3;
  }

  .top-actions {
    width: auto;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    order: 2;
  }

  .top-actions .home-account {
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .top-actions .home-nav-btn {
    width: auto;
    min-height: 38px;
    padding: 0 9px;
    border-radius: 11px;
    flex: 0 1 auto;
    font-size: 13px;
  }

  .top-actions .home-account-menu {
    left: auto;
    right: 0;
    width: min(180px, calc(100vw - 32px));
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .practice-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .practice-section-heading .practice-muted {
    text-align: left;
  }

  .practice-contest-grid,
  .practice-year-grid {
    grid-template-columns: 1fr;
  }

  .practice-intro,
  .practice-ongoing-card,
  .practice-test-toolbar,
  .practice-result-banner,
  .practice-problem-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .practice-ongoing-actions,
  .practice-problem-actions,
  .practice-result-actions,
  .practice-result-stats {
    justify-content: flex-start;
    justify-items: start;
  }

  .practice-report-status {
    text-align: left;
  }

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

  .practice-choice-btn {
    flex-basis: 100%;
  }

  .practice-test-toolbar {
    position: static;
  }
}
