/* Same operating palette. Compare visually, verify ranks, then inspect one store. */
.store-ranking-surface{--ranking-label-width:152px;--ranking-value-width:108px;--ranking-chart-height:clamp(176px,calc(100dvh - 610px),360px)}
.store-ranking-surface .page-head{margin-bottom:8px}
.store-ranking-surface .ranking-metric-filter{margin:8px 0 12px;max-width:480px;font-size:13px}
.store-ranking-dashboard{display:grid;gap:16px;min-width:0}
.ranking-top-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(320px,1fr);gap:16px;align-items:stretch}
.ranking-chart-panel,.ranking-detail-panel,.ranking-comparison-panel{background:var(--surface);border:1px solid var(--line);border-radius:12px;min-width:0}
.ranking-chart-panel>header,.ranking-detail-panel>header,.ranking-comparison-panel>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px}
.ranking-chart-panel h2,.ranking-detail-panel h2,.ranking-comparison-panel h2{font-size:16px;line-height:1.5}
.ranking-chart-panel header p,.ranking-comparison-panel header p{font-size:12px;color:var(--muted);margin-top:2px}
.ranking-detail-panel>header{border-bottom:1px solid var(--line)}
.ranking-detail-panel>header>span{font-size:12px;color:var(--muted);white-space:nowrap}
.ranking-median-legend{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--muted);white-space:nowrap}
.ranking-median-legend>b{font-size:13px;color:var(--text);font-variant-numeric:tabular-nums}
.ranking-median-legend>i{display:inline-block;width:20px;border-top:2px dashed var(--warn)}
.ranking-chart-axis,.ranking-bar-row{display:grid;grid-template-columns:var(--ranking-label-width) minmax(0,1fr) var(--ranking-value-width);gap:12px;align-items:center}
.ranking-chart-axis{padding:0 16px 6px;font-size:12px;color:var(--muted)}
.ranking-chart-axis>div{display:flex;justify-content:space-between;gap:8px;font-variant-numeric:tabular-nums}
.ranking-chart-axis>span:last-child{text-align:right}
.ranking-chart-scroll{max-height:var(--ranking-chart-height);min-height:min(272px,var(--ranking-chart-height));overflow:auto;overscroll-behavior:contain;padding:0 16px;scrollbar-gutter:stable}
.ranking-bar-row{width:100%;min-height:32px;padding:4px 0;border:0;border-radius:5px;text-align:left;background:transparent;line-height:24px;color:var(--text);font-size:13px}
.ranking-bar-row:hover,.ranking-bar-row.is-selected{background:var(--yellow-soft)}
.ranking-bar-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.ranking-bar-name{display:flex;align-items:center;gap:8px;min-width:0}
.ranking-bar-name>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ranking-bar-row>strong{text-align:right;font-size:12px;font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}
.ranking-place{display:inline-flex;justify-content:center;align-items:center;flex:none;min-width:24px;height:24px;border-radius:5px;color:var(--muted);font:500 12px/1 var(--font-number)}
.ranking-place.is-top{font-weight:700;color:var(--text)}
.ranking-place.rank-1{background:var(--yellow)}
.ranking-place.rank-2{background:var(--line)}
.ranking-place.rank-3{background:var(--warn-soft)}
.ranking-bar-row.is-top{font-weight:700}
.ranking-bar-row.is-top>strong{font-weight:700}
.ranking-bar-track{display:block;position:relative;height:24px;min-width:0}
.ranking-bar-fill{position:absolute;top:5px;height:14px;background:var(--muted);border-radius:0;min-width:0}
.rank-1 .ranking-bar-fill{background:var(--yellow)}
.rank-2 .ranking-bar-fill{background:var(--accent)}
.rank-3 .ranking-bar-fill{background:var(--warn)}
.ranking-zero-mark{position:absolute;top:10px;width:4px;height:4px;border-radius:50%;background:var(--muted)}
.ranking-median-line{position:absolute;top:-4px;bottom:-4px;width:0;border-left:1px dashed var(--warn);pointer-events:none;z-index:1}
.ranking-chart-caption{font-size:12px;color:var(--muted);padding:8px 16px 12px;line-height:1.6}
.ranking-tooltip{position:fixed;z-index:80;min-width:208px;max-width:256px;padding:12px 16px;display:flex;flex-direction:column;gap:4px;background:var(--accent);color:var(--surface);border-radius:8px;pointer-events:none;font-size:12px;line-height:1.5}
.ranking-tooltip>b{font-size:13px}.ranking-tooltip>strong{font-size:20px;font-variant-numeric:tabular-nums}.ranking-tooltip>span{color:var(--surface-soft)}
.ranking-detail-scroll{overflow:auto;max-height:calc(var(--ranking-chart-height) + 68px);scrollbar-gutter:stable}
.ranking-detail-table{width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed}
.ranking-detail-table th,.ranking-detail-table td{padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:top;font-weight:400}
.ranking-detail-table thead th{position:sticky;top:0;background:var(--surface-soft);z-index:2;color:var(--muted);font-size:12px;text-align:left}
.ranking-detail-table th:first-child{width:46px}.ranking-detail-table thead th:last-child{width:40%;text-align:right}
.ranking-detail-table tbody th{min-width:0;text-align:left}
.ranking-detail-table tbody td:last-child{text-align:right;font-variant-numeric:tabular-nums}
.ranking-detail-table td>strong{display:block;white-space:nowrap;font-size:13px}
.ranking-detail-table td>small{display:block;font-size:12px;line-height:1.6;color:var(--muted);margin-top:3px}
.ranking-detail-table tr.is-top .ranking-store-pick,.ranking-detail-table tr.is-top td>strong{font-weight:700}
.ranking-detail-table tr.is-selected{background:var(--yellow-soft)}
.ranking-detail-table tr:hover{background:var(--surface-soft)}
.ranking-detail-table .ranking-store-pick{padding:0;min-height:24px;font-size:13px;line-height:1.5;text-align:left;white-space:normal;overflow-wrap:break-word;justify-content:flex-start}
.ranking-detail-table details{padding:0;margin-top:2px}
.ranking-detail-table summary{font-size:12px;color:var(--muted);font-weight:400;min-height:24px;padding:0;line-height:24px}
.ranking-detail-table details dl{padding:4px 0;font-size:12px;line-height:1.8}
.ranking-detail-table details dl div{display:flex;gap:4px;flex-wrap:wrap;justify-content:space-between}
.ranking-detail-table details dt{color:var(--muted)}.ranking-detail-table details dd{margin:0;font-variant-numeric:tabular-nums}
.ranking-detail-table details .btn{font-size:12px;padding:2px 0;min-height:28px}
.ranking-record-reason dd{color:var(--warn)}
.ranking-comparison-panel>header{padding-bottom:12px;border-bottom:1px solid var(--line)}
.ranking-comparison-panel>header label{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;white-space:nowrap}
.ranking-comparison-panel select{min-height:32px;padding:4px 8px;min-width:160px;width:auto;font-size:13px;color:var(--text)}
.ranking-comparison-content{display:grid;grid-template-columns:1fr 1.15fr 1.2fr;gap:24px;padding:16px}
.ranking-comparison-content>div{min-width:0}
.ranking-comparison-content h3{font-size:13px;font-weight:600;line-height:1.5;margin-bottom:10px}
.ranking-distribution{height:12px;display:flex;gap:3px;overflow:hidden;border-radius:3px;margin-top:12px}
.ranking-distribution>span{min-width:0}.ranking-distribution .is-above{background:var(--accent)}.ranking-distribution .is-equal{background:var(--yellow)}.ranking-distribution .is-below{background:var(--line-strong)}
.ranking-distribution-label{display:flex;justify-content:space-between;gap:8px;font-size:12px;margin-top:8px;white-space:nowrap}
.ranking-fineprint{font-size:12px;color:var(--muted);line-height:1.6;margin-top:10px}
.ranking-selected-comparison{border-left:1px solid var(--line);border-right:1px solid var(--line);padding:0 24px}
.ranking-selected-comparison>div{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.ranking-selected-comparison>div>span{font-size:13px;font-weight:600}.ranking-selected-comparison>div>strong{font-size:20px;line-height:1.5;font-variant-numeric:tabular-nums;white-space:nowrap}
.ranking-selected-comparison dl{display:grid;gap:6px;margin-top:8px;font-size:12px}
.ranking-selected-comparison dl>div{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.ranking-selected-comparison dt{color:var(--muted)}.ranking-selected-comparison dd{margin:0;font-weight:600;font-variant-numeric:tabular-nums;text-align:right}
.ranking-evidence-block p{font-size:12px;line-height:1.6;margin:0 0 6px}.ranking-evidence-block p+p{color:var(--muted)}
.ranking-evidence-block .btn{padding:2px 0;min-height:24px;font-size:12px;text-align:left;white-space:normal}
.ranking-empty{display:grid;place-items:center;min-height:304px;padding:24px;text-align:center;color:var(--muted);font-size:14px}
.store-ranking-dashboard>.management-data-note{margin:0;color:var(--muted);font-size:12px;line-height:1.6}
@media(min-width:1440px){.store-ranking-surface{--ranking-label-width:156px;--ranking-value-width:116px}}
@media(max-width:1200px){.store-ranking-surface{--ranking-label-width:120px;--ranking-value-width:96px}.ranking-top-grid{grid-template-columns:minmax(0,1.65fr) minmax(302px,1fr);gap:12px}.ranking-chart-panel>header{align-items:flex-start;gap:8px;flex-wrap:wrap}.ranking-comparison-content{gap:16px}.ranking-selected-comparison{padding:0 16px}.ranking-selected-comparison>div{flex-wrap:wrap}.ranking-chart-axis,.ranking-bar-row{gap:8px}.ranking-detail-table th,.ranking-detail-table td{padding:8px}}
@media(max-width:960px){.ranking-top-grid{grid-template-columns:1fr}.ranking-chart-scroll{max-height:432px;min-height:0}.ranking-detail-scroll{max-height:360px}.ranking-comparison-content{grid-template-columns:1fr 1fr}.ranking-evidence-block{grid-column:1/-1;border-top:1px solid var(--line);padding-top:12px}.ranking-selected-comparison{border-right:0}.ranking-detail-table thead th:last-child{width:38%}}
@media(max-width:600px){.store-ranking-surface{--ranking-label-width:106px;--ranking-value-width:90px}.ranking-chart-panel>header,.ranking-detail-panel>header,.ranking-comparison-panel>header{padding:12px}.ranking-bar-row{min-height:44px;font-size:12px}.ranking-chart-scroll{padding:0 12px;max-height:440px}.ranking-chart-axis{padding:0 12px 6px}.ranking-bar-row>strong{font-size:12px}.ranking-place{min-width:20px;width:20px;height:24px}.ranking-bar-name{gap:4px}.ranking-chart-axis,.ranking-bar-row{gap:6px}.ranking-chart-caption{padding:8px 12px 12px}.ranking-comparison-content{grid-template-columns:1fr;gap:12px;padding:12px}.ranking-selected-comparison{border:0;border-top:1px solid var(--line);padding:12px 0 0}.ranking-evidence-block{grid-column:auto}.ranking-comparison-panel>header{align-items:flex-start;flex-direction:column;gap:8px}.ranking-comparison-panel>header label{width:100%;justify-content:space-between}.ranking-comparison-panel select{font-size:16px;min-height:44px;max-width:70%}.ranking-detail-table .ranking-store-pick{min-height:36px}.ranking-detail-table summary{min-height:32px;line-height:32px}.ranking-detail-table th:first-child{width:44px}.ranking-detail-table thead th:last-child{width:42%}.ranking-detail-scroll{max-height:420px}.ranking-metric-filter select{font-size:16px;min-height:44px}}
/* Ranking comparison: ten visible rows, inline controls and up to five stores. */
.store-ranking-surface{--ranking-chart-height:320px}
.store-ranking-surface .management-period-controls{gap:8px 10px}
.store-ranking-surface .ranking-metric-filter{margin:0;max-width:none;order:0}
.store-ranking-surface .ranking-metric-filter select{width:172px}
.store-ranking-surface .management-period-date .btn{padding-inline:8px}
.ranking-chart-panel>header,.ranking-detail-panel>header{padding:12px 16px;min-height:74px;border-bottom:1px solid var(--line)}
.ranking-detail-panel>header p{font-size:12px;color:var(--muted);margin-top:2px}
.ranking-image-button{font-size:12px;padding:5px 9px;min-height:30px;white-space:nowrap}
.ranking-chart-subhead{display:flex;justify-content:space-between;gap:8px;padding:9px 16px 8px;font-size:12px;color:var(--muted)}
.ranking-detail-panel{display:flex;flex-direction:column}
.ranking-detail-scroll{max-height:390px;flex:1}
.ranking-detail-table th,.ranking-detail-table td{padding:0 8px;height:32px;vertical-align:middle;line-height:1.4}
.ranking-detail-table thead th{height:34px;font-size:12px}
.ranking-detail-table th:first-child{width:42px}
.ranking-detail-table thead th:nth-child(3){width:35%;text-align:right}
.ranking-detail-table thead th:last-child{width:30px}
.ranking-detail-table tbody td:nth-child(3){text-align:right}
.ranking-detail-table tbody td:last-child{text-align:center}
.ranking-detail-table .ranking-store-pick{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:30px;font-size:13px}
.ranking-detail-table .ranking-evidence-button{padding:0;min-height:30px;min-width:26px;color:var(--muted);font-size:15px}
.ranking-detail-panel>.ranking-chart-caption{margin-top:auto;padding-top:10px}
.ranking-comparison-panel h2 small{font-size:12px;font-weight:400;color:var(--muted);margin-left:8px}
.ranking-comparison-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ranking-comparison-actions>.btn{min-height:34px;font-size:13px}
.ranking-store-chooser{position:relative;font-size:13px}
.ranking-store-chooser summary{cursor:pointer;padding:7px 10px;border:1px solid var(--line);border-radius:6px;min-height:34px}
.ranking-store-chooser summary b{margin-left:8px;font-weight:500;color:var(--muted)}
.ranking-store-options{position:absolute;right:0;top:calc(100% + 6px);min-width:220px;max-height:300px;overflow:auto;padding:6px;background:var(--surface);border:1px solid var(--line-strong);border-radius:8px;z-index:10}
.ranking-store-options>label{display:flex;gap:8px;align-items:center;min-height:34px;padding:4px 8px;border-radius:4px;cursor:pointer;font-size:13px;color:var(--text)}
.ranking-store-options>label:hover{background:var(--yellow-soft)}
.ranking-store-options input{width:16px;height:16px;min-height:0;accent-color:var(--accent)}
.ranking-comparison-content{grid-template-columns:minmax(190px,.7fr) minmax(0,2.3fr);gap:24px}
.ranking-selection-table{min-width:0;overflow:auto}
.ranking-selection-table table{width:100%;border-collapse:collapse;font-size:13px;white-space:nowrap}
.ranking-selection-table th,.ranking-selection-table td{padding:5px 8px;border-bottom:1px solid var(--line);text-align:right;font-variant-numeric:tabular-nums;line-height:1.5}
.ranking-selection-table th:first-child{text-align:left}
.ranking-selection-table thead th{color:var(--muted);font-weight:400;font-size:12px}
.ranking-selection-table tbody th{font-weight:500}
.ranking-selection-table td>.btn{font-size:12px;min-height:26px;padding:0 3px;color:var(--muted)}
.ranking-selection-empty{padding:16px;color:var(--muted);font-size:13px}
.ranking-evidence-detail>strong{display:block;font-size:30px;margin:10px 0 20px;font-variant-numeric:tabular-nums}
.ranking-evidence-detail dl{margin:16px 0 24px}
.ranking-evidence-detail dl>div{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--line)}
.ranking-evidence-detail dt{color:var(--muted)}.ranking-evidence-detail dd{margin:0;font-variant-numeric:tabular-nums}
.drawer:has(.ranking-full-comparison){width:min(1200px,96vw)}
.ranking-comparison-range{font-size:14px;font-weight:600;line-height:1.6}
.ranking-full-comparison>.ranking-fineprint{margin:8px 0 16px}
.ranking-all-metrics-scroll{overflow:auto;max-height:calc(100dvh - 260px);border:1px solid var(--line);border-radius:8px;scrollbar-gutter:stable}
.ranking-all-metrics-scroll table{border-collapse:separate;border-spacing:0;width:100%;table-layout:fixed;min-width:680px}
.ranking-all-metrics-scroll th,.ranking-all-metrics-scroll td{padding:11px 12px;vertical-align:top;border-bottom:1px solid var(--line);border-right:1px solid var(--line);font-size:13px;text-align:right;font-variant-numeric:tabular-nums;overflow-wrap:break-word}
.ranking-all-metrics-scroll th:first-child{position:sticky;left:0;text-align:left;width:180px;background:var(--surface);z-index:1}
.ranking-all-metrics-scroll thead th{position:sticky;top:0;background:var(--surface-soft);z-index:2;font-weight:600;font-size:13px}
.ranking-all-metrics-scroll thead th:first-child{z-index:3;background:var(--surface-soft)}
.ranking-all-metrics-scroll tbody th{font-weight:500}
.ranking-all-metrics-scroll small{display:block;font-size:12px;color:var(--muted);font-weight:400;margin-top:5px;line-height:1.5}
.ranking-all-metrics-scroll strong{font-weight:600;white-space:nowrap}
.ranking-all-metrics-scroll tbody tr:hover td,.ranking-all-metrics-scroll tbody tr:hover th{background:var(--yellow-soft)}
.ranking-image-preview>p{font-size:13px;line-height:1.6;margin-bottom:8px}
.ranking-image-preview figure{margin:16px 0 24px}
.ranking-image-preview img{display:block;width:100%;height:auto;border:1px solid var(--line);border-radius:6px;user-select:auto;-webkit-touch-callout:default}
.ranking-image-preview figcaption{display:flex;justify-content:center;padding-top:12px}
@media(max-width:1200px){.ranking-comparison-content{grid-template-columns:minmax(170px,.7fr) minmax(0,2.3fr);gap:16px}.ranking-chart-panel>header{flex-wrap:nowrap;align-items:center}.ranking-detail-table th,.ranking-detail-table td{padding:0 6px}.ranking-image-button{padding-inline:6px}.ranking-chart-subhead>span:last-child{display:none}.store-ranking-surface .management-scope-store{display:none}}
@media(max-width:960px){.ranking-chart-scroll{height:320px;max-height:320px}.ranking-detail-scroll{max-height:354px}.ranking-comparison-content{grid-template-columns:1fr}.ranking-distribution-block{max-width:420px}.ranking-selection-table table{min-width:650px}.store-ranking-surface .ranking-metric-filter{flex:1}.store-ranking-surface .ranking-metric-filter select{flex:1;width:auto;min-width:140px}}
@media(max-width:600px){.store-ranking-surface .management-period-tabs{width:auto;flex:0 0 auto}.store-ranking-surface .management-period-tabs>.btn{min-width:36px;padding:7px}.store-ranking-surface .ranking-metric-filter{font-size:12px;gap:5px}.store-ranking-surface .ranking-metric-filter select{width:140px;min-width:0}.ranking-chart-panel>header,.ranking-detail-panel>header{min-height:74px;padding:12px}.ranking-image-button{min-height:40px}.ranking-chart-scroll{height:440px;max-height:440px}.ranking-detail-scroll{max-height:474px}.ranking-detail-table th,.ranking-detail-table td{height:44px}.ranking-detail-table .ranking-store-pick,.ranking-detail-table .ranking-evidence-button{min-height:44px}.ranking-detail-table thead th:nth-child(3){width:36%}.ranking-detail-table thead th:last-child{width:32px}.ranking-comparison-panel>header{flex-direction:row;flex-wrap:wrap}.ranking-comparison-actions{width:100%;justify-content:space-between}.ranking-store-options{right:auto;left:0}.ranking-comparison-content{padding:12px}.drawer:has(.ranking-full-comparison){width:100%}.ranking-all-metrics-scroll{max-height:calc(100dvh - 290px)}.ranking-all-metrics-scroll th:first-child{width:150px}}

.ranking-detail-table thead th:last-child{width:40px}
@media(max-width:600px){.store-ranking-surface .management-period-tabs>.btn{white-space:nowrap;min-width:40px;padding:7px 6px;font-size:13px}.ranking-detail-table thead th:last-child{width:40px}}

.ranking-reference-field{display:flex;align-items:center;gap:10px;font-size:13px;margin:12px 0}.ranking-reference-field select{width:200px;min-height:36px;font-size:14px}
