:root {
  color-scheme: light;
  --bg: #f5f5f4;
  --surface: #ffffff;
  --surface-soft: #eeece8;
  --nav: #1c1917;
  --nav-soft: #2b2724;
  --text: #1c1917;
  --muted: #68635f;
  --line: #dfdcd6;
  --line-strong: #bcb6ac;
  --accent: #c79a34;
  --accent-hover: #8a6a1e;
  --accent-soft: #f7efd9;
  --danger: #b42318;
  --danger-soft: #feeceb;
  --warning: #9a5b00;
  --warning-soft: #fff2d5;
  --success: #16704a;
  --success-soft: #e6f5ed;
  --info: #295b86;
  --info-soft: #e9f2fa;
  --radius: 0;
  --shadow: 0 16px 44px rgb(28 25 23 / 7%);
  --sidebar: 252px;
}

@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

* { box-sizing: border-box; }
html { font-family: "Archivo", Arial, system-ui, sans-serif; background: var(--bg); color: var(--text); }
body { margin: 0; min-width: 320px; min-height: 100dvh; font-size: 15px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-hover); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(2rem, 3vw, 2.7rem); font-weight: 700; line-height: 1.04; letter-spacing: -.035em; }
h2 { margin-bottom: 5px; font-size: 1.18rem; font-weight: 700; line-height: 1.2; letter-spacing: -.018em; }
p { color: var(--muted); }
pre { max-width: 100%; margin: 0; padding: 12px; overflow: auto; border-radius: var(--radius); background: var(--text); color: #f5f5f4; white-space: pre-wrap; word-break: break-word; font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }

:focus-visible { outline: 3px solid rgb(199 154 52 / 34%); outline-offset: 2px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger)!important; }
.break-all { word-break: break-all; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; padding: 26px 18px 18px; overflow-y: auto; background: var(--nav); color: #f5f5f4; }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { display: inline-flex; flex: 0 0 auto; align-items: center; color: var(--accent); font-size: 24px; font-weight: 500; letter-spacing: -.14em; line-height: 1; }
.brand strong, .brand small { display: block; }
.brand strong { color: inherit; font-size: 11px; font-weight: 650; letter-spacing: .17em; text-transform: uppercase; white-space: nowrap; }
.brand small { margin-top: 4px; color: #a9a39d; font-size: 11px; }
.sidebar .brand { padding: 0 4px 25px; border-bottom: 1px solid rgb(245 245 244 / 13%); }
.nav-list { display: grid; gap: 2px; padding: 22px 0; }
.nav-list a { position: relative; padding: 10px 12px; border-left: 2px solid transparent; border-radius: var(--radius); color: #c9c5c0; text-decoration: none; font-size: 14px; font-weight: 550; transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
.nav-list a:hover { background: rgb(245 245 244 / 6%); color: #fff; }
.nav-list a[aria-current="page"] { border-left-color: var(--accent); background: var(--nav-soft); color: #fff; }
.nav-list a[aria-current="page"]::before { content: none; }
.sidebar-footer { display: grid; gap: 14px; margin-top: auto; padding: 18px 4px 0; border-top: 1px solid rgb(245 245 244 / 13%); }
.identity span, .identity small { display: block; }
.identity span { color: #fff; font-weight: 650; }
.identity small { color: #a9a39d; font-size: 12px; }

.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: flex-end; height: 64px; padding: 0 clamp(18px, 3vw, 42px); border-bottom: 1px solid var(--line); background: rgb(245 245 244 / 94%); backdrop-filter: blur(12px); }
.topbar-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
.state-dot { display: inline-block; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; }
.state-ok { background: #2a956b; box-shadow: 0 0 0 3px rgb(42 149 107 / 14%); }
.state-off { background: #c54337; box-shadow: 0 0 0 3px rgb(197 67 55 / 13%); }
.menu-button { display: none; padding: 8px 13px; border: 1px solid var(--text); border-radius: var(--radius); background: var(--text); color: var(--bg); font-weight: 650; }
.content { width: min(100%, 1480px); margin: 0 auto; padding: clamp(22px, 3.5vw, 44px); }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.page-header p { max-width: 68ch; margin-bottom: 0; }
.back-link { display: inline-block; margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 17px; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; text-align: center; text-decoration: none; white-space: nowrap; font-size: 14px; font-weight: 650; line-height: 1.2; transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .1s ease; }
.button:active { transform: translateY(1px) scale(.99); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button-primary { background: var(--text); color: var(--bg); }
.button-primary:hover { background: #393431; color: #fff; }
.button-secondary { border-color: var(--line-strong); background: var(--surface); color: var(--text); }
.button-secondary:hover { border-color: var(--text); background: var(--surface-soft); color: var(--text); }
.button-ghost { background: transparent; color: var(--accent-hover); }
.button-ghost:hover { background: var(--accent-soft); }
.button-danger { background: var(--danger); color: #fff; }
.button-danger:hover { background: #921c13; color: #fff; }
.button-small { min-height: 32px; padding: 6px 9px; font-size: 12px; }
.button-block { width: 100%; }
.button-sidebar { width: 100%; border-color: rgb(245 245 244 / 27%); background: transparent; color: #f5f5f4; }
.button-sidebar:hover { border-color: var(--accent); background: rgb(245 245 244 / 7%); color: #fff; }

.notice { margin-bottom: 20px; padding: 13px 16px; border: 1px solid; border-left-width: 3px; border-radius: var(--radius); }
.notice ul { margin: 7px 0 0; }
.notice-info { border-color: #bed9ee; background: var(--info-soft); color: #1f527c; }
.notice-success { border-color: #b8dec9; background: var(--success-soft); color: #105f3e; }
.notice-warning { border-color: #ead29d; background: var(--warning-soft); color: #744600; }
.notice-danger, .notice-error { border-color: #f0b9b5; background: var(--danger-soft); color: #8e1d15; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel:not(.table-panel) { padding: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.panel-heading p { margin: 2px 0 0; font-size: 13px; }
.panel-heading > a { font-size: 13px; font-weight: 700; }
.status-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.status-strip > div { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--line); }
.status-strip > div:last-child { border-right: 0; }
.status-strip span, .status-strip strong, .status-strip small { display: block; }
.status-strip span { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.status-strip strong { margin: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.status-strip small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.metric { min-height: 104px; padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 7px 24px rgb(28 25 23 / 3%); }
.metric span, .metric strong { display: block; }
.metric span { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .035em; text-transform: uppercase; }
.metric strong { margin-top: 6px; font: 750 1.8rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.04em; }
.metric-accent { border-left: 3px solid var(--accent); }
.metric-success { border-left: 3px solid var(--success); }
.metric-warning { border-left: 3px solid #d28a18; }
.metric-danger { border-left: 3px solid var(--danger); }
.dashboard-grid, .two-column { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 18px; }

.list-rows { display: grid; }
.list-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.list-row:first-child { padding-top: 0; }
.list-row:last-child { padding-bottom: 0; border-bottom: 0; }
.list-row strong, .list-row small { display: block; }
.list-row small { margin-top: 2px; color: var(--muted); }
.key-values { display: grid; margin: 0; }
.key-values > div { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(0, 1.3fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.key-values > div:last-child { border-bottom: 0; }
.key-values > div.full { display: block; }
.key-values dt { color: var(--muted); }
.key-values dd { min-width: 0; margin: 0; font-weight: 650; }
.key-values .full dd { margin-top: 6px; font-weight: 400; }

.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.filterbar label:first-child { flex: 1 1 240px; }
.filterbar input, .filterbar select { min-height: 38px; }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); }
input, select { min-height: 42px; padding: 8px 10px; }
textarea { min-height: 100px; padding: 10px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #77716c; opacity: 1; }
input:hover, textarea:hover, select:hover { border-color: #8e877e; }
input:focus, textarea:focus, select:focus { border-color: var(--accent-hover); outline: 3px solid rgb(199 154 52 / 18%); }
input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); }

.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-soft); color: #5f5954; font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
tbody tr:hover { background: #faf9f7; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
.actions-col { width: 1%; }
.note-cell { max-width: 260px; color: var(--muted); }
.message-preview { min-width: 200px; max-width: 380px; white-space: pre-line; }
.row-actions, .badge-stack, .command-bar, .error-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.row-actions form, .command-bar form, .error-actions form { margin: 0; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: var(--radius); background: #ece9e5; color: #4c4743; white-space: nowrap; font-size: 11px; font-weight: 750; line-height: 1.2; }
.badge-success, .badge-status-sent, .badge-import-valid, .badge-info { background: var(--success-soft); color: #0f6843; }
.badge-danger, .badge-error, .badge-critical, .badge-status-failed, .badge-status-blocked, .badge-import-blocked { background: var(--danger-soft); color: #9d2118; }
.badge-warning, .badge-status-manual_check, .badge-import-duplicate_user, .badge-import-duplicate_listing, .badge-import-already_contacted { background: var(--warning-soft); color: #835000; }
.badge-status-ready, .badge-status-processing { background: var(--accent-soft); color: #6e5217; }
.badge-status-draft, .badge-status-scheduled, .badge-status-paused, .badge-status-cancelled, .badge-neutral { background: #ece9e5; color: #4c4743; }
.badge-import-incomplete, .badge-import-invalid_url, .badge-import-missing_message, .badge-import-blocked_user { background: var(--danger-soft); color: #9d2118; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.form-layout { display: grid; gap: 16px; }
.compact-form { max-width: 920px; }
.form-section { display: grid; grid-template-columns: minmax(180px, .36fr) minmax(0, 1fr); gap: 26px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.compact-form .form-section { display: block; }
.form-section-heading p { max-width: 30ch; margin: 6px 0 0; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.field > span, .file-field > span { color: #38332f; font-size: 13px; font-weight: 650; }
.field small, .file-field small { color: var(--muted); font-size: 12px; }
.field-wide { grid-column: 1 / -1; }
.check-field { display: flex; align-items: flex-start; gap: 9px; padding-top: 5px; color: #38332f; font-weight: 650; }
.check-field span { flex: 1; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 6px 0; }
.form-actions form { margin: 0; }
.sticky-actions { position: sticky; bottom: 10px; z-index: 4; margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgb(255 255 255 / 94%); box-shadow: var(--shadow); }
.safety-check { max-width: 920px; padding: 17px 20px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--accent-soft); }
.safety-check ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; margin: 10px 0 0; padding-left: 20px; color: #55451f; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 20px; border: 1px solid #e8c1be; border-radius: var(--radius); background: #fffafa; }
.danger-zone h2 { color: var(--danger); }
.danger-zone p { margin: 3px 0 0; }
.form-stack { display: grid; gap: 16px; }
.file-field { display: grid; gap: 7px; padding: 20px; border: 1px dashed #a39b90; border-radius: var(--radius); background: var(--surface-soft); cursor: pointer; }
.file-field input { padding: 7px; background: var(--surface); }
.upload-panel h2 { margin-bottom: 16px; }
.code-list, .secret-box { padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); color: #38332f; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-word; }
.history-panel { margin-top: 18px; }
.history-panel .panel-heading { padding: 18px 18px 0; }

.empty-state { display: grid; justify-items: center; padding: clamp(36px, 8vw, 76px) 20px; text-align: center; }
.empty-state strong { font-size: 1.1rem; }
.empty-state p { max-width: 52ch; margin: 5px 0 16px; }
.empty-state.small { padding: 28px 18px; }
.error-list { display: grid; gap: 12px; }
.error-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.error-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 17px; }
.error-summary h2 { margin: 0; }
.error-summary p { margin: 3px 0 0; font-size: 12px; }
.error-card details { border-top: 1px solid var(--line); }
.error-card summary { padding: 11px 17px; cursor: pointer; color: var(--accent-hover); font-weight: 700; }
.error-card details .key-values { padding: 0 17px 14px; }
.error-actions { padding: 12px 17px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.error-actions form:first-child { display: flex; flex: 1 1 430px; gap: 7px; }
.error-actions input { min-height: 32px; }
.worker-panel { margin-bottom: 16px; }
.worker-heading, .worker-heading > div { display: flex; align-items: center; gap: 11px; }
.worker-heading { justify-content: space-between; margin-bottom: 16px; }
.worker-heading h2, .worker-heading p { margin: 0; }
.worker-heading p { font-size: 12px; }
.worker-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.worker-metrics > div { min-width: 0; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.worker-metrics > div:nth-child(5n) { border-right: 0; }
.worker-metrics > div:nth-last-child(-n+5) { border-bottom: 0; }
.worker-metrics dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.worker-metrics dd { margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.command-bar { padding-top: 15px; border-top: 1px solid var(--line); }
.command-history { margin-top: 14px; }
.command-history summary { cursor: pointer; color: var(--accent-hover); font-weight: 700; }
.command-history .list-rows { margin-top: 12px; }
.security-settings { margin-top: 20px; }
.secret-state { display: grid; align-items: center; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); font-weight: 700; }
.totp-panel { max-width: 680px; }
.totp-panel .form-stack { max-width: 420px; margin-top: 20px; }
.steps { padding-left: 22px; color: var(--muted); }
.qr-code { display: block; width: 220px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.secret-box { display: grid; gap: 5px; margin-top: 14px; }
.secret-box span { font: 12px ui-sans-serif, system-ui, sans-serif; color: var(--muted); }

.login-page { display: grid; min-height: 100dvh; place-items: center; padding: clamp(18px, 4vw, 48px); background: var(--bg); }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr); width: min(100%, 1120px); min-height: min(680px, calc(100dvh - 72px)); border: 1px solid var(--line); background: var(--surface); box-shadow: 0 28px 80px rgb(28 25 23 / 10%); }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(36px, 5vw, 68px); border-right: 1px solid var(--line); background: var(--bg); }
.login-brand { color: var(--text); }
.login-brand small { color: var(--muted); }
.login-message h1 { max-width: 8.8ch; margin-bottom: 22px; font-size: clamp(3rem, 5vw, 4.8rem); line-height: .98; letter-spacing: -.052em; }
.login-message > p:last-child { max-width: 38ch; margin: 0; font-size: 17px; line-height: 1.65; }
.login-kicker { margin-bottom: 16px; color: var(--accent-hover); font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.login-signature { margin: 0; color: var(--muted); font-size: 12px; }
.login-panel { display: grid; align-content: center; width: 100%; padding: clamp(34px, 5vw, 64px); background: var(--surface); }
.login-panel h2 { margin-bottom: 9px; font-size: clamp(2.1rem, 3.2vw, 3rem); line-height: 1; }
.login-panel > p:not(.login-kicker, .security-note) { margin-bottom: 30px; }
.login-panel .form-stack { gap: 19px; }
.login-panel input { min-height: 50px; padding: 11px 13px; }
.login-panel .button { min-height: 50px; margin-top: 3px; }
.login-brand-mobile { display: none; }
.security-note { margin: 28px 0 0!important; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.55; }
.error-page { min-height: 55vh; }

@media (max-width: 1120px) {
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-strip > div:nth-child(2) { border-right: 0; }
  .status-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .worker-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .worker-metrics > div, .worker-metrics > div:nth-child(5n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .worker-metrics > div:nth-child(2n) { border-right: 0; }
  .worker-metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 20; width: min(290px, 86vw); transform: translateX(-105%); transition: transform .18s ease; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-scrim { position: fixed; inset: 0; z-index: 15; display: block; background: rgb(28 25 23 / 58%); }
  .nav-scrim[hidden] { display: none; }
  .topbar { position: sticky; top: 0; z-index: 10; justify-content: space-between; }
  .menu-button { display: inline-flex; }
  .content { padding: 22px 18px 36px; }
  .dashboard-grid, .two-column { grid-template-columns: minmax(0, 1fr); }
  .form-section { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .form-section-heading p { max-width: 65ch; }
  .table-scroll { overflow: visible; }
  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; padding: 10px; }
  tbody tr { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
  td { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  td:last-child { border-bottom: 0; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 800; }
  td .row-actions { align-items: flex-start; }
  .message-preview, .note-cell { min-width: 0; max-width: none; }
}

@media (max-width: 760px) {
  .login-page { align-items: start; padding: 0; background: var(--surface); }
  .login-shell { display: block; min-height: 100dvh; border: 0; box-shadow: none; }
  .login-intro { display: none; }
  .login-panel { min-height: 100dvh; align-content: center; padding: 30px max(22px, 7vw); }
  .login-brand-mobile { display: flex; margin-bottom: clamp(52px, 12vh, 92px); padding-bottom: 22px; border-bottom: 1px solid var(--line); }
  .login-panel h2 { font-size: clamp(2.2rem, 11vw, 3.2rem); }
}

@media (max-width: 580px) {
  .page-header { display: grid; }
  .page-header > .button { width: 100%; }
  .status-strip, .metric-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .status-strip > div, .status-strip > div:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .status-strip > div:last-child { border-bottom: 0; }
  .metric { min-height: 86px; }
  .form-section { padding: 17px; }
  .field-wide { grid-column: auto; }
  .form-actions, .danger-zone { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button, .form-actions form, .form-actions form .button, .danger-zone .button { width: 100%; }
  .safety-check ul { grid-template-columns: minmax(0, 1fr); }
  .error-summary { grid-template-columns: auto minmax(0, 1fr); }
  .error-summary > .badge:last-child { grid-column: 2; justify-self: start; }
  .error-actions form:first-child { display: grid; }
  .worker-metrics { grid-template-columns: minmax(0, 1fr); }
  .worker-metrics > div, .worker-metrics > div:nth-child(2n), .worker-metrics > div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .worker-metrics > div:last-child { border-bottom: 0; }
  td { grid-template-columns: minmax(88px, 31%) minmax(0, 1fr); }
}

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

@media print {
  .sidebar, .topbar, .page-header .button, .filterbar, .row-actions, .command-bar, .nav-scrim { display: none!important; }
  .app-shell { display: block; }
  .content { width: 100%; padding: 0; }
  .panel, .metric, .status-strip { box-shadow: none; }
}
