:root {
  color-scheme: light;
  --bg: #f9fafb;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --indigo: #4f46e5;
  --indigo-dark: #4338ca;
  --indigo-soft: #eef2ff;
  --indigo-text: #4338ca;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --fail: #b91c1c;
  --fail-bg: #fef2f2;
  --pending: #1d4ed8;
  --pending-bg: #eff6ff;
  --skipped: #6b7280;
  --nav: 16rem;
  --sub: 15rem;
  --bar: 3.25rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 15px/1.5 Roboto, "Segoe UI", sans-serif;
}

body.shell { min-height: 100dvh; }

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

.topbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--bar);
  padding: 0 max(0.75rem, env(safe-area-inset-right)) 0 max(0.75rem, env(safe-area-inset-left));
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.menu-button, .drawer-close {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 0.7rem;
  border-radius: 0.65rem;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

.menu-button svg, .drawer-close svg { width: 1.15rem; height: 1.15rem; flex: none; }
.menu-button:hover, .drawer-close:hover { background: #f3f4f6; text-decoration: none; }

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(17, 24, 39, 0.45);
}

#nav-open:checked ~ .scrim { display: block; }
#nav-open:checked ~ .nav { visibility: visible; transform: none; }
body:has(#nav-open:checked) { overflow: hidden; }

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

.nav, .subnav { background: #fff; }

.nav {
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 50;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(18.5rem, calc(100vw - 3rem));
  visibility: hidden;
  transform: translateX(-105%);
  transition: transform 160ms ease;
  border-right: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

body.guest .nav, body.guest .menu-button { display: none; }

.subnav {
  display: flex;
  gap: 0.15rem;
  position: sticky;
  top: var(--bar);
  z-index: 25;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0.35rem max(0.65rem, env(safe-area-inset-right)) 0.35rem max(0.65rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}

.subnav .subnav-title { display: none; }
.subnav .nav-link { width: auto; flex: 0 0 auto; scroll-snap-align: start; }
.subnav { scroll-snap-type: x proximity; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: 4rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: var(--indigo);
  color: #fff;
  flex: none;
}

.brand-mark svg { width: 1.15rem; height: 1.15rem; }
.brand-name { font-size: 1.05rem; font-weight: 700; }

.nav-scroll { padding: 0.75rem; overflow: auto; flex: 1; }
.nav-caption, .subnav-title {
  margin: 0.85rem 0.65rem 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.subnav-title { margin-top: 0.35rem; font-size: 0.95rem; letter-spacing: 0; text-transform: none; color: var(--text); }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.12rem 0;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: #374151;
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  width: 100%;
  cursor: pointer;
}

.nav-link:hover { background: #f3f4f6; color: #111827; text-decoration: none; }
.nav-link span { min-width: 0; overflow-wrap: anywhere; }
.nav-link.is-active { background: var(--indigo-soft); color: var(--indigo-text); }
.nav-link.is-empty { color: #b8bec8; }
.nav-link.is-empty:hover { background: #f9fafb; color: #9ca3af; }
.nav-link.is-empty.is-active { background: #f3f4f6; color: #9ca3af; }
.nav-count {
  margin-left: auto;
  flex: none;
  min-width: 1.15rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}
.nav-link.is-active .nav-count { background: #fff; color: var(--indigo-text); }
.nav-link.is-empty .nav-count,
.nav-link.is-empty.is-active .nav-count { background: transparent; color: inherit; font-weight: 500; }
.nav-logout { color: var(--fail); }
.nav-logout:hover { background: var(--fail-bg); color: var(--fail); }
.nav-foot { border-top: 1px solid var(--line); padding: 0.75rem; }
.nav-logout-form { margin: 0; }
.icon { width: 1rem; height: 1rem; flex: none; }

.workspace {
  min-width: 0;
  padding: 1rem max(0.9rem, env(safe-area-inset-right)) 2rem max(0.9rem, env(safe-area-inset-left));
}
body.guest .workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--bar));
  padding: 1.25rem 1rem 2rem;
}

.login-card {
  width: min(100%, 28rem);
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.08);
  padding: 2rem 1.75rem 1.6rem;
}

.login-card h1 { margin: 0 0 1.2rem; text-align: center; font-size: 1.45rem; }
.login-card input[type="submit"] { width: 100%; margin-top: 0.35rem; }

.flash {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #312e81;
  border-radius: 0.75rem;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1rem;
}
.flash.alert { background: var(--fail-bg); border-color: #fecaca; color: #7f1d1d; }
.banner {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #312e81;
  border-radius: 0.75rem;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1rem;
}
.dot { width: 0.45rem; height: 0.45rem; border-radius: 999px; background: #9ca3af; flex: none; }
.dot-ok { background: #16a34a; }
.dot-off { background: #d97706; }

.page-head, .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.page-head { margin-bottom: 1rem; }
.page-head > div, .row > div { min-width: 0; flex: 1 1 14rem; }
.page-head > .button, .page-head > .button_to, .row > .button, .row > .button_to { flex: 0 0 auto; }
.row > h1, .row > h2 { margin: 0; flex: 1 1 auto; }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 0.35rem; overflow-wrap: anywhere; }
h2 { font-size: 1.05rem; margin: 0 0 0.7rem; }
.muted { color: var(--muted); }
section { margin: 0 0 1.4rem; }
.card, table, form.stack, .login-card form.stack {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}
.login-card form.stack { border: 0; padding: 0; box-shadow: none; }
.card { padding: 0.95rem 1rem; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; margin-bottom: 1.2rem; }
.stat-label { display: block; color: var(--muted); font-size: 0.82rem; }
.stat-value { display: block; margin-top: 0.2rem; font-size: 1.35rem; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; vertical-align: middle; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: #f9fafb; }
tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); margin-top: 0.15rem; }

.status {
  display: inline-block;
  min-width: 4.8rem;
  text-align: center;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: #4b5563;
}
.status-ok { background: #16a34a; }
.status-warn, .status-offline { background: #d97706; }
.status-fail { background: #dc2626; }
.status-pending, .status-running, .status-queued { background: #2563eb; }
.status-skipped, .status-finished { background: #4b5563; }

button, .button, input[type="submit"] {
  background: var(--indigo);
  color: #fff;
  border: 0;
  border-radius: 0.65rem;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .button:hover, input[type="submit"]:hover { background: var(--indigo-dark); }
td.actions { white-space: nowrap; width: 1%; text-align: right; }
td.actions form { display: inline; margin: 0; }
td.actions a, td.actions form { margin-right: 0.85rem; }
table button, td.actions button {
  background: transparent;
  color: var(--fail);
  padding: 0;
  font-weight: 500;
}
table button:hover, td.actions button:hover { background: transparent; text-decoration: underline; }
table button.button, td.actions button.button {
  background: var(--indigo);
  color: #fff;
  padding: 0.28rem 0.6rem;
  font-size: 0.82rem;
}
table button.button:hover, td.actions button.button:hover { background: var(--indigo-dark); color: #fff; text-decoration: none; }
.nav button.nav-link { display: flex; color: var(--fail); padding: 0.48rem 0.7rem; font-weight: 500; }
.nav button.nav-link:hover { background: var(--fail-bg); text-decoration: none; }

form.stack { display: grid; gap: 0.85rem; width: 100%; max-width: 40rem; padding: 1rem 1.05rem; }
label { display: grid; gap: 0.3rem; font-size: 0.92rem; font-weight: 500; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="url"], select {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d1d5db;
  border-radius: 0.65rem;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus { outline: 2px solid #c7d2fe; border-color: var(--indigo); }
label.checks,
label:has(> input[type="checkbox"]) {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.45rem;
  font-weight: 400;
}
label.checks input[type="hidden"],
label:has(> input[type="checkbox"]) input[type="hidden"] { display: none; }
label.checks input[type="checkbox"],
label:has(> input[type="checkbox"]) input[type="checkbox"] {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin: 0.15rem 0 0;
}
.checks { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
fieldset { border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.7rem 0.85rem; }
legend { padding: 0 0.3rem; color: var(--muted); }
.errors { color: var(--fail); margin: 0; padding-left: 1.1rem; }
code { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 0.92em; }
td.nested { padding-left: 1.5rem; color: var(--muted); }
.shot-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.shot { display: block; width: 148px; height: 84px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 0.45rem; background: #f3f4f6; }
.shot-meta { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.75rem; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 0.8rem; }
.search { display: flex; gap: 0.5rem; align-items: center; margin: 0 0 1rem; }
.search input[type="text"] { flex: 1; }
.search input[type="submit"] { flex: none; width: auto; }
.agent-line { display: flex; flex-wrap: wrap; gap: 0.4rem 0.65rem; align-items: center; }
.agent-chip { display: inline-flex; align-items: center; gap: 0.35rem; }
.drawer-close { margin: 0.4rem 0.65rem 0; align-self: flex-start; }
.table-scroll { width: 100%; max-width: 100%; }
td, .muted { overflow-wrap: anywhere; }

.workspace table {
  display: block;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.workspace thead { display: none; }
.workspace tbody { display: block; }
.workspace tr {
  display: block;
  margin: 0 0 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}
.workspace td {
  display: block;
  width: auto;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.workspace tr:last-child td { border-bottom: 1px solid var(--line); }
.workspace tr td:last-child { border-bottom: 0; }
.workspace td::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.workspace td:not([data-label])::before,
.workspace td[data-label=""]::before { content: none; }
.workspace td.actions { white-space: normal; }
.workspace td.actions a, .workspace td.actions button { min-height: 2.5rem; }
.company-card { display: block; padding: 1rem; color: inherit; text-decoration: none; }
.company-card:hover { border-color: #c7d2fe; text-decoration: none; }
.company-card strong { display: block; margin-bottom: 0.25rem; }

.menu-button:focus-visible, .drawer-close:focus-visible, .nav-link:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

@media (min-width: 800px) {
  h1 { font-size: 1.55rem; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .workspace { padding: 1.25rem 1.25rem 2.5rem; overflow-x: auto; }
  .workspace table {
    display: table;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
  }
  .workspace thead { display: table-header-group; }
  .workspace tbody { display: table-row-group; }
  .workspace tr {
    display: table-row;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  .workspace td { display: table-cell; border-bottom: 1px solid var(--line); }
  .workspace tr:last-child td { border-bottom: 0; }
  .workspace td::before { content: none; }
  .workspace td.actions { white-space: nowrap; width: 1%; }
  .workspace td.actions a, .workspace td.actions button { min-height: 0; }
}

@media (min-width: 72rem) {
  .drawer-toggle, .topbar, .scrim, .drawer-close { display: none; }
  body:has(#nav-open:checked) { overflow: visible; }
  body.shell {
    display: grid;
    grid-template-columns: var(--nav) var(--sub) minmax(0, 1fr);
  }
  body.guest { grid-template-columns: var(--nav) minmax(0, 1fr); }
  body.guest .nav { display: flex; }
  .nav, .subnav { border-right: 1px solid var(--line); }
  .nav {
    position: sticky;
    top: 0;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    height: 100vh;
    visibility: visible;
    transform: none;
  }
  .subnav {
    display: block;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    padding: 0.85rem 0.75rem;
    border-bottom: 0;
  }
  .subnav .subnav-title { display: block; }
  .subnav .nav-link, .nav-link { width: 100%; min-height: 0; padding: 0.48rem 0.7rem; }
  .workspace { padding: 1.5rem 1.75rem 2.5rem; }
  body.guest .workspace { min-height: 100vh; padding: 2rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .nav { transition: none; }
}

.page-head > .page-tools {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.view-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  overflow: hidden;
  background: #fff;
}

.view-switch-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.35rem 0.75rem;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.view-switch-link:hover { background: #f3f4f6; color: var(--text); text-decoration: none; }
.view-switch-link.is-active { background: var(--indigo-soft); color: var(--indigo-text); }
.view-switch-link.is-active:hover { background: var(--indigo-soft); color: var(--indigo-text); }
.view-switch-link:focus-visible { outline: 2px solid var(--indigo); outline-offset: -2px; }

.catalog-identity small { display: block; color: var(--muted); margin-top: 0.12rem; }
.catalog-title { font-weight: 700; }
.catalog-shot { margin-top: 0.55rem; }

.readings { display: flex; flex-direction: column; }
.reading {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  align-items: center;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}
.reading:first-child { border-top: 0; padding-top: 0; }
.reading:last-child { padding-bottom: 0; }
.reading-main { display: flex; flex-wrap: wrap; gap: 0.3rem 0.45rem; align-items: center; min-width: 0; }
.reading-label { color: #374151; font-size: 0.86rem; font-weight: 500; }
.reading-time {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.reading-detail { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 0.85rem; }
.reading-empty { margin: 0; }

.reading-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
}
.mini-card {
  flex: 1 1 9.5rem;
  min-width: 9.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.55rem 0.7rem 0.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-top-width: 3px;
  border-radius: 0.7rem;
}
.mini-card.tone-ok { border-top-color: #16a34a; }
.mini-card.tone-warn,
.mini-card.tone-offline { border-top-color: #d97706; }
.mini-card.tone-fail { border-top-color: #dc2626; }
.mini-card.tone-pending,
.mini-card.tone-running,
.mini-card.tone-queued { border-top-color: #2563eb; }
.mini-card.tone-none,
.mini-card.tone-skipped { border-top-color: #9ca3af; }
.mini-card-status { display: flex; flex-wrap: wrap; gap: 0.3rem 0.45rem; align-items: center; }
.mini-card-label { font-size: 0.92rem; }
.mini-card .reading-detail { flex-basis: auto; }

.catalog-actions { display: flex; flex-wrap: wrap; gap: 0.15rem 0.85rem; align-items: center; }
.catalog-actions form, .catalog-action-form { display: inline; margin: 0; }
.catalog-actions a, .catalog-actions button {
  background: transparent;
  color: var(--indigo);
  padding: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 500;
}
.catalog-actions button { color: var(--fail); cursor: pointer; }
.catalog-actions a:hover, .catalog-actions button:hover { background: transparent; text-decoration: underline; }
.catalog-actions a.button, .catalog-actions button.button {
  background: var(--indigo);
  color: #fff;
  padding: 0.28rem 0.6rem;
  border-radius: 0.65rem;
  font-size: 0.82rem;
}
.catalog-actions a.button:hover, .catalog-actions button.button:hover {
  background: var(--indigo-dark);
  color: #fff;
  text-decoration: none;
}

.catalog-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 23rem), 1fr));
  gap: 0.75rem;
}
.resource-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.95rem 1rem 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 0.85rem;
}
.resource-card.tone-ok { border-left-color: #16a34a; }
.resource-card.tone-warn,
.resource-card.tone-offline { border-left-color: #d97706; }
.resource-card.tone-fail { border-left-color: #dc2626; }
.resource-card.tone-pending,
.resource-card.tone-running,
.resource-card.tone-queued { border-left-color: #2563eb; }
.resource-card.tone-none,
.resource-card.tone-skipped { border-left-color: #9ca3af; }
.workspace table.catalog-table .catalog-actions { flex-wrap: nowrap; }
.catalog-actions-wrap {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}

.workspace table.catalog-table {
  display: table;
  width: 100%;
  min-width: 46rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}
.workspace table.catalog-table thead { display: table-header-group; }
.workspace table.catalog-table tbody { display: table-row-group; }
.workspace table.catalog-table tr {
  display: table-row;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.workspace table.catalog-table td,
.workspace table.catalog-table th { display: table-cell; }
.workspace table.catalog-table td { border-bottom: 1px solid var(--line); }
.workspace table.catalog-table tr:last-child td { border-bottom: 0; }
.workspace table.catalog-table td::before { content: none; display: none; }
.workspace table.catalog-table tr.tone-fail td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.workspace table.catalog-table tr.tone-warn td:first-child,
.workspace table.catalog-table tr.tone-offline td:first-child { box-shadow: inset 3px 0 0 #d97706; }
.workspace table.catalog-table tr.tone-ok td:first-child { box-shadow: inset 3px 0 0 #16a34a; }
.workspace table.catalog-table tr.tone-pending td:first-child,
.workspace table.catalog-table tr.tone-running td:first-child,
.workspace table.catalog-table tr.tone-queued td:first-child { box-shadow: inset 3px 0 0 #2563eb; }
.table-scroll:has(.catalog-table) { overflow-x: auto; }

.nav-user {
  margin: 0 0.7rem 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.crumbs { margin: 0 0 0.85rem; }
.crumbs a { font-weight: 500; }

.progress {
  height: 0.45rem;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--indigo);
}
.progress-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.progress-line .progress { flex: 1; }
.progress-line strong { font-variant-numeric: tabular-nums; min-width: 2.6rem; text-align: right; }

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.tag-free { background: var(--ok-bg); color: var(--ok); }
.tag-paid { background: var(--warn-bg); color: var(--warn); }
.tag-personal { background: var(--indigo-soft); color: var(--indigo-text); }
.page-tools .button_to { margin: 0; }
.tag-role { background: var(--indigo-soft); color: var(--indigo-text); margin: 0 0.25rem 0.25rem 0; }
.kind-text { background: var(--indigo-soft); color: var(--indigo-text); }
.kind-audio { background: var(--pending-bg); color: var(--pending); }
.kind-video { background: var(--warn-bg); color: var(--warn); }

.gap-list { display: grid; gap: 0.75rem; }
.gap-card { border-color: #fcd34d; background: var(--warn-bg); }
.gap-card p { margin: 0.35rem 0 0.7rem; }
.material-links { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.material-links .button { margin: 0; }
.media-frame { width: min(100%, 40rem); background: #111827; border-radius: 0.75rem; overflow: hidden; }
.media-frame video { display: block; width: 100%; height: auto; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.section-head h2 { margin: 0; }

.program-card { display: flex; flex-direction: column; gap: 0.55rem; color: inherit; }
.program-card .button,
.program-card form.button_to { align-self: flex-start; margin: 0; }
.program-card > .card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: auto;
}
.catalog-grid .program-card > p { margin: 0; }

.badge-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.badge-chip {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 11rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
}
.badge-chip.is-earned { border-color: #a7f3d0; background: var(--ok-bg); }
.badge-chip strong { font-size: 0.92rem; }

.question { margin: 0 0 1rem; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.35rem 0;
  font-weight: 400;
}
.choice input { margin-top: 0.25rem; }

.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 0.45rem; }
.inline-form input[type="text"], .inline-form select { width: auto; min-width: min(100%, 14rem); flex: 1; }

textarea {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d1d5db;
  border-radius: 0.65rem;
  background: #fff;
  color: var(--text);
  min-height: 6rem;
}
textarea:focus { outline: 2px solid #c7d2fe; border-color: var(--indigo); }

.demo-logins { margin-top: 1.1rem; }
.demo-logins li { margin: 0.15rem 0; }

.stack-gap { display: grid; gap: 0.75rem; }
.person-block { margin: 0 0 1rem; }
.person-block h2 { margin-bottom: 0.45rem; }

.workspace table.children-table {
  display: table;
  width: 100%;
  min-width: 46rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}
.workspace table.children-table thead { display: table-header-group; }
.workspace table.children-table tbody { display: table-row-group; }
.workspace table.children-table tr {
  display: table-row;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.workspace table.children-table th,
.workspace table.children-table td { display: table-cell; }
.workspace table.children-table td { border-bottom: 1px solid var(--line); }
.workspace table.children-table tr:last-child td { border-bottom: 0; }
.workspace table.children-table td::before { content: none; display: none; }
.workspace table.children-table td.child-cell {
  vertical-align: top;
  width: 13rem;
  background: #f9fafb;
}
.workspace table.children-table td.progress-cell { width: 11rem; }
.workspace table.children-table .progress-line { min-width: 0; }
.table-scroll:has(.children-table) { overflow-x: auto; }

.child-groups { display: grid; gap: 1.35rem; }
.child-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.6rem;
}
.child-group-head h2 { margin: 0; }
.hcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 32rem), 1fr));
  gap: 0.7rem;
}
.hcard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9.5rem;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
  min-width: 0;
}
.hcard-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}
.hcard-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
}
.hcard-title { font-weight: 700; overflow-wrap: anywhere; }
.hcard-now { font-size: 0.86rem; }
.hcard .progress-line { min-width: 0; width: 100%; }

@media (max-width: 36rem) {
  .hcard { grid-template-columns: 1fr; }
}
