:root {
  --paper: #fbfaf6;
  --surface: #ffffff;
  --surface-tint: #f3f5ee;
  --ink: #161713;
  --muted: #60645c;
  --line: #d9d9cf;
  --olive: #596018;
  --olive-strong: #3e4410;
  --blue: #235a83;
  --coral: #c95043;
  --coral-soft: #fff0ed;
  --amber: #fff7da;
  --focus: #0b6fb3;
  --shadow: 0 18px 50px rgba(34, 37, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--blue);
  text-underline-offset: 0.18em;
}

a:hover {
  color: #123f60;
}

button,
select,
input {
  font: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
}

.brand-mark {
  flex: 0 0 auto;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--olive);
  border: 1px solid #303407;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 900;
}

.brand-eyebrow,
.kicker,
.detail-kicker {
  margin: 0;
  color: var(--olive);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-name {
  margin: 0;
  font-weight: 800;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  white-space: nowrap;
}

.site-nav a {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--olive);
}

.saved-link span {
  display: inline-grid;
  min-width: 1.55em;
  min-height: 1.55em;
  margin-left: 4px;
  place-items: center;
  color: #fff;
  background: var(--olive);
  border-radius: 999px;
  font-size: 0.75rem;
}

main {
  padding: 0 clamp(16px, 4vw, 48px) 48px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
  padding: clamp(22px, 4vw, 48px) 0 16px;
}

.intro-copy {
  max-width: 800px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.nowrap {
  white-space: nowrap;
}

h1 {
  max-width: 820px;
  margin: 8px 0 12px;
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  line-height: 1.14;
}

h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.25;
}

h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.lead {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.update-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 0;
}

.update-row div {
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.update-row dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.update-row dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.disclosure {
  padding: 16px 18px;
  border: 1px solid var(--coral);
  background: var(--coral-soft);
}

.intro-side {
  display: grid;
  gap: 14px;
}

.disclosure .tag {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 7px;
  color: #fff;
  background: var(--coral);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 800;
}

.disclosure h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.disclosure p {
  margin: 0 0 12px;
}

.concept-preview {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.concept-preview.source-visual {
  max-width: 620px;
  margin-bottom: 14px;
}

.concept-preview img {
  display: block;
  width: 100%;
  height: clamp(150px, 16vw, 210px);
  object-fit: cover;
  object-position: top left;
}

.concept-preview figcaption {
  padding: 8px 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

.criteria,
.controls,
.sources,
.saved-section,
.faq {
  padding: 20px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 14px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.section-heading.compact {
  margin-bottom: 12px;
}

.criteria-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px;
  border: 1px solid var(--line);
  background: var(--line);
  list-style: none;
}

.criteria-list li {
  min-height: 96px;
  padding: 14px 16px;
  background: var(--surface);
}

.criteria-list strong,
.criteria-list span {
  display: block;
}

.criteria-list span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.filter-grid label,
.sort-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.filter-grid select,
.filter-grid input,
.sort-control select {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.search-field {
  min-width: 210px;
}

.button {
  min-height: 46px;
  padding: 10px 16px;
  color: #fff;
  border: 1px solid var(--olive);
  border-radius: 6px;
  background: var(--olive);
  font-weight: 800;
  cursor: pointer;
}

.button:hover {
  background: var(--olive-strong);
}

.button.secondary {
  color: var(--olive);
  background: var(--surface);
}

.button.secondary:hover {
  color: #fff;
  background: var(--olive);
}

.comparison-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 430px);
  gap: 18px;
  align-items: start;
  padding-top: 10px;
}

.comparison-main,
.detail-panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.comparison-main {
  min-width: 0;
}

.table-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar p {
  margin: 0;
  color: var(--muted);
}

.sort-control {
  min-width: 170px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.table-scroll {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

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

.comparison-table th {
  color: var(--muted);
  background: var(--surface-tint);
  font-size: 0.84rem;
  font-weight: 800;
}

.comparison-table tr.is-selected td {
  background: #fbfbef;
  box-shadow: inset 4px 0 0 var(--olive);
}

.school-cell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.school-cell strong,
.school-cell small,
.comparison-table td small {
  display: block;
}

.school-cell small,
.comparison-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.score {
  display: inline-block;
  font-weight: 900;
}

.rank {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pill,
.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill.positive,
.status.checked,
.status-dot.checked {
  color: #174c25;
  background: #e8f5e9;
}

.pill.neutral,
.status.partial,
.status-dot.partial {
  color: #5a4400;
  background: var(--amber);
}

.pill.muted {
  color: var(--muted);
  background: #f0f0ec;
}

.status.caution,
.status-dot.caution {
  color: #8a2117;
  background: var(--coral-soft);
}

.logo-token {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.logo-token.small {
  width: 30px;
  height: 30px;
  font-size: 0.65rem;
}

.logo-dmm {
  background: #111;
}

.logo-shiftai {
  background: #bc2c70;
}

.logo-samurai {
  background: #d93425;
}

.logo-aidemy {
  background: #00a79d;
}

.logo-kikagaku {
  background: #405eb8;
}

.logo-techcamp {
  background: #1b365d;
}

.note {
  margin: 0;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-panel {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 108px);
  overflow: auto;
  box-shadow: var(--shadow);
}

.detail-panel > div {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.detail-head {
  display: grid;
  gap: 6px;
}

.detail-head h2 {
  margin: 0;
  font-size: 1.5rem;
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
}

.detail-list div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.detail-list div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
}

.detail-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.source-box,
.fit-box,
.caution-box {
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.source-box {
  border-color: var(--olive);
  background: #fbfbef;
}

.caution-box {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.source-box p {
  margin: 0 0 10px;
}

.source-box ul,
.fit-box ul,
.caution-box ul {
  margin: 0;
  padding-left: 1.1em;
}

.source-box li + li,
.fit-box li + li,
.caution-box li + li {
  margin-top: 6px;
}

.source-box span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.save-button {
  width: 100%;
}

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

.source-card {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.source-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-card p {
  color: var(--muted);
}

.source-card ul {
  margin: 0;
  padding-left: 1.1em;
}

.saved-list {
  display: grid;
  gap: 10px;
}

.saved-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.saved-card h3,
.saved-card p {
  margin: 0;
}

.saved-card p,
.empty {
  color: var(--muted);
}

.text-button {
  padding: 0;
  color: var(--blue);
  border: 0;
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.faq details {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  padding: 16px;
  font-weight: 800;
  cursor: pointer;
}

.faq details p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 24px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1180px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .intro,
  .comparison-shell {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }

  .criteria-list,
  .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  main {
    padding-inline: 12px;
  }

  .intro {
    padding-top: 26px;
  }

  h1 {
    font-size: 1.9rem;
  }

  .site-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    white-space: normal;
  }

  .criteria-list,
  .source-grid,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .update-row {
    display: grid;
  }

  .table-toolbar,
  .saved-card {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-control {
    min-width: 0;
  }

  .table-scroll {
    overflow: visible;
  }

  .comparison-table {
    min-width: 0;
  }

  .comparison-table thead {
    display: none;
  }

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

  .comparison-table tr {
    border-bottom: 1px solid var(--line);
  }

  .comparison-table td {
    display: grid;
    grid-template-columns: minmax(104px, 35%) minmax(0, 1fr);
    gap: 10px;
    border-bottom: 0;
  }

  .comparison-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
  }

  .comparison-table td:first-child {
    grid-template-columns: 1fr;
  }

  .comparison-table td:first-child::before {
    display: none;
  }

  .school-cell {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .site-footer {
    display: block;
  }

  .site-footer p + p {
    margin-top: 8px;
  }
}

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