.detail-main { display: flex; width: min(1360px, calc(100% - 48px)); max-width: 100%; height: 100vh; padding-bottom: 10px; flex-direction: column; overflow: hidden; }
.detail-fixed-top { position: relative; max-width: 100%; flex: 0 0 auto; }
.detail-scroll { min-width: 0; min-height: 0; max-width: 100%; padding: 2px 2px 18px; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
.detail-top-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.detail-top-utilities { display: flex; align-items: center; gap: 10px; }
.detail-top-utilities .language-switcher a { height: 34px; }
.detail-view-switcher { margin-bottom: 0; }
#detail-tour-open-button { min-width: 86px; height: 36px; padding: 0 16px; }
.detail-hero { display: flex; min-width: 0; align-items: center; gap: 10px; min-height: 62px; padding: 8px 175px 8px 14px; color: #fffdf8; background: rgba(44,41,37,.95); border-radius: 14px; box-shadow: 0 8px 20px rgba(73,52,31,.12); }
.detail-hero h1 { color: #fffdf8; font-family: "Noto Sans JP", sans-serif; font-size: clamp(21px, 2.3vw, 28px); letter-spacing: .02em; }
.hero-title { display: flex; min-width: 0; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.award-history { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: #f4d7a2; font-size: 12px; font-weight: 700; line-height: 1.4; }
.award-history span { padding: 3px 7px; border: 1px solid rgba(244,215,162,.55); border-radius: 999px; background: rgba(255,255,255,.07); white-space: nowrap; }
.detail-hero .portrait, .detail-hero .team-logo { flex: 0 0 auto; width: 42px; height: 42px; transform: none; background: rgba(255,255,255,.9); }
.detail-hero .team-logo { object-fit: contain; border-radius: 10px; }
.detail-selector-details { position: absolute; z-index: 5; top: 63px; right: 14px; min-width: 140px; color: #40372f; }
.detail-selector-details summary { display: flex; height: 31px; align-items: center; justify-content: center; padding: 0 11px; color: #fffdf8; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35); border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 700; list-style: none; }
.detail-selector-details summary::-webkit-details-marker { display: none; }
.detail-selector-details summary::after { margin-left: 7px; content: "⌄"; font-size: 14px; }
.detail-selector-details[open] { min-width: 348px; padding: 8px; background: rgba(255,253,248,.98); border: 1px solid rgba(78,61,45,.2); border-radius: 10px; box-shadow: 0 10px 24px rgba(39,28,18,.2); }
.detail-selector-details[open] summary { justify-content: flex-start; height: 23px; padding: 0 4px; color: #665a4e; background: transparent; border: 0; }
.detail-selector-details[open] summary::after { content: "⌃"; }
.detail-selector { display: flex; align-items: end; gap: 10px; margin-top: 7px; padding: 0; background: transparent; border: 0; }
.detail-selector label { gap: 3px; color: #dccdbb; font-size: 11px; }
.detail-selector select { height: 32px; min-width: 120px; font-size: 13px; }
#detail-target { min-width: 200px; }
.detail-context { display: flex; justify-content: space-between; gap: 14px; margin: 5px 0; color: #554a40; font-size: 12px; font-weight: 700; }
#scope-label { color: #27231e; font-size: 14px; }
#detail-status { min-height: 0; margin: 0 0 4px; color: #8b3b33; font-size: 12px; font-weight: 600; }
#detail-status:empty { display: none; }
.summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.metric-grid { display: block; }
.metric-category { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(78,61,45,.16); }
.metric-category-title { grid-column: 1 / -1; margin: 0 0 2px; color: #4d4339; font-size: 14px; }
.metric-category:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.metric-category-balance-bottom { margin-top: 10px; padding-top: 0; border-top: 0; }
.summary-grid { margin-bottom: 22px; }
.metric-card { display: flex; min-width: 0; height: 116px; padding: 10px 12px; flex-direction: column; background: rgba(255,253,248,.88); border: 1px solid rgba(78,61,45,.16); border-radius: 10px; box-shadow: 0 5px 12px rgba(73,52,31,.05); }
.metric-card h3 { min-height: 26px; margin: 0 0 3px; color: #665a4e; font-size: 11px; font-weight: 700; line-height: 1.25; }
.metric-label { position: relative; cursor: default; }
.metric-label::after { position: absolute; z-index: 10; bottom: calc(100% + 7px); left: 0; width: max-content; max-width: 280px; padding: 8px 10px; color: #fffdf8; background: rgba(44,41,37,.97); border-radius: 6px; box-shadow: 0 6px 18px rgba(39,35,30,.22); content: attr(data-tooltip); font-size: 12px; font-weight: 500; line-height: 1.5; opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .12s ease, transform .12s ease; }
.metric-label:hover::after, .metric-label:focus-visible::after { opacity: 1; transform: translateY(0); }
.summary-grid .metric-label::after { top: calc(100% + 7px); bottom: auto; }
.metric-card .target-value { margin: 0 0 4px; color: #27231e; font-size: 22px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.metric-card .target-value.negative { color: #b42f26; }
.metric-card.metric-unavailable .target-value { color: #85796d; font-size: 16px; }
.metric-meta { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; margin-top: auto; padding-top: 5px; color: #75695d; border-top: 1px solid #e8dfd4; font-size: 11px; font-weight: 600; }
.metric-meta strong { color: #40372f; font-variant-numeric: tabular-nums; }
.metric-meta .rank-value { color: #40372f; }
.metric-meta .rank-value.rank-top { color: #2f7d4c; }
.metric-meta .rank-value.rank-bottom { color: #b42f26; }
.dashboard-section { padding-top: 4px; }
.section-heading { display: flex; align-items: end; gap: 12px; margin-bottom: 11px; }
.section-heading p { margin: 0 0 2px; color: #a83028; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.section-heading h2 { margin: 0; color: #27231e; font-size: 22px; }
.detail-metric-tools { position: sticky; z-index: 4; top: 0; display: grid; grid-template-columns: auto minmax(190px, 300px) minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; background: rgba(247,242,232,.96); border: 1px solid rgba(78,61,45,.14); border-radius: 10px; backdrop-filter: blur(7px); }
.detail-metric-tools label { color: #665a4e; font-size: 12px; }
.detail-metric-tools input { width: 100%; height: 36px; padding: 0 10px; color: #312c27; background: #fff; border: 1px solid #cfc4b8; border-radius: 7px; font: 600 13px "Noto Sans JP", sans-serif; }
.detail-category-nav { display: flex; min-width: 0; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
.detail-category-nav button { height: 30px; padding: 0 9px; flex: 0 0 auto; color: #5e5146; background: #fffdf8; border-color: #d8cabe; box-shadow: none; font-size: 11px; }
.detail-category-nav button:hover { color: #fff; background: #9e251e; transform: none; }
.detail-metric-empty { padding: 35px 12px; color: #75695d; font-weight: 700; text-align: center; }
.distribution-values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.distribution-values span { padding: 7px 3px; color: #51463b; background: #f4eee5; border-radius: 5px; font-size: 12px; font-weight: 700; text-align: center; }
.distribution-values b { display: block; margin-bottom: 2px; color: #9b8978; font-size: 10px; }
@media (max-width: 1120px) { .detail-hero { padding-right: 18px; } .detail-selector-details { position: static; margin-top: 5px; } .detail-selector-details summary { color: #51483e; background: rgba(255,255,255,.68); border-color: rgba(94,72,51,.22); } .detail-selector-details[open] { min-width: 0; } .detail-selector { align-items: start; flex-wrap: wrap; padding: 6px 12px; background: rgba(255,255,255,.68); border: 1px solid rgba(94,72,51,.16); } .detail-selector label { color: inherit; } .summary-grid, .metric-category { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 880px) { .summary-grid, .metric-category { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .detail-main { width: min(100% - 24px, 1360px); height: 100dvh; padding-bottom: 6px; } .detail-hero { min-height: 52px; padding: 6px 11px; border-radius: 11px; } .detail-hero .portrait, .detail-hero .team-logo { width: 36px; height: 36px; } .detail-hero h1 { font-size: 20px; } .hero-title { gap: 6px; } .award-history { display: none; } .detail-selector-details { margin-top: 4px; } .detail-selector-details summary { height: 29px; font-size: 11px; } .detail-selector-details[open] { padding: 6px; } .detail-selector { gap: 7px; margin-top: 4px; padding: 7px 8px; } .detail-selector label { width: 100%; font-size: 10px; } .detail-selector select, #detail-target { width: 100%; min-width: 0; height: 32px; font-size: 12px; } .detail-context { gap: 3px; margin: 4px 0; } #scope-label { font-size: 12px; } .detail-context, #detail-status { font-size: 11px; } .detail-scroll { padding: 1px 0 12px; } .summary-grid { gap: 6px; margin-bottom: 12px; } .metric-category { gap: 6px; margin-top: 10px; padding-top: 10px; } .metric-category-title { font-size: 12px; } .metric-card { height: 92px; padding: 8px; border-radius: 8px; } .metric-card h3 { min-height: 20px; font-size: 10px; } .metric-card .target-value { font-size: 19px; } .metric-meta { padding-top: 3px; font-size: 10px; } .section-heading { margin-bottom: 7px; } .section-heading h2 { font-size: 18px; } .detail-metric-tools { grid-template-columns: 1fr; gap: 5px; padding: 7px; } .detail-metric-tools label { display: none; } .detail-metric-tools input { height: 39px; font-size: 14px; } .detail-category-nav button { height: 32px; font-size: 11px; } .summary-grid, .metric-category { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* ツールチップは横に逃がさず、スマホ画面の下部に全幅で表示する。 */
  .metric-label::after, .summary-grid .metric-label::after { position: fixed; z-index: 100; top: auto; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); left: 12px; width: auto; max-width: none; max-height: min(34dvh, 220px); overflow-y: auto; padding: 10px 12px; font-size: 12px; line-height: 1.5; white-space: normal; transform: translateY(6px); }
}

.detail-scope-filters { display: grid; grid-template-columns: minmax(130px, 180px) minmax(170px, 220px) minmax(0, 1fr); align-items: end; gap: 8px; margin: 6px 0 4px; padding: 7px 10px; background: rgba(255,253,248,.82); border: 1px solid rgba(78,61,45,.14); border-radius: 10px; }
.detail-scope-filters > label { display: grid; gap: 3px; color: #665a4e; font-size: 10px; font-weight: 800; }
.detail-scope-filters select { width: 100%; height: 32px; padding: 0 28px 0 9px; color: #312c27; background: #fff; border: 1px solid #cfc4b8; border-radius: 7px; font: 700 12px "Noto Sans JP", sans-serif; }
.detail-scope-filters .detail-context { align-self: center; justify-content: flex-end; margin: 0; }
.detail-chart-grid { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(520px, 1.8fr); gap: 12px; margin: 2px 0 14px; }
.detail-insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.insight-wide { grid-column: 1 / -1; }
.detail-phase-two-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.phase-two-wide { grid-column: 1 / -1; }
.detail-breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.breakdown-wide { grid-column: 1 / -1; }
.performance-breakdown { display: grid; grid-template-columns: repeat(var(--breakdown-columns), minmax(92px, 1fr)); gap: 12px; margin: 12px 0 0; padding: 0 0 3px; overflow-x: auto; list-style: none; scrollbar-width: thin; }
.performance-breakdown li { display: grid; grid-template-rows: 20px 142px auto auto auto; align-items: center; justify-items: center; min-width: 92px; gap: 4px; }
.breakdown-total { font-size: 12px; font-variant-numeric: tabular-nums; }
.breakdown-total.negative, .round-balance-value.negative { color: #c7352d; }
.breakdown-total.positive, .round-balance-value.positive { color: #236fa9; }
.breakdown-score-track { position: relative; width: min(58px, 68%); height: 142px; overflow: hidden; background: linear-gradient(to bottom, #f4eee6 0 49.6%, #9f9488 49.6% 50.4%, #f4eee6 50.4% 100%); border-radius: 7px; }
.breakdown-score-track i { position: absolute; left: 7px; right: 7px; height: var(--bar-height); min-height: 0; }
.breakdown-score-track i.positive { bottom: 50%; background: #2f78b7; border-radius: 5px 5px 0 0; }
.breakdown-score-track i.negative { top: 50%; background: #c7352d; border-radius: 0 0 5px 5px; }
.breakdown-score-track i.neutral { top: calc(50% - 1px); height: 2px; background: #776f67; }
.breakdown-label { min-width: 0; text-align: center; }
.breakdown-label strong { display: block; color: #302a25; font-size: 13px; }
.breakdown-label small { color: #8a7b6b; font-size: 10px; }
.breakdown-average { color: #6f6256; font-size: 11px; white-space: nowrap; }
.breakdown-ranks { color: #5f544a; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-key { display: inline-flex; align-items: center; gap: 7px; color: #786b5e; font-size: 10px; font-weight: 700; }
.rank-key i { width: 7px; height: 7px; border-radius: 2px; }
.rank-key .rank-1 { background: #337fb9; }.rank-key .rank-2 { background: #42a36a; }.rank-key .rank-3 { background: #e3a91f; }.rank-key .rank-4 { background: #c7352d; }
.round-balance-bars { display: grid; grid-template-columns: repeat(8, minmax(82px, 1fr)); gap: 12px; margin: 14px 0 0; padding: 0 0 3px; overflow-x: auto; list-style: none; scrollbar-width: thin; }
.round-balance-bars li { display: grid; grid-template-rows: 20px 142px auto auto; align-items: center; justify-items: center; min-width: 82px; gap: 4px; }
.round-balance-bars li > strong { font-size: 12px; }
.round-balance-bars li > small { color: #8a7b6b; font-size: 9px; }
.round-balance-track { position: relative; width: 46px; height: 142px; overflow: hidden; background: linear-gradient(to bottom, #f4eee6 0 49.6%, #9f9488 49.6% 50.4%, #f4eee6 50.4% 100%); border-radius: 7px; }
.round-balance-track i { position: absolute; left: 6px; right: 6px; height: var(--bar-height); }
.round-balance-track i.positive { bottom: 50%; background: #2f78b7; border-radius: 5px 5px 0 0; }
.round-balance-track i.negative { top: 50%; background: #c7352d; border-radius: 0 0 5px 5px; }
.round-balance-track i.neutral { top: calc(50% - 1px); height: 2px; background: #776f67; }
.round-balance-value { font-size: 12px; font-variant-numeric: tabular-nums; }
.matchup-chart-card { grid-column: 1 / -1; }
.detail-chart-card { min-width: 0; padding: 14px; overflow: hidden; background: rgba(255,253,248,.92); border: 1px solid rgba(78,61,45,.16); border-radius: 13px; box-shadow: 0 5px 15px rgba(73,52,31,.07); }
.chart-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.chart-title p { margin: 0 0 2px; color: #a83028; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.chart-title h2 { margin: 0; color: #29241f; font-size: 17px; }
.chart-title > span { color: #796c60; font-size: 10px; font-weight: 700; }
.matchup-title-controls { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; color: #796c60; font-size: 10px; font-weight: 700; }
.matchup-filter { display: inline-flex; align-items: center; gap: 5px; color: #51463b; cursor: pointer; white-space: nowrap; }
.matchup-filter input { width: 14px; height: 14px; margin: 0; accent-color: #a83028; }
.rank-chart-body { display: grid; min-height: 250px; place-items: center; }
.rank-donut { position: relative; display: grid; width: min(245px, 100%); aspect-ratio: 1; place-items: center; justify-self: center; background: var(--rank-gradient); border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(50,39,30,.08); }
.rank-donut::before { width: 44%; aspect-ratio: 1; grid-area: 1 / 1; content: ""; background: #fffdf8; border-radius: 50%; box-shadow: 0 0 0 1px rgba(50,39,30,.07); }
.rank-donut-center { z-index: 1; display: grid; grid-area: 1 / 1; gap: 2px; place-items: center; color: #302a25; line-height: 1.2; }
.rank-donut-center strong { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.rank-donut-center span { margin: 0; color: #74685d; font-size: 10px; font-weight: 700; line-height: 1.2; }
.rank-donut-center b { margin-top: 4px; color: #4f453d; font-size: 11px; line-height: 1.25; }
.rank-segment-label { position: absolute; z-index: 2; top: var(--label-y); left: var(--label-x); display: grid; gap: 1px; min-width: 52px; margin: 0; color: #fff !important; line-height: 1.15; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.8), 0 0 1px rgba(0,0,0,.65); transform: translate(-50%, -50%); }
.rank-segment-label b, .rank-segment-label strong, .rank-segment-label small { color: inherit; font-variant-numeric: tabular-nums; line-height: 1.15; }
.rank-segment-label b { margin: 0; font-size: 11px; font-weight: 800; }
.rank-segment-label strong { font-size: 12px; font-weight: 900; }
.rank-segment-label small { font-size: 10px; font-weight: 800; }
.rank-segment-label.dark-label { color: #2d261f !important; text-shadow: 0 1px 0 rgba(255,255,255,.65); }
.rank-segment-label.is-zero { display: none; }
.chart-legend { display: flex; gap: 12px; color: #6f6257; font-size: 10px; font-weight: 800; }
.chart-legend span::before { display: inline-block; width: 18px; height: 3px; margin: 0 5px 3px 0; content: ""; background: currentColor; border-radius: 2px; }
.score-line-key { color: #b53128; }
.recent-chart-scroll { min-width: 0; overflow-x: auto; }
.recent-chart-canvas { width: 100%; min-width: 0; }
.recent-chart { display: block; width: 100%; height: auto; overflow: visible; font: 9px "Noto Sans JP", sans-serif; }
.chart-grid line { stroke: #e5ddd3; stroke-width: 1; }
.chart-grid text { fill: #8a7c6e; }
.zero-line { stroke: #bcb0a5; stroke-width: 1.5; stroke-dasharray: 4 4; }
.score-line { fill: none; stroke: #4f4943; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.score-dot { stroke: #fffdf8; stroke-width: 2; filter: drop-shadow(0 1px 1px rgba(0,0,0,.22)); }
.score-dot.rank-dot-1 { fill: #2f78b7; }
.score-dot.rank-dot-2 { fill: #3f9b63; }
.score-dot.rank-dot-3 { fill: #e2aa21; }
.score-dot.rank-dot-4 { fill: #c7352d; }
.rank-color-key { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 9px; color: #6f6257; font-size: 9px; font-weight: 800; }
.rank-color-key span::before { display: inline-block; width: 8px; height: 8px; margin: 0 4px 1px 0; content: ""; background: currentColor; border-radius: 50%; }
.rank-color-key .rank-1 { color: #2f78b7; }
.rank-color-key .rank-2 { color: #3f9b63; }
.rank-color-key .rank-3 { color: #e2aa21; }
.rank-color-key .rank-4 { color: #c7352d; }
.recent-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: -2px 0 8px; }
.recent-summary > div { min-width: 0; padding: 6px 8px; background: #f7f2eb; border: 1px solid rgba(78,61,45,.08); border-radius: 7px; text-align: center; }
.recent-summary dt { margin: 0 0 2px; color: #796c60; font-size: 9px; font-weight: 800; line-height: 1.2; }
.recent-summary dd { margin: 0; color: #302a25; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.recent-summary dd.positive { color: #326f50; }
.recent-summary dd.negative { color: #b53128; }
.recent-rank-counts { display: flex; align-items: center; justify-content: center; gap: 4px; }
.recent-rank-counts span { display: inline-flex; align-items: center; gap: 4px; }
.recent-rank-counts span + span::before { color: #a2968a; content: "-"; }
.recent-rank-counts span:nth-child(1) { color: #2f78b7; }
.recent-rank-counts span:nth-child(2) { color: #3f9b63; }
.recent-rank-counts span:nth-child(3) { color: #c99112; }
.recent-rank-counts span:nth-child(4) { color: #c7352d; }
.recent-season-key { display: flex; align-items: center; justify-content: flex-end; gap: 5px 10px; min-height: 16px; margin: -4px 0 5px; color: #8a7d70; font-size: 8px; font-weight: 700; }
.recent-season-key b { display: inline-flex; align-items: center; gap: 4px; color: #5f554c; font-size: 8px; white-space: nowrap; }
.recent-season-key i { width: 13px; height: 5px; background: var(--season-color); border-radius: 999px; }
.recent-match-strip { display: grid; grid-template-columns: repeat(var(--match-count), minmax(0, 1fr)); gap: 0; margin: 0; padding: 0 var(--plot-right) 5px var(--plot-left); list-style: none; }
.recent-match-strip li { display: grid; min-width: 0; gap: 1px; margin: 0 2px; padding: 5px 1px; overflow: hidden; background: var(--season-background, #f7f2eb); border-top: 3px solid var(--season-color, #8a8178); border-radius: 6px; text-align: center; }
.recent-match-strip small { color: var(--season-color, #8a7d70); font-size: clamp(6px, .52vw, 8px); font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.recent-match-strip b, .recent-match-strip strong { font-size: clamp(8px, .67vw, 10px); }
.recent-match-strip b { color: #40372f; font-size: 10px; }
.recent-match-strip strong { font-size: 10px; font-variant-numeric: tabular-nums; }
.recent-match-meta { display: block; color: #6f6257; font-size: clamp(6px, .52vw, 8px); font-weight: 800; line-height: 1.05; white-space: nowrap; }
.recent-match-strip .positive { color: #326f50; }
.recent-match-strip .negative { color: #b53128; }
.chart-empty { display: grid; min-height: 205px; margin: 0; place-items: center; color: #817568; font-size: 12px; font-weight: 700; }
.matchup-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.matchup-columns h3 { margin: 0 0 8px; color: #51463b; font-size: 12px; }
.matchup-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.matchup-list li { min-width: 0; }
.matchup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(62px, auto); align-items: baseline; gap: 8px; margin-bottom: 3px; font-size: 11px; }
.matchup-row strong { overflow: hidden; color: #332d27; text-overflow: ellipsis; white-space: nowrap; }
.matchup-row span { color: #887a6d; font-size: 10px; font-weight: 700; }
.matchup-row b { color: #5e5146; font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.matchup-track { display: block; height: 7px; overflow: hidden; background: #eee7de; border-radius: 999px; }
.matchup-track i { display: block; height: 100%; border-radius: inherit; }
.matchup-list.favorable .matchup-track i { background: #2f78b7; }
.matchup-list.favorable .matchup-row b { color: #2f78b7; }
.matchup-list.unfavorable .matchup-track i { background: #c7352d; }
.matchup-list.unfavorable .matchup-row b { color: #c7352d; }
.insight-empty { display: grid; min-height: 70px; margin: 0; place-items: center; color: #8a7d70; background: #f7f2eb; border-radius: 8px; font-size: 11px; font-weight: 700; text-align: center; }
.composition-body { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(180px, 1.2fr); align-items: center; gap: 18px; min-height: 190px; }
.composition-donut { position: relative; display: grid; width: min(170px, 100%); aspect-ratio: 1; place-items: center; justify-self: center; background: var(--composition-gradient); border-radius: 50%; }
.composition-donut::before { width: 52%; aspect-ratio: 1; grid-area: 1 / 1; content: ""; background: #fffdf8; border-radius: 50%; }
.composition-donut > div { z-index: 1; display: grid; grid-area: 1 / 1; gap: 2px; place-items: center; line-height: 1.2; }
.composition-donut > div strong { color: #302a25; font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.composition-donut > div span { margin: 0; color: #74685d; font-size: 10px; font-weight: 700; line-height: 1.2; }
.composition-donut .composition-segment-label { position: absolute; z-index: 2; display: grid; left: var(--label-x); top: var(--label-y); gap: 1px; margin: 0; color: #fff; line-height: 1.15; place-items: center; text-shadow: 0 1px 2px rgba(0,0,0,.82), 0 0 1px rgba(0,0,0,.7); transform: translate(-50%, -50%); white-space: nowrap; }
.composition-donut .composition-segment-label b { color: inherit; font-size: 10px; font-weight: 800; line-height: 1.15; }
.composition-donut .composition-segment-label strong { color: inherit; font-size: 10px; font-weight: 900; line-height: 1.15; }
.composition-donut .composition-segment-label small { color: inherit; font-size: 9px; font-weight: 800; line-height: 1.15; }
.composition-donut .composition-segment-label.dark-label { color: #2d261f; text-shadow: 0 1px 0 rgba(255,255,255,.65); }
.composition-legend { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.composition-legend li { position: relative; display: grid; grid-template-columns: minmax(55px, 1fr) auto; align-items: center; gap: 9px; padding: 9px 8px; background: #f7f2eb; border-radius: 7px; font-size: 11px; }
.composition-legend li::before { position: absolute; left: 8px; display: inline-block; width: 8px; height: 8px; content: ""; background: var(--item-color); border-radius: 50%; }
.composition-legend span { padding-left: 13px; }
.composition-legend small { color: #75695d; font-size: 9px; font-variant-numeric: tabular-nums; text-align: right; }
.value-distribution { display: grid; gap: 10px; margin: 12px 0 2px; padding: 0; list-style: none; }
.value-distribution li { display: grid; grid-template-columns: minmax(95px, 125px) minmax(80px, 1fr) 42px 48px 68px; align-items: center; gap: 8px; min-height: 25px; font-size: 11px; }
.value-distribution > li > span { color: #51463b; font-weight: 700; }
.value-bar { position: relative; height: 11px; background: #eee7de; border-radius: 999px; }
.value-bar i { display: block; height: 100%; background: #a83028; border-radius: inherit; }
.value-bar em { position: absolute; top: -4px; bottom: -4px; left: clamp(0%, var(--average-position), 100%); width: 3px; background: #2378b8; border: 1px solid #fffdf8; border-radius: 2px; box-shadow: 0 0 0 1px rgba(35,120,184,.28); transform: translateX(-2px); }
.value-distribution b, .value-distribution strong { font-variant-numeric: tabular-nums; text-align: right; }
.value-distribution b { color: #3d352e; }
.value-distribution strong { color: #75695d; }
.value-distribution small { color: #928578; font-size: 9px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.average-key { display: inline-block; width: 3px; height: 11px; margin-right: 5px; vertical-align: -2px; background: #2378b8; border: 1px solid #fffdf8; border-radius: 2px; box-shadow: 0 0 0 1px rgba(35,120,184,.28); }
.wait-shape-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.wait-shape-summary > div { display: grid; padding: 8px; place-items: center; background: #f7f2eb; border-radius: 8px; }
.wait-shape-summary strong { color: #302a25; font-size: 21px; font-variant-numeric: tabular-nums; }
.wait-shape-summary span { color: #796c60; font-size: 9px; font-weight: 700; }
.wait-shape-summary small { color: #2f78b7; font-size: 8px; font-weight: 700; }
.quality-stack { display: flex; height: 18px; overflow: hidden; background: #eee7de; border-radius: 999px; }
.quality-stack i { display: block; min-width: 0; height: 100%; }
.quality-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 7px 0 14px; padding: 0; list-style: none; }
.quality-legend li { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 4px; min-width: 0; color: #51463b; font-size: 10px; }
.quality-legend li > i { width: 7px; height: 7px; border-radius: 50%; }
.quality-legend b { font-variant-numeric: tabular-nums; }
.quality-legend small { grid-column: 2 / -1; color: #8a7d70; font-size: 9px; }
.subchart-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 7px; color: #51463b; font-size: 11px; }
.subchart-title small { color: #8a7d70; font-size: 8px; font-weight: 600; }
.shape-bars { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.shape-bars li { display: grid; grid-template-columns: 58px minmax(0, 1fr) 76px; align-items: center; gap: 7px; color: #51463b; font-size: 10px; font-weight: 700; }
.shape-bars li > i { position: relative; height: 8px; background: #eee7de; border-radius: 999px; }
.shape-bars li > i > b { display: block; height: 100%; border-radius: inherit; }
.shape-bars li > i > em { position: absolute; top: -4px; bottom: -4px; left: clamp(0%, var(--average-position), 100%); width: 3px; background: #292724; border: 1px solid #fffdf8; border-radius: 2px; box-shadow: 0 0 0 1px rgba(41,39,36,.35); transform: translateX(-2px); }
.shape-average-key { background: #292724; box-shadow: 0 0 0 1px rgba(41,39,36,.35); }
.shape-bars strong { display: grid; font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.shape-bars strong small { color: #2f78b7; font-size: 8px; font-weight: 700; white-space: nowrap; }
.turn-heat-scroll { overflow-x: auto; padding-bottom: 3px; }
.turn-heatmap { min-width: 760px; }
.turn-heat-header, .turn-heat-row { display: grid; grid-template-columns: 58px repeat(18, minmax(24px, 1fr)) 44px; align-items: center; gap: 3px; }
.turn-heat-header { margin-bottom: 4px; color: #8a7d70; font-size: 8px; text-align: center; }
.turn-heat-header span { text-align: left; }
.turn-heat-row { margin-bottom: 4px; }
.turn-heat-row > strong { color: #51463b; font-size: 10px; }
.turn-heat-row > i { display: grid; height: 27px; place-items: center; border: 1px solid rgba(78,61,45,.08); border-radius: 4px; font-style: normal; }
.turn-heat-row > i span { color: #2e2924; font-size: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.turn-heat-row > b { color: #51463b; font-size: 9px; font-variant-numeric: tabular-nums; text-align: right; }
.context-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.context-sections section { padding: 9px; background: #f7f2eb; border-radius: 9px; }
.context-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; margin-bottom: 7px; }
.context-heading h3 { margin: 0; color: #40372f; font-size: 12px; }
.context-heading small { color: #8a7d70; font-size: 8px; }
.context-column-head, .context-row { display: grid; grid-template-columns: 1fr minmax(65px, auto) 1fr; align-items: center; gap: 5px; text-align: center; }
.context-column-head { margin-bottom: 3px; color: #a83028; font-size: 10px; }
.context-row { padding: 6px 0; border-top: 1px solid #e2d8cc; }
.context-row span { color: #75695d; font-size: 9px; font-weight: 700; }
.context-row strong { color: #302a25; font-size: 12px; font-variant-numeric: tabular-nums; }
.context-row strong { display: grid; }
.context-row strong small { color: #2f78b7; font-size: 8px; font-weight: 700; white-space: nowrap; }
.context-row strong.negative,
.context-row strong small.negative { color: #c7352d; }
.contribution-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; margin: 0; padding: 0; list-style: none; }
.contribution-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.contribution-row strong { overflow: hidden; color: #332d27; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.contribution-row span, .contribution-list small { color: #887a6d; font-size: 9px; }
.contribution-row b { min-width: 62px; font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.contribution-row b.positive { color: #2f78b7; }
.contribution-row b.negative { color: #c7352d; }
.contribution-track { height: 7px; margin-bottom: 3px; overflow: hidden; background: #eee7de; border-radius: 999px; }
.contribution-track i { display: block; height: 100%; border-radius: inherit; }
.contribution-track i.positive { background: #2f78b7; }
.contribution-track i.negative { background: #c7352d; }
.contribution-list small { display: block; font-variant-numeric: tabular-nums; }
.yaku-profile-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.yaku-table-scroll { max-height: 620px; overflow: auto; border: 1px solid #e5ddd3; border-radius: 9px; scrollbar-width: thin; }
.yaku-profile-table { width: 100%; border-collapse: collapse; color: #3a332d; font-size: 12px; font-variant-numeric: tabular-nums; }
.yaku-profile-table th, .yaku-profile-table td { padding: 9px 12px; border-bottom: 1px solid #e8e0d7; text-align: right; vertical-align: middle; }
.yaku-profile-table thead th { position: sticky; z-index: 1; top: 0; color: #665a4e; background: #f4eee6; font-size: 10px; letter-spacing: .04em; }
.yaku-profile-table th:first-child { text-align: left; }
.yaku-profile-table tbody tr:last-child > * { border-bottom: 0; }
.yaku-profile-table tbody tr:nth-child(even) { background: rgba(244,238,230,.38); }
.yaku-profile-table tbody th { color: #29241f; background: transparent !important; box-shadow: none !important; font-size: 12px; }
.yaku-profile-table td > span { display: inline-flex; align-items: baseline; }
.yaku-profile-table .yaku-main-value { display: inline-grid; grid-template-columns: minmax(38px, auto) 55px; justify-content: end; align-items: baseline; column-gap: 14px; width: 100%; white-space: nowrap; }
.yaku-profile-table .yaku-main-value.is-league-average { grid-template-columns: minmax(46px, auto) 55px; }
.yaku-profile-table .yaku-count, .yaku-profile-table .yaku-rate { text-align: right; }
.yaku-profile-table td b { color: #9f2f28; font-size: 13px; }
.yaku-profile-table td > small { display: block; margin-top: 3px; color: #817468; font-size: 9px; white-space: nowrap; }
.yaku-profile-table td > small .yaku-main-value { display: inline-grid; width: auto; margin-left: 3px; grid-template-columns: minmax(32px, auto) 49px; column-gap: 9px; }
.yaku-profile-table td > small .yaku-main-value.is-league-average { grid-template-columns: minmax(40px, auto) 49px; }
.yaku-profile-table td > small .yaku-rate { color: inherit; font-size: inherit; }
.yaku-profile-table td:last-child strong { color: #29241f; font-size: 14px; }
.yaku-profile-table td:last-child small { display: inline; margin-left: 3px; }

@media (max-width: 980px) {
  .detail-chart-grid { grid-template-columns: 1fr; }
  .detail-insight-grid { grid-template-columns: 1fr; }
  .detail-phase-two-grid { grid-template-columns: 1fr; }
  .phase-two-wide { grid-column: auto; }
  .detail-breakdown-grid { grid-template-columns: 1fr; }
  .breakdown-wide { grid-column: auto; }
  .round-balance-bars { grid-template-columns: repeat(8, minmax(78px, 1fr)); }
  .matchup-chart-card { grid-column: auto; }
  .detail-chart-card { padding: 12px; }
  .rank-chart-body { min-height: 240px; }
}
@media (max-width: 700px) {
  .detail-top-actions { margin: 0 0 5px; padding: 0 1px; }
  .detail-view-switcher { margin: 0; }
  .detail-view-switcher a { min-width: 64px; padding: 0 8px; }
  .detail-top-utilities { gap: 6px; }
  .detail-top-utilities .language-switcher { margin: 0; }
  .detail-top-utilities .language-switcher a { min-width: 48px; height: 34px; padding: 0 6px; font-size: 11px; }
  .detail-view-switcher { margin: 0; }
  #detail-tour-open-button { min-width: 76px; height: 36px; padding: 0 13px; }
  .detail-scope-filters { grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; padding: 6px; }
  .detail-scope-filters .detail-context { grid-column: 1 / -1; justify-content: space-between; }
  .detail-scope-filters select { height: 34px; font-size: 11px; }
  .detail-chart-grid { gap: 8px; margin-bottom: 10px; }
  .detail-insight-grid { gap: 8px; margin-bottom: 10px; }
  .detail-phase-two-grid { gap: 8px; margin-bottom: 10px; }
  .detail-breakdown-grid { gap: 8px; margin-bottom: 10px; }
  .performance-breakdown { grid-template-columns: repeat(var(--breakdown-columns), minmax(64px, 1fr)); gap: 2px; }
  .performance-breakdown li { grid-template-rows: 18px 120px auto auto auto; min-width: 64px; gap: 2px; }
  .performance-breakdown.breakdown-seat { grid-template-columns: repeat(var(--breakdown-columns), minmax(0, 1fr)); overflow-x: hidden; }
  .performance-breakdown.breakdown-seat li { min-width: 0; }
  .breakdown-score-track { width: 42px; height: 120px; }
  .breakdown-label strong { font-size: 11px; }
  .breakdown-average { font-size: 9px; }
  .breakdown-ranks { font-size: 8px; }
  .round-balance-bars { grid-template-columns: repeat(var(--round-columns), minmax(58px, 1fr)); gap: 2px; }
  .round-balance-bars li { grid-template-rows: 18px 120px auto auto; min-width: 58px; gap: 2px; }
  .round-balance-track { width: 38px; height: 120px; }
  .detail-chart-card { padding: 10px; border-radius: 10px; }
  .chart-title { margin-bottom: 8px; }
  .chart-title h2 { font-size: 15px; }
  .matchup-title-controls { align-items: flex-start; justify-content: flex-start; }
  .rank-chart-body { min-height: 220px; }
  .rank-donut { width: min(220px, 78vw); }
  .rank-donut-center strong { font-size: 24px; }
  .rank-segment-label b { font-size: 10px; }
  .rank-segment-label strong { font-size: 11px; }
  .rank-segment-label small { font-size: 9px; }
  .recent-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; }
  .recent-summary > div { padding: 5px 4px; }
  .recent-summary dt { font-size: 8px; }
  .recent-summary dd { font-size: 11px; }
  .recent-chart-canvas { width: max(220px, calc(66px + var(--match-count) * 40px)); min-width: max(220px, calc(66px + var(--match-count) * 40px)); margin-inline: auto; }
  .recent-match-strip b, .recent-match-strip strong { font-size: 9px; }
  .recent-match-meta { display: block; color: #6f6257; font-size: 7px; font-weight: 800; line-height: 1.05; white-space: nowrap; }
  .recent-season-key { justify-content: flex-start; overflow-x: auto; }
  .matchup-columns { grid-template-columns: 1fr; gap: 16px; }
  .composition-body { grid-template-columns: 150px minmax(0, 1fr); gap: 8px; min-height: 170px; }
  .composition-donut { width: 150px; }
  .composition-donut > div strong { font-size: 21px; }
  .composition-donut .composition-segment-label b { font-size: 8.5px; }
  .composition-donut .composition-segment-label strong { font-size: 8.5px; }
  .composition-donut .composition-segment-label small { font-size: 8px; }
  .composition-legend li { gap: 5px; padding: 6px; }
  .composition-legend li::before { left: 6px; }
  .value-distribution li { grid-template-columns: 88px minmax(45px, 1fr) 34px 42px; gap: 4px; font-size: 10px; }
  .value-distribution small { grid-column: 2 / -1; font-size: 8px; }
  .context-sections { grid-template-columns: 1fr; }
  .contribution-list { grid-template-columns: 1fr; gap: 10px; }
  .yaku-profile-columns { grid-template-columns: 1fr; gap: 0; }
  .yaku-table-scroll { max-height: none; overflow: visible; border: 0; border-radius: 0; }
  .yaku-profile-table, .yaku-profile-table tbody { display: block; }
  .yaku-profile-table thead { display: none; }
  .yaku-profile-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 9px 0; border-bottom: 1px solid #e8e0d7; }
  .yaku-profile-table th, .yaku-profile-table td { display: grid; align-content: start; gap: 2px; padding: 0 7px; border: 0; text-align: left; }
  .yaku-profile-table tbody th { grid-column: 1 / -1; margin-bottom: 7px; padding: 0 7px; font-size: 13px; }
  .yaku-profile-table td::before { content: attr(data-label); color: #897b6e; font-size: 8px; font-weight: 800; }
  .yaku-profile-table td > span { font-size: 10px; }
  .yaku-profile-table .yaku-main-value { display: grid; grid-template-columns: minmax(30px, auto) 50px; column-gap: 9px; width: 100%; }
  .yaku-profile-table .yaku-main-value.is-league-average { grid-template-columns: minmax(36px, auto) 50px; }
  .yaku-profile-table td b { font-size: 12px; }
  .yaku-profile-table td > small { min-height: 22px; font-size: 8px; line-height: 1.35; }
  .yaku-profile-table td:last-child strong { font-size: 12px; }
  .yaku-profile-table td:last-child small { display: block; margin-left: 0; }
}

/* Desktop readability: raise compact labels without changing the mobile layout. */
@media (min-width: 701px) {
  .detail-selector label,
  .metric-card h3,
  .metric-meta,
  .section-heading p,
  .detail-category-nav button,
  .breakdown-average,
  .rank-donut-center b,
  .rank-segment-label b,
  .matchup-row,
  .insight-empty,
  .composition-legend li,
  .value-distribution li,
  .subchart-title,
  .contribution-row strong,
  .contribution-row b { font-size: 12px; }

  .distribution-values b,
  .detail-scope-filters > label,
  .breakdown-label small,
  .breakdown-ranks,
  .rank-key,
  .chart-title > span,
  .matchup-title-controls,
  .rank-donut-center span,
  .rank-segment-label small,
  .chart-legend,
  .recent-match-strip b,
  .recent-match-strip strong,
  .matchup-row span,
  .composition-donut > div span,
  .composition-donut .composition-segment-label b,
  .composition-donut .composition-segment-label strong,
  .quality-legend li,
  .shape-bars li,
  .shape-bars strong,
  .turn-heat-row > strong,
  .context-column-head,
  .yaku-profile-table thead th { font-size: 11px; }

  .round-balance-bars li > small,
  .chart-title p,
  .rank-color-key,
  .composition-donut .composition-segment-label small,
  .composition-legend small,
  .value-distribution small,
  .wait-shape-summary span,
  .quality-legend small,
  .context-row span,
  .contribution-row span,
  .contribution-list small,
  .turn-heat-row > b,
  .yaku-profile-table td > small { font-size: 10px; }

  .recent-season-key,
  .recent-season-key b,
  .wait-shape-summary small,
  .subchart-title small,
  .shape-bars strong small,
  .turn-heat-header,
  .turn-heat-row > i span,
  .context-heading small,
  .context-row strong small { font-size: 9px; }

  .recent-match-strip small { font-size: clamp(7px, .58vw, 9px); }
}
