/* Private operator console (/admin). Standalone: it never loads or changes the
   public site styles. Mobile-first; the bottom tab bar becomes a sidebar on
   wide screens. Zero JavaScript — disclosure uses native <details>. */

.credential-horizons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.credential-filters label {
  display: grid;
  gap: 6px;
}

.credential-filters .form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

[aria-label="Studio sections"] [aria-current="page"],
.tracker-nav [aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.credential-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.credential-table table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.credential-table th,
.credential-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  min-width: 90px;
}

.credential-table thead {
  background: var(--surface-2);
}

.credential-record {
  overflow-wrap: anywhere;
}

:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111114;
  --surface-2: #17171b;
  --surface-3: #1f1f24;
  --line: #24242a;
  --line-strong: #33333b;
  --text: #ededf0;
  --text-2: #a5a5ae;
  --text-3: #92929c;
  --accent: #93a4ff;
  --accent-strong: #b4c0ff;
  --accent-ink: #0b0e1f;
  --accent-soft: rgb(147 164 255 / 0.13);
  --ok: #5fd99a;
  --ok-soft: rgb(95 217 154 / 0.12);
  --warn: #f2c25b;
  --warn-soft: rgb(242 194 91 / 0.12);
  --bad: #f78b8b;
  --bad-soft: rgb(247 139 139 / 0.12);
  --info: #6cb6ff;
  --info-soft: rgb(108 182 255 / 0.12);
  --muted-soft: rgb(165 165 174 / 0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --appbar-h: 56px;
  --tabbar-h: 64px;
  --gutter: 16px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui,
    sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 620;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.86em;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

svg.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  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: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* ---------------------------------------------------------------- shell */

.shell {
  min-height: 100dvh;
}

/* Resets live in :where() so spacing utilities and owl selectors always win. */
:where(.form, .kv, .facts, .job-meta, fieldset) {
  margin: 0;
}

.frame {
  min-width: 0;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: calc(var(--appbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0
    max(var(--gutter), env(safe-area-inset-left));
  background: rgb(9 9 11 / 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.appbar-title {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 640;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font: 700 11px/1 var(--mono);
  flex: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.appbar .back {
  margin: 0 0 0 -10px;
  color: var(--text);
}

.appbar form {
  margin: 0;
  display: flex;
}

.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom)
    max(4px, env(safe-area-inset-left));
  background: rgb(14 14 17 / 0.92);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--line);
}

.tabbar-brand,
.tabbar-foot {
  display: none;
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tabbar-h);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.01em;
}

.tab svg.icon {
  width: 22px;
  height: 22px;
}

.tab:hover {
  color: var(--text-2);
}

.tab[aria-current="page"] {
  color: var(--text);
}

.tab[aria-current="page"] svg.icon {
  color: var(--accent);
}

.tab-count {
  position: absolute;
  top: 9px;
  left: calc(50% + 6px);
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 10px/17px var(--sans);
  text-align: center;
}

.page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px max(var(--gutter), env(safe-area-inset-right))
    calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 32px)
    max(var(--gutter), env(safe-area-inset-left));
}

.page > * + * {
  margin-top: 20px;
}

/* Career overview: native disclosures and SVG keep summaries usable without scripts. */
.queue-intro,
.queue-note {
  margin: 10px 0;
}
.queue-group + .queue-group {
  margin-top: 12px;
}
.queue-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.queue-item {
  display: grid;
  gap: 14px;
  padding: 16px 0;
  overflow-wrap: anywhere;
}
.queue-item + .queue-item {
  border-top: 1px solid var(--line);
}
.queue-item .job-title a::after {
  content: none;
}
.queue-request {
  display: flex;
  align-items: start;
  gap: 16px;
  justify-content: space-between;
}
.queue-request form,
.queue-actions {
  flex: 0 0 auto;
}
.queue-actions {
  display: flex;
  gap: 6px;
}
.queue-detail {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  width: fit-content;
}
.career-charts {
  display: grid;
  gap: 20px;
  align-items: start;
}
.career-charts .card > * + * {
  margin-top: 16px;
}
.status-chart {
  padding: 0;
  list-style: none;
}
.status-chart a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 16px;
  min-height: 52px;
  padding: 7px 0;
  color: var(--text);
  text-decoration: none;
}
.status-chart a:hover {
  color: var(--accent-strong);
}
.status-chart svg {
  grid-column: 1 / -1;
  width: 100%;
  height: 6px;
}
.chart-track {
  fill: var(--surface-3);
}
.status-bar {
  fill: var(--accent);
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  list-style: none;
  padding: 0;
}
.chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chart-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.outcome-open {
  fill: var(--ok);
  background: var(--ok);
}
.outcome-closed {
  fill: var(--bad);
  background: var(--bad);
}
.outcome-passed {
  fill: var(--accent);
  background: var(--accent);
}
.outcome-aged_out {
  fill: var(--text-2);
  background: var(--text-2);
}
.chart-scroll,
.chart-data .table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.submission-chart {
  width: 100%;
  min-width: 560px;
  display: block;
}
.chart-axis {
  fill: var(--text-2);
  font: 12px var(--sans);
}
.chart-gridline {
  stroke: var(--line);
  stroke-dasharray: 3 4;
}
.chart-baseline {
  stroke: var(--line-strong);
}
.chart-hit {
  fill: transparent;
}
.submission-chart g:focus .chart-hit,
.submission-chart g:hover .chart-hit {
  stroke: var(--accent-strong);
  stroke-width: 1;
}
.chart-data summary {
  cursor: pointer;
  min-height: 44px;
  padding-top: 10px;
  color: var(--accent);
}
.chart-data table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.chart-data :is(th, td) {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
@media (min-width: 1400px) {
  .career-charts {
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.5fr);
  }
}

/* -------------------------------------------------------------- headers */

.page-head {
  display: grid;
  gap: 6px;
}

.page-head h1,
.page-head .title {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.lede {
  color: var(--text-2);
  font-size: 14px;
}

.eyebrow {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: 17px;
}

.section-head .meta {
  color: var(--text-3);
  font-size: 13px;
  white-space: nowrap;
}

section > .section-head:first-child {
  margin-top: 8px;
}

.page > section + section {
  margin-top: 28px;
}

.muted {
  color: var(--text-2);
}

.faint {
  color: var(--text-3);
  font-size: 13px;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.card > * + * {
  margin-top: 12px;
}

.card h2 {
  font-size: 16px;
}

.card > h3 {
  margin-top: 20px;
}

.card h3 {
  font-size: 15px;
}

.card-flush {
  padding: 0;
  overflow: hidden;
}

.card-flush > * + * {
  margin-top: 0;
}

.hero-card {
  background: linear-gradient(160deg, #15172a 0%, var(--surface) 62%);
  border-color: #2a2e4a;
}

.stack {
  display: grid;
  gap: 12px;
}

.stack-sm {
  display: grid;
  gap: 8px;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.split > :first-child {
  min-width: 0;
}

/* -------------------------------------------------------------- metrics */

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

/* Tile layout follows the count so no tile is left alone on a row:
   3 → one row, 4 → 2×2, 5 → 2 + 3 on phones; one row on wider screens. */
.metrics[data-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metrics[data-count="5"] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metrics[data-count="5"] > * {
  grid-column: span 2;
}

.metrics[data-count="5"] > :nth-child(-n + 2) {
  grid-column: span 3;
}

a.metric[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.metric {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  min-width: 0;
}

a.metric:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.metric strong {
  font-size: 24px;
  font-weight: 650;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.metric span {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.3;
}

.metric[data-tone="warn"] strong {
  color: var(--warn);
}

.metric[data-tone="ok"] strong {
  color: var(--ok);
}

.hero-card .metric {
  background: rgb(255 255 255 / 0.03);
}

/* ---------------------------------------------------------------- lists */

.list {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.list > li + li,
.list > .row + .row {
  border-top: 1px solid var(--line);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 12px 14px;
  color: var(--text);
  min-width: 0;
}

a.row:hover,
.row-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.row-main {
  flex: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.row-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  color: var(--text-2);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  color: var(--text-3);
}

.row form {
  margin: 0;
}

.disclosure > .list {
  border: 0;
  border-radius: 0;
}

.list .empty {
  padding: 18px 14px;
}

/* ------------------------------------------------------------------ chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  background: var(--muted-soft);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.chip.plain::before {
  display: none;
}

.chip[data-tone="accent"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.chip[data-tone="ok"] {
  background: var(--ok-soft);
  color: var(--ok);
}

.chip[data-tone="warn"] {
  background: var(--warn-soft);
  color: var(--warn);
}

.chip[data-tone="bad"] {
  background: var(--bad-soft);
  color: var(--bad);
}

.chip[data-tone="info"] {
  background: var(--info-soft);
  color: var(--info);
}

.chip[data-tone="muted"] {
  background: transparent;
  color: var(--text-3);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* ---------------------------------------------------------------- buttons */

.btn,
.page button,
.page input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--text);
  font: 600 14px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover,
.page button:hover {
  background: #26262c;
  border-color: #42424b;
  color: var(--text);
}

.btn-primary,
.page button.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover,
.page button.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--accent-ink);
}

.btn-ghost,
.page button.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn-danger,
.page button.btn-danger {
  background: transparent;
  border-color: rgb(247 139 139 / 0.35);
  color: var(--bad);
}

.btn-danger:hover,
.page button.btn-danger:hover {
  background: var(--bad-soft);
  border-color: var(--bad);
  color: var(--bad);
}

.btn-block {
  width: 100%;
}

.btn-sm,
.page button.btn-sm {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
}

.page button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions form {
  margin: 0;
  display: contents;
}

.actions-fill > *,
.actions-fill form > button {
  flex: 1 1 0;
}

/* ------------------------------------------------------------------ forms */

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 560;
}

.field-hint {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 400;
}

:where(.page) :where(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea) {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: 16px/1.4 var(--sans);
  appearance: none;
  -webkit-appearance: none;
}

:where(.page) textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.55;
}

:where(.page) select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23a5a5ae' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.page input::placeholder,
.page textarea::placeholder {
  color: var(--text-3);
}

.page input:focus,
.page select:focus,
.page textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.page input[type="date"] {
  color-scheme: dark;
  min-width: 0;
  display: block;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.page input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset.field legend {
  margin-bottom: 4px;
  padding: 0;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0 12px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 12px;
}

/* --------------------------------------------------------------- toolbar */

.toolbar {
  position: sticky;
  top: calc(var(--appbar-h) + env(safe-area-inset-top));
  z-index: 10;
  margin-inline: calc(-1 * var(--gutter));
  padding: 10px var(--gutter);
  background: rgb(9 9 11 / 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.toolbar form {
  display: grid;
  gap: 8px;
  margin: 0;
}

.search {
  position: relative;
}

.search svg.icon {
  position: absolute;
  left: 13px;
  top: 50%;
  translate: 0 -50%;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  pointer-events: none;
}

.page .search input {
  padding-left: 40px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.filters label {
  flex: 1 1 130px;
  min-width: 0;
}

.page .filters select {
  width: 100%;
  min-height: 44px;
  padding: 7px 34px 7px 12px;
  border-radius: 99px;
  font-size: 16px;
  background-position: right 12px center;
  flex: none;
}

.page .filters button,
.page .filters .btn {
  min-height: 44px;
  border-radius: 99px;
  flex: none;
}

/* Job list: search stays visible; the rest lives in a dropdown panel. */
.toolbar .search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-row .search {
  flex: 1;
  min-width: 0;
}

.filter-panel > summary.btn {
  min-height: 46px;
  gap: 6px;
}

.filter-panel > summary svg.icon {
  width: 18px;
  height: 18px;
}

.filter-panel[open] > summary.btn {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-panel .count,
.tracker-nav .count {
  background: var(--accent);
  color: var(--accent-ink);
}

.filter-body {
  position: absolute;
  inset: calc(100% + 1px) 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px var(--gutter) 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.5);
}

.filter-body > .span-2 {
  grid-column: 1 / -1;
}

.page .filter-body input[type="date"] {
  min-width: 0;
}

/* ----------------------------------------------------------- disclosure */

details > summary {
  list-style: none;
  cursor: pointer;
}

details > summary::-webkit-details-marker {
  display: none;
}

.disclosure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.disclosure > summary,
.sub-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 16px;
  font-weight: 600;
}

.disclosure > summary:hover {
  background: var(--surface-2);
}

.disclosure > summary::after,
.sub-disclosure > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 1.8px solid var(--text-3);
  border-bottom: 1.8px solid var(--text-3);
  rotate: 45deg;
  translate: 0 -2px;
  transition: rotate 0.15s ease;
  flex: none;
}

.disclosure[open] > summary::after,
.sub-disclosure[open] > summary::after {
  rotate: 225deg;
  translate: 0 2px;
}

.disclosure[open] > summary {
  border-bottom: 1px solid var(--line);
}

.disclosure-body {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.sub-disclosure {
  border-top: 1px solid var(--line);
}

.sub-disclosure > summary {
  min-height: 48px;
  padding: 10px 0;
  color: var(--text-2);
  font-size: 14px;
}

.sub-disclosure[open] > summary {
  color: var(--text);
}

.sub-disclosure > :not(summary) {
  margin-bottom: 14px;
}

summary .icon {
  color: var(--accent);
}

/* ----------------------------------------------------------- key/values */

.kv {
  display: grid;
}

.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.kv > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.kv > div:last-child {
  padding-bottom: 0;
}

.kv dt {
  color: var(--text-2);
  font-size: 13px;
  flex: none;
  max-width: 45%;
}

.kv dd {
  margin: 0;
  text-align: right;
  font-size: 14px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv-stack > div {
  display: grid;
  gap: 2px;
  justify-content: stretch;
}

.kv-stack dd {
  text-align: left;
}

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

.facts > div {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}

.facts dt {
  color: var(--text-3);
  font-size: 12px;
  margin-bottom: 2px;
}

.facts dd {
  margin: 0;
  font-size: 14px;
  font-weight: 560;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------- notices */

.notice {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--info-soft);
  border: 1px solid rgb(108 182 255 / 0.22);
  color: #cfe5ff;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.notice[data-tone="warn"] {
  background: var(--warn-soft);
  border-color: rgb(242 194 91 / 0.25);
  color: #f6dfa9;
}

.notice[data-tone="bad"] {
  background: var(--bad-soft);
  border-color: rgb(247 139 139 / 0.28);
  color: #fbc7c7;
}

.notice[data-tone="ok"] {
  background: var(--ok-soft);
  border-color: rgb(95 217 154 / 0.25);
  color: #bdf0d4;
}

.notice a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.empty {
  display: grid;
  gap: 4px;
  padding: 28px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}

.empty strong,
.empty h3 {
  color: var(--text);
  font-size: 15px;
}

[id] {
  scroll-margin-top: calc(var(--appbar-h) + 16px);
}

/* Section titles sit outside cards so long pages scan as labelled blocks. */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
  font-size: 18px;
  font-weight: 650;
}

.section-title svg.icon {
  width: 28px;
  height: 28px;
  padding: 5px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

section > .faint + .card,
section > .card + .card,
section > .card + .disclosure {
  margin-top: 10px;
}

section > .section-title + .faint {
  margin-bottom: 10px;
}

/* Small caps label that names a block inside a card. */
.subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card > .subhead + * {
  margin-top: 8px;
}

/* ---------------------------------------------------------------- Q & A */

.qa {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.qa:first-child {
  border-top: 0;
  padding-top: 0;
}

.qa h4 {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 560;
  line-height: 1.45;
}

.qa p {
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-line;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 1px;
}

.bullets {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  color: var(--text);
  font-size: 14px;
}

.bullets li::marker {
  color: var(--text-3);
}

/* -------------------------------------------------------------- documents */

.doc {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.doc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.doc-type {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 10px/1 var(--mono);
  flex: none;
}

.doc-name {
  flex: 1;
  min-width: 0;
}

.doc-name strong {
  display: block;
  font-size: 14px;
}

.doc-name span {
  display: block;
  color: var(--text-2);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.path {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-2);
  font: 12px/1.5 var(--mono);
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}

/* --------------------------------------------------------------- timeline */

.timeline {
  list-style: none;
  display: grid;
}

.timeline li {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 0 0 16px 22px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 7.5px;
  top: 19px;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li:last-child::after {
  display: none;
}

.timeline li.is-yours::before {
  background: var(--ok);
}

.timeline strong {
  font-size: 14px;
}

.timeline small {
  color: var(--text-3);
  font-size: 12px;
}

.timeline p {
  color: var(--text-2);
  font-size: 13.5px;
}

/* ----------------------------------------------------------- job register */

.job-list {
  display: grid;
  gap: 10px;
  list-style: none;
}

.job {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.job:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.job-title {
  min-width: 0;
}

.job-title a {
  color: var(--text);
  font-size: 16px;
  font-weight: 640;
  overflow-wrap: anywhere;
}

/* Whole-card tap target without nesting interactive content. */
.job-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.job-title p {
  color: var(--text-2);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.job-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.job-meta > div {
  min-width: 0;
}

.job-meta dt {
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 560;
}

.job-meta dd {
  margin: 0;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.job-meta small,
.job-head small {
  display: block;
  color: var(--text-3);
  font-size: 12px;
}

.job-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ------------------------------------------------------------ job page */

.action-grid {
  display: grid;
  gap: 8px;
}

.btn-meta {
  font-weight: 500;
  font-size: 12.5px;
  opacity: 0.72;
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

/* Phones read the job page as one column: to do, history, status, fit, more. */
@media (max-width: 959px) {
  .job-layout {
    display: flex;
    flex-direction: column;
  }

  .two-col.job-layout > * {
    display: contents;
  }

  .job-todo { order: 1; }
  .job-history { order: 2; }
  .job-status { order: 3; }
  .job-fit { order: 4; }
  .job-more { order: 5; }
}

/* Side panel opened by linking to its id (CSS :target), so it needs no script. */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.drawer:target {
  display: block;
}

/* Keep the page behind still while a panel is open. */
html:has(.drawer:target) {
  overflow: hidden;
}

/* Fixed overlay: ignore the page's vertical rhythm margin. */
.page > .drawer {
  margin: 0;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.6);
  animation: drawer-fade 0.18s ease-out;
}

.drawer-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(560px, 100%);
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) var(--gutter);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  border-left: 1px solid var(--line-strong);
  box-shadow: -24px 0 60px rgb(0 0 0 / 0.45);
  animation: drawer-in 0.22s ease-out;
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 calc(-1 * var(--gutter));
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: rgb(9 9 11 / 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  font-size: 17px;
}

@keyframes drawer-in {
  from { translate: 100% 0; }
}

@keyframes drawer-fade {
  from { opacity: 0; }
}

/* ----------------------------------------------------------- two column */

.two-col,
.two-col > * {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* ------------------------------------------------------------- task cards */

.task {
  display: grid;
  gap: 10px;
  padding: 14px 14px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
  min-width: 0;
  overflow-wrap: anywhere;
}

.task[data-priority="high"] {
  border-left-color: var(--warn);
}

.task[data-priority="urgent"] {
  border-left-color: var(--bad);
}

.task[data-priority="low"] {
  border-left-color: var(--line);
}

.task.is-done {
  opacity: 0.62;
}

.task.is-done h3 {
  text-decoration: line-through;
  text-decoration-color: var(--text-3);
}

.task h3 {
  font-size: 15.5px;
}

.task-desc {
  color: var(--text-2);
  font-size: 14px;
  white-space: pre-line;
}

.task .actions {
  padding-top: 2px;
}

.due {
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 560;
  white-space: nowrap;
}

/* ------------------------------------------------------------- threads */

.thread {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.thread[data-status="needs_reply"],
.thread[data-status="escalated"] {
  border-left: 3px solid var(--warn);
}

.thread[data-status="escalated"] {
  border-left-color: var(--bad);
}

.thread > summary {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.thread > summary:hover {
  background: var(--surface-2);
}

.thread[open] > summary {
  border-bottom: 1px solid var(--line);
}

.thread-who {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.thread-who strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-who time {
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
  flex: none;
}

.thread-subject {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.thread-preview {
  color: var(--text-3);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.messages {
  display: grid;
  gap: 10px;
}

.bubble {
  display: grid;
  gap: 8px;
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 16px 16px 16px 6px;
  background: var(--surface-3);
  overflow-wrap: anywhere;
}

.bubble[data-direction="outbound"] {
  justify-self: end;
  border-radius: 16px 16px 6px 16px;
  background: #1b1f36;
  border: 1px solid #2c3254;
}

.bubble[data-delivery="draft"],
.bubble[data-delivery="approved"] {
  max-width: 100%;
  width: 100%;
  border-style: dashed;
}

.bubble-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--text-3);
}

.bubble-head strong {
  color: var(--text);
  font-size: 13px;
}

.bubble-copy {
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-line;
}

.ai-note {
  color: var(--text-2);
  font-size: 12.5px;
}

/* ---------------------------------------------------------- login screen */

.login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom));
}

.login-card {
  width: min(400px, 100%);
  display: grid;
  gap: 22px;
}

.login-card .appbar-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-size: 14px;
}

.login-card h1 {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.login .page {
  padding: 0;
}

/* --------------------------------------------------------------- wide */

@media (min-width: 720px) {
  :root {
    --gutter: 24px;
  }

  .metrics[data-count="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metrics[data-count="5"] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .metrics[data-count="5"] > *,
  .metrics[data-count="5"] > :nth-child(-n + 2) {
    grid-column: auto;
  }

  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }


  .action-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }

  .job-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid > .span-2,
  .form-grid > fieldset,
  .form-grid > textarea,
  .form-grid > .field:has(textarea) {
    grid-column: 1 / -1;
  }

  .form-grid > button {
    justify-self: start;
  }

  .page-head h1,
  .page-head .title {
    font-size: 30px;
  }
}

@media (min-width: 960px) {
  :root {
    --tabbar-h: 0px;
  }

  .shell {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    background: linear-gradient(to right, var(--surface) 235px, var(--line) 235px 236px, var(--bg) 236px);
  }

  .tabbar {
    position: sticky;
    inset: 0 auto auto;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 12px;
    background: var(--surface);
    border-top: 0;
    border-right: 1px solid var(--line);
    backdrop-filter: none;
  }

  .tabbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 20px;
    color: var(--text);
  }

  .tabbar-brand strong {
    display: block;
    font-size: 14px;
  }

  .tabbar-brand small {
    display: block;
    color: var(--text-3);
    font-size: 12px;
  }

  .tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 14px;
    letter-spacing: 0;
  }

  .tab:hover {
    background: var(--surface-2);
    color: var(--text);
  }

  .tab[aria-current="page"] {
    background: var(--surface-3);
  }

  .tab svg.icon {
    width: 20px;
    height: 20px;
  }

  .tab-count {
    position: static;
    margin-left: auto;
  }

  .tabbar-foot {
    display: block;
    margin-top: auto;
    padding: 12px 10px 0;
    border-top: 1px solid var(--line);
    color: var(--text-3);
    font-size: 12px;
  }

  .tabbar-foot a {
    color: var(--text-2);
  }

  .appbar .appbar-mark {
    display: none;
  }

  .page {
    padding-top: 28px;
    padding-bottom: 56px;
  }

  .toolbar {
    margin-inline: 0;
    padding: 10px 0;
  }


  .two-col {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
  }

  .two-col > * {
    gap: 20px;
    grid-row: 1;
    grid-column: 1;
  }

  .two-col > aside {
    grid-column: 2;
  }

  .bubble {
    max-width: 78%;
  }
}

@media (min-width: 720px) {
  .filter-panel {
    position: relative;
  }

  .filter-body {
    inset: calc(100% + 8px) 0 auto auto;
    width: 420px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
  }
}

@media (min-width: 1200px) {
  .filters label {
    flex: none;
  }

  .page .filters select {
    width: auto;
  }
}

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