/* Keelson UI. Shared spacing, components, then responsive layout. */
:root {
  --ink: #19332f; --muted: #596e68; --line: #dce5df; --teal: #176858;
  --paper: #f4f7f5; --success: #187044; --danger: #b52e37; --warning: #95600c;
  --radius: 10px; --space: 24px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
a { color: var(--teal); text-decoration: none; }
a:hover { color: #0c483d; }
h1,h2,h3,p { margin-top: 0; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.8px; margin-bottom: 8px; overflow-wrap: anywhere; }
h2 { font-size: 17px; font-weight: 650; margin-bottom: 0; }
h3 { font-size: 14px; font-weight: 650; margin-bottom: 8px; }
p { line-height: 1.6; margin-bottom: 16px; }
.muted,.meta-label { color: var(--muted); }
.mono { font: 12px/1.6 ui-monospace, SFMono-Regular, monospace; overflow-wrap: anywhere; }
.eyebrow { font-size: 10px; letter-spacing: 1.5px; font-weight: 700; color: var(--teal); margin-bottom: 8px; }
.page-description { color: var(--muted); margin-bottom: 24px; }
a:focus-visible,button:focus-visible,summary:focus-visible { outline: 3px solid #419a81; outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 12px; padding: 12px; background: white; z-index: 100; }
.skip-link:focus { top: 8px; }
[hidden] { display: none !important; }

/* Page shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; flex: none; padding: 24px 14px; background: #153632; color: #c5d7d0; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 32px; color: white; font-size: 17px; letter-spacing: 2px; font-weight: 650; }
.brand:hover { color: white; }
.brand small { display: block; font-size: 8px; letter-spacing: 1.6px; margin-top: 4px; }
.brandmark { display: grid; place-items: center; width: 38px; height: 42px; flex: none; background: #d9eed2; color: #184137; border-radius: 10px 3px 10px 3px; font: bold 28px Georgia,serif; }
.navigation>summary { display: none; }
.nav-caption { font-size: 10px; letter-spacing: 1.6px; font-weight: 650; color: #98b6ab; margin: 24px 12px 12px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; color: #c5d7d0; font-size: 13px; padding: 11px 12px; border-radius: 6px; margin-bottom: 4px; }
.sidebar nav a span { width: 20px; font-size: 20px; line-height: 1; }
.sidebar nav a.active { background: #2e5046; color: #effbdc; font-weight: 600; }
.sidebar nav a:hover { background: #294b42; color: white; }
.sidebar-footer { margin-top: auto; padding: 32px 10px 0; font-size: 10px; }
.sidebar-footer small { display: block; margin-top: 8px; color: #9db8ae; }
.sidebar-footer a { color: #c5d7d0; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #89bb81; margin-right: 6px; }
.status-dot.amber { background: #b58735; }
.status-dot.ready { background: #187044; }
.status-dot.disabled { background: #64748b; }
.main { flex: 1; min-width: 0; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; background: white; border-bottom: 1px solid var(--line); }
.timezone-chip { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.account { display: flex; align-items: center; gap: 18px; font-size: 12px; }
.role { padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.logout { background: none; border: 0; color: var(--muted); font-size: 12px; padding: 6px 0; }
.content { max-width: 1580px; margin: auto; padding: 28px 32px 40px; min-height: calc(100vh - 120px); }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.heading p:last-child { margin-bottom: 0; }
.date-chip { background: white; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 12px; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 16px 32px; color: var(--muted); font-size: 11px; }

/* Shared cards, text and buttons */
.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 24px; overflow: hidden; }
.padded { padding: var(--space); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; }
.panel-heading p { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.panel-heading .eyebrow { color: var(--teal); font-size: 10px; margin: 0 0 8px; }
.panel-heading>a { font-size: 13px; white-space: nowrap; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading p { color: var(--muted); margin: 8px 0 0; font-size: 13px; }
.padded>h2 { margin-bottom: 20px; }
.padded>h3 { margin-top: 24px; }
.padded>p:last-child { margin-bottom: 0; }
.btn { padding: 10px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; line-height: 1.5; }
.btn-sm { padding: 8px 12px; font-size: 12px; }
.btn-primary { background: var(--teal); border-color: var(--teal); }
.btn-primary:hover { background: #104b40; border-color: #104b40; }
.btn-outline-secondary { color: #34594d; border-color: #cddbd2; background: white; }
.btn-outline-secondary:hover,.btn-outline-secondary:focus-visible { color: var(--teal); background: #eff5f0; border-color: #9dbbab; }
.btn-outline-secondary:focus-visible { outline: 3px solid #419a81; outline-offset: 3px; box-shadow: none; }
.button-row,.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.button-row { margin-top: 24px; }
.card-actions { padding: 18px 24px; border-top: 1px solid var(--line); margin-top: auto; }
.connection-card .card-actions .connection-delete { margin-left: auto; }
.card-actions>a:not(.btn) { margin-left: auto; font-size: 12px; font-weight: 600; }
.details { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 14px 24px; font-size: 13px; margin: 0 0 24px; }
.details dt { color: var(--muted); font-weight: 500; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.detail-secondary { display: inline-block; color: var(--muted); margin-left: 12px; }
.empty { padding: 36px 24px !important; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 12px 0 8px; }
.empty p { margin: 0; font-size: 13px; }
.empty-icon { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; margin: auto; display: grid; place-items: center; font-size: 24px; }
.alert { padding: 16px 20px; border-radius: 8px; margin-bottom: 24px; }
.alert p { margin: 8px 0 0; }
.alert ul:last-child { margin-bottom: 0; }

/* Status: text, shape and color always travel together. */
.status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 5px; font-size: 11px; font-weight: 600; line-height: 1.5; background: #edf1ef; color: #536a61; white-space: nowrap; }
.status-completed,.status-healthy,.status-sent { background: #e7f5ec; color: #17633e; }
.status-pull_failed,.status-push_failed,.status-failed,.status-unhealthy,.status-error { background: #ffebed; color: #aa2637; }
.status-warning,.status-degraded { background: #fff2d8; color: #8d5907; }
.status-unknown { background: #edf1f4; color: #5f6d7a; }
.status-pushing,.status-pulling { background: #e9f0ff; color: #375c9c; }
.health-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; font-size: 12px; font-weight: 650; line-height: 1.25; border-radius: 6px; border: 1px solid transparent; white-space: nowrap; }
.status-icon { width: 17px; height: 17px; flex: none; }
.health-healthy { background: #e7f6ed; color: #147044; border-color: #c4e8d4; }
.health-failed { background: #ffebee; color: #b62b40; border-color: #f4c8d0; }
.health-warning { background: #fff3d9; color: #8c5a05; border-color: #f1d99e; }
.health-unknown { background: #eef1f4; color: #5a6977; border-color: #d8e0e7; }
.legacy-label { font-size: 12px; color: #94600c; font-weight: 600; margin: 10px 0 0; }
.health-error { color: #a62c38; background: #fff4f4; padding: 10px 12px; border-radius: 6px; font-size: 12px; margin: 12px 0 0; overflow-wrap: anywhere; }

/* Read-only test results: strong contrast and distinct symbols. */
.diagnostic-badge { display: inline-flex; align-items: center; justify-content: flex-start; gap: 9px; min-width: 112px; min-height: 34px; padding: 7px 12px; border: 1px solid #c1cbd5; border-radius: 6px; background: #eef2f6; color: #45586c; font-size: 12px; font-weight: 750; line-height: 18px; letter-spacing: .35px; white-space: nowrap; }
.diagnostic-icon { width: 18px; height: 18px; flex: none; }
.diagnostic-pass { background: #187044; border-color: #187044; color: #fff; }
.diagnostic-fail { background: #b62b40; border-color: #b62b40; color: #fff; }
.diagnostic-skipped { background: #526477; border-color: #526477; color: #fff; }
.diagnostic-not_run { border-style: dashed; }
.diagnostic-stages { align-items: center; row-gap: 12px; }
.diagnostic-stages dt { font-weight: 600; }

/* Operations overview */
.operations-status { padding: 16px 20px; }
.operations-status-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.operations-status-heading>div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.operations-status-heading .muted { font-size: 12px; }
.operations-status-items { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.operations-status-items .status { white-space: normal; }
.operations-status-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.metric { display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--ink); }
.metric:hover { border-color: #76a18a; }
.metric p { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.metric p span { font-size: 16px; }
.metric strong { font-size: 34px; line-height: 1; font-weight: 650; margin-top: auto; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.metric small { font-size: 12px; color: var(--muted); }
.metric-danger { border-top: 3px solid #bd4851; }
.metric-danger strong { color: #aa303b; }
.overview-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 24px; align-items: stretch; }
.overview-grid > .panel { display: flex; flex-direction: column; }
.overview-grid .alert-list:has(> .empty) { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.health-list,.alert-list { max-height: 360px; overflow-y: auto; }
.health-row { display: block; padding: 16px 24px; border-top: 1px solid var(--line); color: var(--ink); }
.health-row:hover { background: #f6faf7; }
.health-row-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.health-row-heading strong { font-size: 14px; overflow-wrap: anywhere; }
.health-row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.mode-label { font-weight: 600; color: #385c50; }
.enabled-label { padding-left: 12px; border-left: 1px solid var(--line); }
.last-success { margin-left: auto; }
.alert-row { display: block; color: var(--ink); padding: 16px 24px; border-top: 1px solid var(--line); }
.alert-row:hover { background: #f6faf7; }
.alert-row>div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.alert-row p { margin: 8px 0; font-size: 13px; overflow-wrap: anywhere; }
.alert-row small { color: var(--muted); }

/* Connection and route cards */
.connection-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; align-items: stretch; }
.connection-card { display: flex; flex-direction: column; margin-bottom: 0; }
.connection-card-body { padding: 0 24px 24px; }
.connection-card .details { grid-template-columns: 130px minmax(0,1fr); margin-bottom: 0; }
.connection-health { background: #f7f9f7; border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 24px; }
.connection-health-line { display: grid; grid-template-columns: 118px minmax(0,1fr); gap: 16px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.connection-health-line:last-child { margin-bottom: 0; }
.connection-health-line .health-badge { justify-self: start; }
.connection-health-line time { overflow-wrap: anywhere; }
.connection-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.connection-tabs a { padding: 9px 14px; font-size: 13px; border-radius: 6px; }
.connection-tabs a.active { background: var(--teal); color: white; }
.route-banner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 24px; }
.path-main { flex: 1; min-width: 0; }
.path-label { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.path-label h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 18px; }
.route a { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; max-width: 260px; }
.route a small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 6px; }
.route>span { color: #8da998; font-size: 20px; }
.route>strong { padding: 8px 16px; border-radius: 6px; background: #edf5ed; border: 1px solid #d5e5d8; }
.path-description { font-size: 13px; color: var(--muted); margin: 18px 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.route-state { flex: 0 0 270px; width: 270px; min-width: 0; display: grid; grid-template-rows: 24px 40px; align-content: start; gap: 12px; font-size: 13px; }
.path-state-label { display: flex; align-items: center; gap: 8px; }
.path-state-label .status-dot { margin: 0; flex-shrink: 0; }
.path-last-scan { display: grid; grid-template-rows: 18px 20px; gap: 2px; color: var(--muted); font-size: 12px; }
.path-last-scan time { font-variant-numeric: tabular-nums; }
.path-run-slot { min-height: 36px; width: 220px; max-width: 100%; }
.path-run-slot form { margin: 0; }
.path-run-slot .btn { width: 100%; }
.path-run-slot .btn:disabled { background: #e9efeb; color: #53655b; border-color: #cddbd2; opacity: 1; }
.path-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.path-actions .btn { min-width: 104px; }
.path-actions .path-edit { color: var(--teal); background: #eff5f0; border-color: #9dbbab; }
.btn.btn-delete-subtle { color: #991b1b; background: #fff1f2; border-color: #f0b8be; }
.btn.btn-delete-subtle:hover,.btn.btn-delete-subtle:focus-visible { color: #7f1d1d; background: #ffe4e6; border-color: #dc8d98; }
.btn.btn-delete-subtle:focus-visible { outline-color: #be3548; }
.path-state-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.path-state-error { color: #991b1b; }
.schedule-preview { font-size: 13px; margin-top: 16px; }
.schedule-preview summary,.audit-changes summary { color: var(--teal); cursor: pointer; }
.schedule-preview ul { padding-left: 20px; margin: 12px 0; }
.transfer-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; background: white; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 24px; }
.transfer-summary form { margin-left: auto; }

/* Tables and forms */
.relay-table { margin: 0; font-size: 13px; }
.relay-table thead th { padding: 13px 20px; background: #f8faf8; color: #536a60; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; border-color: var(--line); white-space: nowrap; }
.relay-table td { padding: 16px 20px; vertical-align: middle; border-color: var(--line); }
.relay-table td small { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; }
.file-link { font-weight: 600; overflow-wrap: anywhere; }
.pagination-row { display: flex; justify-content: center; align-items: center; gap: 24px; padding: 20px; font-size: 13px; }
.audit-changes summary { font-weight: 600; }
.audit-changes dl { min-width: 220px; max-width: 440px; margin: 14px 0 0; overflow-wrap: anywhere; }
.audit-changes dt,.audit-changes dd { font-size: 12px; }
.audit-changes dd { padding-bottom: 8px; }
input:not([type=checkbox]):not([type=hidden]),select,textarea { width: 100%; border: 1px solid #c6d6ca; border-radius: 6px; background: white; color: var(--ink); padding: 10px 12px; font-size: 13px; line-height: 1.5; min-height: 42px; }
input:focus,select:focus,textarea:focus { outline: 2px solid #74aa92; outline-offset: 1px; }
input:disabled,select:disabled,textarea:disabled { background: #f3f6f3; color: #667b70; }
input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--teal); margin: 0; }
.field { margin-bottom: 24px; min-width: 0; }
.field>label,.filter-form label,.timezone-form label,.login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.6; }
.field .checkbox-control { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin: 0; font-size: 13px; font-weight: 600; line-height: 20px; }
.checkbox-control input { margin-top: 1px; }
.checkbox-control span { min-width: 0; }
.form-panel { max-width: 1040px; }
/* Adjacent fields share heading, control and supporting-text tracks.
   A checkbox reserves the heading track even when it has no separate title. */
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 24px; row-gap: 8px; }
.settings-grid>.grid-field { display: grid; grid-template-rows: subgrid; grid-row: span 3; margin: 0 0 16px; row-gap: 8px; }
.settings-grid .grid-field-heading { margin: 0; min-height: 19.5px; font-size: 13px; line-height: 1.5; align-self: end; }
.grid-field-input { min-width: 0; align-self: start; }
.grid-field-support { min-width: 0; }
.grid-field-support small { margin: 0; }
.grid-field-support .errorlist { margin-bottom: 0; }
@supports not (grid-template-rows: subgrid) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid>.grid-field { grid-template-rows: auto auto auto; }
}
.wide-field { grid-column: 1/-1; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 20px; }
.algorithm-field div label { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; font: 12px/20px ui-monospace,monospace; overflow-wrap: anywhere; }
.algorithm-field div input { margin-top: 1px; }
.errorlist { color: #b32937; font-size: 12px; padding-left: 18px; margin-top: 8px; }
.filter-form { padding: 20px 24px; }
.filter-primary { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr) minmax(0,1fr); gap: 16px; }
.filter-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.advanced-filters { margin-top: 20px; }
.advanced-filters summary { color: var(--teal); font-size: 13px; cursor: pointer; }
.advanced-filters[open] summary { margin-bottom: 16px; }
.filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }

/* Transfer path form: intentional pairs, independent of DOM field order. */
.path-form-section { border: 0; padding: 0; margin: 0; min-width: 0; }
.path-form-section + .path-form-section { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 28px; }
.path-form-section legend { float: none; width: auto; font-size: 16px; font-weight: 650; margin-bottom: 20px; }
.path-form-section .field { margin: 0; }
.path-form-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; align-items: start; margin-top: 24px; }
.path-form-section legend + .path-form-row { margin-top: 0; }
.path-endpoints { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; position: relative; margin-top: 24px; }
.path-direction-arrow { position: absolute; left: 50%; top: 33px; transform: translateX(-50%); width: 24px; text-align: center; font-size: 20px; font-weight: 650; color: var(--teal); }
.path-form-section .path-description-field { margin-top: 24px; }
.field-caption { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; line-height: 1.5; }
.option-input { display: flex; align-items: center; min-height: 42px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #f7faf7; }
.option-input .checkbox-control { width: 100%; }
.cron-preset-field { margin-top: 16px; }
.cron-preset-field>label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.path-schedule-value { min-width: 0; }
@media(max-width:760px) {
  .path-form-row { grid-template-columns: 1fr; gap: 20px; }
  .path-endpoints { gap: 24px; }
  .path-endpoints label { font-size: 12px; }
  .path-endpoints select { padding-inline: 6px; font-size: 12px; }
  .path-endpoints small { font-size: 11px; }
}

/* System settings and capacity */
.timezone-form { display: flex; align-items: flex-end; gap: 16px; }
.timezone-form>div { flex: 1; max-width: 520px; }
.timezone-form .btn { flex: none; }
.setting-note { color: var(--muted); font-size: 12px; margin: 16px 0 0; line-height: 1.7; }
.service-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.service-card { padding: 20px; margin: 0; }
.service-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.service-heading h2 { margin: 0; }
.service-indicator { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; }
.is-up { color: #187044; background: #e7f6ed; }
.is-down { color: #b62b40; background: #ffebee; }
.service-card .status { white-space: normal; }
.storage-list { display: grid; gap: 24px; }
.storage-row { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.storage-row:last-child { padding-bottom: 0; border-bottom: 0; }
.storage-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.storage-heading h3 { font-size: 14px; margin: 0; }
.storage-heading>span { color: var(--muted); font-size: 13px; }
.storage-heading strong { color: var(--ink); }
.storage-meter { height: 10px; background: #eaf0ec; border-radius: 6px; overflow: hidden; }
.storage-meter span { display: block; height: 100%; border-radius: inherit; background: #32856c; }
.storage-warning span { background: #cb932c; }
.storage-critical span { background: #c24652; }
.storage-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; margin-top: 10px; }
.storage-files { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; background: #edf3ed; }
.login-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 40px; width: 440px; max-width: calc(100% - 32px); box-shadow: 0 16px 48px #18382a0c; }
.login-card form { margin-top: 24px; }
.login-note { font-size: 11px; color: var(--muted); text-align: center; margin: 24px 0 0; }

@media(max-width:1150px) {
  .sidebar { width: 200px; }
  .content { padding: 24px; }
  .overview-grid { grid-template-columns: 1fr; gap: 0; }
  .connection-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:760px) {
  :root { --space: 20px; }
  .shell { display: block; }
  .sidebar { position: static; width: auto; height: auto; padding: 16px 20px; }
  .brand { margin: 0 0 12px; }
  .navigation>summary { display: list-item; cursor: pointer; padding: 8px 0; color: white; font-weight: 600; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 8px; }
  .sidebar nav a { font-size: 12px; padding: 8px; }
  .sidebar nav a span,.nav-caption,.sidebar-footer { display: none; }
  .topbar { height: auto; min-height: 76px; flex-wrap: wrap; padding: 12px 20px; gap: 12px; }
  .account { width: 100%; justify-content: space-between; gap: 12px; }
  .content { padding: 24px 16px; }
  h1 { font-size: 27px; }
  .heading { align-items: flex-start; flex-wrap: wrap; gap: 16px; }
  .page-footer { padding: 16px; flex-direction: column; gap: 6px; }
  .panel-heading { padding: 18px 20px; gap: 12px; }
  .panel-heading>a { font-size: 12px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .metric { padding: 16px; }
  .metric p { font-size: 12px; }
  .metric small { font-size: 11px; }
  .health-row,.alert-row { padding: 16px 20px; }
  .health-row-meta { gap: 8px 12px; }
  .last-success { flex-basis: 100%; margin-left: 0; }
  .health-badge { padding: 6px 8px; font-size: 11px; }
  .connection-card-body { padding: 0 20px 20px; }
  .connection-health { padding: 14px; }
  .connection-health-line { grid-template-columns: 108px minmax(0,1fr); gap: 10px; font-size: 12px; }
  .details,.connection-card .details { grid-template-columns: 100px minmax(0,1fr); gap: 14px 16px; }
  .card-actions { padding: 16px 20px; gap: 10px; }
  .card-actions>a:not(.btn) { margin-left: 0; }
  .settings-grid,.filter-primary,.filter-grid { grid-template-columns: 1fr; gap: 20px; }
  .settings-grid { row-gap: 8px; }
  .settings-grid .grid-field-heading:empty { display: none; }
  .settings-grid>.grid-field:has(.grid-field-heading:empty) { grid-row: span 2; }
  .filter-form { padding: 20px; }
  .timezone-form { flex-direction: column; align-items: stretch; gap: 16px; }
  .timezone-form>div { max-width: none; }
  .section-heading { flex-wrap: wrap; }
  .service-grid { gap: 12px; }
  .service-card { padding: 16px; }
  .service-heading { gap: 8px; }
  .service-heading h2 { font-size: 15px; }
  .storage-meta { flex-wrap: wrap; gap: 6px; }
  .route-banner { flex-direction: column; align-items: stretch; padding: 20px; }
  .route { gap: 10px; }
  .route a { max-width: 100%; }
  .route>strong { padding: 6px 10px; }
  .route-state { flex: none; width: auto; padding-top: 16px; border-top: 1px solid var(--line); }
  .relay-table th,.relay-table td { padding: 12px 16px; }
  .relay-table:has(.empty) { table-layout: fixed; width: 100%; }
  .relay-table:has(.empty) thead { display: none; }
  .transfer-summary { padding: 20px; }
  .login-card { padding: 28px; }
}

/* Action history: aligned columns, strong result contrast, wrapped metadata. */
.activity-table { min-width: 800px; }
.activity-table td { vertical-align: top; }
.activity-time { white-space: nowrap; font-size: .8rem; }
.activity-meta { display: block; margin-top: .35rem; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.activity-file { overflow-wrap: anywhere; }
.activity-error { color: #9b1c1c; }
.activity-badge { display: inline-flex; align-items: center; gap: .45rem; min-height: 32px; padding: .3rem .65rem; border: 1px solid; border-radius: 6px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.activity-success { color: #14532d; background: #dcfce7; border-color: #86c99b; }
.activity-failed { color: #991b1b; background: #fee2e2; border-color: #f2aaaa; }
.activity-started { color: #1e40af; background: #dbeafe; border-color: #93baf1; }
.activity-skipped { color: #475569; background: #e2e8f0; border-color: #a8b5c7; }
.activity-info { color: #475569; background: #f8fafc; border-color: #cbd5e1; }

.activity-filter-primary { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.4fr); }
.activity-table:has(.empty) { min-width: 0; }
@media (max-width: 767px) { .activity-filter-primary { grid-template-columns: 1fr; } }

.activity-technical { max-width: 540px; line-height: 1.5; }
.activity-technical code { color: #334155; font-size: .78rem; white-space: normal; overflow-wrap: anywhere; }
@media (min-width: 768px) and (max-width: 1250px) { .activity-filter-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.activity-order { display: flex; align-items: center; gap: 10px; }
.activity-order label { margin: 0; white-space: nowrap; }
.activity-order select { width: auto; min-width: 160px; }
.activity-time time strong { font-variant-numeric: tabular-nums; }
@media (max-width: 767px) { .activity-order { flex-basis: 100%; } }

.activity-filter-primary [name="run"] { font-size: .8rem; }

.archive-filter-grid .field { margin: 0; }
.archive-retention-controls { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }

/* Dashboard connection rows: up to five share the available height. */
.health-list { display: grid; grid-auto-rows: minmax(90px, auto); max-height: 450px; }
.health-list:not(:has(.health-row:nth-child(6))) { min-height: 450px; max-height: none; overflow-y: visible; grid-auto-rows: minmax(min-content, 1fr); flex: 1; }
.health-list .health-row { display: flex; flex-direction: column; justify-content: center; padding: 10px 20px; }
.health-list .health-badge { padding: 4px 8px; }
.health-list .health-row-meta { margin-top: 4px; gap: 4px 12px; }
.health-notices { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-size: 11px; line-height: 16px; }
.health-error-code { color: #a62c38; overflow-wrap: anywhere; }
.health-legacy { color: #8c5a05; }

.overview-grid .alert-list:has(> .empty) { max-height: none; }

.destination-options { min-height: 42px; max-height: 220px; overflow-y: auto; border: 1px solid #c6d6ca; border-radius: 6px; padding: 8px 12px; background: white; }
.destination-options label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 0; font-weight: 500; }
.destination-options input:disabled + span { color: var(--muted); }
.path-destinations { display: grid; gap: 12px; min-width: 0; }
.path-destinations > a + a { border-top: 1px solid var(--line); padding-top: 10px; }

/* Whole-run activity trace: chronological actions stay together in one table row. */
.activity-run-timeline { list-style: none; margin: 0; padding: 0; }
.activity-run-timeline>li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.activity-run-timeline>li:first-child { padding-top: 0; }
.activity-run-timeline>li:last-child { padding-bottom: 0; border-bottom: 0; }
.activity-action-heading { display: grid; grid-template-columns: 96px 50px minmax(0,1fr) auto; align-items: start; gap: 6px; margin-bottom: 0; }
.activity-action-heading time { font-family: var(--bs-font-monospace); font-size: 10.5px; line-height: 18px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.activity-action-heading strong { font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.activity-action-heading .activity-badge { min-height: 18px; padding: 0 4px; border-radius: 3px; font-size: 10px; line-height: 16px; justify-content: center; }
.activity-action-date { font-size: 10px; line-height: 16px; color: var(--muted); margin-bottom: 2px; }
.activity-action-meta { display: flex; flex-wrap: wrap; gap: 0 10px; }
.activity-action-meta .activity-meta { margin: 0; font-size: 11px; line-height: 1.35; max-width: 100%; }
.activity-action-meta .activity-technical code { font-size: 11px; }
.activity-event-id { line-height: 18px; font-size: 10px; color: var(--muted); }
.activity-run-actions { min-width: 420px; }
.activity-run-result .activity-badge { display: inline-flex; margin-bottom: 8px; white-space: nowrap; }
.activity-run-link { overflow-wrap: anywhere; min-width: 110px; }
.activity-filter-note { font-size: 12px; margin-bottom: 16px; }

.activity-notice-label { font-size: 10px; line-height: 18px; color: var(--muted); text-align: center; }
.activity-unresolved { margin-top: 6px; max-width: 180px; font-size: 11px; line-height: 1.4; color: #8c5a05; }
.activity-unresolved summary { cursor: pointer; }
.activity-unresolved p { margin: 5px 0 0; overflow-wrap: anywhere; }

.activity-action-meta .activity-location { color: var(--teal); font-weight: 600; }
