/* craft-calc 共通スタイル（依存なし・システムフォント） */
:root {
  --bg: #f6f7f4; --surface: #fff; --text: #22302a; --muted: #66736c; --line: #e3e7e0;
  --brand: #1f6f8b; --brand-dark: #185a71; --brand-soft: #e6f1f5; --accent: #e07a2f; --accent-soft: #fdf0e4;
  --ok: #2f7d4a; --warn-bg: #fff6d9; --footer: #22302a; --footer-text: #c9d3cc; --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(34,48,42,.06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif; line-height: 1.75; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
.note { color: var(--muted); font-size: .85rem; }
.small { font-size: .85rem; }

/* header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; }
.logo small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.nav a { margin-left: 14px; font-size: .9rem; text-decoration: none; }
@media (max-width: 560px) { .logo small { display: none; } .nav a { margin-left: 10px; font-size: .85rem; } }
.site-footer { background: var(--footer); color: var(--footer-text); margin-top: 48px; padding: 28px 0; font-size: .85rem; }
.site-footer a { color: #fff; margin-right: 14px; text-decoration: none; }
.site-footer nav { margin: 8px 0; }

/* hero */
.hero { padding: 28px 0 8px; }
.hero p { max-width: 720px; }

/* layout */
.grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 16px; }
.grid > * { min-width: 0; } /* 表の min-content で列が広がらないように（表は .tbl-wrap で横スクロール） */
@media (min-width: 900px) { .grid { grid-template-columns: 1fr 380px; align-items: start; } .sticky { position: sticky; top: 72px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 14px; margin-bottom: 18px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card h2 .step { background: var(--brand); color: #fff; font-size: .75rem; border-radius: 999px; padding: 1px 9px; }
details.card summary { cursor: pointer; font-weight: 700; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: "＋"; float: right; color: var(--muted); }
details.card[open] summary::after { content: "－"; }

/* form */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 12px; }
.field label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.field .in { display: flex; align-items: center; gap: 6px; }
.field .in span { font-size: .8rem; color: var(--muted); white-space: nowrap; }
input[type=number], input[type=text], select { width: 100%; font: inherit; font-size: .95rem; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input[type=number] { text-align: right; }
.wide { grid-column: 1 / -1; }
.radio-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9rem; }
.radio-row label { display: flex; align-items: center; gap: 4px; }
.helper { background: var(--bg); border-radius: 8px; padding: 8px 10px; margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; }
.helper input { width: 90px; }

/* filament table */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .78rem; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }
.fil-table input, .fil-table select { padding: 5px 6px; font-size: .9rem; }
.fil-table td:first-child input { min-width: 110px; }
.fil-table td { padding: 4px 3px; }
.fil-table th { white-space: nowrap; }

/* buttons */
button, .btn { font: inherit; font-size: .9rem; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
button:hover, .btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-accent { background: var(--accent-soft); border-color: #f0cfae; color: #8a4a12; }
.btn-sm { padding: 3px 9px; font-size: .8rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* results */
.result .total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-top: 2px solid var(--text); font-weight: 700; }
.result dl { margin: 0; }
.result .row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.result .row .k { color: var(--muted); }
.result .row.sub .k { padding-left: 1em; }
.price-box { background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.price-box .big { font-size: 1.7rem; font-weight: 800; color: var(--brand-dark); line-height: 1.2; }
.price-box .big small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.warn { background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; font-size: .85rem; }
.msg { font-size: .85rem; color: var(--ok); min-height: 1.4em; margin-top: 6px; }
.compare td.num { font-variant-numeric: tabular-nums; }
.compare tr.cur td { background: var(--brand-soft); }

/* legal pages */
.page { padding: 28px 0; }
.page h1 { margin-bottom: 4px; }
.page .meta { color: var(--muted); font-size: .85rem; margin-bottom: 20px; }
.legal h2 { margin-top: 1.6em; padding-left: 10px; border-left: 4px solid var(--brand); }
.legal ul { padding-left: 1.3em; }
.pro-msg { display: none; }
.pro-msg.show { display: block; }
