/* 鯖いくら帳 — 紙と墨と朱。帳面のつもりで組んである。
   色は下の変数だけ。写真は <img> で置き、CSS からは呼ばない。 */
:root {
  --paper: #f3eee3;
  --paper-2: #e9e2d2;
  --ink: #1d1a16;
  --muted: #675f52;
  --rule: #d3c9b5;
  --link: #1f3f6b;
  --shu: #c23b22;
  --shu-ink: #fff8f0;
  --warn-bg: #f6e6b4;
  --warn-ink: #4d3a00;
  --plate: #1d1a16;
  --plate-ink: #efe8da;
  --plate-muted: #b3a995;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --wrap: 1120px;
  --gutter: 20px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2  0 0 0 0 .16  0 0 0 0 .1  0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171411;
    --paper-2: #211d18;
    --ink: #ebe4d6;
    --muted: #a69d8c;
    --rule: #3b352c;
    --link: #a9c3e6;
    --shu: #e4573c;
    --shu-ink: #1a0f0b;
    --warn-bg: #3d3210;
    --warn-ink: #f3dfa0;
    --plate: #0e0c0a;
    --plate-ink: #ebe4d6;
    --plate-muted: #a69d8c;
    --grain: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--paper) var(--grain);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  font-feature-settings: "palt";
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 0; }

/* ---------------------------------------------------------- 枠 */
.head-in, main, .foot-in, .pr-notice, .stale {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.site-head { border-top: 4px solid var(--ink); border-bottom: 1px solid var(--rule); }
.head-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  background: var(--shu); color: var(--shu-ink);
  font-family: var(--serif); font-weight: 800; font-size: 20px; line-height: 1;
  border-radius: 3px;
}
.brand-name { font-family: var(--serif); font-weight: 800; font-size: 1.32rem; letter-spacing: .16em; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.site-head nav a {
  color: var(--ink); text-decoration: none;
  font-size: .86rem; letter-spacing: .08em;
  padding: 6px 0 4px; border-bottom: 2px solid transparent;
}
.site-head nav a:hover { border-bottom-color: var(--rule); }
.site-head nav a[aria-current="page"] { border-bottom-color: var(--shu); }

.pr-notice, .stale { margin-top: 16px; font-size: .9rem; }
.pr-notice { padding-block: 10px; padding-left: calc(var(--gutter) + 14px); position: relative; color: var(--muted); }
.pr-notice::before { content: ""; position: absolute; left: var(--gutter); top: 12px; bottom: 12px; width: 3px; background: var(--shu); }
.stale { padding-block: 12px; background: var(--warn-bg); color: var(--warn-ink); }

main { padding-block: 0 72px; counter-reset: sec; }

/* ---------------------------------------------------------- 文字 */
h1, h2, .hero-lede { font-family: var(--serif); }
h1 {
  font-size: clamp(1.75rem, 4.6vw, 2.7rem);
  font-weight: 800; line-height: 1.35; letter-spacing: .03em;
  margin: 10px 0 14px;
}
h2 {
  counter-increment: sec;
  display: flex; align-items: center; gap: 14px;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  font-weight: 700; line-height: 1.5; letter-spacing: .04em;
  margin: 72px 0 16px; padding-top: 18px;
  border-top: 1px solid var(--ink);
}
h2::before {
  content: counter(sec, cjk-ideographic);
  flex: none; display: inline-grid; place-items: center;
  min-width: 1.9em; height: 1.9em; padding: 0 .3em;
  background: var(--shu); color: var(--shu-ink);
  font-size: .78em; font-weight: 800; line-height: 1; letter-spacing: 0;
  border-radius: 2px;
}
h3 {
  font-size: .98rem; margin: 26px 0 6px; padding-left: 12px;
  border-left: 3px solid var(--shu); line-height: 1.5;
}
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0; font-size: .76rem; letter-spacing: .3em; color: var(--muted); }
.eyebrow::before { content: ""; width: 32px; height: 1px; background: var(--shu); }
.lede { margin: 0 0 8px; max-width: 44em; font-size: 1.02rem; }
.meta { font-size: .86rem; color: var(--muted); }
.table-note { font-size: .86rem; color: var(--muted); margin: 0 0 10px; max-width: 52em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.none { color: var(--muted); }
ul.plain { padding-left: 1.3em; margin: 8px 0; }
ul.plain li { margin: 5px 0; overflow-wrap: anywhere; }
ul.plain li::marker { color: var(--shu); }
.more { font-size: .92rem; letter-spacing: .04em; }
.more::after { content: " →"; }

/* ---------------------------------------------------------- 表紙(トップ) */
.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 64px); align-items: center;
  padding-block: clamp(32px, 6vw, 76px) clamp(8px, 3vw, 32px);
}
.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.5rem);
  line-height: 1.16; letter-spacing: .02em; margin: 14px 0 20px;
}
.hero h1 .q { color: var(--shu); }
.hero-lede { font-size: clamp(1rem, 1.7vw, 1.14rem); font-weight: 500; line-height: 1.9; margin: 0; }
.gloss { margin: 26px 0 28px; border-top: 1px solid var(--ink); }
.gloss > div { display: grid; grid-template-columns: 7.2em 1fr; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.gloss dt { font-family: var(--serif); font-weight: 700; font-size: 1.12rem; letter-spacing: .08em; }
.gloss dt span { margin-left: 8px; font-family: var(--sans); font-weight: 400; font-size: .68rem; letter-spacing: .14em; color: var(--muted); }
.gloss dd { margin: 0; font-size: .92rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0; }
.cta {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 14px 24px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; letter-spacing: .08em; text-decoration: none;
  border-radius: 2px;
}
.cta::after { content: "→"; transition: transform .2s ease; }
.cta:hover::after { transform: translateX(5px); }
.hero-photo { position: relative; margin: 0; }
.hero-photo img { display: block; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; object-position: 58% 50%; }
.hero-photo figcaption { margin-top: 8px; font-size: .72rem; letter-spacing: .12em; color: var(--muted); text-align: right; }
.tate {
  position: absolute; top: 28px; left: -20px;
  writing-mode: vertical-rl;
  padding: 20px 10px 16px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--shu);
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(1.05rem, 1.9vw, 1.45rem); letter-spacing: .34em; line-height: 1;
}

.feature {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  margin-top: clamp(36px, 6vw, 72px);
  background: var(--plate); color: var(--plate-ink);
}
.feature-photo img { display: block; width: 100%; height: 100%; min-height: 240px; object-fit: cover; }
.feature-body { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: clamp(24px, 4.5vw, 52px); }
.feature .eyebrow { color: var(--plate-muted); }
.feature h2 { counter-increment: none; display: block; margin: 0; padding: 0; border: 0; font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 800; }
.feature h2::before { content: none; }
.feature h2 a { color: inherit; text-decoration: none; }
.feature h2 a:hover { text-decoration: underline; text-decoration-color: var(--shu); }
.feature p { margin: 0; color: var(--plate-muted); font-size: .94rem; }
.feature-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 10px; padding: 0; margin: 8px 0 0; }
.feature-links a {
  display: inline-block; padding: 7px 14px;
  border: 1px solid var(--plate-muted); color: var(--plate-ink);
  font-size: .84rem; letter-spacing: .06em; text-decoration: none;
}
.feature-links a:hover { border-color: var(--shu); background: var(--shu); color: var(--shu-ink); }

.rules { list-style: none; counter-reset: rule; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; margin: 0 0 18px; border-bottom: 1px solid var(--rule); }
.rules li { counter-increment: rule; padding: 6px 20px 22px; border-left: 1px solid var(--rule); font-size: .95rem; line-height: 1.75; }
.rules li:first-child { padding-left: 0; border-left: 0; }
.rules li::before {
  content: counter(rule, cjk-ideographic);
  display: block; margin-bottom: 10px;
  font-family: var(--serif); font-weight: 800; font-size: 2.1rem; line-height: 1.2; color: var(--shu);
}

/* 表紙では章の番号を出さない(決まりの一〜四と重なるので) */
.page-home main > h2 { display: block; }
.page-home main > h2::before { content: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.card { display: block; padding: 18px 20px; border: 1px solid var(--ink); color: var(--ink); text-decoration: none; }
.card:hover { background: var(--paper-2); }
.card strong { display: block; font-family: var(--serif); font-size: 1.12rem; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: .9rem; }

/* ---------------------------------------------------------- 中のページの見出し */
.page-head { padding-block: clamp(30px, 5vw, 60px) 4px; }
.stats { display: flex; flex-wrap: wrap; margin: 22px 0 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.stats > div { flex: 1 1 200px; padding: 12px 20px 12px 0; }
.stats dt { font-size: .7rem; letter-spacing: .22em; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-family: var(--serif); font-weight: 700; font-size: 1.08rem; line-height: 1.6; }
.band { margin: 26px 0 0; }
.band img { display: block; width: 100%; aspect-ratio: 16 / 5; object-fit: cover; object-position: 40% 42%; }
.band figcaption { margin-top: 8px; font-size: .72rem; letter-spacing: .12em; color: var(--muted); text-align: right; }

/* ---------------------------------------------------------- 表 */
.table-wrap { overflow-x: auto; background: var(--paper); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 11px 14px; border-top: 1px solid var(--rule); text-align: left; vertical-align: top; }
thead th {
  border-top: 0; border-bottom: 1px solid var(--ink);
  font-size: .74rem; font-weight: 600; letter-spacing: .08em; line-height: 1.5; color: var(--muted);
  white-space: nowrap; vertical-align: bottom;
}
td.num, th.num { text-align: right; }
tbody th { position: sticky; left: 0; z-index: 1; min-width: 9.5em; background: var(--paper); font-weight: 700; line-height: 1.5; }
tbody th a { color: var(--ink); text-decoration-color: var(--rule); }
tbody th a:hover { text-decoration-color: var(--shu); }
tbody th small { display: block; margin-top: 2px; font-weight: 400; font-size: .84em; color: var(--muted); }
tbody tr:hover > * { background: var(--paper-2); }
td.total { font-family: var(--serif); font-weight: 800; font-size: 1.16rem; line-height: 1.4; }
td ul.plain { margin: 0; min-width: 16em; }
td[data-col="rank"] { width: 3em; font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: var(--muted); text-align: center; }
#score-body tr:nth-child(-n+3 of :not([hidden])) td[data-col="rank"] { color: var(--shu); font-weight: 800; font-size: 1.3rem; line-height: 1.2; }
#score-body tr:nth-child(1 of :not([hidden])) > * { border-top-color: var(--ink); }
.tag {
  display: inline-block; margin-left: 8px; padding: 1px 6px;
  border: 1px solid var(--shu); border-radius: 2px;
  color: var(--shu); font-family: var(--sans); font-size: .68rem; font-weight: 600; letter-spacing: .04em; line-height: 1.5;
  white-space: nowrap; vertical-align: 2px;
}
tbody th small .tag { margin: 3px 4px 0 0; display: inline-block; vertical-align: 0; }
tbody th small .tag:first-child { margin-left: 6px; }
.ad-label { display: inline-block; margin-left: 6px; padding: 0 6px; background: var(--ink); color: var(--paper); font-size: .68rem; border-radius: 2px; vertical-align: 2px; }

/* ---------------------------------------------------------- 比較表(このページの主役) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cmp th, .cmp td { vertical-align: middle; padding-block: 14px; }
.cmp td.price { font-family: var(--serif); font-weight: 800; font-size: 1.16rem; }
.cmp td.total { font-size: 1.05rem; color: var(--muted); }
.cmp td.act { text-align: right; white-space: nowrap; }
.cmp .detail-col { display: none; }
.detail-toggle:checked ~ .table-wrap .detail-col { display: table-cell; }
.detail-toggle { margin: 0 6px 12px 0; accent-color: var(--shu); vertical-align: -1px; }
.detail-label { font-size: .86rem; color: var(--muted); cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--ink); color: var(--paper);
  font-size: .84rem; font-weight: 600; letter-spacing: .06em; text-decoration: none; white-space: nowrap;
  border-radius: 2px;
}
.btn::after { content: "→"; transition: transform .2s ease; }
.btn:hover { background: var(--shu); color: var(--shu-ink); }
.btn:hover::after { transform: translateX(3px); }
tbody th a.btn, .cmp a.btn { color: var(--paper); }
.cmp a.btn:hover { color: var(--shu-ink); }
.tune { margin: 0 0 14px; }
.tune > summary { display: inline-block; cursor: pointer; font-size: .86rem; color: var(--link); text-decoration: underline; text-underline-offset: 4px; list-style: none; }
.tune > summary::-webkit-details-marker { display: none; }
.tune > summary::before { content: "＋ "; text-decoration: none; }
.tune[open] > summary::before { content: "− "; }
.tune .controls { margin-top: 12px; }

/* 折りたたみ(くわしい数字) */
.more-lead { margin: 56px 0 10px; font-size: .9rem; color: var(--muted); }
details.fold { border-top: 1px solid var(--ink); }
details.fold:last-of-type { border-bottom: 1px solid var(--ink); }
details.fold > summary { display: flex; align-items: center; gap: 14px; padding: 16px 0; cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { flex: 1; margin: 0; padding: 0; border: 0; font-size: clamp(1.05rem, 2.2vw, 1.25rem); }
details.fold > summary::after { content: "＋"; flex: none; font-family: var(--serif); font-size: 1.3rem; line-height: 1; color: var(--shu); }
details.fold[open] > summary::after { content: "−"; }
details.fold > summary:hover h2 { text-decoration: underline; text-decoration-color: var(--shu); text-underline-offset: 6px; }
.fold-body { padding: 0 0 30px; }
.fold-body > :first-child { margin-top: 4px; }

@media (max-width: 760px) {
  /* スマホでは表を1プラン1枚の札にする */
  .cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cmp, .cmp tbody, .cmp th, .cmp td { display: block; }
  .cmp tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; padding: 18px 0 20px; border-top: 1px solid var(--ink); }
  .cmp tr:first-child { border-top: 0; }
  .cmp tr:hover > * { background: transparent; }
  .cmp th, .cmp td { border: 0; padding: 0; text-align: left; }
  .cmp th { grid-column: 1 / -1; position: static; min-width: 0; font-size: 1.1rem; margin: 2px 0 10px; }
  .cmp td { padding: 7px 0; }
  .cmp td::before { content: attr(data-label); display: block; font-family: var(--sans); font-size: .68rem; font-weight: 400; letter-spacing: .14em; line-height: 1.6; color: var(--muted); }
  .cmp td[data-col="rank"] { grid-column: 1 / -1; width: auto; padding: 0; text-align: left; font-size: .9rem; line-height: 1.4; }
  .cmp td[data-col="rank"]::before { display: inline; content: "総合点の順 "; }
  #score-body tr:nth-child(-n+3 of :not([hidden])) td[data-col="rank"] { font-size: 1.05rem; }
  .cmp td.num { text-align: left; }
  .cmp td.price { font-size: 1.35rem; }
  .cmp td.act { grid-column: 1 / -1; padding-top: 12px; text-align: left; }
  .cmp td.act::before { content: none; }
  .cmp a.btn { width: 100%; justify-content: space-between; padding: 12px 16px; }
  .detail-toggle:checked ~ .table-wrap .detail-col { display: block; }
}

/* ---------------------------------------------------------- 入力 */
.controls { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin: 28px 0 0; }
.controls label { font-size: .9rem; letter-spacing: .04em; }
select, input[type="number"] {
  font: inherit; color: var(--ink);
  padding: 7px 10px; border: 1px solid var(--ink); border-radius: 2px; background: var(--paper);
}
input[type="number"] { width: 7.5em; text-align: right; }
button {
  font: inherit; color: var(--ink); cursor: pointer;
  padding: 7px 14px; border: 1px solid var(--ink); border-radius: 2px; background: transparent;
}
button:hover { background: var(--ink); color: var(--paper); }
#controls { padding: 12px 16px; border: 1px solid var(--ink); display: inline-flex; }
#controls label { font-family: var(--serif); font-weight: 700; font-size: 1rem; }
#weights { margin: 4px 0 16px; padding: 14px 16px; background: var(--paper-2); border-left: 3px solid var(--ink); gap: 10px 20px; }
#weights label { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; }
#weights select { padding: 5px 8px; border-color: var(--rule); }

/* ---------------------------------------------------------- 記録 */
.log { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.log li { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--rule); }
.log li:first-child { border-top: 0; }
.log time { font-family: var(--serif); font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { margin: 0; padding: 22px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); color: var(--muted); }

/* ---------------------------------------------------------- 奥付 */
.site-foot { background: var(--plate); color: var(--plate-ink); border-top: 4px solid var(--shu); }
.foot-in { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr); gap: 24px 40px; padding-block: 40px 52px; font-size: .84rem; line-height: 1.8; }
.site-foot p { margin: 0 0 6px; color: var(--plate-muted); }
.site-foot .foot-name { font-family: var(--serif); font-weight: 800; font-size: 1.5rem; letter-spacing: .18em; color: var(--plate-ink); }
.foot-nav { display: flex; flex-direction: column; gap: 6px; }
.foot-nav a { color: var(--plate-ink); text-decoration: none; letter-spacing: .06em; }
.foot-nav a:hover { text-decoration: underline; text-decoration-color: var(--shu); }

/* ---------------------------------------------------------- せまい画面 */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .hero-photo { order: -1; margin-inline: calc(var(--gutter) * -1); }
  .hero-photo img { aspect-ratio: 16 / 10; }
  .hero-photo figcaption { padding-right: var(--gutter); }
  .tate { top: 16px; left: var(--gutter); padding: 14px 8px 10px; box-shadow: 3px 3px 0 var(--shu); }
  .feature { grid-template-columns: 1fr; margin-inline: calc(var(--gutter) * -1); }
  .feature-photo img { min-height: 0; aspect-ratio: 16 / 8; }
  .feature-body { padding-inline: var(--gutter); }
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 0; }
  .rules li { padding: 6px 16px 20px; border-bottom: 1px solid var(--rule); }
  .rules li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .foot-in { grid-template-columns: 1fr; padding-block: 32px 44px; }
  .band img { aspect-ratio: 16 / 7; }
  h2 { margin-top: 56px; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .head-in { padding-block: 12px 8px; }
  .site-head nav { gap: 2px 18px; }
  .site-head nav a { font-size: .8rem; letter-spacing: .04em; }
  th, td { padding: 10px 10px; }
  tbody th { min-width: 8.2em; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  .gloss > div { grid-template-columns: 6.2em 1fr; }
  .cta { width: 100%; justify-content: space-between; }
  .stats > div { flex-basis: 100%; padding-block: 9px; border-top: 1px solid var(--rule); }
  .stats > div:first-child { border-top: 0; }
}
@media (prefers-color-scheme: dark) {
  .hero-photo img, .band img, .feature-photo img { filter: brightness(.9); }
  .site-foot { border-top-color: var(--shu); }
  .feature { border: 1px solid var(--rule); }
}
@media print {
  .site-head nav, .site-foot, .controls, .cta, .skip { display: none; }
  body { background: #fff; }
}
