:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --paper: #fff;
  --ink: #252525;
  --muted: #6f6b63;
  --line: #dedbd2;
  --soft: #ece8dd;
  --accent: #006c67;
  --accent-ink: #004845;
  --mark: #fff2a6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  letter-spacing: 0;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.site {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.site-home {
  width: min(920px, calc(100% - 32px));
  padding-top: 48px;
}

header {
  display: grid;
  gap: 16px;
  padding: 18px 0 24px;
  border-bottom: 1px solid var(--line);
}

.hero {
  gap: 18px;
  padding: 28px 0 30px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 58px);
  line-height: 1.1;
  font-weight: 760;
}

.hero h1 {
  font-size: clamp(34px, 7vw, 64px);
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

p {
  margin: 0;
}

.lead {
  max-width: 780px;
  color: var(--muted);
  font-size: 16px;
}

.site-home .lead {
  max-width: 720px;
}

.back {
  width: fit-content;
  font-size: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.search {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 22px 0 28px;
  padding: 12px;
  background: rgba(247, 246, 242, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
}

label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

input[type="search"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

input[type="search"]:focus {
  outline: 2px solid rgba(0, 108, 103, 0.24);
  border-color: var(--accent);
}

main {
  display: grid;
  gap: 34px;
}

.site-home main {
  gap: 24px;
  padding: 28px 0;
}

section {
  scroll-margin-top: 84px;
}

.summary {
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.summary ul {
  margin: 10px 0 0;
  padding-left: 1.2em;
  color: var(--muted);
}

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

.category-card {
  display: grid;
  gap: 8px;
  min-height: 124px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.category-card strong {
  color: var(--accent-ink);
  font-size: 17px;
  line-height: 1.4;
}

.category-card span {
  color: var(--muted);
  font-size: 14px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.note {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  background: var(--soft);
  color: #3d3932;
  font-weight: 700;
  white-space: nowrap;
}

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

td:first-child {
  color: var(--accent-ink);
  font-weight: 700;
  white-space: nowrap;
}

mark {
  background: var(--mark);
  color: inherit;
  padding: 0 0.1em;
}

.empty {
  display: none;
  padding: 18px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

body.no-results .empty {
  display: block;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-home footer {
  margin-top: 18px;
}

footer a {
  color: inherit;
}

@media (max-width: 760px) {
  .site,
  .site-home {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .site-home {
    padding-top: 28px;
  }

  .hero {
    padding-top: 16px;
  }

  .actions,
  .search-inner,
  .section-head {
    display: grid;
    gap: 6px;
  }

  .actions {
    align-items: stretch;
  }

  .search {
    margin-left: -10px;
    margin-right: -10px;
    padding: 10px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 680px;
    font-size: 13px;
  }

  th,
  td {
    padding: 10px;
  }
}

.affiliate-footer {
  margin: 28px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--border, var(--line, #dedbd2));
  border-radius: 8px;
  background: var(--paper, #fff);
  color: var(--muted, #666);
  font-size: 0.84rem;
  line-height: 1.65;
}

.affiliate-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted, #666);
}

.affiliate-note {
  margin: 0 0 10px;
}

.amazon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--accent, #006c67);
  border-radius: 6px;
  background: transparent;
  color: var(--accent-ink, var(--accent, #006c67));
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.amazon-button:hover,
.amazon-button:focus-visible {
  background: var(--soft, #f4f1ea);
  text-decoration: none;
}

@media (max-width: 640px) {
  .affiliate-footer {
    margin: 22px 0 14px;
    padding: 12px 14px;
  }

  .amazon-button {
    width: 100%;
  }
}
