/* ══════════════════════════════════════════════════════════════════════
   IW Mobile Theme — light variants + theme toggle
   Canon 2026: glass → border separation on light, no naive inversion
   ══════════════════════════════════════════════════════════════════════ */

/* ── Light overrides for mobile glass tokens ────────────────────────── */
html[data-theme="light"] {
  /* На свету стекло почти непрозрачное + опора на border, не на blur */
  --mob-glass-l1: rgba(255, 255, 255, 0.94);
  --mob-glass-l2: rgba(248, 250, 253, 0.96);
  --mob-glass-l3: rgba(236, 242, 248, 0.88);
  --mob-glass-l4: rgba(255, 255, 255, 0.97);
}

@media (pointer: coarse) {
  html[data-theme="light"] .mob-bottom-nav,
  html[data-theme="light"] .mob-header {
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
  }

  html[data-theme="light"] .mob-bottom-nav__item { color: #7a92a4; }
  html[data-theme="light"] .mob-bottom-nav__item.active,
  html[data-theme="light"] .mob-bottom-nav__item[aria-current="page"] { color: #0089b8; }

  html[data-theme="light"] .sb {
    border-right-color: rgba(15, 23, 42, 0.1);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
  }

  /* Skeleton на свету — тёмный shimmer вместо светлого */
  html[data-theme="light"] .mob-skeleton {
    background: linear-gradient(90deg, rgba(15,23,42,0.04) 25%, rgba(15,23,42,0.09) 50%, rgba(15,23,42,0.04) 75%);
    background-size: 200% 100%;
  }
}

/* ── Theme toggle button ────────────────────────────────────────────── */
[data-theme-toggle] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--mob-glass-l2, rgba(18,26,39,0.85));
  border: 1px solid var(--sw-border, rgba(170,188,204,0.18));
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--sw-text-secondary, #a7b7c7);
  transition: background 180ms ease, transform 120ms ease, color 180ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
}

[data-theme-toggle]:active { transform: scale(0.92); }

/* Иконка зависит от состояния (system/light/dark) — через ::before */
[data-theme-toggle]::before {
  content: "🌓";
  transition: opacity 180ms ease, transform 320ms cubic-bezier(0.34,1.56,0.64,1);
}
[data-theme-toggle][data-theme-state="light"]::before { content: "☀️"; }
[data-theme-toggle][data-theme-state="dark"]::before  { content: "🌙"; }
[data-theme-toggle][data-theme-state="system"]::before { content: "🌓"; }

[data-theme-toggle]:focus-visible {
  outline: 2px solid var(--eterna-ai, #00c8ff);
  outline-offset: 2px;
}

/* ── Light-mode: убрать тяжёлый blur где он бессмыслен ──────────────── */
html[data-theme="light"] .mob-sheet {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.12);
}

/* ── Respect system when no explicit choice (progressive) ───────────── */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) { color-scheme: light; }
}
