:root {
  color-scheme: light;
  --canvas: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #f1f3f5;
  --text: #171a1f;
  --text-muted: #5f6875;
  --text-subtle: #788290;
  --border: #dfe3e8;
  --border-strong: #c9d0d8;
  --primary: #1769e0;
  --primary-hover: #1259c5;
  --primary-tint: #edf5ff;
  --success: #147d50;
  --success-tint: #ecf8f1;
  --warning: #9a6700;
  --warning-tint: #fff7df;
  --danger: #c83232;
  --danger-tint: #fff0f0;
  --sidebar: #111419;
  --sidebar-text: #f2f4f7;
  --sidebar-muted: #9ca5b1;
  --radius-sm: 6px;
  --radius: 8px;
  --sidebar-width: 248px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--canvas); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: rgba(23, 105, 224, .12); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--text); line-height: 1.2; text-wrap: balance; }
h1 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -.025em; }
h2 { margin-bottom: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
p { color: var(--text-muted); }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
code { overflow-wrap: anywhere; font-size: 12px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 8px 12px; transform: translateY(-150%); border-radius: var(--radius-sm); background: var(--text); color: white; }
.skip-link:focus { transform: translateY(0); }
.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; }
.muted { color: var(--text-subtle); }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: var(--sidebar-width); flex-direction: column; padding: 16px 12px 12px; overflow-y: auto; background: var(--sidebar); color: var(--sidebar-text); }
.brand { display: flex; min-width: 0; align-items: center; gap: 10px; min-height: 48px; padding: 4px 8px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand__mark { display: inline-grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; box-shadow: inset 0 1px rgba(255,255,255,.18); }
.brand > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.brand strong { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.brand small { color: var(--sidebar-muted); font-size: 11px; letter-spacing: .04em; }
.nav-list { display: flex; flex-direction: column; gap: 2px; margin-top: 20px; }
.nav-link { display: flex; min-height: 40px; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--sidebar-muted); font-size: 13px; font-weight: 500; letter-spacing: .01em; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.is-active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 2px 0 var(--primary); }
.nav-count { min-width: 20px; margin-left: auto; padding: 1px 6px; border-radius: 999px; background: #d73a3a; color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.sidebar__footer { display: flex; align-items: center; gap: 9px; min-height: 56px; margin-top: auto; padding: 12px 6px 0; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 12px; font-weight: 600; }
.sidebar__user { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.sidebar__user strong { overflow: hidden; color: #fff; font-size: 12px; font-weight: 500; text-overflow: ellipsis; }
.sidebar__user small { color: var(--sidebar-muted); font-size: 10px; }
.sidebar__footer .icon-button { color: var(--sidebar-muted); }

.main { min-height: 100vh; margin-left: var(--sidebar-width); padding: 36px clamp(24px, 4vw, 56px) 64px; }
.main > * { width: min(100%, 1320px); margin-right: auto; margin-left: auto; }
.mobile-bar, .drawer, .drawer-backdrop { display: none; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header__copy { min-width: 0; }
.page-header p:not(.eyebrow) { max-width: 66ch; margin-bottom: 0; text-wrap: pretty; }
.eyebrow { margin-bottom: 6px; color: var(--text-subtle); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.page-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding-top: 4px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; color: var(--text-subtle); font-size: 12px; }
.breadcrumbs a { color: var(--text-muted); }

.button { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 600; letter-spacing: .005em; text-decoration: none; }
.button:hover { text-decoration: none; }
.button--primary { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.button--primary:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
.button--secondary { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.button--secondary:hover { border-color: #aeb7c2; background: var(--surface-muted); }
.button--ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.button--ghost:hover { background: var(--surface-muted); color: var(--text); }
.button--full { width: 100%; min-height: 44px; }
.icon-button { display: inline-grid; width: 40px; height: 40px; padding: 0; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; cursor: pointer; font-size: 20px; }
.icon-button:hover { background: rgba(127,127,127,.12); }

.priority-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px rgba(17,24,39,.03); }
.metric { position: relative; display: grid; min-width: 0; padding: 18px 20px; border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric::before { position: absolute; top: 0; right: 20px; left: 20px; height: 2px; border-radius: 2px; background: transparent; content: ""; }
.metric--danger::before { background: var(--danger); }
.metric--running::before { background: var(--primary); }
.metric--queued::before { background: var(--warning); }
.metric__label { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.metric__value { margin: 5px 0 1px; color: var(--text); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.1; }
.metric__detail { overflow: hidden; color: var(--text-subtle); font-size: 11px; letter-spacing: .01em; text-overflow: ellipsis; white-space: nowrap; }
.compact-stats { display: grid; grid-template-columns: repeat(2, 1fr); margin: -4px -12px 12px; }
.compact-stats .metric { padding: 12px; }
.compact-stats .metric__value { font-size: 22px; }

.dashboard-grid, .detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panel { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px rgba(17,24,39,.025); }
.panel--span-2 { grid-column: span 2; }
.panel--full { grid-column: 1 / -1; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading .eyebrow { margin-bottom: 3px; }
.section-heading > a { flex: 0 0 auto; font-size: 12px; font-weight: 500; }
.capability-row { display: flex; align-items: center; justify-content: space-between; padding-top: 13px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }

.status { display: inline-flex; width: fit-content; min-height: 23px; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); font-size: 11px; font-weight: 600; letter-spacing: .015em; line-height: 1; white-space: nowrap; }
.status__mark { width: 7px; height: 7px; flex: 0 0 auto; border: 1px solid currentColor; border-radius: 50%; background: currentColor; }
.status--completed, .status--success, .status--available, .status--configured, .status--verified, .status--implemented { border-color: #bfe5d0; background: var(--success-tint); color: var(--success); }
.status--running { border-color: #bfd6f8; background: var(--primary-tint); color: var(--primary); }
.status--running .status__mark { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.status--queued, .status--blocked, .status--not-configured, .status--not-linked { border-color: #ead99f; background: var(--warning-tint); color: var(--warning); }
.status--blocked .status__mark { border-radius: 1px; }
.status--failed, .status--failure, .status--unavailable { border-color: #efc1c1; background: var(--danger-tint); color: var(--danger); }
.status--failed .status__mark, .status--failure .status__mark, .status--unavailable .status__mark { border-radius: 1px; transform: rotate(45deg); }

.object-list, .schedule-list, .artifact-list { margin: 0; padding: 0; list-style: none; }
.object-list li + li, .schedule-list li + li, .artifact-list li + li { border-top: 1px solid var(--border); }
.object-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; min-height: 54px; padding: 8px 2px; color: var(--text); }
.object-list a:hover { text-decoration: none; }
.object-list__main { display: flex; min-width: 0; flex-direction: column; }
.object-list__main strong { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.object-list__main small { color: var(--text-subtle); font-size: 11px; }
.object-list__arrow { color: var(--text-subtle); }
.schedule-list li { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; }
.schedule-list span { min-width: 0; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.schedule-list strong { color: var(--text-subtle); font-size: 11px; font-weight: 400; }

.activity-feed { margin: 0; padding: 0; list-style: none; }
.activity-feed li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: start; gap: 11px; padding: 10px 2px; }
.activity-feed li + li { border-top: 1px solid var(--border); }
.activity-feed__mark { width: 8px; height: 8px; margin-top: 6px; border: 2px solid var(--primary); border-radius: 50%; background: #fff; }
.activity-feed strong { display: block; color: var(--text); font-size: 12px; font-weight: 500; }
.activity-feed p { margin: 2px 0 0; font-size: 11px; }
.activity-feed time { color: var(--text-subtle); font-size: 11px; }

.table-shell { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fafbfc; color: var(--text-subtle); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfd; }
th:first-child, td:first-child { width: 30%; }
th:last-child, td:last-child { width: 82px; text-align: right; }
.primary-link { display: block; overflow: hidden; color: var(--text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
td small, .primary-link + small { display: block; margin-top: 2px; overflow: hidden; color: var(--text-subtle); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.row-action { font-weight: 600; white-space: nowrap; }

input, select { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; }
input::placeholder { color: #8a94a1; }
input:focus-visible, select:focus-visible { border-color: var(--primary); outline: 2px solid rgba(23,105,224,.16); outline-offset: 0; }
.filter-bar { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 16px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.filter-bar label { display: grid; min-width: 180px; gap: 4px; }
.filter-bar label > span { color: var(--text-subtle); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.filter-bar--wide label { flex: 1; }
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-chip { display: inline-flex; min-height: 34px; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 500; }
.filter-chip:hover { border-color: var(--border-strong); background: var(--surface-muted); text-decoration: none; }
.filter-chip.is-active { border-color: #b9d1f3; background: var(--primary-tint); color: var(--primary); }
.filter-chip span { min-width: 18px; color: inherit; font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; }
.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-form label { width: min(100%, 420px); }
.search-form--compact { width: min(100%, 340px); margin-bottom: 0; }
.search-form--compact label { flex: 1; }

.empty-state { display: flex; min-height: 150px; align-items: flex-start; justify-content: center; gap: 13px; flex-direction: row; padding: 34px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: rgba(255,255,255,.45); text-align: left; }
.empty-state__mark { width: 12px; height: 12px; flex: 0 0 auto; margin-top: 4px; border: 2px solid var(--text-subtle); border-radius: 50%; }
.empty-state h2 { margin-bottom: 5px; font-size: 14px; }
.empty-state p { max-width: 48ch; margin: 0; font-size: 12px; }
.empty-state__action { margin-top: 14px; }
.empty-state--success .empty-state__mark { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 2px white; }
.empty-state--warning .empty-state__mark { border-color: var(--warning); border-radius: 2px; transform: rotate(45deg); }

.job-state-line { display: flex; align-items: center; gap: 14px; margin: -10px 0 20px; color: var(--text-muted); font-size: 12px; }
.error-callout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; margin-bottom: 16px; padding: 16px; border: 1px solid #efc1c1; border-radius: var(--radius); background: var(--danger-tint); }
.error-callout h2 { color: var(--danger); }
.error-callout .code-block { margin: 0; border-color: #efc1c1; background: #fffafa; }
.step-timeline { margin: 0; padding: 0; list-style: none; }
.timeline-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 20px; }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step:not(:last-child)::before { position: absolute; top: 27px; bottom: 0; left: 13px; width: 1px; background: var(--border-strong); content: ""; }
.timeline-step__index { position: relative; z-index: 1; display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--text-subtle); font-size: 11px; font-variant-numeric: tabular-nums; }
.timeline-step--completed .timeline-step__index { border-color: var(--success); background: var(--success); color: white; }
.timeline-step--running .timeline-step__index { border-color: var(--primary); color: var(--primary); box-shadow: inset 0 0 0 3px var(--primary-tint); }
.timeline-step--failed .timeline-step__index { border-color: var(--danger); background: var(--danger-tint); color: var(--danger); }
.timeline-step--blocked .timeline-step__index { border-color: var(--warning); background: var(--warning-tint); color: var(--warning); }
.timeline-step__body { min-width: 0; padding-top: 3px; }
.timeline-step__body > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timeline-step__body strong { font-size: 13px; font-weight: 600; }
.timeline-step__body p { margin: 3px 0 0; color: var(--text-subtle); font-size: 11px; }
.step-error { margin-top: 10px; }
.code-block { max-height: 340px; margin: 0; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #f6f8fa; color: #343a43; font-size: 11px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.definition-list { margin: 0; }
.definition-list > div { display: grid; grid-template-columns: minmax(100px, 36%) minmax(0, 1fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.definition-list > div:first-child { padding-top: 0; }
.definition-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.definition-list dt { color: var(--text-subtle); font-size: 11px; }
.definition-list dd { min-width: 0; margin: 0; color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.artifact-list li { display: flex; flex-direction: column; padding: 10px 0; }
.artifact-list strong { font-size: 12px; }
.artifact-list span { color: var(--text-subtle); font-size: 10px; }
.capability-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.capability-banner > div { display: flex; flex-direction: column; }
.capability-banner span:first-child { color: var(--text-subtle); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.capability-banner strong { font-size: 13px; }
.capability-list > div { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.capability-list > div:last-child { border-bottom: 0; }
.capability-list > div > span { display: flex; min-width: 0; flex-direction: column; }
.capability-list strong { font-size: 12px; }
.capability-list small { color: var(--text-subtle); font-size: 10px; }

.flash-stack { margin-bottom: 16px; }
.flash { padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 12px; }
.flash--success { border-color: #bfe5d0; background: var(--success-tint); color: var(--success); }
.flash--warning { border-color: #ead99f; background: var(--warning-tint); color: var(--warning); }
.flash--danger { border-color: #efc1c1; background: var(--danger-tint); color: var(--danger); }
.button:disabled { cursor: wait; opacity: .72; }

.auth-page { background: #eef1f5; }
.auth-shell { display: grid; width: min(100% - 32px, 940px); min-height: 560px; grid-template-columns: 1.05fr .95fr; margin: max(32px, 8vh) auto; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 20px 60px rgba(24,32,43,.11); }
.auth-intro { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 6vw, 72px); overflow: hidden; background: var(--sidebar); color: white; }
.auth-intro::after { position: absolute; right: -90px; bottom: -110px; width: 270px; height: 270px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 42px rgba(255,255,255,.025), 0 0 0 84px rgba(255,255,255,.018); content: ""; }
.brand__mark--large { width: 42px; height: 42px; margin-bottom: 52px; font-size: 14px; }
.auth-intro .eyebrow { color: #9eabb9; }
.auth-intro h1 { margin-bottom: 16px; color: white; font-size: clamp(34px, 5vw, 50px); font-weight: 550; letter-spacing: -.045em; line-height: 1.03; }
.auth-intro > p:not(.eyebrow) { max-width: 38ch; color: #aeb8c5; font-size: 14px; text-wrap: pretty; }
.auth-signal { display: flex; align-items: center; gap: 8px; margin-top: 44px; color: #aeb8c5; font-size: 11px; letter-spacing: .02em; }
.auth-signal span { width: 7px; height: 7px; border-radius: 50%; background: #42c785; box-shadow: 0 0 0 3px rgba(66,199,133,.12); }
.auth-form-panel { display: grid; place-items: center; padding: 36px; }
.auth-form { display: grid; width: min(100%, 320px); gap: 9px; }
.auth-form > div:first-child { margin-bottom: 16px; }
.auth-form h2 { margin: 0 0 5px; font-size: 22px; }
.auth-form p { margin-bottom: 0; font-size: 12px; }
.auth-form label { margin-top: 4px; color: var(--text-muted); font-size: 12px; font-weight: 500; }
.auth-form input { min-height: 44px; }
.auth-form .button { margin-top: 11px; }
.form-error { margin-bottom: 7px; padding: 9px 10px; border: 1px solid #efc1c1; border-radius: var(--radius-sm); background: var(--danger-tint); color: var(--danger); font-size: 12px; }
.plain-error { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.plain-error main { width: min(100%, 460px); padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.plain-error .brand__mark { margin-bottom: 28px; }

@media (max-width: 1040px) {
  .dashboard-grid, .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel--span-2, .panel--full { grid-column: 1 / -1; }
  .priority-strip { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 760px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .sidebar { display: none; }
  .mobile-bar { position: sticky; z-index: 30; top: 0; display: grid; min-height: 58px; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
  .brand--mobile { min-height: 44px; padding: 0; color: var(--text); }
  .brand--mobile strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .brand--mobile .brand__mark { width: 30px; height: 30px; }
  .mobile-bar__links { display: flex; align-items: center; gap: 2px; }
  .mobile-bar__links a { display: inline-flex; min-height: 44px; align-items: center; gap: 4px; padding: 0 8px; color: var(--text-muted); font-size: 12px; font-weight: 600; }
  .mobile-bar__links a span { display: grid; min-width: 17px; height: 17px; place-items: center; border-radius: 50%; background: var(--danger); color: white; font-size: 9px; }
  .main { margin-left: 0; padding: 24px 16px 56px; }
  .drawer-backdrop { position: fixed; z-index: 39; inset: 0; display: block; background: rgba(9,13,18,.48); }
  .drawer-backdrop[hidden] { display: none; }
  .drawer { position: fixed; z-index: 40; inset: 0 0 0 auto; display: flex; width: min(88vw, 340px); flex-direction: column; padding: 12px; overflow-y: auto; transform: translateX(101%); background: var(--sidebar); color: var(--sidebar-text); transition: transform 160ms ease; overscroll-behavior: contain; }
  .drawer.is-open { transform: translateX(0); }
  .drawer__header { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 0 4px 0 10px; }
  .drawer__header strong { font-size: 13px; }
  .drawer .nav-list { margin-top: 10px; }
  .drawer .nav-link { min-height: 44px; }
  .drawer__logout { margin-top: auto; padding-top: 16px; }
  .page-header { flex-direction: column; margin-bottom: 22px; }
  .page-actions { width: 100%; padding-top: 0; }
  .page-actions form, .page-actions .button, .page-actions button { width: 100%; }
  .priority-strip { grid-template-columns: repeat(2, 1fr); }
  .metric { padding: 15px; }
  .metric__value { font-size: 23px; }
  .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
  .panel, .panel--span-2, .panel--full { grid-column: 1; padding: 15px; }
  .list-tools { align-items: stretch; flex-direction: column; }
  .filter-chips { flex-wrap: nowrap; margin-right: -16px; padding-right: 16px; overflow-x: auto; scrollbar-width: none; }
  .filter-chip { min-height: 44px; }
  .search-form, .search-form--compact { width: 100%; }
  .search-form input, .search-form .button, .filter-bar input, .filter-bar select, .filter-bar .button { min-height: 44px; }
  .filter-bar, .filter-bar--wide { align-items: stretch; flex-direction: column; }
  .filter-bar label, .filter-bar--wide label { min-width: 0; }
  .table-shell { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  tbody { display: grid; gap: 10px; }
  tbody tr { padding: 5px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
  tbody tr:hover { background: var(--surface); }
  td, th:first-child, td:first-child, th:last-child, td:last-child { display: grid; width: 100%; min-height: 42px; grid-template-columns: minmax(92px, 34%) minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); text-align: left; }
  td:last-child { min-height: 44px; border-bottom: 0; }
  td::before { color: var(--text-subtle); content: attr(data-label); font-size: 9px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
  td:empty { display: none; }
  .row-action { display: inline-flex; min-height: 44px; align-items: center; }
  .error-callout { grid-template-columns: 1fr; }
  .activity-feed li { grid-template-columns: 10px minmax(0, 1fr); }
  .activity-feed time { grid-column: 2; }
  .auth-shell { min-height: 0; grid-template-columns: 1fr; margin: 16px auto; }
  .auth-intro { min-height: 270px; padding: 30px; }
  .brand__mark--large { margin-bottom: 30px; }
  .auth-intro h1 { font-size: 35px; }
  .auth-signal { margin-top: 20px; }
  .auth-form-panel { padding: 34px 24px; }
}

@media (max-width: 420px) {
  .mobile-bar { grid-template-columns: minmax(0, 1fr) auto 44px; }
  .brand--mobile strong { display: none; }
  .priority-strip { grid-template-columns: 1fr 1fr; }
  .metric { border-right: 0; }
  .metric:nth-child(odd) { border-right: 1px solid var(--border); }
  .definition-list > div { grid-template-columns: 1fr; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Articles workspace */
.articles-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.articles-workspace { display:grid; grid-template-columns:minmax(260px,.8fr) minmax(0,2fr); gap:1rem; margin-bottom:1rem; }
.stack-form, .article-builder, .assignment-form { display:grid; gap:1rem; }
.stack-form label, .article-builder label, .assignment-form>label { display:grid; gap:.45rem; color:var(--ink); font-weight:650; }
.stack-form label span, .article-builder label>span, .assignment-form label>span { font-size:.82rem; }
.stack-form small, .article-builder small { color:var(--muted); font-weight:500; }
.stack-form input, .stack-form select, .stack-form textarea, .article-builder input, .article-builder select, .article-builder textarea, .assignment-form select, .inline-form input { width:100%; min-height:44px; border:1px solid var(--line); border-radius:var(--radius-sm); background:#fff; color:var(--ink); padding:.7rem .8rem; font:inherit; }
.stack-form textarea, .article-builder textarea { resize:vertical; }
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus, .article-builder input:focus, .article-builder select:focus, .article-builder textarea:focus, .inline-form input:focus { outline:3px solid rgba(31,99,255,.16); border-color:var(--accent); }
.field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem; }
.form-hint { margin:0; color:var(--muted); font-size:.84rem; line-height:1.55; }
.import-result { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.75rem; margin-bottom:1rem; }
.inline-form { display:flex; gap:.45rem; min-width:230px; }
.inline-form .button { min-height:44px; }
.assignment-form { border-top:1px solid var(--line); padding-top:1.15rem; margin-top:1rem; }
.assignment-form fieldset, .stack-form fieldset { margin:0; padding:0; border:0; }
.assignment-form legend, .stack-form legend { margin-bottom:.65rem; font-weight:700; }
.check-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.6rem; }
.check-card, .choice-card, .switch-row { display:flex !important; grid-template-columns:none !important; align-items:flex-start; gap:.7rem !important; min-height:52px; border:1px solid var(--line); border-radius:var(--radius-sm); padding:.75rem; background:#fff; cursor:pointer; }
.check-card input, .choice-card input, .switch-row input { width:18px !important; min-height:18px !important; margin-top:.15rem; accent-color:var(--accent); }
.check-card span, .choice-card span, .switch-row span { display:grid; gap:.12rem; }
.check-card small, .choice-card small, .switch-row small { color:var(--muted); font-weight:500; }
.article-builder { max-width:980px; }
.workflow-step { position:relative; display:grid; grid-template-columns:46px minmax(0,1fr); gap:1rem; padding:1.25rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow-sm); }
.workflow-step__number { display:grid; place-items:center; width:38px; height:38px; border-radius:50%; background:var(--ink); color:#fff; font-weight:750; }
.workflow-step h2 { margin:.15rem 0 1rem; font-size:1.2rem; }
.keyword-groups { display:grid; gap:.8rem; margin-bottom:1rem; }
.keyword-choice-group { border:1px solid var(--line); border-radius:var(--radius-sm); padding:.85rem; }
.keyword-choice-group[hidden] { display:none; }
.keyword-choice-group h3 { margin:0 0 .65rem; font-size:.92rem; }
.choice-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.7rem; margin-bottom:1rem; }
.builder-submit { position:sticky; bottom:1rem; display:flex; justify-content:flex-end; padding:1rem; border:1px solid var(--line-strong); border-radius:var(--radius); background:rgba(255,255,255,.96); box-shadow:var(--shadow-lg); z-index:2; }
.batch-confirm { max-width:760px; }
.batch-confirm form { display:flex; justify-content:flex-end; margin-top:1rem; }
.plain-list { margin:0; padding-left:1.2rem; }
.article-preview { margin-top:1rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
.article-preview__header { padding:1.5rem; border-bottom:1px solid var(--line); background:linear-gradient(135deg,#f7f9fc,#fff); }
.article-preview__header h2 { margin:.25rem 0 .45rem; font-size:clamp(1.45rem,3vw,2.2rem); }
.article-preview__header p:last-child { margin:0; color:var(--muted); }
.article-copy { max-width:760px; padding:1.5rem; font-size:1rem; line-height:1.75; }
.article-copy h2, .article-copy h3, .article-copy h4 { margin:1.6em 0 .55em; line-height:1.2; }
.article-copy p { margin:0 0 1em; }
.preview-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(280px,.8fr); gap:1rem; padding:0 1.5rem 1.5rem; }
.preview-grid>section { border-top:1px solid var(--line); padding-top:1rem; }
.artifact-preview { border-top:1px solid var(--line); padding:1rem 1.5rem; }
.artifact-preview summary { min-height:44px; display:flex; align-items:center; font-weight:700; cursor:pointer; }
@media (max-width: 900px) {
  .articles-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .articles-workspace, .preview-grid { grid-template-columns:1fr; }
}
@media (max-width: 560px) {
  .articles-metrics, .import-result, .field-grid, .check-grid, .choice-row { grid-template-columns:1fr; }
  .workflow-step { grid-template-columns:38px minmax(0,1fr); gap:.7rem; padding:1rem .85rem; }
  .workflow-step__number { width:32px; height:32px; }
  .builder-submit { bottom:.5rem; }
  .builder-submit .button { width:100%; }
  .inline-form { min-width:0; flex-direction:column; }
  .article-copy, .article-preview__header, .preview-grid { padding-left:1rem; padding-right:1rem; }
}

.article-job-facts { margin: 1rem 0; }
.article-job-facts .definition-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .article-job-facts .definition-list { grid-template-columns: 1fr; } }
/* Manual Writing and persistent Batch Articles */
.site-picker { display:grid; grid-template-columns:minmax(220px,.7fr) minmax(300px,1.3fr); gap:.8rem; }
.site-picker label, .batch-create>label, .batch-settings label, .batch-add>label, .spread-form label, .manual-editor label { display:grid; gap:.4rem; font-weight:650; }
.site-picker label>span, .batch-create label>span, .batch-settings label>span, .batch-add label>span, .spread-form label>span, .manual-editor label>span { font-size:.82rem; }
.new-article-start, .batch-create, .batch-settings, .batch-add { display:grid; max-width:1100px; gap:1rem; margin-bottom:1rem; }
.new-article-start fieldset, .batch-add fieldset, .manual-editor fieldset { margin:0; padding:0; border:0; }
.new-article-start legend, .batch-add legend, .manual-editor legend { margin-bottom:.65rem; font-weight:700; }
.batch-list { margin-top:1rem; }
.batch-site-lock { margin-bottom:1rem; padding:1rem 1.2rem; border:1px solid var(--border); border-left:3px solid var(--primary); border-radius:var(--radius); background:var(--primary-tint); }
.batch-site-lock .definition-list { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:1rem; }
.batch-site-lock .definition-list>div { display:block; padding:0; border:0; }
.batch-site-lock dt { margin-bottom:.25rem; }
.keyword-checklist, .link-checklist { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.55rem; max-height:360px; overflow:auto; padding:.15rem; content-visibility:auto; contain-intrinsic-size:0 320px; }
.check-card--warning { border-color:#ead99f; background:var(--warning-tint); }
.batch-toolbar { position:sticky; z-index:5; top:1rem; display:flex; align-items:end; justify-content:space-between; gap:1rem; margin:1rem 0; padding:.85rem 1rem; border:1px solid var(--border-strong); border-radius:var(--radius); background:rgba(255,255,255,.97); box-shadow:0 8px 24px rgba(17,24,39,.08); }
.batch-toolbar>div { display:grid; }
.batch-toolbar>div span { color:var(--text-subtle); font-size:.75rem; }
.spread-form { display:flex; align-items:end; gap:.55rem; }
.spread-form label:first-of-type { min-width:190px; }
.spread-form input, .spread-form select { min-height:40px; }
.batch-article-list { display:grid; gap:.9rem; }
.batch-article-card { overflow:hidden; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); box-shadow:0 1px 2px rgba(17,24,39,.03); scroll-margin-top:100px; }
.batch-article-card>header { display:flex; min-height:82px; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.1rem; }
.batch-article-card>header>div { display:flex; align-items:center; gap:.75rem; }
.batch-article-card>header>div:last-child { flex-wrap:wrap; justify-content:flex-end; }
.batch-article-card h2 { margin:0 0 .2rem; font-size:1rem; }
.batch-article-card p { margin:0; font-size:.78rem; }
.batch-index { display:grid; width:32px; height:32px; flex:0 0 auto; place-items:center; border-radius:50%; background:var(--text); color:#fff; font-size:.75rem; font-weight:700; }
.article-signal { display:inline-flex; min-height:28px; align-items:center; padding:.25rem .55rem; border:1px solid var(--border); border-radius:999px; color:var(--text-muted); font-size:.72rem; }
.batch-article-card>details { border-top:1px solid var(--border); }
.batch-article-card>details>summary, .editor-panel>summary { display:flex; min-height:48px; align-items:center; padding:.7rem 1.1rem; cursor:pointer; font-weight:700; }
.manual-editor { display:grid; gap:.75rem; padding:0 1rem 1rem; }
.editor-panel { display:grid; gap:.85rem; margin:0; padding:1rem; border:1px solid var(--border); border-radius:var(--radius); background:#fbfcfd; }
.editor-panel--identity { border-left:3px solid var(--primary); }
.editor-panel>summary { margin:-1rem; margin-bottom:0; }
.article-body-editor { min-height:420px; resize:vertical; font-family:var(--font); line-height:1.65; }
.image-choice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.7rem; }
.image-choice { display:grid; grid-template-columns:120px minmax(0,1fr); gap:.65rem; padding:.6rem; border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; }
.image-choice img, .image-choice__empty { width:120px; height:80px; object-fit:cover; border-radius:4px; background:var(--surface-muted); }
.image-choice__empty { display:grid; place-items:center; color:var(--text-subtle); font-size:.7rem; }
.image-choice>div { display:grid; align-content:start; gap:.2rem; min-width:0; }
.image-choice strong, .image-choice small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.image-choice label { display:flex; grid-template-columns:none; align-items:center; gap:.35rem; font-size:.72rem; font-weight:500; }
.image-choice input { width:auto; min-height:auto; }
.row-controls { display:flex; flex-wrap:wrap; gap:.25rem; padding:.55rem 1rem; border-top:1px solid var(--border); background:#fafbfc; }
.row-controls form { margin:0; }
.batch-review .definition-list { margin-bottom:1rem; }
.batch-review>form { display:flex; justify-content:flex-end; margin-top:1rem; }
@media (max-width: 980px) {
  .keyword-checklist, .link-checklist, .image-choice-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .batch-site-lock .definition-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .batch-toolbar { position:static; align-items:stretch; flex-direction:column; }
  .spread-form { display:grid; grid-template-columns:2fr .7fr 1fr auto; }
}
@media (max-width: 620px) {
  .site-picker, .keyword-checklist, .link-checklist, .image-choice-grid, .spread-form, .batch-site-lock .definition-list { grid-template-columns:1fr; }
  .batch-article-card>header { align-items:flex-start; flex-direction:column; }
  .batch-article-card>header>div:last-child { justify-content:flex-start; }
  .manual-editor { padding:0 .65rem .65rem; }
  .editor-panel { padding:.8rem; }
  .article-body-editor { min-height:52vh; }
  .image-choice { grid-template-columns:92px minmax(0,1fr); }
  .image-choice img, .image-choice__empty { width:92px; height:72px; }
  .row-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .row-controls .button { width:100%; min-height:44px; }
}
