:root {
  color-scheme: light;
  --navy: #14243b;
  --ink: #1f2e43;
  --muted: #45576d;
  --link: #244e7a;
  --line: #d6dee8;
  --paper: #fff;
  --canvas: #f3f5f8;
  --tint: #e9eef5;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: system-ui, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.65;
  line-break: strict;
}

a {
  color: var(--link);
  text-underline-offset: .2em;
}

a:focus-visible,
.table-scroll:focus-visible {
  outline: 2px solid #5989bb;
  outline-offset: 4px;
}

.shell {
  width: min(100%, 72rem);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-heading {
  color: var(--paper);
  background: var(--navy);
}

.heading-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem 1.5rem;
  padding-block: .65rem;
}

.brand {
  display: inline-block;
  padding-block: .35rem;
  color: inherit;
  font-size: 1.125rem;
  font-weight: 750;
  text-decoration: none;
}

.subject-nav,
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .65rem;
}

.subject-nav a {
  display: inline-block;
  padding: .4rem .65rem;
  border-radius: .3rem;
  color: #e5edf7;
  font-size: .9rem;
  text-decoration: none;
}

.subject-nav a:hover,
.subject-nav a[aria-current="page"] {
  color: #fff;
  background: #314763;
}

main {
  padding-block: clamp(1.75rem, 5vw, 3.75rem);
}

h1, h2 {
  line-height: 1.3;
}

h1 {
  margin: 0 0 .65rem;
  color: var(--navy);
  font-size: clamp(1.7rem, 4.8vw, 3rem);
}

h2 {
  margin: 0 0 .7rem;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
}

p {
  margin: 0 0 .85rem;
}

.intro {
  max-width: 49rem;
}

.ad-notice {
  width: fit-content;
  margin: .95rem 0 0;
  padding: .25rem .65rem;
  border-inline-start: 3px solid #718ba9;
  background: var(--tint);
  color: var(--muted);
  font-size: .875rem;
}

.content-section,
.level {
  margin-top: clamp(1.65rem, 4vw, 2.6rem);
}

.subject-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: .65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subject-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--paper);
  font-weight: 700;
  text-decoration: none;
}

.subject-list a:hover {
  border-color: var(--link);
}

.count {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
}

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

table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: .925rem;
}

th, td {
  padding: .65rem .85rem;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

thead th {
  background: var(--tint);
  white-space: nowrap;
}

tbody th {
  width: 53%;
  font-weight: 600;
}

td:nth-child(2) {
  min-width: 9rem;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

.book-note {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 400;
}

.amazon-link {
  white-space: nowrap;
}

@media (max-width: 640px) {
  table {
    min-width: 0;
    font-size: .85rem;
  }

  th, td {
    padding: .5rem .45rem;
  }

  thead th {
    white-space: normal;
  }

  tbody th {
    width: auto;
  }

  td:nth-child(2) {
    min-width: 0;
  }
}

.site-footer {
  padding-block: 1.35rem 2.3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}

.footer-nav {
  gap: .3rem 1.15rem;
  margin-bottom: .8rem;
}

@media (max-width: 37rem) {
  .heading-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .subject-nav {
    margin-inline-start: -.3rem;
    gap: .2rem;
  }

  .subject-nav a {
    padding-inline: .4rem;
  }
}
