:root {
  --bg: #080b10;
  --bg-elevated: #0f1319;
  --bg-card: #141922;
  --bg-card-hover: #1a2030;
  --border: #232b3a;
  --border-light: #2d3748;
  --text: #eef2f7;
  --text-muted: #a8b4c8;
  --text-dim: #5c6578;
  --accent: #3b82f6;
  --accent-glow: #3b82f633;
  --purple: #8b5cf6;
  --green: #22c55e;
  --green-dim: #22c55e22;
  --yellow: #eab308;
  --yellow-dim: #eab30822;
  --red: #ef4444;
  --red-dim: #ef444422;
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 252px;
  --font: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; overflow-x: hidden; }
button, a, input, select { touch-action: manipulation; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, #3b82f612, transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, #8b5cf60a, transparent);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.layout { display: flex; min-height: 100vh; min-height: 100dvh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  height: 100dvh;
  z-index: 20;
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
}

.sidebar-backdrop {
  display: none;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 22px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-text { min-width: 0; flex: 1; }
.brand-title { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

.sidebar-close {
  display: none;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 3px;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nav-icon { opacity: 0.5; font-size: 0.75rem; width: 16px; text-align: center; flex-shrink: 0; }
.nav-label { min-width: 0; }
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, var(--accent-glow), #8b5cf622);
  color: var(--text);
  border: 1px solid #3b82f644;
}
.nav-item.active .nav-icon { opacity: 1; color: var(--accent); }

.sidebar-footer {
  padding: 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.refresh-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.pulse {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2.5s ease infinite;
}
.pulse.err { background: var(--red); box-shadow: 0 0 8px var(--red); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.btn-refresh {
  width: 100%;
  padding: 9px;
  min-height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-refresh:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.btn-logout { margin-top: 8px; }
.btn-logout:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* ── Login ── */
.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-shell { width: 100%; max-width: 400px; }
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px 26px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.login-title { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.login-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.login-form .mail-field { margin-bottom: 14px; }
.login-submit { width: 100%; margin-top: 8px; }
.login-error {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid #ef444433;
}

/* ── Main ── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 28px 36px 56px;
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
  max-width: 1480px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
}

.topbar-lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.topbar-titles { min-width: 0; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
  transition: transform 0.15s, top 0.15s, background 0.15s;
}
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
body.menu-open .menu-toggle-bars { background: transparent; }
body.menu-open .menu-toggle-bars::before { top: 0; transform: rotate(45deg); }
body.menu-open .menu-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.topbar h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.subtitle { color: var(--text-muted); font-size: 0.88rem; margin-top: 6px; }

.health-ring { position: relative; width: 96px; height: 96px; }
.health-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 7; }
.ring-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 0;
  transition: stroke 0.5s, stroke-dashoffset 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.health-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.health-value span { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.health-value small { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.section { display: none; animation: fadeIn 0.25s ease; }
.section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.section-head { margin: 28px 0 14px; }
.section-head h2 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.section-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}

/* ── Stat cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.15s, transform 0.15s;
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.stat-card.ok .stat-icon { color: var(--green); }
.stat-card.warn .stat-value { color: var(--yellow); }
.stat-card.err .stat-value { color: var(--red); }

.stat-icon { width: 36px; height: 36px; color: var(--accent); opacity: 0.85; flex-shrink: 0; }
.stat-icon svg { width: 100%; height: 100%; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.stat-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-top: 2px; }

/* ── Tool cards (platform logos) ── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.tool-card:hover {
  border-color: #3b82f666;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover .tool-arrow { opacity: 1; transform: translate(2px, -2px); }

.tool-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.tool-logo svg { width: 100%; height: 100%; display: block; }

.tool-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.tool-name { font-weight: 600; font-size: 0.92rem; }
.tool-url { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tool-arrow {
  font-size: 1rem;
  color: var(--accent);
  opacity: 0;
  transition: all 0.2s;
  position: relative;
  z-index: 1;
}

/* ── Node cards ── */
.node-grid { display: flex; flex-direction: column; gap: 10px; }

.node-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  border-left: 3px solid var(--green);
}
.node-card.err { border-left-color: var(--red); }
.node-card.peer { border-left-color: var(--accent); }
.node-card.peer.err { border-left-color: var(--red); }

.node-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.node-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.node-icon { width: 28px; height: 28px; opacity: 0.9; }
.node-icon svg { width: 100%; height: 100%; }
.node-name { font-weight: 600; font-size: 0.92rem; overflow-wrap: anywhere; }
.node-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.node-specs { display: flex; gap: 12px; margin-top: 10px; font-size: 0.78rem; color: var(--text-dim); flex-wrap: wrap; }
.node-note { font-size: 0.72rem; color: var(--text-muted); margin-top: 8px; }
a.peer-link { text-decoration: none; }
a.peer-link:hover { color: var(--accent); border-color: var(--accent); }

/* ── Namespace mini cards ── */
.ns-card-grid { display: flex; flex-direction: column; gap: 8px; }

.ns-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.ns-mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ns-mini-name { font-weight: 600; font-size: 0.82rem; font-family: var(--mono); }
.ns-mini-count { font-size: 0.72rem; color: var(--text-muted); }

.ns-mini-bar {
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ns-mini-fill { height: 100%; background: linear-gradient(90deg, var(--green), #16a34a); border-radius: 99px; transition: width 0.5s; }

.ns-mini-stats { display: flex; gap: 10px; font-size: 0.72rem; color: var(--text-muted); }
.dot::before { content: "● "; }
.dot.ok { color: var(--green); }
.dot.warn { color: var(--yellow); }
.dot.err { color: var(--red); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge.ok { background: var(--green-dim); color: var(--green); }
.badge.warn { background: var(--yellow-dim); color: var(--yellow); }
.badge.err { background: var(--red-dim); color: var(--red); }
.badge.muted { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Toolbar ── */
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.search {
  flex: 1;
  min-width: min(100%, 220px);
  max-width: 420px;
  padding: 11px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Selects ── */
.select,
.mail-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8b4c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select:hover,
.mail-field select:hover {
  border-color: var(--accent);
}
.select:focus,
.mail-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.select option,
.mail-field select option {
  background: var(--bg-card);
  color: var(--text);
}

.select {
  flex: 0 0 auto;
  min-width: 148px;
  padding: 11px 36px 11px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.toggle-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.toggle-chip:has(input:checked) { border-color: var(--accent); color: var(--text); background: var(--accent-glow); }
.toggle-chip input { accent-color: var(--accent); }

/* ── Service groups ── */
.ns-group { margin-bottom: 32px; }

.ns-group-head { margin-bottom: 14px; }
.ns-group-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.ns-badge {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--accent-glow), #8b5cf622);
  border: 1px solid #3b82f644;
  border-radius: 8px;
  color: var(--accent);
}

.ns-group-meta { font-size: 0.8rem; color: var(--text-muted); }

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 14px;
}

/* ── Service card ── */
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.service-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }
.service-card.unhealthy { border-color: #ef444455; }

.service-card-head { display: flex; align-items: flex-start; gap: 12px; }

.service-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.service-status-dot.ok { background: var(--green); color: var(--green); }
.service-status-dot.err { background: var(--red); color: var(--red); }

.service-title-block { flex: 1; min-width: 0; }
.service-name { font-size: 1rem; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.service-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.btn-open {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border: 1px solid #3b82f655;
  border-radius: 9px;
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-open:hover { background: var(--accent); color: #fff; }

.service-links { display: flex; flex-wrap: wrap; gap: 6px; }

.link-chip {
  font-size: 0.72rem;
  font-family: var(--mono);
  padding: 5px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-chip.primary {
  color: var(--accent);
  border-color: #3b82f644;
  background: var(--accent-glow);
}
a.link-chip:hover { border-color: var(--accent); color: var(--accent); }

.service-replicas { display: flex; align-items: center; gap: 10px; }
.replica-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
}
.replica-fill { height: 100%; border-radius: 99px; transition: width 0.4s; }
.replica-fill.ok { background: var(--green); }
.replica-fill.err { background: var(--red); }
.replica-text { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* ── Pods under service ── */
.pod-section {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: auto;
}

.pod-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
}
.pod-toggle:hover { color: var(--text); }
.pod-toggle-label { font-weight: 600; color: var(--text); }
.pod-summary-chips { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.chevron { transition: transform 0.2s; font-size: 0.7rem; opacity: 0.5; }
.pod-toggle.open .chevron { transform: rotate(180deg); }

.mini-chip {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.mini-chip.ok { background: var(--green-dim); color: var(--green); }
.mini-chip.warn { background: var(--yellow-dim); color: var(--yellow); }
.mini-chip.err { background: var(--red-dim); color: var(--red); }
.mini-chip.muted { background: var(--bg-elevated); color: var(--text-dim); }

.pod-list {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 2px;
  max-height: 240px;
  overflow-y: auto;
}
.pod-list.open { display: flex; }

.pod-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.78rem;
}
.pod-chip.has-issue { border-color: #ef444444; background: #ef44440a; }

.pod-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.pod-chip.ok .pod-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.pod-chip.warn .pod-dot { background: var(--yellow); }
.pod-chip.err .pod-dot { background: var(--red); }
.pod-chip.muted .pod-dot { background: var(--text-dim); }

.pod-chip-body { flex: 1; min-width: 0; }
.pod-chip-name { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; display: block; word-break: break-all; }
.pod-chip-meta { font-size: 0.68rem; color: var(--text-muted); display: block; margin-top: 2px; }
.pod-chip-issue { font-size: 0.68rem; color: var(--red); display: block; margin-top: 3px; font-weight: 500; }
.pod-empty { font-size: 0.78rem; color: var(--text-dim); font-style: italic; padding: 8px 4px; }

/* ── Ingress cards ── */
.ingress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
}

.ingress-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}
.ingress-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.ingress-card-top { display: flex; justify-content: space-between; align-items: center; }
.ingress-globe { font-size: 1.4rem; }
.ingress-host { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.02em; word-break: break-all; }
.ingress-meta { font-size: 0.78rem; color: var(--text-muted); }
.ingress-paths { display: flex; flex-wrap: wrap; gap: 5px; }
.path-tag {
  font-size: 0.68rem;
  font-family: var(--mono);
  padding: 4px 8px;
  background: var(--bg-elevated);
  border-radius: 6px;
  color: var(--text-muted);
}
.ingress-open { font-size: 0.82rem; color: var(--accent); font-weight: 500; margin-top: auto; }

/* ── Deploy cards ── */
.deploy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 12px;
}

.deploy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.deploy-card.unhealthy { border-color: #ef444444; }

.deploy-card-head { display: flex; align-items: center; gap: 10px; text-align: left; margin-bottom: 14px; }
.deploy-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.deploy-status.ok { background: var(--green); box-shadow: 0 0 6px var(--green); }
.deploy-status.err { background: var(--red); }
.deploy-name { font-weight: 600; font-size: 0.88rem; overflow-wrap: anywhere; }
.deploy-ns { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); }

.deploy-replica-ring {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
}
.deploy-replica-ring svg { width: 100%; height: 100%; }
.deploy-replica-ring span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.deploy-label { font-size: 0.75rem; color: var(--text-muted); }

/* ── Event cards ── */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.event-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.event-ns { font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); }
.event-msg { font-size: 0.85rem; color: var(--text); line-height: 1.45; }
.event-time { font-size: 0.72rem; color: var(--text-dim); margin-top: 10px; display: block; }

/* Ops / sunucu izleme */
.node-metrics { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.metric-row {
  display: grid;
  grid-template-columns: 36px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.metric-row.hot { color: var(--yellow); }
.metric-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.metric-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.metric-fill.ram { background: var(--purple); }
.metric-row.hot .metric-fill.ram { background: var(--yellow); }

.ops-timeline { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ops-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
}
.ops-item.sev-warning { border-left-color: var(--yellow); }
.ops-item.sev-critical { border-left-color: var(--red); }
.ops-item.sev-info { border-left-color: var(--green); }
.ops-item-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ops-item-head time { margin-left: auto; font-size: 0.72rem; color: var(--text-dim); }
.ops-title { font-size: 0.92rem; font-weight: 600; }
.ops-detail { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }
.ops-meta { font-size: 0.72rem; color: var(--text-dim); margin-top: 8px; }

.empty-state {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 40px 20px;
  text-align: center;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ── ays-data connections ── */
.conn-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1.25rem;
}
.conn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}
.conn-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.conn-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.conn-name { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.conn-meta { font-size: 0.72rem; color: var(--text-dim); margin-top: 4px; font-family: var(--mono); }
.btn-copy-all {
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-copy-all:hover { color: var(--text); border-color: var(--accent); }
.conn-list { list-style: none; }
.conn-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.conn-row:last-child { border-bottom: none; }
.conn-row:hover { background: var(--bg-card-hover); }
.conn-label { font-size: 0.72rem; color: var(--text-dim); font-weight: 500; }
.conn-value {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conn-copy-icon { color: var(--text-dim); font-size: 0.85rem; opacity: 0.6; }
.conn-row:hover .conn-copy-icon { opacity: 1; color: var(--accent); }

.toast {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid var(--border-light);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Mail / SMTP ── */
.mail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.mail-hero-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.mail-hero-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.mail-hero-desc {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.mail-hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.mail-conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 0 3px #5c657833;
}
.mail-hero-status.ready .mail-conn-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}
.mail-hero-status.ready { color: var(--text); border-color: #22c55e44; }
.mail-hero-status.warn .mail-conn-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow-dim);
}
.mail-hero-status.warn { border-color: #eab30844; color: var(--text); }
.mail-hero-status.err .mail-conn-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-dim);
}
.mail-hero-status.err { border-color: #ef444455; color: var(--text); }

.mail-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.mail-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: 76px;
}
.mail-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.mail-stat-value {
  margin-top: 6px;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.mail-stat-sub {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.mail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.mail-panel-activity { margin-bottom: 8px; }
.mail-panel-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.mail-panel-head h3 {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.mail-panel-head p {
  margin-top: 3px;
  font-size: 0.78rem;
  color: #c0cad8;
}
.mail-panel-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.mail-form { padding: 16px 18px 18px; }
.mail-fieldset {
  border: none;
  margin: 0 0 16px;
  padding: 0;
}
.mail-fieldset legend {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.mail-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.mail-row:last-child { margin-bottom: 0; }
.mail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 12px;
}
.mail-field:last-child { margin-bottom: 0; }
.mail-field em {
  font-style: normal;
  color: var(--text-dim);
  font-weight: 400;
}
.mail-grow { flex: 1; min-width: 0; margin-bottom: 0; }
.mail-port { width: 96px; flex-shrink: 0; margin-bottom: 0; }
.mail-field input[type="text"],
.mail-field input[type="email"],
.mail-field input[type="password"],
.mail-field input[type="number"],
.mail-field select {
  width: 100%;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.86rem;
  font-family: var(--mono);
}
.mail-field select {
  padding-right: 36px;
  font-family: inherit;
}
.mail-field input:focus,
.mail-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.mail-pass-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}
.mail-pass-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.mail-pass-wrap input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
}
.mail-pass-toggle {
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 0 12px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font);
  height: 40px;
  text-transform: lowercase;
}
.mail-pass-toggle:hover { color: var(--text); }

.mail-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  margin-top: 4px;
}
.mail-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mail-switch-ui {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.mail-switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.15s, background 0.15s;
}
.mail-switch input:checked + .mail-switch-ui {
  background: var(--accent-glow);
  border-color: #3b82f666;
}
.mail-switch input:checked + .mail-switch-ui::after {
  transform: translateX(18px);
  background: var(--accent);
}
.mail-switch-text { display: flex; flex-direction: column; gap: 1px; }
.mail-switch-text strong { font-size: 0.84rem; color: var(--text); font-weight: 600; }
.mail-switch-text small { font-size: 0.72rem; color: var(--text-dim); }

.mail-meta {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--mono);
}
.mail-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.btn-primary, .btn-secondary, .btn-icon {
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font);
}
.btn-primary, .btn-secondary {
  padding: 10px 16px;
  min-height: 44px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border-light);
}
.btn-secondary:hover { color: var(--text); border-color: var(--accent); }
.btn-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border-light);
  flex-shrink: 0;
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }
.mail-status {
  margin-top: 12px;
  font-size: 0.84rem;
  padding: 10px 12px;
  border-radius: 8px;
}
.mail-item.dim { opacity: 0.55; }

.mail-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.mail-pill {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font);
}
.mail-pill:hover { color: var(--text); border-color: var(--border-light); }
.mail-pill.active {
  background: var(--accent-glow);
  border-color: #3b82f655;
  color: var(--text);
}

.mail-feed { padding: 8px; }

.settings-link-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 16px;
}
.settings-preview-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
}
.settings-preview-item:hover { border-color: var(--accent); }
.settings-preview-item strong { font-size: 0.82rem; }
.settings-preview-item span {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--text-dim);
  word-break: break-all;
}
div.settings-preview-item { cursor: default; }

.mail-feed-tall { max-height: 420px; overflow-y: auto; }
.mail-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 10px;
  border-radius: 10px;
  transition: background 0.15s;
}
.mail-item:hover { background: var(--bg-card-hover); }
.mail-item + .mail-item { border-top: 1px solid var(--border); }
.mail-item-rail {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--text-dim);
}
.mail-item-rail.scheduled { background: #60a5fa; box-shadow: 0 0 0 3px #3b82f622; }
.mail-item-rail.queued { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-dim); }
.mail-item-rail.sent { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.mail-item-rail.failed { background: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
.mail-item-rail.sending { background: #a78bfa; box-shadow: 0 0 0 3px #8b5cf622; }
.mail-item-main { min-width: 0; }
.mail-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-item-meta {
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.mail-item-meta code {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}
.mail-item-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.mail-item-when {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.mail-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.mail-badge.scheduled { background: #3b82f622; color: #60a5fa; }
.mail-badge.queued { background: var(--yellow-dim); color: var(--yellow); }
.mail-badge.sent { background: var(--green-dim); color: var(--green); }
.mail-badge.failed { background: var(--red-dim); color: var(--red); }
.mail-badge.sending { background: #8b5cf622; color: #a78bfa; }
.mail-item-err {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--red);
  line-height: 1.35;
}

.mail-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.mail-empty strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}
.mail-skeleton { padding: 16px 12px; }
.mail-skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-elevated), var(--bg-card-hover), var(--bg-elevated));
  background-size: 200% 100%;
  animation: mailShimmer 1.2s ease-in-out infinite;
  margin-bottom: 10px;
}
.mail-skel-line.short { width: 55%; }
@keyframes mailShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (max-width: 1100px) {
  .mail-stat-row { grid-template-columns: 1fr 1fr; }
  .mail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .mail-stat-row { grid-template-columns: 1fr; }
  .mail-row { flex-direction: column; }
  .mail-port { width: 100%; }
  .mail-panel-head-row { flex-direction: column; }
  .mail-filter-pills { justify-content: flex-start; }
  .mail-item {
    grid-template-columns: 10px 1fr;
  }
  .mail-item-side {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
  }
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .sidebar-close { display: inline-flex; }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  body.menu-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  body.menu-open { overflow: hidden; }

  .sidebar {
    width: min(300px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: none;
    padding-left: env(safe-area-inset-left);
    z-index: 26;
  }
  body.menu-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }

  .main {
    margin-left: 0;
    padding: 16px 16px 40px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    margin: -16px -16px 20px;
    margin-left: calc(-1 * max(16px, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(16px, env(safe-area-inset-right)));
    padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    padding-top: max(12px, env(safe-area-inset-top));
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    align-items: center;
  }

  .topbar h1 { font-size: 1.28rem; }
  .health-ring { width: 64px; height: 64px; }
  .health-value span { font-size: 1.15rem; }

  .grid-2 { grid-template-columns: 1fr; }
  .service-grid,
  .tool-grid,
  .ingress-grid,
  .event-grid,
  .conn-grid { grid-template-columns: 1fr; }

  .toolbar-row .search,
  .toolbar-row .select {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
  }

  .search,
  .select,
  .mail-field input[type="text"],
  .mail-field input[type="email"],
  .mail-field input[type="password"],
  .mail-field input[type="number"],
  .mail-field select {
    font-size: 16px;
  }

  .mail-actions {
    flex-direction: column;
  }
  .mail-actions .btn-primary,
  .mail-actions .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .deploy-grid { grid-template-columns: 1fr 1fr; }
  .topbar h1 { font-size: 1.15rem; }

  .conn-card-head { flex-wrap: wrap; }
  .conn-row {
    grid-template-columns: 1fr auto;
  }
  .conn-label {
    grid-column: 1 / -1;
  }

  .toggle-chip { width: 100%; justify-content: flex-start; }

  .mail-hero-status { width: 100%; justify-content: flex-start; }
  .mail-item-title { white-space: normal; }
}

@media (max-width: 400px) {
  .stat-grid,
  .deploy-grid { grid-template-columns: 1fr; }
  .health-widget { display: none; }
}

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

/* Scrollbar */
.nav::-webkit-scrollbar,
.pod-list::-webkit-scrollbar,
.mail-feed-tall::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb,
.pod-list::-webkit-scrollbar-thumb,
.mail-feed-tall::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
