/* ============================================================
   シキカル — 公開ページ共通スタイル
   トークンはアプリの docs-internal/design.md §4-1（標準テーマ「生成り」）に合わせる
   （生成りの紙・墨・朱・藍。装飾は控えめに、帳面の罫線で区切る）
   ============================================================ */

:root {
  --paper: #F4F1E8;
  --display: #FBFAF5;
  --ink: #1D1B17;
  --ink2: #58534A;
  --ink3: #6F6A60;
  --key-op: #E6E0D2;
  --key-lip: #8E8676;
  --shu: #B5391F;
  --on-shu: #FFFFFF;
  --shu-text: #A53419;
  --ai: #264D8C;
  --ai-bg: #DDE6F4;
  --ai-text: #1F4178;
  --hair: #D9D3C5;
  --radius: 18px;
  --maxw: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141311;
    --display: #1B1A17;
    --ink: #F1EEE6;
    --ink2: #B7B0A3;
    --ink3: #9C968A;
    --key-op: #3A3731;
    --key-lip: #77716A;
    --shu: #E0634A;
    --on-shu: #1A0E0A;
    --shu-text: #F08A72;
    --ai: #8DB0EA;
    --ai-bg: #22324D;
    --ai-text: #B9CEF2;
    --hair: #34312C;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* 数字は桁が揃う字形（アプリの monospacedDigit に相当） */
.num { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.op { color: var(--ink2); font-weight: 300; padding: 0 0.2em; }
.sel {
  color: var(--ai-text); background: var(--ai-bg);
  border-bottom: 3px solid var(--ai); border-radius: 6px; padding: 0 0.12em;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- ナビ ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--hair);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 600; }
.nav-links a { color: var(--ink2); }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 640px) { .nav-links a.hide-sm { display: none; } }

/* ---------- ヒーロー（帳面の一行） ---------- */
.hero { padding: 64px 0 0; overflow: hidden; border-bottom: 1px solid var(--hair); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: end; }
.hero-copy { padding-bottom: 64px; }
.hero h1 { font-size: clamp(32px, 5.6vw, 54px); font-weight: 800; line-height: 1.3; }
.hero .lead { margin-top: 18px; font-size: clamp(15px, 2.1vw, 18px); color: var(--ink2); }
.ledger {
  margin-top: 28px; background: var(--display); border: 1px solid var(--hair);
  border-radius: var(--radius); padding: 18px 22px; text-align: right;
}
.ledger .expr { font-size: clamp(22px, 3.4vw, 28px); }
.ledger .result { font-size: clamp(40px, 7vw, 56px); font-weight: 500; line-height: 1.2; }
.ledger .hint { font-size: 15px; color: var(--ink2); }
.cta-row { display: flex; align-items: center; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.badge-soon {
  display: inline-flex; align-items: center;
  background: var(--shu); color: var(--on-shu);
  padding: 12px 20px; border-radius: 14px; font-weight: 700; font-size: 15px;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--shu) 60%, #000);
}
.badge-soon small { display: block; font-size: 11px; font-weight: 500; opacity: 0.85; line-height: 1.2; }
.hero-note { font-size: 13px; color: var(--ink2); }
.hero-shot { display: flex; justify-content: center; }
.hero-shot img {
  width: 100%; max-width: 300px; display: block;
  border-radius: 40px 40px 0 0; border: 1px solid var(--hair); border-bottom: 0;
}
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 16px; }
  .hero-shot img { max-width: 250px; }
}

/* ---------- セクション ---------- */
.section { padding: 72px 0; }
.section-label {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--shu-text); border-bottom: 2px solid var(--shu);
  padding-bottom: 2px; margin-bottom: 14px;
}
.section h2 { font-size: clamp(24px, 4.2vw, 36px); font-weight: 800; line-height: 1.45; }
.section p.desc { margin-top: 14px; color: var(--ink2); font-size: clamp(15px, 2vw, 17px); }

.feature {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 48px;
  padding: 44px 0; border-top: 1px dashed var(--hair);
}
.feature:first-of-type { border-top: 0; }
.feature.reverse .feature-media { order: 2; }
.feature-media { display: flex; justify-content: center; }
.feature-media img {
  width: 100%; max-width: 270px; border-radius: 34px; display: block;
  border: 1px solid var(--hair);
}
@media (max-width: 800px) {
  .feature, .feature.reverse { grid-template-columns: 1fr; gap: 24px; }
  .feature.reverse .feature-media { order: 0; }
}

/* 税の内訳（アプリの S1 と同じ並び） */
.breakdown {
  margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--display); border: 1px solid var(--hair); border-radius: 12px; overflow: hidden;
}
.breakdown div { padding: 10px 14px; border-left: 1px solid var(--hair); }
.breakdown div:first-child { border-left: 0; }
.breakdown span { display: block; font-size: 13px; color: var(--ink2); }
.breakdown b { font-size: 20px; font-weight: 600; }
.small-note { margin-top: 8px; font-size: 13px; color: var(--ink3); }

/* 標準の計算機との違い */
.diff-list { list-style: none; margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.diff-list li { background: var(--display); border: 1px solid var(--hair); border-radius: 16px; padding: 16px 18px; }
.diff-list b { display: block; font-size: 16px; }
.diff-list span { font-size: 14px; color: var(--ink2); }
@media (max-width: 800px) { .diff-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .diff-list { grid-template-columns: 1fr; } }

/* ---------- 端末の中だけ ---------- */
.privacy-band { background: #1D1B17; color: #F1EEE6; text-align: center; padding: 72px 0; }
.privacy-band h2 { font-size: clamp(24px, 4.2vw, 34px); font-weight: 800; line-height: 1.45; }
.privacy-band p { margin-top: 14px; color: #B7B0A3; font-size: 16px; }
.privacy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
.pcard { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 20px 14px; }
.pcard b { display: block; font-size: 15px; }
.pcard span { font-size: 12px; color: #B7B0A3; }
@media (max-width: 700px) { .privacy-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Plus ---------- */
.plus-table { width: 100%; margin-top: 24px; border-collapse: collapse; background: var(--display); border-radius: 14px; overflow: hidden; font-size: 15px; }
.plus-table th, .plus-table td { padding: 10px 14px; border-bottom: 1px solid var(--hair); text-align: left; vertical-align: top; }
.plus-table th { font-size: 13px; color: var(--ink2); font-weight: 600; }
.plus-table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.note { margin-top: 18px; font-size: 13px; color: var(--ink2); }

/* ---------- フッター ---------- */
.footer { border-top: 1px solid var(--hair); padding: 34px 0; font-size: 14px; color: var(--ink2); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--ink); }

/* ---------- 文書ページ ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 44px 16px 96px; }
.doc h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 800; margin-bottom: 6px; }
.doc .updated { color: var(--ink2); font-size: 14px; margin-bottom: 30px; }
.doc h2 { font-size: 20px; font-weight: 700; margin: 34px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--hair); }
.doc h3 { font-size: 17px; font-weight: 700; margin: 24px 0 6px; }
.doc p, .doc li { color: var(--ink); font-size: 16px; line-height: 1.9; }
.doc ul, .doc ol { padding-left: 22px; margin: 10px 0; }
.doc li { margin: 4px 0; }
.doc .callout {
  background: var(--display); border: 1px solid var(--hair); border-left: 4px solid var(--shu);
  border-radius: 12px; padding: 16px 20px; margin: 22px 0;
}
.doc a.inline { color: var(--ai); font-weight: 700; border-bottom: 1px solid currentColor; word-break: break-all; }
.back-home { display: inline-flex; gap: 6px; color: var(--ink2); font-size: 14px; font-weight: 600; margin-bottom: 22px; }
.back-home:hover { color: var(--ink); }

/* grid の子が中身の幅で広がり、スマホで横にはみ出さないように */
.hero-grid > *, .feature > * { min-width: 0; }
.ledger .expr, .ledger .result { overflow-wrap: anywhere; }
body { overflow-x: hidden; }
