/* ── 書類の白。差し色は紺。赤は「加算税」の意味にだけ使う ─────────── */
:root {
  /* Meiryo UI 優先。無い環境は OS 標準の日本語 UI 書体へ落とす */
  --ui: "Meiryo UI", Meiryo, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", sans-serif;
  --paper:   #F0EFEA;
  --panel:   #FFFFFF;
  --panel-2: #E7E6E0;
  --ink:     #191C20;
  --ink-2:   #4A4F56;
  --ink-3:   #7A8089;
  --navy:    #23374D;
  --navy-2:  #35506E;
  --navy-w:  #E4E9EF;
  --olive:   #6E6440;
  --danger:  #A32B2B;   /* 重加算税など、警告の意味でのみ使う */
  --line:    #D6D5CE;
  --line-2:  #C2C1B8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14171B; --panel: #1B1F24; --panel-2: #23282E;
    --ink: #E8E8E3; --ink-2: #B2B6BC; --ink-3: #868C94;
    --navy: #7FA3CB; --navy-2: #A6C2E0; --navy-w: #1D2833;
    --olive: #B9AA75; --danger: #E2736C;
    --line: #2B3138; --line-2: #3A424B;
  }
}
:root[data-theme="dark"] {
  --paper: #14171B; --panel: #1B1F24; --panel-2: #23282E;
  --ink: #E8E8E3; --ink-2: #B2B6BC; --ink-3: #868C94;
  --navy: #7FA3CB; --navy-2: #A6C2E0; --navy-w: #1D2833;
  --olive: #B9AA75; --danger: #E2736C;
  --line: #2B3138; --line-2: #3A424B;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--ui);
  font-size: 15.5px; line-height: 1.9; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-family: var(--ui); font-weight: 700; text-wrap: balance; }
.num { font-family: var(--ui); font-variant-numeric: tabular-nums; }

.band { background: var(--navy); color: #F0EFEA; font-size: 11.5px; letter-spacing: .05em; padding: 7px 20px; text-align: center; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ── 上部の進行バー ────────────────────────────────────────── */
#bar { position: fixed; left: 0; top: 0; height: 3px; background: var(--navy); width: 0; z-index: 50; transition: width .1s linear; }

/* ── ヘッダ ────────────────────────────────────────────────── */
header { padding: 40px 0 56px; border-bottom: 1px solid var(--line); background: var(--panel); }
.office { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.office b { font-family: var(--ui); font-size: 17px; color: var(--ink); letter-spacing: .08em; }
h1 { font-size: clamp(28px, 4.6vw, 50px); line-height: 1.5; margin: 34px 0 16px; letter-spacing: .02em; }
h1 span { color: var(--navy); }
.lede { max-width: 60ch; color: var(--ink-2); margin: 0 0 28px; }
.badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge { font-size: 12px; border: 1px solid var(--line-2); color: var(--ink-2); padding: 4px 12px; border-radius: 2px; background: var(--paper); }

/* ── 導入 ──────────────────────────────────────────────────── */
section { padding: 64px 0; }
.shead { margin-bottom: 30px; }
.shead .no { font-family: var(--ui); font-size: 11.5px; letter-spacing: .16em; color: var(--olive); }
.shead h2 { font-size: 27px; margin: 6px 0 8px; letter-spacing: .04em; }
.shead p { margin: 0; color: var(--ink-2); max-width: 62ch; font-size: 14.5px; }

.rise { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.3,1); }
.rise.seen { opacity: 1; transform: none; }

.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); gap: 16px; }
.case { background: var(--panel); border: 1px solid var(--line); padding: 22px 20px; position: relative; }
.case::before { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: var(--navy); }
.case h3 { font-size: 16px; margin-bottom: 6px; }
.case p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* ── 横スクロールのタイムライン ───────────────────────────── */
.track { position: relative; }
.sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; background: var(--panel); border-block: 1px solid var(--line); }
.stickyhead { padding: 0 clamp(24px, 8vw, 110px) 22px; }
.stickyhead .no { font-family: var(--ui); font-size: 11.5px; letter-spacing: .16em; color: var(--olive); }
.stickyhead h2 { font-size: clamp(22px, 3vw, 31px); margin: 6px 0 4px; }
.stickyhead p { margin: 0; font-size: 13.5px; color: var(--ink-3); }

.rail { display: flex; gap: 22px; padding: 0 clamp(24px, 8vw, 110px); will-change: transform; }
.tl {
  flex: 0 0 320px; background: var(--paper); border: 1px solid var(--line);
  padding: 24px 22px; position: relative; min-height: 268px;
}
.tl .when { font-family: var(--ui); font-size: 11.5px; letter-spacing: .1em; color: var(--navy); }
.tl .step { position: absolute; right: 18px; top: 16px; font-family: var(--ui); font-size: 42px; line-height: 1; color: var(--line-2); }
.tl h3 { font-size: 18px; margin: 10px 0 8px; }
.tl p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.85; }
.tl .who { margin-top: 14px; font-size: 11.5px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 9px; }
.tl.key { border-color: var(--navy); background: var(--navy-w); }

.railline { position: absolute; left: 0; right: 0; bottom: 84px; height: 1px; background: var(--line); }
.progress { padding: 20px clamp(24px, 8vw, 110px) 0; display: flex; align-items: center; gap: 14px; }
.progress .barwrap { flex: 1; height: 2px; background: var(--line); position: relative; }
.progress .barin { position: absolute; left: 0; top: 0; height: 100%; background: var(--navy); width: 0; }
.progress .lbl { font-family: var(--ui); font-size: 11px; color: var(--ink-3); }

/* ── 加算税 ────────────────────────────────────────────────── */
.rates { border: 1px solid var(--line); background: var(--panel); }
.rate { display: grid; grid-template-columns: 190px minmax(0,1fr) 92px; gap: 18px; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.rate:last-child { border-bottom: none; }
.rate .nm { font-size: 14px; }
.rate .nm small { display: block; font-size: 11.5px; color: var(--ink-3); }
.rate .bw { height: 9px; background: var(--panel-2); position: relative; }
.rate .bi { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: var(--navy); transition: width 1.1s cubic-bezier(.2,.8,.3,1); }
.rate.hi .bi { background: var(--danger); }
.rate .pc { font-family: var(--ui); font-size: 19px; text-align: right; font-variant-numeric: tabular-nums; }
.rate.hi .pc { color: var(--danger); }
.ratenote { font-size: 12px; color: var(--ink-3); margin: 14px 0 0; line-height: 1.85; }

/* ── 書面添付 ──────────────────────────────────────────────── */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); padding: 26px 24px; }
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.card .law { font-size: 11.5px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }

/* ── 料金 ──────────────────────────────────────────────────── */
.fees { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); font-size: 14px; }
.fees th, .fees td { padding: 13px 18px; border-bottom: 1px solid var(--line); text-align: left; }
.fees th { background: var(--panel-2); font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.fees td.p { font-family: var(--ui); text-align: right; white-space: nowrap; }
.fees tr:last-child td { border-bottom: none; }

/* ── CTA ───────────────────────────────────────────────────── */
.cta { background: var(--navy); color: #F0EFEA; padding: 46px clamp(24px, 5vw, 56px); }
.cta h2 { font-size: 25px; margin-bottom: 10px; color: #fff; }
.cta p { margin: 0 0 22px; font-size: 14.5px; opacity: .84; max-width: 56ch; }
.btn { display: inline-block; background: var(--paper); color: var(--navy); text-decoration: none; padding: 14px 38px; font-weight: 700; font-size: 15px; transition: transform .18s, box-shadow .22s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.cta small { display: block; margin-top: 14px; font-size: 11.5px; opacity: .7; }

/* ── 実装メモ ──────────────────────────────────────────────── */
.techgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 22px 30px; }
.techgrid dt { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.techgrid dd { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.8; }
.techgrid .m { font-family: var(--ui); font-size: 11.5px; color: var(--olive); }

/* ── 問い合わせ ────────────────────────────────────────────── */
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(226px, 1fr)); gap: 16px 22px; max-width: 820px; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f > label { font-size: 11px; letter-spacing: .12em; color: var(--ink-3); }
.f .req { color: var(--danger); }
.f input[type="text"], .f input[type="email"], .f input[type="tel"], .f textarea, .f select {
  font: inherit; font-size: 14px; padding: 10px 11px; width: 100%;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 0;
}
.f textarea { min-height: 112px; resize: vertical; }
.f input:focus, .f textarea:focus, .f select:focus { outline: none; border-color: var(--navy); }
.f .err { font-size: 11.5px; color: var(--danger); min-height: 1.15em; }
.f.bad input, .f.bad textarea, .f.bad select { border-color: var(--danger); }
.consent { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.consent input { accent-color: var(--navy); margin-top: 5px; }
.submit {
  font: inherit; font-family: var(--ui); font-weight: 700; font-size: 15px;
  padding: 14px 44px; margin-top: 4px; cursor: pointer;
  background: var(--navy); color: #F0EFEA; border: none;
  transition: background .2s, transform .16s;
}
.submit:hover { background: var(--navy-2); transform: translateY(-1px); }
.sent { display: none; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--navy); background: var(--navy-w); font-size: 13px; max-width: 820px; }
.sent.on { display: block; }

/* ── ページ上部へ ──────────────────────────────────────────── */
.pagetop {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 50px; height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--navy); color: #F0EFEA; text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .3s, transform .3s, background .2s;
}
.pagetop.on { opacity: 1; pointer-events: auto; transform: none; }
.pagetop:hover { background: var(--navy-2); }
.pagetop b { font-size: 15px; line-height: 1; }
.pagetop span { font-size: 7.5px; letter-spacing: .1em; margin-top: 3px; }

footer { padding: 34px 0 60px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line); }
footer p { margin: 0 0 8px; text-wrap: pretty; word-break: auto-phrase; }

@media (max-width: 720px) {
  .rate { grid-template-columns: 1fr 68px; }
  .rate .bw { grid-column: 1 / -1; }
  .tl { flex-basis: 262px; }
}
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1 !important; transform: none !important; }
  .sticky { position: static; height: auto; padding: 40px 0; }
  .rail { overflow-x: auto; transform: none !important; padding-bottom: 14px; }
  .rate .bi { transition: none; }
  .btn:hover { transform: none; }
}
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
