/* ═══════════════════════════════════════════════════════════════════════════
   CI/CD Monitor — visual theme layer (2026)
   Loads after dashboard.css. Same class names & layout; new palette + polish.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design tokens (override dashboard :root / html.light) ─────────────── */
:root {
  --ok: #2dd4bf;
  --fail: #fb7185;
  --warn: #fbbf24;
  --info: #38bdf8;
  --purple: #a78bfa;

  --bg: #05080f;
  --surface: #0c111c;
  --surface2: #131b2a;
  --surface3: #1a2438;
  --text: #eef2f8;
  --muted: #8b97a8;
  --border: #273549;

  --radius: 0.875rem;
  --accent: #7dd3fc;

  --shell-line: rgba(125, 211, 252, 0.08);
  --shell-glow: 0 0 40px -12px rgba(56, 189, 248, 0.15);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-float: 0 12px 40px -8px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --focus-ring: 0 0 0 3px rgba(56, 189, 248, 0.35);

  --shell-radius: 1.125rem;
  --shell-radius-sm: 0.6875rem;
  /* Sticky offset under one-line header (approx. height + top bar) */
  --header-sticky-offset: 52px;
}

html.light {
  --ok: #0d9488;
  --fail: #e11d48;
  --warn: #d97706;
  --info: #0284c7;
  --purple: #7c3aed;

  --bg: #eef2f6;
  --surface: #ffffff;
  --surface2: #f4f7fb;
  --surface3: #e2e8f0;
  --text: #0f172a;
  --muted: #5c6b7e;
  --border: #c9d4e3;

  --shell-line: rgba(15, 23, 42, 0.08);
  --shell-glow: 0 8px 32px -8px rgba(2, 132, 199, 0.12);
  --shadow-soft: 0 2px 12px rgba(15, 23, 42, 0.06);
  --shadow-float: 0 16px 48px -12px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --focus-ring: 0 0 0 3px rgba(2, 132, 199, 0.22);
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html,
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  letter-spacing: 0.01em;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 140% 80% at 0% -30%, rgba(56, 189, 248, 0.12), transparent 52%),
    radial-gradient(ellipse 100% 60% at 100% 0%, rgba(167, 139, 250, 0.1), transparent 48%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(45, 212, 191, 0.06), transparent 45%);
  background-attachment: fixed;
}

html.light body {
  background-image: radial-gradient(ellipse 120% 70% at 0% -20%, rgba(2, 132, 199, 0.08), transparent 50%),
    radial-gradient(ellipse 90% 50% at 100% 0%, rgba(124, 58, 237, 0.06), transparent 48%);
}

a {
  color: var(--info);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--text);
}

/* ── Header — single row (scroll horizontally if needed) ─────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 48px;
  padding: 0.55rem 1rem 0.6rem;
  gap: 0.45rem 0.55rem;
  flex-wrap: nowrap;
  align-items: center;
  display: flex;
  background: rgba(12, 17, 28, 0.82);
  border-bottom: 1px solid var(--shell-line);
  box-shadow: var(--shadow-soft), var(--shell-glow);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

header::-webkit-scrollbar {
  height: 5px;
}
header::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--border);
}

header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ok), var(--info), var(--purple));
  opacity: 0.85;
  pointer-events: none;
}

html.light header {
  background: rgba(255, 255, 255, 0.88);
}

header .app-logo {
  border-radius: 0.85rem;
  border: 1px solid var(--shell-line);
  box-shadow: var(--shadow-soft);
  background: var(--surface2);
}

header h1 {
  font-size: 1.15rem;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.1;
  flex-shrink: 0;
}

header .app-tagline {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(18rem, 26vw);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* LIVE block: one compact row (no stacked subtitle height) */
header .live-block {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  max-width: min(11rem, 22vw);
  margin-right: 0;
}

header .live-help {
  display: inline-block;
  max-width: min(9rem, 18vw);
  padding-left: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collect + Stop in one horizontal chip */
header .collect-actions-stack {
  flex-direction: row;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
}

header .collect-actions-stack > .btn {
  padding: 0.32rem 0.55rem;
  font-size: 0.72rem;
}

/* Collect status line: single row, ellipsis */
header .collect-bar {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  align-self: center;
  margin-left: 0.35rem;
  flex-shrink: 1;
  min-width: 0;
  max-width: min(23rem, 38vw);
  padding: 0.18rem 0.55rem;
}

header .collect-text {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  max-width: min(20rem, 34vw);
  min-width: 0;
}

header .collect-line-main,
header .collect-line-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(16rem, 30vw);
}

header .dot {
  margin-top: 0;
  flex-shrink: 0;
  align-self: center;
}

header .btn,
header .btn-ghost,
header .lang-toggle,
header #notif-btn,
header .export-wrap,
header > a.btn-ghost {
  flex-shrink: 0;
}

html[lang="ru"] header .live-help {
  display: none;
}

body.dashboard-live header {
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.45), var(--shadow-soft);
}

.collect-bar {
  font-size: 0.8125rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: var(--surface2);
}

.collect-line-main {
  font-weight: 600;
  color: var(--text);
}

.collect-line-sub {
  opacity: 0.88;
}

.dot {
  width: 11px;
  height: 11px;
  box-shadow: 0 0 0 2px var(--surface);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  border: 1px solid transparent;
  border-radius: var(--shell-radius-sm);
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 0.45rem 0.95rem;
  font-size: 0.8125rem;
  background: linear-gradient(165deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
  box-shadow: var(--shadow-soft), var(--shadow-inset);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: var(--shadow-float);
  opacity: 1;
}

.btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
  box-shadow: var(--focus-ring), var(--shadow-soft);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-inset);
}

.btn-ghost:hover {
  background: var(--surface3);
  border-color: var(--info);
  filter: none;
}

#btn-collect-stop.btn-collect-stop {
  background: linear-gradient(165deg, #fb7185, #e11d48) !important;
  border-color: rgba(225, 29, 72, 0.6) !important;
}

/* ── Top status bar ─────────────────────────────────────────────────────── */
.topbar {
  margin: 0.65rem 1rem 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background: var(--surface2);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toppill {
  border: 1px solid var(--shell-line);
  background: var(--surface);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-weight: 550;
  box-shadow: var(--shadow-inset);
}

.topbar-legend .lg {
  font-weight: 500;
}

/* ── Main & grids ───────────────────────────────────────────────────────── */
main {
  padding: 1.5rem 1.5rem 2.25rem;
}

.panels {
  gap: 1.35rem;
}

/* ── Stat cards ─────────────────────────────────────────────────────────── */
.stats {
  gap: 1rem;
}

.stat {
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.stat:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: var(--shadow-float);
}

.stat .n {
  font-weight: 820;
  letter-spacing: -0.02em;
}

.stat .l {
  font-weight: 600;
  letter-spacing: 0.06em;
}

.stat.active {
  border-color: var(--info);
  box-shadow: var(--focus-ring);
}

/* ── Panels ──────────────────────────────────────────────────────────────── */
.panel {
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.panel-head {
  padding: 0.85rem 1.1rem;
  background: linear-gradient(180deg, var(--surface2) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--shell-line);
}

.panel-head h2 {
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.panel-count {
  border-radius: 999px;
  font-weight: 650;
  border: 1px solid var(--shell-line);
  background: var(--surface3);
}

/* ── Filters ─────────────────────────────────────────────────────────────── */
.f-input,
.f-select {
  border-radius: var(--shell-radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.f-input:focus,
.f-select:focus {
  border-color: var(--info);
  box-shadow: var(--focus-ring);
}

.f-clear:hover {
  border-radius: var(--shell-radius-sm);
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.tbl-wrap {
  border-radius: 0 0 var(--shell-radius-sm) var(--shell-radius-sm);
}

th {
  font-weight: 650;
  letter-spacing: 0.055em;
  background: var(--surface2);
  border-bottom: 1px solid var(--shell-line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

td {
  border-bottom: 1px solid var(--shell-line);
}

tbody tr:hover td {
  background: var(--surface3);
  transition: background 0.12s ease;
}

.src-group-row td {
  background: var(--surface2);
  border-bottom: 1px solid var(--shell-line);
}

/* ── Status badges ───────────────────────────────────────────────────────── */
.b {
  font-weight: 650;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.b-ok {
  background: linear-gradient(165deg, #0f766e, #134e4a);
  border-color: rgba(45, 212, 191, 0.45);
  color: #ecfeff;
}

.b-fail {
  background: linear-gradient(165deg, #9f1239, #881337);
  border-color: rgba(251, 113, 133, 0.45);
  color: #fff1f2;
}

.b-warn {
  background: linear-gradient(165deg, #b45309, #92400e);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fffbeb;
}

.b-info {
  background: linear-gradient(165deg, #0369a1, #0c4a6e);
  border-color: rgba(56, 189, 248, 0.45);
  color: #f0f9ff;
}

.b-dim {
  background: var(--surface3);
  border-color: var(--border);
  color: var(--text);
}

.b-purple {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.35);
  color: #ede9fe;
}

html.light .b-ok {
  background: rgba(13, 148, 136, 0.18);
  border-color: rgba(13, 148, 136, 0.4);
  color: #134e4a;
}

html.light .b-fail {
  background: rgba(225, 29, 72, 0.14);
  border-color: rgba(225, 29, 72, 0.35);
  color: #9f1239;
}

html.light .b-warn {
  background: rgba(217, 119, 6, 0.16);
  border-color: rgba(217, 119, 6, 0.4);
  color: #92400e;
}

html.light .b-info {
  background: rgba(2, 132, 199, 0.14);
  border-color: rgba(2, 132, 199, 0.35);
  color: #0c4a6e;
}

html.light .b-dim {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text);
}

html.light .b .b-code {
  background: rgba(15, 23, 42, 0.08);
}

/* ── Tab navigation ─────────────────────────────────────────────────────── */
.dash-page-tabs {
  position: sticky;
  top: var(--header-sticky-offset);
  z-index: 95;
  margin: 0 auto 0.5rem;
  padding: 0.5rem 0.65rem 0.65rem;
  gap: 0.4rem 0.55rem;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  display: flex;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  border: 1px solid var(--shell-line);
  border-radius: 999px;
  background: rgba(19, 27, 42, 0.65);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html.light .dash-page-tabs {
  background: rgba(255, 255, 255, 0.78);
}

.dash-tab-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  gap: 0.08rem;
}

.dash-tab {
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 650;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.dash-tab:hover {
  color: var(--text);
  background: var(--surface3);
  border-color: var(--shell-line);
}

.dash-tab.active,
.dash-tab[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(165deg, #0ea5e9, #0369a1);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.35);
}

.dash-tab-sub {
  font-size: 0.62rem;
  font-weight: 550;
  opacity: 0.9;
  text-align: center;
  width: 100%;
}

.dash-section {
  scroll-margin-top: calc(var(--header-sticky-offset) + 4.25rem);
}

/* ── Surfaces & motion (content area) ───────────────────────────────────── */
.panel,
.stat,
.ic-ev,
.toppill {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.tbl-wrap {
  border-radius: 0 0 var(--shell-radius-sm) var(--shell-radius-sm);
  background: rgba(0, 0, 0, 0.1);
}

html.light .tbl-wrap {
  background: rgba(255, 255, 255, 0.4);
}

.filter-active-line {
  font-weight: 500;
  opacity: 0.92;
}

.empty-row td {
  border-radius: var(--shell-radius-sm);
}

/* ── Situation & incidents ───────────────────────────────────────────────── */
.situation-strip {
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.2rem;
}

.situation-strip .sit-title {
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}

.incident-center {
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  background: linear-gradient(165deg, var(--surface2) 0%, var(--surface) 55%);
  box-shadow: var(--shadow-float);
}

.ic-ev {
  border-radius: var(--shell-radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--surface2);
  transition: border-color 0.15s ease, transform 0.14s ease, box-shadow 0.15s ease;
}

.ic-ev:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.ic-tl-seg {
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--shell-line);
}

/* ── Secondary controls ──────────────────────────────────────────────────── */
.act-btn,
.time-filter-btn,
.expand-btn,
.preset-btn,
.log-lvl-btn,
.grp-toggle {
  border-radius: var(--shell-radius-sm);
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.act-btn:hover {
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.22);
}

.trend-day-btn.active {
  box-shadow: var(--shadow-soft);
}

.lang-toggle {
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.lang-toggle button.active {
  font-weight: 750;
}

.pill {
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: 999px;
}

/* ── Global search & notifications ───────────────────────────────────────── */
#global-search {
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: var(--surface2);
  font-weight: 500;
}

#global-search:focus {
  box-shadow: var(--focus-ring);
}

#notif-btn {
  border-radius: var(--shell-radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--surface2);
  box-shadow: var(--shadow-inset);
}

#notif-btn:hover {
  border-color: var(--info);
}

#notif-panel {
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shadow-float);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.export-menu {
  border-radius: var(--shell-radius-sm);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shadow-float);
  background: var(--surface);
}

/* ── Toasts & modals ─────────────────────────────────────────────────────── */
.toast {
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-overlay {
  background: rgba(5, 8, 15, 0.78);
  backdrop-filter: blur(8px);
}

html.light .modal-overlay {
  background: rgba(15, 23, 42, 0.45);
}

.modal-card {
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  background: linear-gradient(170deg, var(--surface2) 0%, var(--surface) 100%);
  box-shadow: var(--shadow-float);
}

.trends-modal-card {
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shadow-float);
}

.chart-card {
  border-radius: var(--shell-radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--surface2);
  box-shadow: var(--shadow-soft);
}

.chart-card.chart-fs {
  box-shadow: 0 0 0 9999px rgba(5, 8, 15, 0.88) !important;
}

html.light .chart-card.chart-fs {
  box-shadow: 0 0 0 9999px rgba(238, 242, 246, 0.94) !important;
}

/* ── AI chat widget ───────────────────────────────────────────────────────── */
#ai-chat-fab {
  width: 54px;
  height: 54px;
  background: linear-gradient(145deg, #6366f1 0%, #4f46e5 40%, #7c3aed 100%);
  box-shadow: 0 8px 28px rgba(79, 70, 229, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#ai-chat-panel {
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.chat-hdr {
  border-bottom: 1px solid var(--shell-line);
  background: linear-gradient(180deg, var(--surface2), var(--surface));
}

.chat-msg.user {
  background: linear-gradient(165deg, #4f46e5, #4338ca);
  color: #eef2ff;
}

.chat-msg.assistant pre {
  background: var(--bg);
  border-radius: var(--shell-radius-sm);
  border: 1px solid var(--shell-line);
}

.chat-input {
  border-radius: var(--shell-radius-sm);
  border: 1px solid var(--shell-line);
}

.chat-send {
  border-radius: var(--shell-radius-sm);
}

/* ── Misc ─────────────────────────────────────────────────────────────────── */
.no-data-banner.visible {
  border-radius: var(--shell-radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.anomaly {
  border-radius: var(--shell-radius-sm);
  border-left-width: 4px;
}

.exec-health-line.visible {
  border-radius: var(--shell-radius-sm);
  border: 1px solid var(--shell-line);
}

.btn-back-top {
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.correlation-line {
  font-weight: 500;
}

.panel-inline-error {
  border-radius: var(--shell-radius-sm);
}

/* ── Map & status dots (inherit new --ok etc.) ───────────────────────────── */
.map-cell.mc-ok {
  background: var(--ok);
}
.map-cell.mc-fail {
  background: var(--fail);
}
.map-cell.mc-run {
  background: var(--info);
}
.map-cell.mc-warn {
  background: var(--warn);
}

/* ── Scrollbars ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: var(--surface);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid var(--surface);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ── Accessibility & reading comfort ─────────────────────────────────────── */
::selection {
  background: rgba(56, 189, 248, 0.28);
  color: var(--text);
}

html.light ::selection {
  background: rgba(2, 132, 199, 0.2);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="tab"]:focus-visible,
[role="button"]:focus-visible,
.dash-tab:focus-visible,
.f-clear:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  font-feature-settings: "liga" 0;
}

/* ── Log viewer & runbook modals ─────────────────────────────────────────── */
.log-modal-card {
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shadow-float);
  background: var(--surface);
}

.log-modal-header {
  border-bottom: 1px solid var(--shell-line);
  background: linear-gradient(180deg, var(--surface2), var(--surface));
}

.log-modal-toolbar {
  border-bottom: 1px solid var(--shell-line);
  background: var(--surface2);
}

.log-modal-pre {
  background: var(--bg) !important;
  color: var(--text) !important;
  border-top: 1px solid var(--shell-line);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.runbook-modal-card {
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shadow-float);
}

.runbook-hdr {
  border-bottom: 1px solid var(--shell-line);
  background: linear-gradient(180deg, var(--surface2), var(--surface));
}

.runbook-box {
  border-radius: var(--shell-radius-sm);
  border: 1px solid var(--shell-line);
  background: var(--surface2);
}

.panel-head .glossary-hint {
  border-radius: var(--shell-radius-sm);
  border: 1px solid var(--shell-line);
}

/* ── App watermark (bottom-left) ─────────────────────────────────────────── */
.app-watermark {
  position: fixed;
  left: 0.9rem;
  bottom: 0.85rem;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: rgba(12, 17, 28, 0.7);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tr-kpi-health {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 0 0 0.55rem;
}

.tr-kpi-card.tr-kpi-updated {
  animation: trKpiPulse 0.28s ease;
}

@keyframes trKpiPulse {
  from { transform: translateY(0); box-shadow: var(--shadow-soft); }
  50% { transform: translateY(-1px); box-shadow: var(--shadow-strong); }
  to { transform: translateY(0); box-shadow: var(--shadow-soft); }
}

.app-watermark img {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 0.2rem;
}

.app-watermark:hover {
  color: var(--text);
  border-color: var(--info);
}

html.light .app-watermark {
  background: rgba(255, 255, 255, 0.78);
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .stat:hover,
  .ic-ev:hover {
    transform: none;
  }
}
