/* らく計算 — one stylesheet for the whole site. Mobile first. System fonts only (no web-font download). */
:root {
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #e6f4f1;
  --ink: #1f2933;
  --ink-soft: #52606d;
  --line: #d9e2ec;
  --bg: #f7faf9;
  --card: #ffffff;
  --accent: #b45309;
  --radius: 12px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #2dd4bf;
    --brand-dark: #5eead4;
    --brand-soft: #123532;
    --ink: #e4e7eb;
    --ink-soft: #a9b4c0;
    --line: #2f3b46;
    --bg: #111a1f;
    --card: #17232a;
    --accent: #f59e0b;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: anywhere;
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* header / footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding-top: 12px; padding-bottom: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.3rem; }
.logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 1.05rem; }
.tagline { margin: 0; font-size: .82rem; color: var(--ink-soft); }
.site-footer { margin-top: 56px; padding: 24px 0 32px; border-top: 1px solid var(--line); background: var(--card); font-size: .88rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--ink-soft); }
.copy { color: var(--ink-soft); margin: 12px 0 0; }

/* headings & text */
h1 { font-size: 1.55rem; line-height: 1.4; margin: 20px 0 8px; }
h2 { font-size: 1.22rem; line-height: 1.45; margin: 40px 0 12px; padding-left: 12px; border-left: 5px solid var(--brand); }
h3 { font-size: 1.05rem; margin: 26px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
li { margin-bottom: 4px; }
.lead { color: var(--ink-soft); margin-bottom: 18px; }
.breadcrumb { font-size: .82rem; color: var(--ink-soft); margin-top: 14px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; }
.updated { font-size: .8rem; color: var(--ink-soft); }

/* calculator card */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 16px 0 8px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.field { margin-bottom: 16px; }
.field > label, .field > .label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-height: 46px;
}
textarea { min-height: 160px; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit span { white-space: nowrap; color: var(--ink-soft); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); cursor: pointer; font-size: .95rem; }
.choices input { accent-color: var(--brand); }
.choices label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
button, .btn { font: inherit; font-weight: 700; color: #fff; background: var(--brand); border: 0; border-radius: 9px; padding: 12px 20px; min-height: 46px; cursor: pointer; }
button.secondary { background: transparent; color: var(--brand); border: 1px solid var(--brand); }

/* result */
.result { margin-top: 6px; padding: 16px; border-radius: var(--radius); background: var(--brand-soft); }
.result dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; align-items: baseline; }
.result dt { color: var(--ink-soft); font-size: .9rem; }
.result dd { margin: 0; text-align: right; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.result dd.main { font-size: 1.6rem; color: var(--brand-dark); }
.result .error { color: var(--accent); font-weight: 700; margin: 0; }
.result .note { font-size: .8rem; color: var(--ink-soft); margin: 10px 0 0; }

/* article */
.article table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: .92rem; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.article th { background: var(--brand-soft); }
.table-scroll { overflow-x: auto; }
.example { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.example p:last-child { margin-bottom: 0; }
.formula { font-family: var(--font); background: var(--card); border-left: 4px solid var(--brand); padding: 10px 14px; margin: 0 0 14px; }

/* faq */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style: none; }
.faq summary::before { content: "Q. "; color: var(--brand); }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { padding: 0 14px 12px; margin: 0; }

/* related + home grid */
.related ul, .tool-grid { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .related ul, .tool-grid { grid-template-columns: 1fr 1fr; } }
.related a, .tool-grid a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--ink); font-weight: 700; }
.related a:hover, .tool-grid a:hover { border-color: var(--brand); }
.tool-grid small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .82rem; line-height: 1.6; margin-top: 2px; }
.hero { padding: 26px 0 8px; }
.hero h1 { margin-top: 0; }
