/*
 * HoX "studio" theme (adapted from openkoji) for koji-web 1.35 (Cheetah templates).
 * One stylesheet. Order: tokens → base → shell → components → pages → legacy.
 * Page templates must not carry <style> or inline style attributes; add a class here instead.
 */
@import url("fonts/fonts.css");

/* ---------- tokens ---------- */
:root {
  --bg: #F5F1EA;
  --surface: #FFFDF9;
  --surface-2: #FBF7F0;
  --sunken: #F1EBE0;
  --hover: #EDE7DC;
  --nav-active: #EAE4D8;
  --line: #E8E1D5;
  --line-soft: #F1EBE0;
  --line-strong: #DDD4C5;
  --ink: #221E19;
  --ink-2: #3D372F;
  --muted: #5C554B;
  --faint: #6E675D;
  --accent: #235B4E;
  --accent-ink: #17423A;
  --accent-soft: #E3EEEA;
  --danger: #A8321E;
  --danger-soft: #F8E7E2;
  --warn: #8A5A00;
  --warn-soft: #F6ECD6;
  --neutral-soft: #EEE9E0;
  --chart-other: #C98F1C;
  --chart-grid: #EDE6DA;

  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px rgba(60, 40, 20, .05);
  --sidebar: 232px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.studio {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font-body);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }
code, .mono, kbd, pre { font-family: var(--font-mono); }
/* show characters as typed: JetBrains Mono ligatures would turn "<=" into one glyph */
code, .mono, kbd, pre, .logpanel pre { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.num { font-variant-numeric: tabular-nums; }
.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;
}
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 10; padding: 8px 12px; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  padding: 28px 16px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-name { display: block; font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { display: block; font-size: 12px; color: var(--muted); }

.mainnav { display: flex; flex-direction: column; gap: 22px; }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.navlabel { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 0 12px; margin-bottom: 6px; }
.mainnav a {
  display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px;
  border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500;
}
.mainnav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.mainnav svg { flex-shrink: 0; }

/* Active section: body id is koji's pageID (note upstream's "builtargets" typo). */
body#summary #summaryTab a,
body#packages #packagesTab a,
body#builds #buildsTab a,
body#tasks #tasksTab a,
body#tags #tagsTab a,
body#buildtargets #buildtargetsTab a,
body#builtargets #buildtargetsTab a,
body#users #usersTab a,
body#hosts #hostsTab a,
body#reports #reportsTab a,
body#activesession #reportsTab a,
body#buildroots #hostsTab a,
body#search #searchTab a,
body#api #apiTab a {
  background: var(--nav-active); color: var(--accent); font-weight: 600;
}

.sidebar-foot { margin-top: auto; padding: 0 12px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.sidebar-foot a { color: var(--muted); }

.main { flex-grow: 1; min-width: 0; padding: 24px 48px 28px 40px; display: flex; flex-direction: column; gap: 20px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 48px; flex-wrap: wrap; }
.who { display: flex; flex-direction: column; gap: 2px; }
.who-hello { font-family: var(--font-display); font-size: 18px; }
.who-hello a { font-weight: 600; }
.who-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.who-meta a { color: var(--muted); }

.search { display: flex; align-items: center; gap: 8px; position: relative; }
.search-field {
  display: flex; align-items: center; height: 40px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden;
}
.search-field:focus-within { border-color: var(--accent); }
.search-field select {
  height: 38px; border: 0; border-right: 1px solid var(--line); background: transparent;
  padding: 0 10px 0 14px; font: 500 13px var(--font-body); color: var(--ink-2);
}
.search-field input {
  width: 240px; height: 38px; border: 0; background: transparent; padding: 0 14px;
  font: 14px var(--font-body); color: var(--ink); outline: none;
}
.altsearch-menu {
  position: absolute; right: 0; top: 46px; z-index: 5; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
}
.altsearch-menu .menu-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 8px 10px 4px; }
.altsearch-menu button {
  text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px;
  font: 500 13px var(--font-body); color: var(--ink-2); cursor: pointer;
}
.altsearch-menu button:hover, .altsearch-menu button:focus-visible { background: var(--hover); color: var(--ink); }
.altsearch-menu small { display: block; color: var(--faint); font-weight: 400; font-size: 12px; }

/* page tabs */
.pagetabs { display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid #E2DACC; margin-top: -4px; overflow-x: auto; }
.pagetab {
  display: flex; align-items: center; flex-shrink: 0; height: 36px; max-width: 300px;
  border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0;
}
.pagetab:hover { background: var(--hover); }
.pagetab > a {
  display: flex; align-items: center; gap: 8px; height: 100%; min-width: 0; padding: 0 12px;
  color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap;
}
.pagetab > a:hover { color: var(--ink); text-decoration: none; }
.pagetab > a .t { overflow: hidden; text-overflow: ellipsis; }
.pagetab > a .k { color: #8A8174; font-size: 12px; }
.pagetab-icon { flex-shrink: 0; color: var(--faint); }
.pagetab.is-current .pagetab-icon, .pagetab > a:hover .pagetab-icon { color: var(--accent); }
.pagetab.closable > a { padding-right: 4px; }
.pagetab.is-current {
  background: var(--surface); border-color: #E2DACC; height: 37px; margin-bottom: -1px;
}
.pagetab.is-current > a { color: var(--ink); font-weight: 600; }
.pagetab-close {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 20px; height: 20px; margin-right: 8px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer;
}
.pagetab-close:hover { background: #E2DACC; color: var(--ink); }

.legacy-note {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
  padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--sunken);
}

.content { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.sitefoot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid #E2DACC; font-size: 12px; color: var(--muted);
}
.sitefoot a { color: var(--muted); }
.sitefoot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.sitefoot-credit { font-family: var(--font-display); font-style: italic; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 20px 24px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 20px 24px 12px; }
.card-head.card-head-tight { padding: 0 0 6px; }
.card-pad.card-pad-flush { padding-top: 0; }
.h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.th, .eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.sub { font-size: 13px; color: var(--muted); }
.link-more { font-size: 13px; font-weight: 500; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); font: 500 14px var(--font-body); white-space: nowrap; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
}
.btn:hover { text-decoration: none; background: var(--hover); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-ink); color: #FFFFFF; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 40px; padding: 0; }

.field-inline { display: flex; align-items: center; gap: 10px; }
.field-inline label { font-size: 13px; color: var(--muted); }
.select {
  height: 34px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface);
  padding: 0 12px; font: 600 14px var(--font-mono); color: var(--ink);
}

.segmented { display: flex; background: var(--sunken); border-radius: 8px; padding: 2px; }
.segmented button {
  height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  font: 500 12px var(--font-body); color: var(--muted); cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(60, 40, 20, .08); font-weight: 600; color: var(--ink); }

/* state chips: text + color, never color alone */
.state {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; text-transform: capitalize;
  background: var(--neutral-soft); color: var(--ink-2);
}
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.state-complete, .state-closed, .state-ready { background: var(--accent-soft); color: var(--accent); }
.state-failed, .state-problem { background: var(--danger-soft); color: var(--danger); }
.state-building, .state-open, .state-assigned, .state-init, .state-waiting, .state-initializing { background: var(--warn-soft); color: var(--warn); }
.state-free { background: var(--neutral-soft); color: var(--ink-2); }
.state-free::before { background: transparent; border: 1.5px solid currentColor; width: 7px; height: 7px; }
.state-canceled, .state-deleted, .state-expired { background: var(--neutral-soft); color: var(--muted); }

/* list rows (card tables) */
.rows { width: 100%; border-collapse: collapse; }
.rows th {
  text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600;
  height: 32px; padding: 0 14px; background: var(--surface-2);
  border-top: 1px solid #EFE8DC; border-bottom: 1px solid #EFE8DC; white-space: nowrap;
}
.rows th:first-child, .rows td:first-child { padding-left: 24px; }
.rows th:last-child, .rows td:last-child { padding-right: 24px; }
.rows th a { color: inherit; }
.rows td { padding: 8px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.rows tr:last-child td { border-bottom: 0; }
.rows .cell-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rows .cell-main > a, .rows .cell-main > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .cell-sub { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .id { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
.rows .nvr { font-family: var(--font-mono); font-size: 13px; color: var(--ink); font-weight: 500; }
.rows .when { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rows .empty td { color: var(--muted); padding: 18px 24px; }
.table-scroll { overflow-x: auto; }
.rows.fixed { table-layout: fixed; min-width: 520px; }
.rows col.c-id { width: 96px; }
.rows col.c-when { width: 150px; }
.rows col.c-state { width: 118px; }

.pager { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pager select { height: 28px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); font: 12px var(--font-body); }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px dashed #D3CABB; border-radius: 12px;
  background: #F1ECE3; color: var(--muted); font-size: 12.5px; line-height: 1.5;
}
.notice svg { flex-shrink: 0; margin-top: 2px; }

.empty-state {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px;
  padding: 14px 18px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2);
}
.empty-state .lead { font-family: var(--font-display); font-size: 17px; font-style: italic; color: var(--ink-2); }

/* ---------- shared page building blocks (use these; do not add per-page one-offs) ---------- */
/* page header for list/detail pages */
.page-kicker { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 6px; }
.page-title-md { font-size: 34px; letter-spacing: -0.015em; line-height: 1.1; word-break: break-word; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-sub { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); margin-top: 8px; }

/* filter bar: labelled selects / toggles in one row */
.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; padding: 16px 24px; border-bottom: 1px solid var(--line-soft); }
.filter { display: flex; flex-direction: column; gap: 4px; }
.filter > label, .filter > .filter-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.filter select, .filter input[type=text] {
  height: 34px; min-width: 120px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface);
  padding: 0 10px; font: 500 13px var(--font-body); color: var(--ink);
}
.filter select:disabled { color: var(--faint); background: var(--sunken); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); height: 34px; }
.letters { display: flex; flex-wrap: wrap; gap: 2px; padding: 10px 24px; border-bottom: 1px solid var(--line-soft); }
.letters a, .letters strong { min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; font-size: 12.5px; font-weight: 500; }
.letters a { color: var(--ink-2); }
.letters a:hover { background: var(--hover); text-decoration: none; }
.letters strong { background: var(--accent); color: #FFFFFF; }

/* table card: .card > [.card-head] [.filters] .table-scroll > table.rows ; .card-foot pager */
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 24px; border-top: 1px solid var(--line-soft); }
.rows th.sorted { color: var(--accent); }
.rows th img, .rows td img.sort { vertical-align: middle; }
.rows tr:hover td { background: #FDFAF4; }
.rows .muted { color: var(--muted); }
.rows .wrap { white-space: normal; word-break: break-word; }

/* detail layout: main column + side rail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.detail-main, .detail-rail { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* definition list */
.dl { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); margin: 0; }
.dl > dt, .dl > dd { padding: 9px 0; border-top: 1px solid var(--line-soft); margin: 0; }
.dl > dt:first-of-type, .dl > dt:first-of-type + dd { border-top: 0; }
.dl > dt { color: var(--muted); font-size: 13px; padding-right: 16px; }
.dl > dd { font-size: 13.5px; word-break: break-word; }
.card .dl { padding: 4px 24px 12px; }

/* inline list of links/tags */
.inline-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--sunken); color: var(--ink-2); font-size: 12.5px; font-family: var(--font-mono); }
a.pill:hover { background: var(--hover); text-decoration: none; }

/* task tree with connector lines */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 14px; padding-left: 16px; border-left: 1px solid var(--line-strong); }
.tree li { position: relative; padding: 5px 0; }
.tree ul > li::before { content: ""; position: absolute; left: -16px; top: 17px; width: 12px; border-top: 1px solid var(--line-strong); }
.tree-node { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.tree-node .meta { font-size: 12px; color: var(--faint); }
.tree-node.current > a { font-weight: 600; color: var(--ink); }

/* callouts */
.callout { border-radius: 12px; padding: 14px 18px; font-size: 13.5px; line-height: 1.55; }
.callout-danger { background: var(--danger-soft); color: #7A2415; border: 1px solid #EFCFC6; }
.callout-info { background: var(--sunken); color: var(--ink-2); border: 1px solid var(--line); }
.callout pre { white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; font-size: 12.5px; }

/* log / code panel */
.logpanel { background: #1F1B16; color: #EDE6DA; border-radius: 12px; overflow: hidden; }
.logpanel-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 14px; background: #2A251F; border-bottom: 1px solid #3A332B; font-size: 12.5px; }
.logpanel-bar select, .logpanel-bar button {
  height: 28px; border: 1px solid #4A423A; border-radius: 7px; background: #1F1B16; color: #EDE6DA; font: 12.5px var(--font-body); padding: 0 8px; cursor: pointer;
}
.logpanel-bar button[aria-pressed="true"] { border-color: #6FA897; color: #BFE3D7; }
.logpanel-bar .spacer { flex-grow: 1; }
.logpanel-bar .status { color: #B8AE9F; }
.logpanel pre { margin: 0; padding: 14px 16px; max-height: 520px; overflow: auto; font: 12.5px/1.55 var(--font-mono); white-space: pre-wrap; word-break: break-all; }
.logpanel .hl-error { background: #4A1F17; color: #FFB59E; display: block; }
.logpanel-note { padding: 8px 14px; font-size: 12px; color: #B8AE9F; border-top: 1px solid #3A332B; }

/* file / output list */
.filelist { list-style: none; margin: 0; padding: 0 24px 12px; }
.filelist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.filelist li:first-child { border-top: 0; }
.filelist .name { font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .size { color: var(--muted); font-size: 12px; }

.footnote { font-size: 12px; color: var(--faint); }
/* plain list of navigation links with a short explanation */
.link-list { list-style: none; margin: 0; padding: 0 24px 14px; }
.link-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.link-list li:first-child { border-top: 0; }
.link-list a { font-weight: 500; }
.dl dd.digest { word-break: break-all; font-size: 12.5px; }


/* forms: label column + field column, action bar at the bottom */
.form-card { max-width: 760px; }
.form-grid { display: flex; flex-direction: column; padding: 8px 24px; }
.form-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.form-row:first-child { border-top: 0; }
.form-row > label, .form-label { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-top: 8px; }
.form-row input[type=text], .form-row select {
  width: 100%; max-width: 420px; height: 38px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); padding: 0 12px; font: 14px var(--font-body); color: var(--ink);
}
.form-row input[type=text]:focus, .form-row select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row input.input-short { max-width: 140px; }
.form-row .check { height: auto; padding-top: 8px; align-items: flex-start; }
.form-row .check input { margin-top: 3px; }
.form-row input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.form-static { padding-top: 8px; font-size: 14px; }
.form-hint { margin: 6px 0 0; font-size: 12px; color: var(--faint); }
.form-actions { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.form-row textarea {
  width: 100%; max-width: 560px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface);
  padding: 8px 12px; font: 14px var(--font-body); color: var(--ink);
}
.form-row textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row select[multiple] { height: auto; padding: 4px; max-width: 480px; }
.form-row select[multiple] option { padding: 4px 8px; border-radius: 6px; font-family: var(--font-mono); font-size: 13px; }
.form-row select[multiple] option:checked { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (max-width: 820px) {
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

.btn-danger { color: var(--danger); border-color: #E6C3B8; }
.btn-danger:hover { background: var(--danger-soft); color: #7A2415; }
.pager-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }



/* ---------- pages: tasks ---------- */
/* Tasks list + task info (group "tasks"). To be merged into studio.css. */

/* list */
.task-desc a { font-weight: 500; }
.card-foot-top { border-top: 0; border-bottom: 1px solid var(--line-soft); }
.tasks-table col.c-owner { width: 190px; }
.tasks-table col.c-arch { width: 88px; }
.tasks-table td { height: 50px; }
.tasks-table tr.task-child td { height: 42px; border-bottom-color: transparent; }
.tasks-table tr.task-top + tr.task-child td, .tasks-table tr.task-child + tr.task-child td { border-top: 0; }
.tasks-table tr.task-child.last td { border-bottom-color: var(--line-soft); }
.tasks-table tr.task-child .id a { color: #3E7A6C; }
.tasks-table td.owner { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.task-cell { display: flex; align-items: center; min-width: 0; height: 100%; }
.task-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-size: 13.5px; }
.task-title:hover { color: var(--accent-ink); }
.task-title .task-m { font-weight: 600; }
.task-title .task-a { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
tr.task-child .task-title { font-size: 13px; }
tr.task-child .task-title .task-m { font-weight: 500; }
.tree-stub { position: relative; flex-shrink: 0; align-self: stretch; }
tr.d1 .tree-stub { width: 28px; }
tr.d2 .tree-stub { width: 50px; }
tr.d3 .tree-stub { width: 72px; }
tr.d4 .tree-stub { width: 94px; }
.tree-stub::before { content: ""; position: absolute; right: 12px; top: -9px; bottom: -9px; border-left: 1px solid #CFC5B4; }
tr.last .tree-stub::before { bottom: 50%; }
.tree-stub::after { content: ""; position: absolute; right: 2px; top: 50%; width: 10px; border-top: 1px solid #CFC5B4; }

.seg-links { height: 34px; align-items: center; }
.seg-links a, .seg-links span {
  height: 28px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 6px;
  font: 500 13px var(--font-body); color: var(--muted);
}
.seg-links a:hover { text-decoration: none; color: var(--ink); }
.seg-links a[aria-current] { background: var(--surface); box-shadow: 0 1px 2px rgba(60, 40, 20, .08); font-weight: 600; color: var(--ink); }
.seg-links .disabled { color: #B3AA9C; cursor: not-allowed; }
.scope-chips { display: flex; gap: 6px; height: 34px; align-items: center; flex-wrap: wrap; }
.pill-x { margin-left: 4px; color: var(--faint); font-family: var(--font-body); }
.pill-x:hover { color: var(--danger); text-decoration: none; }

/* task info */
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.title-row .state { font-size: 13px; padding: 4px 11px 4px 9px; }
.task-h1 .task-m { font-weight: 600; }
.task-h1 .task-a { font-weight: 400; color: var(--muted); }
.result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.result-head h2 { font-size: 20px; }
.callout .result-body pre, .callout .result-body { font-family: var(--font-mono); font-size: 13px; }
.callout .result-body pre { margin: 0; }
.result-toggle { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; }
.callout-danger a { color: #7A2415; font-weight: 600; }
.card-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; padding: 18px 24px 8px; }
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px 24px 8px; }
.card-title-row .card-title { padding: 0; }
.task-tree { padding: 4px 24px 16px; }
.task-tree .tree-node .state { font-size: 11.5px; padding: 2px 8px 2px 7px; }
.params { padding: 4px 24px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.params .param { display: flex; flex-direction: column; gap: 2px; }
.params .param > .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.params .param > .v { font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; color: var(--ink-2); }
.build-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 24px 16px; }
.build-row a { font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; }
.filelist .actions { display: flex; gap: 10px; font-size: 12px; }
.rail-links { padding: 0 24px 14px; font-size: 13px; }
.logpanel-head { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.logpanel-head strong { font-family: var(--font-display); font-size: 16px; color: #F5EFE4; font-weight: 600; }
.logpanel-head span { font-family: var(--font-mono); font-size: 11.5px; color: #B8AE9F; }
.logpanel-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid #3A332B; font-size: 11.5px; color: #B8AE9F; }
.logpanel-foot a, .logpanel-foot button { color: #E9C9A0; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.logpanel .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #6FA897; display: inline-block; margin-right: 6px; }
.logpanel [aria-pressed="false"] .live-dot { background: #8C8273; }
.logpanel-empty { padding: 18px 16px; font-size: 13px; color: #B8AE9F; }
.logpanel-empty button { color: #E9C9A0; background: none; border: 0; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

/* refinements after screenshots */
.tasks-table td.mono { font-size: 12px; }
.task-h1 { overflow-wrap: anywhere; }
.task-h1 .task-a { font-size: .62em; font-family: var(--font-mono); letter-spacing: 0; }
.tree-node { flex-wrap: nowrap; min-width: 0; }
.tree-node .task-title { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-node > .mono { flex-shrink: 0; }
.tree-node > .state { flex-shrink: 0; }
.logpanel-bar .logpanel-head { flex: 1 1 220px; min-width: 0; }
.logpanel-bar .logpanel-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logpanel-bar select { max-width: 300px; }
.page-head .page-actions { align-self: flex-end; }

/* ---------- pages: builds ---------- */
/* group "builds" (builds.chtml, buildinfo.chtml) — to be merged into studio.css */

/* sub-group header inside a card (arch / archive extension / log dir) */
.card-head.arch-head { padding: 6px 24px 2px; }
.card-head.arch-head + .filelist li:first-child { border-top: 0; }

/* log links as a wrapping row of pills */
.log-links { padding: 4px 24px 18px; }

/* preformatted blocks inside cards: changelog, extra */
.card pre.changelog, .card pre.extra {
  margin: 0; padding: 0 24px 20px; max-height: 480px; overflow: auto;
  font: 12.5px/1.6 var(--font-mono); color: var(--ink-2); white-space: pre-wrap; word-break: break-word;
}

/* rpm header text (description) keeps its line breaks */
.rpmheader.usertext { white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

/* builds list: the letters bar sits directly under the filters */
.charlist { border-bottom: 1px solid var(--line-soft); }

/* page title that links to itself (buildinfo): keep ink colour */
.page-title-md a { color: inherit; }
.page-title-md a:hover { color: var(--accent); text-decoration: none; }
/* filter description sentence flows as one line of text */
.page-desc a { font-weight: 500; }

/* ---------- pages: packages ---------- */
/* packages group (packages, packageinfo, search) — to be merged into studio.css */

/* link-based segmented toggle (works without JS) */
.segmented a {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 6px;
  font: 500 12.5px var(--font-body); color: var(--muted);
}
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented a[aria-current="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(60, 40, 20, .08); font-weight: 600; color: var(--ink); }

/* filters inside a padded card, no own border */
.filters.filters-flush { padding: 0; border-bottom: 0; }
.filter.filter-grow { flex: 1 1 260px; }
.filter.filter-grow input[type=text] { width: 100%; }

/* search form */
.search-form { display: flex; flex-direction: column; gap: 14px; }
.match-modes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 0; margin: 0; padding: 0; }
.match-modes legend { float: left; margin-right: 6px; }
.match-mode {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; color: var(--ink); cursor: pointer;
}
.match-mode:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.match-mode abbr { text-decoration: none; font-family: var(--font-mono); }
.match-mode input { accent-color: var(--accent); margin: 0; }

.dl.dl-flush { padding: 8px 0 0; }
.card-pad .h2 + .dl { margin-top: 4px; }

/* titles that are links (packageinfo) keep the ink color */
.title-link a { color: inherit; }
.title-link a:hover { color: var(--accent); text-decoration: none; }

/* wider rail when it carries a table (packageinfo tags) */
.detail.detail-rail-wide { grid-template-columns: minmax(0, 1fr) 420px; }
@media (max-width: 1100px) { .detail.detail-rail-wide { grid-template-columns: minmax(0, 1fr); } }

/* tighter cells for tables in side rails */
.rows.compact th, .rows.compact td { padding-left: 10px; padding-right: 10px; }
.rows.compact th:first-child, .rows.compact td:first-child { padding-left: 24px; }
.rows.compact th:last-child, .rows.compact td:last-child { padding-right: 24px; }

/* page-jump select readable */
.pageJump select { min-width: 58px; padding: 0 6px; }

/* NVRs never break mid-token; the table scrolls instead */
.rows a.nvr { white-space: nowrap; }
.rows a.nvr:hover { color: var(--accent); }

/* ---------- pages: hosts ---------- */
/* group "hosts" (hosts, hostinfo, channelinfo, clusterhealth, hostedit) — to be merged into studio.css */

/* numeric columns */
.rows th.num-col, .rows td.num-col { text-align: right; }

/* channel pills: per-host / per-channel disabled state is shown struck through */
.pill.chan-disabled { text-decoration: line-through; color: var(--faint); background: var(--neutral-soft); }

/* horizontal bars drawn as SVG (width from template, no inline styles) */
.hbar { display: block; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; }
.hbar-track { fill: var(--sunken); }
.hbar-free { fill: var(--accent); }
.hbar-busy { fill: var(--chart-other); }
.hbar-cap { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* host detail: task load card */
.load-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.load-figure { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.load-figure .fig-value { color: var(--ink); }
.load-figure .fig-value:hover { color: var(--accent); text-decoration: none; }

/* user-entered text (description / comment) keeps its line breaks */
.card .usertext { white-space: pre-wrap; margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); word-break: break-word; }
.card .usertext:empty { display: none; }
.adminLink { font-size: 12px; color: var(--muted); margin-left: 6px; }

/* channel detail: totals row */
.rows tr.total-row th, .rows tr.total-row td { background: var(--surface-2); font-weight: 600; }
.rows tr.total-row th { text-align: left; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink); }

/* cluster health */
.rows.health th[scope="row"] { background: transparent; border-top: 0; border-bottom: 1px solid var(--line-soft); text-transform: none; letter-spacing: 0; font-size: 13px; height: auto; padding-top: 12px; padding-bottom: 12px; }
.rows.health td { width: 40%; padding-top: 12px; padding-bottom: 12px; }
.health-legend { display: flex; gap: 16px; align-items: center; height: 34px; font-size: 12.5px; color: var(--muted); }
.health-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.health-legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.health-legend .sw-busy { background: var(--chart-other); }
.health-legend .sw-free { background: var(--accent); }

/* forms (admin edit pages) */

/* ---------- pages: tags ---------- */
/* group "tags" (tags, taginfo, taginfo_deleted, tagedit, tagparent) — to be merged into studio.css */

/* destructive button (admin delete): outlined, turns red on hover */

/* tags list: narrow ID column; pager sits at the right of the card head */
.rows th.col-id { width: 96px; }

/* callout carrying an action (add-as-parent flow) */
.tag-addparent { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* inheritance tree: each item draws its own connector so lines stop at the last child */
.tag-tree { padding-top: 2px; }
.tag-tree ul { margin-left: 14px; padding-left: 0; border-left: 0; }
.tag-tree ul > li { padding: 5px 0 0 18px; border-left: 1px solid var(--line-strong); }
.tag-tree ul > li:last-child, .tag-tree ul > li.tree-trunc { border-left-color: transparent; }
.tag-tree ul > li::before {
  content: ""; position: absolute; left: -1px; top: 0; width: 14px; height: 17px;
  border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); border-top: 0;
}
.tag-tree > .tree-node { font-size: 14px; padding: 4px 0; }
.tag-tree li.hidden { display: none; }
.tag-tree .tree-trunc .meta { font-style: italic; }
.tree-actions { display: inline-flex; gap: 10px; font-size: 12px; }
.tree-actions a { color: var(--muted); }
.tree-actions a:hover { color: var(--accent); }
.tree-empty { margin: 6px 0 0; }
.tree-toggle { margin: 12px 0 0; font-size: 13px; }

/* extra options values */
pre.extra-value { margin: 0; font: 12.5px/1.55 var(--font-mono); white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }

/* single-card pages */
.tag-narrow { max-width: 720px; }

/* admin forms */

/* ---------- pages: targets & users ---------- */
/* group "targets" (buildtargets, buildtargetinfo, buildtargetedit, users, userinfo) — to be merged into studio.css */

/* narrow numeric ID column in simple lists */
.rows th.col-id { width: 96px; }

/* "how builds flow" steps on the target page */
.target-flow { list-style: none; margin: 0; padding: 0 24px 20px; display: flex; flex-direction: column; gap: 0; }
.target-flow li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.target-flow li:first-child { border-top: 0; }

/* labelled admin forms: label column + field column, actions under the fields */

/* ---------- pages: reports ---------- */
/* group "reports" (reports index + 7 reports sharing one template) — to be merged into studio.css */

/* index: grouped cards */
.report-group { display: flex; flex-direction: column; gap: 12px; }
.report-group > .th { font-family: var(--font-body); margin: 0; padding-left: 2px; }
.report-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.report-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px; color: var(--ink); }
.report-card:hover { text-decoration: none; color: var(--ink); border-color: var(--line-strong); }
.report-card:hover .report-card-title { color: var(--accent); }
.report-card-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.report-card-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }

/* one-of-many link choices (arch filters) */
.choice { display: flex; flex-wrap: wrap; gap: 2px; }
.choice a, .choice strong {
  display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 8px;
  font: 500 13px var(--font-mono);
}
.choice a { color: var(--ink-2); }
.choice a:hover { background: var(--hover); text-decoration: none; }
.choice strong { background: var(--accent); color: #FFFFFF; }
.filter-unit { font-size: 13px; color: var(--muted); height: 34px; display: inline-flex; align-items: center; }
.title-arch { font-size: 0.7em; color: var(--muted); margin-left: 12px; }

/* report table: count cell = number + horizontal bar (SVG, no inline styles) */
.card.report { overflow: hidden; }
.report-table th.report-count-col { width: 58%; }
.report-count { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 14px; }
.report-num { font-weight: 600; text-align: right; }
.rbar { display: block; width: 100%; height: 8px; }
.rbar-track { fill: var(--sunken); }
.rbar-fill { fill: var(--accent); }
.rbar-failed .rbar-fill { fill: var(--danger); }
.rbar-canceled .rbar-fill { fill: #9C9488; }

@media (max-width: 1100px) {
  .report-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .report-cards { grid-template-columns: minmax(0, 1fr); }
  .report-count { grid-template-columns: 64px minmax(0, 1fr); }
}

/* ---------- pages: rpms, archives, files ---------- */
/* group "rpms" (rpminfo, rpmlist, archiveinfo, archivelist, fileinfo, imageinfo) - to be merged into studio.css */

/* a linked object name inside a sentence-style page title */
.page-title-md a.title-inline { color: var(--ink); }
.page-title-md a.title-inline:hover { color: var(--accent); text-decoration: none; }
.page-title-md.file-title { font-size: 26px; word-break: break-all; }

/* long hashes / checksums wrap instead of overflowing the rail */

/* rpm NVR cells produced by util.formatRPM (a link) */
.rows td.rpm-nvr a { color: var(--ink); font-weight: 500; }
.rows td.rpm-nvr a:hover { color: var(--accent); }

/* dependencies: one disclosure per type, empty types as a compact line */
.deps { display: flex; flex-direction: column; padding: 0 24px 12px; }
.dep-group { border-top: 1px solid var(--line-soft); }
.dep-group:first-child { border-top: 0; }
.dep-group > summary, .dep-group.dep-empty {
  display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 13.5px;
}
.dep-group > summary { cursor: pointer; list-style: none; }
.dep-group > summary::-webkit-details-marker { display: none; }
.dep-group > summary::before {
  content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint);
  transform: rotate(-45deg); transition: transform .15s ease; margin: 0 4px 0 2px;
}
.dep-group[open] > summary::before { transform: rotate(45deg); }
.dep-group.dep-empty { padding-left: 19px; }
.dep-name { font-weight: 600; color: var(--ink-2); min-width: 96px; }
.dep-count {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px;
  background: var(--sunken); color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.dep-list {
  list-style: none; margin: 0 0 12px; padding: 4px 0 0 19px;
  columns: 2 320px; column-gap: 28px;
  font: 12.5px/1.8 var(--font-mono); color: var(--ink-2);
  font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0;
}
.dep-list li { break-inside: avoid; word-break: break-all; }

/* ---------- pages: repos, buildroots, api, error, sessions ---------- */
/* group "repos" (repoinfo, buildroots, buildrootinfo(_cg), externalrepoinfo, api, error,
   activesession, notificationedit) — to be merged into studio.css */

/* rail list of links with a quiet caption (buildroot contents, tags using an ext repo) */
.link-list { list-style: none; margin: 0; padding: 0 24px 14px; }
.link-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.link-list li:first-child { border-top: 0; }
.link-list .sub { font-size: 12px; text-align: right; }
.card-empty { margin: 0; padding: 4px 24px 18px; color: var(--muted); font-size: 13.5px; }
.repo-note { margin: 0; padding: 0 24px 16px; }
.br-extra { margin: 0; padding: 0 24px 20px; font: 12.5px/1.6 var(--font-mono); color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.ext-url { word-break: break-all; }

/* API reference */
.api-detail { grid-template-columns: minmax(0, 1fr) 380px; }
.api-filter { display: flex; align-items: center; gap: 10px; }
.api-filter input {
  width: 220px; height: 34px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface);
  padding: 0 12px; font: 13px var(--font-body); color: var(--ink);
}
.api-filter input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.api-letters { border-top: 1px solid var(--line-soft); gap: 0; }
.api-letters a, .api-letters .off { min-width: 23px; }
.api-letters .off { height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; color: #C9C0B2; }
.api-letters a.dim { color: #C9C0B2; }
.api-methods { padding: 0 24px 16px; }
.api-letter { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--accent); margin: 18px 0 4px; scroll-margin-top: 16px; }
.api-group { list-style: none; margin: 0; padding: 0; }
.api-method { padding: 12px 0; border-top: 1px solid var(--line-soft); scroll-margin-top: 16px; }
.api-group .api-method:first-child { border-top: 0; }
.api-sig { display: block; font: 13px/1.5 var(--font-mono); color: var(--muted); word-break: break-word; }
.api-sig b { color: var(--ink); font-weight: 600; }
.api-doc { margin: 6px 0 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; font: 12.5px/1.55 var(--font-mono); color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.api-intro p { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); margin: 0 0 10px; }
.api-rail-title { padding: 0 0 10px; }
.api-sample { margin: 0; padding: 12px 14px; background: #1F1B16; color: #EDE6DA; border-radius: 10px; font: 12px/1.6 var(--font-mono); white-space: pre-wrap; word-break: break-all; }

/* error page */
.error-main { display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; }
.error-explanation { line-height: 1.6; }
.error-links { display: flex; gap: 18px; font-size: 13px; }
.error-tb { margin: 0; padding: 0 24px 20px; font: 12.5px/1.6 var(--font-mono); color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }

@media (max-width: 1100px) {
  .api-detail { grid-template-columns: minmax(0, 1fr); }
  .api-filter input { width: 160px; }
}

/* ---------- pages: summary ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-top: 4px; flex-wrap: wrap; }
.page-head-left { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; }
.page-title { font-size: 44px; letter-spacing: -0.02em; line-height: 1; }
.page-meta { font-size: 13px; color: var(--muted); }

.progress-card { display: grid; grid-template-columns: minmax(0, 1fr); }
.progress-main { padding: 22px 26px 18px; display: flex; flex-direction: column; gap: 12px; }
.progress-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.progress-tools { display: flex; align-items: center; gap: 14px; }
.progress-figures { display: flex; gap: 40px; align-items: flex-end; flex-wrap: wrap; }
.fig-big { font-family: var(--font-display); font-size: 60px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--accent); }
.fig-big small { font-size: 30px; }
.fig { display: flex; flex-direction: column; gap: 2px; }
.fig-label { font-size: 12px; color: var(--muted); }
.fig-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.fig-value.bad { color: var(--danger); }
.fig-caption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.progress-side { border-left: 1px solid var(--chart-grid); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.release-row { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; color: var(--ink); border-top: 1px solid var(--chart-grid); }
.release-row:first-of-type { border-top: 0; }
.release-row:hover { text-decoration: none; color: var(--ink); }
.release-row .top { display: flex; justify-content: space-between; align-items: baseline; }
.release-row .pct { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.bar { height: 5px; border-radius: 3px; background: var(--chart-grid); overflow: hidden; display: flex; }
.bar > span { background: var(--accent); }
.release-row .meta { font-size: 12px; color: var(--muted); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font-body); fill: var(--faint); }

.summary-grid { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 24px; }
.now-list { display: flex; flex-direction: column; }
.now-row { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line-soft); color: var(--ink); }
.now-row:first-child { border-top: 0; }
.now-row:hover { text-decoration: none; color: var(--ink); }
.now-row .k { color: var(--ink-2); font-size: 13px; }
.now-row .v { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.now-row .v.warn { color: var(--warn); }
.now-row .s { font-size: 13px; color: var(--muted); }

.week-card { padding: 20px 26px 16px; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; }
.week-total { font-family: var(--font-display); font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.week-total small { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.legend-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) 60px; align-items: center; gap: 10px; height: 32px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--ink); }
.legend-row:first-child { border-top: 0; }
.legend-row:hover { text-decoration: none; color: var(--ink); }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend-row .n { text-align: right; font-weight: 600; }
.sw-closed { background: var(--accent); }
.sw-failed { background: var(--danger); }
.sw-canceled { background: #9C9488; }
.sw-active { background: var(--chart-other); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-7-5 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; }

/* ---------- legacy: pages still on upstream markup ---------- */
.content.legacy { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; display: block; }
.content.legacy h4, .content.legacy .pageHeader { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 0 0 16px; }
.content.legacy .dataHeader { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 20px 0 8px; }
.content.legacy table { border-collapse: collapse; }
.content.legacy table.data-list { width: 100%; }
.content.legacy table.data-list td, .content.legacy table.data-list th { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.content.legacy table.data-list tr.list-header th, .content.legacy table.data-list tr.list-header td {
  background: var(--surface-2); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600;
}
.content.legacy table.data-list td.paginate { background: transparent; color: var(--muted); font-size: 12.5px; }
.content.legacy > table:not(.data-list) th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 16px 6px 0; vertical-align: top; white-space: nowrap; }
.content.legacy > table:not(.data-list) td { padding: 6px 0; vertical-align: top; }
.content.legacy img.stateimg { vertical-align: middle; }
.content.legacy pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; }
.content.legacy input[type=text], .content.legacy select, .content.legacy textarea {
  border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); padding: 4px 8px; font: 13px var(--font-body);
}
.content.legacy input[type=submit], .content.legacy button {
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); padding: 5px 12px; font: 500 13px var(--font-body); cursor: pointer;
}
.content.legacy .taskfree { color: var(--ink-2); }
.content.legacy .taskopen, .content.legacy .taskassigned { color: var(--warn); }
.content.legacy .taskclosed { color: var(--accent); }
.content.legacy .taskfailed { color: var(--danger); }
.content.legacy .taskcanceled { color: var(--muted); }

/* ---------- task log dialog ---------- */
/* Site-wide task quick view (static/js/tasklog.js): native <dialog>, meta + children + live log. */
.taskdialog {
  width: min(1120px, calc(100vw - 48px)); max-width: none; max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(40, 25, 10, .22);
  overflow: hidden;
}
.taskdialog::backdrop { background: rgba(34, 30, 25, .42); }
.taskdialog[open] { animation: studio-pop var(--t-med) var(--ease-out) both; }
.taskdialog[open]::backdrop { animation: studio-fade var(--t-med) ease both; }
.taskdialog-inner { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.taskdialog-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--line-soft);
}
.taskdialog-titles { min-width: 0; }
.taskdialog-titles .h2 { word-break: break-word; }
.taskdialog-titles .page-sub { margin-top: 4px; }
.taskdialog-trail { flex-wrap: wrap; align-items: center; }
.taskdialog-crumb { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.taskdialog-crumb:hover { text-decoration: underline; }
.taskdialog-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; padding: 18px 24px 24px; overflow: auto; }
.taskdialog-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.taskdialog-meta { padding: 0; }
.taskdialog-meta > dd { font-size: 13px; }
.taskdialog-kids-title { margin: 10px 0 2px; }
.taskdialog-kids { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; }
.taskdialog-kid {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px;
  border: 0; border-radius: 8px; background: transparent; font: 13px var(--font-body); color: var(--ink-2); cursor: pointer;
}
.taskdialog-kid:hover, .taskdialog-kid:focus-visible { background: var(--hover); color: var(--ink); }
.taskdialog-none { font-size: 13px; color: var(--muted); padding: 4px 0; }
.taskdialog-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.taskdialog .logpanel pre { max-height: min(52vh, 560px); min-height: 220px; }
/* the .logpanel pre `font` shorthand resets ligature settings: logs must show '<=' as typed */
.logpanel pre { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
@media (max-width: 820px) {
  .taskdialog-body { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- motion (restrained; everything off under prefers-reduced-motion) ---------- */
:root { --ease-out: cubic-bezier(.2, .7, .2, 1); --t-fast: 140ms; --t-med: 220ms; }
@keyframes studio-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes studio-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes studio-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes studio-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes studio-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.content { animation: studio-enter var(--t-med) var(--ease-out) both; }
a, .btn, .mainnav a, .pagetab, .pagetab > a, .pagetab-icon, .pagetab-close, .segmented button,
.letters a, .altsearch-menu button, .rows td, .release-row, .now-row, .legend-row {
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.altsearch-menu:not([hidden]) { animation: studio-pop var(--t-fast) var(--ease-out) both; transform-origin: top right; }
details[open] > :not(summary) { animation: studio-fade var(--t-med) ease both; }
.pagetab.is-leaving { opacity: 0; transform: translateY(4px); transition: opacity var(--t-fast) ease, transform var(--t-fast) ease; }
a.card:hover, .card.card-link:hover { box-shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 12px 32px rgba(60, 40, 20, .09); transform: translateY(-1px); }
a.card, .card.card-link { transition: box-shadow var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out); }
.chart .draw { stroke-dasharray: 1; animation: studio-draw 900ms var(--ease-out) both; }
.chart .grow { transform-box: fill-box; transform-origin: bottom; animation: studio-grow 520ms var(--ease-out) both; animation-delay: var(--delay, 0ms); }
.chart .fade { animation: studio-fade 600ms ease both; animation-delay: var(--delay, 0ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- narrow screens ---------- */
@media (max-width: 1100px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .summary-grid, .grid-2, .grid-7-5 { grid-template-columns: minmax(0, 1fr); }
  .progress-card, .week-card { grid-template-columns: minmax(0, 1fr); }
  .progress-side { border-left: 0; border-top: 1px solid var(--chart-grid); border-radius: 0 0 var(--radius) var(--radius); }
}
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar { position: static; width: auto; height: auto; padding: 16px; gap: 12px; }
  .mainnav { flex-direction: row; gap: 12px; overflow-x: auto; }
  .mainnav ul { flex-direction: row; }
  .navlabel, .mainnav svg, .sidebar-foot { display: none; }
  .main { padding: 16px; }
  .search-field input { width: 150px; }
  .page-title { font-size: 34px; }
}
