/* Headroom's workspace. Fleet typography, core colors and shell stay upstream. */
:root {
  --work-surface: oklch(0.19 0.016 260);
  --work-raised: oklch(0.23 0.018 260);
  --work-line: oklch(0.52 0.02 260 / 0.24);
  --work-soft: oklch(0.77 0.016 260);
  --work-active: oklch(0.78 0.13 210 / 0.09);
}

.scenario-bar {
  width: 100%; max-width: 1760px; margin: 0 auto; padding-inline: 28px;
}
.eyebrow { font-size: 10px; line-height: 1.5; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--work-soft); }
.scenario-bar { display: flex; align-items: center; gap: 18px; padding-block: 22px 20px; }
.scenario-label { color: var(--work-soft); font-size: 12px; white-space: nowrap; }
.scenario-picks { display: flex; flex-wrap: wrap; gap: 7px; }
.scenario-picks .chip { padding: 7px 12px; min-height: 34px; border-radius: 6px; background: var(--surface-1); font-size: 12px; }
.chip[aria-pressed="true"] { color: var(--accent-bright); background: var(--work-active); border-color: color-mix(in oklch, var(--accent) 38%, transparent); }
.lab { max-width: 1760px; padding: 0 28px 32px; gap: 18px; align-items: start; }

/* First-visit introduction. The native dialog sits above the shared shell. */
body.welcome-open { overflow: hidden; }
.welcome-dialog {
  width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; overflow-x: hidden; overflow-y: auto;
  color: var(--text-primary); background: var(--work-surface);
  border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: 0 24px 90px oklch(0.1 0.015 260 / 0.5);
}
.welcome-dialog::backdrop { background: oklch(0.1 0.015 260 / 0.78); }
.welcome-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; z-index: 1; }
.welcome-art {
  display: flex; align-items: center; justify-content: center; gap: 0;
  min-height: 180px; padding: 38px 22px 0;
  background: radial-gradient(ellipse at 50% 90%, oklch(0.35 0.025 240 / 0.25), transparent 70%);
}
.welcome-art img { display: block; height: auto; object-fit: contain; }
.welcome-box { width: 58%; flex: none; }
.welcome-client { width: 23%; flex: none; margin-top: 58px; opacity: 0.85; }
.welcome-content { padding: 18px 38px 32px; }
.welcome-content .eyebrow { margin-bottom: 12px; color: var(--work-soft); }
.welcome-content h2 { font: 600 28px/1.2 var(--font); letter-spacing: -0.035em; max-width: 15ch; }
.welcome-description { color: var(--text-secondary); font-size: 14px; line-height: 1.7; margin-top: 14px; max-width: 40ch; }
.welcome-start { width: 100%; margin-top: 26px; justify-content: center; gap: 14px; min-height: 46px; font-size: 13px; }
.welcome-start > span { font-size: 18px; font-weight: 400; }
.welcome-note { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--text-muted); font-size: 10px; margin-top: 17px; }
.welcome-note > span { width: 5px; height: 5px; background: var(--c-3); border-radius: 50%; }

/* Configuration is one work area with three sections, not a stack of cards. */
.loadout {
  background: var(--work-surface); border: 1px solid var(--work-line); border-radius: 12px;
  padding: 0; overflow: hidden; -webkit-mask-image: none; mask-image: none;
}
.loadout-heading, .score-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 17px 18px; }
.loadout-heading h3, .score-heading h3 { font-size: 14px; font-weight: 600; }
.loadout-heading > span { font-size: 10px; color: var(--text-muted); text-align: right; max-width: 95px; line-height: 1.4; }
.setup-toggle, .loadout-summary { display: none; }
.setup-nav { display: grid; grid-template-columns: 1fr 1.25fr 0.8fr; border-bottom: 1px solid var(--work-line); padding-inline: 12px; }
.setup-nav button {
  appearance: none; font: 500 11px/1.4 var(--font); color: var(--text-muted); background: none; border: 0;
  border-bottom: 2px solid transparent; padding: 10px 4px 12px; cursor: pointer;
}
.setup-nav button span { display: block; font-size: 10px; margin-bottom: 4px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.setup-nav button[aria-pressed="true"] { color: var(--accent-bright); border-color: var(--accent); }
.setup-nav button:hover { color: var(--text-primary); }
.loadout .panel { border: 0; border-radius: 0; background: none; padding: 18px; margin: 0; }
.loadout .panel + .panel { border-top: 1px solid var(--work-line); }
.loadout .panel__title { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-primary); }
.loadout .select, .loadout .input { font-size: 12px; min-height: 38px; border-color: var(--work-line); border-radius: 6px; background-color: oklch(0.3 0.017 260 / 0.44); }
.loadout .select:hover, .loadout .input:hover { border-color: var(--border-strong); }
.loadout .field { margin-bottom: 12px; gap: 6px; }
.loadout .field > span { font-size: 11px; color: var(--work-soft); }
.loadout .specs { gap: 7px 12px; font-size: 11px; }
.loadout .specs dd { overflow-wrap: anywhere; }
.hardware-preview { position: relative; display: flex; align-items: center; justify-content: center; min-height: 160px; margin: -2px -2px 14px; background: radial-gradient(ellipse at 50% 70%, oklch(0.35 0.025 240 / 0.34), transparent 70%); }
.hardware-preview img { display: block; width: 100%; height: 168px; object-fit: contain; }
.hardware-maker { position: absolute; top: 1px; left: 0; color: var(--text-muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.hardware-render-note { position: absolute; bottom: 0; right: 0; font-size: 9px; color: var(--text-muted); }
.hardware-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hardware-title h3 { font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -0.025em; }
.hardware-title > span { color: var(--work-soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.hardware-chip { color: var(--text-muted); font-size: 11px; margin-top: 4px; line-height: 1.5; }
.hardware-facts { display: grid; grid-template-columns: 1fr 1.1fr 0.85fr; gap: 8px; padding: 17px 0 19px; margin-bottom: 16px; border-bottom: 1px solid var(--work-line); }
.hardware-facts > span { color: var(--text-muted); font-size: 10px; }
.hardware-facts strong { display: block; margin-bottom: 4px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.disclosure { border-top: 1px solid var(--work-line); padding-top: 12px; margin-top: 6px; }
.disclosure > summary { list-style: none; font-size: 11px; font-weight: 500; cursor: pointer; color: var(--work-soft); display: flex; align-items: center; gap: 7px; min-height: 26px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: '›'; font-size: 18px; line-height: 1; transition: transform 160ms var(--ease-out); }
.disclosure[open] > summary::before { transform: rotate(90deg); }
.disclosure > summary > span { margin-left: auto; font-size: 10px; font-weight: 400; color: var(--text-muted); }
.disclosure[open] > summary { margin-bottom: 12px !important; }
.setup-recap { padding: 17px 18px 20px; border-top: 1px solid var(--work-line); background: oklch(0.16 0.017 260 / 0.5); }
.setup-recap .eyebrow { margin-bottom: 8px; color: var(--text-muted); }
.setup-recap button { display: flex; gap: 10px; justify-content: space-between; width: 100%; border: 0; background: none; padding: 6px 0; font: 11px/1.4 var(--font); text-align: left; cursor: pointer; }
.setup-recap button > span { color: var(--text-muted); }
.setup-recap strong { color: var(--work-soft); font-weight: 500; text-align: right; }
.setup-recap button:hover strong { color: var(--accent-bright); }
.group { border: 0; border-radius: 0; padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--work-line); background: none; }
.group-device { display: flex; align-items: center; gap: 8px; margin: -5px 0 14px; }
.group-device img { object-fit: contain; }
.group-device .eyebrow { display: block; font-size: 9px; color: var(--text-muted); }
.group-device strong { display: block; font-size: 12px; font-weight: 500; margin-top: 3px; }
.group__head { align-items: end; gap: 8px; }
.group__head .field { flex: 1; margin: 0; }
.group__head .group__count { flex: 0 0 62px; }
.group__head .icon-btn { margin-bottom: 3px; }
.group .row { grid-template-columns: minmax(0, 1fr); }
.group .disclosure { margin-bottom: 12px; padding-top: 4px; }
.group .disclosure .row { padding-top: 2px; }
.group__meta { font-size: 11px; line-height: 1.6; }

/* The device scene and its controls form a single, quiet work surface. */
.floor-wrap { border-color: var(--work-line); border-radius: 12px; background: var(--work-surface); }
.scene-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 18px 20px 0; }
.scene-heading h3 { font-size: 14px; line-height: 1.4; font-weight: 600; }
.scene-heading p { font-size: 11px; color: var(--text-muted); margin-top: 5px; line-height: 1.5; }
.scene-views { flex-shrink: 0; border-color: var(--work-line); border-radius: 6px; }
.scene-views button { font-size: 10px; min-height: 30px; padding-inline: 10px; }
.scene-viewport { position: relative; margin-top: 8px; overflow: hidden; background: radial-gradient(ellipse at 50% 70%, oklch(0.3 0.025 250 / 0.22), transparent 70%); }
#floor, #deviceFloor { display: block; width: 100%; height: 425px; }
#deviceFloor { touch-action: pan-y; cursor: grab; }
#deviceFloor:active { cursor: grabbing; }
#deviceFloor:focus-visible { outline-offset: -3px; }
.scene-status { position: absolute; top: 16px; left: 20px; display: flex; gap: 7px; align-items: center; color: var(--text-muted); font-size: 10px; pointer-events: none; }
.scene-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); }
.scene-status.is-running { color: var(--accent-bright); }
.scene-status.is-running::before { background: var(--accent); }
.scene-load { position: absolute; top: 16px; right: 20px; color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; pointer-events: none; }
.scene-caption { position: absolute; bottom: 14px; left: 20px; right: 185px; color: var(--text-muted); font-size: 10px; line-height: 1.5; pointer-events: none; }
.scene-camera { position: absolute; right: 16px; bottom: 10px; display: flex; gap: 2px; padding: 3px; border: 1px solid var(--work-line); border-radius: 7px; background: var(--work-surface); }
.scene-camera .icon-btn { width: 27px; height: 27px; font-size: 18px; color: var(--work-soft); }
.floor-groups { display: flex; flex-wrap: wrap; padding: 0 16px; gap: 0 20px; border-top: 1px solid var(--work-line); }
.connected-group { appearance: none; display: flex; align-items: center; gap: 7px; flex: 1 1 200px; min-width: 0; max-width: 100%; text-align: left; font: inherit; color: var(--text-secondary); border: 0; background: none; padding: 10px 0; cursor: pointer; }
.connected-group img { flex: none; object-fit: contain; }
.connected-group strong { display: block; font-size: 12px; font-weight: 600; }
.connected-group small { display: flex; align-items: center; font-size: 10px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.connected-group .flag { color: var(--st-warn); }
.connected-group__edit { margin-left: auto; color: var(--text-muted); }
.connected-group:hover strong, .connected-group:hover .connected-group__edit { color: var(--accent-bright); }
.floor-groups .num { width: 14px; height: 14px; flex: none; font-size: 9px; }
.floor-legend { border-top-color: var(--work-line); padding: 12px 20px; gap: 8px 14px; font-size: 10px; color: var(--text-muted); }
.floor-legend .lg { gap: 5px; }
.floor-legend .lg i { width: 6px; height: 6px; }
.floor-legend b { font-weight: 500; color: var(--work-soft); }
.transport { margin: 12px 0 22px; gap: 7px; }
.transport .btn { padding-inline: 11px; font-size: 11px; }
.transport #playBtn { min-width: 72px; gap: 7px; }
.transport #playBtn > span { font-size: 10px; }
.transport .seg button { padding-inline: 9px; font-size: 10px; }
.transport .seg { border-color: var(--work-line); }
.transport__end { gap: 5px; }
.clock { display: flex; flex-direction: column; gap: 1px; min-width: 67px; padding-inline: 3px; font-size: 11px; text-align: center; }
.clock small { color: var(--text-muted); font-size: 9px; }
#redlineBtn { border-color: color-mix(in oklch, var(--accent) 28%, transparent); color: var(--accent-bright); background: var(--work-active); }
.charts { gap: 12px; margin-top: 0; }
.charts .viz-panel { border-color: var(--work-line); border-radius: 9px; background: var(--work-surface); }
.chart__svg .viz-title { letter-spacing: 0.04em; }
.blame .panel { border-color: var(--work-line); border-radius: 9px; background: var(--work-surface); }
.blame .panel__title { font-size: 10px; letter-spacing: 0.04em; }
.blame .stack-legend { font-size: 10px; line-height: 1.6; }

/* Results use rules and spacing for hierarchy instead of nested cards. */
.score { border: 1px solid var(--work-line); border-radius: 12px; background: var(--work-surface); overflow: hidden; }
.score-heading { padding-bottom: 15px; }
.score-heading > span { color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.score .verdict { margin: 0 16px 4px; padding: 15px 13px; border-radius: 8px; grid-template-columns: 22px 1fr; gap: 6px 9px; }
.score .verdict__icon { width: 21px; height: 21px; margin-top: 1px; }
.score .verdict__label { font-size: 18px; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; }
.score .verdict__text { font-size: 12px; line-height: 1.65; }
.score .tone-good { background: oklch(0.58 0.1 155 / 0.07); border-color: oklch(0.58 0.1 155 / 0.35); }
.score .tone-good .verdict__icon { color: oklch(0.74 0.14 155); }
.score .tone-warn { background: oklch(0.7 0.12 85 / 0.06); }
.score .tone-bad { background: oklch(0.65 0.14 30 / 0.06); }
.score .panel { margin: 0 !important; padding: 18px; border: 0; border-radius: 0; background: none; }
.score .panel + .panel { border-top: 1px solid var(--work-line); }
.score .panel__title { font-size: 10px; letter-spacing: 0.05em; line-height: 1.6; }
.tiles { column-gap: 17px; row-gap: 19px; }
.tile { padding: 0; border: 0; border-radius: 0; background: none; }
.tile__label { font-size: 10px; margin-bottom: 5px; }
.tile__value { font-size: 18px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.tile__sub { display: block; font-size: 9px; margin-top: 5px; line-height: 1.5; }
.score .stack-legend, .score .meter__top { font-size: 10px; }
.score .memory .bar-stack { height: 10px; }
.score .stack-legend { gap: 5px 10px; margin-top: 10px; }
.score .stack-legend .lg i { width: 6px; height: 6px; }
.score .meter { margin-bottom: 13px; }
.score .meter:last-child { margin-bottom: 0; }
.score .meter__bar { height: 4px; }
.meter__bar > span { transition: none; }
.score .list, .score .kv { font-size: 11px; line-height: 1.65; }
.score .kv { gap: 8px 12px; grid-template-columns: minmax(0, 1fr) minmax(65px, 0.8fr); }
.score .tbl { font-size: 10px; }
.score .tbl td, .score .tbl th { padding-inline: 4px; }
.compare-device { display: flex; gap: 10px; align-items: center; min-width: 200px; }
.compare-device img { object-fit: contain; flex: none; }
.compare-device > span { line-height: 1.8; }
#compare .tbl td { padding-block: 12px; }
.icon-btn:disabled, button:disabled { cursor: not-allowed; opacity: 0.45; }
button:focus-visible, summary:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (min-width: 1200px) {
  .lab { grid-template-columns: 292px minmax(0, 1fr) 292px; }
  .stage { display: block; }
  .loadout { position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow-y: auto; }
  .lab > .loadout, .lab > .stage, .lab > .score { grid-column: auto; grid-row: auto; order: 0; }
}
@media (min-width: 960px) and (max-width: 1199px) {
  .lab { grid-template-columns: 280px minmax(0, 1fr); gap: 16px; }
  .loadout { grid-row: 1 / span 7; overflow-y: auto; }
  .floor-wrap { order: 1; }
  .transport { order: 2; margin: 0 0 5px; }
  .score { display: grid; grid-template-columns: 1fr 1fr; }
  .score-heading, .score .verdict { grid-column: 1 / -1; }
  .score .verdict { margin-bottom: 8px; }
}
@media (min-width: 1200px) and (max-width: 1420px) {
  .lab { grid-template-columns: 268px minmax(0, 1fr) 272px; gap: 14px; padding-inline: 20px; }
  .scene-heading { flex-wrap: wrap; gap: 12px; }
  .transport__end { margin-left: 0; width: 100%; }
  #floor, #deviceFloor { height: 400px; }
}
@media (max-width: 959px) {
  .scenario-bar { padding-inline: 20px; }
  .lab { padding-inline: 20px; gap: 16px; }
  .loadout { order: 1; scroll-margin-top: 16px; }
  .loadout-heading { padding-block: 12px; }
  .loadout-heading > span { display: none; }
  .loadout .setup-toggle { display: inline-flex; font-size: 11px; }
  .loadout-summary { display: block; padding: 0 18px 16px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
  .loadout-summary span { display: block; color: var(--text-muted); font-size: 11px; }
  .loadout:not(.is-expanded) .setup-nav, .loadout:not(.is-expanded) .setup-content { display: none; }
  .loadout.is-expanded .loadout-summary { display: none; }
  .floor-wrap { order: 2; }
  .transport { order: 3; margin: 0 0 5px; }
  .score { order: 4; display: grid; grid-template-columns: 1fr 1fr; }
  .score-heading, .score .verdict { grid-column: 1 / -1; }
  .redline-card { order: 5; }
  .charts { order: 6; }
  .blame { order: 7; }
  .setup-content { min-width: 0; }
  .setup-nav { grid-template-columns: 1fr 1fr 1fr; }
  .setup-nav button span { display: inline; margin-right: 7px; }
  .setup-recap { display: none; }
  .hardware-preview { float: left; width: 40%; margin-right: 20px; }
  .hardware-preview img { height: 210px; }
  .hardware-facts { padding-block: 15px; margin-bottom: 12px; }
  .loadout .panel::after { content: ''; display: block; clear: both; }
  .loadout-heading > span { max-width: none; }
  .loadout .group .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .transport .only-narrow { margin-left: auto; }
}
@media (max-width: 599px) {
  .scenario-bar { display: block; padding: 18px 16px; }
  .welcome-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .welcome-art { min-height: 145px; padding: 28px 12px 0; }
  .welcome-content { padding: 12px 26px 26px; }
  .welcome-content h2 { font-size: 26px; }
  .welcome-description { font-size: 13px; }
  .scenario-label { display: block; margin-bottom: 10px; font-size: 11px; }
  .scenario-picks { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .scenario-picks .chip { white-space: nowrap; flex: none; }
  .lab { padding-inline: 12px; }
  .loadout .panel { padding: 16px; }
  .hardware-preview { float: none; width: 100%; margin: 0 0 10px; min-height: 125px; }
  .hardware-preview img { height: 145px; }
  .hardware-title h3 { font-size: 20px; }
  .hardware-facts { padding-block: 14px; }
  .hardware-facts strong { font-size: 14px; }
  .loadout .group .row { grid-template-columns: minmax(0, 1fr); }
  .scene-heading { padding: 16px 16px 0; flex-wrap: wrap; gap: 12px; }
  .scene-views button { min-height: 34px; }
  #floor, #deviceFloor { height: 350px; }
  .scene-caption { left: 14px; bottom: 51px; right: 14px; text-align: center; font-size: 9px; }
  .scene-camera { right: 50%; transform: translateX(50%); bottom: 9px; }
  .scene-status { left: 16px; }
  .scene-camera .icon-btn { width: 32px; height: 32px; }
  .floor-groups { padding-inline: 12px; }
  .floor-legend { padding: 12px 16px; gap: 9px 12px; }
  .transport { padding-inline: 3px; }
  .transport .seg button { padding-inline: 8px; }
  .transport__end { margin-left: 0; width: 100%; }
  .transport .clock { margin-left: auto; }
  .score { display: block; }
  .score .panel { padding: 18px; }
  .tile__label { font-size: 11px; }
  .tile__value { font-size: 23px; }
  .tile__sub { font-size: 10px; }
  .score .kv, .score .meter__top { font-size: 12px; }
  .charts { grid-template-columns: 1fr; }
  .compare-device { min-width: 135px; gap: 5px; }
  .compare-device img { width: 45px; height: 40px; }
}
@media (pointer: coarse) {
  .setup-nav button, .scenario-picks .chip, .scene-views button, .disclosure > summary { min-height: 44px; }
  .scene-camera .icon-btn { width: 36px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .disclosure > summary::before { transition: none; }
}
