/* サイトの見た目。印 A（青緑・目盛りの付いた計量のます）。色は :root の変数だけで替えられる。 */
:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --ink: #1e2a32;
  --ink-sub: #55636d;
  --line: #d9dee2;
  --main: #0e6f73;
  --main-dark: #0a5356;
  --main-tint: #e6f2f1;
  --buy: #ffd84d;
  --buy-line: #d9a400;
  --buy-tint: #fff8dc;
  --notice-bg: #fff4cc;
  --notice-ink: #4d3b00;
  --radius: 10px;
  --w: 720px;
}
[data-theme="B"] {
  --main: #1f3a5f; --main-dark: #162b47; --main-tint: #e8edf4;
  --buy: #ffb38a; --buy-line: #d9622b; --buy-tint: #fff1e8;
}
[data-theme="C"] {
  --main: #1f6fa8; --main-dark: #17557f; --main-tint: #e6f1f8;
  --buy: #ffd2c2; --buy-line: #d9512c; --buy-tint: #fff3ee;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic", Meiryo, sans-serif;
  font-size: 17px;
  line-height: 1.85;
}
a { color: var(--main); text-underline-offset: 3px; }
a:hover { color: var(--main-dark); }
img, svg { max-width: 100%; height: auto; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 16px; }

/* 頁の頭の断り（広告・AI）。終わりだけ・薄い色・小さい字にしない。 */
.notice {
  background: var(--notice-bg);
  color: var(--notice-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  border-bottom: 1px solid #e6d28a;
}
.notice .wrap { padding-top: 8px; padding-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.notice .tag { display: inline-block; border: 1.5px solid var(--notice-ink); border-radius: 4px; padding: 0 7px; background: #fff; }
.notice a { color: var(--notice-ink); font-weight: 400; }

.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 19px; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-sub); line-height: 1.3; }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 15px; }
.nav a { text-decoration: none; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--main); font-weight: 700; }

main { padding: 22px 0 48px; }
h1 { font-size: 27px; line-height: 1.45; margin: 6px 0 14px; letter-spacing: .01em; }
h2 { font-size: 21px; line-height: 1.5; margin: 40px 0 12px; padding: 4px 0 4px 12px; border-left: 6px solid var(--main); }
h3 { font-size: 18px; margin: 26px 0 8px; }
p { margin: 0 0 14px; }
.lead { font-size: 17px; color: var(--ink-sub); }
.kicker { font-size: 14px; color: var(--main-dark); font-weight: 700; letter-spacing: .04em; }
small, .small { font-size: 14px; color: var(--ink-sub); }

/* 答えの箱（冒頭で言い切る） */
.answer {
  background: var(--main-tint);
  border: 2px solid var(--main);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 14px 0 20px;
}
.answer p { margin: 0 0 6px; }
.answer p:last-child { margin-bottom: 0; }
.answer .big { font-size: 30px; font-weight: 700; line-height: 1.35; color: var(--main-dark); font-variant-numeric: tabular-nums; }
.answer .big b { font-size: 44px; }

/* 計算の入力 */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 10px 0 8px; }
.calc fieldset { border: 0; margin: 0; padding: 0; }
.calc legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.row:last-of-type { border-bottom: 0; }
.row label { font-weight: 700; }
.row label small { display: block; font-weight: 400; }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper button {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--main); background: #fff; color: var(--main-dark);
  font-size: 24px; font-weight: 700; line-height: 1; cursor: pointer; touch-action: manipulation;
}
.stepper button:active { background: var(--main-tint); }
.stepper input {
  width: 64px; height: 46px; text-align: center; font-size: 22px; font-weight: 700; border: 1px solid var(--line); border-radius: 8px;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; background: #fff; color: var(--ink);
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chips button { border: 1.5px solid var(--main); background: #fff; color: var(--main-dark); border-radius: 999px; padding: 5px 14px; font-size: 15px; font-weight: 700; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--main); color: #fff; }

/* 結果 */
.results { display: grid; gap: 12px; margin: 14px 0; }
.result { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--main); border-radius: var(--radius); padding: 14px 16px; }
.result h3 { margin: 0 0 2px; font-size: 16px; color: var(--ink-sub); font-weight: 700; }
.result .num { font-size: 22px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.result .num b { font-size: 40px; color: var(--main-dark); }
.result .formula { font-size: 15px; color: var(--ink-sub); margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.result .conv { font-size: 16px; margin: 6px 0 0; }
.result .src { font-size: 13.5px; margin: 8px 0 0; color: var(--ink-sub); }

/* 表 */
.table-wrap { overflow-x: auto; margin: 10px 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 16px; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 10px 12px 6px; font-weight: 700; font-size: 15px; color: var(--ink-sub); }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--main-tint); color: var(--main-dark); font-size: 15px; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.hl, th.hl { background: var(--buy-tint); font-weight: 700; }
table.wraptext td, table.wraptext th { white-space: normal; text-align: left; }

/* 買う所（チラシのように） */
.buy { background: var(--buy-tint); border: 2px solid var(--buy-line); border-radius: var(--radius); margin: 18px 0; overflow: hidden; }
.buy > h2, .buy > h3 { margin: 0; padding: 9px 16px; background: var(--buy); border: 0; border-bottom: 2px solid var(--buy-line); font-size: 19px; color: #2a2000; }
.buy .pr { font-size: 13px; font-weight: 700; border: 1.5px solid #2a2000; border-radius: 4px; padding: 0 6px; margin-left: 8px; background: #fff; vertical-align: 2px; }
.buy .group { padding: 12px 16px 4px; border-top: 1px dashed var(--buy-line); }
.buy .group:first-of-type { border-top: 0; }
.buy .group > h4 { margin: 0 0 6px; font-size: 16px; }
.item { background: #fff; border: 1px solid #e8d9a0; border-radius: 8px; padding: 12px 14px; margin: 0 0 10px; }
.item .name { font-weight: 700; font-size: 17px; line-height: 1.5; margin: 0; }
.item .maker { font-size: 14px; color: var(--ink-sub); margin: 0 0 6px; }
.item .specs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.item .specs li { font-size: 14px; background: var(--main-tint); color: var(--main-dark); border-radius: 4px; padding: 1px 8px; font-weight: 700; }
.item .why { font-size: 15.5px; margin: 0 0 6px; }
.item .need { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.item .need b { font-size: 22px; color: #a23b00; }
.item .shops { display: flex; gap: 8px; flex-wrap: wrap; }
.item .shops a, .item .shops span { display: inline-block; border-radius: 6px; padding: 7px 14px; font-size: 15px; font-weight: 700; text-decoration: none; }
.item .shops a { background: #2a2000; color: #fff; }
.item .shops span { background: #efefef; color: #666; border: 1px dashed #aaa; font-weight: 400; }
.item .official { font-size: 13.5px; margin: 6px 0 0; }

/* 出典 */
.sources { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; font-size: 15px; }
.sources ol { margin: 0; padding-left: 22px; }
.sources li { margin: 0 0 8px; word-break: break-all; }
.sources .q { color: var(--ink-sub); display: block; word-break: normal; }

.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; font-size: 15.5px; }
.note ul { margin: 0; padding-left: 20px; }
.cards { display: grid; gap: 10px; padding: 0; list-style: none; margin: 10px 0; }
.cards a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--ink); }
.cards a b { display: block; color: var(--main-dark); font-size: 17px; line-height: 1.5; }
.cards a span { font-size: 14px; color: var(--ink-sub); }
.cards .type { display: inline-block; font-size: 12.5px; font-weight: 700; color: #fff; background: var(--main); border-radius: 4px; padding: 0 7px; margin-bottom: 2px; }
.blank { color: var(--ink-sub); }   /* まだ無い物（問い合わせの Pinterest の番地など）。「準備中」と出す */
.amazon-line { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 10px 14px; font-size: 15.5px; font-weight: 700; margin: 18px 0; }

.site-foot { border-top: 1px solid var(--line); background: var(--surface); font-size: 14.5px; color: var(--ink-sub); }
.site-foot .wrap { padding-top: 18px; padding-bottom: 28px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
.site-foot p { margin: 0 0 6px; }

/* 結果を、そのまま人に見せる番地 */
.result { scroll-margin-top: 12px; }
#kekka { scroll-margin-top: 12px; }
.share { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0 4px; font-size: 15px; }
.share p { margin: 0 0 8px; }
.share .small { margin: 6px 0 0; min-height: 0; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 14px; color: var(--ink-sub); background: var(--bg); }
.share-row button { flex: none; height: 44px; border: 2px solid var(--main); background: #fff; color: var(--main-dark); border-radius: 8px; padding: 0 14px; font-size: 15px; font-weight: 700; cursor: pointer; }
.share-row button:active { background: var(--main-tint); }

/* 記事から計算の頁へ */
.tocalc { margin: 0 0 18px; }
.btn { display: inline-block; background: var(--main); color: #fff; border-radius: 8px; padding: 10px 16px; font-weight: 700; text-decoration: none; line-height: 1.5; }
.btn:hover { background: var(--main-dark); color: #fff; }

/* 買い物リスト（項目ごとに 1 点と、要る数） */
.buy .g-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; font-size: 17px; }
.buy .g-head .total { font-size: 15px; font-weight: 700; color: #5c4700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.buy .intro p { margin: 0 0 4px; }
.buy .intro details.more { margin: 0 0 6px; }
.item.pick { padding: 10px 12px; margin-bottom: 6px; }
.pick .name { font-size: 16px; line-height: 1.45; }
.pick .maker { font-size: 13px; margin: 0 0 2px; }
.pick .count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin: 0 0 4px; line-height: 1.5; }
.pick .count-num { font-size: 17px; font-weight: 700; white-space: nowrap; }
.pick .count-num b { font-size: 30px; color: #a23b00; font-variant-numeric: tabular-nums; }
.pick .count .small { font-size: 13px; }
.pick .why { font-size: 14.5px; line-height: 1.7; margin: 0 0 8px; }
.pick .shops { flex-wrap: nowrap; }
.pick .shops a, .pick .shops span { flex: 1; text-align: center; padding: 8px 6px; font-size: 14.5px; white-space: nowrap; }
.pick .official { font-size: 12.5px; line-height: 1.6; color: var(--ink-sub); }
.sources details.quotes { margin-top: 2px; }
.sources details.quotes > summary { cursor: pointer; font-size: 14px; color: var(--ink-sub); word-break: normal; }
.why-label { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--main-dark); background: var(--main-tint); border-radius: 4px; padding: 0 7px; margin-right: 6px; }
details.more { margin: 0 0 10px; }
details.more > summary { cursor: pointer; font-size: 15px; font-weight: 700; color: #5c4700; padding: 8px 2px; }
details.more[open] > summary { margin-bottom: 6px; }

@media (min-width: 640px) {
  h1 { font-size: 32px; }
  .results { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media print { .notice, .nav, .stepper button, .chips { display: none; } }
