@font-face {
  font-family: "Inter";
  src: url("fonts/Inter.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-primary: #EAF1FF;
  --surface-primary: #FFFFFF;
  --text-primary: #13233A;
  --text-secondary: #3D4B5F;
  --text-tertiary: #5A6577;
  --text-inverse: #FFFFFF;
  --text-inverse-muted: #DCE6FF;
  --text-link: #2B4FD6;
  --text-error: #B3261E;
  --accent: #22388C;
  --accent-subtle: #FFD45E;
  --accent-text: #6A4800;
  --action-primary: #3461EC;
  --action-disabled: #E3E8EF;
  --action-text-disabled: #5A6577;
  --action-tertiary-hover: #DCE6FF;
  --border-default: #CDD5DF;
  --border-subtle: #E3E8EF;
  --border-strong: #7D8898;
  --border-focus: #13233A;
  --border-error: #B3261E;
  --scrim: rgba(10, 10, 10, 0.5);
  --shadow-card: 0 10px 24px rgba(20, 36, 77, 0.12);
  --shadow-float: 0 12px 32px -6px rgba(15, 59, 59, 0.18), 0 2px 6px rgba(15, 59, 59, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --font-heading: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg-primary); color: var(--text-primary); font: 400 16px/1.5 var(--font-body); }

a { color: var(--text-link); }
h1, h2 { font-family: var(--font-heading); color: var(--text-primary); }

.masthead { position: sticky; top: 0; z-index: 5; background: var(--bg-primary); border-bottom: 1px solid var(--border-default); padding: 12px 16px; text-align: center; }
.masthead-name { font-weight: 700; font-size: 16px; line-height: 1.4; color: var(--text-primary); text-decoration: none; }

.article, .legal-sheet { max-width: 720px; margin: 0 auto; padding: 32px 16px 48px; }

.opener { padding-bottom: 24px; border-bottom: 2px solid var(--text-primary); }
.kicker { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.opener h1 { margin: 0 0 16px; font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.standfirst { margin: 0 0 24px; font-size: 18px; line-height: 1.55; color: var(--text-secondary); }
.contents { margin: 0; padding: 16px 16px 16px 36px; background: var(--surface-primary); border-radius: var(--radius-lg); font-size: 15px; line-height: 1.9; }
.contents a { color: var(--text-primary); text-decoration-color: var(--border-default); text-underline-offset: 3px; }
.contents a:hover { color: var(--action-primary); }

.chapter { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 32px 0; border-bottom: 1px solid var(--border-default); scroll-margin-top: 48px; }
.chapter-mark { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.chapter-mark span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: var(--radius-full); background: var(--accent); color: var(--accent-subtle); font-weight: 800; font-size: 18px; }
.chapter-mark svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chapter-body h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.25; font-weight: 700; }
.chapter-body p { margin: 0 0 12px; font-size: 16px; line-height: 1.65; }
.aside-note { padding-left: 12px; border-left: 3px solid var(--accent-subtle); color: var(--text-secondary); font-size: 14px !important; }

.flow-list { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: flow; }
.flow-list li { position: relative; padding: 0 0 16px 44px; line-height: 1.6; counter-increment: flow; }
.flow-list li::before { content: counter(flow); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--accent-subtle); color: var(--accent-text); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.flow-list li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; border-left: 2px dashed var(--border-default); }

.param-table { width: 100%; margin: 0 0 16px; border-collapse: collapse; background: var(--surface-primary); border-radius: var(--radius-lg); overflow: hidden; font-size: 15px; }
.param-table th, .param-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-subtle); line-height: 1.5; }
.param-table tr:last-child th, .param-table tr:last-child td { border-bottom: 0; }
.param-table th { width: 40%; font-weight: 600; color: var(--text-secondary); }
.param-table td { font-weight: 600; }

.calc { margin: 0 0 16px; padding: 16px; background: var(--surface-primary); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); font-variant-numeric: tabular-nums; }
.calc-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border-default); }
.calc-row dt { color: var(--text-secondary); }
.calc-row dd { margin: 0; font-weight: 700; }
.calc-total { border-bottom: 0; padding-top: 12px; font-size: 18px; }
.calc-total dt { color: var(--text-primary); font-weight: 700; }

.bank-callout { padding: 16px; border-radius: var(--radius-lg); background: var(--accent); color: var(--text-inverse); font-weight: 600; }

.qa-list > p:first-child { margin: 0 0 12px; font-size: 13px; color: var(--text-tertiary); }
.faq-item { background: var(--surface-primary); border-radius: var(--radius-md); margin: 0 0 8px; }
.faq-item summary { cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 600; line-height: 1.45; list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--action-primary); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0; padding: 0 16px 16px; line-height: 1.6; color: var(--text-secondary); }

.byline { margin-top: 32px; padding: 20px 16px; border-top: 2px solid var(--text-primary); }
.byline h2 { margin: 0 0 8px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.byline p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }

.colophon { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; padding: 20px 16px 32px; border-top: 1px solid var(--border-default); font-size: 13px; color: var(--text-tertiary); }
.colophon a { color: var(--text-secondary); }

.back-link { display: inline-block; margin-bottom: 16px; font-size: 14px; font-weight: 600; text-decoration: none; }
.back-link::before { content: "← "; }
.legal-sheet h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; font-weight: 800; }
.legal-sheet h2 { margin: 28px 0 8px; font-size: 19px; line-height: 1.35; }
.legal-sheet p, .legal-sheet li { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.legal-meta { margin: 0 0 24px; font-size: 13px !important; color: var(--text-tertiary); }
.legal-facts { padding: 16px; background: var(--surface-primary); border-radius: var(--radius-lg); }
.legal-sheet .faq-item p { font-size: 15px; }
/* Opened from the form: the app's native bar is the page header, the text starts right under it */
.from-form .legal-sheet { padding-top: 16px; }

@media (min-width: 760px) {
  .article { padding-top: 56px; }
  .opener h1 { font-size: 46px; }
  .standfirst { font-size: 20px; }
  .contents { columns: 2; column-gap: 32px; }
  .chapter { grid-template-columns: 72px 1fr; gap: 24px; }
  .chapter-mark { flex-direction: column; align-items: flex-start; }
  .chapter-body h2 { font-size: 28px; }
  .masthead { text-align: left; padding: 14px max(16px, calc((100vw - 720px) / 2)); }
}
