:root {
  color-scheme: light;
  --ink: #142c3f;
  --blue: #064e83;
  --dim: #3f586b;
  --line: #c4d2db;
  --paper: #f7fafb;
  --navy: #133650;
  --ice: #a3dbf2;
  --copper: #a94b26;
  font:
    16px/1.55 "Segoe UI",
    "Yu Gothic UI",
    Meiryo,
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  border-top: 5px solid var(--blue);
}
a {
  color: var(--blue);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid #c75d22;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.shell {
  max-width: 1160px;
  margin: auto;
  padding: 0 clamp(18px, 5vw, 72px);
}
header,
footer,
.feature-head,
.feature-bottom,
.buttons,
.inputrow {
  display: flex;
  align-items: center;
}
header {
  min-height: 92px;
  padding-top: 14px;
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
  gap: 4px 16px;
  flex-wrap: wrap;
}
.section-nav {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(14px, 3vw, 36px);
  align-self: end;
}
.section-nav a {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.section-nav a:hover,
.section-nav a[aria-current] {
  color: var(--blue);
  border-color: var(--copper);
}
.brand {
  color: var(--navy);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -1.4px;
  text-decoration: none;
}
.languages {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
.languages a {
  color: var(--dim);
  font-size: 14px;
  text-decoration: none;
  padding: 5px 0;
}
.languages a[aria-current] {
  color: var(--blue);
  font-weight: 700;
  border-bottom: 2px solid var(--blue);
}
main {
  padding: 40px 0 32px;
}
.home-intro,
.workspace,
.columns {
  display: grid;
  gap: clamp(20px, 4vw, 54px);
}
.home-intro {
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  margin-bottom: 44px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-family: Georgia, "Yu Mincho", "MS PMincho", serif;
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-wrap: balance;
}
html[lang="ja"] h1 {
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.03em;
  line-break: strict;
}
.deck {
  color: var(--dim);
  font-size: 17px;
  max-width: 67ch;
  margin: 15px 0;
}
.feature,
.readout {
  background: var(--navy);
  color: white;
  border-radius: 10px;
}
.feature {
  display: block;
  padding: 18px 22px 12px;
  text-decoration: none;
  transition: background 0.2s;
}
.feature:hover {
  background: #19425f;
  text-decoration: none;
}
.feature-head,
.feature-bottom {
  justify-content: space-between;
  gap: 12px;
}
.feature-head span {
  font-weight: 600;
}
.feature-head strong {
  font:
    500 clamp(21px, 3vw, 34px) / 1.2 Consolas,
    monospace;
  color: var(--ice);
}
.feature-bottom {
  border-top: 1px solid #537184;
  padding-top: 8px;
  font-size: 13px;
  color: #d3e7ef;
}
.feature-bottom b {
  font-size: 18px;
}
.field-diagram {
  object-fit: contain;
  display: block;
  width: 100%;
  height: auto;
  max-height: 147px;
}
.columns {
  grid-template-columns: 1fr 1fr;
}
.list {
  border-top: 3px solid var(--navy);
  padding-top: 10px;
}
.list h2,
article h2,
.calculator h2 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.home-section h2 a {
  display: inline-flex;
  gap: 7px;
  align-items: baseline;
  color: var(--navy);
  text-decoration: none;
}
.home-section h2 a:hover, .home-section li a:hover {
  text-decoration: underline;
}
.home-section h2 span { color: var(--copper); }
.home-section > p { color: var(--dim); margin-top: 5px; }
.home-section ul, .related ul { margin: 10px 0 0; padding-left: 20px; }
.home-section li, .related li { margin: 5px 0; }
.section-entries { max-width: 780px; margin: 28px 0; border-top: 2px solid var(--navy); }
.model-plot { margin: 18px 0; }
.model-plot canvas {
  display: block;
  height: auto;
  width: 100%;
  background: #eaf2f4;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.model-plot figcaption, .reference-data caption { margin: 6px 0; color: var(--dim); font-size: 14px; }
.reference-data { margin: 14px 0 22px; }
.reference-data table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(13px, 2vw, 16px);
  font-variant-numeric: tabular-nums;
}
.reference-data caption { text-align: start; }
.reference-data th, .reference-data td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.reference-data thead th { background: #e4edf2; color: var(--navy); vertical-align: bottom; }
.reference-data tbody th { font-weight: 500; }
.reference-data tbody tr:nth-child(even) { background: #eef4f6; }
.product-shelf { margin-top: 32px; max-width: 780px; }
.product-shelf h2 { font-size: 21px; }
.purchase-box { max-width: 740px; background: #e8f1f4; border: 1px solid var(--line); border-radius: 8px; padding: clamp(16px, 3vw, 25px); margin-top: 22px; }
.purchase-box p { margin-top: 10px; }
.shop-price { display: block; font-size: 22px; color: var(--navy); }
.shop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 16px 0 5px; }
.shop-action { color: white; background: var(--blue); padding: 8px 14px; border-radius: 4px; display: inline-block; text-decoration: none; }
.shop-action:hover { background: var(--navy); }
.shop-secondary { font-weight: 600; }
.input-hint { font-size: 14px; color: var(--dim); margin-top: 8px; }
.sag-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; align-items: end; }
.sag-parts { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; border-top: 1px solid #577180; padding-top: 14px; margin: 14px 0; }
.sag-parts dt { color: #d3e7ef; }
.sag-parts dd { margin: 0; font-variant-numeric: tabular-nums; text-align: end; overflow-wrap: anywhere; }
.sag-math { overflow-wrap: anywhere; }
@media (max-width: 430px) {
  .sag-fields { grid-template-columns: 1fr; }
  .sag-parts { display: block; }
  .sag-parts dd { text-align: start; margin-bottom: 6px; }
}
.entry {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.entry h3 {
  font-size: 17px;
  font-weight: 620;
  line-height: 1.4;
}
.entry p {
  font-size: 14px;
  line-height: 1.48;
  color: var(--dim);
  margin-top: 3px;
}
.entry span {
  color: var(--copper);
  font-weight: bold;
}
.back {
  display: inline-block;
  font-size: 14px;
  margin-bottom: 16px;
}
.detail-title {
  font-size: clamp(32px, 4.2vw, 55px);
  max-width: 26ch;
}
.workspace {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px;
  background: #e4edf2;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 23px 0;
}
.calculator,
.readout {
  padding: 22px;
}
.calculator {
  background: white;
  border-radius: 7px;
}
.field {
  margin-top: 11px;
}
.field label {
  display: block;
  font-size: 14px;
  font-weight: 620;
  margin-bottom: 3px;
}
.inputrow {
  gap: 6px;
}
.inputrow input,
.inputrow select {
  min-width: 0;
  padding: 7px;
  border: 1px solid #7693a7;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.inputrow input {
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.inputrow select {
  flex: none;
}
.primary {
  margin-top: 16px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 7px 15px;
}
.primary span {
  margin-left: 8px;
}
.readout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.readout > span {
  color: #d3e7ef;
  font-size: 14px;
}
.readout output {
  font:
    500 clamp(27px, 4.4vw, 55px) / 1.35 Consolas,
    monospace;
  color: white;
  overflow-wrap: anywhere;
}
.readout .field-diagram {
  max-height: 120px;
}
.equation {
  font:
    18px Georgia,
    serif;
  margin-top: 22px;
  color: var(--ice);
}
.error {
  color: #962b15;
  font-size: 14px;
  margin: 10px 0 0;
}
article {
  max-width: 74ch;
  margin-top: 26px;
}
article h2 {
  margin-top: 22px;
}
article p {
  margin: 7px 0 15px;
}
.math {
  font:
    22px Georgia,
    serif;
}
.related {
  border-left: 3px solid var(--copper);
  padding: 6px 15px;
  margin: 25px 0 15px;
}
.related span {
  display: block;
  font-size: 13px;
  color: var(--dim);
}
.related a {
  font-weight: 600;
}
details summary {
  cursor: pointer;
  color: var(--dim);
  font-size: 14px;
}
.choice {
  border: 1px solid #b5c8d3;
  border-radius: 6px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  margin: 8px 0 16px;
  background: #edf3f6;
}
.choice strong {
  font-size: 15px;
}
.choice p {
  font-size: 13px;
  margin-top: 2px;
  color: var(--dim);
}
.buttons {
  gap: 8px;
  flex-wrap: wrap;
}
.buttons button {
  padding: 5px 11px;
  background: white;
  color: var(--blue);
  border: 1px solid #728da0;
  border-radius: 4px;
  white-space: nowrap;
}
footer {
  gap: 14px;
  flex-wrap: wrap;
  padding: 19px 0 30px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
footer button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.skip {
  position: fixed;
  left: 12px;
  top: -100px;
  z-index: 5;
  background: white;
  padding: 8px;
}
.skip:focus {
  top: 8px;
}
@media (max-width: 720px) {
  .home-intro,
  .columns,
  .workspace {
    grid-template-columns: 1fr;
  }
  .home-intro {
    margin-bottom: 29px;
  }
  .feature .field-diagram {
    max-height: 118px;
  }
  .workspace {
    gap: 9px;
    padding: 8px;
  }
  .readout,
  .calculator {
    padding: 16px;
  }
  .detail-title {
    max-width: none;
  }
  .choice {
    align-items: flex-start;
    flex-direction: column;
  }
  .languages {
    gap: 10px;
  }
  .columns {
    gap: 26px;
  }
  main {
    padding: 25px 0;
  }
  header {
    padding: 8px 0 0;
  }
  .section-nav { gap: 0 16px; }
  .section-nav a { font-size: 14px; }
  .related {
    overflow-wrap: anywhere;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
