/* Navigation: the sidebar's Projects tree, the Projects page, a project's fixed header and environment cards,
   Runs & Reports with its Ongoing runs, and the editor's Agent tab. Loaded after the other stylesheets. */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Projects in the sidebar: an entry that opens and closes the tree of projects, environments and tests ---------- */
/* The tree sits in the sidebar's one list, which scrolls as a whole: the tree itself never scrolls on its own. */
.nav-projects { display: flex; flex-direction: column; gap: 2px; flex: none; }
.nav-projects:has(> .tab[hidden]) { display: none; }
.nav-projects-toggle .nav-projects-chevron { width: 14px; height: 14px; margin-left: -4px; transition: transform .15s; }
.nav-projects-toggle[aria-expanded="false"] .nav-projects-chevron { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { .nav-projects-toggle .nav-projects-chevron { transition: none; } }
.nav-tree-region { display: flex; flex-direction: column; gap: 4px; flex: none; min-height: 0; padding: 2px 0 6px 10px; }
.nav-tree-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.nav-tree-filter { flex: 1 1 auto; min-width: 0; height: 30px; border: 1px solid var(--nav-line); border-radius: 6px; background: var(--nav-raised); color: var(--nav-text-strong); padding: 0 10px; font-size: 13px; transition: border-color .15s; }
.nav-tree-filter::placeholder { color: var(--nav-muted); opacity: 1; }
.nav-tree-filter:hover { border-color: var(--nav-line); }
.nav-tree-filter:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: 1px; }
.nav-tree-collapse, .nav-tree-new { flex: none; min-width: 30px; min-height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--nav-muted); cursor: pointer; }
.nav-tree-collapse:hover, .nav-tree-new:hover { background: var(--nav-divider); color: var(--nav-text-strong); }
.nav-tree-new:hover { color: var(--nav-accent); }
.nav-tree-collapse:focus-visible, .nav-tree-new:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: -2px; }
.nav-tree, .nav-tree ul { list-style: none; margin: 0; padding: 0; }
.nav-tree { flex: none; }
.nav-tree-item { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 8px 0 calc(2px + var(--level, 0) * 14px); border-radius: 6px; color: var(--nav-text); text-decoration: none; font-size: 13px; line-height: 1.3; cursor: pointer; user-select: none; }
.nav-tree-item:hover { background: var(--nav-hover); color: var(--nav-text-strong); }
.nav-tree-item:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: -2px; }
.nav-tree-item[aria-current="page"] { background: var(--nav-active); color: var(--on-fill); box-shadow: inset 2px 0 var(--nav-accent); }
.nav-chevron { flex: none; width: 18px; height: 22px; display: grid; place-items: center; border-radius: 4px; color: var(--nav-muted); }
.nav-tree-item[aria-expanded] .nav-chevron:hover { background: var(--nav-divider); color: var(--on-fill); }
.nav-chevron-icon { width: 14px; height: 14px; transition: transform .12s; }
.nav-tree-item[aria-expanded="false"] .nav-chevron-icon { transform: rotate(-90deg); }
.nav-tree-icon { flex: none; width: 15px; height: 15px; color: var(--nav-muted); }
.nav-tree-item[aria-current="page"] .nav-tree-icon { color: var(--nav-accent); }
.nav-tree-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-tree-count { flex: none; font-size: 11px; color: var(--nav-muted); }
.nav-tree-tag { flex: none; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; padding: 1px 4px; border-radius: 3px; background: var(--nav-tag-bg); color: var(--nav-tag-text); }
.nav-tree-tag.production { background: var(--nav-tag-production-bg); color: var(--nav-tag-production-text); }
/* The type's colour alone, when the environment's name already says its type. */
.nav-tree-tag.is-dot { width: 7px; height: 7px; padding: 0; border-radius: 50%; background: currentColor; }
.nav-tree-status { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--nav-idle); }
.nav-tree-status.passed { background: var(--nav-pass); }
.nav-tree-status.failed, .nav-tree-status.invalid { background: var(--nav-fail); }
.nav-tree-status.running { background: var(--nav-run); box-shadow: 0 0 0 3px var(--focus-halo); }
.nav-tree-more { color: var(--nav-tag-text); }
/* A row's ⋯ sits over the row's right end. It shows on hover, on the row focused by keyboard, while its menu is open
   and always on a touch screen, and the row makes room for it then. */
.nav-tree-row { position: relative; --nav-actions: 26px; }
.nav-tree-actions { position: absolute; top: 50%; right: 3px; transform: translateY(-50%); width: var(--nav-actions); height: var(--nav-actions); display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--nav-muted); cursor: pointer; visibility: hidden; }
.nav-tree-actions:hover, .nav-tree-actions.is-open { background: var(--nav-divider); color: var(--nav-text-strong); }
.nav-tree-row:has(> .nav-tree-actions:hover) > .nav-tree-item:not([aria-current="page"]) { background: var(--nav-hover); color: var(--nav-text-strong); }
.nav-tree-row:hover > .nav-tree-actions, .nav-tree-row:has(> .nav-tree-item:focus-visible) > .nav-tree-actions, .nav-tree-actions.is-open { visibility: visible; }
.nav-tree-row.has-actions:hover > .nav-tree-item, .nav-tree-row.has-actions:has(> .nav-tree-item:focus-visible) > .nav-tree-item, .nav-tree-row:has(> .is-open) > .nav-tree-item { padding-right: calc(var(--nav-actions) + 6px); }
@media (hover: none) {
  .nav-tree-actions { visibility: visible; }
  .nav-tree-row.has-actions > .nav-tree-item { padding-right: calc(var(--nav-actions) + 6px); }
}
/* The ⋯ menu opens over the page, beside the sidebar, so the sidebar's edge never cuts it off. */
.nav-tree-menu { position: fixed; z-index: 80; display: flex; flex-direction: column; min-width: 200px; max-width: min(320px, calc(100vw - 16px)); padding: 6px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); animation: menu-in .14s var(--ease); }
.nav-tree-menu-item { width: 100%; border: 0; border-radius: 7px; background: none; text-align: left; padding: 9px 12px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.nav-tree-menu-item:hover, .nav-tree-menu-item:focus-visible { background: var(--surface-hover); }
.nav-tree-menu-item:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.nav-tree-menu-item.is-danger { color: var(--fail-ink); }
@media (prefers-reduced-motion: reduce) { .nav-tree-menu { animation: none; } }
/* The icon rail keeps only the section icons; a group is a hairline between them. The Projects tree has no room
   there: its entry opens the Projects page instead. */
@media (min-width: 761px) {
  .app.drawer-collapsed .nav-tree-region, .app.drawer-collapsed .nav-projects-chevron { display: none; }
  .app.drawer-collapsed .nav-section-label { height: 1px; margin: 8px 10px; padding: 0; overflow: hidden; color: transparent; background: var(--nav-divider); }
  .app.drawer-collapsed .nav-section.is-pinned .tab { width: 44px; }
}
/* On a phone the drawer scrolls as a whole, Projects and its tree with it. Every row is a comfortable tap. */
@media (max-width: 760px) {
  .sidebar { overflow-y: auto; }
  .sidebar-tabs { flex: none; overflow: visible; }
  .nav-tree-item { min-height: 44px; }
  .nav-tree-row { --nav-actions: 40px; }
  .nav-tree-menu-item { min-height: 44px; }
  .nav-chevron { width: 30px; height: 36px; }
  .nav-tree-filter, .nav-tree-collapse, .nav-tree-new { min-height: 44px; min-width: 44px; }
  .nav-tree-filter { font-size: 16px; }
  .nav-section.is-pinned { margin-top: 8px; }
  .nav-section.is-pinned .tab { height: 44px; }
}

/* ---------- Projects page: one card per project; the whole card opens it ---------- */
ul.project-grid { list-style: none; margin: 0 0 18px; padding: 0; }
.project-card { position: relative; gap: 8px; }
.project-card > p { margin: 0; }
.project-card-name { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.project-card-name a { color: var(--ink); text-decoration: none; }
/* The name is the card's link; its box stretches over the card, so a click anywhere on it opens the project. */
.project-card-name a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.project-card-name a:focus-visible { outline: none; }
.project-card:has(.project-card-name a:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.project-card:hover .project-card-name a { color: var(--accent); }
/* Environments sit above the stretched link, each opening the project filtered to it. */
.project-card-environments { position: relative; z-index: 1; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; }
.project-card-environments a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 12px; color: var(--text-2); text-decoration: none; background: var(--surface-muted); }
.project-card-environments a:hover { border-color: var(--border-firm); background: var(--surface); }
.project-card-last { font-size: 11px; color: var(--muted); }
.project-grid > .library-empty { grid-column: 1 / -1; }
#projects-summary a { color: var(--accent); }

/* ---------- A project's environments, in the header's one row on every tab ---------- */
/* Chips in a segmented row: the name, the type (a dot when the name already says it) and the test count; the
   address is the tooltip. + Add and the chosen environment's settings follow; the rest is in Project details. */
#environment-list { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; flex: 1 1 320px; min-width: 0; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.environment-scope-note { flex-basis: 100%; font-size: 12px; color: var(--muted); }
/* One row that scrolls on its own when a project has many environments, so the header never grows taller. */
.environment-cards { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-width: 0; overflow-x: auto; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-hover); scrollbar-width: none; }
.environment-cards .environment-card { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 7px; min-width: 0; max-width: 240px; min-height: 30px; padding: 4px 11px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text-2); cursor: pointer; font: inherit; transition: background-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease); }
.environment-cards .environment-card:hover { background: var(--surface-translucent); color: var(--ink); }
.environment-cards .environment-card[aria-checked="true"] { border-color: var(--border-strong); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.environment-cards .environment-card:focus-visible { outline-offset: 0; }
.environment-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.environment-cards .environment-card .environment-type { flex: none; padding: 1px 5px; font-size: 9.5px; }
.environment-type.is-dot { width: 7px; height: 7px; padding: 0 !important; border-radius: 50%; font-size: 0 !important; background: var(--run); }
.environment-type.production.is-dot { background: var(--brand-orange); }
.environment-count { flex: none; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-active); color: var(--text-2); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.environment-card[aria-checked="true"] .environment-count { background: var(--accent-soft-hover); color: var(--accent-ink); }
.environment-add { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 4px 10px 4px 8px; border: 1px dashed var(--border-firm); border-radius: 8px; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: border-color .15s var(--ease), color .15s var(--ease), background-color .15s var(--ease); }
.environment-add:hover { border-color: var(--brand-orange); color: var(--ink); background: var(--surface); }
.environment-settings { color: var(--muted); }
.environment-picker-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
#environment-list.has-cards .environment-picker-row { display: none; }
#environment-list .environment-picker { min-width: 220px; max-width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 8px; background: var(--surface); font: inherit; font-size: 13px; }
.project-run-list { overflow: hidden; margin-bottom: 14px; }
/* The project's menu (Rename, Delete): a square button of the actions' height. */
.project-menu > summary.btn-icon-only { width: var(--control-height); padding: 0; font-size: 18px; line-height: 1; }
.project-menu .dropdown-panel { min-width: 180px; }

/* ---------- Project details: a drawer over the page's right side; a full-screen sheet on a phone ---------- */
.side-drawer-backdrop { position: fixed; inset: 0; z-index: 70; background: var(--overlay); animation: drawer-fade .18s var(--ease); }
.side-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; display: flex; flex-direction: column; width: min(460px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: -18px 0 50px var(--shadow-medium); outline: none; transform: translateX(16px); opacity: .6; transition: transform .2s var(--ease), opacity .2s var(--ease); }
.side-drawer.is-open { transform: none; opacity: 1; }
@keyframes drawer-fade { from { opacity: 0; } }
.side-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.side-drawer-head h2 { margin: 4px 0 0; font-family: var(--brand-font); font-size: var(--font-xl); font-weight: 600; letter-spacing: -.3px; color: var(--ink); overflow-wrap: anywhere; }
.side-drawer-close { flex: none; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.side-drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 24px; overscroll-behavior: contain; }
.drawer-section { padding: 16px 0; border-bottom: 1px solid var(--border-subtle); }
.drawer-section:last-child { border-bottom: 0; }
.drawer-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.drawer-section-head h3 { margin: 0; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.drawer-summary { margin: 0 0 8px; font-size: 13px; color: var(--text); }
.drawer-attribution { display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.drawer-attribution p { margin: 0; overflow-wrap: anywhere; }
.drawer-attribution strong { color: var(--text); font-weight: 600; }
.drawer-environments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.drawer-environment { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.drawer-environment.is-current { border-color: var(--accent-border); box-shadow: inset 3px 0 0 var(--accent); }
.drawer-environment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.drawer-environment-head h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.drawer-environment-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.drawer-facts { display: grid; gap: 6px; margin: 0 0 10px; }
.drawer-fact { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; font-size: 12.5px; }
.drawer-fact dt { color: var(--muted); }
.drawer-fact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.drawer-fact a { color: var(--accent); text-decoration: none; }
.drawer-fact a:hover { text-decoration: underline; }
.drawer-tokens { display: flex; flex-wrap: wrap; gap: 4px; }
.drawer-tokens code, .drawer-persona { padding: 1px 6px; border-radius: 5px; background: var(--surface-hover); color: var(--text-2); font-size: 11.5px; }
.drawer-tokens code { font-family: var(--mono); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 760px) {
  .side-drawer { width: 100vw; border-left: 0; }
  .side-drawer-head { padding: 14px 16px 12px; }
  .side-drawer-body { padding: 0 16px 20px; }
}

/* ---------- The test editor's Agent tab ---------- */
.editor-agent-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 4px 0 14px; font-size: 12px; color: var(--muted); }
.editor-agent-head select { flex: 1 1 220px; min-width: 0; max-width: 420px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 7px 9px; background: var(--surface); font: inherit; font-size: 12px; color: var(--text); }
.editor-agent-body { min-width: 0; }
.editor-agent-body .agent-thread { max-height: none; }
.editor-agent-empty { display: grid; justify-items: start; gap: 12px; padding: 28px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-muted); font-size: 13px; line-height: 1.7; color: var(--muted); }
.editor-agent-empty p { margin: 0; }
.editor-agent-empty .btn-link { font-size: 13px; }
/* What the agent does: discuss a run, or draft steps. Two toggle buttons, like the editor's own view switch. */
.editor-agent-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px; }
.editor-agent-modes button { min-height: 34px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 7px 14px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.editor-agent-modes [aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-strong); font-weight: 600; }
.editor-agent-modes button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }

/* ---------- Describe steps: the step drafter in the Agent tab ---------- */
.step-draft { min-width: 0; gap: 16px; }
.step-draft > .inspector-note { margin: 0; }
.step-draft .agent-banner { margin: 0; }
.step-draft .agent-thread { max-height: none; }
/* The run agent's message heads are too light for AA on the tester's blue bubble (4.4:1); here they meet it. */
.step-draft .agent-message-head { color: var(--muted); }
.step-draft-tools { display: flex; justify-content: flex-end; }
.step-draft-tools .btn-link { font-size: 12px; }
.step-draft-notes { margin: 8px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.6; color: var(--warn-ink); overflow-wrap: anywhere; }
.step-draft-result h3 { margin: 0 0 10px; font-size: 14px; }
.step-draft-steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--surface); }
.step-draft-step { display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: start; gap: 10px; padding: 11px 13px; border-top: 1px solid var(--border-subtle); }
.step-draft-step:first-child { border-top: 0; }
/* A step with something to check keeps a mark at its edge, so it stands out in a long draft. */
.step-draft-step.flagged { box-shadow: inset 3px 0 0 var(--warn-border); }
.step-draft-step .step-index { width: 27px; height: 27px; border: 0; border-radius: 7px; background: var(--surface-hover); color: var(--muted); font-size: 12px; }
.step-draft-step .step-desc { white-space: normal; overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
.step-draft-fields { font-family: var(--mono); font-size: 11px; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.step-draft-check { margin: 2px 0 0; padding: 6px 9px; border-radius: 6px; background: var(--warn-soft); color: var(--warn-ink); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.step-draft-add { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.step-draft-add select { flex: 1 1 200px; min-width: 0; max-width: 320px; min-height: 34px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 7px 9px; background: var(--surface); font: inherit; font-size: 12px; color: var(--text); }
.step-draft-ask { display: grid; gap: 6px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.step-draft-ask-row { display: flex; gap: 12px; align-items: flex-start; }
.step-draft-ask textarea { flex: 1; min-width: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); padding: 11px 12px; font: inherit; font-size: 13px; color: var(--text); resize: vertical; }
.step-draft-ask .btn { flex: none; }
@media (max-width: 760px) {
  .step-draft-ask-row { flex-direction: column; align-items: stretch; }
  .step-draft-ask .btn { align-self: flex-end; }
  .step-draft-add select { max-width: none; }
}

/* ---------- Runs & Reports: the runs going on now, above both tabs ---------- */
.ongoing-runs { margin: 0 32px 14px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.ongoing-runs h2 { display: flex; align-items: center; gap: 4px; margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.ongoing-list { list-style: none; margin: 0; padding: 0; }
.ongoing-run { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(160px, 1.2fr) minmax(100px, .7fr) auto; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.ongoing-run:first-child { border-top: 0; }
.ongoing-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ongoing-name { display: grid; gap: 2px; min-width: 0; }
.ongoing-name strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ongoing-name small, .ongoing-progress small, .ongoing-who { font-size: 12px; color: var(--muted); }
.ongoing-progress { display: grid; gap: 5px; min-width: 0; }
.ongoing-progress small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ongoing-bar { display: block; height: 6px; border-radius: 999px; background: var(--surface-active); overflow: hidden; }
.ongoing-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s; }
.ongoing-who { display: grid; gap: 2px; }
.ongoing-elapsed { font-variant-numeric: tabular-nums; }
.ongoing-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ongoing-empty { padding: 4px 0; font-size: 13px; color: var(--muted); }
/* The heading, how the run slots stand, and Watch all, on one line that wraps. */
.ongoing-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 8px; min-width: 0; }
.ongoing-head h2 { margin: 0; }
.ongoing-slots { font-size: 12px; color: var(--muted); }
.ongoing-slots:empty { display: none; }
.ongoing-watch-all { margin-left: auto; color: var(--ink); text-decoration: none; }
.ongoing-window { min-width: 32px; justify-content: center; color: var(--ink); text-decoration: none; }
/* A run waiting for a run slot says where it is in line where a running one shows its progress. */
.ongoing-line strong { font-size: 12px; font-weight: 600; color: var(--warn-ink); }
.ongoing-unseen { padding: 8px 0 2px; border-top: 1px solid var(--border-subtle); font-size: 12px; color: var(--muted); }
/* The number of runs going on stands out from the sidebar's other counts. */
#nav-runs-count { color: var(--nav-text-strong); background: var(--accent-fill-strong); }
@media (max-width: 760px) {
  .ongoing-runs { margin: 0 20px 12px; padding: 12px 14px; }
  .ongoing-run { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ongoing-actions { justify-content: flex-start; }
}

@media (max-width: 760px) {
  #environment-list { padding: 0; }
  /* On a phone the choice is one list, with the chosen environment's URL under it. */
  #environment-list .environment-cards { display: none; }
  #environment-list.has-cards .environment-picker-row { display: flex; }
  #environment-list .environment-picker { flex: 1 1 100%; min-width: 0; }
  #environment-list .environment-actions { margin-left: 0; }
}
/* A short window keeps the whole menu in view: the rows and group labels tighten. Shorter still, the brand's tagline
   makes room too, and past that the menu scrolls as a whole (studio.css). */
@media (min-width: 761px) and (max-height: 820px) {
  .sidebar .brand { min-height: 54px; padding: 9px 8px; }
  .sidebar-tabs { padding-top: 6px; }
  .sidebar-tabs .tab { height: 36px; }
  .nav-section-label { padding: 10px 12px 3px; font-size: 10px; }
  .nav-section.is-pinned .tab { height: 32px; }
  .sidebar-note { padding: 8px 12px 10px; }
}
@media (min-width: 761px) and (max-height: 680px) {
  .sidebar .brand-sub { display: none; }
  .sidebar .brand { min-height: 46px; padding: 7px 8px; }
  .sidebar-tabs { padding-top: 4px; }
  .sidebar-tabs .tab { height: 30px; font-size: 13.5px; }
  .sidebar-tabs .tab .icon { width: 18px; height: 18px; }
  .nav-section-label { padding: 6px 12px 1px; font-size: 9.5px; letter-spacing: .12em; }
  .nav-section.is-pinned { padding-top: 6px; }
  .nav-section.is-pinned .tab { height: 28px; }
  .sidebar-note div > span { display: none; }
  .sidebar-note { padding: 5px 12px 6px; }
  .sidebar-note strong { font-size: 12px; }
}
@media (min-width: 761px) and (max-height: 560px) {
  .sidebar { overflow-y: auto; }
  .sidebar-tabs { flex: none; overflow: visible; }
}

/* ---------- Runs & Reports: a heading like every page's, tabs on the page's edge, and compact rows ---------- */
#reports-workspace > .toolbar { padding: 22px 28px 12px; align-items: center; }
#reports-workspace .report-title { padding: 0; margin: 0; font-family: var(--brand-font); font-size: 24px; letter-spacing: -.5px; color: var(--ink); }
#reports-workspace .file-row { padding: 0; }
#reports-workspace #report-range-label { padding: 0; font-family: inherit; font-size: 13px; color: var(--muted); }
#reports-workspace .report-controls { padding-top: 0; }
#reports-workspace .ongoing-runs { margin: 0 28px 14px; padding: 12px 16px; border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
/* With nothing running, the card is one line. */
#reports-workspace .ongoing-runs:has(.ongoing-empty) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
#reports-workspace .ongoing-runs:has(.ongoing-empty) h2, #reports-workspace .ongoing-runs:has(.ongoing-empty) .ongoing-head { margin: 0; }
#reports-workspace .ongoing-runs:has(.ongoing-empty) .ongoing-empty { padding: 0; }
#reports-workspace .report-tabs { flex: none; margin: 0 28px; padding: 0; gap: 24px; background: none; border-bottom: 1px solid var(--border-strong); }
#reports-workspace .report-tabs button { margin-bottom: -1px; padding: 9px 0 10px; border-bottom-width: 2px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
#reports-workspace .report-tabs button:hover { color: var(--ink); }
#reports-workspace .report-tabs [aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
#reports-workspace .report-history-body { padding: 16px 28px 28px; }
#reports-workspace .report-body { padding: 16px 28px 28px; }
/* Runs & Reports scrolls as one page: each tab's body takes the height its content needs, so a long list of ongoing
   runs above never squeezes the report into a short box of its own with a scroll bar inside the page's. */
#reports-workspace .report-body, #reports-workspace .report-history-body { flex: none; min-height: auto; overflow: visible; }
#reports-workspace .ongoing-more { padding: 8px 0 0; border-top: 1px solid var(--border-subtle); }
#reports-workspace .report-alert { margin: 12px 28px 0; }
.report-evidence-panel { padding: 16px 18px; border-radius: var(--radius-lg); }
.report-evidence-panel > h2 { margin: 0 0 2px; font-family: var(--brand-font); font-size: var(--font-lg); font-weight: 600; color: var(--ink); }
.report-evidence-panel > .muted { margin: 0 0 12px; font-size: 12.5px; }
.inspector-history-row { min-height: 52px; padding: 8px 12px; transition: background-color .12s var(--ease); }
.inspector-history-row strong { font-size: 13.5px; color: var(--ink); }
.inspector-history-row small { margin-top: 2px; }
/* A run in the history and its Report link, side by side on one line of the list. */
.inspector-history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--border); background: var(--surface); }
.inspector-history-item > .inspector-history-row { border-bottom: 0; }
.inspector-history-report { padding: 8px 14px 8px 4px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--accent); }
@media (max-width: 760px) {
  #reports-workspace > .toolbar { padding: 18px 20px 10px; }
  #reports-workspace .ongoing-runs, #reports-workspace .report-tabs { margin-left: 20px; margin-right: 20px; }
  #reports-workspace .report-history-body, #reports-workspace .report-body { padding: 12px 20px 24px; }
}
/* The line under the brand meets the header's line, with the menu open or as an icon rail (Kajal): the brand is as
   tall as the header. In the rail, the hairline between groups keeps clear of the icons beside it. */
@media (min-width: 761px) {
  .app .sidebar .brand { box-sizing: border-box; height: 56px; min-height: 0; padding-top: 0; padding-bottom: 0; }
  .app.drawer-collapsed .nav-section-label { margin: 12px 10px; }
}
