/* BackupHub professional theme layer.
   Loaded after app.css / v3.css / compact.css. It redefines the design tokens
   (calm neutrals, one accent, semantic status colors) and refines components.
   Light is the default; dark applies via :root[data-theme="dark"], which the
   inline script in base.html sets before first paint (Light / System / Dark). */

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --text: #101828;
  --text-2: #344054;
  --muted: #5d6679;
  --border: #e4e7ec;
  --border-strong: #cfd4dc;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-text: #3730a3;
  --success: #079455;
  --success-text: #067647;
  --success-soft: #ecfdf3;
  --warning: #dc6803;
  --warning-text: #b54708;
  --warning-soft: #fffaeb;
  --danger: #d92d20;
  --danger-text: #b42318;
  --danger-soft: #fef3f2;
  --info: #1570ef;
  --info-text: #175cd3;
  --info-soft: #eff8ff;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
  --sidebar: 248px;
  --topbar: 60px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f17;
  --bg-soft: #0f141e;
  --surface: #131925;
  --surface-2: #182030;
  --surface-3: #1f293b;
  --text: #eceff4;
  --text-2: #c9d0dc;
  --muted: #98a2b3;
  --border: #243044;
  --border-strong: #33415a;
  --primary: #6366f1;
  --primary-hover: #7578f5;
  --primary-soft: #1e1f4a;
  --primary-text: #a5b4fc;
  --success: #17b26a;
  --success-text: #47cd89;
  --success-soft: #0d2a1e;
  --warning: #f79009;
  --warning-text: #fdb022;
  --warning-soft: #2e2110;
  --danger: #f04438;
  --danger-text: #fd8a80;
  --danger-soft: #331717;
  --info: #2e90fa;
  --info-text: #84caff;
  --info-soft: #102a46;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 40px -10px rgba(0, 0, 0, .6);
}

/* ---------- Base ---------- */
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3 { color: var(--text); letter-spacing: -.015em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); color: var(--text-2); }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-weight: 600; }
.skip-link:focus { top: 12px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { box-shadow: var(--ring); border-color: var(--primary) !important; }
tbody td, .system-metrics strong, .kpi-card strong, .big-number, .forecast, .activity-size { font-variant-numeric: tabular-nums; }

/* ---------- Sidebar ---------- */
.sidebar { background: var(--bg-soft); border-right: 1px solid var(--border); padding: 16px 12px; }
.brand { padding: 2px 8px 16px; gap: 10px; }
.brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 9px; background: var(--primary); box-shadow: none; color: #fff; }
.brand-mark .icon { width: 19px; height: 19px; }
.brand strong { font-size: 15px; font-weight: 700; color: var(--text); }
.brand small { font-size: 11.5px; color: var(--muted); }
.side-nav { gap: 2px; }
.side-nav a { min-height: 36px; padding: 8px 10px; gap: 10px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.side-nav a .icon { width: 18px; height: 18px; color: var(--muted); }
.side-nav a:hover { background: var(--surface-3); color: var(--text); }
.side-nav a:hover .icon { color: var(--text); }
.side-nav a.active { background: var(--primary-soft); color: var(--primary-text); box-shadow: none; font-weight: 600; }
.side-nav a.active .icon { color: var(--primary-text); }
.nav-label { padding: 16px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.side-nav > .nav-label:first-child { padding-top: 4px; }
.secure-badge { border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px 12px; }
.secure-badge strong { font-size: 12.5px; font-weight: 600; }
.secure-badge small { font-size: 11.5px; }

/* ---------- Top bar ---------- */
.topbar { height: var(--topbar); padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); }
.top-title { font-size: 14px; font-weight: 600; color: var(--text); }
.top-actions { gap: 10px; }
.icon-button, .mobile-menu { width: 36px; height: 36px; min-width: 36px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); }
.icon-button:hover, .mobile-menu:hover { background: var(--surface-2); color: var(--text); }
.notification-button b { font-size: 10.5px; border-color: var(--surface); }

.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.theme-switch button { width: 30px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.theme-switch button .icon { width: 16px; height: 16px; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
:root[data-theme="dark"] .theme-switch button.active { background: var(--surface-3); }

.user-dropdown { position: relative; }
.user-dropdown > summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.user-dropdown > summary::-webkit-details-marker { display: none; }
.user-dropdown > summary:hover, .user-dropdown[open] > summary { background: var(--surface); border-color: var(--border); }
.user-dropdown .chevron { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.user-dropdown[open] .chevron { transform: rotate(180deg); }
.avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); font-weight: 700; font-size: 13px; }
.user-copy strong { font-size: 13px; font-weight: 600; color: var(--text); }
.user-copy small { font-size: 11.5px; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 230px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); }
.dropdown-head { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.dropdown-head strong, .dropdown-head small { display: block; }
.dropdown-head strong { font-size: 13.5px; font-weight: 600; }
.dropdown-head small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text-2); }
.dropdown-menu a .icon { width: 16px; height: 16px; color: var(--muted); }
.dropdown-menu a:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Layout ---------- */
.container { padding: 28px 32px 56px; max-width: 1480px; }
.page-head { margin-bottom: 20px; align-items: flex-end; }
.page-head h1, .compact-head h1, .system-title-row h1 { font-size: clamp(22px, 2vw, 26px); font-weight: 700; letter-spacing: -.02em; }
.page-head p { font-size: 14px; }
.hero-head h1 { font-size: clamp(22px, 2vw, 26px); }
.section-title-row { margin: 28px 0 12px; }
.section-title-row h2, .section-head h2 { font-size: 16px; font-weight: 600; }
.back { font-size: 13px; gap: 6px; margin-bottom: 8px; }
.back .icon { width: 15px; height: 15px; }

/* ---------- Cards ---------- */
.card, .v3-card { border-radius: var(--radius); box-shadow: var(--shadow-sm); border-color: var(--border); }
.card { padding: 20px; }
.v3-card { padding: 20px; }
.card:hover { border-color: var(--border); }
.card > h2, .v3-card > h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.big-number { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.forecast { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }

/* KPI tiles: neutral surfaces with a colored icon chip instead of loud gradients. */
.kpi-grid { gap: 16px; margin-bottom: 16px; }
.kpi-card { --accent: var(--primary); min-height: 0; padding: 18px 20px; gap: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.kpi-card.purple { --accent: var(--primary); background: var(--surface); }
.kpi-card.green { --accent: var(--success); background: var(--surface); }
.kpi-card.orange { --accent: var(--warning); background: var(--surface); }
.kpi-card.blue { --accent: var(--info); background: var(--surface); }
.kpi-icon { width: 44px; height: 44px; flex-basis: 44px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.kpi-icon .icon { width: 22px; height: 22px; }
.kpi-card span { font-size: 13px; font-weight: 500; color: var(--muted); opacity: 1; }
.kpi-card strong { margin: 4px 0 2px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.kpi-card small { font-size: 12.5px; color: var(--muted); opacity: 1; }

.dashboard-grid { gap: 16px; margin-bottom: 4px; }
.storage-panel, .health-panel { min-height: 0; }
.donut { width: 104px; height: 104px; }
.donut:before { inset: 11px; }
.donut strong { font-size: 20px; font-weight: 700; }
.donut span { font-size: 12px; }
.storage-copy > div { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.storage-copy span { font-size: 12px; }
.storage-copy strong { font-size: 15px; font-weight: 600; }
.progress { height: 8px; margin-top: 16px; }
.gradient-progress span { background: var(--primary); }

.health-stack { display: flex; gap: 3px; height: 12px; margin-top: 18px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.health-stack .seg { min-width: 6px; }
.health-stack .good { background: var(--success); }
.health-stack .warn { background: var(--warning); }
.health-stack .bad { background: var(--danger); }
.health-stack .empty { background: var(--surface-3); }
.health-legend { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; }
.health-legend li { display: grid; grid-template-columns: 1fr auto 52px; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.health-legend li:last-child { border-bottom: 0; }
.health-legend strong { font-size: 15px; font-weight: 600; }
.health-legend small { text-align: right; color: var(--muted); font-size: 12.5px; }
.dot { width: 8px; height: 8px; margin-right: 8px; }

/* ---------- Status badges ---------- */
.status, .overall { padding: 3px 10px 3px 8px; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; border-radius: 999px; }
.status.large { padding: 5px 12px 5px 10px; font-size: 12.5px; }
.status.running { color: var(--info-text); }
.status.queued, .status.maintenance { color: var(--primary-text); }
.overall { font-size: 13px; padding: 6px 12px 6px 10px; }
.pill { font-size: 12px; padding: 4px 10px; }
.tiny-badge { font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 3px 8px; }
.tag { font-size: 12px; padding: 2px 9px; }

/* ---------- System cards ---------- */
.system-grid { gap: 16px; }
.system-card { min-height: 0; padding: 20px; gap: 14px; }
.system-card:hover { transform: none; border-color: var(--border-strong); box-shadow: var(--shadow); }
.system-icon { width: 40px; height: 40px; border-radius: 10px; }
.system-icon .icon { width: 20px; height: 20px; }
.system-card h2 { font-size: 17px; font-weight: 600; }
.system-card .reason { font-size: 13px; }
.system-card .eyebrow { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
.sparkline { height: 56px; }
.system-metrics { gap: 10px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 12px; border-top: 1px solid var(--border); }
.system-metrics span { font-size: 11.5px; text-transform: none; letter-spacing: 0; }
.system-metrics strong { font-size: 13px; font-weight: 600; margin-top: 2px; }
.card-warning { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12.5px; border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent); }
.card-warning .icon { width: 16px; height: 16px; }

/* ---------- Activity ---------- */
.activity-card { margin-top: 16px; }
.activity-list > a { padding: 11px 4px; gap: 14px; border-radius: var(--radius-sm); }
.activity-list > a:hover { background: var(--surface-2); }
.activity-icon { width: 32px; height: 32px; border-radius: 50%; }
.activity-icon .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.activity-icon.ok { background: var(--success-soft); color: var(--success-text); }
.activity-icon.pending { background: var(--warning-soft); color: var(--warning-text); }
.activity-list strong { font-size: 13.5px; font-weight: 600; }
.activity-list small { font-size: 12px; }
.activity-size { font-size: 13px; }

/* ---------- Buttons ---------- */
.action-btn, .primary, .secondary, .btn { min-height: 36px; padding: 8px 14px; gap: 8px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); }
.action-btn .icon, .primary .icon, .secondary .icon, .btn .icon { width: 16px; height: 16px; }
.action-btn:hover, .secondary:hover, .btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.action-btn.primary, .primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.action-btn.primary:hover, .primary:hover, .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.action-btn.verify, .action-btn.restore { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.action-btn.verify .icon { color: var(--success); }
.action-btn.restore .icon { color: var(--warning); }
.action-btn.verify:hover, .action-btn.restore:hover { background: var(--surface-2); color: var(--text); }
.text-button { font-size: 13px; font-weight: 600; }
.compact { min-height: 34px; }

/* ---------- Forms ---------- */
.stack { gap: 14px; }
.stack label, .quick-compare-form label, .compare-picker label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.stack input, .stack select, .stack textarea, .quick-compare-form select, .compare-picker select { min-height: 40px; margin-top: 6px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 14px; box-shadow: var(--shadow-sm); }
.stack input:hover, .stack select:hover, .stack textarea:hover { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--muted)); }
.stack label small { font-size: 12px; color: var(--muted); }
.alert, .token-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; }
.alert .icon { width: 18px; height: 18px; }
.alert:not(.warn):not(.danger) { color: var(--success-text); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, var(--border)); }
.token-box { display: block; font-size: 13px; }

/* ---------- Tables ---------- */
.table-wrap { border-radius: var(--radius-sm); }
table { font-size: 13.5px; }
th, td { padding: 11px 14px; }
thead th { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); background: var(--surface-2); }
tbody tr:hover td { background: var(--surface-2); }
.backup-link { font-weight: 600; }
.backup-link:hover { color: var(--primary); }
.log { font-family: var(--mono); font-size: 12.5px; background: #0b1020; color: #d7dfec; border-color: var(--border); }

/* ---------- Misc pages ---------- */
.metric-card span, .compact-metric span { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--muted); }
.metric-card strong, .compact-metric strong { font-size: 15px; font-weight: 600; }
.notification-item { padding: 14px 0; }
.notification-item strong { font-size: 14px; font-weight: 600; }
.empty-line { font-size: 13.5px; }
.empty-icon .icon { width: 28px; height: 28px; }
.system-add-icon .icon { width: 20px; height: 20px; }
.compare-arrow .icon { width: 18px; height: 18px; color: var(--muted); }
.inline-anomaly span .icon { width: 18px; height: 18px; }
.storage-row .split { font-size: 13.5px; }
.storage-row .bar { height: 8px; }
.day-cell { width: 26px; height: 26px; font-size: 11px; border-radius: 6px; }
.heatmap .system-name { font-weight: 600; }
.steps strong { font-size: 13px; }
.steps small { font-size: 12px; }
.job-progress span { background: var(--primary); }

/* ---------- Sign in ---------- */
.auth-page { overflow: auto; background: var(--bg); }
.auth-theme { position: fixed; top: 16px; right: 16px; z-index: 10; }
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.signin-panel { width: min(100%, 420px); margin: auto; padding: 48px 24px; }
.signin-brand { padding: 0 0 36px; }
.signin-panel h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.signin-panel > .muted { margin: 0 0 24px; font-size: 14.5px; }
.signin-form { gap: 16px; }
.signin-form .input-wrap { position: relative; }
.signin-form .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); margin-top: 3px; pointer-events: none; }
.signin-form .input-wrap input { padding-left: 38px; padding-right: 64px; height: 44px; }
.signin-form .peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-top: 3px; padding: 5px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.signin-form .peek:hover { background: var(--surface-3); color: var(--text); }
.signin-button { width: 100%; min-height: 44px; margin-top: 4px; font-size: 14.5px; }
.signin-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; font-size: 12.5px; color: var(--muted); }
.signin-note .icon { width: 14px; height: 14px; }
.signin-aside { display: flex; align-items: center; justify-content: center; padding: 48px; background: linear-gradient(160deg, #312e81 0%, #1e1b4b 55%, #0f172a 100%); color: #e0e7ff; position: relative; overflow: hidden; }
.signin-aside::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 22px 22px; }
.signin-aside-inner { position: relative; max-width: 440px; }
.signin-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); font-size: 13px; font-weight: 500; }
.signin-pill .icon { width: 16px; height: 16px; color: #86efac; }
.signin-aside h2 { margin: 20px 0 24px; color: #fff; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.signin-aside ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.signin-aside li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: #c7d2fe; }
.signin-aside li .icon { width: 20px; height: 20px; padding: 7px; box-sizing: content-box; border-radius: 8px; background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .container { padding: 20px 18px 48px; }
  .topbar { padding: 0 14px; }
  .signin { grid-template-columns: 1fr; }
  .signin-aside { display: none; }
}
@media (max-width: 700px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { padding: 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .kpi-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .kpi-card strong { font-size: 22px; }
  .kpi-card span { font-size: 12.5px; }
  .kpi-card small { font-size: 12px; }
  .system-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .storage-viz { grid-template-columns: 1fr; justify-items: center; }
  .storage-copy { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .user-copy, .user-dropdown .chevron { display: none; }
  .user-dropdown > summary { padding: 2px; }
  .theme-switch button { width: 28px; height: 26px; }
  .card, .v3-card, .system-card { padding: 16px; }
  .activity-list > a { grid-template-columns: auto minmax(0, 1fr) auto; }
  .activity-size { display: none; }
}
@media (max-width: 430px) {
  .topbar { height: 56px; padding: 0 10px; }
  .top-actions { gap: 6px; }
  .icon-button, .mobile-menu { width: 34px; height: 34px; min-width: 34px; }
  .kpi-card strong { font-size: 20px; }
  .storage-copy strong { font-size: 13px; }
  .status, .overall { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Long timestamps wrap instead of being cut off in system cards. */
.system-metrics strong { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }

/* ---------- Readable sizes for the compact system / compare views ---------- */
.system-reason { font-size: 13.5px; margin-top: 6px; }
.compact-actions { gap: 8px; }
.compact-actions .action-btn { min-height: 36px; padding: 8px 12px; font-size: 13px; }
.compact-metric span { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.compact-metric strong { font-size: 16px; font-weight: 600; margin-top: 4px; }
.compact-section-head h2 { font-size: 16px; font-weight: 600; }
.compact-copy { font-size: 13px; }
.compact-ring { width: 64px; height: 64px; }
.compact-ring strong { font-size: 16px; }
.readiness-checks { font-size: 13px; line-height: 1.7; }
.system-note { font-size: 12.5px; }
.inline-anomaly strong { font-size: 13px; }
.inline-anomaly small { font-size: 12px; }
.inline-anomaly a { font-size: 12.5px; font-weight: 600; }
.quick-compare-form label > span, .compare-picker label > span { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; margin-bottom: 6px; }
.quick-compare-form select, .compare-picker select { min-height: 40px; padding: 8px 12px; font-size: 13.5px; }
.compact-table table { font-size: 13px; }
.compact-table th { font-size: 12px; }
.compact-table .status { font-size: 11.5px; padding: 2px 8px; }
.compare-summary-grid .metric-card strong { font-size: 18px; }
.compare-summary-grid .metric-card small { font-size: 12px; }
.compare-note, .temp-clean-note { font-size: 12.5px; }
.temp-clean-note .icon { width: 15px; height: 15px; }
@media (max-width: 760px) {
  .table-wrap:not(.calendar-wrap) table:not(.heatmap) td::before { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; }
}
@media (max-width: 430px) {
  .compact-metric strong { font-size: 14px; }
}

/* ---------- Inline controls, disclosures, job cards ---------- */
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
td select, .inline-form select { min-height: 34px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; }
td .secondary, .inline-form .secondary { min-height: 34px; padding: 6px 12px; font-size: 13px; }
td input[type="password"] { min-height: 34px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; }
details > summary { cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 500; }
details > summary:hover { color: var(--text); }
td details[open] > form { margin-top: 8px; }
.job-card h2 { margin: 6px 0 12px; font-size: 18px; font-weight: 600; }
.job-card form { margin: 14px 0 4px; }
.job-card details { margin-top: 12px; }
.job-card .log { margin-top: 10px; }

/* Tables inside the narrower column of two-column admin pages scroll instead of crushing cells. */
@media (min-width: 761px) {
  .two-col .table-wrap table { min-width: 720px; }
  .two-col .table-wrap td { overflow-wrap: normal !important; word-break: normal; }
}
td .secondary, td button, td .status { white-space: nowrap; }

/* ---------- Touch devices: comfortable tap targets (~40-44px) ---------- */
.steps b { font-size: 12px; }
@media (pointer: coarse) {
  .theme-switch button { width: 36px; height: 34px; }
  .icon-button, .mobile-menu { width: 40px; height: 40px; min-width: 40px; }
  .user-dropdown > summary { min-height: 40px; }
  .side-nav a { min-height: 44px; }
  .dropdown-menu a { min-height: 44px; }
  .back { min-height: 40px; padding: 8px 0; margin-bottom: 0; }
  .inline-anomaly a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 6px; }
  .text-button { min-height: 40px; padding: 8px 0; }
  .backup-link, td > a, .system-name a { display: inline-flex; align-items: center; min-height: 40px; }
  .action-btn, .primary, .secondary, .btn { min-height: 42px; }
  .stack input, .stack select, .stack textarea, .quick-compare-form select, .compare-picker select { min-height: 44px; font-size: 16px; }
  td select, .inline-form select, td input[type="password"], td .secondary, .inline-form .secondary { min-height: 40px; font-size: 15px; }
  details > summary { min-height: 40px; display: flex; align-items: center; }
}

/* ---------- Phone layout fixes ---------- */
@media (max-width: 700px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head > div { text-align: left; }
  .compact-metric strong { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
}
