:root {
  --ink: #17201d;
  --muted: #67716d;
  --paper: #f5f3ec;
  --card: #fffef9;
  --forest: #10221c;
  --forest-2: #18392e;
  --gold: #e9c870;
  --line: #d9d8cf;
  --soft: #ebe9df;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Noto Sans JP", system-ui, sans-serif; font-size: 16px; line-height: 1.7; }
button, input, select { font: inherit; }
button { color: inherit; }
.site-header { min-height: 72px; padding: 14px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--gold); background: var(--forest); font-family: "Shippori Mincho", serif; }
.header-note, .small-note { font-size: .8rem; color: var(--muted); }
.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a, footer a { color: var(--muted); text-decoration: none; font-size: .85rem; }
.site-nav a:hover, footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.intro { display: grid; grid-template-columns: 1.35fr .65fr; gap: 64px; align-items: end; padding: 70px 0 40px; }
.eyebrow, .step { margin: 0 0 10px; color: #52645d; font-size: .75rem; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: "Shippori Mincho", serif; font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 1.25; letter-spacing: -.025em; }
.intro-copy { margin-bottom: 6px; color: var(--muted); }

.tool-tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tool-tab { min-height: 118px; padding: 18px; display: grid; grid-template-columns: auto 1fr; align-content: center; gap: 0 12px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.tool-tab > span { grid-row: 1 / 3; color: #929894; font-family: "Shippori Mincho", serif; }
.tool-tab strong { font-family: "Shippori Mincho", serif; font-size: 1.05rem; }
.tool-tab small { color: var(--muted); }
.tool-tab:hover { background: rgba(255,255,255,.48); }
.tool-tab.active { background: var(--forest); color: white; }
.tool-tab.active span, .tool-tab.active small { color: #b8c7c0; }
.tool-tab:focus-visible { outline: 3px solid #bd9b45; outline-offset: -3px; }
.tool-panel { margin-bottom: 76px; }
.tool-panel[hidden] { display: none; }
.tool-intro { min-height: 112px; display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 22px 0; }
.tool-intro h2, .section-heading h2 { margin-bottom: 0; font-family: "Shippori Mincho", serif; font-size: clamp(1.65rem, 3vw, 2.2rem); }
.tool-intro > p { max-width: 470px; margin-bottom: 2px; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .85fr); box-shadow: 0 22px 70px rgba(22,38,32,.1); }
.ledger-panel, .form-panel, .list-panel { padding: clamp(24px, 4vw, 46px); background: var(--card); }
.list-panel { border-left: 1px solid var(--line); }
.result-panel { padding: clamp(28px, 4vw, 46px); background: var(--forest); color: white; }
.panel-heading, .section-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.panel-heading h3 { margin-bottom: 0; font-family: "Shippori Mincho", serif; font-size: 1.35rem; }
.text-button { border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.text-button:hover { color: var(--ink); }
.rows { margin: 26px 0 18px; border-top: 1px solid var(--line); }
.cost-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(110px, 150px) 100px 38px; gap: 14px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.cost-name, .cost-amount, .form-panel input, .form-panel select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 3px; background: #f7f6f1; color: var(--ink); }
.cost-name:focus, .cost-amount:focus, .form-panel input:focus, .form-panel select:focus { outline: 2px solid #bd9b45; outline-offset: 1px; background: white; }
.money-input { position: relative; }
.money-input span { position: absolute; top: 10px; left: 12px; color: var(--muted); }
.money-input input { padding-left: 28px; text-align: right; }
.review-label { display: inline-flex; gap: 8px; align-items: center; font-size: .85rem; cursor: pointer; }
.review-label input { width: 19px; height: 19px; accent-color: var(--forest-2); }
.remove-row { border: 0; background: transparent; color: #8a918e; font-size: 1.35rem; cursor: pointer; }
.remove-row:hover { color: #8a342d; }
.add-button, .primary-button { border: 1px solid var(--ink); padding: 11px 17px; border-radius: 3px; cursor: pointer; font-weight: 700; }
.add-button { background: transparent; }
.add-button:hover { background: var(--soft); }
.primary-button { width: 100%; margin-top: 8px; background: var(--forest); color: white; }
.primary-button:hover { background: var(--forest-2); }
.form-panel { display: grid; align-content: start; gap: 18px; }
.form-panel label { display: grid; gap: 7px; color: #3d4b46; font-size: .9rem; font-weight: 600; }
.step.light { color: #b8c7c0; }
.total-block { margin: 34px 0 28px; padding-bottom: 28px; border-bottom: 1px solid rgba(255,255,255,.18); }
.total-block span, .total-block small { display: block; color: #b8c7c0; }
.total-block strong { display: block; margin: 6px 0; color: var(--gold); font-family: "Shippori Mincho", serif; font-size: clamp(2.7rem, 5vw, 4.2rem); line-height: 1.15; }
.summary-list { margin: 0; }
.summary-list div { display: flex; justify-content: space-between; gap: 20px; margin: 12px 0; }
.summary-list dt { color: #b8c7c0; }
.summary-list dd { margin: 0; font-weight: 600; }
.result-message { margin-top: 30px; padding: 17px; border-left: 3px solid var(--gold); background: rgba(255,255,255,.07); color: #dce5e1; font-size: .9rem; }
.renewal-list { margin-top: 24px; }
.renewal-item { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.renewal-item h3 { margin: 4px 0 2px; font-size: 1rem; }
.renewal-item p { margin: 0; color: var(--muted); font-size: .8rem; }
.renewal-item button { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.date-badge { color: #735d23; font-size: .75rem; font-weight: 700; }
.empty-state { padding: 24px 0; color: var(--muted); }
.timeline { margin: 22px 0 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 0 0 25px 22px; border-left: 1px solid #9ca9a4; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--forest); }
.timeline li.past { opacity: .48; }
.timeline time { font-size: .78rem; color: var(--muted); }
.timeline h3 { margin-bottom: 2px; font-size: 1rem; }
.timeline p { margin: 0; color: var(--muted); font-size: .85rem; }
.timeline .empty-state { display: block; padding-left: 0; border: 0; }
.timeline .empty-state::before { display: none; }
.next-actions { padding: 20px 0 70px; }
.section-heading { align-items: end; margin-bottom: 26px; }
.section-heading > p { max-width: 440px; margin-bottom: 2px; color: var(--muted); }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.action-grid article { min-height: 235px; padding: 27px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.34); }
.action-grid span { color: #735d23; font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
.action-grid h3 { margin: 42px 0 10px; font-family: "Shippori Mincho", serif; font-size: 1.35rem; }
.action-grid p { color: var(--muted); }
.card-link { display: inline-block; margin-top: 8px; color: var(--forest-2); font-size: .85rem; font-weight: 700; text-underline-offset: 4px; }
.disclosure { max-width: 850px; margin: 22px 0 0; color: var(--muted); font-size: .78rem; }
.guide-section { padding: 20px 0 90px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.guide-grid > a { min-height: 280px; padding: 30px; display: flex; flex-direction: column; color: var(--ink); text-decoration: none; background: var(--card); border: 1px solid var(--line); transition: transform .18s ease, box-shadow .18s ease; }
.guide-grid > a:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(22,38,32,.09); }
.guide-grid span { color: #735d23; font-size: .75rem; font-weight: 700; }
.guide-grid h3 { margin: 34px 0 12px; font-family: "Shippori Mincho", serif; font-size: 1.35rem; line-height: 1.55; }
.guide-grid p { color: var(--muted); }
.guide-grid strong { margin-top: auto; color: var(--forest-2); font-size: .85rem; }

/* Editorial and policy pages */
.page-shell { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 100px; }
.page-kicker { margin-bottom: 12px; color: #735d23; font-size: .78rem; font-weight: 700; letter-spacing: .12em; }
.page-shell h1 { max-width: 820px; font-size: clamp(2.1rem, 5vw, 3.8rem); }
.page-lead { max-width: 700px; margin: 28px 0 52px; color: var(--muted); font-size: 1.05rem; }
.article-meta { margin-top: 18px; color: var(--muted); font-size: .8rem; }
.article-body { max-width: 760px; }
.article-body h2 { margin: 56px 0 18px; font-family: "Shippori Mincho", serif; font-size: 1.75rem; }
.article-body h3 { margin: 34px 0 12px; font-size: 1.1rem; }
.article-body p, .article-body li { color: #37423e; }
.article-body li + li { margin-top: 10px; }
.article-body a { color: #285a49; text-underline-offset: 4px; }
.note-box, .decision-box, .ad-box { margin: 34px 0; padding: 24px 26px; border: 1px solid var(--line); background: var(--card); }
.decision-box { border-left: 4px solid var(--gold); }
.note-box h2, .decision-box h2, .ad-box h2 { margin-top: 0; font-size: 1.35rem; }
.check-list { padding-left: 1.4em; }
.tool-cta { margin: 44px 0; padding: 30px; background: var(--forest); color: white; }
.tool-cta p { color: #dce5e1; }
.tool-cta a { display: inline-block; padding: 11px 18px; border-radius: 3px; background: var(--gold); color: var(--forest); font-weight: 700; text-decoration: none; }
.ad-box { background: #f0eee5; }
.ad-label { display: inline-block; margin-bottom: 10px; color: var(--muted); font-size: .72rem; letter-spacing: .1em; }
.ad-box a[aria-disabled="true"] { color: var(--muted); pointer-events: none; }
.policy-list { padding-left: 1.4em; }
.contact-card { max-width: 680px; margin-top: 40px; padding: 30px; background: var(--card); border: 1px solid var(--line); }
.status-badge { display: inline-block; margin-bottom: 14px; padding: 4px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: .75rem; font-weight: 700; }
footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 48px; display: flex; justify-content: space-between; gap: 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
footer p { margin-bottom: 6px; }
footer p:first-child { color: var(--ink); font-weight: 700; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; align-content: start; }
@media (max-width: 900px) {
  .intro, .workspace { grid-template-columns: 1fr; }
  .intro { gap: 24px; padding: 48px 0 34px; }
  .tool-tabs { grid-template-columns: repeat(2, 1fr); }
  .list-panel { border-left: 0; border-top: 1px solid var(--line); }
  .action-grid, .guide-grid { grid-template-columns: 1fr; }
  .action-grid article { min-height: 190px; }
}
@media (max-width: 600px) {
  .site-header { align-items: flex-start; }
  .site-nav { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .site-nav a { font-size: .78rem; }
  main { width: min(100% - 24px, 1180px); }
  h1 { font-size: 2.3rem; }
  .tool-tabs { grid-template-columns: 1fr; }
  .tool-tab { min-height: 82px; }
  .tool-intro, .section-heading { display: block; }
  .tool-intro > p, .section-heading > p { margin-top: 12px; }
  .cost-row { grid-template-columns: 1fr 112px 34px; gap: 8px; }
  .review-label { grid-column: 1 / 3; }
  .remove-row { grid-column: 3; grid-row: 1; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .page-shell { width: min(100% - 24px, 920px); padding-top: 44px; }
  footer { width: min(100% - 24px, 1180px); display: block; }
  footer nav { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
