/* RenderRate — 値札を軸にしたデザイン。
   言葉は幅広の書体、数字は縦長の太字（値札の数字）。黄色は「いちばん安い」だけに使う。 */
:root {
  --mist: #EDF1F5;
  --panel: #FFFFFF;
  --ink: #17223B;
  --soft: #4A5876;
  --line: #C9D2DE;
  --sticker: #FFD21F;
  --over: #C81E36;
  --go: #1F3FD1;
  --wide: 116%;
  --narrow: 64%;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}
a { color: var(--go); text-underline-offset: 0.16em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--go); outline-offset: 2px; }
img, svg { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.prose { max-width: 68ch; }

/* ---------- 上の帯 ---------- */
.top { border-bottom: 2px solid var(--ink); background: var(--panel); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding-top: 14px; padding-bottom: 14px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-stretch: var(--wide); font-weight: 800; font-size: 21px; letter-spacing: -0.01em;
}
.brand-tag {
  display: inline-block; width: 22px; height: 22px; background: var(--sticker);
  border: 2px solid var(--ink); transform: rotate(-8deg);
}
.nav { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-left: auto; font-size: 16px; }
.nav a { color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ---------- 見出し ---------- */
h1, h2, h3 { font-stretch: var(--wide); letter-spacing: -0.015em; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(34px, 5.4vw, 60px); font-weight: 800; max-width: 17ch; }
h2 { font-size: clamp(24px, 3vw, 36px); font-weight: 750; margin-top: 64px; margin-bottom: 16px; }
h3 { font-size: 21px; font-weight: 700; }
.lead { font-size: 21px; max-width: 54ch; margin: 18px 0 0; color: var(--ink); }
.page-head { padding: 52px 0 28px; }
.crumbs { font-size: 15px; color: var(--soft); margin: 0; padding-top: 22px; }
.crumbs + .page-head { padding-top: 26px; }
.crumbs a { color: var(--soft); }
p { margin: 0 0 16px; }
main { padding-bottom: 80px; }

/* ---------- 計算機：入力 ---------- */
.calc-form {
  background: var(--panel); border: 2px solid var(--ink);
  padding: 22px 24px 24px; display: grid; gap: 22px;
}
.calc-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.calc-form legend, .calc-q { font-weight: 700; font-size: 18px; padding: 0; margin-bottom: 10px; display: block; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: block; padding: 9px 16px; border: 2px solid var(--line); background: var(--panel);
  font-size: 17px; font-weight: 500;
}
.seg input:hover + span { border-color: var(--ink); }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--go); outline-offset: 2px; }

.vol { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.vol input[type="range"] { flex: 1 1 260px; min-width: 0; accent-color: var(--ink); height: 28px; }
.vol-num { display: inline-flex; align-items: baseline; gap: 8px; }
.vol input[type="number"] {
  width: 5.2em; font: inherit; font-stretch: var(--narrow); font-weight: 800; font-size: 36px; line-height: 1;
  color: var(--ink); border: 0; border-bottom: 3px solid var(--ink); background: transparent;
  padding: 0 2px 2px; text-align: right; -moz-appearance: textfield; appearance: textfield;
}
.vol input[type="number"]::-webkit-outer-spin-button,
.vol input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hint { font-size: 15px; color: var(--soft); margin: 8px 0 0; min-height: 1.5em; }
.opts { display: flex; flex-wrap: wrap; gap: 20px 40px; }

/* ---------- 計算機：結果 ---------- */
.out-head { margin: 36px 0 6px; }
.out-head h2 { margin-top: 0; margin-bottom: 6px; }
.out-note { font-size: 15px; color: var(--soft); max-width: 70ch; margin: 0 0 18px; }

.rows { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 2px solid var(--ink); }
.row {
  display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; gap: 8px 26px; align-items: start;
  padding: 24px; border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }

.price { display: flex; flex-direction: column; align-items: flex-start; padding: 2px 0; }
.price-num {
  font-stretch: var(--narrow); font-weight: 900; font-size: 68px; line-height: 0.92;
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.price-per { font-size: 15px; color: var(--soft); margin-top: 6px; }
.is-best .price {
  background: var(--sticker); border: 2px solid var(--ink); padding: 12px 14px 10px;
  transform: rotate(-2deg); align-self: start; justify-self: start;
}
.is-best .price-per { color: var(--ink); font-weight: 600; }

.row-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.row-plan { font-stretch: 100%; font-weight: 500; font-size: 17px; letter-spacing: 0; color: var(--soft); }
.row-unit { margin: 6px 0 12px; font-weight: 600; }

.math { margin: 0 0 10px; max-width: 46ch; font-size: 16px; }
.math div { display: flex; align-items: baseline; gap: 8px; }
.math dt { order: 1; }
.math div::after { content: ""; order: 2; flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.math dd { order: 3; margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }

.use { font-size: 15px; color: var(--soft); margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.bar { display: inline-block; width: 140px; height: 8px; background: var(--mist); border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--ink); }
.row-rate { font-size: 15px; color: var(--soft); margin: 0; }
.row-free { font-size: 15px; margin: 8px 0 0; }

.row-go { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 15px; padding-top: 4px; }
.btn {
  display: inline-block; background: var(--ink); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 17px; padding: 12px 18px; border: 2px solid var(--ink); white-space: nowrap;
}
.btn:hover { background: var(--go); border-color: var(--go); }

.row.is-out { grid-template-columns: minmax(0, 1fr); background: var(--mist); }
.row.is-out h3 { font-size: 18px; }
.row.is-out p { margin: 4px 0 0; font-size: 16px; color: var(--soft); }
.empty { background: var(--panel); border: 2px solid var(--ink); padding: 24px; }

/* ---------- 表 ---------- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 2px solid var(--ink); }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
thead th { border-top: 0; border-bottom: 2px solid var(--ink); font-weight: 700; white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.big { font-stretch: var(--narrow); font-weight: 800; font-size: 26px; line-height: 1.1; }
td .sub, th .sub { display: block; font-size: 14px; color: var(--soft); font-stretch: 100%; font-weight: 400; letter-spacing: 0; line-height: 1.4; }
td.big.win > span:first-child { background: var(--sticker); padding: 0 6px; box-shadow: 0 0 0 2px var(--ink); display: inline-block; }
caption { text-align: left; padding: 12px 16px; font-size: 15px; color: var(--soft); caption-side: bottom; border-top: 1px solid var(--line); }

/* ---------- 文章まわり ---------- */
.list { padding-left: 1.2em; margin: 0 0 16px; max-width: 68ch; }
.list li { margin-bottom: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; border: 2px solid var(--ink); background: var(--panel); }
.cards a { display: block; padding: 20px; color: var(--ink); text-decoration: none; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cards a:hover { background: var(--sticker); }
.cards strong { display: block; font-stretch: var(--wide); font-size: 19px; font-weight: 700; }
.cards span { font-size: 15px; color: var(--soft); }
.cards a:hover span { color: var(--ink); }
.verdict { background: var(--panel); border: 2px solid var(--ink); border-left-width: 12px; padding: 20px 24px; max-width: 72ch; font-size: 19px; }
.cta-line { margin: 24px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; font-size: 15px; color: var(--soft); }
.sources { font-size: 15px; color: var(--soft); }
.sources a { word-break: break-all; }
.log { list-style: none; padding: 0; margin: 0; background: var(--panel); border: 2px solid var(--ink); }
.log li { padding: 18px 24px; border-top: 1px solid var(--line); }
.log li:first-child { border-top: 0; }
.log time { font-weight: 700; margin-right: 12px; }

/* ---------- 下の帯 ---------- */
.foot { border-top: 2px solid var(--ink); background: var(--panel); padding: 32px 0 48px; font-size: 15px; color: var(--soft); }
.foot-in { display: grid; gap: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot a { color: var(--ink); }
.foot p { margin: 0; max-width: 78ch; }

/* ---------- 狭い画面 ---------- */
@media (max-width: 760px) {
  body { font-size: 17px; }
  .page-head { padding: 34px 0 22px; }
  .calc-form { padding: 18px 16px 20px; }
  .row { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; gap: 14px; }
  .price-num { font-size: 56px; }
  .row-go { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
  .nav { margin-left: 0; width: 100%; }
  h2 { margin-top: 48px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
