:root {
  color-scheme: light;
  --page: #eef4fa;
  --surface: #ffffff;
  --surface-soft: #f6f9fc;
  --surface-blue: #e4eff8;
  --surface-conditions: #f1f6fa;
  --ink: #17212b;
  --muted: #667480;
  --line: #d6e1ea;
  --blue: #174f7a;
  --green: #1f6b4f;
  --green-soft: #e7f3ed;
  --red: #8a3340;
  --red-soft: #f8e9eb;
  --body-size: 15px;
  --sub-size: 18px;
  --title-size: 30px;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font: 400 var(--body-size)/1.45 "Segoe UI", Arial, sans-serif;
}
button, input, select { font: inherit; }
h1, h2, h3, p, dl, dd { margin: 0; }

.v6-shell { max-width: 1280px; margin: 0 auto; padding: 24px; }
.v6-hero { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(480px,1.3fr); gap: 32px; margin-bottom: 12px; align-items: start; }
.v6-hero h1 { font-size: var(--title-size); line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.v6-hero-copy { display: grid; gap: 4px; padding-top: 3px; }
.v6-tagline { color: var(--muted); }
.v6-tagline.is-benefit { color: var(--green); }
.v6-tagline-risks { color: var(--red); }
.v6-release-note { margin-bottom: 12px; padding: 8px 12px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.v6-release-note strong { color: var(--ink); font-weight: 600; }
.v6-legal-note { display: grid; gap: 6px; margin-top: 16px; padding: 12px 14px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; line-height: 1.45; }
.v6-legal-note h2 { max-width: 90ch; margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.v6-legal-note p { max-width: 90ch; margin: 0; }
.v6-view-menu { display: flex; gap: 12px; margin-bottom: 18px; padding: 8px 10px 0; align-items: end; overflow: visible; background: var(--surface-blue); border: 1px solid var(--line); border-radius: 10px 10px 0 0; }
.v6-view-menu button { cursor: pointer; }
.v6-view-tabs { display: flex; gap: 4px; align-items: end; }
.v6-view-tabs svg, .v6-mobile-label { display: none; }
.v6-view-tabs svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.v6-view-tabs button { position: relative; bottom: -1px; min-height: 46px; padding: 9px 18px; color: var(--muted); background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: 7px 7px 0 0; }
.v6-view-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; background: var(--surface); border-color: var(--line); box-shadow: inset 0 3px var(--blue); }
.v6-panel-toggles { display: flex; gap: 8px; margin-left: auto; padding-bottom: 7px; align-items: center; }
.v6-panel-toggles button { min-height: 38px; padding: 7px 14px; color: var(--blue); background: transparent; border: 1px solid #afc5d6; border-radius: 7px; }
.v6-panel-toggles button[aria-expanded="true"] { color: var(--ink); font-weight: 600; background: var(--surface); border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.v6-view-menu button:hover { color: var(--ink); }
.v6-view-menu button:focus-visible { position: relative; z-index: 1; outline: 3px solid var(--blue); outline-offset: -3px; }
.v6-drawer-trigger { display: inline-flex; align-items: center; }

.v6-yield-curve { grid-area: main; margin: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.v6-yield-curve[hidden] { display: none; }
.v6-yield-head { padding: 14px 16px; background: var(--surface-blue); border-bottom: 1px solid var(--line); }
.v6-yield-head h2 { font-size: var(--sub-size); font-weight: 600; }
.v6-yield-optima { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 6px; }
.v6-yield-optima strong { color: var(--green); font-weight: 600; }
.v6-yield-legend { display: flex; gap: 10px 20px; padding: 0 16px 12px; flex-wrap: wrap; color: var(--muted); }
.v6-yield-legend span { display: inline-flex; gap: 7px; align-items: center; }
.v6-yield-legend span::before { width: 22px; height: 0; content: ""; border-top: 2px solid var(--blue); }
.v6-yield-legend .is-optimistic::before { border-color: var(--green); border-top-width: 3px; }
.v6-yield-legend .is-range::before { height: 10px; background: var(--surface-blue); border: 1px solid var(--line); }
.v6-yield-legend .is-extremes::before { border-top: 1px solid var(--muted); }
.v6-yield-legend .is-optimal::before { width: 2px; height: 18px; border: 0; background: repeating-linear-gradient(to bottom, var(--green) 0 3px, transparent 3px 6px); }
.v6-yield-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px; }
.v6-yield-panels figure { min-width: 0; margin: 0; padding: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.v6-yield-panels figcaption { margin-bottom: 6px; font-weight: 600; }
.v6-yield-panels svg { display: block; width: 100%; height: 250px; overflow: visible; }
.v6-scale-note { padding: 0 16px 12px; color: var(--muted); }
.v6-chart-grid { stroke: var(--line); stroke-width: 1; }
.v6-chart-axis, .v6-chart-label { fill: var(--muted); font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; }
.v6-chart-band { fill: #dbeaf5; stroke: none; }
.v6-chart-extreme { fill: none; stroke: #93a4b0; stroke-width: 1; }
.v6-chart-average, .v6-chart-optimistic { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.v6-chart-average { stroke: var(--blue); stroke-width: 3; }
.v6-chart-optimistic { stroke: var(--green); stroke-width: 2.5; }
.v6-chart-point { fill: var(--surface); stroke: var(--blue); stroke-width: 2; }
.v6-chart-point:focus { stroke: var(--ink); stroke-width: 4; outline: none; }
.v6-chart-optimal { stroke: var(--green); stroke-width: 2; stroke-dasharray: 3 3; }
.v6-yield-summary-wrap { padding: 0 16px 12px; overflow-x: auto; }
.v6-yield-summary { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.v6-yield-summary caption { padding-bottom: 6px; text-align: left; font-weight: 600; }
.v6-yield-summary th, .v6-yield-summary td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.v6-yield-summary th:first-child, .v6-yield-summary td:first-child { padding-left: 0; text-align: left; }
.v6-yield-summary th { color: var(--muted); font-weight: 400; }
.v6-yield-method { padding: 0 16px 14px; color: var(--muted); }

.v6-layout { display: grid; grid-template-columns: minmax(0,1fr) 360px; grid-template-areas: "main settings"; gap: 16px; align-items: start; }
.v6-layout.is-settings-closed { grid-template-columns: minmax(0,1fr); grid-template-areas: "main"; }
.v6-results { grid-area: main; min-width: 0; display: grid; gap: 12px; }
.v6-results[hidden] { display: none; }
.v6-leaders { display: grid; gap: 10px; }
.v6-leaders[aria-busy="true"] { opacity: .72; }
.v6-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.v6-settings { position: sticky; inset: auto; top: 16px; grid-area: settings; width: auto; max-width: none; height: auto; max-height: calc(100vh - 32px); margin: 0; padding: 0; overflow-y: auto; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
.v6-settings:not([open]) { display: none; }
.v6-settings::backdrop { background: rgb(23 33 43 / 28%); }
.v6-drawer-head { position: sticky; z-index: 30; top: 0; display: flex; min-height: 58px; padding: 9px 12px 9px 16px; align-items: center; justify-content: space-between; background: var(--surface-blue); border-bottom: 1px solid var(--line); }
.v6-drawer-head h2 { font-size: var(--sub-size); font-weight: 600; }
.v6-drawer-head button { min-height: 40px; padding: 7px 10px; color: var(--blue); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.v6-drawer-head button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
#v6-settings-close, #v6-method-close { display: none; }
.v6-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px; align-content: start; border-bottom: 1px solid var(--line); }
.v6-fields label { display: grid; gap: 5px; color: var(--muted); }
.v6-fields select { width: 100%; min-height: 42px; min-width: 0; padding: 8px 28px 8px 9px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }

.v6-filter + .v6-filter { border-top: 1px solid var(--line); }
summary { cursor: pointer; }
.v6-filter summary { display: grid; grid-template-columns: 1fr auto; gap: 12px; min-height: 54px; padding: 9px 16px; align-items: center; list-style: none; }
.v6-filter summary::-webkit-details-marker { display: none; }
.v6-filter summary > span:first-child { display: grid; }
.v6-filter summary strong { font-size: var(--sub-size); font-weight: 600; }
.v6-filter summary small { color: var(--muted); }
.v6-disclosure-arrow { display: grid; width: 28px; height: 28px; place-items: center; color: var(--blue); font-size: 24px; line-height: 1; transform: rotate(0deg); transition: transform 160ms ease; }
.v6-filter[open] .v6-disclosure-arrow { transform: rotate(180deg); }
.v6-checks { display: grid; padding: 0 10px 10px; }
.v6-checks label { display: flex; gap: 10px; min-height: 44px; padding: 9px 6px; align-items: center; border-radius: 7px; cursor: pointer; }
.v6-checks label:hover { background: var(--surface-soft); }
.v6-checks input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.v6-availability-note { margin: 0 16px 10px; color: var(--muted); }
.v6-setting-option { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 44px; align-items: center; }
.v6-setting-option[hidden] { display: none; }
.v6-setting-option label { min-width: 0; }
.v6-setting-help { position: relative; z-index: 0; display: grid; width: 44px; height: 44px; padding: 0; place-items: center; color: var(--blue); background: transparent; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.v6-setting-help::before { position: absolute; z-index: -1; inset: 8px; content: ""; background: var(--surface-blue); border: 1px solid var(--line); border-radius: 50%; }
.v6-setting-tooltip { position: absolute; z-index: 20; top: calc(100% + 3px); right: 5px; width: min(280px,calc(100% - 10px)); margin: 0; padding: 10px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 20px rgb(23 33 43 / 12%); }
.v6-setting-tooltip::before { position: absolute; top: -7px; right: 15px; width: 12px; height: 12px; content: ""; background: var(--surface); border-top: 1px solid var(--line); border-left: 1px solid var(--line); transform: rotate(45deg); }
.v6-setting-tooltip strong { font-weight: 600; }
.v6-setting-option.is-tooltip-above .v6-setting-tooltip { top: auto; bottom: calc(100% + 3px); }
.v6-setting-option.is-tooltip-above .v6-setting-tooltip::before { top: auto; bottom: -7px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.v6-setting-tooltip[hidden] { display: none; }
.v6-checks input:focus-visible, .v6-fields select:focus-visible, .v6-setting-help:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.v6-settings-foot { padding: 12px 16px; color: var(--blue); background: var(--surface-blue); border-top: 1px solid var(--line); }
.v6-method-content { display: grid; gap: 10px; padding: 16px; }
.v6-method-content strong { font-weight: 600; }

.v6-leader-card { display: grid; grid-template-columns: 44px minmax(0,1fr); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.v6-leader-card:first-child { border-top: 3px solid var(--blue); }
.v6-place { display: grid; place-items: start center; padding-top: 16px; color: var(--blue); background: var(--surface-blue); font-size: var(--sub-size); font-weight: 600; font-variant-numeric: tabular-nums; }
.v6-card-main { min-width: 0; }
.v6-card-head { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; min-height: 64px; padding: 12px 14px; align-items: center; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.v6-bank-mark { display: grid; width: 38px; height: 38px; place-items: center; color: #fff; background: var(--blue); border-radius: 9px; font-weight: 600; }
.v6-product { display: grid; min-width: 0; }
.v6-product strong { font-weight: 600; }
.v6-product-type { color: var(--muted); }
.v6-product-name { color: var(--ink); }
.v6-place-text { color: var(--muted); text-align: right; }

.v6-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 13px 14px; }
.v6-metrics > div { min-width: 0; padding: 0 12px; text-align: right; border-left: 1px solid var(--line); }
.v6-metrics > div:first-child { padding-left: 0; border-left: 0; }
.v6-metrics > div:last-child { padding-right: 0; }
.v6-metrics dt { color: var(--muted); }
.v6-metrics dd { margin-top: 3px; font-size: var(--sub-size); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.v6-metrics .is-primary dd { color: var(--green); }
.v6-metrics .is-secondary dd { color: var(--muted); font-weight: 400; }

.v6-conditions { padding: 8px 14px 6px; background: var(--surface-conditions); border-top: 1px solid var(--line); }
.v6-condition-groups { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 6px 14px; }
.v6-condition-group h3 { margin: 0; color: var(--muted); font-size: var(--body-size); font-weight: 600; }
.v6-condition-group.is-positive-group h3 { color: var(--green); }
.v6-condition-group.is-restriction-group h3,
.v6-condition-group.is-risk-group h3 { color: var(--red); }
.v6-conditions ul { display: grid; margin: 0; padding: 0; list-style: none; }
.v6-conditions li { display: grid; grid-template-columns: 18px minmax(0,1fr) auto 34px; gap: 6px; min-height: 34px; padding: 0; align-items: center; border-bottom: 1px solid var(--line); }
.v6-conditions li.has-no-effect { grid-template-columns: 18px minmax(0,1fr) 34px; }
.v6-conditions li:last-child { border-bottom: 0; }
.v6-condition-icon, .v6-condition-effect { font-weight: 600; }
.v6-condition-effect { text-align: right; white-space: nowrap; }
.v6-condition-toggle { display: grid; grid-column: -2 / -1; grid-row: 1; width: 34px; height: 34px; padding: 0; place-items: center; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.v6-condition-toggle::before { width: 7px; height: 7px; content: ""; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 140ms ease; }
.v6-condition-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
.v6-condition-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: -5px; border-radius: 8px; }
.v6-condition-detail { grid-column: 2 / -1; margin: 0 0 5px; padding: 6px 8px; color: var(--muted); background: var(--surface); border-radius: 7px; }
.v6-condition-detail[hidden] { display: none; }
.v6-condition-detail-line { margin: 0; }
.v6-condition-detail-line + .v6-condition-detail-line { margin-top: 4px; }
.v6-condition-detail-line strong { color: var(--ink); font-weight: 600; }
.is-positive { color: var(--green); }
.is-risk, .is-restriction { color: var(--red); }
.is-neutral { color: var(--muted); }
.v6-conditions li.is-risk-row > span:nth-child(2),
.v6-conditions li.is-restriction-row > span:nth-child(2) { color: var(--red); }

.v6-source { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 14px; min-height: 42px; padding: 10px 14px; align-items: center; color: var(--muted); background: var(--surface-soft); border-top: 1px solid var(--line); }
.v6-source a { min-width: 0; color: var(--blue); overflow-wrap: anywhere; }
.v6-source span { white-space: nowrap; }
.v6-source .v6-stale-note { color: var(--red); white-space: normal; overflow-wrap: anywhere; }
.v6-empty { padding: 24px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.v6-empty strong { display: block; margin-bottom: 4px; font-size: var(--sub-size); }

@media (max-width: 899px) {
  .v6-hero { grid-template-columns: 1fr; gap: 6px; }
  .v6-hero-copy { padding-top: 0; }
  .v6-layout { grid-template-columns: 1fr; grid-template-areas: "main"; }
  .v6-settings { position: fixed; inset: 0 0 0 auto; z-index: 50; grid-area: auto; width: 420px; max-width: calc(100% - 24px); height: 100dvh; max-height: none; border: 0; border-left: 1px solid var(--line); border-radius: 12px 0 0 12px; box-shadow: -12px 0 32px rgb(23 33 43 / 18%); }
  #v6-settings-close, #v6-method-close { display: block; }
  .v6-view-menu { flex-wrap: wrap; }
  .v6-view-tabs { flex: 1 1 100%; }
  .v6-panel-toggles { margin-left: 0; }
}

@media (max-width: 759px) {
  :root { --title-size: 26px; }
  .v6-shell { padding: 8px; }
  .v6-hero { gap: 3px; margin-bottom: 8px; }
  .v6-release-note { margin-bottom: 8px; padding: 5px 8px; font-size: 13px; line-height: 1.35; }
  .v6-legal-note { margin-top: 10px; padding: 9px 10px; }
  .v6-view-menu { display: grid; gap: 5px; margin-bottom: 8px; padding: 6px; }
  .v6-view-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
  .v6-view-tabs button { display: grid; min-height: 52px; padding: 4px 3px; place-items: center; align-content: center; gap: 1px; line-height: 1.15; }
  .v6-view-tabs svg, .v6-mobile-label { display: block; }
  .v6-view-tabs .v6-desktop-label { display: none; }
  .v6-panel-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-left: 0; padding-bottom: 0; }
  .v6-panel-toggles button { min-height: 44px; padding: 5px 8px; justify-content: center; }
  .v6-yield-curve { margin-top: 0; }
  .v6-yield-head { align-items: start; }
  .v6-layout { grid-template-areas: "settings" "main"; gap: 10px; }
  #v6-settings-panel { position: static; grid-area: settings; width: auto; max-width: none; height: auto; max-height: none; border: 1px solid var(--line); border-radius: 10px; box-shadow: none; }
  #v6-settings-panel .v6-drawer-head, #v6-settings-panel .v6-settings-foot { display: none; }
  #v6-settings-panel .v6-fields { gap: 8px; padding: 8px 10px; }
  #v6-settings-panel .v6-fields label { grid-template-columns: auto minmax(0,1fr); gap: 7px; align-items: center; }
  #v6-settings-panel .v6-fields select { min-height: 44px; }
  #v6-settings-panel .v6-filter summary { min-height: 48px; padding-block: 6px; }
  #v6-method-panel { width: 100%; max-width: 100%; border-left: 0; border-radius: 0; }
  .v6-yield-panels { grid-template-columns: 1fr; padding: 10px 12px; }
  .v6-yield-optima { gap: 10px; }
  .v6-yield-panels svg { height: 210px; }
  .v6-yield-summary-wrap { padding: 0 12px 10px; }
  .v6-scale-note { padding: 0 12px 10px; }
  .v6-yield-summary thead { display: none; }
  .v6-yield-summary, .v6-yield-summary tbody, .v6-yield-summary tr { display: block; }
  .v6-yield-summary tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .v6-yield-summary th, .v6-yield-summary td { display: grid; gap: 2px; padding: 0; text-align: left; white-space: normal; border: 0; }
  .v6-yield-summary th:first-child { grid-column: 1 / -1; font-weight: 600; }
  .v6-yield-summary td::before { content: attr(data-label); color: var(--muted); }
  .v6-yield-method { padding: 0 12px 12px; }
  .v6-leader-card { position: relative; display: block; }
  .v6-place { position: absolute; z-index: 2; top: 10px; right: 10px; width: 34px; height: 34px; padding: 0; place-items: center; border-radius: 7px; }
  .v6-checks { grid-template-columns: 1fr 1fr; column-gap: 6px; }
  .v6-setting-option { grid-column: auto; }
  .v6-checks label { gap: 7px; padding-inline: 4px; }
  .v6-availability-note { margin-inline: 10px; font-size: 13px; }
  .v6-setting-tooltip { position: relative; inset: auto; grid-column: 1 / -1; width: auto; margin: 0 6px 8px 34px; box-shadow: none; }
  .v6-card-head { grid-template-columns: 34px minmax(0,1fr); padding: 10px 54px 10px 12px; }
  .v6-bank-mark { width: 34px; height: 34px; }
  .v6-place-text { display: none; }
  .v6-metrics { grid-template-columns: 1fr 1fr; padding: 8px 12px; }
  .v6-metrics > div { padding: 9px 0; text-align: left; border-left: 0; border-bottom: 1px solid var(--line); }
  .v6-metrics > div:nth-child(even) { padding-left: 12px; text-align: right; border-left: 1px solid var(--line); }
  .v6-metrics > div:nth-child(n+3) { border-bottom: 0; }
  .v6-metrics .is-secondary { grid-column: 1; grid-row: 1; padding-left: 0; text-align: left; border-left: 0; }
  .v6-metrics .is-primary { grid-column: 2; grid-row: 1; padding-left: 12px; text-align: right; border-left: 1px solid var(--line); }
  .v6-conditions { padding: 9px 12px 7px; }
  .v6-condition-groups { grid-template-columns: 1fr; gap: 8px; }
  .v6-conditions li, .v6-conditions li.has-no-effect { grid-template-columns: 18px minmax(0,1fr) 44px; }
  .v6-conditions li { min-height: 44px; }
  .v6-condition-effect { grid-column: 2; text-align: left; }
  .v6-condition-toggle { grid-column: 3; width: 44px; height: 44px; }
  .v6-condition-detail { grid-column: 2 / -1; }
  .v6-source { grid-template-columns: minmax(0,1fr) auto; gap: 6px; padding: 9px 12px; font-size: 13px; }
  .v6-source span { white-space: nowrap; }
}

@media (max-width: 370px) {
  .v6-fields { gap: 6px; padding-inline: 10px; }
  .v6-source { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
