/* デザイン：白×コーラルの経済メディア風（2026-10-15 共通デザイン / okanefuyasu-top/DESIGN.md）
   印刷して渡す資料なので塗りは最小限、区切りは罫線 */
:root {
  --ink: #111;
  --sub: #5f6368;
  --line: #e3e3e3;
  --accent: #ff9a85;
  --pos: #157f3b;
  --neg: #c2410c;
  --bg: #fff;
  font-family: "Inter", "Noto Sans JP", "Hiragino Sans", sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); -webkit-font-smoothing: antialiased; }
td, .result-num, .num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

/* header */
.topbar { border-top: 6px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 26px 0 22px; background: var(--bg); }
.headrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.tag { display: inline-block; background: var(--accent); color: var(--ink); font-size: .75rem; font-weight: 700; padding: 2px 10px; letter-spacing: .06em; }
.topbar h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900; letter-spacing: -.01em; line-height: 1.25; margin: 10px 0 0; }
.topbar .sub { font-size: .95rem; font-weight: 700; margin: 6px 0 0; }
.topbar .lead { font-size: .82rem; color: var(--sub); margin: 6px 0 0; }
.topnav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar .btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); font-weight: 700; padding: 6px 12px; font-size: 13px; }
.topbar .btn.ghost:hover { background: var(--accent); }

main { padding-top: 28px; padding-bottom: 60px; }
.card { padding: 0 0 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; border-top: 2px solid var(--ink); padding-top: 8px; }
.step { width: 22px; height: 22px; background: var(--accent); color: var(--ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
h2 { font-size: .78rem; font-weight: 700; letter-spacing: .12em; margin: 0; }
.sub-h { font-size: .78rem; font-weight: 700; letter-spacing: .12em; margin: 28px 0 10px; border-top: 2px solid var(--ink); padding-top: 8px; }
.hint { color: var(--sub); font-size: 13px; margin: 6px 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row.gap { margin-top: 12px; flex-wrap: wrap; }

/* buttons */
.btn { font: inherit; font-size: 14px; font-weight: 700; padding: 8px 14px; border-radius: 4px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn:hover { background: #333; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { padding: 10px 20px; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--accent); }
.btn.small { font-size: 12.5px; padding: 4px 10px; }
.linklike { font: inherit; background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; }

/* import */
.howto { margin: 0 0 12px; padding-left: 22px; font-size: 14px; }
.howto li { margin: 3px 0; }
#paste { width: 100%; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; padding: 10px 12px; border: 1px solid #bdbdbd; border-radius: 0; resize: vertical; background: transparent; color: var(--ink); }
#paste:focus { outline: none; border-color: var(--ink); }
.hint.error { color: var(--neg); }
input[type=text], input[type=password], input[type=number], select { font: inherit; font-size: 15px; font-weight: 600; padding: 6px 2px; border: none; border-bottom: 1.5px solid #bdbdbd; border-radius: 0; background: transparent; color: var(--ink); min-width: 0; }
input:focus, select:focus { outline: none; border-bottom-color: var(--ink); }
input[type=checkbox], input[type=range] { accent-color: var(--ink); }
.privacy { font-size: 12.5px; color: var(--sub); border-left: 4px solid var(--accent); padding: 4px 0 4px 12px; margin: 16px 0 8px; }

/* sheet（画面でも1枚の紙のように：箱にせず罫線で） */
.sheet { padding: 0 0 22px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 10px 0 8px; margin-bottom: 16px; }
.sheet-title { font-size: 1.25rem; font-weight: 900; margin: 0; letter-spacing: 0; }
.sheet-meta { margin: 2px 0 0; font-size: 12.5px; color: var(--sub); }
.atena input { width: 220px; }
.atena span { font-size: 16px; font-weight: 700; }
.sheet-note { font-size: 11.5px; color: var(--sub); margin: 12px 0 0; line-height: 1.6; }
.print-only { display: none; }
.check-line { font-size: 13px; margin: 0 0 10px; padding: 2px 0 2px 12px; border-left: 4px solid var(--line); }
.check-line:empty { display: none; }
.check-line.ok { color: var(--pos); border-left-color: var(--pos); }
.check-line.ng { color: var(--neg); border-left-color: var(--neg); }
.family-summary { margin-top: 16px; }
.family-summary td { font-size: 13px; white-space: normal; }
.grid.family-summary thead th:not(.item) { text-align: left; }
.grid.family-summary th.item { width: 90px; min-width: 0; }
.grid.family-summary td { width: 42%; }
.family-edit { margin-top: 12px; font-size: 14px; }
.family-edit summary, .more summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.family-edit[open] summary { margin-bottom: 6px; }
.more summary { font-size: 15px; }

/* おすすめ返礼品 */
.osusume-sheet .osu-h { font-size: .78rem; font-weight: 700; letter-spacing: .12em; margin: 20px 0 6px; border-top: 2px solid var(--ink); padding-top: 8px; }
.osu-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.osu-summary:empty { display: none; }
.osu-summary > .hint { grid-column: 1 / -1; }
.osu-sum { padding: 10px 12px 6px 0; }
.osu-sum + .osu-sum { border-left: 1px solid var(--line); padding-left: 14px; }
.osu-sum span { display: block; font-size: .74rem; color: var(--sub); }
.osu-sum strong { display: block; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.osu-sum strong.ng { color: var(--neg); }
.osu-table td, .osu-table th { font-size: 13px; }
.osu-table td.r, .osu-table th.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid.osu-table thead th:not(.item) { text-align: left; }
.grid.osu-table thead th.r { text-align: right; }
.osu-table a { color: var(--ink); white-space: nowrap; }
.osu-table input.qty { width: 56px; text-align: right; padding: 2px 4px; font-size: 14px; }

/* 結論：今年の見込みの限度額が主役 */
.result-bar { margin-bottom: 18px; }
.result-label { font-size: .85rem; color: var(--sub); }
.result-foot { font-size: .8rem; color: var(--sub); }
.result-card.accent .result-num { font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 2px 0 6px; }
.result-num .mark { background: linear-gradient(transparent 62%, var(--accent) 62%); }
.result-card.base { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
.result-card.base .result-num { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.4; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.controls label { display: flex; align-items: center; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.notes { border-left: 4px solid var(--accent); padding: 4px 0 4px 12px; font-size: 13.5px; margin-bottom: 12px; }

/* tables */
.table-scroll { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: middle; }
.grid th:first-child, .grid td:first-child { padding-left: 0; }
.grid thead th { font-size: .75rem; color: var(--sub); font-weight: 500; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.grid thead th:not(.item) { text-align: right; }
.grid th.item { font-weight: 500; min-width: 210px; }
.row-hint { display: block; font-size: 11.5px; color: var(--sub); font-weight: 400; }
.grid tr.group th { font-size: .75rem; color: var(--ink); font-weight: 700; letter-spacing: .08em; padding-top: 16px; border-bottom: 1px solid var(--ink); }
.grid td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 170px; }
.grid td.num input { width: 150px; text-align: right; font-variant-numeric: tabular-nums; }
.grid input.changed { border-bottom-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.grid input.locked { border-bottom-color: transparent; background: transparent; color: var(--ink); cursor: default; outline: none; }
.family select:disabled, .family input:disabled { color: var(--ink); background: transparent; border-bottom-color: var(--line); opacity: 1; cursor: default; }
.grid tr.strong th, .grid tr.strong td { font-weight: 700; }
.grid tr.accent th, .grid tr.accent td { font-weight: 700; font-size: 15.5px; border-top: 1.5px solid var(--ink); }
.grid tr.accent th:first-child { box-shadow: inset 4px 0 0 var(--accent); padding-left: 10px; }
.est { display: block; font-size: 11.5px; color: var(--sub); }
.grid td.ok { color: var(--pos); font-weight: 700; white-space: nowrap; }
.grid td.ng { color: var(--neg); font-weight: 700; white-space: nowrap; }
.warn { border: 1px solid var(--ink); padding: 10px 14px; font-size: 13.5px; margin: 6px 0; }

/* family */
.family-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.family { border-top: 2px solid var(--ink); padding: 8px 0 0; }
.family h4 { margin: 0 0 8px; font-size: 14px; }
.family fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 10px 0 6px; }
.family legend { font-size: 13px; font-weight: 700; padding: 0 6px 0 0; }
.frow, .fuyo { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 8px; }
.frow label, .fuyo label { display: flex; flex-direction: column; font-size: 11.5px; color: var(--sub); gap: 2px; }
.frow label.check, .fuyo label.check { flex-direction: row; font-size: 13px; color: var(--ink); padding-bottom: 8px; }
.frow input[type=text], .fuyo input[type=text] { width: 110px; font-size: 14px; padding: 4px 2px; }
.frow select, .fuyo select { font-size: 14px; padding: 4px 2px; }
.fuyo { padding: 8px 0; border-top: 1px dashed var(--line); }
.fuyo input[data-fy=zokugara] { width: 70px; }
.fuyo input[data-fy=birth_year] { width: 72px; }
.age, .kubun { font-size: 12.5px; color: var(--sub); padding-bottom: 8px; }

/* chart（主役＝アクセント、線＝黒） */
.chart svg { width: 100%; height: auto; max-width: 760px; display: block; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--sub); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.chart .dot { fill: var(--accent); stroke: var(--ink); stroke-width: 1.5; }
.chart .cur-label { font-size: 12px; fill: var(--ink); font-weight: 700; }
.caveats { padding-left: 20px; margin: 0; font-size: 13px; color: var(--sub); }
.caveats li { margin: 4px 0; }

footer { border-top: 1px solid var(--ink); font-size: .75rem; color: var(--sub); padding-top: 14px; padding-bottom: 40px; }

@media (max-width: 760px) {
  .family-cols { grid-template-columns: 1fr; }
  .grid th.item { min-width: 150px; }
  .grid td.num { min-width: 120px; }
  .grid td.num input { width: 110px; }
  .atena input { width: 100%; }
}
@media (max-width: 560px) {
  .osu-summary { grid-template-columns: 1fr; }
  .osu-sum + .osu-sum { border-left: none; border-top: 1px solid var(--line); padding-left: 0; }
}

/* 印刷：シート1枚だけを A4 縦に収める */
@page { size: A4 portrait; margin: 12mm; }
@media print {
  :root { font-size: 10.5px; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print, [hidden] { display: none !important; }
  .print-only { display: inline; }
  .wrap { max-width: none; padding: 0; }
  main { padding: 0; }
  .sheet { border: 0; padding: 0; margin: 0; }
  .sheet-head { padding: 6px 0 6px; margin-bottom: 10px; }
  .sheet-title { font-size: 16px; }
  .sheet-meta { font-size: 10px; }
  .atena span { font-size: 14px; }
  .result-bar { margin-bottom: 8px; }
  .result-label, .result-foot { font-size: 9.5px; }
  .result-card.accent .result-num { font-size: 30px; margin: 0 0 2px; }
  .result-card.base { margin-top: 6px; padding-top: 4px; }
  .result-card.base .result-num { font-size: 14px; }
  .table-scroll { overflow: visible; }
  .grid { font-size: 10px; }
  .grid th, .grid td { padding: 2.5px 8px; }
  .grid th:first-child, .grid td:first-child { padding-left: 0; }
  .grid tr.accent th:first-child { padding-left: 8px; }
  .grid th.item { min-width: 0; }
  .grid td.num { min-width: 0; }
  .grid thead th { font-size: 9.5px; }
  .grid tr.group th { padding-top: 5px; font-size: 9.5px; }
  .grid tr.accent th, .grid tr.accent td { font-size: 11px; }
  .grid td.num input { width: 100%; border: 0; background: none; padding: 0; font-size: 10px; height: auto; }
  .grid input.changed { background: none; box-shadow: none; }
  .row-hint, .est { display: none; }
  .family-summary { margin-top: 8px; }
  .family-summary td { font-size: 9.5px; }
  .sheet-note { font-size: 8.5px; margin-top: 8px; }
  .grid, .result-bar, .family-summary { break-inside: avoid; }
  .osusume-sheet { break-before: page; }
  .osusume-sheet.no-print { display: none !important; }
  .osu-sum { padding: 4px 10px 2px 0; }
  .osu-sum + .osu-sum { padding-left: 10px; }
  .osu-sum span { font-size: 9px; }
  .osu-sum strong { font-size: 12px; }
  .osusume-sheet .osu-h { font-size: 9.5px; margin: 8px 0 4px; padding-top: 4px; }
  .osu-table td, .osu-table th { font-size: 9.5px; padding: 2.5px 6px; }
  .osu-table a { color: #1a4fa0; text-decoration: underline; }
}
