:root {
  color-scheme: light;
  --color-bg: #f4f1e9;
  --color-surface: #fbfaf6;
  --color-text: #20231f;
  --color-muted: #62685f;
  --color-line: #d4d1c8;
  --color-accent: #27694f;
  --color-accent-soft: #e0ebe4;
  --content-wide: 1120px;
  --content-reading: 800px;
  --page-gutter: clamp(20px, 5vw, 72px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 42%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.reading-column,
.report-shell {
  width: min(calc(100% - 2 * var(--page-gutter) - env(safe-area-inset-left) - env(safe-area-inset-right)), var(--content-reading));
  margin-inline: auto;
}

.report-header {
  padding: clamp(72px, 10vw, 128px) 0 clamp(64px, 8vw, 104px);
}

.report-header h1 {
  max-width: 760px;
  margin: 0 0 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 6.2vw, 4.9rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.report-header p,
.report-header ul {
  margin: 0 0 1.4em;
}

.report-header .dek {
  margin-bottom: 1.8em;
  color: var(--color-accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  line-height: 1.45;
}

.report-header strong,
.report-notes strong {
  font-weight: 500;
}

.report-header ul,
.report-notes ul {
  padding-left: 1.3em;
}

.report-header li,
.report-notes li {
  margin-bottom: 0.35em;
}

code {
  padding: 0.08em 0.28em;
  border: 1px solid var(--color-line);
  border-radius: 3px;
  background: var(--color-surface);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.86em;
}

.section-nav {
  position: sticky;
  z-index: 10;
  top: 0;
  border-block: 1px solid var(--color-line);
  background: color-mix(in srgb, var(--color-bg) 94%, transparent);
  backdrop-filter: blur(10px);
}

.section-nav__inner {
  display: flex;
  width: min(calc(100% - 2 * var(--page-gutter)), var(--content-wide));
  min-height: 58px;
  margin-inline: auto;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.section-nav__inner::-webkit-scrollbar {
  display: none;
}

.section-nav a {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 12px;
  align-items: center;
  flex: 0 0 auto;
  border-radius: 4px;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

.section-nav a:hover {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.report-shell {
  padding: 80px 0 96px;
}

.report-shell h2 {
  margin: 0 0 32px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.quick-choice,
.ranking,
.report-notes {
  scroll-margin-top: 84px;
}

.quick-choice {
  margin-bottom: 104px;
}

.table-wrap {
  border-top: 1px solid var(--color-text);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.45;
}

th,
td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

td:first-child {
  width: 29%;
  font-weight: 500;
}

td:nth-child(2) {
  width: 34%;
}

.ranking > h2 {
  margin-bottom: 40px;
}

.catalog-tools {
  margin-bottom: 80px;
  padding: 24px;
  border-block: 1px solid var(--color-line);
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
}

.catalog-tools label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.catalog-tools input {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid #a9ada5;
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
}

.catalog-tools input:hover,
.catalog-tools input:focus {
  border-color: var(--color-accent);
}

.filter-row {
  display: flex;
  margin-top: 16px;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-row button,
.reset-button {
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.82rem;
}

.filter-row button:hover,
.filter-row button[aria-pressed="true"] {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.catalog-status {
  display: flex;
  min-height: 44px;
  margin-top: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.reset-button {
  border: 0;
  border-radius: 4px;
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.score-band {
  margin-bottom: 96px;
  scroll-margin-top: 84px;
}

.score-band > h2 {
  margin-bottom: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-text);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.niche {
  padding: 52px 0 56px;
  border-bottom: 1px solid var(--color-line);
  scroll-margin-top: 84px;
}

.niche h3 {
  margin: 0 0 30px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.niche dl,
.niche dd {
  margin: 0;
}

.niche dl > div {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 24px;
}

.niche dt,
.niche dd {
  padding: 8px 0;
}

.niche dt {
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.55;
}

.niche dt::after {
  content: ":";
}

.niche dd {
  min-width: 0;
  line-height: 1.62;
}

.report-notes {
  width: 100%;
}

.report-notes h2 {
  margin-top: 96px;
  padding-top: 8px;
  border-top: 1px solid var(--color-text);
  scroll-margin-top: 84px;
}

.report-notes p {
  margin: 0 0 1.35em;
}

.back-to-top {
  display: inline-flex;
  min-height: 44px;
  margin-top: 56px;
  align-items: center;
  color: var(--color-accent);
  font-size: 0.84rem;
  font-weight: 500;
}

@media (max-width: 700px) {
  :root {
    --page-gutter: 20px;
  }

  body {
    font-size: 17px;
  }

  .report-header {
    padding: 60px 0 56px;
  }

  .report-header h1 {
    margin-bottom: 24px;
    font-size: clamp(2.25rem, 10.2vw, 2.55rem);
    overflow-wrap: anywhere;
  }

  .report-header .dek {
    font-size: 1.18rem;
  }

  .section-nav__inner {
    width: 100%;
    padding-inline: calc(var(--page-gutter) + env(safe-area-inset-left)) calc(var(--page-gutter) + env(safe-area-inset-right));
  }

  .report-shell {
    padding: 56px 0 72px;
  }

  .quick-choice {
    margin-bottom: 80px;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

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

  tbody tr {
    padding: 22px 0;
    border-bottom: 1px solid var(--color-line);
  }

  td,
  td:first-child,
  td:nth-child(2),
  td:last-child {
    width: 100%;
    padding: 4px 0;
    border: 0;
  }

  td:first-child {
    margin-bottom: 4px;
  }

  .catalog-tools {
    margin-inline: calc(-1 * var(--page-gutter));
    margin-bottom: 64px;
    padding: 20px var(--page-gutter);
  }

  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-row button {
    flex: 0 0 auto;
  }

  .score-band {
    margin-bottom: 72px;
  }

  .niche {
    padding: 40px 0 44px;
  }

  .niche h3 {
    margin-bottom: 24px;
    font-size: 1.42rem;
    overflow-wrap: anywhere;
  }

  .niche dl > div {
    display: block;
    margin-bottom: 16px;
  }

  .niche dt,
  .niche dd {
    padding: 0;
  }

  .niche dt {
    margin-bottom: 3px;
  }

  .report-notes h2 {
    margin-top: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
