/* 手取りの地図 — design system
   Editorial, numbers-forward. Paper ground, ink text, one accent.
   The wall diagram (threshold lines on an income axis) is the identity. */

:root {
  --paper: #faf7f1;
  --paper-2: #f3eee4;
  --ink: #1c1a16;
  --ink-2: #55504a;
  --ink-3: #8a8478;
  --rule: #ddd5c6;
  --accent: #9a3b26;        /* shu-iro vermilion, used sparingly */
  --accent-ink: #7c2d1c;
  --wall: #b3543f;
  --gain: #2e6b4f;
  --loss: #9a3b26;
  --card: #fffdf8;
  --radius: 10px;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, serif;
  --sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", -apple-system, "Segoe UI", sans-serif;
  --num: "SF Mono", "Hiragino Kaku Gothic ProN", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-head {
  border-bottom: 1px solid var(--rule);
  padding: 18px 0 14px;
}
.site-head .wrap {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
}
.brand {
  font-family: var(--serif);
  font-size: 20px; font-weight: 700; letter-spacing: .08em;
  color: var(--ink); text-decoration: none;
}
.brand .brand-sub {
  display: block; font-family: var(--sans); font-size: 11px; font-weight: 400;
  letter-spacing: .18em; color: var(--ink-3); margin-top: 2px;
}
.lang-switch { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.lang-switch a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); }
.lang-switch a:hover { color: var(--accent-ink); }

/* hero */
.hero { padding: 44px 0 8px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.35; font-weight: 700; letter-spacing: .02em;
  margin: 0 0 14px;
}
.hero h1 .wall-word { color: var(--accent-ink); }
.hero p.lede { color: var(--ink-2); margin: 0 0 8px; max-width: 38em; }
.hero .meta { font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; }

/* wall strip: the identity motif */
.wall-strip {
  position: relative; height: 54px; margin: 26px 0 6px;
  border-bottom: 2px solid var(--ink);
}
.wall-strip .tick {
  position: absolute; bottom: 0; width: 0;
  border-left: 2px solid var(--wall);
}
.wall-strip .tick span {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .06em; color: var(--accent-ink);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.wall-strip .axis-note {
  position: absolute; right: 0; bottom: -22px;
  font-size: 11px; color: var(--ink-3);
}

/* cards & forms */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  margin: 22px 0;
}
.card h2 {
  font-family: var(--serif); font-size: 18px; margin: 0 0 4px; letter-spacing: .04em;
}
.card .card-note { font-size: 13px; color: var(--ink-2); margin: 0 0 16px; }

.field { margin: 0 0 18px; }
.field label {
  display: block; font-size: 13.5px; font-weight: 600; letter-spacing: .03em;
  margin-bottom: 6px;
}
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.money-input {
  display: flex; align-items: baseline; gap: 8px;
  border-bottom: 2px solid var(--ink); padding-bottom: 4px; max-width: 320px;
}
.money-input input {
  font-family: var(--num); font-variant-numeric: tabular-nums;
  font-size: 26px; font-weight: 600; color: var(--ink);
  border: 0; background: transparent; width: 100%; outline: none; padding: 0;
}
.money-input .unit { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 10px 0 0; }
.range-scale {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  font-family: var(--sans); font-size: 13.5px;
  background: var(--paper); color: var(--ink-2);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 7px 14px; cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
select {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 8px; padding: 9px 12px; max-width: 100%;
}

/* results */
.result-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 18px;
  border-bottom: 1px solid var(--rule); padding-bottom: 14px; margin-bottom: 14px;
}
.result-head .label { font-size: 13px; color: var(--ink-2); letter-spacing: .06em; }
.result-head .big {
  font-family: var(--num); font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 7vw, 42px); font-weight: 700; line-height: 1.1;
}
.result-head .big .unit { font-size: 16px; font-weight: 400; color: var(--ink-2); }
.delta { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--gain); }
.delta.down { color: var(--loss); }

table.breakdown { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.breakdown th, table.breakdown td {
  padding: 8px 4px; border-bottom: 1px solid var(--paper-2);
  text-align: left; font-weight: 400;
}
table.breakdown td.num, table.breakdown th.num {
  text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.breakdown tr.total td { border-top: 2px solid var(--ink); font-weight: 700; }
table.breakdown .sub { color: var(--ink-3); font-size: 12.5px; }

.wall-list { list-style: none; margin: 6px 0 0; padding: 0; }
.wall-list li {
  display: flex; gap: 12px; align-items: baseline;
  padding: 10px 2px; border-bottom: 1px solid var(--paper-2);
  font-size: 14.5px;
}
.wall-list .w-amount {
  font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 700;
  min-width: 92px; color: var(--accent-ink);
}
.wall-list .w-state { margin-left: auto; font-size: 12.5px; white-space: nowrap; }
.wall-list .w-state.over { color: var(--loss); font-weight: 700; }
.wall-list .w-state.under { color: var(--gain); }
.wall-list .w-desc { color: var(--ink-2); font-size: 13.5px; }

canvas.chart { width: 100%; height: 300px; display: block; }
.chart-note { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }

/* prose */
.prose { max-width: 42em; }
.prose h2 {
  font-family: var(--serif); font-size: 20px; margin: 36px 0 10px; letter-spacing: .03em;
}
.prose h3 { font-size: 15.5px; margin: 24px 0 6px; }
.prose p { margin: 0 0 12px; color: #2c2924; }
.prose ul { margin: 0 0 12px; padding-left: 1.3em; }
.prose li { margin-bottom: 4px; }
.prose .source { font-size: 12.5px; color: var(--ink-3); }
.prose a { color: var(--accent-ink); }

.notice {
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  padding: 12px 16px; font-size: 13.5px; color: var(--ink-2);
  margin: 22px 0;
}

.ad-slot {
  border: 1px dashed var(--rule); border-radius: var(--radius);
  color: var(--ink-3); font-size: 12px; letter-spacing: .1em;
  text-align: center; padding: 18px; margin: 26px 0;
}
.affiliate-note { font-size: 12px; color: var(--ink-3); }

/* tool index */
.tool-list { list-style: none; margin: 0; padding: 0; }
.tool-list li { border-bottom: 1px solid var(--rule); }
.tool-list a, .tool-list .soon {
  display: flex; align-items: baseline; gap: 14px;
  padding: 18px 2px; text-decoration: none; color: var(--ink);
}
.tool-list .t-name { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.tool-list .t-desc { color: var(--ink-2); font-size: 13.5px; }
.tool-list .t-state { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.tool-list a:hover .t-name { color: var(--accent-ink); }

footer.site-foot {
  border-top: 1px solid var(--rule); margin-top: 56px; padding: 22px 0 40px;
  font-size: 12.5px; color: var(--ink-3);
}
footer.site-foot a { color: var(--ink-2); }

@media (max-width: 560px) {
  .card { padding: 18px 16px 14px; }
  .wall-list .w-amount { min-width: 76px; }
  canvas.chart { height: 240px; }
}
