/* ═══════════════════════════════════════════════
   ANDGER Design System v1.0
   ═══════════════════════════════════════════════ */
:root {
  /* Layer scale: screens < practice < modals < critical modals < toasts < loader */
  --z-screen: 100;
  --z-practice: 500;
  --z-modal: 1000;
  --z-critical-modal: 1100;
  --z-toast: 1200;
  --z-loader: 9999;

  --d-bg: #0d0a18;
  --d-bg-2: #100c1e;
  --d-surface: rgba(255, 255, 255, 0.03);
  --d-surface-2: rgba(255, 255, 255, 0.06);
  --d-surface-3: rgba(255, 255, 255, 0.09);
  --d-border: rgba(255, 255, 255, 0.10);
  --d-border-strong: rgba(255, 255, 255, 0.18);
  --d-text: #f5f4fa;
  --d-text-dim: #8a8aa5;
  --d-text-mute: #5f5f78;
  --d-accent: #7c5cff;
  --d-accent-2: #a78bfa;
  --d-accent-3: #c4b5fd;
  --d-warm: #ff7a2a;
  --d-gold: #ffb800;
  --d-success: #3ecf8e;
  --d-danger: #ff5c5c;
  --d-info: #1e5cff;
  --d-gradient: linear-gradient(135deg, #7c5cff 0%, #6366f1 100%);
  --d-gradient-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(99, 102, 241, 0.12));
  --d-gradient-success: linear-gradient(135deg, #3ecf8e 0%, #2ea870 100%);
  --d-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --d-shadow-md: 0 6px 20px rgba(0, 0, 0, 0.25);
  --d-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
  --d-glow-accent: 0 6px 24px rgba(124, 92, 255, 0.28), 0 2px 8px rgba(124, 92, 255, 0.2);
  --d-radius-sm: 12px;
  --d-radius-md: 16px;
  --d-radius-lg: 20px;
  --d-radius-xl: 24px;
  --d-safe-top: env(safe-area-inset-top, 0px);
  --d-safe-bottom: env(safe-area-inset-bottom, 0px);
  --d-bg-header: rgba(30, 20, 55, 0.85);
  --d-bg-nav: rgba(30, 20, 55, 0.95);

  /* Legacy-compatible app tokens */
  --color-accent: #4f46e5;
  --color-background-app: #120c24;
  --color-background-deep: #05030a;
  --color-background-glow: #15112a;
  --color-card-base: #1a1428;
  --color-lilac: #c4b5fd;
  --color-text-soft: #e2dff0;
  --color-warm: #ff7a2a;
  --color-white: #fff;
  --bg: #0d0a18;
  --bg2: #100c1e;
  --card: var(--color-card-base);
  --card2: #231a3a;
  --card3: #2c2245;
  --accent: var(--color-accent);
  --accent-2: #818cf8;
  --accent-glow: rgba(124,92,255,.35);
  --warm: #ff9d00;
  --warm-glow: rgba(255,154,86,.4);
  --gold: #ffb800;
  --gold-deep: #e67e22;
  --gold-glow: rgba(255,184,0,.4);
  --success: #3ecf8e;
  --success-glow: rgba(62,207,142,.4);
  --danger: var(--color-warm);
  --text: #eceaf5;
  --muted: #8a8aa5;
  --border: #2e2545;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.18);
  --shadow-md: 0 6px 20px rgba(0,0,0,.22);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.32);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at 50% 40%, #15112a 0%, #05030a 100%) fixed;
  background-color: var(--d-bg);
  color: var(--d-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(124, 92, 255, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(255, 122, 42, 0.10) 0%, transparent 45%),
    radial-gradient(circle at 50% 55%, rgba(30, 92, 255, 0.08) 0%, transparent 55%);
}

.d-glass {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.d-card-glass {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius-xl);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 16px;
  box-shadow: var(--d-shadow-sm);
}

.d-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 16px;
  background: var(--d-gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  box-shadow: var(--d-glow-accent);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s;
}
.d-btn-primary:active { transform: scale(0.97); box-shadow: 0 3px 12px rgba(255, 122, 42, 0.25); }
.d-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.d-btn-primary.done { background: var(--d-gradient-success); box-shadow: 0 6px 24px rgba(62, 207, 142, 0.35); }

.d-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 16px;
  background: transparent;
  border: 1px solid var(--d-border-strong);
  color: var(--d-text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.d-btn-secondary:active { background: var(--d-surface-2); border-color: var(--d-accent-2); }

.d-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--d-text);
  position: relative;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}
.d-icon-btn:active { transform: scale(0.92); background: var(--d-surface-2); }
.d-icon-btn svg { width: 18px; height: 18px; }

.d-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-screen);
  max-width: 520px;
  margin: 0 auto;
  padding: calc(12px + var(--d-safe-top)) 16px 12px;
  background: var(--d-bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(124, 92, 255, 0.25); /* Фиолетовая рамка */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.d-header-greet { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.d-header-greet-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; color: var(--d-text-dim); }
.d-header-greet-name { font-size: 20px; font-weight: 800; color: var(--d-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.d-header-actions { display: flex; gap: 8px; align-items: center; }

.d-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 4px calc(8px + var(--d-safe-bottom));
  background: var(--d-bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(124, 92, 255, 0.25); /* Фиолетовая рамка */
  display: flex;
  justify-content: space-around;
  gap: 2px;
}
.d-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  background: transparent;
  border: none;
  color: var(--d-text-dim);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
  border-radius: var(--d-radius-sm);
  white-space: nowrap;
}
.d-nav-btn svg { width: 20px; height: 20px; }
.d-nav-btn:active { transform: scale(0.92); }
.d-nav-btn.on { color: var(--d-accent-3); }
.d-nav-btn.on svg { filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.5)); }

.d-avatar {
  width: 46px; /* Было 40px */
  height: 46px;
  border-radius: 14px; /* Чуть увеличили скругление */
  background: var(--d-gradient-soft);
  border: 1px solid var(--d-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.d-avatar:active { transform: scale(0.92); }
.d-avatar svg { width: 100%; height: 100%; }

.d-calendar-strip {
  display: flex;
  gap: 6px;
  padding: 10px 8px;
  
  /* Вместо прозрачности и размытия — плотный фон, который сливается с дизайном */
  background: rgba(40, 30, 70, 0.85); 
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius-xl);
  
  overflow-x: auto;
  scrollbar-width: none;
}
.d-cal-day {
  flex: 1;
  min-width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--d-radius-md);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s;
}
.d-cal-dow { font-size: 9px; font-weight: 800; color: var(--d-text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.d-cal-dom { font-size: 14px; font-weight: 800; color: var(--d-text); }
.d-cal-day.today { border-color: var(--d-accent); background: rgba(124, 92, 255, 0.10); }
.d-cal-day.today .d-cal-dom { color: var(--d-accent-3); }
.d-cal-day.done .d-cal-dom { color: var(--d-warm); }
.d-cal-day:active { transform: scale(0.92); }

.d-focus-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--d-gradient-soft), var(--d-surface);
  border: 1px solid var(--d-border-strong);
  border-radius: var(--d-radius-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  box-shadow: var(--d-shadow-sm);
}
.d-focus-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 154, 86, 0.14), transparent 70%);
  pointer-events: none;
}
.d-focus-top { display: flex; gap: 12px; align-items: flex-start; position: relative; }
.d-focus-cover {
  width: 68px;
  height: 68px;
  border-radius: var(--d-radius-md);
  background: var(--d-gradient-soft);
  border: 1px solid var(--d-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.d-focus-meta { flex: 1; min-width: 0; padding-right: 56px; }
.d-focus-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--d-accent-2); margin-bottom: 4px; }
.d-focus-title { font-size: 15px; font-weight: 800; color: var(--d-text); line-height: 1.25; margin-bottom: 4px; }
.d-focus-action { font-size: 12px; color: var(--d-text-dim); font-weight: 600; line-height: 1.35; }
.d-focus-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(124, 92, 255, 0.08);
  border: 1px solid rgba(124, 92, 255, 0.20);
  border-radius: var(--d-radius-md);
  font-size: 12px;
  font-style: italic;
  color: var(--d-accent-3);
  line-height: 1.4;
}
.d-focus-identity svg { flex-shrink: 0; color: var(--d-accent-2); }

.d-ring { position: absolute; top: 16px; right: 16px; width: 56px; height: 56px; }
.d-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.d-ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 8; }
.d-ring-fill { fill: none; stroke: url(#dRingGrad); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 264; stroke-dashoffset: 264; transition: stroke-dashoffset 1s ease; }
.d-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.d-ring-num { font-size: 14px; font-weight: 900; color: var(--d-text); line-height: 1; }
.d-ring-lbl { font-size: 7px; color: var(--d-text-dim); text-transform: uppercase; font-weight: 800; margin-top: 1px; }

.d-lumi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.d-lumi-orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff9d00 0%, #7c5cff 55%, #1e5cff 100%);
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.5), 0 0 8px rgba(255, 154, 86, 0.4);
  flex-shrink: 0;
  position: relative;
  animation: d-lumi-pulse 3.2s ease-in-out infinite;
}
.d-lumi-orb::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.5), transparent 60%); }
@keyframes d-lumi-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(124, 92, 255, 0.5), 0 0 8px rgba(255, 154, 86, 0.4); }
  50% { transform: scale(1.06); box-shadow: 0 0 30px rgba(124, 92, 255, 0.75), 0 0 14px rgba(255, 154, 86, 0.55); }
}
.d-lumi-text { flex: 1; font-size: 12px; line-height: 1.45; color: var(--d-text); font-style: italic; }
.d-lumi-text::before { content: 'Луми'; display: block; font-style: normal; font-weight: 800; color: var(--d-accent-2); font-size: 9px; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 3px; }

.d-lib-search { position: relative; width: 100%; }
.d-lib-search input {
  width: 100%; height: 48px; padding: 0 16px 0 44px; background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-radius-md); color: var(--d-text); font-size: 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: border-color 0.2s;
}
.d-lib-search input:focus { outline: none; border-color: var(--d-accent); }
.d-lib-search input::placeholder { color: var(--d-text-mute); }
.d-lib-search > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--d-text-dim); pointer-events: none; }

.d-lib-chips { 
  display: grid; 
  grid-template-columns: repeat(4, 1fr); 
  gap: 4px; 
  width: 100%;
  background: var(--d-surface); 
  border: 1px solid var(--d-border); 
  border-radius: 16px; 
  padding: 4px;
}
.d-lib-chip { 
  padding: 8px 4px; 
  border-radius: 12px; 
  background: transparent; 
  border: 1px solid transparent; 
  color: var(--d-text-dim); 
  font-size: 11px; 
  font-weight: 800; 
  cursor: pointer; 
  text-align: center;
  transition: all 0.25s ease; 
}
.d-lib-chip.on { 
  background: linear-gradient(135deg, #7c5cff 0%, #6366f1 100%); 
  border-color: transparent; 
  color: #fff; 
  box-shadow: none; 
}

.d-lib-book-card { display: flex; gap: 12px; padding: 12px; background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-radius-lg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: pointer; position: relative; transition: border-color 0.2s, transform 0.15s; overflow: hidden; }
.d-lib-book-card:active { transform: scale(0.98); border-color: var(--d-accent-2); }
.d-lib-book-card.locked > *:not(.d-lib-book-lock) { filter: blur(1.5px) saturate(0.5); pointer-events: none; }
.d-lib-book-lock {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(13, 10, 24, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--d-gold);
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.2s;
}
.d-lib-book-card:active .d-lib-book-lock {
  background: rgba(124, 92, 255, 0.4);
}
.d-lib-book-cover { width: 52px; height: 78px; border-radius: var(--d-radius-sm); background: var(--d-gradient-soft); border: 1px solid var(--d-border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.d-lib-book-body { flex: 1; min-width: 0; }
.d-lib-book-title { font-size: 14px; font-weight: 800; color: var(--d-text); margin-bottom: 2px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.d-lib-book-author { font-size: 11px; color: var(--d-text-dim); margin-bottom: 8px; }
.d-lib-book-bar { height: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.d-lib-book-fill { height: 100%; background: var(--d-gradient); border-radius: 4px; transition: width 0.6s ease; }
.d-lib-book-pct { font-size: 10px; font-weight: 800; color: var(--d-accent-2); }

.d-lib-folder { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: linear-gradient(135deg, var(--d-surface) 0%, rgba(124, 92, 255, 0.05) 100%); border: 1px solid var(--d-border); border-radius: var(--d-radius-md); cursor: pointer; transition: 0.2s; margin-bottom: 8px; }
.d-lib-folder:active { transform: scale(0.98); border-color: var(--d-accent); }
.d-lib-folder-left { display: flex; align-items: center; gap: 12px; }
.d-lib-folder-icon { width: 40px; height: 40px; border-radius: 12px; background: rgba(124, 92, 255, 0.12); display: flex; align-items: center; justify-content: center; color: var(--d-accent-2); flex-shrink: 0; }
.d-lib-folder-title { font-size: 15px; font-weight: 800; color: var(--d-text); }
.d-lib-folder-count { font-size: 11px; color: var(--d-text-dim); font-weight: 600; margin-top: 1px; }

.d-timer-ring-wrap { position: relative; width: 240px; height: 240px; margin: 0 auto 24px; display: flex; align-items: center; justify-content: center; }
.d-timer-ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 20px rgba(124, 92, 255, 0.4)); }
.d-timer-ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.05); stroke-width: 8; }
.d-timer-ring-fill { fill: none; stroke: url(#dTimerGrad); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.d-timer-text { position: absolute; font-size: 40px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 0 20px rgba(255, 255, 255, 0.2); letter-spacing: -1px; }

.d-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 24px; background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-radius-xl); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); margin: 20px 0; }
.d-empty-ico-wrap { width: 72px; height: 72px; border-radius: 50%; background: rgba(124, 92, 255, 0.10); border: 1px solid rgba(124, 92, 255, 0.20); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.d-empty-ico-wrap svg { width: 32px; height: 32px; color: var(--d-accent-2); }
.d-empty-title { font-size: 18px; font-weight: 900; color: var(--d-text); margin-bottom: 8px; }
.d-empty-text { font-size: 13px; color: var(--d-text-dim); max-width: 260px; line-height: 1.5; }

.d-admin-tabs { display: flex; gap: 6px; padding: 4px; background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-radius-md); overflow-x: auto; scrollbar-width: none; }
.d-admin-tabs::-webkit-scrollbar { display: none; }
.d-admin-tab { flex-shrink: 0; padding: 8px 16px; border-radius: var(--d-radius-sm); font-size: 12px; font-weight: 800; color: var(--d-text-dim); cursor: pointer; transition: 0.2s; white-space: nowrap; }
.d-admin-tab.on {
  background: linear-gradient(135deg, #7c5cff 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.4);
}

.d-admin-user-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-radius-md); cursor: pointer; transition: border-color 0.2s; margin-bottom: 8px; }
.d-admin-user-card:active { border-color: var(--d-accent-2); }
.d-admin-user-ava { width: 40px; height: 40px; border-radius: 50%; background: var(--d-gradient-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.d-admin-user-ava svg { width: 100%; height: 100%; }
.d-admin-user-info { flex: 1; min-width: 0; }
.d-admin-user-name { font-size: 13px; font-weight: 800; color: var(--d-text); }
.d-admin-user-sub { font-size: 11px; color: var(--d-text-dim); margin-top: 2px; }

.d-toggle { position: relative; width: 44px; height: 26px; border-radius: 16px; background: var(--d-surface-2); border: 1px solid var(--d-border); cursor: pointer; transition: background 0.25s; flex-shrink: 0; }
.d-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.25s; }
.d-toggle.on { background: var(--d-gradient); border-color: transparent; }
.d-toggle.on::after { transform: translateX(18px); }

.d-premium-hero { padding: 32px 20px; text-align: center; background: var(--d-gradient-soft); border: 1px solid var(--d-border-strong); border-radius: var(--d-radius-xl); margin-bottom: 20px; }
.d-premium-title { font-size: 22px; font-weight: 900; color: var(--d-text); margin-bottom: 8px; line-height: 1.2; }
.d-premium-sub { font-size: 13px; color: var(--d-text-dim); margin-bottom: 20px; line-height: 1.5; }
.d-premium-price { font-size: 32px; font-weight: 900; background: var(--d-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 4px; line-height: 1.1; }
.d-premium-price-sub { font-size: 11px; color: var(--d-text-dim); margin-bottom: 24px; }
.d-premium-features { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-radius-lg); margin-bottom: 20px; }
.d-premium-feature { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--d-text); line-height: 1.4; }

.d-splash-orb { width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ff9d00 0%, #7c5cff 50%, #1e5cff 100%); box-shadow: 0 0 80px rgba(124, 92, 255, 0.6), 0 0 40px rgba(255, 154, 86, 0.4); position: relative; animation: d-splash-orb-pulse 2.5s ease-in-out infinite; }
.d-splash-orb::after { content: ''; position: absolute; inset: 15%; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), transparent 60%); }
@keyframes d-splash-orb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.d-hidden { display: none; }
.d-center { display: flex; align-items: center; justify-content: center; }
.d-flex-col { display: flex; flex-direction: column; }
.d-text-dim { color: var(--d-text-dim); }
.d-text-sm { font-size: 12px; }
.d-text-xs { font-size: 10px; }
.d-fw-800 { font-weight: 800; }
.d-fw-900 { font-weight: 900; }
.d-uppercase { text-transform: uppercase; letter-spacing: 0.6px; }
/* Фикс выпадающего списка */
select option {
  background-color: #1a1428;
  color: #f5f4fa;
  font-size: 14px;
  padding: 10px;
}
/* Фикс для календаря (убираем серые квадраты) */
.d-cal-day {
  background-color: transparent;
  box-shadow: none;
}
.d-cal-day.today {
  background-color: rgba(124, 92, 255, 0.1);
  border-color: var(--d-accent);
}
.d-cal-day.done {
  background: var(--d-gradient-soft);
  border-color: rgba(255, 154, 86, 0.35);
}
/* ═══════════════════════════════════════════════
   ФИКСЫ И ПОЛИРОВКА (от дизайнера)
   ═══════════════════════════════════════════════ */

/* 1. Скроллбары (тонкие и темные) */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }

/* 2. Единые скругления (100px для кнопок, 16px для карточек) */
.d-btn-primary, .d-btn-secondary, .d-icon-btn { border-radius: 16px; }
.d-card-glass, .modal-box, .d-lib-book-card { border-radius: 16px; }

/* ═══════════════════════════════════════════════
   ПОЛНОЦЕННАЯ СВЕТЛАЯ ТЕМА
   ═══════════════════════════════════════════════ */
html.light {
  --d-bg: #f5f4fa;
  --d-bg-2: #ffffff;
  --d-bg-header: rgba(255, 255, 255, 0.85);
  --d-bg-nav: rgba(255, 255, 255, 0.92);
  --d-surface: rgba(255, 255, 255, 0.7);
  --d-surface-2: rgba(0, 0, 0, 0.04);
  --d-surface-3: rgba(0, 0, 0, 0.08);
  --d-border: rgba(0, 0, 0, 0.1);
  --d-border-strong: rgba(0, 0, 0, 0.15);
  --d-text: #1a1428;
  --d-text-dim: #6b6880;
  --d-text-mute: #9e9bb0;
  
  background-color: #f5f4fa;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(124, 92, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(255, 122, 42, 0.05) 0%, transparent 50%);
}

html.light body {
  background: transparent;
  color: var(--d-text);
}

html.light .d-header, 
html.light .d-bottom-nav, 
html.light .d-card-glass, 
html.light .d-calendar-strip {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

html.light .d-text-dim, 
html.light .d-focus-action, 
html.light .d-lib-book-author {
  color: var(--d-text-dim);
}

html.light .d-btn-primary, 
html.light .d-btn-primary span,
html.light .d-lib-book-cover span,
html.light .d-nav-btn.on span {
  color: #ffffff;
}

html.light .d-focus-title, 
html.light .d-lib-book-title, 
html.light .d-lib-folder-title {
  color: #1a1428;
}

/* 4. Луми (Светящийся шар с парением) */
.d-lumi-orb {
  background: radial-gradient(circle at 30% 30%, #ffdf7a 0%, #ff9d00 30%, #7c5cff 70%, #1e5cff 100%);
  box-shadow: inset -5px -5px 15px rgba(0,0,0,0.6), 0 0 25px rgba(124, 92, 255, 0.8), 0 0 50px rgba(255, 154, 86, 0.4);
  animation: floatLumi 4s ease-in-out infinite;
}
@keyframes floatLumi {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

/* 5. Настройка голоса (Скрываем галочки у невыбранных) */
.voice-option .voice-check { display: none; }
.voice-option.active .voice-check { display: block; }
.voice-option.active span:first-child { color: var(--d-accent-2); font-weight: 800; }

/* 6. Быстрая заметка (Спиннер в кнопке) */
.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%; border-top-color: #fff; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 7. Админка - Список текстов */
.admin-text-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--d-surface-2); padding: 12px 16px; border-radius: 12px; margin-bottom: 8px;
  border: 1px solid var(--d-border);
}
.focus-mode .ps-block:not(.timer-wrapper),
.focus-mode .ritual-hero, 
.focus-mode .ps-hero, 
.focus-mode .ps-block:not(.timer-wrapper), 
.focus-mode .ritual-body > .btn, 
.focus-mode .ps-content > .btn,
.focus-mode .practice-focus-hide,
.focus-mode .difficulty-selector { /* <--- Добавили скрытие кнопок сложности */
  display: none !important;
}

/* Контейнер с таймером растягивается на весь экран */
.focus-mode .timer-wrapper {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 50% 40%, #15112a 0%, #05030a 100%);
    z-index: var(--z-practice);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: calc(95px + env(safe-area-inset-top, 0px)) 20px 20px; /* Опускаем вниз под шапку */
    margin: 0;
    border: none;
}

/* Скрываем заголовок "Время практики" в фокусе */
.focus-mode .timer-wrapper > h3 {
    display: none;
}

/* Центрируем кольцо и кнопки */
.focus-mode .timer-box {
    margin: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.focus-mode .d-timer-ring-wrap {
    width: 240px;
    height: 240px;
    margin: 15px auto 20px auto; /* <--- Добавили 15px сверху */
    flex-shrink: 0; /* Кольцо никогда не сжимается */
}
.focus-mode .d-timer-text {
    font-size: 46px; /* Оставляем этот же размер шрифта */
}
/* Оранжевая кнопка, когда таймер на паузе */
.d-btn-primary.paused {
  background: linear-gradient(135deg, #ff9d00 0%, #e67e22 100%);
  box-shadow: 0 6px 24px rgba(255, 154, 86, 0.35);
}
/* Жестко фиксируем кнопку плюса в правом нижнем углу */
.fab-btn {
  position: fixed;
  bottom: calc(75px + var(--safe-bottom));
  right: 16px;
  left: auto;
  z-index: var(--z-screen);
}
/* ═══════════════════════════════════════════════
   ЭКРАН ЗАГРУЗКИ (SPLASH)
   ═══════════════════════════════════════════════ */

#appLoader.hide { opacity: 0; pointer-events: none; }

.splash-main { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 100%; }
.splash-ring-wrap { position: relative; width: 300px; height: 300px; max-width: 80vw; max-height: 80vw; display: flex; align-items: center; justify-content: center; transform: translateY(-20px); margin-bottom: 20px; }
.splash-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 15px rgba(255, 42, 122, 0.5)) drop-shadow(0 0 25px rgba(124, 92, 255, 0.4)); }
.splash-ring-arc { stroke-dasharray: 816; stroke-dashoffset: 816; animation: drawRing 6s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

.splash-text-center { text-align: center; z-index: 2; animation: fadeInText 1s ease 0.5s forwards; opacity: 1; max-width: 90%; }
.splash-logo { font-size: 36px; font-weight: 900; letter-spacing: 6px; color: #fff; text-shadow: 0 0 20px rgba(255,255,255,0.4); margin-bottom: 4px; margin-left: 6px; }
.splash-sub { font-size: 10px; color: #e2dff0; font-weight: 800; letter-spacing: 2px; }

.splash-progress-wrap { width: 100%; max-width: 240px; margin-top: 40px; text-align: center; animation: fadeInText 1s ease 1s forwards; opacity: 0; }
.splash-progress-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; margin-bottom: 12px; position: relative; box-shadow: inset 0 1px 2px rgba(0,0,0,0.5); }
.splash-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #1e5cff 0%, #7c5cff 50%, #ff7a2a 100%);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.8);
  animation: splashProgressFill 8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.splash-loading-text { font-size: 12px; color: #e2dff0; font-weight: 600; letter-spacing: 1px; }

.splash-quote-wrap { position: relative; z-index: 1; text-align: center; max-width: 320px; animation: fadeInText 1s ease 1.2s forwards; opacity: 0; margin-bottom: 0; padding: 0 10px; }
.splash-quote-text { font-family: Georgia, 'Times New Roman', serif; font-size: 13px; line-height: 1.5; color: #ffffff; position: relative; z-index: 2; padding: 0 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.splash-quote-author { font-size: 11px; color: #818cf8; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; margin-top: 16px; }

.quote-mark { position: absolute; font-family: Georgia, serif; font-size: 65px; color: var(--d-accent); opacity: 0.15; z-index: 1; line-height: 0; }
.quote-mark.left { content: '“'; top: 0px; left: -10px; }
.quote-mark.right { content: '”'; bottom: -10px; right: -10px; }

/* Красивые табы в Сообществе */
.tab-pill {
  flex: 1;
  padding: 8px 6px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  color: var(--d-text-dim);
  border: 1px solid transparent;
  transition: 0.2s;
}
.tab-pill.on {
  background: linear-gradient(135deg, #7c5cff 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.4);
}
/* Градиент для вкладок Вход/Регистрация */
.auth-tab.on {
  background: linear-gradient(135deg, var(--d-accent) 0%, var(--d-accent-2) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.3);
}

/* ═══════════════════════════════════════════════
   ГЛУБОКИЙ КОСМИЧЕСКИЙ ФОН И СТЕКЛО
   ═══════════════════════════════════════════════ */

/* 1. Основной фон (глубокий фиолетовый) */
body {
  background-color: #120c24;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(124, 92, 255, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(255, 122, 42, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(30, 92, 255, 0.1) 0%, transparent 60%);
  background-attachment: scroll;
  min-height: 100dvh;
}

/* 2. Карточки (стекло с фиолетовым оттенком) */
.d-card-glass {
  background: linear-gradient(135deg, rgba(40, 30, 70, 0.6) 0%, rgba(25, 18, 45, 0.4) 100%);
  border: 1px solid rgba(124, 92, 255, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 3. Шапка (эффект парящего стекла) */
.d-header, .main-head {
  background: rgba(18, 12, 36, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(124, 92, 255, 0.2);
}

/* 4. Календарь (делаем его чуть заметнее) */
.d-calendar-strip {
  background: rgba(40, 30, 70, 0.4);
  border: 1px solid rgba(124, 92, 255, 0.2);
}

/* 5. Нижнее меню */
.bottom-nav, .d-bottom-nav {
  background: rgba(18, 12, 36, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(124, 92, 255, 0.2);
}

/* 6. Карточка "Фокус дня" (чтобы она сияла еще ярче) */
.d-focus-card {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15) 0%, rgba(25, 18, 45, 0.8) 100%);
  border: 1px solid rgba(124, 92, 255, 0.4);
}
/* ═══════════════════════════════════════════════
   ЕДИНЫЙ СТИЛЬ ВСЕХ ГЛАВНЫХ КНОПОК
   ═══════════════════════════════════════════════ */

/* Применяем градиент ко всем основным кнопкам */
.d-btn-primary,
.btn,
#mpcStartBtn,
#bdStartBtn,
#onbNext,
#authBtn {
  background: linear-gradient(135deg, #4f46e5 0%, #ff9d00 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 6px 20px rgba(255, 122, 42, 0.3), 0 2px 8px rgba(124, 92, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Эффект нажатия */
.d-btn-primary:active,
.btn:active,
#mpcStartBtn:active,
#bdStartBtn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(255, 122, 42, 0.2);
}
/* ═══════════════════════════════════════════════
   ТОТАЛЬНЫЙ ФИОЛЕТОВЫЙ СТИЛЬ ДЛЯ ВСЕХ КНОПОК
   ═══════════════════════════════════════════════ */

/* 1. Все главные кнопки (градиент от фиолетового к светло-фиолетовому) */
.d-btn-primary,
.btn,
#mpcStartBtn,
#bdStartBtn,
#onbNext,
#authBtn,
.rbs-btn {
  background: linear-gradient(135deg, #7c5cff 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 2. Все второстепенные кнопки (Поделиться, Настройки, Сообщения, Рейтинг) */
.d-btn-secondary,
.tab-pill,
.d-lib-chip,
.admin-filter-pill {
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  color: var(--d-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: .2s;
}
.admin-filter-pill.on {
  background: linear-gradient(135deg, var(--d-accent), var(--d-accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124,92,255,0.3);
}
/* 3. Перекрашиваем баннер Premium в Библиотеке (который в HTML) */
div[onclick="showPremium()"] {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.2) 0%, rgba(179, 107, 255, 0.1) 100%);
  border: 1px solid rgba(124, 92, 255, 0.4);
}
div[onclick="showPremium()"] div {
  color: #c4b5fd;
}

/* Эффект нажатия для всех кнопок */
.d-btn-primary:active, .btn:active, .d-btn-secondary:active {
  transform: scale(0.97);
}
/* Красивая градиентная кнопка отправки сообщений (самолетик) */
#feedInputWrap .feed-post-btn,
#dialogInputWrap .feed-post-btn {
  background: linear-gradient(135deg, #7c5cff 0%, #ff7a2a 100%);
  box-shadow: 0 4px 12px rgba(255, 122, 42, 0.3);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#appLoader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0; /* Заставляет блок прилипнуть к физическому низу экрана */
  width: 100vw;
  height: 100%; /* Убрали 100vh и 100dvh, чтобы не было скачков */
  background-color: #120c24;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(124, 92, 255, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(255, 122, 42, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(30, 92, 255, 0.1) 0%, transparent 60%);
  background-attachment: scroll;
  background-size: cover;
  z-index: var(--z-loader);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Учитываем безопасную зону (полоску жестов) iPhone */
  padding-bottom: env(safe-area-inset-bottom, 0px) !important; 
  box-sizing: border-box;
}
/* Компактный календарь на Главной */
.d-calendar-strip {
  padding: 8px 6px;
  gap: 4px;
  border-radius: 16px;
}
.d-cal-day {
  padding: 8px 2px;
}
.d-cal-dow { font-size: 8px; }
.d-cal-dom { font-size: 12px; }
/* ═══════ Экранные фоны и состояния ═══════ */
#landingScreen {
  background-color: #120c24;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(124, 92, 255, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(255, 122, 42, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(30, 92, 255, 0.1) 0%, transparent 60%);
  background-attachment: scroll;
  z-index: var(--z-screen);
}
/* ═══════ Экранные фоны и состояния ═══════ */
#authScreen {
  background-color: #120c24;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(124, 92, 255, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(255, 122, 42, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(30, 92, 255, 0.1) 0%, transparent 60%);
  background-attachment: fixed;
}
/* ═══════════════════════════════════════════════
   Экранные фоны и состояния
   ═══════════════════════════════════════════════ */

/* 1. Экраны практик должны быть ОПАКОВЫМИ (непрозрачными) и иметь космический фон */
#practiceScreen, #ritualScreen {
  background-color: #120c24;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(124, 92, 255, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(255, 122, 42, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(30, 92, 255, 0.1) 0%, transparent 60%);
  background-attachment: fixed;
  z-index: var(--z-practice);
}

/* 2. Окно таймера делаем прозрачным, чтобы видеть космический фон */
#practiceScreen.focus-mode .timer-wrapper,
#ritualScreen.focus-mode .timer-wrapper {
  background: transparent;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* <--- Изменили center на flex-start */
  z-index: var(--z-practice);
  padding-top: calc(120px + env(safe-area-inset-top, 0px)); /* <--- Увеличили отступ */
  margin: 0;
}

/* 3. Прячем весь текст на фоне, когда запущен таймер */
#practiceScreen.focus-mode .ps-content > *:not(.timer-wrapper),
#ritualScreen.focus-mode .ritual-body > *:not(.timer-wrapper) {
  display: none;
}

/* 4. Делаем модальные окна (подтверждение, завершение) красивыми, а не черными */
.modal, .complete-overlay, #confirmModal {
  z-index: var(--z-modal);
  background: rgba(18, 12, 36, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* 5. Отступы для текста и кнопки таймера */
#practiceScreen.focus-mode .voice-subtitle,
#ritualScreen.focus-mode .voice-subtitle {
  margin-top: 60px;
  margin-bottom: 24px;
}
#practiceScreen.focus-mode .zen-buttons-wrap,
#ritualScreen.focus-mode .zen-buttons-wrap {
  margin-top: auto;
  padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 280px;
}

/* Делаем обе кнопки одинаковыми по высоте */
.focus-mode .zen-buttons-wrap button {
  height: 46px;
  min-height: 46px;
  font-size: 13px;
  border-radius: 14px;
  padding: 0 20px;
}
/* ═══════════════════════════════════════════════
   ФИКС КНОПОК БЫСТРОГО ДОСТУПА (Горизонтальные)
   ═══════════════════════════════════════════════ */

.quick-action-btn {
  flex: 1;
  display: flex;
  flex-direction: row; /* Иконка и текст в ряд */
  align-items: center; /* Центрируем по вертикали */
  justify-content: center; /* Центрируем по горизонтали */
  gap: 6px; /* Расстояние между иконкой и текстом */
  
  /* Тот самый градиент */
  background: linear-gradient(135deg, #7c5cff 0%, #6366f1 100%);
  border: none;
  border-radius: 16px; /* Овальная форма */
  padding: 0 8px;
  height: 46px; /* Фиксируем высоту, чтобы все кнопки были одинаковыми */
  color: #ffffff;
  
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
  transition: transform 0.2s;
  cursor: pointer;
}

.quick-action-btn svg {
  flex-shrink: 0; /* Чтобы иконка не сжималась */
  margin-top: 1px; /* Легкая оптическая коррекция */
}

.quick-action-btn span {
  font-size: 10px; 
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap; /* Запрещаем перенос текста на новую строку */
}

.quick-action-btn:active {
  transform: scale(0.95);
}
/* ═══════════════════════════════════════════════
   МАГ-ХРАНИТЕЛЬ ANDGER (v6.0 Magical)
   ═══════════════════════════════════════════════ */

.andger-mascot-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  width: 100%;
}

.andger-mascot-avatar {
  width: 86px;
  height: 86px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  animation: floatMage 4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
  margin-top: -10px;
}

.andger-mascot-avatar:active {
  transform: scale(0.9);
}

.mascot-glow {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(124,92,255,0.3) 0%, transparent 60%);
  border-radius: 50%;
  z-index: -1;
  animation: pulseGlow 3s ease-in-out infinite alternate;
}

/* Анимации */
@keyframes floatMage {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.3; }
  100% { transform: scale(1.1); opacity: 0.7; }
}

.mascot-cloak {
  transform-origin: 60px 70px;
  animation: cloakSway 3.5s ease-in-out infinite alternate;
}
@keyframes cloakSway {
  0% { transform: scaleX(1) skewX(0deg); }
  100% { transform: scaleX(1.03) skewX(2deg); }
}

.mascot-orb {
  animation: orbFloat 2.5s ease-in-out infinite alternate;
}
@keyframes orbFloat {
  0% { transform: translate(0, 0); opacity: 0.8; }
  100% { transform: translate(-5px, -15px); opacity: 1; }
}

/* Стили для облачка */
.andger-bubble {
  position: relative;
  background: rgba(40, 30, 70, 0.65);
  border: 1px solid rgba(124, 92, 255, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  border-top-left-radius: 4px;
  padding: 12px 16px;
  flex: 1;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(124, 92, 255, 0.1);
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bubblePop {
  0% { transform: scale(0.8) translateX(-10px); opacity: 0; }
  100% { transform: scale(1) translateX(0); opacity: 1; }
}
.andger-bubble.animate-in {
  animation: bubblePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.andger-bubble::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 24px;
  width: 12px;
  height: 12px;
  background: rgba(40, 30, 70, 0.65);
  border-left: 1px solid rgba(124, 92, 255, 0.35);
  border-bottom: 1px solid rgba(124, 92, 255, 0.35);
  transform: rotate(45deg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.andger-bubble-name {
  font-size: 10px;
  font-weight: 900;
  color: var(--d-accent-3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
}

.andger-bubble-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--d-text);
  font-weight: 500;
}

/* Искры */
.spark-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--d-warm);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 8px var(--d-warm);
}
/* ═══════════════════════════════════════════════
   УВЕЛИЧЕННОЕ КОЛЬЦО С ФИОЛЕТОВЫМ ГРАДИЕНТОМ
   ═══════════════════════════════════════════════ */

.d-ring {
  position: absolute;
  top: 14px;   /* Чуть подняли, чтобы было ровно */
  right: 14px;
  width: 74px; /* Сделали больше (было ~56px) */
  height: 74px;
}

/* Увеличиваем цифры внутри кольца, чтобы они не терялись */
.d-ring-num {
  font-size: 18px; 
  font-weight: 900;
}
/* ═══════════════════════════════════════════════
   ФИКС ПОЛЕЙ ВВОДА (Убираем черный фон)
   ═══════════════════════════════════════════════ */
#feedInput, #dialogInput {
  background-color: transparent;
  color: #f5f4fa;
  box-shadow: none;
  -webkit-appearance: none; appearance: none;
}

/* Красивое свечение для кнопок отправки */
#feedInputWrap button, #dialogInputWrap button {
  background: linear-gradient(135deg, #7c5cff 0%, #6366f1 100%);
  box-shadow: 0 4px 15px rgba(124, 92, 255, 0.5);
}

/* Само стеклянное облачко вокруг ввода */
#feedInputWrap, #dialogInputWrap {
  background: rgba(40, 30, 70, 0.85);
  border: 1px solid rgba(124, 92, 255, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
/* Компактная карточка текущей книги на Главной */
.d-focus-card {
  padding: 12px 14px; /* Уменьшили внутренние отступы */
}

/* Уменьшаем размер обложки книги */
#mpcBookIcon {
  width: 48px;
  height: 48px;
}

/* Уменьшаем блок с идентичностью (Я - тот, кто...) */
.d-focus-identity {
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
}

/* Делаем кнопку "Начать практику" чуть ниже */
#mpcStartBtn {
  height: 44px; 
  margin-top: 4px;
}
/* ═══════════════════════════════════════════════
   УМЕНЬШЕНИЕ ВЫСОТЫ КАРТОЧКИ ТЕКУЩЕЙ КНИГИ
   ═══════════════════════════════════════════════ */

/* 1. Уменьшаем общий внутренний отступ карточки */
#todayScreen .d-focus-card {
  padding: 12px 14px; 
}

/* 2. Прижимаем верхнюю часть (книгу и кольцо) к блоку идентичности */
#todayScreen .d-focus-card > div:first-child {
  margin-bottom: 8px; /* Было 16px */
}

/* 3. Делаем блок "Я — тот, кто..." более плоским */
#todayScreen .d-focus-identity {
  margin-bottom: 10px; /* Было 16px */
  padding: 8px 12px;   /* Было 10px 14px */
}

/* 4. Чуть уменьшаем высоту кнопки (чтобы была аккуратнее) */
#todayScreen #mpcStartBtn {
  height: 44px; /* Было 48px */
}

/* 5. Немного уменьшаем обложку книги, чтобы она не растягивала верхнюю строку */
#todayScreen #mpcBookIcon {
  width: 48px; 
  height: 48px;
}
/* ═══════════════════════════════════════════════
   ИДЕАЛЬНЫЙ БАЛАНС ГЛАВНОГО ЭКРАНА (ВОЗДУХ + КОМПАКТНОСТЬ)
   ═══════════════════════════════════════════════ */

/* 1. Карточка текущей книги — даем чуть больше воздуха */
#todayScreen .d-focus-card {
  padding: 14px 16px; /* Вернули комфортные отступы */
}

/* 2. Увеличиваем обложку и кольцо */
#todayScreen #mpcBookIcon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}
#todayScreen .d-ring {
  width: 60px;
  height: 60px;
}

/* 3. Выравниваем шрифты (чтобы не были мелкими) */
#todayScreen #mpcBookTitle {
  font-size: 16px;
  margin-bottom: 2px;
}
#todayScreen #mpcBookAuthor {
  font-size: 12px;
}
#todayScreen #mpcProgressText {
  font-size: 11px;
  margin-top: 4px;
}

/* 4. Блок "Я — тот, кто..." — делаем его аккуратным */
#todayScreen .d-focus-identity {
  margin-top: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  font-size: 12px;
}

/* 5. Кнопка "Начать практику" — комфортная высота для пальца */
#todayScreen #mpcStartBtn {
  height: 46px;
  font-size: 13px;
  border-radius: 16px;
}

/* 6. Фикс кнопок быстрого доступа (чтобы не обрезался текст) */
#todayScreen .quick-actions-row {
  margin-top: 12px;
  gap: 8px; /* Чуть увеличили зазор между кнопками */
}
#todayScreen .quick-action-btn {
  padding: 0 8px; 
}
#todayScreen .quick-action-btn span {
  font-size: 9.5px; /* Немного уменьшили шрифт, чтобы влезло "Быстрый режим" */
  letter-spacing: -0.2px;
}

/* 7. Делаем равномерные отступы между всеми блоками на экране */
#todayScreen .wrap {
  gap: 12px; /* Отступы между календарем, цитатой и карточками */
}

/* 8. Чуть возвращаем размеры календарю */
#todayScreen .d-cal-day {
  padding: 8px 2px;
}
#todayScreen .d-cal-dom { font-size: 13px; }
/* ═══════════════════════════════════════════════
   МИНИМАЛЬНОЕ РАССТОЯНИЕ ДО КНОПКИ "НАЧАТЬ ПРАКТИКУ"
   ═══════════════════════════════════════════════ */

/* 1. Убираем нижний отступ у плашки с идентичностью */
#todayScreen .d-focus-identity {
  margin-bottom: 6px; /* Было 14px, теперь минимальный зазор */
}

/* 2. На всякий случай убираем верхний отступ у самой кнопки, если он есть */
#todayScreen #mpcStartBtn {
  margin-top: 0; 
}
/* ═══════════════════════════════════════════════
   УМЕНЬШАЕМ ОТСТУП ДО ПЛАШКИ "Я - ТОТ, КТО..."
   ═══════════════════════════════════════════════ */

#todayScreen .d-focus-identity {
  margin-top: 2px; /* Уменьшили верхний отступ (было 10px) */
}
/* ═══════════════════════════════════════════════
   ПРЕМИАЛЬНЫЕ АВАТАРКИ (СВЕЧЕНИЕ И СТЕКЛО)
   ═══════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════ */
/* ПРЕМИАЛЬНЫЕ АВАТАРКИ (v2.0 Glassmorphism) */
/* ═══════════════════════════════════════════════ */
.premium-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.premium-avatar-item {
  aspect-ratio: 1;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,0.1);
}

.premium-avatar-item:active {
  transform: scale(0.92);
}

/* Обертка для иконки, чтобы она красиво увеличивалась */
.avatar-icon-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}

.premium-avatar-item.active {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(255, 122, 42, 0.1));
  border-color: rgba(167, 139, 250, 0.8);
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.4), inset 0 0 15px rgba(124, 92, 255, 0.2);
}

.premium-avatar-item.active .avatar-icon-wrap {
  transform: scale(1.15);
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.8));
}

/* Стили для ЗАКРЫТЫХ аватарок */
.premium-avatar-item.locked {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.premium-avatar-item.locked .avatar-icon-wrap {
  opacity: 0.3;
  filter: grayscale(1) blur(1px);
}

.avatar-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 18px;
  color: var(--d-gold);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.premium-avatar-item.active svg {
  transform: scale(1.15);
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.8));
}

/* Делаем красивую подложку для большой аватарки в профиле */
.profile-ava-bento {
  background: radial-gradient(circle at 30% 30%, rgba(124, 92, 255, 0.3), rgba(124, 92, 255, 0.05));
  border: 2px solid rgba(124, 92, 255, 0.5);
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.2);
}

#profileAva svg {
  width: 100%;
  height: 100%;
  padding: 0; /* Убрали жесткий отступ */
  box-sizing: border-box;
  filter: drop-shadow(0 4px 12px rgba(124,92,255,0.6));
}
/* ═══════════════════════════════════════════════
   ФИКС МАСКОТА (Чтобы облачко не скрывало тело)
   ═══════════════════════════════════════════════ */

/* 1. Поднимаем маскота на самый верхний слой */
.andger-mascot-avatar {
  position: relative;
  z-index: 10; 
}

/* 2. Опускаем облачко чуть ниже маскота */
.andger-bubble {
  position: relative;
  z-index: 1;
}

/* 3. Делаем SVG маскота видимым без обрезки */
.mascot-svg {
  overflow: visible;
  display: block;
}

/* 4. Убираем эффект "наезда" при анимации (убираем сдвиг влево) */
@keyframes bubblePop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
/* ═══════════════════════════════════════════════
   ГЛОБАЛЬНЫЙ ФИКС ГОРИЗОНТАЛЬНОГО СКРОЛЛА
   ═══════════════════════════════════════════════ */

/* 1. Запрещаем скролл на уровне всего документа */
html, body, #screensRoot {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden; 
  position: relative;
}

/* 2. Заставляем все контейнеры уважать границы экрана */
.wrap, .d-header, .bottom-nav, .d-focus-card, .d-card-glass {
  max-width: 100%;
  box-sizing: border-box;
}

/* 3. Фикс шапки профиля (чтобы длинное имя не растягивало экран) */
.d-header-greet {
  min-width: 0; /* Разрешаем flex-элементу сжиматься */
  overflow: hidden;
}
.d-header-greet-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 4. Фикс вкладок в Сообществе (убираем отрицательные отступы) */
.tab-pill {
  padding: 8px 4px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#communityScreen .wrap > div:nth-child(1) {
  /* Тот самый контейнер с вкладками Лента/Сообщения/Рейтинг */
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 4px;
  box-sizing: border-box;
}

/* 5. Фикс кнопок быстрого доступа (чтобы не распирали экран) */
.quick-actions-row {
  width: 100%;
  max-width: 100%;
  display: flex;
  box-sizing: border-box;
}
.quick-action-btn {
  flex: 1;
  min-width: 0; /* Разрешаем кнопке сжиматься */
}
.quick-action-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* Если текст не влезает, будет "Быстрый реж..." */
  display: block;
}

/* 6. Фикс карточки книги (чтобы кольцо "1/21" не выталкивало текст) */
.d-focus-card > div:first-child {
  min-width: 0;
}
/* Автор всегда в одну строку */
#mpcBookAuthor {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Название строго в 2 строки */
#mpcBookTitle {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  min-height: 34px; 
}

/* 7. Фикс карточки Сторис (чтобы не была шире экрана) */
#storyCard {
  width: 100%;
  max-width: 320px;
}
/* ═══════════════════════════════════════════════
   НАТИВНЫЙ РЕЖИМ ПРИЛОЖЕНИЯ (ANTI-PAN & ZOOM)
   ═══════════════════════════════════════════════ */

/* 1. Жестко фиксируем размеры окна */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* Запрет скролла вбок */
  margin: 0;
  padding: 0;
  overscroll-behavior-y: none; /* Отключает "резиновый" отскок страницы */
}

/* 2. Блокируем выделение текста и вызов контекстного меню (как в приложении) */
* {
  -webkit-touch-callout: none; /* Запрещает меню "Копировать/Сохранить" */
  -webkit-user-select: none;   /* Запрещает выделение текста */
  user-select: none;
}

/* 3. Возвращаем выделение и нормальный шрифт для полей ввода */
input, textarea, select {
  -webkit-user-select: auto;
  user-select: auto;
  /* САМОЕ ВАЖНОЕ: 16px — это золотой стандарт. Если шрифт меньше, iOS принудительно зумит экран! */
  font-size: 16px; 
}

/* 4. Запрещаем элементам вылезать за края */
#screensRoot, .wrap, .d-header, .bottom-nav, #communityScreen, #profileScreen {
  max-width: 100vw;
  box-sizing: border-box;
}

/* 5. Фикс контейнеров с прокруткой (карусели) */
#journalFilters, #statsBooksSwipe, .d-lib-chips, .d-admin-tabs, .tabs-row {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* Фикс высоты контейнера маскота */
.andger-mascot-avatar {
  height: 104px;
}
.andger-mascot-avatar .mascot-svg {
  width: 100%;
  height: 100%;
  display: block;
}
/* 1. Делаем текст книги на Главной таким же, как в Библиотеке */
#mpcBookTitle {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--d-text);
  margin-bottom: 2px;
}

#mpcBookAuthor {
  font-size: 11px;
  color: var(--d-text-dim);
  margin-top: 0;
}

/* 2. Уменьшаем высоту плашки с текстом у маскота */
.andger-bubble {
  min-height: auto; /* Убираем жесткую высоту */
  padding: 10px 14px; /* Уменьшаем внутренние отступы */
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Принудительно опускаем полосу загрузки вниз */
.splash-progress-wrap {
  margin-top: 120px; 
}
/* ═══════════════════════════════════════════════
   ГЛОБАЛЬНЫЕ ЦВЕТА ТАЙМЕРА (Оранжевый, Фиолетовый, Синий)
   ═══════════════════════════════════════════════ */

/* 2. Полоски прогресса (в книгах, в профиле, на главной) */
.d-lib-book-fill, 
.lc-bar-fill, 
#mpcCourseBar,
.abc-fill {
  background: linear-gradient(90deg, #ff7a2a 0%, #7c5cff 50%, #1e5cff 100%);
}

#mpcBookIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
}
#mpcBookIcon svg, #mpcBookIcon img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}
/* ═══════════════════════════════════════════════
   ПЛАВНЫЕ АНИМАЦИИ И ПЕРЕХОДЫ (Premium Feel)
   ═══════════════════════════════════════════════ */

/* 1. Плавное появление карточек при загрузке */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.d-lib-book-card, .d-card-glass, .active-book-card, .ritual-builder-item {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Аккордеоны управляются базовыми правилами styles.css без конфликтующего max-height. */
/* 3. Плавный переход в режим Таймера (Focus Mode) */
.focus-mode .timer-wrapper {
  animation: zoomInFocus 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes zoomInFocus {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* 4. Плавный скролл для всех экранов */
html {
  scroll-behavior: smooth;
}

/* 5. Плавное нажатие на кнопки (чуть более мягкое, чем было) */
button, .nav-btn, .d-icon-btn, .tab-pill, .fp-action {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, color 0.2s, opacity 0.2s;
}

/* 6. Плавное появление модальных окон */
.modal {
  animation: backdropFadeIn 0.3s ease forwards;
}
.modal-box {
  animation: modalSpringIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes backdropFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(10px); }
}
@keyframes modalSpringIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
/* ═══════════════════════════════════════════════
   НОВЫЙ BENTO DASHBOARD (Админка)
   ═══════════════════════════════════════════════ */
.admin-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.admin-nav-btn {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: 16px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

.admin-nav-btn:active {
  transform: scale(0.95);
  background: var(--d-surface-2);
}

.admin-nav-btn.on {
  background: linear-gradient(135deg, rgba(124,92,255,0.15), rgba(124,92,255,0.05));
  border-color: var(--d-accent);
  box-shadow: 0 4px 15px rgba(124,92,255,0.2);
}

.admin-nav-btn .anb-icon {
  font-size: 24px;
  margin-bottom: 2px;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.2));
}

.admin-nav-btn .anb-text {
  font-size: 10px;
  font-weight: 800;
  color: var(--d-text);
  line-height: 1.2;
}

.admin-content-area {
  animation: fadeIn 0.3s ease forwards;
}
/* Вкладки в редакторе книг */
.ed-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 20px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.ed-tab-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  font-size: 12px;
  font-weight: 800;
  color: var(--d-text-dim);
  cursor: pointer;
  transition: 0.2s;
}
.ed-tab-btn.on {
  background: var(--d-accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(124,92,255,0.3);
}

/* Скрытые модальные окна должны оставаться скрытыми после объявления .modal. */
.modal.hidden, .complete-overlay.hidden { display: none; }

/* ANDGER brand components */
.d-card-glass { background: linear-gradient(135deg, rgba(40,30,70,.6), rgba(25,18,45,.4)); border-color: rgba(124,92,255,.25); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.d-btn-primary { background: linear-gradient(135deg, #7c5cff 0%, #6366f1 100%); color: #fff; box-shadow: 0 6px 20px rgba(124,92,255,.4); }
.d-header, .d-bottom-nav { background: rgba(18,12,36,.78); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.d-focus-card { background: linear-gradient(135deg, rgba(124,92,255,.15), rgba(25,18,45,.8)); }
.d-calendar-strip { background: rgba(40,30,70,.4); }

/* ═══════════════════════════════════════════════
   PREMIUM LIGHT THEME (ANDGER 2.0)
   ═══════════════════════════════════════════════ */
html.light {
  --d-bg: #f4f2f9;
  --d-bg-2: #ffffff;
  --d-surface: rgba(255, 255, 255, 0.7);
  --d-surface-2: rgba(0, 0, 0, 0.04);
  --d-surface-3: rgba(0, 0, 0, 0.08);
  --d-border: rgba(124, 92, 255, 0.15);
  --d-border-strong: rgba(124, 92, 255, 0.3);
  --d-text: #1a1428;
  --d-text-dim: #6b6880;
  --d-text-mute: #9e9bb0;
  --color-background-app: #f4f2f9;
}

html.light body {
  background-color: #f4f2f9;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(124, 92, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(255, 122, 42, 0.1) 0%, transparent 50%);
}

html.light .d-header, 
html.light .d-bottom-nav {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(124, 92, 255, 0.15) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

html.light .d-card-glass,
html.light .d-focus-card,
html.light .d-lib-folder,
html.light .lib-category-wrap,
html.light .timer-wrapper,
html.light .admin-detail {
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: rgba(124, 92, 255, 0.2) !important;
  box-shadow: 0 8px 32px rgba(124, 92, 255, 0.08) !important;
}

html.light .d-btn-primary, 
html.light .btn {
  background: linear-gradient(135deg, #7c5cff 0%, #6366f1 100%);
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.3);
}

html.light .d-btn-secondary {
  background: rgba(124, 92, 255, 0.08);
  border-color: rgba(124, 92, 255, 0.2);
  color: #7c5cff;
}

/* Исправляем невидимые элементы при светлой теме */
html.light .d-focus-cover,
html.light .d-lib-book-cover {
  background: #ffffff;
  border-color: rgba(0,0,0,0.05);
}

html.light .d-cal-day.today {
  background: rgba(124, 92, 255, 0.1);
  border-color: #7c5cff;
}

html.light .d-cal-dom, 
html.light .d-focus-title, 
html.light .d-lib-book-title,
html.light .andger-bubble-text {
  color: #1a1428;
}

html.light .d-focus-action,
html.light .d-lib-book-author,
html.light .d-cal-dow {
  color: #6b6880;
}

html.light .andger-bubble {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(124, 92, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Эффект выбранной темы */
.theme-option.active {
  border-color: var(--d-accent) !important;
  background: rgba(124, 92, 255, 0.1) !important;
  box-shadow: 0 0 15px rgba(124, 92, 255, 0.2) !important;
  transform: scale(1.02);
}
/* ═══════════════════════════════════════════════ */
/* ПРЕМИАЛЬНЫЙ ВЫБОР ТЕМЫ (3D СФЕРЫ) */
/* ═══════════════════════════════════════════════ */

.theme-selector-container {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: 20px;
  margin-bottom: 8px;
}

.theme-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 8px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

/* Темная сфера */
.dark-sphere {
  background: radial-gradient(circle at 30% 30%, #3b1f66, #0d0a18);
  border: 1px solid rgba(124, 92, 255, 0.4);
  box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.8), 0 0 15px rgba(124, 92, 255, 0.2);
}

/* Светлая сфера */
.light-sphere {
  background: radial-gradient(circle at 30% 30%, #ffffff, #dcdae5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.15), 0 0 15px rgba(255, 255, 255, 0.1);
}
.light-sphere::after {
  background: rgba(255, 255, 255, 0.9); /* Более яркий блик для светлой */
}

/* Сфера Авто (идеальный плавный переход) */
.auto-sphere {
  background: linear-gradient(135deg, #0d0a18 0%, #2a164a 30%, #7c5cff 60%, #f5f4fa 100%);
  border: 1px solid rgba(124, 92, 255, 0.6);
  box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.7), inset 2px 2px 10px rgba(255, 255, 255, 0.4), 0 0 20px rgba(124, 92, 255, 0.4);
}

/* Текст */
.theme-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--d-text-dim);
  transition: color 0.3s;
  letter-spacing: 0.5px;
}

/* АКТИВНОЕ СОСТОЯНИЕ */
.theme-card.active {
  background: rgba(124, 92, 255, 0.1);
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.15);
}

/* ═══════════════════════════════════════════════ */
/* НОВЫЙ ВЫБОР ЦВЕТОВОЙ СХЕМЫ (ИКОНКИ) */
/* ═══════════════════════════════════════════════ */

.theme-selector-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px; /* Сделали контейнер тоньше */
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: 16px;
  margin-bottom: 8px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px; /* Уменьшили отступ между иконкой и текстом */
  padding: 10px 6px; /* Сделали карточку ниже */
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-card:active {
  transform: scale(0.95);
}

/* Активная тема теперь выделяется строгой нейтральной рамкой, без фиолетового */
.theme-card.active {
  background: var(--d-surface-3); 
  border-color: var(--d-border-strong); 
}

.theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--d-text-mute);
  transition: all 0.2s;
}

.theme-icon svg {
  width: 20px;
  height: 20px;
}

.theme-card.active .theme-icon {
  color: var(--d-text); /* Иконка становится яркой при выборе */
}

.theme-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--d-text-mute);
  transition: color 0.2s;
}

.theme-card.active .theme-label {
  color: var(--d-text);
}
