/* WMR VPN · Mini App · custom styles
   Современный neo-glass UI с анимированным mesh-gradient фоном. */

:root {
  color-scheme: dark;
}

html, body {
  background: #020617;
  min-height: 100dvh;
}

/* ========== Mesh gradient background ========== */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mesh-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: blob-float 18s ease-in-out infinite;
  will-change: transform;
}

/* Бренд WMR — синий + красный (mesh-blobs под лого) */
.mesh-blob-1 {
  width: 60vw; height: 60vw;
  background: radial-gradient(circle at center, #0061AD 0%, transparent 65%);
  top: -10vw; left: -10vw;
  animation-delay: 0s;
}

.mesh-blob-2 {
  width: 55vw; height: 55vw;
  background: radial-gradient(circle at center, #B91922 0%, transparent 65%);
  bottom: -15vw; right: -10vw;
  animation-delay: -6s;
}

.mesh-blob-3 {
  width: 50vw; height: 50vw;
  background: radial-gradient(circle at center, #3380c1 0%, transparent 65%);
  top: 30%; left: 30%;
  animation-delay: -12s;
}

@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(15vw, -8vh) scale(1.08); }
  66%      { transform: translate(-12vw, 10vh) scale(0.94); }
}

/* film noise overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ========== Glass cards ========== */
.glass-card {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 20px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 40px -10px rgba(0, 0, 0, 0.6);
}

/* ========== Device cards ========== */
.device-card {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform 0.2s cubic-bezier(.16,1,.3,1), border-color 0.2s, box-shadow 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: slide .45s cubic-bezier(.16,1,.3,1) both;
}

.device-card.detected {
  border-color: rgba(0, 97, 173, 0.45);
  box-shadow: 0 0 0 1px rgba(0, 97, 173, 0.3),
              0 14px 35px -10px rgba(0, 97, 173, 0.35);
}

.device-card.detected::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  background: linear-gradient(135deg, rgba(0, 97, 173, 0.15), rgba(185, 25, 34, 0.08), transparent);
  z-index: -1;
  pointer-events: none;
}

.detected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0061AD, #B91922);
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(0, 97, 173, 0.5);
}

.device-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 97, 173, 0.08), rgba(185, 25, 34, 0.05));
  opacity: 0;
  transition: opacity 0.25s;
}

.device-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 97, 173, 0.4);
  box-shadow:
    0 0 0 1px rgba(0, 97, 173, 0.25),
    0 18px 50px -10px rgba(0, 97, 173, 0.35);
}

.device-card:hover::before { opacity: 1; }
.device-card:active { transform: translateY(0) scale(0.98); }

.device-card-icon {
  height: 48px;
  width: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0061AD, #B91922);
  box-shadow: 0 8px 24px -6px rgba(0, 97, 173, 0.4);
}

.device-card-icon.from-blue { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.device-card-icon.from-green { background: linear-gradient(135deg, #10b981, #22d3ee); }
.device-card-icon.from-orange { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.device-card-icon.from-purple { background: linear-gradient(135deg, #8b5cf6, #6366f1); }

/* Нечётная последняя карточка (напр. Linux при 5 платформах) — растягиваем на
   всю ширину и центрируем, чтобы не было «осиротевшей» плитки с пустотой.
   Класс .wide вешается из x-for по данным (надёжнее nth-child: Alpine
   оставляет <template> в DOM и сбивает parity). */
.device-card.wide {
  grid-column: 1 / -1;
  align-items: center;
  text-align: center;
}

/* ========== Hero device card (текущее устройство, сверху) ========== */
.device-hero {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 18px;
  border-radius: 22px;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  border: 1.5px solid rgba(0, 97, 173, 0.5);
  /* Насыщенный тёмный «spotlight»-фон, не зависящий от темы: белый текст и
     бренд-свечение читаются одинаково в light и dark. */
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(0, 97, 173, 0.45), transparent 62%),
    linear-gradient(135deg, #0a2746, #1a1226);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(0, 97, 173, 0.25),
    0 20px 50px -16px rgba(0, 97, 173, 0.5);
  transition: transform 0.25s cubic-bezier(.16,1,.3,1), box-shadow 0.3s, border-color 0.25s;
  animation: hero-rise .5s cubic-bezier(.16,1,.3,1) both;
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.device-hero:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 97, 173, 0.7);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.08) inset,
    0 0 0 1px rgba(0, 97, 173, 0.4),
    0 28px 70px -16px rgba(0, 97, 173, 0.6);
}
.device-hero:active { transform: translateY(-1px) scale(0.99); }

/* Пульсирующее свечение за карточкой */
.device-hero-glow {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 60%;
  height: 180%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 97, 173, 0.45), transparent 70%);
  filter: blur(10px);
  opacity: 0.7;
  animation: hero-glow 4.5s ease-in-out infinite;
}
@keyframes hero-glow {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 0.8;  transform: scale(1.12); }
}

/* Диагональный «блик», проезжающий по карточке при hover */
.device-hero-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.14) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.7s cubic-bezier(.16,1,.3,1);
}
.device-hero:hover .device-hero-sheen { transform: translateX(120%); }

.device-hero-icon {
  height: 60px;
  width: 60px;
  border-radius: 18px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.device-hero-icon i, .device-hero-icon svg { color: #fff; stroke: #fff; }

.device-hero-main {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.device-hero-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.device-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0061AD, #B91922);
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(0, 97, 173, 0.5);
  white-space: nowrap;
}
.device-hero-badge i, .device-hero-badge svg { color: #fff; stroke: #fff; }
.device-hero-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 3px 8px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 8px -2px rgba(16, 185, 129, 0.55);
  white-space: nowrap;
}
.device-hero-label {
  margin-top: 8px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.1;
  color: #f8fafc;
  letter-spacing: -0.01em;
}
.device-hero-hint {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.72);
}

.device-hero-arrow {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #cfe3f5;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  z-index: 1;
  transition: gap 0.2s, background 0.2s, color 0.2s;
}
.device-hero-arrow i, .device-hero-arrow svg { transition: transform 0.2s; flex-shrink: 0; }
.device-hero:hover .device-hero-arrow { gap: 9px; background: rgba(255, 255, 255, 0.14); color: #fff; }
.device-hero:hover .device-hero-arrow i, .device-hero:hover .device-hero-arrow svg { transform: translateX(2px); }

/* Узкие экраны (≤400): прячем текст «Настроить», оставляем стрелку-кнопку */
@media (max-width: 400px) {
  .device-hero { gap: 12px; padding: 16px 14px; }
  .device-hero-icon { height: 54px; width: 54px; }
  .device-hero-label { font-size: 20px; }
  .device-hero-arrow-txt { display: none; }
  .device-hero-arrow { padding: 10px; }
}

/* ========== Buttons ========== */
.primary-btn {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
  background: rgba(148, 163, 184, 0.13);
  border-color: rgba(0, 97, 173, 0.35);
  transform: translateY(-1px);
}

.primary-btn:active { transform: translateY(0) scale(0.98); }

.primary-gradient {
  background: linear-gradient(135deg, #0061AD 0%, #3380c1 40%, #B91922 100%);
  border-color: transparent;
  box-shadow: 0 10px 30px -8px rgba(0, 97, 173, 0.5);
}

.primary-gradient:hover {
  background: linear-gradient(135deg, #3380c1 0%, #6699cf 40%, #dc4f57 100%);
  border-color: transparent;
  box-shadow: 0 14px 40px -8px rgba(0, 97, 173, 0.7);
}

.secondary-btn {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.13);
  color: #cbd5e1;
  font-weight: 500;
  font-size: 13px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.secondary-btn:hover {
  background: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.25);
}

.danger-btn {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: 13px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.danger-btn:hover {
  background: rgba(244, 63, 94, 0.18);
  color: #fecdd3;
  border-color: rgba(244, 63, 94, 0.5);
}

.icon-btn {
  height: 38px; width: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.13);
  color: #cbd5e1;
  transition: background 0.2s, color 0.2s;
}

.icon-btn:hover { background: rgba(15, 23, 42, 0.8); color: #fff; }

.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px 6px 6px;
  border-radius: 10px;
  font-size: 13px;
  color: #94a3b8;
  transition: color 0.2s;
}

.back-btn:hover { color: #e2e8f0; }

/* ========== Step rows ========== */
.step-row {
  display: flex; align-items: center; gap: 14px;
}

.step-num {
  height: 32px; width: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0061AD, #B91922);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 18px -4px rgba(0, 97, 173, 0.5);
  shrink: 0;
}

/* ========== User rows ========== */
.user-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.2s, border-color 0.2s;
}

.user-row:hover {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.2);
}

/* ========== Status dot — единственный индикатор онлайн/revoked/never ========== */
/* Точка центрирована на нижне-правом углу аватара (его родитель — отдельный
   relative-wrapper без overflow:hidden, чтобы dot мог выпирать за пределы).
   Половина точки лежит ПОВЕРХ фотографии, половина — ПОВЕРХ фона карточки.
   Border под фон карточки (белый в light, тёмный в dark) рисует «дырку»
   между точкой и аватаром — точка читается как наклейка на углу. */
.status-dot {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  border: 2px solid #0b1220; /* фон карточки в dark */
  z-index: 5;
  pointer-events: none;
}
:root.light .status-dot {
  /* В светлой теме фон карточки белый/полупрозрачный — border под него. */
  border-color: #ffffff;
}

/* online — зелёный, пульсирует радиальное свечение */
.status-dot.is-online {
  background: #10b981; /* emerald-500 */
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: status-pulse-online 1.8s ease-out infinite;
}
@keyframes status-pulse-online {
  0%   { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0); }
}

/* revoked — красный, без пульса (статичный «стоп-сигнал») */
.status-dot.is-revoked {
  background: #ef4444; /* red-500 */
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: status-pulse-revoked 2.4s ease-out infinite;
}
@keyframes status-pulse-revoked {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* never connected — нейтральный серый, без анимации */
.status-dot.is-never {
  background: #94a3b8; /* slate-400 */
}

/* Legacy shim: .online-dot всё ещё может встречаться в кэшированном HTML */
.online-dot {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: #10b981;
  border: 2px solid #0b1220;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: status-pulse-online 1.8s ease-out infinite;
  z-index: 5;
  pointer-events: none;
}
:root.light .online-dot { border-color: #ffffff; }

/* Backward-compat shim: класс animate-pulse2 встречается в HTML.
   Мягкая пульсация opacity для прочих элементов (бейджи, badges). */
.animate-pulse2 {
  animation: pulse2-soft 2s ease-in-out infinite;
}
@keyframes pulse2-soft {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ========== Lucide icons sizing helper ========== */
[data-lucide] { stroke-width: 2; flex-shrink: 0; }

/* ========== Form inputs ========== */
.form-input {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: rgba(0, 97, 173, 0.55);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(0, 97, 173, 0.15);
}

.form-input::placeholder { color: #475569; }

/* respect Telegram safe area */
@supports (padding: env(safe-area-inset-bottom)) {
  main { padding-bottom: max(6rem, env(safe-area-inset-bottom) + 1rem); }
}

/* ============================================================
   Light theme — активируется классом .light на <html>.
   Реализация через !important переопределения утилитарных классов
   Tailwind. Чисто, без переписывания всех utility classes.
   ============================================================ */

:root.light { color-scheme: light; }
:root.light html, :root.light body { background: #f8fafc !important; }

/* Background gradient — мягче */
:root.light .mesh-blob-1 { background: radial-gradient(circle, rgba(168,85,247,0.18), transparent 60%); }
:root.light .mesh-blob-2 { background: radial-gradient(circle, rgba(236,72,153,0.16), transparent 60%); }
:root.light .mesh-blob-3 { background: radial-gradient(circle, rgba(59,130,246,0.16), transparent 60%); }
:root.light .noise-overlay { opacity: 0.4; }

/* Карточки и текст */
:root.light .glass-card {
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

/* Текстовые цвета: ink-* инвертируется (50↔950).
   КАНОН feedback_ui_contrast: на светлой теме все text-ink-* должны
   быть тёмными цветами (#1e293b…#475569) — иначе серое на белом нечитаемо.
   Fix 2026-05-24: добавлены text-ink-300/600, перевёрнут text-ink-700
   (был #cbd5e1 = светло-серый → стал #334155 = тёмно-серый). */
:root.light .text-ink-50 { color: #0f172a !important; }
:root.light .text-ink-100 { color: #1e293b !important; }
:root.light .text-ink-200 { color: #334155 !important; }
:root.light .text-ink-300 { color: #475569 !important; }
:root.light .text-ink-400 { color: #64748b !important; }
:root.light .text-ink-500 { color: #475569 !important; }
:root.light .text-ink-600 { color: #334155 !important; }
:root.light .text-ink-700 { color: #334155 !important; }
:root.light .text-ink-800 { color: #1e293b !important; }
:root.light .text-ink-900 { color: #0f172a !important; }

/* Фоны: ink-900/950/800 → светлые */
:root.light .bg-ink-950 { background-color: #f8fafc !important; }
:root.light .bg-ink-900 { background-color: rgba(241, 245, 249, 0.7) !important; }
:root.light .bg-ink-800 { background-color: rgba(226, 232, 240, 0.7) !important; }
:root.light .bg-ink-900\/60 { background-color: rgba(241, 245, 249, 0.5) !important; }
:root.light .bg-ink-900\/40 { background-color: rgba(241, 245, 249, 0.4) !important; }
:root.light .bg-ink-800\/40 { background-color: rgba(226, 232, 240, 0.4) !important; }

/* Бордеры */
:root.light .border-ink-700, :root.light .border-ink-800 { border-color: rgba(15, 23, 42, 0.1) !important; }
:root.light .border-ink-600 { border-color: rgba(15, 23, 42, 0.15) !important; }

/* body — текст по умолчанию */
:root.light body { color: #0f172a; }

/* Selection */
:root.light ::selection { background: rgba(0, 97, 173, 0.25); color: #0f172a; }

/* Кнопки и инпуты */
:root.light .form-input,
:root.light textarea.form-input {
  background: rgba(255, 255, 255, 0.8) !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
}
:root.light .form-input:focus { border-color: rgba(0, 97, 173, 0.5) !important; }
:root.light .icon-btn { background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(15, 23, 42, 0.08); color: #475569; }
:root.light .icon-btn:hover { background: rgba(255, 255, 255, 0.9); color: #0f172a; }
:root.light .secondary-btn { background: rgba(241, 245, 249, 0.8); color: #0f172a; border: 1px solid rgba(15, 23, 42, 0.1); }
:root.light .back-btn { color: #475569; }
:root.light .back-btn:hover { color: #0f172a; }

/* User row hover */
:root.light .user-row { background: rgba(255, 255, 255, 0.4); border: 1px solid rgba(15, 23, 42, 0.06); }
:root.light .user-row:hover { background: rgba(255, 255, 255, 0.7); border-color: rgba(15, 23, 42, 0.12); }

/* Brand-coloured pills остаются яркими — снижаем чуть-чуть */
/* Brand-цвета в light теме чуть темнее для контраста */
:root.light .text-brand-300 { color: #003a69 !important; }
:root.light .text-brand-200 { color: #003a69 !important; }
:root.light .text-brand-400 { color: #004e8c !important; }
:root.light .text-accent-300 { color: #94141b !important; }
:root.light .text-accent-400 { color: #94141b !important; }
:root.light .text-cyan-300 { color: #0891b2 !important; }
:root.light .text-emerald-300 { color: #047857 !important; }
:root.light .text-amber-300 { color: #b45309 !important; }
:root.light .text-rose-300 { color: #be123c !important; }

/* Code/Pre */
:root.light code, :root.light pre {
  background: rgba(241, 245, 249, 0.8);
  color: #0f172a;
}

/* Modal overlay */
:root.light .fixed.inset-0.bg-ink-950\/80 { background-color: rgba(15, 23, 42, 0.45) !important; }

/* Tailwind safelist для dynamic классов из trustBadgeClass:
   bg-emerald-500/20 text-emerald-300 border-emerald-400/30
   bg-amber-500/20 text-amber-300 border-amber-400/30
   bg-rose-500/20 text-rose-300 border-rose-400/30 */

/* ============================================================
   UX АУДИТ — фикс контраста выбранных кнопок и плавность
   ============================================================ */

/* Универсальный плавный transition для интерактивных элементов */
button, a, input, textarea, select { transition: background-color .18s, border-color .18s, color .18s, transform .12s, box-shadow .2s; }
button:active:not(:disabled), a:active { transform: scale(0.97); }

/* В DARK теме выбранные фильтр-кнопки имели text-brand-100 (почти белый) на bg-brand-500/15 (тёмно-синий) — нормально */
/* В LIGHT теме нужно усилить контраст: тёмный текст на светло-голубом фоне */
:root.light .text-brand-100 { color: #003a69 !important; }
:root.light .text-amber-100 { color: #78350f !important; }
:root.light .text-accent-100 { color: #6f0f14 !important; }
:root.light .text-emerald-100 { color: #064e3b !important; }
:root.light .text-cyan-100 { color: #155e75 !important; }
:root.light .text-rose-100 { color: #881337 !important; }
:root.light .text-violet-100 { color: #4c1d95 !important; }

/* Pill / badge цвета в light */
:root.light .bg-brand-500\/15 { background-color: rgba(0, 97, 173, 0.10) !important; }
:root.light .bg-brand-500\/20 { background-color: rgba(0, 97, 173, 0.14) !important; }
:root.light .bg-accent-500\/15 { background-color: rgba(185, 25, 34, 0.10) !important; }
:root.light .bg-accent-500\/20 { background-color: rgba(185, 25, 34, 0.14) !important; }
:root.light .bg-amber-500\/15 { background-color: rgba(245, 158, 11, 0.12) !important; }

/* Borders в light теме должны быть видны */
:root.light .border-brand-400\/30,
:root.light .border-brand-400\/40,
:root.light .border-brand-400\/60 { border-color: rgba(0, 97, 173, 0.45) !important; }
:root.light .border-accent-400\/30,
:root.light .border-accent-400\/40,
:root.light .border-accent-400\/60 { border-color: rgba(185, 25, 34, 0.45) !important; }
:root.light .border-amber-400\/30,
:root.light .border-amber-400\/50 { border-color: rgba(245, 158, 11, 0.55) !important; }

/* ============================================================
   КОНТРАСТ ВСЕХ COLOR-VARIANT'ов В LIGHT THEME
   2026-05-23: правило юзера — текст должен быть читаем на обеих темах.
   Все text-COLOR-200, text-COLOR-200/90, text-COLOR-200/80 в LIGHT
   переопределяются на тёмный оттенок (-700..-900), bg делается ярче.
   ============================================================ */

/* AMBER — warning */
:root.light .text-amber-200,
:root.light [class*="text-amber-200/"] { color: #78350f !important; }
:root.light .bg-amber-500\/5  { background-color: rgba(245, 158, 11, 0.10) !important; }
:root.light .bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.14) !important; }
:root.light .bg-amber-500\/20 { background-color: rgba(245, 158, 11, 0.20) !important; }
:root.light .border-amber-400\/15,
:root.light .border-amber-400\/20 { border-color: rgba(245, 158, 11, 0.55) !important; }

/* ROSE — danger */
:root.light .text-rose-200,
:root.light [class*="text-rose-200/"] { color: #881337 !important; }
:root.light .text-rose-300\/80 { color: #be123c !important; }
:root.light .bg-rose-500\/5  { background-color: rgba(225, 29, 72, 0.08) !important; }
:root.light .bg-rose-500\/10 { background-color: rgba(225, 29, 72, 0.12) !important; }
:root.light .bg-rose-500\/15 { background-color: rgba(225, 29, 72, 0.16) !important; }
:root.light .border-rose-400\/20,
:root.light .border-rose-400\/30 { border-color: rgba(225, 29, 72, 0.45) !important; }

/* EMERALD — success */
:root.light .text-emerald-200,
:root.light [class*="text-emerald-200/"] { color: #064e3b !important; }
:root.light .text-emerald-300\/80 { color: #047857 !important; }
:root.light .bg-emerald-500\/5  { background-color: rgba(16, 185, 129, 0.10) !important; }
:root.light .bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.14) !important; }
:root.light .bg-emerald-500\/15 { background-color: rgba(16, 185, 129, 0.18) !important; }
:root.light .bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.20) !important; }
:root.light .bg-emerald-500\/25,
:root.light .bg-emerald-500\/30 { background-color: rgba(16, 185, 129, 0.25) !important; }
:root.light .border-emerald-400\/20,
:root.light .border-emerald-400\/30,
:root.light .border-emerald-400\/40,
:root.light .border-emerald-400\/50 { border-color: rgba(5, 150, 105, 0.55) !important; }

/* SKY — info (если будем использовать) */
:root.light .text-sky-200,
:root.light [class*="text-sky-200/"] { color: #0c4a6e !important; }
:root.light .bg-sky-500\/5  { background-color: rgba(14, 165, 233, 0.10) !important; }
:root.light .bg-sky-500\/10 { background-color: rgba(14, 165, 233, 0.14) !important; }

/* AMBER-300, EMERALD-300, ROSE-300 — тоже могут быть на светлом — делаем чуть темнее */
:root.light .text-amber-300\/80 { color: #b45309 !important; }

/* Borders amber/rose/emerald slim opacities */
:root.light .border-emerald-400\/15 { border-color: rgba(5, 150, 105, 0.40) !important; }

/* Disabled state — явно видно что недоступно */
button:disabled, input:disabled, textarea:disabled, select:disabled {
  opacity: 0.55; cursor: not-allowed; pointer-events: none;
}
:root.light button:disabled { color: #94a3b8 !important; }

/* Focus ring — accessibility и красота */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Чтобы lucide иконки не выглядели огромными в light теме (баг) */
.lucide { stroke: currentColor !important; }

/* Smooth screen transitions при x-show */
[x-cloak] { display: none !important; }

/* Glow для важных primary-кнопок при hover */
.primary-gradient:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* Code/Inline */
code, pre {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85em;
}

/* Hide scrollbar but keep functionality для длинных списков */
.glass-card .overflow-y-auto::-webkit-scrollbar { width: 4px; }
.glass-card .overflow-y-auto::-webkit-scrollbar-track { background: transparent; }
.glass-card .overflow-y-auto::-webkit-scrollbar-thumb {
  background: rgba(0, 97, 173, 0.3);
  border-radius: 4px;
}

/* Логотип header — небольшая тень */
img[alt="WebMasters"] {
  filter: drop-shadow(0 2px 8px rgba(0, 97, 173, 0.3));
}
:root.light img[alt="WebMasters"] {
  filter: drop-shadow(0 2px 8px rgba(0, 97, 173, 0.2));
}

/* Чипы-теги внутри карточек */
.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

/* Animation для появления новых элементов в списке */
@keyframes slide-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.glass-card.animate-slide,
.glass-card.animate-pop {
  animation: slide-in .35s cubic-bezier(.16,1,.3,1) both;
}

/* ============================================================
   ПОЛНАЯ ПЕРЕРАБОТКА LIGHT THEME — бренд WebMasters
   Цель: чтобы выглядело как родное светлое приложение, а не серая пустота.
   ============================================================ */

:root.light html, :root.light body {
  background: linear-gradient(180deg, #f0f7ff 0%, #fff5f5 100%) !important;
}

/* Усиливаем mesh-блобы в light — иначе фон серый */
:root.light .mesh-blob { opacity: 0.5 !important; mix-blend-mode: multiply; filter: blur(70px); }
:root.light .mesh-blob-1 { background: radial-gradient(circle at center, rgba(0, 97, 173, 0.35) 0%, transparent 70%) !important; }
:root.light .mesh-blob-2 { background: radial-gradient(circle at center, rgba(185, 25, 34, 0.30) 0%, transparent 70%) !important; }
:root.light .mesh-blob-3 { background: radial-gradient(circle at center, rgba(51, 128, 193, 0.28) 0%, transparent 70%) !important; }

/* Glass card в light — белый с бренд-подложкой и тенью */
:root.light .glass-card {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(0, 97, 173, 0.15) !important;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.9) inset,
    0 4px 16px -2px rgba(0, 97, 173, 0.08),
    0 18px 50px -12px rgba(0, 97, 173, 0.12) !important;
}

/* Кнопки группы (фильтры периодов / off-monitor-block / etc) ─ ЯВНЫЕ STATES */
/* Невыбранная — белый фон, тёмная рамка, тёмный текст */
:root.light button[class*="bg-ink-900\/60"],
:root.light button[class*="bg-ink-900\/40"] {
  background: rgba(241, 245, 249, 0.85) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #475569 !important;
}

/* Выбранная кнопка-фильтр (синяя) */
:root.light button[class*="bg-brand-500\/15"],
:root.light button[class*="bg-brand-500\/20"] {
  background: linear-gradient(135deg, #0061AD, #3380c1) !important;
  border-color: #0061AD !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px -2px rgba(0, 97, 173, 0.4);
}

/* Выбранная кнопка-фильтр (красная/accent) */
:root.light button[class*="bg-accent-500\/15"],
:root.light button[class*="bg-accent-500\/20"] {
  background: linear-gradient(135deg, #B91922, #dc4f57) !important;
  border-color: #B91922 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px -2px rgba(185, 25, 34, 0.4);
}

/* Выбранная кнопка-фильтр (жёлтая/amber — режимы monitor/log_only) */
:root.light button[class*="bg-amber-500\/15"],
:root.light button[class*="bg-amber-500\/20"] {
  background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
  border-color: #d97706 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px -2px rgba(245, 158, 11, 0.4);
}

/* Выбранная зелёная */
:root.light button[class*="bg-emerald-500\/15"],
:root.light button[class*="bg-emerald-500\/20"] {
  background: linear-gradient(135deg, #10b981, #34d399) !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

/* Выбранная rose (rejected) */
:root.light button[class*="bg-rose-500\/10"],
:root.light button[class*="bg-rose-500\/15"] {
  background: linear-gradient(135deg, #f43f5e, #fb7185) !important;
  border-color: #e11d48 !important;
  color: #ffffff !important;
}

/* Primary gradient button — насыщенный бренд */
:root.light .primary-btn { background: rgba(255, 255, 255, 0.6); color: #0f172a; border-color: rgba(0, 97, 173, 0.18); }
:root.light .primary-gradient {
  background: linear-gradient(135deg, #0061AD 0%, #3380c1 40%, #B91922 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 10px 28px -8px rgba(0, 97, 173, 0.5), 0 4px 10px -2px rgba(185, 25, 34, 0.25);
}
:root.light .primary-gradient:hover {
  filter: brightness(1.08);
  box-shadow: 0 14px 36px -8px rgba(0, 97, 173, 0.6), 0 6px 14px -2px rgba(185, 25, 34, 0.3);
}

/* Текст в карточках под брендовый фон */
:root.light body, :root.light .text-ink-50, :root.light .text-ink-100 { color: #0f172a !important; }
:root.light .text-ink-200 { color: #1e293b !important; }
:root.light .text-ink-300 { color: #334155 !important; }

/* ============ Чипы блокировки категорий (тема-независимые) ============ */
/* Заблокированная категория — красный «активный» вид */
.cat-chip-blocked {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(244, 63, 94, 0.55);
  background: rgba(244, 63, 94, 0.18);
  color: #fecdd3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cat-chip-blocked:hover {
  background: rgba(244, 63, 94, 0.28);
  border-color: rgba(251, 113, 133, 0.85);
}
:root.light .cat-chip-blocked {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(190, 18, 60, 0.45);
  color: #881337;
}
:root.light .cat-chip-blocked:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(190, 18, 60, 0.7);
}

/* Доступная для блокировки категория — нейтральный вид с красным hover */
.cat-chip-available {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.4);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cat-chip-available:hover {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(244, 63, 94, 0.1);
  color: #fecdd3;
}
:root.light .cat-chip-available {
  background: rgba(241, 245, 249, 0.7);
  border-color: rgba(15, 23, 42, 0.12);
  color: #475569;
}
:root.light .cat-chip-available:hover {
  border-color: rgba(190, 18, 60, 0.5);
  background: rgba(244, 63, 94, 0.08);
  color: #881337;
}
:root.light .text-ink-400 { color: #475569 !important; }
:root.light .text-ink-500 { color: #64748b !important; }

/* h1, h2, h3 — обязательно тёмные */
:root.light h1, :root.light h2, :root.light h3 { color: #0f172a !important; }

/* Logo glow по бренду */
:root.light img[alt="WebMasters"] {
  filter: drop-shadow(0 2px 12px rgba(0, 97, 173, 0.35)) drop-shadow(0 4px 16px rgba(185, 25, 34, 0.15)) !important;
}

/* Floating role-toggle chip — контраст в light */
:root.light .fixed.top-3.right-3 button { background: rgba(255, 255, 255, 0.85) !important; color: #0061AD; border-color: rgba(0, 97, 173, 0.3); box-shadow: 0 4px 12px -2px rgba(0, 97, 173, 0.2); }

/* Inputs в light */
:root.light input, :root.light textarea, :root.light select {
  background: #ffffff !important;
  border: 1px solid rgba(0, 97, 173, 0.2) !important;
  color: #0f172a !important;
}
:root.light input:focus, :root.light textarea:focus, :root.light select:focus {
  border-color: #0061AD !important;
  box-shadow: 0 0 0 3px rgba(0, 97, 173, 0.12);
}
:root.light input::placeholder, :root.light textarea::placeholder { color: #94a3b8 !important; }

/* Code/pre — фон под цвет */
:root.light code, :root.light pre {
  background: rgba(0, 97, 173, 0.08) !important;
  color: #003a69 !important;
  border: 1px solid rgba(0, 97, 173, 0.12);
  border-radius: 4px;
  padding: 1px 4px;
}

/* ADMIN бейдж в карточке (был fuchsia, сейчас brand) — явные стили */
:root.light .text-brand-300 { color: #003a69 !important; }
:root.light .bg-brand-500\/20 { background: rgba(0, 97, 173, 0.18) !important; }

/* Notifications/Alerts фон — мягкий тонированный */
:root.light .bg-ink-900\/40 { background: rgba(248, 250, 252, 0.7) !important; }
:root.light .bg-ink-900\/60 { background: rgba(241, 245, 249, 0.85) !important; }

/* Activity feed строки в light */
:root.light .glass-card .bg-ink-900\/40 {
  background: rgba(248, 250, 252, 0.6) !important;
  border-left: 2px solid rgba(0, 97, 173, 0.12);
}

/* Стрелки и иконки в light — тёмнее */
:root.light .text-ink-500 svg, :root.light .icon-btn { color: #475569 !important; }

/* Кнопки device-type в add device modal — явный selected */
:root.light .bg-brand-500\/10 { background: rgba(0, 97, 173, 0.10) !important; }

/* SVG карта world — фон в light */
:root.light [style*="background:linear-gradient(135deg,rgba(15,23,42,0.4)"] {
  background: linear-gradient(135deg, rgba(0, 97, 173, 0.10), rgba(185, 25, 34, 0.06)) !important;
}

/* Animation: появление страницы — smooth fade */
@keyframes screen-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
section[x-show] { animation: screen-fade-in .25s ease-out; }

/* Карточки внутри списков получают staggered delay */
.glass-card.animate-pop:nth-child(1) { animation-delay: 0ms; }
.glass-card.animate-pop:nth-child(2) { animation-delay: 60ms; }
.glass-card.animate-pop:nth-child(3) { animation-delay: 120ms; }
.glass-card.animate-pop:nth-child(4) { animation-delay: 180ms; }

/* Toast — насыщенный в light */
:root.light .glass-card.border-emerald-400\/50 {
  background: linear-gradient(135deg, #d1fae5, #ecfdf5) !important;
  color: #064e3b !important;
}
:root.light .glass-card.border-rose-400\/50 {
  background: linear-gradient(135deg, #fee2e2, #fef2f2) !important;
  color: #7f1d1d !important;
}

/* Welcome screen header в light — лого должен светиться */
:root.light header .text-brand-300 { color: #003a69 !important; font-weight: 700; }

/* Чтобы блобы были видны над белым фоном */
:root.light .noise-overlay { opacity: 0.02 !important; }


/* ============================================================
   M1.4 — фиксы конкретных багов после визуального теста
   ============================================================ */

/* 1. Иконки lucide внутри primary-gradient кнопок — всегда белые */
.primary-gradient svg,
.primary-gradient i,
.primary-gradient i[data-lucide] {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/* 2. Floating role-toggle chip — бренд цвета (синий когда admin, красный когда preview) */
.fixed.top-3.right-3 button {
  background: linear-gradient(135deg, #0061AD, #3380c1) !important;
  border: 1px solid #0061AD !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px -2px rgba(0, 97, 173, 0.45);
  font-weight: 600;
}
.fixed.top-3.right-3 button[class*="bg-amber"] {
  background: linear-gradient(135deg, #B91922, #dc4f57) !important;
  border-color: #B91922 !important;
  box-shadow: 0 4px 14px -2px rgba(185, 25, 34, 0.45);
}
.fixed.top-3.right-3 button svg,
.fixed.top-3.right-3 button i { color: #ffffff !important; stroke: #ffffff !important; }
.fixed.top-3.right-3 span[class*="bg-amber"] {
  background: linear-gradient(135deg, #B91922, #dc4f57) !important;
  color: #ffffff !important;
  border: 1px solid #B91922 !important;
}

/* 3. Device cards (iPhone / Android / macOS / Windows) — бренд градиенты */
.device-card {
  background: linear-gradient(135deg, rgba(0, 97, 173, 0.12), rgba(185, 25, 34, 0.08)) !important;
  border: 1.5px solid rgba(0, 97, 173, 0.25) !important;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 24px -8px rgba(0, 97, 173, 0.25),
    0 16px 48px -12px rgba(185, 25, 34, 0.15);
}
.device-card:hover {
  background: linear-gradient(135deg, rgba(0, 97, 173, 0.18), rgba(185, 25, 34, 0.12)) !important;
  border-color: rgba(0, 97, 173, 0.45) !important;
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(0, 97, 173, 0.35),
    0 22px 60px -10px rgba(0, 97, 173, 0.4);
}
.device-card.detected {
  background: linear-gradient(135deg, rgba(0, 97, 173, 0.22), rgba(185, 25, 34, 0.14)) !important;
  border-color: rgba(0, 97, 173, 0.6) !important;
  box-shadow:
    0 0 0 2px rgba(0, 97, 173, 0.4),
    0 16px 40px -10px rgba(0, 97, 173, 0.45);
}
.device-card::after { display: none; }
.device-card::before {
  background: linear-gradient(135deg, rgba(0, 97, 173, 0.15), rgba(185, 25, 34, 0.10)) !important;
}

/* Text внутри device-card — гарантированно тёмный/белый в обеих темах */
.device-card .text-sm,
.device-card div.font-semibold,
.device-card .text-[11px] { color: inherit; }

/* Подпись hint под названием устройства в device-card — fix readability */
.device-card .text-ink-400,
:root.light .device-card .text-ink-400 {
  color: #475569 !important;
  font-weight: 500;
}

/* Detected badge — белый текст */
.detected-badge { color: #ffffff !important; }
.detected-badge i, .detected-badge svg { color: #ffffff !important; stroke: #ffffff !important; }

/* Device-card-icon — для разных платформ разные цвета (узнаваемо как Apple/Android/...) */
.device-card-icon { background: linear-gradient(135deg, #0061AD, #B91922); }
.device-card-icon.from-green { background: linear-gradient(135deg, #10b981, #06b6d4) !important; }
.device-card-icon.from-blue { background: linear-gradient(135deg, #3b82f6, #06b6d4) !important; }
.device-card-icon.from-orange { background: linear-gradient(135deg, #f59e0b, #ef4444) !important; }

/* 4. Кнопка «+ Пригласить» в admin user list (gradient brand→accent) — иконка белая */
button[class*="from-brand-500"] svg,
button[class*="from-brand-500"] i,
button[class*="to-accent-500"] svg,
button[class*="to-accent-500"] i {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/* Универсально: любая кнопка с белым :text-white внутри — иконка тоже белая */
button[class*="text-white"] svg,
button[class*="text-white"] i { color: #ffffff !important; stroke: #ffffff !important; }

/* Подробнее — ссылка в light/dark, явный underline brand-цвет */
.text-brand-300.underline { color: #003a69 !important; text-underline-offset: 4px; }
:root.light .text-brand-300.underline { color: #003a69 !important; }

/* 5. Welcome screen — фикс layout (имя обрезалось из-за flex с лого) */
section[x-show="screen === 'welcome'"] header { flex-wrap: wrap; gap: 12px; }
section[x-show="screen === 'welcome'"] header > div { min-width: 0; flex: 1; }
section[x-show="screen === 'welcome'"] h1 { word-break: break-word; }

/* Active button — таспl feedback */
button:active:not(:disabled) { transform: scale(0.96) !important; }

/* ─── LIGHT theme refinements ─── */
:root.light .device-card {
  background: linear-gradient(135deg, rgba(0, 97, 173, 0.08), rgba(185, 25, 34, 0.05)) !important;
  border: 1.5px solid rgba(0, 97, 173, 0.25) !important;
}
:root.light .device-card .text-ink-400 { color: #475569 !important; }

/* Hero — тёмная карточка на светлом фоне: мягкая бренд-тень для глубины */
:root.light .device-hero {
  box-shadow:
    0 0 0 1px rgba(0, 97, 173, 0.18),
    0 18px 44px -16px rgba(0, 97, 173, 0.4);
}
:root.light .device-hero-hint { color: rgba(226, 232, 240, 0.78); }

/* Подробнее ссылка в light */
:root.light .underline.text-brand-300 { color: #003a69 !important; }

/* h2 «Подробнее» / любые underline ссылки в Подробнее */
:root.light a.text-brand-300, :root.light button.text-brand-300 { color: #003a69 !important; }

/* lucide иконки в primary-gradient hover state */
.primary-gradient:hover svg, .primary-gradient:hover i { color: #ffffff !important; }

/* ============================================================
   M1.6 — финал floating chip + кнопка-emoji fix
   ============================================================ */

/* Floating chips top-right — ВСЕГДА белый текст и иконки */
.fixed.top-3.right-3 button,
.fixed.top-3.right-3 button span,
.fixed.top-3.right-3 button i,
.fixed.top-3.right-3 button svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/* Theme toggle — обводка и фон явные */
.fixed.top-3.right-3 button[title^="Тема"] {
  background: linear-gradient(135deg, #0061AD, #3380c1) !important;
  border: 1px solid #0061AD !important;
}
.fixed.top-3.right-3 button[title^="Тема"]:hover {
  filter: brightness(1.1);
}

/* В light theme — текст всё равно белый */
:root.light .fixed.top-3.right-3 button,
:root.light .fixed.top-3.right-3 button span,
:root.light .fixed.top-3.right-3 button i,
:root.light .fixed.top-3.right-3 button svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/* Search input в Доменных логах — явный placeholder */
input::placeholder, textarea::placeholder {
  color: #64748b !important;
  opacity: 0.7;
}
:root.light input::placeholder, :root.light textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}

/* Все кнопки с градиентом brand→accent — гарантированно белый */
button[class*="from-brand-500"][class*="to-accent-500"],
button[class*="from-brand-500"][class*="to-accent-500"] span,
button[class*="from-brand-500"][class*="to-accent-500"] i,
button[class*="from-brand-500"][class*="to-accent-500"] svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/* ============================================================
   FINAL — chip buttons по ID (specificity 100, бьёт все class rules)
   ============================================================ */
#chip-theme {
  height: 36px; width: 36px;
  border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: #0061AD !important; background-image: linear-gradient(135deg, #0061AD, #3380c1) !important;
  color: #fff;
  border: 1px solid #0061AD;
  box-shadow: 0 4px 14px -2px rgba(0, 97, 173, 0.5);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
#chip-theme:hover { filter: brightness(1.1); transform: translateY(-1px); }
#chip-theme:active { transform: scale(0.94); }
#chip-theme svg, #chip-theme i {
  width: 18px; height: 18px;
  color: #fff !important; stroke: #fff !important;
}

#chip-role {
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  background: #0061AD !important; background-image: linear-gradient(135deg, #0061AD, #3380c1) !important;
  color: #fff;
  border: 1px solid #0061AD;
  box-shadow: 0 4px 14px -2px rgba(0, 97, 173, 0.5);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
#chip-role.is-preview {
  background: #B91922 !important; background-image: linear-gradient(135deg, #B91922, #dc4f57) !important;
  border-color: #B91922;
  box-shadow: 0 4px 14px -2px rgba(185, 25, 34, 0.5);
}
#chip-role:hover { filter: brightness(1.1); transform: translateY(-1px); }
#chip-role:active { transform: scale(0.96); }
#chip-role svg, #chip-role i {
  width: 14px; height: 14px;
  color: #fff !important; stroke: #fff !important;
}
#chip-role span { color: #fff !important; }

/* Сила: в light тоже только бренд */
:root.light #chip-theme,
:root.light #chip-role {
  color: #fff !important;
}
:root.light #chip-theme svg, :root.light #chip-theme i,
:root.light #chip-role svg, :root.light #chip-role i,
:root.light #chip-role span {
  color: #fff !important; stroke: #fff !important;
}
