:root {
  color-scheme: light;
  --ink: #17262d;
  --navy: #123c4a;
  --teal: #24776f;
  --teal-dark: #175951;
  --paper: #f5f3ed;
  --white: #fff;
  --muted: #617078;
  --line: #d9dfdc;
  --amber: #f1b95b;
  --danger: #9d2f31;
  --shadow: 0 18px 50px rgba(18, 60, 74, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif; line-height: 1.7; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--navy); line-height: 1.25; letter-spacing: -.02em; }
.wrap { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.narrow { width: min(960px, calc(100% - 40px)); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 8px 12px; background: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

.site-header { position: sticky; z-index: 10; top: 0; border-bottom: 1px solid rgba(18,60,74,.12); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
.nav { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 900; text-decoration: none; }
.brand span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #fff; background: var(--teal); font-size: 12px; letter-spacing: .04em; }
.nav nav { display: flex; gap: 22px; }
.nav nav a { color: #43555d; font-size: 14px; font-weight: 700; text-decoration: none; }
.nav nav a[aria-current="page"] { color: var(--teal-dark); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; min-height: 46px; color: var(--muted); font-size: 12px; }
.breadcrumb a { font-weight: 800; text-decoration: none; }

.hero { padding: 76px 0 64px; background: radial-gradient(circle at 82% 12%, #d1ece6 0, transparent 30%), linear-gradient(145deg, #fff 0, #f5f3ed 68%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); align-items: center; gap: clamp(40px, 7vw, 88px); }
.eyebrow { margin-bottom: 12px; color: var(--teal); font-size: 12px; font-weight: 900; letter-spacing: .14em; }
h1 { margin-bottom: 20px; font-size: clamp(42px, 6vw, 72px); }
.hero-title-detail { display: block; margin-top: 12px; color: var(--teal-dark); font-size: clamp(17px, 2vw, 24px); font-weight: 800; letter-spacing: 0; }
.lead { max-width: 720px; color: #4a5e66; font-size: clamp(17px, 2vw, 20px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 19px; border: 1px solid var(--teal); border-radius: 12px; color: #fff; background: var(--teal); font-weight: 800; text-decoration: none; box-shadow: 0 7px 18px rgba(36,119,111,.16); }
.button:hover { border-color: var(--teal-dark); background: var(--teal-dark); }
.button.secondary { color: var(--teal-dark); background: #fff; box-shadow: none; }
.micro, .field-help { color: var(--muted); font-size: 13px; }
.micro { margin-top: 13px; }
.snapshot-card { padding: 26px; border: 1px solid rgba(36,119,111,.2); border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.status-dot { display: inline-flex; align-items: center; gap: 8px; color: var(--teal-dark); font-size: 12px; font-weight: 900; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2aa776; box-shadow: 0 0 0 4px #dff3ea; }
.snapshot-card dl { margin: 20px 0 12px; }
.snapshot-card dl div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid #e6e9e7; }
.snapshot-card dt { color: var(--muted); font-size: 13px; }
.snapshot-card dd { margin: 0; font-weight: 900; text-align: right; }
.snapshot-card p { margin: 0; color: #8a5813; font-size: 12px; font-weight: 800; }

.scope-strip { border-block: 1px solid rgba(18,60,74,.13); background: var(--navy); color: #fff; }
.scope-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.scope-grid div { display: grid; gap: 2px; padding: 17px 22px; border-right: 1px solid rgba(255,255,255,.14); }
.scope-grid div:last-child { border: 0; }
.scope-grid strong { font-size: 13px; }
.scope-grid span { color: #cbdadd; font-size: 12px; }

.section { padding: 72px 0; }
.workspace { background: #fafaf7; }
.section-heading { margin-bottom: 30px; }
.section-heading h2, .step-heading h2, .result-heading h2 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 40px); }
.section-heading > p:last-child, .step-heading p, .result-heading p, .block-heading p { margin: 0; color: var(--muted); }
.code-entry { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.code-entry label { display: block; margin-bottom: 7px; color: var(--navy); font-size: 13px; font-weight: 900; }
.code-entry-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.code-entry input { min-width: 0; min-height: 52px; padding: 10px 14px; border: 1px solid #9caaad; border-radius: 12px; color: var(--ink); background: #fff; font-size: 18px; }
.code-entry input:focus { border-color: var(--teal); outline: 3px solid rgba(36,119,111,.16); }
.field-help { margin: 7px 0 0; }
.suggestions { display: grid; gap: 6px; margin-top: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #f8faf9; }
.suggestions[hidden] { display: none; }
.suggestions button { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; color: var(--ink); background: #fff; text-align: left; }
.suggestions button:hover, .suggestions button:focus-visible { background: #eaf5f2; }
.suggestions span { display: grid; gap: 1px; }
.suggestions small { color: var(--muted); }
.suggestions em { flex: 0 0 auto; color: var(--teal-dark); font-size: 12px; font-style: normal; font-weight: 900; }
.quick-actions { display: flex; justify-content: flex-end; margin: 10px 4px 0; }
.text-button { padding: 4px 0; border: 0; color: var(--teal-dark); background: transparent; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.message { margin: 12px 0 0; padding: 11px 13px; border-radius: 10px; font-size: 14px; }
.message.error { border: 1px solid #e5b1b2; color: var(--danger); background: #fff2f2; }
.selected-funds, .allocation-list { display: grid; gap: 10px; margin-top: 20px; }
.allocation-section[hidden] { display: none; }
.empty-selection { margin: 0; padding: 18px; border: 1px dashed #a9b5b5; border-radius: 14px; color: var(--muted); background: #fff; }
.fund-card, .allocation-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.fund-card h3 { margin: 3px 0; font-size: 18px; }
.fund-card p { margin: 0; color: var(--muted); font-size: 12px; }
.fund-code, .security-code { color: var(--teal-dark); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.remove-fund { border: 0; color: var(--danger); background: transparent; font-size: 13px; font-weight: 800; text-decoration: underline; }
.step-heading { display: grid; grid-template-columns: 58px 1fr; gap: 18px; margin-top: 54px; }
.step-heading > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; color: #fff; background: var(--navy); font-weight: 900; }
.allocation-row > span:first-child { display: grid; }
.allocation-row small { color: var(--muted); }
.allocation-input { display: flex; align-items: center; gap: 8px; }
.allocation-input input { width: 110px; min-height: 42px; padding: 7px 10px; border: 1px solid #a9b5b5; border-radius: 10px; text-align: right; }
.allocation-input em { color: var(--muted); font-size: 12px; font-style: normal; }
.calculation-note { display: grid; gap: 2px; margin-top: 14px; padding: 15px 18px; border: 1px solid #b8d8d1; border-radius: 14px; color: var(--teal-dark); background: #eef9f6; }
.calculation-note span { color: #486a66; }
.actions-row { margin-top: 22px; }
.analyze { width: 100%; min-height: 54px; font-size: 17px; }
.supported-panel { margin-top: 26px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.supported-panel summary { padding: 14px 16px; color: var(--navy); cursor: pointer; font-weight: 800; }

.results { scroll-margin-top: 82px; margin-top: 70px; padding-top: 56px; border-top: 1px solid var(--line); }
.result-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; }
.summary-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 26px 0; }
.summary-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.summary-card span, .summary-card small { display: block; color: var(--muted); font-size: 11px; }
.summary-card strong { display: block; margin: 4px 0; color: var(--navy); font-size: clamp(20px, 2.5vw, 27px); overflow-wrap: anywhere; }
.insight-callout { display: grid; gap: 5px; padding: 23px 25px; border-radius: 18px; color: #fff; background: var(--navy); }
.insight-callout span { color: var(--amber); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.insight-callout strong { color: #fff; font-size: 18px; }
.insight-callout p { margin: 0; color: #d5e3e5; }
.result-block { margin-top: 46px; }
.block-heading { margin-bottom: 14px; }
.block-heading h3 { margin-bottom: 5px; font-size: 25px; }
.ranking-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.holdings-filter { display: inline-flex; flex: 0 0 auto; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.holdings-filter button { min-height: 36px; padding: 6px 11px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; }
.holdings-filter button[aria-pressed="true"] { color: #fff; background: var(--teal); }
.filter-count { margin: -5px 0 12px; color: var(--teal-dark); font-size: 12px; font-weight: 900; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 13px; border-bottom: 1px solid #e8ece9; text-align: left; white-space: nowrap; }
th { color: #42565d; background: #f1f5f3; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.table-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.more-button { display: block; margin: 12px auto 0; }
.bar-list { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.bar-row { display: grid; grid-template-columns: 28px minmax(140px, 240px) 1fr 74px; gap: 10px; align-items: center; font-size: 12px; }
.bar-rank { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; color: var(--navy); background: #e3eeeb; font-weight: 900; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; overflow: hidden; border-radius: 99px; background: #e3e9e7; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #54b59e); }
.bar-row strong { text-align: right; }
.method-card { padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.method-card ul { margin: 10px 0 0; padding-left: 1.3em; color: var(--muted); }
.pairwise-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 0 16px; padding: 0; list-style: none; }
.pairwise-list li { display: grid; gap: 2px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.pairwise-list strong { color: var(--navy); font-size: 13px; }
.pairwise-list span { color: var(--muted); font-size: 12px; }

.sources { background: var(--white); }
.notes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.notes-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: #fafbf9; }
.notes-grid h3 { margin-bottom: 7px; }
.notes-grid p, .notes-grid ul { margin-bottom: 0; color: var(--muted); }
.license-note { margin-top: 18px; padding: 18px 20px; border-left: 4px solid var(--teal); background: #eff8f5; font-size: 13px; }
.license-note p { margin-bottom: 4px; }
.disclaimer { margin-top: 18px; padding: 20px; border: 1px solid #e8c77e; border-radius: 14px; background: #fff8e8; }
.disclaimer p { margin: 4px 0 0; color: #6b592e; }
footer { padding: 24px 0; color: #c7d6d8; background: #0d313c; font-size: 12px; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
footer a { color: #eef7f8; text-decoration: none; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .snapshot-card { max-width: 620px; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .wrap, .narrow { width: min(100% - 24px, 1160px); }
  .nav nav { display: none; }
  .hero { padding: 52px 0 46px; }
  h1 { font-size: clamp(38px, 12vw, 56px); }
  .hero-actions, .result-heading, .fund-card, .allocation-row { align-items: stretch; flex-direction: column; }
  .hero-actions .button, .result-heading .button { width: 100%; }
  .scope-grid { grid-template-columns: 1fr; }
  .scope-grid div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.14); }
  .code-entry-row { grid-template-columns: 1fr; }
  .step-heading { grid-template-columns: 1fr; gap: 8px; }
  .allocation-input { justify-content: flex-end; }
  .summary-cards, .notes-grid { grid-template-columns: 1fr; }
  .pairwise-list { grid-template-columns: 1fr; }
  footer .wrap { align-items: flex-start; flex-direction: column; }
  .ranking-heading { align-items: stretch; flex-direction: column; }
  .holdings-filter { align-self: flex-start; }
  .bar-row { grid-template-columns: 26px minmax(90px, 130px) 1fr 60px; gap: 7px; }
  footer .wrap { flex-direction: column; gap: 2px; }
}
