/* くるまおかね計算室
   ナンバープレート(白地に緑の縁と文字)と、道路の白線をモチーフにする。
   アスファルト(road)、プレートの緑(plate)、軽自動車のプレートの黄(kei)が軸。
   見せ場は「12か月の支払いカレンダー」:いつ、何に、いくら出ていくかを月ごとの棒で見せる。 */
:root {
  --paper: #fbfcfb;
  --ink: #23262a;
  --muted: #5d646b;
  --rule: #d6dbd8;
  --road: #2f3337;
  --line: #ffffff;
  --plate: #0e5e3b;
  --plate-ink: #ffffff;
  --plate-soft: #e8f2ec;
  --kei: #f2c200;
  --kei-soft: #fdf4cc;
  --link: #1d4f91;
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --num: "Barlow Condensed", "Zen Kaku Gothic New", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141617;
    --ink: #e6e9ea;
    --muted: #a2aab1;
    --rule: #33393d;
    --road: #0c0d0e;
    --line: #d9dde0;
    --plate: #6cc49a;
    --plate-ink: #0b2318;
    --plate-soft: #17271f;
    --kei: #e0b400;
    --kei-soft: #2b260f;
    --link: #8db6ee;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.85; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー:アスファルトに白い破線(センターライン) */
header.site { background: var(--road); color: #fff; position: relative; }
header.site::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: repeating-linear-gradient(90deg, var(--kei) 0 28px, transparent 28px 48px); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 14px; padding-bottom: 16px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .04em; }
/* ロゴ:小さなナンバープレート */
.logo i { display: inline-block; width: 30px; height: 18px; border-radius: 3px; background: #fff; border: 2px solid #0e5e3b; position: relative; }
.logo i::before { content: ""; position: absolute; left: 5px; right: 5px; top: 6px; height: 3px; background: #0e5e3b; border-radius: 1px; }
nav.top { display: flex; gap: 18px; font-size: 14px; }
nav.top a { color: #d5dade; text-decoration: none; }
nav.top a:hover { color: #fff; text-decoration: underline; }

.crumbs { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.crumbs a { color: var(--muted); }
h1, h2, h3 { font-weight: 700; letter-spacing: .02em; }
h1 { font-size: clamp(24px, 4.6vw, 30px); line-height: 1.5; margin: 10px 0 8px; }
h2 { font-size: 20px; line-height: 1.5; margin: 44px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--road); }
h3 { font-size: 17px; margin: 26px 0 6px; }
.lead { color: var(--muted); margin: 0 0 22px; max-width: 36em; }
article p, article li { max-width: 36em; }

.hero { padding: 36px 0 6px; }
.hero h1 { font-size: clamp(26px, 5.6vw, 38px); line-height: 1.45; margin: 0 0 12px; max-width: 15em; }
.hero p { color: var(--muted); margin: 0; max-width: 34em; }

/* 入力欄 */
.sheet { border: 1px solid var(--rule); border-top: 4px solid var(--plate); padding: 22px; margin: 20px 0; background: var(--paper); }
.tool label { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 5px; }
.tool .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.tool input, .tool select { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid #8b949b; border-radius: 6px; background: var(--paper); color: var(--ink); }
.tool input:focus, .tool select:focus { outline: 3px solid var(--kei); outline-offset: 0; border-color: var(--road); }
.tool input[type="checkbox"], .tool input[type="radio"] { width: auto; accent-color: var(--plate); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .row, .row3 { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; font-size: 15px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: 14px; margin: 14px 0 5px; padding: 0; }

/* 計算結果:大きな金額はナンバープレートの書体感で */
#out { margin-top: 22px; }
#out > div:first-child { font-size: 14px; color: var(--muted); }
.plate-num { display: inline-flex; align-items: baseline; gap: 6px; margin: 4px 0 10px; padding: 4px 18px 2px; background: #fff; color: #0e5e3b;
  border: 3px solid #0e5e3b; border-radius: 8px; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #0e5e3b; }
.plate-num.kei { background: #f2c200; color: #1d1d1b; border-color: #1d1d1b; box-shadow: inset 0 0 0 2px #f2c200, inset 0 0 0 3px #1d1d1b; }
.plate-num b { font-family: var(--num); font-weight: 600; font-size: clamp(38px, 9vw, 54px); line-height: 1.05; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.plate-num small { font-size: 16px; font-weight: 700; }
#out .sub { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
#out table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#out td { padding: 7px 2px; border-bottom: 1px solid var(--rule); font-size: 15px; }
#out td.n { text-align: right; white-space: nowrap; }
#out tr.total td { font-weight: 700; border-top: 2px solid var(--road); }
#out p { font-size: 15px; color: var(--muted); }

/* 見せ場:12か月の支払いカレンダー */
.cal { margin: 18px 0 8px; }
.cal-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 190px; padding: 0 0 0; border-bottom: 3px solid var(--road); }
.cal-col { display: flex; flex-direction: column-reverse; height: 100%; min-width: 0; }
.cal-col span { display: block; width: 100%; }
.cal-col .fx { background: #aab3b9; }
.cal-col .tax { background: var(--plate); }
.cal-col .ins { background: var(--link); }
.cal-col .shaken { background: var(--kei); }
.cal-col .cap { font-style: normal; order: 99; margin-top: auto; font-family: var(--num); font-size: 13px; line-height: 1.1; text-align: center; color: var(--muted); white-space: nowrap; overflow: hidden; padding-bottom: 3px; }
.cal-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; font-size: 12px; text-align: center; color: var(--muted); margin-top: 4px; }
.cal-key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.cal-key i { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 5px; }
@media (max-width: 560px) { .cal-bars { height: 150px; gap: 2px; } .cal-months { gap: 2px; font-size: 11px; } .cal-col .cap { display: none; } }

/* 返済表など */
table.data { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { border: 1px solid var(--rule); padding: 8px; text-align: left; vertical-align: top; }
table.data tr:first-child th { background: var(--plate-soft); }
table.data td.n, table.data th.n { text-align: right; }
.scroll { overflow-x: auto; }
.note { border-left: 4px solid var(--kei); background: var(--kei-soft); padding: 10px 16px; font-size: 14px; margin: 24px 0; color: var(--ink); }

.promo { border: 1px solid var(--rule); border-left: 6px solid var(--plate); background: var(--paper); padding: 14px 18px; margin: 20px 0; }
.promo .tag { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--muted); border-radius: 3px; padding: 0 6px; }
.promo strong { display: block; font-size: 17px; margin-top: 4px; }
.promo p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.promo ul.aff { list-style: none; margin: 10px 0 0; padding: 0; }
.promo ul.aff li { border-top: 1px solid var(--rule); padding: 8px 0; font-size: 14px; }
.promo ul.aff a { font-weight: 700; display: block; }
.promo ul.aff span { color: var(--muted); }

.index { list-style: none; margin: 8px 0 0; padding: 0; }
.index li { border-bottom: 1px solid var(--rule); }
.index li:first-child { border-top: 1px solid var(--rule); }
.index a { display: block; padding: 13px 4px 13px 16px; text-decoration: none; color: var(--ink); position: relative; }
.index a::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; background: var(--plate); border-radius: 2px; }
.index b { display: block; color: var(--link); }
.index a:hover b { text-decoration: underline; }
.index span { color: var(--muted); font-size: 15px; }

details { border-bottom: 1px solid var(--rule); padding: 10px 2px; }
details:first-of-type { border-top: 1px solid var(--rule); }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 8px 0 2px; color: var(--muted); }
footer.site { margin-top: 56px; background: var(--road); color: #c9cfd4; font-size: 13px; }
footer.site .wrap { padding-top: 22px; padding-bottom: 28px; }
footer.site a { color: #e3e7ea; margin-right: 14px; display: inline-block; }
@media (max-width: 560px) { .sheet { padding: 16px 14px; } }
