/* ずんだ節約計算ラボ - 共通スタイル（外部フォント・外部リソースなし） */
:root {
  --main: #1d5c8f;
  --main-dark: #143f63;
  --main-pale: #eaf2fa;
  --main-soft: #d5e5f4;
  --accent: #e8791c;
  --accent-pale: #fff1e3;
  --ink: #1d2733;
  --muted: #586473;
  --line: #c9d8e8;
  --warn-bg: #fff8e6;
  --warn-line: #efc867;
  --bad: #b83227;
  --good: #1f7a4a;
  --card: #ffffff;
  --bg: #f4f7fb;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  font-size: 16px;
}
a { color: var(--main); }
a:hover { color: var(--main-dark); }

.site-header { background: var(--main); color: #fff; padding: 12px 16px; border-bottom: 4px solid var(--accent); }
.site-header .inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.site-header a.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.08rem; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; font-weight: 800; }
.site-header nav { margin-left: auto; display: flex; gap: 4px 12px; flex-wrap: wrap; font-size: .9rem; }
.site-header nav a { color: #fff; text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; margin: 6px 0 4px; color: var(--main-dark); line-height: 1.45; }
h2 { font-size: 1.12rem; margin: 30px 0 8px; color: var(--main-dark); padding-bottom: 4px; border-bottom: 2px solid var(--main-soft); }
h3 { font-size: 1rem; margin: 18px 0 6px; color: var(--main-dark); }
.lead { color: var(--muted); margin-top: 0; }
.crumb { font-size: .8rem; color: var(--muted); margin: 0 0 6px; }
.crumb a { color: var(--muted); }
.hint { font-size: .85rem; color: var(--muted); font-weight: 400; }
.pr-top { font-size: .8rem; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; display: inline-block; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.row { margin-bottom: 12px; }
label { display: block; font-weight: 700; margin-bottom: 4px; }
input[type="number"], input[type="text"], select {
  width: 100%; font-size: 1.05rem; padding: 9px 10px;
  border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: none; border-color: var(--main); }
.unit-wrap { display: flex; align-items: center; gap: 6px; }
.unit-wrap span { white-space: nowrap; color: var(--muted); font-size: .9rem; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: 18px; height: 18px; accent-color: var(--main); }

button, .btn {
  display: inline-block; background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 11px 20px; font-size: 1rem; font-weight: 800; cursor: pointer; text-decoration: none;
}
button:hover, .btn:hover { background: #c9640f; color: #fff; }
button.sub { background: #fff; color: var(--main); border: 2px solid var(--main); padding: 8px 14px; font-size: .9rem; }
button.sub:hover { background: var(--main-pale); color: var(--main-dark); }

/* 入力の表（家電・サブスクの行） */
.rows { display: grid; gap: 10px; }
.item { background: var(--main-pale); border-radius: 10px; padding: 10px; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.item .full { grid-column: 1 / -1; }
.item label { font-size: .82rem; margin-bottom: 2px; }
.item input, .item select { font-size: 1rem; padding: 7px 8px; }

.result-big { text-align: center; background: var(--accent-pale); border: 2px solid var(--accent); border-radius: var(--radius); padding: 12px; margin: 6px 0 12px; }
.result-big .label { font-size: .9rem; color: var(--muted); }
.result-big .value { font-size: 1.85rem; font-weight: 800; color: var(--main-dark); line-height: 1.3; }
.result-big .sub { font-size: .92rem; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th { background: var(--main-soft); color: var(--main-dark); }
tr.total td, tr.total th { font-weight: 800; background: var(--main-pale); }
.good { color: var(--good); font-weight: 800; }
.bad { color: var(--bad); font-weight: 800; }

.point { background: var(--main-pale); border-left: 5px solid var(--main); border-radius: 0 10px 10px 0; padding: 10px 14px; margin: 14px 0; }
.example { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.example .ex-title { font-weight: 800; color: var(--main-dark); }
.note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin: 12px 0; }
.note ul, .note ol { margin: 4px 0; padding-left: 1.3em; }
.article p { margin: 10px 0; }
.article ul, .article ol { padding-left: 1.3em; }
.article li { margin: 4px 0; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; padding: 0 14px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.faq details p { margin: 6px 0 12px; }

.tool-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.tool-list a { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: 10px; padding: 12px 14px; }
.tool-list a:hover { border-color: var(--main); }
.tool-list .t { font-weight: 800; color: var(--main-dark); font-size: 1.05rem; }
.tool-list .d { display: block; font-size: .88rem; color: var(--muted); }

.affiliate { border: 1px dashed var(--main); border-radius: 10px; padding: 10px 12px; margin: 20px 0 8px; font-size: .9rem; background: #fff; }
.affiliate .pr { font-size: .75rem; color: var(--muted); }
.affiliate img { width: 1px; height: 1px; border: 0; vertical-align: top; }

.disclaimer { font-size: .84rem; color: var(--muted); border-top: 1px dashed var(--line); margin-top: 24px; padding-top: 12px; }
.ai-note { font-size: .8rem; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 16px 0 0; }
.related ul { padding-left: 1.2em; margin: 6px 0; }
main a, main td, main li { overflow-wrap: anywhere; }

.site-footer { background: var(--main-dark); color: #dde8f3; font-size: .82rem; padding: 18px 16px 28px; margin-top: 30px; }
.site-footer .inner { max-width: 760px; margin: 0 auto; }
.site-footer a { color: #fff; }
.site-footer .foot-grid { display: grid; gap: 4px 20px; margin-bottom: 12px; }
.site-footer .foot-h { font-weight: 800; color: #fff; margin: 10px 0 4px; font-size: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 3px 0; }
.site-footer .foot-meta { border-top: 1px solid rgba(255,255,255,.2); padding-top: 10px; }

@media (min-width: 640px) {
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .item { grid-template-columns: 2fr 1fr 1fr 1fr; }
  h1 { font-size: 1.65rem; }
  .site-footer .foot-grid { grid-template-columns: 1fr 1fr; }
}
