/* Performance tab · a night card below the header that fits the viewport on desktop. */
.performance{position:fixed;top:84px;left:24px;right:24px;bottom:20px;z-index:9;border-radius:24px;background:#0d1915;box-shadow:inset 0 0 0 1px rgba(255,255,255,.07);overflow:hidden}
.perf-scroll{height:100%;overflow:auto;padding:18px 20px 12px}
.perf-inner{display:flex;flex-direction:column;gap:12px;max-width:1400px;margin:0 auto}
.perf-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.perf-title{display:flex;flex-direction:column;gap:6px;min-width:0}
.perf-head h2{margin:0;font:800 28px/1 var(--display);letter-spacing:-.03em}
.perf-note{display:flex;align-items:center;gap:8px;min-width:0;margin:0;font-size:12.5px;color:var(--muted)}
.perf-note span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.perf-pill{flex:none;padding:3px 8px;border-radius:999px;background:var(--cta);color:var(--cta-ink);font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.perf-head-tools{display:flex;align-items:center;gap:8px;flex:none}
.performance .segmented{background:rgba(255,255,255,.07);border:0;backdrop-filter:none;-webkit-backdrop-filter:none}
.performance .segmented>button{padding:6px 12px;font-size:12.5px}
#perf-history-date{padding:6px 12px;border-radius:999px;border:0;background:rgba(255,255,255,.07);color:var(--ink);font-size:12.5px;font-weight:600;color-scheme:dark}

/* Headline numbers: label on top, number and note side by side. */
.perf-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.perf-stat{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"label label" "value note";align-items:end;gap:4px 12px;padding:12px 16px;border-radius:16px;background:rgba(255,255,255,.04);box-shadow:inset 0 0 0 1px rgba(255,255,255,.09)}
.perf-stat>span{grid-area:label;font-size:10.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.perf-stat strong{grid-area:value;font:700 32px/1 var(--display);letter-spacing:-.03em}
.perf-stat strong small{font-size:.5em;color:var(--muted);margin-left:3px}
.perf-stat p{grid-area:note;margin:0 0 3px;font-size:12px;line-height:1.3;color:var(--muted)}

/* Chart and inspector share the remaining height. */
.perf-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:12px;align-items:stretch}
.perf-card{display:flex;flex-direction:column;gap:10px;padding:14px 16px;border-radius:18px;background:rgba(255,255,255,.04);box-shadow:inset 0 0 0 1px rgba(255,255,255,.09);min-width:0;min-height:0}
.perf-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.perf-chart{min-height:0}
.heat{display:flex;flex-direction:column;gap:2px;overflow-x:auto}
.heat-row{display:grid;gap:1px;align-items:center}
.heat-row.hours{font:400 10px var(--mono);color:var(--muted);padding-bottom:2px}
.heat-row.hours span{white-space:nowrap;width:0;overflow:visible}
.heat .name,.pulse-row .name{display:flex;align-items:center;gap:7px;padding:0 8px 0 0;border:0;background:transparent;font-size:12.5px;font-weight:500;color:var(--ink);text-align:left;white-space:nowrap;overflow:hidden}
.heat .name.on,.pulse-row.on .name{font-weight:700}
.heat .name i,.pulse-row .name i{width:8px;height:8px;border-radius:50%;flex:none}
.cell{height:18px;padding:0;border:0;border-radius:2px}
.cell.selected{box-shadow:0 0 0 2px var(--ink);position:relative;z-index:1}
.cell:hover{filter:brightness(1.35)}
.pulse{display:flex;flex-direction:column;gap:2px}
.pulse-row{display:grid;grid-template-columns:150px minmax(0,1fr) 80px;gap:10px;align-items:center;padding:3px 0;border:0;background:transparent;text-align:left}
.pulse-row .name{font-size:13px}
.pulse-row .track{display:flex;height:12px;border-radius:6px;overflow:hidden;background:rgba(255,255,255,.07)}
.pulse-row small{font-size:12px;color:var(--muted);text-align:right;white-space:nowrap}
.perf-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 10px;font-size:11.5px;color:var(--muted)}
.perf-legend{display:flex;flex-wrap:wrap;gap:10px}
.perf-legend span{display:flex;align-items:center;gap:5px}
.perf-legend i{width:10px;height:10px;border-radius:3px}

.perf-inspector{gap:8px}
.perf-back{align-self:flex-start;padding:0;border:0;background:transparent;font-size:13px;font-weight:600;color:var(--accent)}
.perf-inspector .kicker{font-size:10.5px;letter-spacing:.09em}
.insp-line{display:flex;align-items:center;gap:9px;font:700 22px/1 var(--display);letter-spacing:-.02em}
.insp-line i{width:11px;height:11px;border-radius:50%}
.insp-period{margin-top:-2px;font-size:13px;color:var(--muted)}
.insp-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.insp-stats div{display:flex;flex-direction:column;gap:2px;padding:8px 10px;border-radius:12px;background:rgba(255,255,255,.07)}
.insp-stats strong{font:700 18px var(--display)}
.insp-stats span{font-size:11px;color:var(--muted)}
.spark{display:block;width:100%;height:48px}
.spark-range{display:flex;justify-content:space-between;margin-top:-4px;font:400 10px var(--mono);color:var(--muted)}
.insp-count{font-size:12px;color:var(--muted)}
.journeys{display:flex;flex-direction:column;min-height:72px;max-height:260px;overflow:auto;scrollbar-width:thin}
.journey{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 2px;border:0;border-top:1px solid rgba(255,255,255,.09);background:transparent;text-align:left}
.journey span{display:flex;flex-direction:column;gap:1px;min-width:0}
.journey b{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.journey small{font-size:11px;color:var(--muted)}
.journey em{flex:none;font-style:normal;font-size:12px;font-weight:600;white-space:nowrap}
button.journey:hover{background:rgba(255,255,255,.03)}
.perf-inspector .empty{margin:6px 0;font-size:13px;color:var(--muted)}
.see-live{flex:none;padding:10px 14px;border-radius:12px;border:0;background:var(--ink);color:#0b1512;font-size:13.5px;font-weight:600}
.perf-method{margin:0;font-size:11.5px;line-height:1.4;color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.perf-method a{color:var(--accent)}

/* Desktop with enough height: the page never scrolls; heatmap rows and the journey list flex to fit. */
@media (min-width:960px) and (min-height:620px){
 .perf-scroll{overflow:hidden}
 .perf-inner{height:100%}
 .perf-layout{flex:1;min-height:0;grid-template-rows:minmax(0,1fr)}
 .perf-chart{flex:1;display:flex;flex-direction:column}
 .heat{flex:1;min-height:0}
 .heat-row:not(.hours){flex:1 1 0;min-height:9px;max-height:32px}
 .heat .cell{height:100%}
 .pulse{flex:1;min-height:0;justify-content:space-between}
 .pulse-row{flex:1 1 0;max-height:32px;min-height:0;padding:0}
 .journeys{flex:1;max-height:none;min-height:40px}
}
@media (min-width:960px) and (max-height:760px){.perf-stat{padding:9px 14px}.perf-stat strong{font-size:26px}.perf-head h2{font-size:24px}.perf-inner{gap:10px}.spark{height:36px}.insp-period{display:none}}
@media (min-width:960px) and (max-width:1199px){.performance{top:120px}.perf-layout{grid-template-columns:minmax(0,1fr) 280px}.perf-head{flex-wrap:wrap}.perf-stat{grid-template-areas:"label label" "value value" "note note"}}
@media (max-width:959px){
 .performance{top:calc(116px + env(safe-area-inset-top));left:0;right:0;bottom:0;border-radius:0;box-shadow:none;border-top:1px solid rgba(255,255,255,.08)}
 .perf-scroll{padding:12px 12px calc(20px + env(safe-area-inset-bottom))}
 .perf-inner{gap:10px}
 .perf-head{flex-direction:column;align-items:stretch;gap:10px}
 .perf-head h2{font-size:22px}
 .perf-head h2{font-size:21px}
 .perf-note{font-size:11.5px}
 .perf-head-tools{justify-content:space-between}
 .perf-stats{gap:6px}
 .perf-stat{grid-template-areas:"label" "value" "note";grid-template-columns:1fr;gap:3px;padding:10px}
 .perf-stat>span{font-size:9.5px;letter-spacing:.06em}
 .perf-stat strong{font-size:24px}
 .perf-stat p{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .perf-stat strong{font-size:22px}
 .perf-layout{grid-template-columns:minmax(0,1fr)}
 .perf-card{padding:12px}
 .perf-tools{gap:6px;flex-wrap:nowrap;overflow-x:auto;margin:0 -12px;padding:0 12px;scrollbar-width:none}
 .perf-tools::-webkit-scrollbar{display:none}
 .perf-tools .segmented{flex:none}
 .performance .segmented>button{padding:6px 9px;font-size:12px}
 .cell{height:13px}
 .pulse-row{grid-template-columns:104px minmax(0,1fr) 28px;padding:1px 0}
 .pulse-row .name{font-size:12.5px}
 .pulse-row .track{height:10px}
 .journeys{max-height:200px}
 .spark{height:40px}
 .perf-method{white-space:normal}
}
