:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --panel: #fffdf8;
  --ink: #20231f;
  --muted: #6c7069;
  --rule: #d8d4c9;
  --blue: #315f78;
  --green: #27644b;
  --red: #9a493e;
  --soft-blue: #e9f0f3;
  --shadow: 0 10px 32px rgba(40, 44, 37, .055);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button { font: inherit; }
.site-header, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header { min-height: 126px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rule); }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: .7rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { font-size: clamp(2rem, 5vw, 3.15rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.025em; }
.as-of { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--green); }
main { padding: 28px 0 64px; }
.metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; margin-bottom: 18px; overflow: hidden; border: 1px solid var(--rule); border-radius: 10px; background: var(--rule); box-shadow: var(--shadow); }
.metrics article { min-width: 0; padding: 19px 18px; background: var(--panel); }
.metrics span, .metrics small { display: block; }
.metrics span { min-height: 34px; color: var(--muted); font-size: .72rem; font-weight: 700; line-height: 1.35; text-transform: uppercase; letter-spacing: .055em; }
.metrics strong { display: block; margin: 10px 0 5px; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.metrics small { color: var(--muted); font-size: .7rem; line-height: 1.35; }
.comparison { background: var(--soft-blue) !important; }
.difference.difference-positive { background: #edf1e8 !important; }
.difference.difference-negative { background: #f5e9e6 !important; }
.panel { min-width: 0; margin-top: 18px; padding: 26px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.portfolio-panel { padding: 0; }
.portfolio-panel > summary { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 24px 26px; cursor: pointer; list-style: none; }
.portfolio-panel > summary::-webkit-details-marker { display: none; }
.portfolio-summary-meta { display: grid; grid-template-columns: auto auto auto; gap: 14px; align-items: center; color: var(--muted); font-size: .76rem; }
.portfolio-summary-meta strong { color: var(--ink); font-family: Georgia, serif; font-size: 1.25rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.portfolio-chevron { font-size: 1rem; transition: transform .2s ease; }
.portfolio-panel[open] .portfolio-chevron { transform: rotate(180deg); }
.portfolio-body { padding: 0 26px 24px; }
.holdings-table td:nth-child(n+2), .holdings-table th:nth-child(n+2) { text-align: right; }
.holdings-table td:last-child strong { display: inline; }
.sort-button { display: inline-flex; gap: 5px; align-items: center; justify-content: inherit; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; font-weight: inherit; letter-spacing: inherit; text-align: inherit; text-transform: inherit; white-space: nowrap; }
.sort-button span { width: 9px; color: var(--blue); font-size: .55rem; }
.sort-button:hover, .sort-button:focus-visible, .sort-button.active { color: var(--blue); }
.section-heading { display: flex; gap: 18px; align-items: end; justify-content: space-between; margin-bottom: 24px; }
.legend, .run-meta { color: var(--muted); font-size: .76rem; }
.legend { display: flex; gap: 18px; }
.legend span::before { content: ""; display: inline-block; width: 18px; height: 2px; margin: 0 7px 3px 0; }
.yumurai-key::before { background: var(--green); }
.spy-key::before { background: var(--red); }
.chart-shell { position: relative; width: 100%; min-width: 0; height: 260px; overflow: hidden; contain: layout paint; border-top: 1px solid var(--rule); }
.performance-chart { position: relative; width: 100%; max-width: 100%; min-width: 0; height: 100%; overflow: hidden; }
.chart-grid-line { position: absolute; right: 14px; height: 1px; background: var(--rule); }
.chart-y-label, .chart-x-label { position: absolute; color: var(--muted); font-size: 10px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-y-label { left: 0; width: 44px; text-align: right; transform: translateY(-50%); }
.chart-x-label { bottom: 6px; transform: translateX(-50%); }
.chart-x-label.first { transform: none; }
.chart-x-label.last { transform: translateX(-100%); }
.chart-segment { position: absolute; height: 2px; border-radius: 999px; transform-origin: 0 50%; }
.chart-point { position: absolute; width: 9px; height: 9px; border: 2px solid; border-radius: 50%; background: var(--panel); transform: translate(-50%, -50%); }
.chart-segment.yumurai-series { background: var(--green); }
.chart-point.yumurai-series { border-color: var(--green); }
.chart-segment.spy-series { background: var(--red); }
.chart-point.spy-series { border-color: var(--red); }
.chart-tooltip { position: absolute; z-index: 2; min-width: 164px; padding: 9px 11px; border: 1px solid var(--rule); border-radius: 7px; background: rgba(255, 253, 248, .96); box-shadow: 0 7px 20px rgba(40, 44, 37, .12); color: var(--ink); font-size: .72rem; line-height: 1.5; pointer-events: none; transform: translate(-50%, calc(-100% - 12px)); }
.chart-tooltip strong, .chart-tooltip span { display: block; }
.chart-tooltip span { color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: .86rem; text-align: center; }
.chart-empty[hidden] { display: none; }
.sr-only { position: absolute !important; width: 1px !important; max-width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; table-layout: fixed; }
.notice { margin-bottom: 10px; padding: 12px 14px; border-left: 3px solid #a7873f; background: #f6f0df; color: #62573d; font-size: .82rem; line-height: 1.5; }
.pick { border-top: 1px solid var(--rule); }
.pick-not-approved { background: #f3f1ec; opacity: .82; }
.pick summary { display: grid; grid-template-columns: 48px minmax(200px, 1.3fr) 1fr 1fr 1fr auto; gap: 12px; align-items: center; padding: 18px 4px; cursor: pointer; list-style: none; }
.pick summary::-webkit-details-marker { display: none; }
.rank { color: var(--muted); font-family: Georgia, serif; font-size: 1.15rem; }
.company strong, .company span { display: block; }
.company strong { font-size: .95rem; }
.company span, .pick-label { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.data-cell .pick-label, .data-cell .pick-value { display: block; }
.pick-value { font-size: .88rem; font-variant-numeric: tabular-nums; }
.state { justify-self: end; padding: 6px 9px; border: 1px solid var(--rule); border-radius: 20px; color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.state-not-approved { border-color: #c6a9a4; background: #f5e9e6; color: var(--red); }
.chevron { color: var(--muted); transition: transform .2s ease; }
.pick[open] .chevron { transform: rotate(180deg); }
.pick-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 0 64px 22px; color: #4e524c; font-size: .84rem; line-height: 1.58; }
.pick-detail h3 { margin: 0 0 6px; color: var(--ink); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.pick-detail p { margin: 0; }
.history-wrap { overflow-x: auto; border-top: 1px solid var(--rule); }
.history-table { width: 100%; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
.history-table th { padding: 12px 10px; color: var(--muted); font-size: .66rem; letter-spacing: .055em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.history-table td { padding: 15px 10px; border-top: 1px solid #e7e3d9; white-space: nowrap; }
.history-table td strong { display: block; }
.history-table td small { color: var(--muted); }
.better { color: var(--green); }
.worse { color: #9a493e; }
.quiet-button, footer button { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: .78rem; }
.quiet-button:disabled { color: #a6a69f; cursor: default; }
.load-more-wrap { display: flex; justify-content: center; padding: 20px 0 4px; }
.load-more-button { padding: 10px 18px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--blue); cursor: pointer; font: inherit; font-size: .78rem; }
.load-more-button:hover { background: #f2efe7; }
.load-more-button[hidden] { display: none; }
footer { display: flex; justify-content: space-between; padding: 26px 0 36px; border-top: 1px solid var(--rule); color: var(--muted); font-size: .75rem; }
dialog { width: min(540px, calc(100% - 32px)); padding: 30px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(29,31,27,.42); }
dialog p:not(.eyebrow) { color: #50544e; line-height: 1.6; }
.dialog-close { float: right; border: 0; background: transparent; cursor: pointer; font-size: 1.6rem; color: var(--muted); }

@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .pick summary { grid-template-columns: 38px 1fr auto; }
  .pick summary > .data-cell { display: none; }
  .pick-detail { padding-left: 42px; grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 560px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 108px; align-items: flex-start; padding-top: 22px; }
  .as-of { margin-top: 9px; max-width: 112px; text-align: right; line-height: 1.4; }
  main { padding-top: 14px; }
  .metrics article { padding: 15px 13px; }
  .metrics strong { font-size: 1.5rem; }
  .panel { padding: 19px 15px; }
  .portfolio-panel { padding: 0; }
  .portfolio-panel > summary { padding: 19px 15px; }
  .portfolio-summary-meta { grid-template-columns: auto auto; gap: 6px 10px; text-align: right; }
  .portfolio-summary-meta > span:first-child { grid-column: 1 / -1; }
  .portfolio-body { padding: 0 15px 19px; }
  .section-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .legend { flex-direction: column; gap: 5px; }
  .chart-shell { height: 220px; }
  .pick summary { grid-template-columns: 28px 1fr auto; gap: 8px; padding: 15px 0; }
  .state { display: none; }
  .pick-detail { padding: 0 36px 20px; }
  .history-wrap { margin-inline: -15px; padding-inline: 5px; }
  footer { gap: 20px; align-items: flex-start; }
  footer p { margin: 0; }
}
