:root {
  color-scheme: light;
  --ink: #19353b;
  --ink-soft: #49636a;
  --paper: #f6f1e7;
  --sheet: #fffdf7;
  --line: #cbd3cd;
  --teal: #157a78;
  --teal-pale: #d8ece6;
  --amber: #e7a52d;
  --amber-pale: #f8e5b7;
  --coral: #d9634c;
  --shadow: 0 12px 28px rgb(25 53 59 / 10%);
  font-family: Inter, "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

a {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

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

.site-header {
  align-items: center;
  background: rgb(255 253 247 / 94%);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px max(22px, calc((100vw - 1180px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-size: 17px;
  font-weight: 800;
  gap: 10px;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.brand-mark {
  background: var(--ink);
  border-radius: 3px;
  display: grid;
  gap: 3px;
  padding: 6px;
  transform: rotate(-2deg);
}

.brand-mark i {
  background: var(--sheet);
  border-radius: 1px;
  display: block;
  height: 3px;
  width: 19px;
}

.brand-mark i:last-child {
  background: var(--amber);
  width: 13px;
}

.site-header nav {
  display: flex;
  gap: clamp(14px, 2.6vw, 30px);
}

.site-header nav a {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

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

main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 54px 22px 76px;
}

.hero-shell {
  align-items: center;
  display: grid;
  gap: clamp(32px, 7vw, 86px);
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  min-height: 430px;
  padding: 20px 0 64px;
}

.period-label,
.section-kicker {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.15em;
  margin: 0 0 13px;
  text-transform: uppercase;
}

.hero-copy h1,
.page-intro h1 {
  font-size: clamp(30px, 4vw, 40px);
  letter-spacing: -0.045em;
  line-height: 1.34;
  margin: 0;
  max-width: 14em;
}

.lead,
.page-intro > p:last-child {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.9;
  margin: 22px 0 0;
  max-width: 39em;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.hero-facts span {
  align-items: baseline;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-soft);
  display: inline-flex;
  font-size: 12px;
  gap: 5px;
  padding: 8px 10px;
}

.hero-facts b {
  color: var(--ink);
  font-size: 16px;
}

.condition-desk {
  background: #dfe5dc;
  border: 1px solid #b9c4bc;
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-height: 330px;
  overflow: hidden;
  padding: 32px 48px 38px;
  position: relative;
}

.condition-desk::before {
  border: 14px solid rgb(25 53 59 / 5%);
  content: "";
  inset: 16px;
  opacity: 0.7;
  position: absolute;
}

.desk-tabs {
  display: flex;
  gap: 6px;
  left: 25px;
  position: absolute;
  top: 20px;
}

.desk-tabs i {
  align-items: center;
  background: var(--amber);
  border-radius: 4px 4px 0 0;
  display: flex;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  width: 38px;
}

.desk-tabs i:nth-child(2) {
  background: var(--coral);
  color: white;
}

.desk-tabs i:nth-child(3) {
  background: var(--teal);
  color: white;
}

.job-slip {
  background: var(--sheet);
  border: 1px solid #b9c4bc;
  box-shadow: 0 9px 20px rgb(25 53 59 / 14%);
  margin: 20px auto 0;
  max-width: 420px;
  padding: 26px 28px 22px;
  position: relative;
  transform: rotate(-1.3deg);
  z-index: 2;
}

.job-slip::after {
  border: 1px solid rgb(25 53 59 / 18%);
  content: "";
  inset: 7px;
  pointer-events: none;
  position: absolute;
}

.slip-number {
  background: var(--ink);
  color: white;
  display: inline-grid;
  font-size: 12px;
  font-weight: 800;
  margin-right: 8px;
  padding: 5px 7px;
  place-items: center;
}

.job-slip > strong {
  font-size: 17px;
}

.slip-rule {
  border-top: 1px solid var(--line);
  margin: 19px 0;
}

.condition-stamps {
  display: grid;
  gap: 13px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 20px;
}

.stamp {
  align-items: center;
  border: 3px double currentcolor;
  display: flex;
  justify-content: space-between;
  padding: 12px;
  transform: rotate(1.5deg);
}

.stamp small {
  font-size: 10px;
  font-weight: 800;
}

.stamp b {
  font-size: 19px;
}

.bonus-stamp {
  color: var(--coral);
}

.commute-stamp {
  color: var(--teal);
  transform: rotate(-1deg);
}

.job-slip > small {
  color: var(--ink-soft);
  font-size: 10px;
}

.desk-pocket {
  bottom: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  left: 7%;
  position: absolute;
  right: 7%;
  z-index: 3;
}

.desk-pocket i {
  background: rgb(25 53 59 / 78%);
  border-radius: 4px 4px 0 0;
  display: block;
  height: 23px;
}

.desk-pocket i:nth-child(2) {
  background: rgb(21 122 120 / 78%);
}

.desk-pocket i:nth-child(3) {
  background: rgb(231 165 45 / 82%);
}

.compare-workbench,
.catalogue {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 7px 20px rgb(25 53 59 / 7%);
  margin-top: 22px;
  padding: clamp(22px, 4vw, 42px);
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.section-heading h2,
.results-heading h2 {
  font-size: clamp(22px, 2.5vw, 29px);
  letter-spacing: -0.035em;
  margin: 0;
}

.section-heading > p {
  color: var(--ink-soft);
  font-size: 12px;
  margin: 0;
}

.compare-tools {
  align-items: center;
  display: flex;
  gap: 10px;
}

.compare-tools > span {
  background: var(--teal-pale);
  border-radius: 99px;
  color: #0b5d5c;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 11px;
}

.compare-tools button,
.occupation-card button {
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  min-height: 38px;
  padding: 8px 13px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.metric-controls {
  align-items: end;
  border-bottom: 1px dashed var(--line);
  border-top: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 25px 0;
  padding: 18px 0;
}

.metric-controls > label,
.catalogue-controls label {
  display: grid;
  gap: 7px;
}

.metric-controls label > span,
.catalogue-controls label > span,
.metric-switch legend {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

select,
input[type="search"] {
  background: white;
  border: 1px solid #aebcb6;
  border-radius: 4px;
  min-height: 44px;
  padding: 9px 11px;
}

.metric-switch {
  border: 0;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.metric-switch legend {
  margin-bottom: 7px;
}

.metric-switch label {
  cursor: pointer;
  position: relative;
}

.metric-switch input {
  inset: 0;
  opacity: 0;
  position: absolute;
}

.metric-switch label span {
  background: white;
  border: 1px solid #aebcb6;
  border-radius: 4px;
  color: var(--ink);
  display: block;
  font-size: 13px;
  min-height: 44px;
  padding: 12px 18px;
}

.metric-switch input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.metric-switch input:focus-visible + span {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

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

.empty-compare,
.load-error {
  border: 1px dashed #aebcb6;
  color: var(--ink-soft);
  font-size: 13px;
  grid-column: 1 / -1;
  padding: 38px 20px;
  text-align: center;
}

.comparison-card {
  background: white;
  border: 1px solid var(--line);
  border-top: 5px solid var(--coral);
  min-width: 0;
  padding: 17px;
}

.comparison-card:nth-child(even) {
  border-top-color: var(--teal);
}

.comparison-card.is-unavailable {
  background: #f1f0eb;
  border-top-color: #84928e;
}

.comparison-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.comparison-title span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.comparison-title button {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-size: 21px;
  line-height: 1;
  padding: 2px 5px;
}

.comparison-card h3 {
  font-size: 14px;
  line-height: 1.55;
  margin: 13px 0 22px;
  min-height: 44px;
}

.rate-display {
  display: grid;
  gap: 4px;
}

.rate-display span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.rate-display strong {
  font-size: clamp(23px, 3vw, 31px);
  letter-spacing: -0.04em;
}

.is-unavailable .rate-display strong {
  font-size: 18px;
}

.rate-track {
  background: #e2e7e3;
  height: 7px;
  margin: 11px 0 17px;
  overflow: hidden;
}

.rate-track i {
  background: var(--coral);
  display: block;
  height: 100%;
}

.comparison-card:nth-child(even) .rate-track i {
  background: var(--teal);
}

.breakdown {
  display: grid;
  gap: 7px;
  margin: 0;
}

.breakdown div {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.breakdown dt {
  color: var(--ink-soft);
  font-size: 10px;
}

.breakdown dd {
  font-size: 11px;
  font-weight: 800;
  margin: 0;
}

.record-total,
.unavailable-copy {
  border-top: 1px dotted var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
  margin: 14px 0 0;
  padding-top: 10px;
}

.aggregate-note {
  align-items: center;
  background: var(--amber-pale);
  border-left: 5px solid var(--amber);
  display: flex;
  gap: 17px;
  margin-top: 18px;
  padding: 17px 20px;
}

.aggregate-note > span {
  border: 2px solid var(--ink);
  border-radius: 99px;
  display: grid;
  flex: 0 0 38px;
  font-weight: 900;
  height: 38px;
  place-items: center;
}

.aggregate-note strong {
  font-size: 13px;
}

.aggregate-note p,
.aggregate-note small {
  color: var(--ink-soft);
  display: block;
  font-size: 10px;
  line-height: 1.7;
  margin: 4px 0 0;
}

.catalogue {
  margin-top: 28px;
}

.catalogue-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 0.45fr);
  margin: 25px 0 20px;
}

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

.occupation-card {
  background: white;
  border: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  min-height: 178px;
  padding: 15px;
  transition:
    border-color 150ms ease,
    transform 150ms ease;
}

.occupation-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.occupation-card.is-selected {
  background: #eef8f5;
  border: 2px solid var(--teal);
  padding: 14px;
}

.occupation-code {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.occupation-code span {
  background: var(--amber-pale);
  display: inline-grid;
  font-size: 10px;
  font-weight: 900;
  height: 23px;
  place-items: center;
  width: 23px;
}

.occupation-code b {
  color: #869590;
  font-size: 10px;
}

.occupation-card h3 {
  font-size: 13px;
  line-height: 1.55;
  margin: 11px 0;
}

.occupation-card p {
  color: var(--ink-soft);
  font-size: 10px;
  margin: 0 0 10px;
}

.occupation-card.is-selected button {
  background: var(--teal);
  border-color: var(--teal);
}

.boundary {
  align-items: center;
  background: var(--ink);
  color: white;
  display: flex;
  gap: 22px;
  margin-top: 28px;
  padding: 24px 28px;
}

.boundary-mark {
  border: 2px solid var(--amber);
  color: var(--amber);
  display: grid;
  flex: 0 0 45px;
  font-size: 13px;
  font-weight: 900;
  height: 45px;
  place-items: center;
  transform: rotate(-5deg);
}

.boundary strong {
  font-size: 14px;
}

.boundary p {
  color: #cdd9d6;
  font-size: 11px;
  line-height: 1.8;
  margin: 5px 0 0;
}

.text-page {
  max-width: 940px;
  min-height: calc(100vh - 210px);
}

.page-intro {
  border-bottom: 1px solid var(--line);
  padding: 26px 0 42px;
}

.formula-sheet {
  align-items: center;
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 15px;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  margin: 38px 0;
  padding: clamp(20px, 4vw, 34px);
}

.formula-sheet > div {
  display: grid;
  gap: 6px;
}

.formula-sheet span {
  color: var(--ink-soft);
  font-size: 10px;
}

.formula-sheet strong {
  font-size: clamp(18px, 2.7vw, 27px);
}

.formula-sheet > b,
.formula-sheet > i {
  color: var(--ink-soft);
  font-size: 20px;
  font-style: normal;
}

.formula-result {
  border-left: 4px solid var(--coral);
  padding-left: 15px;
}

.guide-grid,
.privacy-grid,
.source-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 38px 0;
}

.guide-grid article,
.privacy-grid article,
.source-grid article {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 24px;
}

.guide-grid article > span,
.source-grid article > span {
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.guide-grid h2,
.privacy-grid h2,
.source-grid h2,
.note-panel h2,
.source-detail h2 {
  font-size: 18px;
  margin: 9px 0 12px;
}

.guide-grid p,
.privacy-grid p,
.source-grid p,
.note-panel p,
.source-detail dd {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.85;
  margin: 0;
}

.source-grid a,
.note-panel a,
.link-row a {
  color: var(--teal);
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 14px;
}

.note-panel,
.source-detail {
  background: var(--amber-pale);
  border-left: 5px solid var(--amber);
  margin-top: 28px;
  padding: 25px 28px;
}

.source-detail {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
}

.source-detail dl {
  margin: 20px 0 0;
}

.source-detail dl > div {
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 20px;
  grid-template-columns: 90px 1fr;
  padding: 16px 0;
}

.source-detail dt {
  font-size: 12px;
  font-weight: 900;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 24px;
}

footer {
  align-items: end;
  background: var(--ink);
  color: white;
  display: flex;
  justify-content: space-between;
  min-height: 150px;
  padding: 32px max(22px, calc((100vw - 1180px) / 2));
}

footer strong {
  font-size: 15px;
}

footer p {
  color: #b9cbc7;
  font-size: 10px;
  margin: 7px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: #d9e4e1;
  font-size: 11px;
}

@media (max-width: 940px) {
  .hero-shell {
    grid-template-columns: 1fr;
  }

  .condition-desk {
    margin: 0 auto;
    max-width: 620px;
    width: 100%;
  }

  .comparison-grid,
  .occupation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
  }

  .site-header nav {
    gap: 9px 14px;
    justify-content: flex-end;
  }

  .site-header nav a {
    font-size: 10px;
  }

  .site-header nav a:last-child {
    display: none;
  }

  main {
    padding: 35px 15px 58px;
  }

  .hero-shell {
    min-height: auto;
    padding: 10px 0 38px;
  }

  .condition-desk {
    min-height: 280px;
    padding: 31px 18px 34px;
  }

  .job-slip {
    padding: 23px 20px 19px;
  }

  .stamp {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .compare-workbench,
  .catalogue {
    padding: 21px 15px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .metric-controls {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .metric-switch {
    grid-column: 1 / -1;
  }

  .comparison-grid,
  .occupation-grid,
  .catalogue-controls,
  .guide-grid,
  .privacy-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .comparison-card h3 {
    min-height: 0;
  }

  .formula-sheet {
    grid-template-columns: 1fr auto 1fr;
  }

  .formula-sheet > i {
    display: none;
  }

  .formula-result {
    border-left: 0;
    border-top: 4px solid var(--coral);
    grid-column: 1 / -1;
    padding: 14px 0 0;
  }

  .source-detail dl > div {
    gap: 7px;
    grid-template-columns: 1fr;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 27px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
