:root,
[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f8fa;
  --bg-elevated: #ffffff;
  --card-surface: linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
  --bg-recessed: #f1f2f5;
  --bg-subtle: #f1f2f5;
  --bg-muted: #e6e8ee;
  --bg-hover: rgba(15, 23, 42, 0.045);
  --seg-pill-bg: #ffffff;

  --border: rgba(15, 23, 42, 0.075);
  --border-strong: rgba(15, 23, 42, 0.14);

  --text: #0f1117;
  --text-secondary: #525866;
  --text-muted: #848b9b;

  --primary: #181a20;
  --primary-fg: #ffffff;
  --primary-hover: #2b2e38;

  --card-cta-bg: linear-gradient(180deg, #181a20 0%, #181a20 100%);
  --card-cta-hover: linear-gradient(180deg, #2c303b 0%, #2c303b 100%);
  --card-cta-fg: #ffffff;
  --card-cta-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);

  --badge-metal-bg: linear-gradient(145deg, #262932 0%, #14161c 100%);
  --badge-metal-fg: #ffffff;
  --badge-metal-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);

  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.1);
  --ok-text: #059669;
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.11);
  --warn-text: #b45309;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.1);
  --danger-text: #dc2626;

  --card-specular: rgba(255, 255, 255, 0);
  --card-ring: 0 0 0 1px rgba(15, 23, 42, 0.068), 0 1px 3px rgba(15, 23, 42, 0.035);
  --card-ring-hover: 0 0 0 1px rgba(15, 23, 42, 0.13), 0 10px 24px -10px rgba(15, 23, 42, 0.09), 0 2px 6px rgba(15, 23, 42, 0.03);
  --recessed-ring: inset 0 1px 1.5px rgba(15, 23, 42, 0.035), inset 0 0 0 1px rgba(15, 23, 42, 0.065);
  --seg-pill-shadow: 0 1px 2.5px rgba(15, 23, 42, 0.09), 0 0 0 1px rgba(15, 23, 42, 0.05);
  --modal-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 24px 64px -12px rgba(15, 23, 42, 0.2);
  --dock-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.12);

  --grid-dot: rgba(15, 23, 42, 0.075);
  --ambient-glow:
    radial-gradient(620px 280px at 26% -60px, rgba(99, 102, 241, 0.05), transparent 70%),
    radial-gradient(580px 260px at 74% -70px, rgba(16, 185, 129, 0.045), transparent 70%);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 14px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-snappy: cubic-bezier(0.2, 0, 0, 1);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0e1015;
  --bg-elevated: #161922;
  --card-surface: linear-gradient(180deg, #181c26 0%, #141720 100%);
  --bg-recessed: #101218;
  --bg-subtle: #1b1f2b;
  --bg-muted: #252b3a;
  --bg-hover: rgba(255, 255, 255, 0.055);
  --seg-pill-bg: #242a38;

  --border: rgba(255, 255, 255, 0.072);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #e5e8f0;
  --text-secondary: #98a0b3;
  --text-muted: #687085;

  --primary: #dfe3ee;
  --primary-fg: #0e1015;
  --primary-hover: #eef1f8;

  /* Eye-comfort anodized glass CTA in Dark Mode (zero blinding white halation!) */
  --card-cta-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.065) 100%);
  --card-cta-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.19) 0%, rgba(255, 255, 255, 0.1) 100%);
  --card-cta-fg: #eef1f8;
  --card-cta-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.12), 0 2px 6px rgba(0, 0, 0, 0.35);

  --badge-metal-bg: linear-gradient(145deg, #2a3042 0%, #1b1f2c 100%);
  --badge-metal-fg: #eef1f8;
  --badge-metal-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.1), 0 2px 6px rgba(0, 0, 0, 0.35);

  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.14);
  --ok-text: #34d399;
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --warn-text: #fbbf24;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --danger-text: #f87171;

  --card-specular: rgba(255, 255, 255, 0.13);
  --card-ring: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 0 0 1px rgba(255, 255, 255, 0.072), 0 4px 14px -4px rgba(0, 0, 0, 0.42);
  --card-ring-hover: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.15), 0 14px 32px -10px rgba(0, 0, 0, 0.65);
  --recessed-ring: inset 0 1px 2px rgba(0, 0, 0, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.055);
  --seg-pill-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 3px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.09);
  --modal-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.11), 0 28px 72px -12px rgba(0, 0, 0, 0.8);
  --dock-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.14);

  --grid-dot: rgba(255, 255, 255, 0.065);
  --ambient-glow:
    radial-gradient(680px 320px at 24% -70px, rgba(99, 102, 241, 0.095), transparent 72%),
    radial-gradient(620px 290px at 76% -80px, rgba(20, 184, 166, 0.075), transparent 72%);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--ambient-glow);
}
.ambient-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--grid-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 78% 360px at 50% 0%, #000 12%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 78% 360px at 50% 0%, #000 12%, transparent 78%);
}

.hidden { display: none !important; }
.muted { color: var(--text-muted); margin: 0; }
.muted-sm { color: var(--text-muted); font-size: 12px; margin: 0; }

/* ==================== Tactile Controls ==================== */
button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button:focus,
a:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5.5px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition:
    background-color 0.15s var(--ease-snappy),
    border-color 0.15s var(--ease-snappy),
    color 0.15s var(--ease-snappy),
    box-shadow 0.15s var(--ease-snappy),
    transform 0.1s var(--ease-snappy),
    opacity 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-card-cta {
  background: var(--card-cta-bg);
  color: var(--card-cta-fg);
  box-shadow: var(--card-cta-shadow);
  font-weight: 500;
}
.btn-card-cta:hover:not(:disabled) {
  background: var(--card-cta-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.03);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn-subtle {
  background: var(--bg-subtle);
  color: var(--text);
}
.btn-subtle:hover:not(:disabled) {
  background: var(--bg-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
}

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 5px; }
.btn-block { width: 100%; height: 38px; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); }
.btn-icon-only { width: 30px; height: 30px; padding: 0; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
}
.icon-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
}
.icon-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.icon-btn-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: none;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.icon-btn-xs:hover {
  background: var(--border-strong);
  color: var(--text);
}

.is-spinning svg {
  animation: spin 0.72s linear infinite;
}

.theme-btn svg {
  transition: transform 0.35s var(--ease-out-expo);
}
.theme-btn:hover svg {
  transform: rotate(18deg);
}

/* Copy success morph state */
.is-copied {
  color: var(--ok-text) !important;
}
.is-copied svg {
  animation: popIn 0.24s var(--ease-out-expo);
}

/* ==================== Brand Glyph ==================== */
.brand-glyph {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--badge-metal-bg);
  color: var(--badge-metal-fg);
  flex-shrink: 0;
  box-shadow: var(--badge-metal-shadow);
}
.brand-glyph-lg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

/* ==================== Login Screen ==================== */
.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: 100%;
  max-width: 380px;
  animation: surfaceEnter 0.36s var(--ease-out-expo);
}

.login-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--modal-shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 24px;
}
.login-brand-copy h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.login-brand-copy p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-group {
  display: flex;
  align-items: center;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  padding: 0 5px 0 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
.input-group:focus-within {
  background: var(--bg-elevated);
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--bg-hover);
}
.input-group input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  min-width: 0;
}

.alert-error,
.alert-warn {
  padding: 8px 11px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  animation: fadeSlideIn 0.2s var(--ease-out-expo);
}
.alert-error {
  background: var(--danger-soft);
  color: var(--danger-text);
}
.alert-warn {
  background: var(--warn-soft);
  color: var(--warn-text);
  margin-bottom: 8px;
}

/* ==================== Topbar (Linear / Vercel Glass Bar) ==================== */
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  height: 52px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.03em;
}

.topbar-sep {
  width: 1px;
  height: 16px;
  background: var(--border-strong);
  transform: rotate(15deg);
}

/* Sliding Segmented Nav */
.main-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-recessed);
  box-shadow: var(--recessed-ring);
}

.nav-glider {
  position: absolute;
  top: 3px;
  left: 0;
  height: calc(100% - 6px);
  border-radius: 6px;
  background: var(--seg-pill-bg);
  box-shadow: var(--seg-pill-shadow);
  transition:
    transform 0.24s var(--ease-out-expo),
    width 0.24s var(--ease-out-expo);
  pointer-events: none;
  z-index: 0;
}

.nav-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5.5px;
  height: 26px;
  padding: 0 11px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.16s ease;
}
.nav-tab:hover {
  color: var(--text);
}
.nav-tab.active {
  color: var(--text);
  font-weight: 600;
}

.nav-count {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  transition: color 0.16s ease;
}
.nav-tab.active .nav-count {
  color: var(--text-secondary);
}

/* Command Search Box */
.topbar-center {
  flex: 1;
  max-width: 320px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px 0 10px;
  height: 31px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow 0.16s ease, background-color 0.16s ease;
}
.search-box:focus-within {
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--text), 0 0 0 3px var(--bg-hover);
}
.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  min-width: 0;
}
.search-box input::placeholder {
  color: var(--text-muted);
}
.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--bg-elevated);
  box-shadow: 0 0 0 1px var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.status-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-ok { background: var(--ok); box-shadow: 0 0 0 2px var(--ok-soft); }
.dot-warn, .dot-fallback { background: var(--warn); box-shadow: 0 0 0 2px var(--warn-soft); }
.dot-error { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }
.dot-idle { background: var(--text-muted); opacity: 0.45; }

.badge-mini {
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* ==================== Layout & Architectural Rail ==================== */
.main-layout {
  display: flex;
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 22px;
  gap: 26px;
  align-items: flex-start;
}

.sidebar {
  width: 208px;
  flex-shrink: 0;
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 8px;
}
.sidebar-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.sidebar-meta {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.user-list {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.user-rail-glider {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  box-shadow: var(--card-ring);
  transition:
    transform 0.24s var(--ease-out-expo),
    height 0.24s var(--ease-out-expo),
    opacity 0.16s ease;
  pointer-events: none;
  z-index: 0;
}

.user-list-items {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.user-nav-item:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text);
}
.user-nav-item.active {
  color: var(--text);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--border);
  flex-shrink: 0;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.user-nav-item.active .user-avatar {
  background: var(--badge-metal-bg);
  color: var(--badge-metal-fg);
  box-shadow: var(--badge-metal-shadow);
}

.user-nav-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
}
.user-nav-name {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-nav-item.active .user-nav-name {
  font-weight: 600;
}

.user-nav-count {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  flex-shrink: 0;
}
.user-nav-item.active .user-nav-count {
  color: var(--text);
  font-weight: 600;
}

/* ==================== Workspace & Editorial Header ==================== */
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-user-bar {
  display: none;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.mobile-user-bar::-webkit-scrollbar { display: none; }

.editorial-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.editorial-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editorial-title-group {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.user-avatar-md {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--badge-metal-fg);
  background: var(--badge-metal-bg);
  flex-shrink: 0;
  box-shadow: var(--badge-metal-shadow);
}

.editorial-heading {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.editorial-heading-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.editorial-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.25;
}
.editorial-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner-right-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Refined Traffic Meter */
.traffic-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--bg-elevated);
  box-shadow: var(--card-ring);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.traffic-mini-bar {
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}
.traffic-mini-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981 0%, #6366f1 100%);
  transition: width 0.5s var(--ease-out-expo);
}

/* Sliding Segmented Filter Bar */
.seg-filter-bar {
  position: relative;
  display: inline-flex;
  align-self: flex-start;
  flex-wrap: wrap;
  align-items: center;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-recessed);
  box-shadow: var(--recessed-ring);
}

.seg-glider {
  position: absolute;
  top: 3px;
  left: 0;
  height: 26px;
  border-radius: 6px;
  background: var(--seg-pill-bg);
  box-shadow: var(--seg-pill-shadow);
  transition:
    transform 0.24s var(--ease-out-expo),
    width 0.24s var(--ease-out-expo),
    opacity 0.15s ease;
  pointer-events: none;
  z-index: 0;
}

.seg-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 11px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease;
}
.seg-btn:hover {
  color: var(--text);
}
.seg-btn.active {
  color: var(--text);
  font-weight: 600;
}
.seg-btn-num {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.seg-btn.active .seg-btn-num {
  color: var(--text-secondary);
}

/* ==================== Client Sections & Profile Cards ==================== */
.clients-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.client-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px;
}

.client-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.client-section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong) 0%, transparent 90%);
  opacity: 0.65;
}
.client-icon-mini {
  width: 23px;
  height: 23px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.client-icon-mini[data-client='mihomo'] {
  background: rgba(99, 102, 241, 0.13);
  color: #6366f1;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.24);
}
[data-theme='dark'] .client-icon-mini[data-client='mihomo'] { color: #818cf8; }

.client-icon-mini[data-client='surge'] {
  background: rgba(14, 165, 233, 0.13);
  color: #0284c7;
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.24);
}
[data-theme='dark'] .client-icon-mini[data-client='surge'] { color: #38bdf8; }

.client-icon-mini[data-client='singbox'] {
  background: rgba(16, 185, 129, 0.13);
  color: #059669;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.24);
}
[data-theme='dark'] .client-icon-mini[data-client='singbox'] { color: #34d399; }

.client-icon-mini[data-client='singbox-ref1nd'] {
  background: rgba(20, 184, 166, 0.14);
  color: #0d9488;
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.28);
}
[data-theme='dark'] .client-icon-mini[data-client='singbox-ref1nd'] { color: #2dd4bf; }

.client-icon-mini[data-client='stash'] {
  background: rgba(168, 85, 247, 0.13);
  color: #9333ea;
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.24);
}
[data-theme='dark'] .client-icon-mini[data-client='stash'] { color: #c084fc; }

.client-icon-mini[data-client='loon'] {
  background: rgba(245, 158, 11, 0.13);
  color: #d97706;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.24);
}
[data-theme='dark'] .client-icon-mini[data-client='loon'] { color: #fbbf24; }

.client-icon-mini[data-client='quantumultx'] {
  background: rgba(244, 63, 94, 0.13);
  color: #e11d48;
  box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.24);
}
[data-theme='dark'] .client-icon-mini[data-client='quantumultx'] { color: #fb7185; }
.client-section-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.section-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Card Entrance Choreography */
.stagger-item {
  animation: cardReveal 0.28s var(--ease-out-expo) both;
  animation-delay: calc(var(--stagger, 0) * 22ms);
}

.profile-card,
.provider-card,
.ruleset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--card-ring);
  overflow: hidden;
  transition:
    box-shadow 0.2s var(--ease-out-expo),
    transform 0.2s var(--ease-out-expo);
}
.profile-card::before,
.provider-card::before,
.ruleset-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 8%, var(--card-specular) 50%, transparent 92%);
  pointer-events: none;
}

.profile-card:hover,
.provider-card:hover,
.ruleset-card:hover {
  box-shadow: var(--card-ring-hover);
  transform: translateY(-1px);
}

.provider-card.is-checked {
  box-shadow: 0 0 0 1.5px var(--text), 0 8px 20px -10px rgba(0, 0, 0, 0.15);
}

.card-main {
  padding: 15px 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.card-slug {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* Subtle Badges (Zero Heavy Border Noise) */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 7.5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}
.pill-badge-mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
  border-radius: 5px;
}
.pill-badge-ok {
  background: var(--ok-soft);
  color: var(--ok-text);
}
.pill-badge-warn {
  background: var(--warn-soft);
  color: var(--warn-text);
}
.pill-badge-error {
  background: var(--danger-soft);
  color: var(--danger-text);
}
.pill-badge-dark {
  background: var(--primary);
  color: var(--primary-fg);
}

/* ==================== Unified Recessed Segmented Track (Protocols & Targets) ==================== */
.seg-track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-recessed);
  box-shadow: var(--recessed-ring);
}

.seg-track-options {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.track-glider {
  position: absolute;
  top: 0;
  left: 0;
  height: 24px;
  border-radius: 6px;
  background: var(--seg-pill-bg);
  box-shadow: var(--seg-pill-shadow);
  transition:
    transform 0.22s var(--ease-out-expo),
    width 0.22s var(--ease-out-expo),
    opacity 0.14s ease;
  pointer-events: none;
  z-index: 0;
}

.track-opt {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.16s var(--ease-snappy),
    color 0.16s var(--ease-snappy),
    box-shadow 0.16s var(--ease-snappy),
    transform 0.1s ease;
}
.track-opt:hover:not(:disabled):not(.selected):not(.selected-glided) {
  color: var(--text);
  background: var(--bg-hover);
}
.track-opt:active:not(:disabled) {
  transform: scale(0.96);
}
.track-opt.selected {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--seg-pill-shadow);
}
.track-opt.selected-glided {
  background: transparent;
  color: var(--text);
  font-weight: 600;
}
.track-opt.selected-multi {
  background: var(--card-cta-bg);
  color: var(--card-cta-fg);
  font-weight: 600;
  box-shadow: var(--card-cta-shadow);
}
.track-opt:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  color: var(--text-muted);
}

.track-meta-right {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 3px;
  flex-shrink: 0;
}

.micro-toggle {
  height: 22px;
  padding: 0 7px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.micro-toggle:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.micro-toggle.is-multi {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--seg-pill-shadow);
}

/* ==================== Prettified Endpoint Bar (Dub.co / Stripe Style) ==================== */
.endpoint-bar {
  display: flex;
  align-items: center;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-recessed);
  box-shadow: var(--recessed-ring);
  overflow: hidden;
  transition: box-shadow 0.16s ease, background-color 0.16s ease;
}
.endpoint-bar:hover {
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.endpoint-bar.url-flash {
  animation: endpointPulse 0.36s var(--ease-out-expo);
}

.ui-select-trigger {
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  padding: 0 9px 0 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: color 0.14s ease, background-color 0.14s ease;
}
.ui-select-trigger:hover,
.ui-select-trigger.is-open {
  color: var(--text);
  background: var(--bg-hover);
}
.ui-select-trigger.no-right-border {
  border-right: none;
}
.ui-select-trigger.has-left-border {
  border-left: 1px solid var(--border);
}

.ui-select-chevron {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  transition: transform 0.2s var(--ease-out-expo), color 0.14s ease;
}
.ui-select-trigger.is-open .ui-select-chevron {
  transform: rotate(180deg);
  color: var(--text);
}

.ui-select-dock-trigger {
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px 0 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary-fg) 22%, transparent);
  background: color-mix(in srgb, var(--primary-fg) 10%, var(--primary));
  color: var(--primary-fg);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease;
}
.ui-select-dock-trigger:hover {
  background: color-mix(in srgb, var(--primary-fg) 18%, var(--primary));
}

/* Radix / Shadcn Style Floating Popover Menu */
.ui-select-popover {
  position: fixed;
  z-index: 88;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  box-shadow: var(--modal-shadow);
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 280px;
  overflow-y: auto;
  animation: popoverSpringIn 0.16s var(--ease-out-expo) both;
}
.ui-select-popover.is-closing {
  animation: popoverOut 0.12s ease forwards;
}

.ui-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 28px;
  padding: 5px 9px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.1s ease, color 0.1s ease;
}
.ui-select-opt-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.ui-select-opt-sub {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.cdn-trigger {
  gap: 5px;
  padding: 0 9px;
  font-variant-numeric: tabular-nums;
}
.cdn-trigger.is-custom-cdn {
  border-color: var(--border-strong);
  color: var(--text);
}
.cdn-prefix {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-right: 2px;
}
.cdn-trigger.is-open .ui-select-chevron {
  transform: rotate(180deg);
  color: var(--text);
}
.ui-select-option:hover {
  background: var(--bg-subtle);
  color: var(--text);
}
.ui-select-option.selected {
  color: var(--text);
  font-weight: 600;
  background: var(--bg-subtle);
}
.ui-select-check {
  display: inline-flex;
  color: var(--text);
}

.endpoint-url-btn {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.endpoint-url-btn:hover {
  color: var(--text);
}

.endpoint-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-param-tag {
  flex-shrink: 0;
  padding: 0 5px;
  height: 18px;
  line-height: 18px;
  border-radius: 4px;
  background: var(--bg-elevated);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 10.5px;
  color: var(--text);
}

.endpoint-copy-trigger {
  width: 30px;
  height: 100%;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.endpoint-copy-trigger:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ==================== Whisper-Clean Card Action Footer ==================== */
.card-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 12px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-subtle) 42%, var(--bg-elevated));
}

.footer-left-actions,
.footer-right-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.footer-meta-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 3px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
}
.toolbar-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.toolbar-btn:active {
  transform: scale(0.96);
}
.toolbar-btn-primary {
  color: var(--text);
  font-weight: 600;
}

.static-variants-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ==================== Providers & RuleSets Grids ==================== */
.providers-grid,
.rulesets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Grouped Hairline Slot List (No Nested Box Clutter!) */
.slots-group {
  border-radius: var(--radius-sm);
  background: var(--bg-recessed);
  box-shadow: var(--recessed-ring);
  overflow: hidden;
}

.slot-item {
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slot-item + .slot-item {
  border-top: 1px solid var(--border);
}

.slot-row-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slot-left,
.slot-right {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.slot-name {
  font-weight: 600;
  font-size: 12px;
}
.slot-format {
  font-size: 11px;
  color: var(--text-muted);
}

.slot-url-drawer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  animation: fadeSlideIn 0.18s var(--ease-out-expo);
}
.slot-url-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Provider Card Merge Toggle Pill */
.provider-merge-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background-color 0.16s var(--ease-snappy),
    border-color 0.16s var(--ease-snappy),
    color 0.16s var(--ease-snappy),
    box-shadow 0.16s var(--ease-snappy),
    transform 0.1s ease;
}
.provider-merge-toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
  color: var(--text);
}
.provider-merge-toggle:active {
  transform: scale(0.96);
}
.provider-merge-toggle.is-selected {
  border-color: transparent;
  background: var(--card-cta-bg);
  color: var(--card-cta-fg);
  box-shadow: var(--card-cta-shadow);
  font-weight: 600;
}

.combine-cta-btn {
  gap: 6px;
}
.combine-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 18%, transparent);
  color: inherit;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.provider-traffic-row {
  display: flex;
  align-items: center;
  margin-top: -4px;
}

/* Multi-Provider Combine Export Builder Modal */
.modal-md { max-width: 620px; }

.combine-builder-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.combine-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.combine-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.combine-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.combine-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.combine-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.combine-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}
.combine-chip:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
  color: var(--text);
}
.combine-chip:active {
  transform: scale(0.97);
}
.combine-chip.is-selected {
  border-color: transparent;
  background: var(--card-cta-bg);
  color: var(--card-cta-fg);
  box-shadow: var(--card-cta-shadow);
  font-weight: 600;
}
.combine-chip-id {
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.72;
}
.combine-format-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.combine-format-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 31px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-recessed);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.combine-format-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.combine-format-btn.is-selected {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--seg-pill-shadow);
}
.combine-empty-hint {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-recessed);
  box-shadow: var(--recessed-ring);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.combine-builder-footer {
  justify-content: space-between;
  flex-wrap: wrap;
}
.combine-footer-left,
.combine-footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .combine-format-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.provider-check {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elevated);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}
.provider-check:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.provider-check:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1.2px;
  width: 4px;
  height: 7.5px;
  border: solid var(--primary-fg);
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}

/* Floating Selection Dock (Linear / Figma Multi-Select Bar) */
.floating-dock {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 15px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: var(--dock-shadow);
  font-size: 12px;
  animation: dockSlideUp 0.26s var(--ease-out-expo);
}
[data-theme='dark'] .floating-dock {
  background: rgba(24, 29, 40, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 18px 42px -10px rgba(0, 0, 0, 0.65);
}
[data-theme='dark'] .floating-dock .ui-select-dock-trigger {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
[data-theme='dark'] .floating-dock .dock-btn {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}
[data-theme='dark'] .floating-dock .dock-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
[data-theme='dark'] .floating-dock .dock-btn-solid {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.13) 100%);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.floating-dock-select {
  appearance: none;
  -webkit-appearance: none;
  height: 26px;
  padding: 0 22px 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary-fg) 22%, transparent);
  background-color: color-mix(in srgb, var(--primary-fg) 10%, var(--primary));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  color: var(--primary-fg);
  font-size: 11.5px;
  outline: none;
  cursor: pointer;
}
.floating-dock-select option {
  background: var(--bg-elevated);
  color: var(--text);
}
.dock-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: none;
  background: color-mix(in srgb, var(--primary-fg) 14%, transparent);
  color: var(--primary-fg);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.1s ease;
}
.dock-btn:hover {
  background: color-mix(in srgb, var(--primary-fg) 24%, transparent);
}
.dock-btn-solid {
  background: var(--primary-fg);
  color: var(--primary);
  font-weight: 600;
}
.dock-btn-solid:hover {
  background: color-mix(in srgb, var(--primary-fg) 90%, transparent);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--card-ring);
  color: var(--text-muted);
  font-size: 13px;
}

/* ==================== Animated Modals & Vaul Slide-Over Drawer ==================== */
.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(9, 9, 11, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: backdropIn 0.2s ease both;
}
.modal-backdrop.modal-layer-top {
  z-index: 75;
}
.drawer-backdrop {
  justify-content: flex-end;
  padding: 0;
}

.modal-backdrop.is-closing,
.drawer-backdrop.is-closing {
  animation: backdropOut 0.18s ease forwards;
}

.modal-dialog {
  width: 100%;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--modal-shadow);
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  overflow: hidden;
  animation: modalSpringIn 0.24s var(--ease-out-expo) both;
}
.modal-backdrop.is-closing .modal-dialog {
  animation: modalOut 0.16s ease forwards;
}

.modal-sm { max-width: 390px; }
.modal-lg { max-width: 860px; }

.drawer-panel {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  background: var(--bg-elevated);
  box-shadow: var(--modal-shadow);
  display: flex;
  flex-direction: column;
  animation: drawerSlideIn 0.3s var(--ease-sheet) both;
}
.drawer-backdrop.is-closing .drawer-panel {
  animation: drawerSlideOut 0.2s var(--ease-snappy) forwards;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.modal-title-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.header-actions-inline {
  display: flex;
  align-items: center;
  gap: 5px;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}
.drawer-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.qr-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.qr-canvas {
  width: 224px;
  height: 224px;
  padding: 12px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 6px 18px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
  animation: surfaceEnter 0.22s var(--ease-out-expo);
}
.qr-url-box {
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--border);
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  max-height: 76px;
  overflow-y: auto;
}

.preview-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.preview-body {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
}

.code-shell {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0c0c0f;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.code-shell-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  background: #141418;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #a1a1aa;
}
.code-search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
}
.code-search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  color: #f4f4f6;
  font-size: 12px;
  outline: none;
}
.code-search-wrap input::placeholder {
  color: #71717a;
}
.code-stats {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #71717a;
  flex-shrink: 0;
}

.code-viewer {
  margin: 0;
  padding: 14px;
  color: #e4e4e7;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  overflow: auto;
  max-height: 54vh;
  white-space: pre;
}

/* ==================== Health Cards ==================== */
.health-card {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.health-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.health-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.health-counts {
  display: flex;
  gap: 12px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.health-reasons {
  margin: 2px 0 0;
  padding-left: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ==================== Entry Fission Row & Generic Resolver Drawer ==================== */
.entry-fission-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.entry-fission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-recessed);
  box-shadow: var(--recessed-ring);
  flex-wrap: wrap;
}
.entry-fission-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}
.entry-fission-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.resolver-switcher-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  flex-wrap: wrap;
}
.resolver-switcher-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.resolver-switcher-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.resolver-switcher-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
}
.resolver-switcher-pill:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.resolver-switcher-pill.active {
  background: var(--card-cta-bg);
  color: var(--card-cta-fg);
  border-color: transparent;
  box-shadow: var(--card-cta-shadow);
  font-weight: 600;
}
.resolver-switcher-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.72;
}
.resolver-switcher-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}
.entry-fission-trigger {
  height: 22px;
  max-width: 100%;
  min-width: 0;
  padding: 0 7px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.entry-fission-trigger > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entry-fission-trigger:hover {
  background: var(--bg-subtle);
}
.entry-fission-trigger.is-custom {
  border-color: var(--text-secondary);
}
.entry-fission-right {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.slot-internal-tag {
  background: var(--warn-soft) !important;
  color: var(--warn-text) !important;
}
.drawer-panel-wide {
  width: min(700px, 100%) !important;
  max-width: 100% !important;
}
.resolver-drawer-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 18px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.resolver-tab-btn {
  position: relative;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.resolver-tab-btn:hover {
  color: var(--text);
}
.resolver-tab-btn.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--text);
}
.resolver-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.resolver-section {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resolver-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.resolver-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.resolver-mode-group {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-xs);
  background: var(--bg-recessed);
  box-shadow: var(--recessed-ring);
  gap: 2px;
}
.resolver-mode-btn {
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.resolver-mode-btn.active {
  background: var(--seg-pill-bg);
  color: var(--text);
  box-shadow: var(--seg-pill-shadow);
}
.resolver-isp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.resolver-isp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
}
.resolver-isp-chip:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.resolver-isp-chip.is-selected {
  background: var(--card-cta-bg);
  color: var(--card-cta-fg);
  border-color: transparent;
  box-shadow: var(--card-cta-shadow);
}
.resolver-isp-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.65;
}
.resolver-dns-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.resolver-dns-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 11.5px;
  flex-wrap: wrap;
}
.resolver-dns-domain {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.resolver-dns-ips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.resolver-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 9px 11px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-recessed);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  outline: none;
}
.resolver-textarea:focus {
  border-color: var(--text-secondary);
}
.resolver-textarea-lg {
  min-height: 300px;
}
.resolver-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.resolver-asn-search {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.resolver-asn-search:focus {
  border-color: var(--text-secondary);
}
.resolver-asn-table-wrap {
  max-height: 410px;
  overflow: auto;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px var(--border);
  background: var(--bg-elevated);
}
.resolver-asn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.resolver-asn-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.resolver-asn-table td {
  padding: 6px 9px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.resolver-asn-table tr:last-child td {
  border-bottom: none;
}
.resolver-asn-input {
  width: 108px;
  height: 24px;
  padding: 0 7px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--bg-recessed);
  color: var(--text);
  font-size: 11.5px;
  outline: none;
}
.resolver-asn-input:focus {
  border-color: var(--text-secondary);
}
.resolver-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.resolver-checkbox-label input {
  accent-color: var(--text);
}

/* ==================== Sonner-Style Toast Stack ==================== */
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.72s linear infinite;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--modal-shadow);
  animation: toastEnter 0.24s var(--ease-out-expo) both;
}
.toast.is-leaving {
  animation: toastLeave 0.18s ease forwards;
}
.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toast-ok .toast-icon {
  background: var(--ok-soft);
  color: var(--ok-text);
}
.toast-error .toast-icon {
  background: var(--danger-soft);
  color: var(--danger-text);
}

/* ==================== Keyframes ==================== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes surfaceEnter {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes endpointPulse {
  0% { box-shadow: inset 0 0 0 1.5px var(--text); }
  100% { box-shadow: inset 0 0 0 1px var(--border); }
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes backdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modalSpringIn {
  from { opacity: 0.88; transform: translateY(8px) scale(0.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(4px) scale(0.975); }
}

@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes drawerSlideOut {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

@keyframes dockSlideUp {
  from { opacity: 0; transform: translate(-50%, 14px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes toastEnter {
  from { opacity: 0; transform: translateY(10px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastLeave {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(6px) scale(0.95); }
}

@keyframes popoverSpringIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes popoverOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-2px) scale(0.97); }
}

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

/* ==================== Responsive ==================== */
@media (max-width: 980px) {
  .hide-md { display: none; }
}
@media (max-width: 900px) {
  .main-layout { flex-direction: column; padding: 14px; gap: 14px; }
  .page-container { padding: 14px; }
  .sidebar { display: none; }
  .mobile-user-bar:not(.hidden) { display: flex; }
  .profiles-grid, .providers-grid, .rulesets-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 0 8px; gap: 4px; }
  .topbar-left { gap: 6px; min-width: 0; }
  .topbar-right { gap: 3px; flex-shrink: 0; }
  .brand-name, .nav-count, .hide-sm, .topbar-center, .topbar-sep { display: none; }
  .brand-glyph { width: 24px; height: 24px; border-radius: 6px; }
  .main-nav { padding: 2px; }
  .nav-tab { padding: 0 7px; font-size: 12px; height: 25px; }
  .cdn-trigger { padding: 0 6px; gap: 3px; height: 28px; }
  .cdn-trigger #cdn-active-label { display: none; }
  #btn-refresh-all, #btn-health { padding: 0 6px; height: 28px; }
  .btn-icon-only { width: 28px; height: 28px; }
  .card-main { padding: 13px 12px 11px; }
  .card-footer-bar { padding: 7px 10px; }
  .profile-card .footer-left-actions,
  .ruleset-card .footer-left-actions { display: none; }
  .profile-card .footer-right-actions,
  .ruleset-card .footer-right-actions { width: 100%; justify-content: space-between; }
  .provider-card .card-footer-bar { flex-wrap: wrap; gap: 8px; }
  .provider-card .footer-left-actions { width: 100%; }
  .provider-card .footer-left-actions .endpoint-bar { width: 100%; justify-content: space-between; }
  .provider-card .footer-right-actions { width: 100%; justify-content: space-between; }
  .toolbar-btn { padding: 0 6px; }
  .floating-dock { width: calc(100% - 20px); border-radius: var(--radius-md); flex-wrap: wrap; justify-content: center; gap: 8px; }
  .combine-builder-footer { flex-direction: row; justify-content: flex-end; gap: 6px; }
  .combine-footer-left { margin-right: auto; }
}
