/* ShriLahari Space — Professional UI */
:root, [data-theme="dark"] {
  --accent: #8b5cf6;
  --accent2: #6d28d9;
  --accent-hover: #7c3aed;
  --accent-light: rgba(139, 92, 246, 0.16);
  --bg: #0b0b10;
  --bg-elevated: #111118;
  --sidebar: #101018;
  --card: #16161f;
  --card-soft: rgba(22, 22, 31, 0.92);
  --text: #f4f4f7;
  --text-strong: #ffffff;
  --muted: #b0b0bd;
  --muted-2: #8e8e9c;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;
  --glow: rgba(139, 92, 246, 0.28);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.28);
  --topbar-bg: rgba(11, 11, 16, 0.92);
  --input-bg: rgba(0, 0, 0, 0.28);
}

[data-theme="light"] {
  --bg: #f4f5f8;
  --bg-elevated: #ffffff;
  --sidebar: #ffffff;
  --card: #ffffff;
  --card-soft: rgba(255, 255, 255, 0.96);
  --text: #111827;
  --text-strong: #0f172a;
  --muted: #6b7280;
  --muted-2: #6b7280;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.16);
  --glow: rgba(124, 58, 237, 0.18);
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08);
  --topbar-bg: rgba(255, 255, 255, 0.94);
  --input-bg: #f3f4f6;
  --accent-light: rgba(124, 58, 237, 0.12);
  --link: #6d28d9;
  --link-hover: #5b21b6;
  --success: #047857;
  --danger: #b91c1c;
  --warning: #92400e;
  --info: #1d4ed8;
  --link: #6d28d9;
  --link-hover: #5b21b6;
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}
html, body { overflow-x: hidden; max-width: 100%; }
img, video, canvas, svg, table, input, select, textarea { max-width: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 10% -10%, rgba(109, 40, 217, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(59, 130, 246, 0.08), transparent 45%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link, #8b5cf6); text-decoration: none; }
a:hover { color: var(--link-hover, #6d28d9); }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(17, 17, 24, 0.98), rgba(11, 11, 18, 0.98));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.25s;
  box-shadow: 12px 0 30px rgba(0,0,0,0.12);
}
.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.sidebar-header .brand span {
  color: var(--accent);
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.1);
}
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

/* ========== Expandable Meditation nav group ========== */
.nav-group {
  display: flex;
  flex-direction: column;
  margin: 2px 0;
}
.nav-group-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  position: relative;
}
.nav-group-toggle .nav-chevron {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}
.nav-group.open .nav-group-toggle .nav-chevron {
  transform: rotate(180deg);
}
.nav-group-toggle.active,
.nav-group.open > .nav-group-toggle {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent, #a78bfa);
}
.nav-sub {
  display: none !important;
  flex-direction: column;
  padding-left: 12px;
  margin: 2px 0 6px;
  border-left: 2px solid rgba(139, 92, 246, 0.25);
  margin-left: 18px;
}
.nav-group.open > .nav-sub {
  display: flex !important;
}
/* Never show legacy flat subnav links */
a.meditation-subnav-item,
.sidebar-nav > a.nav-sub-item {
  display: none !important;
}
.nav-group .nav-sub-item {
  display: flex !important;
}
.nav-sub-item {
  padding: 8px 12px !important;
  font-size: 13.5px !important;
  min-height: 40px;
  color: var(--muted, #a89bb8);
}
.nav-sub-item.active {
  color: var(--accent, #a78bfa);
  background: rgba(139, 92, 246, 0.1);
  font-weight: 600;
}
.nav-sub-item:hover {
  color: var(--text, #f2ecff);
}
/* legacy class cleanup */
.meditation-subnav-item { display: none !important; }

@media (max-width: 768px) {
  .nav-sub { margin-left: 12px; }
  .nav-sub-item { font-size: 14px !important; min-height: 44px; }
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 3px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s ease;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-strong);
  transform: translateX(2px);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(79, 70, 229, 0.12));
  color: #ede9fe;
  border-color: rgba(139, 92, 246, 0.28);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.14);
}
[data-theme="light"] .sidebar .nav-item.nav-sub-item.active {
  color: #5b21b6;
  background: rgba(109, 40, 217, 0.1);
}
.nav-item .icon { font-size: 18px; width: 22px; text-align: center; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.sidebar-footer .user-name { color: var(--text); font-weight: 500; margin-bottom: 4px; }

/* Main content — v3.3.10 (stable beside fixed sidebar) */
.main {
  margin-left: var(--sidebar-w);
  width: auto;
  max-width: none;
  min-height: 100vh;
  min-width: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow-x: visible;
  visibility: visible !important;
  opacity: 1 !important;
}
.main .content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 1 1 auto;
  padding: 24px 28px 36px;
  min-height: 200px;
  color: var(--text);
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 11, 18, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: visible;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.topbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  box-sizing: border-box;
}
.topbar-row-main {
  flex: 1 1 auto;
  min-width: 0;
}
.topbar-row-tools {
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.topbar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  order: 3;
  margin-left: auto;
}
.topbar-lang { order: 1; flex-shrink: 0; }
.topbar-search { order: 2; }
.topbar-storage { order: 4; }
.topbar .notif-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
}
.topbar .notif-wrap button {
  position: relative;
  z-index: 2;
}
.topbar .notif-panel {
  right: 0;
  left: auto;
  z-index: 90;
}
.topbar-search {
  position: relative;
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 280px;
  box-sizing: border-box;
}
.topbar-search .pv-global-search,
input.pv-global-search {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.32);
  color: var(--text);
  font-size: 14px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.02);
}
.topbar-search .pv-global-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.topbar-storage {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.topbar-lang .pv-lang-switch {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.topbar-lang .pv-lang-switch button,
.topbar-lang .pv-lang-switch a {
  min-width: 44px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg, rgba(255,255,255,0.04));
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-bell, .topbar-actions .bell, button.notif-btn, .topbar .notif-wrap button {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar h2, .topbar-title { margin: 0; font-size: 18px; font-weight: 650; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.content { padding: 24px 28px 36px; flex: 1; }

.dashboard-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(59, 130, 246, 0.08), rgba(255,255,255,0.02));
}
.dashboard-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.28);
  margin-bottom: 8px;
}
.dashboard-hero-copy h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.1;
  color: var(--text-strong);
}
.dashboard-hero-copy p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}
.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}
.dash-stats .stat-card {
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  text-decoration: none;
  color: inherit;
  display: block;
  min-width: 0;
}
.dash-stats .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  border-color: rgba(139, 92, 246, 0.28);
}
.dash-stats .stat-card:focus-visible,
.quick-access-list a:focus-visible,
.dash-actions a:focus-visible {
  outline: 2px solid var(--accent, #a78bfa);
  outline-offset: 3px;
}
.dashboard-size { font-size: 1.08rem !important; }
.dashboard-lower-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}
.dash-storage {
  background: var(--card, rgba(255,255,255,.04));
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 18px;
  padding: 18px 18px 16px;
}
.storage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.storage-head strong {
  color: var(--text-strong);
}
.storage-head span {
  color: var(--muted);
  font-size: 13px;
}
.dash-storage .bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  margin-top: 10px;
}
.dash-storage .bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .4s ease;
}
.dash-storage .bar.ok > i { background: linear-gradient(90deg, #22c55e, #16a34a); }
.dash-storage .bar.warn > i { background: linear-gradient(90deg, #f59e0b, #d97706); }
.dash-storage .bar.danger > i { background: linear-gradient(90deg, #ef4444, #dc2626); }
.quick-access-card {
  padding: 18px;
}
.quick-access-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.quick-access-list {
  display: grid;
  gap: 8px;
}
.quick-access-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.quick-access-list a:hover {
  border-color: rgba(139, 92, 246, 0.24);
  background: rgba(139, 92, 246, 0.08);
}
.dash-recent {
  overflow: hidden;
}
.recent-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-strong);
}
.recent-wrap {
  overflow: auto;
  max-height: 420px;
}
.dash-recent table { width: 100%; border-collapse: collapse; }
.dash-recent th,.dash-recent td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border, rgba(255,255,255,.06)); font-size: 13px; }
.dash-recent th { position: sticky; top: 0; background: rgba(0,0,0,.35); color: var(--muted,#9ca3af); font-weight: 600; }
.dash-recent tr:hover td { background: rgba(139,92,246,.06); }
.dash-file-ico { font-size: 18px; margin-right: 8px; }
.dash-empty { padding: 32px; text-align: center; color: var(--muted,#9ca3af); }
.dash-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-actions a,.dash-actions button {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
@media(max-width:900px){
  .dashboard-lower-grid {
    grid-template-columns: 1fr;
  }
}
@media(max-width:700px){
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-hero-actions {
    width: 100%;
  }
  .dashboard-hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .dash-recent table,.dash-recent thead,.dash-recent tbody,.dash-recent th,.dash-recent td,.dash-recent tr{display:block}
  .dash-recent thead{display:none}
  .dash-recent tr{padding:12px 14px;border-bottom:1px solid var(--border)}
  .dash-recent td{padding:4px 0;border:0}
  .dash-recent td:nth-child(2) { display: none; }
  .dash-recent td:first-child {
    overflow-wrap: anywhere;
    font-weight: 600;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dash-stats .stat-card,
  .dash-storage .bar > i {
    transition: none;
  }
  .dash-stats .stat-card:hover {
    transform: none;
  }
}

/* Cards */
.glass-card {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.glass-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 6px; color: var(--text); }
.stat-card .value.accent { color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff !important;
  box-shadow: 0 8px 20px var(--glow);
  border-color: rgba(255,255,255,0.12);
}
.btn-primary:hover { filter: brightness(1.06); color: #fff !important; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text) !important;
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-strong) !important;
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca !important;
  border: 1px solid rgba(239, 68, 68, 0.28);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.22); }
.btn-sm { padding: 7px 12px; min-height: 32px; font-size: 12.5px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(17, 24, 39, 0.32);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.toggle input { width: auto; }

/* File grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.file-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}
.file-item:hover { border-color: var(--accent); }
.file-item .thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 8px;
}
.file-item .name {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-item .meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.file-item { min-width: 0; }
.file-item .name { overflow-wrap: anywhere; }
.file-preview-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}
.file-preview-trigger:focus-visible,
.file-lightbox-close:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.file-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.84);
}
.file-lightbox[aria-hidden="false"] { display: flex; }
.file-lightbox-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 1100px);
  max-height: 90vh;
}
.file-lightbox-panel img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}
.file-lightbox-close {
  position: absolute;
  top: -42px;
  right: 0;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 24px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .file-item { padding: 10px; }
  .file-item .thumb { height: 96px; }
  .file-lightbox { padding: 12px; }
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.upload-zone input { display: none; }

/* Progress */
.progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar .fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}

/* Mobile */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}

/* Player bars */
.player-bar {
  position: fixed;
  bottom: 0; left: var(--sidebar-w); right: 0;
  background: var(--sidebar);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 90;
}
@media (max-width: 768px) {
  .player-bar { left: 0; }
}

/* Challenge builder */
.challenge-list { list-style: none; }
.challenge-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: grab;
}
.challenge-item .handle { color: var(--muted); cursor: grab; }
.challenge-item .info { flex: 1; }
.challenge-item .info strong { display: block; font-size: 14px; }
.challenge-item .info small { color: var(--muted); font-size: 12px; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success { background: rgba(34,197,94,0.12); color: #86efac; }
.alert-error { background: rgba(239,68,68,0.12); color: #fca5a5; }
.alert-info { background: rgba(109,40,217,0.12); color: #c4b5fd; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
.lightbox .close {
  position: absolute;
  top: 20px; right: 24px;
  background: none; border: none;
  color: #fff; font-size: 28px; cursor: pointer;
}

.pv-video-player {
  width: min(960px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 16px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
.pv-video-player::backdrop { background: rgba(0, 0, 0, .78); }
.pv-video-player__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.pv-video-player__header h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pv-video-player video {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 140px);
  background: #000;
  border-radius: 8px;
}
.pv-video-player__status {
  min-height: 1.5em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 600px) {
  .pv-video-player { padding: 10px; }
  .pv-video-player video { max-height: calc(100dvh - 110px); }
}

/* Badge (inbox unread) */
.nav-item .badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Priority tags */
.priority-low { color: #94a3b8; }
.priority-normal { color: #60a5fa; }
.priority-high { color: #fbbf24; }
.priority-urgent { color: #f87171; font-weight: 600; }

/* Notes grid */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.note-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
  min-height: 120px;
  position: relative;
}
.note-card:hover { border-color: var(--accent); }
.note-card .note-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.note-card .note-preview { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.note-card .pin { position: absolute; top: 10px; right: 10px; font-size: 12px; }

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.kanban-col {
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  padding: 12px;
  min-height: 200px;
}
.kanban-col h4 { font-size: 12px; color: var(--muted); text-transform: uppercase; margin-bottom: 12px; }
.kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  font-size: 13px;
}
.kanban-card:hover { border-color: var(--accent); }

/* Calendar */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  appearance: none;
  width: 100%;
  min-height: 80px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  overflow: hidden;
}
.cal-day:hover, .cal-day:focus-visible { border-color: var(--accent); }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-day-empty { cursor: default; background: transparent; border-color: transparent; }
.cal-day.today { border-color: var(--accent); background: var(--accent-light); }
.cal-day .day-num { display: block; font-weight: 600; margin-bottom: 4px; }
.cal-day .event-dot {
  display: block;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-header span { text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.calendar-views, .calendar-month-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.calendar-month-toolbar { gap: 10px; margin-bottom: 16px; }
.calendar-month-toolbar h3 { font-size: 18px; min-width: 160px; text-align: center; }
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 20px;
}
.calendar-layout > *, .calendar-event-list { min-width: 0; }
.calendar-card { margin-bottom: 16px; }
.calendar-event-list { max-width: 900px; }
.calendar-event-list h3 { font-size: 18px; margin-bottom: 12px; }
.calendar-empty { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.calendar-event-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.calendar-event-copy { display: grid; min-width: 0; gap: 2px; }
.calendar-event-copy strong { overflow-wrap: anywhere; }
.calendar-event-copy span, .calendar-event-done { color: var(--muted); font-size: 12px; }
.calendar-event-done { margin-left: auto; }
.calendar-event-list > .btn { margin-top: 14px; }
.calendar-modal[hidden] { display: none !important; }
.calendar-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.8);
}
.calendar-modal-card { width: 100%; max-width: 400px; }
.calendar-modal-card h3 { margin-bottom: 12px; font-size: 16px; }
.calendar-modal-card input, .calendar-modal-card select { width: 100%; min-height: 42px; }
.calendar-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.calendar-form-error { color: var(--danger); font-size: 13px; margin: 0 0 12px; }

/* Message list */
.msg-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.msg-item:hover { background: rgba(255,255,255,0.03); }
.msg-item.unread { background: rgba(109,40,217,0.08); }
.msg-item .msg-subject { font-weight: 500; font-size: 14px; }
.msg-item .msg-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

@media (max-width: 900px) {
  .kanban { grid-template-columns: 1fr; }
}

/* ===== Responsive v2.2 ===== */
@media (max-width: 1024px) {
  .kanban { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    width: min(280px, 85vw);
    transform: translateX(-100%);
    box-shadow: 8px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; width: 100%; }
  .menu-toggle { display: block !important; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card .value { font-size: 20px; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .kanban { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .topbar { padding: 12px 14px; }
  .topbar h2 { font-size: 16px; }
  .glass-card { padding: 14px; }
  table { font-size: 12px; }
  th, td { padding: 8px 8px; }
  .player-bar { left: 0; }
  .notes-grid:not([data-view="list"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-day { min-height: 56px; font-size: 11px; padding: 4px; }
  .cal-day .event-dot { font-size: 9px; }
  .calendar-month-toolbar h3 { min-width: 130px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .btn { padding: 10px 14px; font-size: 14px; }
  body { font-size: 15px; }
}
/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .sidebar { width: 200px; }
  .main { margin-left: 200px; }
}

/* ===== v2.2.1 Mobile-first polish ===== */
html { -webkit-text-size-adjust: 100%; }
img, video, canvas, iframe { max-width: 100%; height: auto; }
/* v3.3.10: do not force 100vw on .main (clips content with sidebar margin) */
.main { max-width: none; overflow-x: visible; }
.content { max-width: 100%; overflow-x: auto; }

@media (max-width: 900px) {
  .sidebar {
    width: min(300px, 88vw) !important;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }
  .sidebar.open { transform: translateX(0) !important; z-index: 200; }
  .main { margin-left: 0 !important; }
  .menu-toggle { display: inline-flex !important; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar h2 { font-size: 15px; line-height: 1.3; }
  .content { padding: 12px !important; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .value { font-size: 20px; }
  .glass-card { padding: 14px; border-radius: 12px; }
  .form-row { grid-template-columns: 1fr !important; }
  .table-wrap { margin: 0 -4px; }
  table { font-size: 12px; }
  th, td { padding: 10px 8px; }
  .btn { min-height: 40px; }
  .file-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kanban { grid-template-columns: 1fr !important; }
  .notes-grid:not([data-view="list"]) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .notes-grid[data-view="list"] { display: flex !important; flex-direction: column !important; }
  .auth-card, .auth-wrap { max-width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .file-grid { grid-template-columns: 1fr 1fr; }
  body { font-size: 15px; }
}

/* Overlay when sidebar open on mobile */
@media (max-width: 900px) {
  body.sidebar-open::after {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 150;
  }
}

.file-item { position: relative; }
.file-check-wrap, .file-item > label { cursor: pointer; }
.file-actions .btn { font-size: 11px; padding: 6px 10px; }
.file-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 6px; }
.file-item .thumb { min-height: 80px; }

/* ========== v2.6.2 — Dark theme readability & UX ========== */

/* Links must stay visible on dark backgrounds */
a {
  color: #c4b5fd;
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #ddd6fe;
}
a:visited {
  color: #a78bfa;
}
/* Inline code in dark UI */
code {
  background: rgba(255,255,255,0.08);
  color: #e9d5ff;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.92em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

/* Info / callout bars */
.info-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: rgba(109, 40, 217, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.info-bar strong { color: #e9d5ff; }
.info-bar a {
  color: #f5f3ff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.info-bar a:hover { color: #fff; }
.info-bar .info-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Clear section titles */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.section-title .icon { font-size: 18px; }

/* Form grid helpers */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 16px;
}
.form-grid .form-group { margin-bottom: 0; }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: center;
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.check-row label {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text) !important;
  margin: 0 !important;
  cursor: pointer;
  user-select: none;
}
.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Hint text under fields */
.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Table action buttons spacing */
td .btn { margin: 2px 2px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.empty-state .icon { font-size: 32px; display: block; margin-bottom: 10px; opacity: 0.7; }

/* Status chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.chip-on { background: rgba(34,197,94,0.18); color: #86efac; }
.chip-off { background: rgba(148,163,184,0.15); color: #94a3b8; }
.chip-warn { background: rgba(245,158,11,0.18); color: #fcd34d; }

/* Toggle label (settings) clearer on dark */
label.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
label.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Select / option readability */
.form-group select option {
  background: #1c1c24;
  color: #e8e8ed;
}

/* Content links inside cards (not nav) */
.glass-card a:not(.btn):not(.nav-item) {
  color: #ddd6fe;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.glass-card a:not(.btn):not(.nav-item):hover {
  color: #fff;
}

/* Topbar title */
.topbar h1, .topbar .page-title { color: var(--text); }

/* Fix muted text contrast slightly */
:root {
  --muted: #9ca3af;
  --link: #c4b5fd;
  --link-hover: #f5f3ff;
}


/* === v2.7.2 polish & speed === */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video { max-width: 100%; height: auto; }
/* content-visibility removed from .main/.content — caused mobile width collapse */
.btn, .nav-item, .toggle, a { touch-action: manipulation; }
.btn { transition: background .15s ease, opacity .15s ease, transform .1s ease; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.form-group label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(109,40,217,.55);
  box-shadow: 0 0 0 3px rgba(109,40,217,.15);
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.alert-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.file-pick { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.file-pick .meta { flex: 1; min-width: 0; }
.file-pick .meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick .meta small { color: var(--muted); font-size: 12px; }
.file-pick img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.empty-state { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty-state .icon { display: block; font-size: 28px; margin-bottom: 8px; }
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .form-row { grid-template-columns: 1fr !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


/* === Success / error toasts (fixed overlay — never affects page width) === */
.pv-toast-host {
  position: fixed !important;
  top: 12px;
  left: 12px;
  right: 12px;
  margin: 0 auto;
  width: auto;
  max-width: 440px;
  z-index: 2147483646 !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  pointer-events: none;
  transform: none !important;
  contain: layout style;
}
.pv-toast {
  pointer-events: auto;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(22,22,30,.97);
  color: var(--text, #e8e8ed);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  word-break: break-word;
  animation: pv-toast-in .22s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pv-toast.success {
  border-color: rgba(34,197,94,.45);
  background: linear-gradient(180deg, rgba(34,197,94,.18), rgba(22,22,30,.97));
}
.pv-toast.error {
  border-color: rgba(239,68,68,.5);
  background: linear-gradient(180deg, rgba(239,68,68,.16), rgba(22,22,30,.97));
}
.pv-toast.info {
  border-color: rgba(109,40,217,.45);
}
.pv-toast .pv-toast-icon { flex-shrink: 0; font-size: 16px; line-height: 1.2; }
.pv-toast .pv-toast-msg { flex: 1; min-width: 0; }
@keyframes pv-toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pv-toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}

/* Mobile full-width content */
@media (max-width: 768px) {
  .main { width: 100% !important; max-width: 100% !important; margin-left: 0 !important; }
  .content { width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
  .glass-card { max-width: 100%; }
  .attach-row {
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
  }
  .attach-row .btn { width: 100%; justify-content: center; }
  .file-pick {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .file-pick .btn, .file-pick a.btn {
    margin-top: 6px;
  }
  .file-pick form { width: 100%; }
}

/* === Universal Share Dialog === */
.pv-share-overlay {
  display: none; position: fixed; inset: 0; z-index: 100000;
  background: rgba(0,0,0,.55); align-items: center; justify-content: center;
  padding: 16px; backdrop-filter: blur(4px);
}
.pv-share-modal {
  width: 100%; max-width: 440px; max-height: 90vh; overflow: auto;
  background: var(--card, #16161e); color: var(--text, #f1f1f5);
  border: 1px solid rgba(255,255,255,.1); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.pv-share-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 15px;
}
.pv-share-x {
  border: 0; background: transparent; color: inherit; font-size: 22px; cursor: pointer; line-height: 1;
}
.pv-share-body { padding: 14px 16px; }
.pv-share-item { font-size: 13px; color: var(--muted, #9ca3af); margin-bottom: 12px; }
.pv-share-label { display: block; font-size: 12px; color: var(--muted, #9ca3af); margin: 10px 0 6px; }
.pv-share-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.25); color: inherit; font-size: 14px;
}
.pv-share-list {
  max-height: 180px; overflow: auto; border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; margin-top: 6px;
}
.pv-share-row {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px; cursor: pointer;
}
.pv-share-empty { padding: 16px; text-align: center; color: var(--muted, #9ca3af); font-size: 13px; }
.pv-share-presets, .pv-share-custom {
  display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: 13px; margin-top: 6px;
}
.pv-share-err {
  margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: 12px;
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #fca5a5;
}
.pv-share-foot {
  display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.share-actions .btn { min-width: auto; }


/* === PV PROFESSIONAL VISIBILITY LAYER === */
.sidebar {
  background: linear-gradient(180deg, #12121a 0%, var(--sidebar) 100%);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(0,0,0,.25);
}
.sidebar-header {
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-header .brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.sidebar-header .brand span {
  color: var(--accent);
  filter: drop-shadow(0 0 10px var(--glow));
}
.sidebar-footer {
  background: rgba(0,0,0,.2);
  color: var(--muted);
}
.sidebar-footer .user-name {
  color: var(--text-strong) !important;
  font-weight: 600;
  font-size: 13px;
}
.sidebar-footer a, .sidebar-footer .btn {
  color: var(--text) !important;
}

/* Forms */
label, .form-group label, .field label {
  color: var(--muted) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
}
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"],
select, textarea {
  background: rgba(0, 0, 0, 0.32) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-strong) !important;
  font-size: 14px !important;
}
input::placeholder, textarea::placeholder { color: #7a7a88 !important; opacity: 1; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18) !important;
  outline: none !important;
}

/* Tables */
table { width: 100%; border-collapse: collapse; }
th {
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border) !important;
  padding: 12px 10px !important;
  text-align: left;
}
td {
  color: var(--text) !important;
  font-size: 14px !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  padding: 12px 10px !important;
  vertical-align: middle;
}
tr:hover td { background: rgba(255,255,255,0.025); }

/* Section titles */
.section-title, h3.section-title, .content h2, .content h3 {
  color: var(--text-strong) !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.field-hint, .hint, small, .meta, .text-muted {
  color: var(--muted) !important;
  font-size: 12.5px;
}

/* Alerts / toasts */
.alert, .alert-success, .alert-error {
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
}
.alert-success {
  background: rgba(52, 211, 153, 0.12) !important;
  border: 1px solid rgba(52, 211, 153, 0.3) !important;
  color: #a7f3d0 !important;
}
.alert-error {
  background: rgba(248, 113, 113, 0.12) !important;
  border: 1px solid rgba(248, 113, 113, 0.3) !important;
  color: #fecaca !important;
}

/* Status pills */
.status-pill, .badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

/* Toggle / checkbox labels */
label.toggle, .toggle {
  color: var(--text) !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
}

/* Modals / overlays */
.sl-secret-overlay {
  position: fixed;
  inset: 0;
  z-index: 10070;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: rgba(8, 6, 16, .9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.sl-secret-overlay.is-open { display: flex; }
.sl-secret-dialog {
  width: 100%;
  max-width: 380px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f5f0ff;
  text-align: center;
}
.sl-secret-dialog h2,
.sl-secret-dialog label { display: none; }
.sl-secret-error { display:none; min-height:1.4em; margin:8px 0; color:#fca5a5; font-size:13px; }
.sl-secret-overlay.has-error .sl-secret-error { display:block; }
.sl-secret-dialog form { margin: 0; }
/* Background typing: field is invisible but real-sized so mobile keyboard works */
.sl-secret-dialog form {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.sl-secret-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  min-height: 28px;
  margin: 22px auto 0;
  pointer-events: none;
}
.sl-secret-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.28);
  border: 1px solid rgba(167, 139, 250, 0.45);
  transition: background .15s, transform .15s;
}
.sl-secret-dots span.on {
  background: #c4b5fd;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.7);
  transform: scale(1.15);
}
.sl-secret-dialog input {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(280px, 82vw);
  max-width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 12px 16px;
  border: 0 !important;
  border-radius: 14px;
  opacity: 0; /* typed in background */
  background: transparent !important;
  color: transparent !important;
  caret-color: transparent;
  font-size: 16px !important;
  line-height: 1.25;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  z-index: 3;
}
.sl-secret-dialog input:focus {
  outline: none;
  opacity: 0;
}
.sl-secret-om {
  display: none;
  margin: 0 auto;
  color: #f5f0ff;
  font-size: clamp(150px, 35vw, 220px);
  line-height: 1;
  text-shadow: 0 0 42px rgba(167, 139, 250, .65);
}
.sl-secret-overlay.shows-om .sl-secret-om { display: block; animation:sl-secret-om-pulse 1.4s ease-in-out infinite alternate; }
@keyframes sl-secret-om-pulse { from { opacity:.72; transform:scale(.96); } to { opacity:1; transform:scale(1.04); } }
.sl-secret-dialog form { display:flex;flex-direction:column;align-items:center; }
.sl-secret-overlay[aria-hidden="true"] { pointer-events: none; }
.sl-secret-overlay.is-open[aria-hidden="false"] { pointer-events: auto; }

.note-editor, [contenteditable="true"] {
  color: var(--text-strong) !important;
  background: rgba(0,0,0,0.28) !important;
}

/* Links that were too dim */
.main a:not(.btn):not(.nav-item) {
  color: #c4b5fd;
}
.main a:not(.btn):not(.nav-item):hover {
  color: #ede9fe;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.35) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.35);
  border-radius: 8px;
}
*::-webkit-scrollbar-track { background: transparent; }

/* Mobile readability */
@media (max-width: 768px) {
  .content { padding: 16px; }
  .topbar { padding: 12px 14px; }
  .topbar h2 { font-size: 1.05rem; }
  .btn { min-height: 40px; }
  .nav-item { font-size: 14.5px; padding: 12px 14px; }
}


/* === List / Grid view system === */
.pv-view-toggle { display:inline-flex; gap:6px; align-items:center; }
.pv-view-toggle .pv-view-btn.active {
  background: var(--accent-light, rgba(139,92,246,.18));
  color: #ede9fe !important;
  border-color: rgba(139,92,246,.4);
}
.pv-items.grid-view,
.notes-grid.grid-view {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.notes-grid.grid-view { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.pv-items.list-view,
.notes-grid.list-view {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
}
.pv-items.list-view .file-card,
.pv-items.list-view .file-item,
.notes-grid.list-view .note-card,
.pv-items.list-view .rem-card,
.pv-items.list-view .task-row-card {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card, #16161f);
  border: 1px solid var(--border);
}
.notes-grid.list-view .note-card {
  position: relative;
  cursor: pointer;
}
.notes-grid.list-view .note-preview {
  flex: 1;
  -webkit-line-clamp: 1;
  margin: 0;
  max-height: 1.4em;
}
.notes-grid.list-view .note-title {
  min-width: 140px;
  margin: 0;
}
.pv-items.list-view .thumb {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px;
  border-radius: 10px;
  flex-shrink: 0;
}
.pv-items.list-view .name {
  flex: 1;
  text-align: left !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv-items.list-view .meta {
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}
.pv-search,
input.pv-search,
input[type="search"].pv-search,
.file-toolbar input[type="search"],
.file-search {
  -webkit-appearance: none !important;
  appearance: none !important;
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 100%;
  min-height: 42px;
  padding: 10px 14px !important;
  background: var(--input-bg) !important;
  background-color: var(--input-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  color: var(--text) !important;
  font-size: 14px !important;
  caret-color: #c4b5fd;
}
.pv-search::placeholder,
input[type="search"]::placeholder {
  color: #8b8b9a !important;
  opacity: 1 !important;
}
/* Kill white autofill */
.pv-search:-webkit-autofill,
input[type="search"]:-webkit-autofill {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
  transition: background-color 9999s ease-in-out 0s;
}
.pv-search:focus,
input[type="search"].pv-search:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(139,92,246,0.22) !important;
  outline: none !important;
  background: var(--input-bg) !important;
}

.pv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.pv-toolbar .btn {
  flex: 0 0 auto;
}
.pv-toolbar .pv-search {
  flex: 1 1 180px;
  order: 0;
}
.pv-toolbar .pv-view-toggle {
  flex: 0 0 auto;
  width: 100%;
  justify-content: flex-start;
}
@media (min-width: 640px) {
  .pv-toolbar .pv-view-toggle { width: auto; }
}

/* Notes list mode must override base .notes-grid */
.notes-grid.list-view {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
}
.notes-grid.list-view .note-card {
  min-height: auto !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
}
.notes-grid.list-view .note-card .note-title {
  flex: 0 0 auto;
  max-width: 40%;
}
.notes-grid.list-view .note-card .note-preview {
  flex: 1 1 auto;
  -webkit-line-clamp: 1 !important;
  margin: 0 !important;
}
.notes-grid.list-view .note-card .btn {
  flex: 0 0 auto;
  margin-top: 0 !important;
}

/* Tasks toolbar links as solid chips */
.pv-toolbar a.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}

/* Mobile: search full width under primary action */
@media (max-width: 600px) {
  .pv-toolbar .pv-search {
    flex: 1 1 100%;
    max-width: 100%;
    order: 2;
  }
  .pv-toolbar .btn-primary {
    order: 1;
  }
  .pv-toolbar .pv-view-toggle,
  .pv-toolbar a.btn {
    order: 3;
  }
}

/* === Universal file Grid / List (images, video, audio, docs) === */
.file-grid[data-view="grid"],
#filesGrid[data-view="grid"],
.files-grid[data-view="grid"] {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
  gap: 12px !important;
}
.file-grid[data-view="list"],
#filesGrid[data-view="list"],
.files-grid[data-view="list"] {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.file-grid[data-view="list"] .file-item,
#filesGrid[data-view="list"] .file-item,
.files-grid[data-view="list"] .file-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  width: 100% !important;
  position: relative !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  background: var(--card, #16161f) !important;
}
.file-grid[data-view="list"] .thumb,
#filesGrid[data-view="list"] .thumb {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}
.file-grid[data-view="list"] .name,
#filesGrid[data-view="list"] .name {
  flex: 1 1 auto !important;
  text-align: left !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.file-grid[data-view="list"] .meta,
#filesGrid[data-view="list"] .meta {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  color: var(--muted) !important;
}
.file-grid[data-view="list"] .file-actions,
#filesGrid[data-view="list"] .file-actions {
  margin-top: 0 !important;
  flex: 0 0 auto !important;
}
.file-grid[data-view="list"] .file-check-wrap,
#filesGrid[data-view="list"] .file-check-wrap {
  position: static !important;
  background: transparent !important;
  margin-right: 4px;
}
/* documents list/grid */
.doc-list[data-view="grid"] {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  gap: 12px !important;
}
.doc-list[data-view="list"] {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.doc-list[data-view="grid"] .doc-row {
  display: flex !important;
  flex-direction: column !important;
  padding: 14px !important;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card, #16161f);
}
.doc-list[data-view="list"] .doc-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card, #16161f);
}
/* voice recordings */
.rec-list[data-view="grid"] {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 12px !important;
}
.rec-list[data-view="list"] {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.pv-view-btn.btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
  color: #fff !important;
  border: none !important;
}
@media (max-width: 600px) {
  .file-grid[data-view="grid"],
  #filesGrid[data-view="grid"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}


/* DOCUMENTS MOBILE LIST */
@media (max-width: 640px) {
  .doc-list[data-view="grid"] {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
    gap: 10px !important;
  }
  .doc-list[data-view="list"] .doc-row {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px !important;
  }
  .doc-list[data-view="list"] .doc-name {
    min-width: 0;
    overflow: hidden;
  }
  .doc-list[data-view="grid"] .doc-name,
  .file-item .name {
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
  }
  .doc-list[data-view="grid"] .doc-actions { width: 100%; }
  .doc-list[data-view="list"] .doc-actions { width: auto; }
  .btn, .nav-item { min-height: 44px; }
  .content { overflow-x: hidden; }
}

.pv-lang-switch { display:inline-flex; gap:6px; align-items:center; }
.pv-lang-switch .btn { min-width:52px; }
.lang-tabs { display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.lang-tabs .btn.active, .lang-tabs a.btn-primary { background:linear-gradient(135deg,#8b5cf6,#6d28d9); color:#fff; border:none; }
.bilingual-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:700px){ .bilingual-grid { grid-template-columns:1fr; } }

/* —— Rich text editor (admin) —— */
.pv-rich-wrap { border:1px solid var(--border); border-radius:12px; overflow:hidden; background:rgba(0,0,0,.25); }
.pv-rich-toolbar { display:flex; flex-wrap:wrap; gap:4px; padding:8px; border-bottom:1px solid var(--border); background:rgba(0,0,0,.2); align-items:center; }
.pv-rich-toolbar button, .pv-rich-toolbar select {
  min-width:32px; height:32px; padding:0 8px; border-radius:8px; border:1px solid transparent;
  background:transparent; color:var(--text); font-size:13px; cursor:pointer;
}
.pv-rich-toolbar button:hover, .pv-rich-toolbar select:hover { background:rgba(139,92,246,.2); border-color:var(--border); }
.pv-rich-toolbar .sep { width:1px; height:20px; background:var(--border); margin:0 4px; }
.pv-rich-toolbar select { max-width:90px; }
.pv-rich-editor {
  min-height:220px; max-height:480px; overflow-y:auto; padding:16px 18px;
  color:var(--text); font-size:15px; line-height:1.7; outline:none;
}
.pv-rich-editor:empty:before { content:attr(data-placeholder); color:var(--muted); pointer-events:none; }

/* —— WordPress-like reading content —— */
.pv-content, .stotra-read, .dev-read {
  max-width:720px; margin:0 auto; line-height:1.8; font-size:1.08rem; color:var(--text);
  word-wrap:break-word; overflow-wrap:break-word;
}
.pv-content h1, .stotra-read h1, .dev-read h1 { font-size:1.85rem; font-weight:700; margin:1.4em 0 .6em; line-height:1.25; }
.pv-content h2, .stotra-read h2, .dev-read h2 { font-size:1.5rem; font-weight:700; margin:1.3em 0 .55em; line-height:1.3; }
.pv-content h3, .stotra-read h3, .dev-read h3 { font-size:1.25rem; font-weight:600; margin:1.2em 0 .5em; }
.pv-content h4, .stotra-read h4, .dev-read h4 { font-size:1.1rem; font-weight:600; margin:1.1em 0 .45em; }
.pv-content p, .stotra-read p, .dev-read p { margin:0 0 1em; }
.pv-content ul, .stotra-read ul, .dev-read ul,
.pv-content ol, .stotra-read ol, .dev-read ol { margin:0 0 1em 1.4em; padding:0; }
.pv-content li, .stotra-read li, .dev-read li { margin:.35em 0; }
.pv-content blockquote, .stotra-read blockquote, .dev-read blockquote {
  margin:1.2em 0; padding:.75em 1.1em; border-left:4px solid #8b5cf6;
  background:rgba(139,92,246,.08); border-radius:0 10px 10px 0; color:var(--muted);
}
.pv-content a, .stotra-read a, .dev-read a { color:#a78bfa; text-decoration:underline; }
.pv-content img, .stotra-read img, .dev-read img { max-width:100%; height:auto; border-radius:10px; margin:1em 0; }
.pv-content table, .stotra-read table, .dev-read table { width:100%; border-collapse:collapse; margin:1em 0; font-size:.95em; }
.pv-content th, .stotra-read th, .dev-read th,
.pv-content td, .stotra-read td, .dev-read td { border:1px solid var(--border); padding:8px 12px; text-align:left; }
.pv-content th, .stotra-read th, .dev-read th { background:rgba(139,92,246,.12); font-weight:600; }
.pv-content pre, .stotra-read pre, .dev-read pre {
  background:rgba(0,0,0,.35); padding:14px; border-radius:10px; overflow-x:auto; font-size:.9em; margin:1em 0;
}
.pv-content code, .stotra-read code, .dev-read code { font-family:ui-monospace,monospace; font-size:.9em; }
.pv-content hr, .stotra-read hr, .dev-read hr { border:none; border-top:1px solid var(--border); margin:1.5em 0; }
.pv-content strong, .stotra-read strong, .dev-read strong,
.pv-content b, .stotra-read b, .dev-read b { font-weight:700; }


/* —— WordPress-style content editor —— */
.wp-editor-wrap {
  border: 1px solid #3d3d4a;
  border-radius: 4px;
  background: #1e1e24;
  margin: 0 0 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.wp-editor-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px 0;
  background: #25252e;
  border-bottom: 1px solid #3d3d4a;
  flex-wrap: wrap;
  gap: 8px;
}
.wp-editor-tools-left { display: flex; gap: 0; }
.wp-switch-editor {
  border: 1px solid #3d3d4a;
  border-bottom: none;
  background: #1e1e24;
  color: #a1a1aa;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-right: 4px;
}
.wp-switch-editor.is-active {
  background: #2a2a35;
  color: #f4f4f5;
  font-weight: 600;
}
.wp-media-btn { cursor: pointer; display: inline-flex; }
.wp-media-btn .btn { font-size: 13px; }
.wp-editor-container { background: #fff; }
.wp-toolbar, .mce-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  padding: 6px 8px;
  background: #f0f0f1;
  border-bottom: 1px solid #c3c4c7;
}
.wp-toolbar button, .mce-toolbar button {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #1d2327;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}
.wp-toolbar button:hover, .mce-toolbar button:hover {
  background: #fff;
  border-color: #c3c4c7;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.wp-toolbar select, .mce-toolbar select {
  height: 30px;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  background: #fff;
  color: #1d2327;
  font-size: 13px;
  padding: 0 6px;
  max-width: 130px;
}
.mce-sep {
  width: 1px;
  height: 20px;
  background: #c3c4c7;
  margin: 0 4px;
}
.wp-editor-area.wp-edit-visual {
  min-height: 320px;
  max-height: 560px;
  overflow-y: auto;
  padding: 16px 20px;
  background: #fff;
  color: #1d2327;
  font-size: 15px;
  line-height: 1.7;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
.wp-editor-area.wp-edit-visual:empty:before {
  content: attr(data-placeholder);
  color: #8c8f94;
  pointer-events: none;
}
.wp-editor-area.wp-edit-code {
  display: none;
  width: 100%;
  min-height: 320px;
  max-height: 560px;
  padding: 14px 16px;
  border: none;
  resize: vertical;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.5;
  background: #1d2327;
  color: #f0f0f1;
  box-sizing: border-box;
}
.wp-editor-wrap.mode-code .wp-edit-visual { display: none; }
.wp-editor-wrap.mode-code .wp-edit-code { display: block; }
.wp-editor-wrap.mode-code .wp-toolbar { opacity: .45; pointer-events: none; }
.wp-editor-statusbar {
  display: flex;
  justify-content: space-between;
  padding: 4px 12px;
  background: #f0f0f1;
  border-top: 1px solid #c3c4c7;
  font-size: 12px;
  color: #646970;
}
.wp-edit-visual img { max-width: 100%; height: auto; }
.wp-edit-visual p { margin: 0 0 1em; }
.wp-edit-visual h1 { font-size: 2em; margin: .67em 0; }
.wp-edit-visual h2 { font-size: 1.5em; margin: .75em 0; }
.wp-edit-visual h3 { font-size: 1.17em; margin: .83em 0; }
.wp-edit-visual blockquote {
  border-left: 4px solid #8b5cf6;
  margin: 1em 0;
  padding: .5em 1em;
  color: #50575e;
  background: #f6f7f7;
}
/* Dark admin shell: keep editor canvas light like WordPress */
body .wp-editor-wrap .wp-editor-container { background: #fff; }

img.stotra-image{max-width:100%;height:auto;border-radius:10px;margin:1em 0;display:block}

/* v3.2.0 polish */
.content{padding:16px}
.stat-card,.card,.dash-storage,.dash-recent{border-radius:14px}
.stat-card:hover{transform:translateY(-2px)}
*::-webkit-scrollbar{width:10px;height:10px}
*::-webkit-scrollbar-thumb{background:rgba(139,92,246,.35);border-radius:999px}
*::-webkit-scrollbar-track{background:rgba(0,0,0,.2)}
table thead th{position:sticky;top:0;z-index:1;background:rgba(17,24,39,.95)}
.topbar-search{position:relative;}
.pv-search-results{position:absolute;right:0;top:110%;width:min(360px,90vw);max-height:360px;overflow:auto;background:#111827;border:1px solid #374151;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.45);z-index:50;padding:8px}
.pv-s-h{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#9CA3AF;padding:6px 10px}
.pv-s-item{display:block;padding:8px 10px;color:#F9FAFB;text-decoration:none;border-radius:8px;font-size:13px}
.pv-s-item:hover{background:rgba(139,92,246,.15)}
.pv-s-empty{padding:16px;color:#9CA3AF;text-align:center;font-size:13px}
.skeleton{background:linear-gradient(90deg,rgba(255,255,255,.04),rgba(255,255,255,.08),rgba(255,255,255,.04));background-size:200% 100%;animation:sk 1.2s infinite;border-radius:8px;min-height:14px}
@keyframes sk{0%{background-position:200% 0}100%{background-position:-200% 0}}
img[loading="lazy"]{background:rgba(255,255,255,.03)}


/* v3.3.8 — toast-only success; never hide page content */
body > .alert.alert-success,
body .content > .alert.alert-success {
  display: none !important;
}
.main, .content, .page-content {
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 120px;
}



/* ===== v3.3.10 content visibility lock ===== */
body { visibility: visible !important; opacity: 1 !important; }
.main, .main .content, .content, .page-content {
  visibility: visible !important;
  opacity: 1 !important;
}
@media (min-width: 769px) {
  .main {
    margin-left: var(--sidebar-w) !important;
    width: auto !important;
    max-width: none !important;
  }
}
@media (max-width: 768px) {
  .main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}


/* ===== v3.4.4 admin responsive (Identity, Storage, tables) ===== */
.admin-stats,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.admin-card-grid,
.id-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .admin-card-grid,
  .id-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1200px) {
  .admin-card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}
table.compact { min-width: 560px; }
@media (max-width: 767px) { table.compact.resp-cards { min-width: 0 !important; } }
table.compact th,
table.compact td {
  white-space: nowrap;
  vertical-align: top;
}
table.compact td.wrap,
table.compact .cell-wrap {
  white-space: normal;
  min-width: 120px;
  max-width: 220px;
  word-break: break-word;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.inline-form input,
.inline-form select {
  min-height: 36px;
  max-width: 100%;
  box-sizing: border-box;
}
.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  min-width: 140px;
}
.actions-stack .btn { width: 100%; justify-content: center; }

/* Mobile: clean card rows (no striped half-backgrounds) */
@media (max-width: 767px) {
  .table-wrap {
    border: none !important;
    overflow: visible !important;
    background: transparent !important;
  }
  .table-wrap.dashboard-activity-wrap {
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
  }
  table.resp-cards,
  table.compact.resp-cards {
    min-width: 0 !important;
    width: 100% !important;
    border: 0 !important;
    background: transparent !important;
  }
  table.resp-cards thead { display: none !important; }
  table.resp-cards tbody {
    display: block !important;
    width: 100% !important;
    background: transparent !important;
  }
  table.resp-cards tr {
    display: block !important;
    width: 100% !important;
    background: var(--card, #ffffff) !important;
    color: var(--text, #111827) !important;
    border: 1px solid var(--border, rgba(15,23,42,0.12)) !important;
    border-radius: 14px !important;
    margin: 0 0 12px 0 !important;
    padding: 12px 14px !important;
    box-shadow: none !important;
  }
  table.resp-cards tr:nth-child(odd),
  table.resp-cards tr:nth-child(even) {
    background: var(--card, #ffffff) !important;
  }
  table.resp-cards td {
    display: grid !important;
    grid-template-columns: 96px 1fr !important;
    gap: 8px !important;
    align-items: start !important;
    width: 100% !important;
    border: none !important;
    border-bottom: 1px solid var(--border, rgba(15,23,42,0.08)) !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    background: transparent !important;
    white-space: normal !important;
    text-align: left !important;
    font-size: 13px !important;
    color: var(--text, #111827) !important;
  }
  table.resp-cards td:last-child {
    border-bottom: none !important;
  }
  table.resp-cards td::before {
    content: attr(data-label);
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--muted, #6b7280) !important;
    line-height: 1.4 !important;
    padding-top: 2px !important;
  }
  table.resp-cards td.actions-cell {
    display: block !important;
    border-top: 1px solid var(--border, rgba(15,23,42,0.1)) !important;
    border-bottom: none !important;
    padding-top: 12px !important;
    margin-top: 4px !important;
  }
  table.resp-cards td.actions-cell::before { display: none !important; content: none !important; }
  table.resp-cards td[colspan] {
    display: block !important;
    grid-template-columns: 1fr !important;
    text-align: center !important;
    color: var(--muted, #6b7280) !important;
  }
  table.resp-cards td[colspan]::before { display: none !important; }
  .actions-stack { min-width: 0; width: 100%; }
  .inline-form { width: 100%; }
  .inline-form input,
  .inline-form select { flex: 1 1 120px; max-width: none !important; min-width: 0; }
  .content { padding: 12px !important; }
  .glass-card { padding: 14px !important; }
  .form-row { display: grid !important; grid-template-columns: 1fr !important; gap: 10px !important; }
  .btn { min-height: 44px; }
  /* kill global table cell striping / borders */
  table.resp-cards td,
  table.resp-cards th {
    background-image: none !important;
    box-shadow: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .content { padding: 16px 18px; }
  table.compact { min-width: 640px; }
  .actions-stack { min-width: 160px; }
}

/* v3.4.6 — mobile header 2-row, no overflow */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 8px;
  }
  .topbar-row-main {
    width: 100%;
    max-width: 100%;
  }
  .topbar-row-tools {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .topbar-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    width: auto;
  }
  .topbar-title {
    font-size: 16px;
  }
  .menu-toggle { display: inline-flex !important; }
  .topbar-storage { display: none; }
}
@media (max-width: 480px) {
  .topbar { padding: 8px 10px; gap: 6px; }
  .topbar-title { font-size: 15px; }
  .topbar-search .pv-global-search { height: 40px; font-size: 14px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .topbar-search { max-width: 180px; }
}
@media (min-width: 1025px) {
  .topbar-search { max-width: 260px; width: 260px; flex: 0 0 260px; }
}

[data-theme="light"] body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 10% -10%, rgba(124, 58, 237, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(59, 130, 246, 0.05), transparent 45%);
}
[data-theme="light"] .sidebar {
  background: var(--sidebar);
  border-right-color: var(--border);
}
[data-theme="light"] .glass-card,
[data-theme="light"] .stat-card {
  background: var(--card);
  border-color: var(--border);
}
[data-theme="light"] .topbar {
  background: var(--topbar-bg);
}
[data-theme="light"] a {
  color: #5b21b6;
}
[data-theme="light"] a:hover {
  color: #4c1d95;
}
[data-theme="light"] .btn-danger {
  color: #991b1b !important;
}
[data-theme="light"] .alert-error {
  background: rgba(185, 28, 28, 0.08);
  border-color: rgba(185, 28, 28, 0.25);
  color: #991b1b;
}
[data-theme="light"] .alert-success {
  background: rgba(4, 120, 87, 0.08);
  border-color: rgba(4, 120, 87, 0.25);
  color: #065f46;
}

/* v3.4.6 form theme */
.form-group input, .form-group select, .form-group textarea,
input[type="text"], input[type="search"], input[type="password"],
input[type="number"], select, textarea {
  background: var(--input-bg, rgba(0,0,0,0.28));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 42px;
  max-width: 100%;
  box-sizing: border-box;
}
.btn { min-height: 42px; border-radius: var(--radius-sm); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
}

/* v3.4.7 accessibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Stotra / Devotional — preserve source newlines on display */
.stotra-content,
.devotional-content,
.stotra-read,
.pv-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
}

/* Stotra / Devotional — plain text newlines */
.stotra-content,
.devotional-content,
.stotra-read,
.dev-read,
.pv-content {
  line-height: 1.9;
  word-break: break-word;
  white-space: pre-wrap;
}


/* Ensure Meditation toggle is clickable and styled */
button.nav-group-toggle.nav-item {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  pointer-events: auto !important;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.nav-group-toggle.nav-item:hover {
  background: rgba(139, 92, 246, 0.1);
}
.nav-group.open > .nav-sub {
  display: flex !important;
  visibility: visible !important;
  max-height: 500px !important;
  opacity: 1 !important;
}
.nav-group:not(.open) > .nav-sub {
  display: none !important;
  visibility: hidden !important;
  max-height: 0 !important;
  overflow: hidden !important;
}

body.public-page {
  display: block;
}
.public-page .public-topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 20px;
  box-sizing: border-box;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
}
.public-page .public-brand { flex: 0 0 auto; font-size: 16px; font-weight: 700; }
.public-page .public-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.public-page .public-nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  white-space: nowrap;
}
.public-page .public-nav-links a:hover,
.public-page .public-nav-links a.active { color: var(--text); background: var(--accent-light); }
.public-page .public-nav-tools { flex: 0 0 auto; }
.public-page .main { width: 100%; max-width: 100%; margin-left: 0 !important; }
.public-page .topbar { position: relative; top: auto; }
.public-page .topbar-row-tools,
.public-page .menu-toggle { display: none !important; }
.public-page .japa-counter-screen { transform: none; }

@media (max-width: 700px) {
  .public-page .public-topnav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 8px 12px;
  }
  .public-page .public-nav-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .public-page .public-nav-tools { grid-column: 2; grid-row: 1; }
}

/* v5.1.33 — Admin light-theme contrast polish */
[data-theme="light"] .sidebar {
  background: #ffffff !important;
  border-right-color: #e5e7eb !important;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.06) !important;
}

[data-theme="light"] .sidebar .nav-item {
  color: #4b5563 !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

[data-theme="light"] .sidebar .nav-item:hover {
  color: #5b21b6 !important;
  background: #f5f3ff !important;
  border-color: #e9d5ff !important;
}

[data-theme="light"] .sidebar .nav-item.active,
[data-theme="light"] .sidebar .nav-group-toggle.active,
[data-theme="light"] .sidebar .nav-group.open > .nav-group-toggle {
  color: #5b21b6 !important;
  background: linear-gradient(135deg, #f0eaff 0%, #e9ddff 100%) !important;
  border-color: #c4b5fd !important;
  box-shadow: inset 3px 0 0 #7c3aed, 0 1px 2px rgba(91, 33, 182, 0.06) !important;
  font-weight: 700 !important;
}

[data-theme="light"] .sidebar .nav-item.active .icon,
[data-theme="light"] .sidebar .nav-group-toggle.active .icon {
  color: #6d28d9 !important;
  opacity: 1 !important;
}

[data-theme="light"] .sidebar .nav-sub-item.active {
  color: #6d28d9 !important;
  background: #f5f3ff !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

[data-theme="light"] .sidebar-footer {
  background: #f8f7fb !important;
  border-top-color: #e5e7eb !important;
  color: #6b7280 !important;
}

[data-theme="light"] .sidebar-footer .user-name {
  color: #111827 !important;
}

[data-theme="light"] .sidebar-footer a,
[data-theme="light"] .sidebar-footer .btn {
  color: #374151 !important;
}

[data-theme="light"] .topbar-search .pv-global-search,
[data-theme="light"] input.pv-global-search {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: #d1d5db !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .topbar-search .pv-global-search::placeholder,
[data-theme="light"] input.pv-global-search::placeholder {
  color: var(--muted, #6b7280) !important;
}

[data-theme="light"] .topbar-search .pv-global-search:focus,
[data-theme="light"] input.pv-global-search:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14) !important;
}

[data-theme="light"] .topbar-lang .pv-lang-switch button,
[data-theme="light"] .topbar-lang .pv-lang-switch a {
  color: #4b5563 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
}

[data-theme="light"] .topbar-lang .pv-lang-switch button:hover,
[data-theme="light"] .topbar-lang .pv-lang-switch a:hover {
  color: #5b21b6 !important;
  background: #f5f3ff !important;
  border-color: #e9d5ff !important;
}

[data-theme="light"] .topbar-lang .pv-lang-switch .active,
[data-theme="light"] .topbar-lang .pv-lang-switch button.active,
[data-theme="light"] .topbar-lang .pv-lang-switch a.active {
  color: #6d28d9 !important;
  background: #f0eaff !important;
  border-color: #ddd6fe !important;
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="search"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="datetime-local"],
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: #d1d5db !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: var(--muted, #6b7280) !important;
}

/* ===== Messages light-theme readability fix v5.1.33 ===== */
[data-theme="light"] .msg-item {
  color: #111827;
  background: #ffffff;
  border-bottom-color: #e5e7eb;
}

[data-theme="light"] .msg-item:hover {
  background: #f8f7ff !important;
}

[data-theme="light"] .msg-item.unread {
  background: #f5f3ff !important;
}

[data-theme="light"] .msg-item .msg-subject,
[data-theme="light"] .msg-item .msg-subject a {
  color: #4c1d95 !important;
  font-weight: 650;
}

[data-theme="light"] .msg-item .msg-subject a:hover {
  color: #6d28d9 !important;
  text-decoration: underline;
}

[data-theme="light"] .msg-item .msg-meta,
[data-theme="light"] .msg-item .msg-meta a {
  color: #4b5563 !important;
}

[data-theme="light"] .msg-item .msg-meta a:hover {
  color: #6d28d9 !important;
}

[data-theme="light"] .msg-item .msg-date,
[data-theme="light"] .msg-item time {
  color: #374151 !important;
  font-weight: 600;
}

[data-theme="light"] .msg-item .msg-preview,
[data-theme="light"] .msg-item .preview {
  color: #6b7280 !important;
}

[data-theme="light"] .message-toolbar,
[data-theme="light"] .messages-toolbar {
  color: #374151;
}

[data-theme="light"] .message-toolbar input,
[data-theme="light"] .messages-toolbar input,
[data-theme="light"] .message-search input {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: #d1d5db !important;
}

[data-theme="light"] .message-toolbar input::placeholder,
[data-theme="light"] .messages-toolbar input::placeholder,
[data-theme="light"] .message-search input::placeholder {
  color: #6b7280 !important;
}


/* v5.1.34 — Public light-theme contrast + readability polish */
[data-theme="light"] body,
[data-theme="light"] .main,
[data-theme="light"] .content,
[data-theme="light"] .public-page {
  color: var(--text) !important;
  background: var(--bg) !important;
}
[data-theme="light"] .card,
[data-theme="light"] .panel,
[data-theme="light"] .box,
[data-theme="light"] .modal,
[data-theme="light"] .table-wrap,
[data-theme="light"] .list-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .empty-state {
  color: var(--text) !important;
  background: var(--card) !important;
  border-color: var(--border) !important;
}
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  color: #111827 !important;
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}
[data-theme="light"] label,
[data-theme="light"] th,
[data-theme="light"] .form-label,
[data-theme="light"] .field-label {
  color: #1f2937 !important;
}
[data-theme="light"] small,
[data-theme="light"] .muted,
[data-theme="light"] .text-muted,
[data-theme="light"] .hint,
[data-theme="light"] .help-text {
  color: #64748b !important;
}
[data-theme="light"] table td,
[data-theme="light"] table th {
  color: #1f2937 !important;
  border-color: #e2e8f0 !important;
}
[data-theme="light"] .btn-ghost,
[data-theme="light"] button:not(.btn-primary) {
  color: #334155 !important;
}
[data-theme="light"] .btn-ghost:hover,
[data-theme="light"] button:not(.btn-primary):hover {
  color: #5b21b6 !important;
}
[data-theme="light"] .alert-success { color: #166534 !important; background: #f0fdf4 !important; border-color: #bbf7d0 !important; }
[data-theme="light"] .alert-error { color: #991b1b !important; background: #fef2f2 !important; border-color: #fecaca !important; }
[data-theme="light"] .alert-info { color: #3730a3 !important; background: #eef2ff !important; border-color: #c7d2fe !important; }
[data-theme="light"] .alert-warning { color: #92400e !important; background: #fffbeb !important; border-color: #fde68a !important; }
[data-theme="light"] .public-page .public-nav-links a {
  color: #64748b !important;
}
[data-theme="light"] .public-page .public-nav-links a:hover,
[data-theme="light"] .public-page .public-nav-links a.active {
  color: #4c1d95 !important;
  background: #f3e8ff !important;
}
[data-theme="light"] .public-page .public-brand a {
  color: #5b21b6 !important;
}


/* v5.1.41 public navigation consistency */
/* Keep public practice pages visually consistent with the Stotra/Devotional sidebar. */
.public-page .sidebar .nav-item { transition: background .18s ease, color .18s ease, transform .18s ease; }
.public-page .sidebar .nav-item:hover { transform: translateX(1px); }
.public-page .sidebar .nav-item.active { box-shadow: 0 0 0 1px rgba(139,92,246,.18), 0 6px 18px rgba(0,0,0,.14); }
.sl-tool-card { filter: saturate(1.06); }
.sl-tool-card:hover { transform: translateY(-2px); }

.pv-audio-block audio{display:block;min-height:40px}.pv-audio-block{box-sizing:border-box}.pv-audio-lang{min-width:82px}

/* v5.1.51 CSS FINAL POLISH — shared visual layer */
:root {
  --focus-ring: 0 0 0 3px rgba(124,58,237,.16);
  --shadow-soft: 0 6px 20px rgba(15,23,42,.07);
}

body { text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; }
button, .btn, .nav-item, .nav-group-toggle, .theme-toggle-btn, a { -webkit-tap-highlight-color: transparent; }

/* Consistent focus accessibility */
:where(a,button,input,select,textarea,[tabindex]):focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring) !important;
}

/* Cards / panels */
.card, .panel, .box, .stat-card, .list-card, .table-wrap, .glass-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card, .panel, .box, .stat-card, .list-card, .table-wrap { box-shadow: var(--shadow-card); }
.card:hover, .stat-card:hover, .list-card:hover { border-color: var(--border-strong); }

/* Buttons */
.btn, button:not(.nav-group-toggle) {
  min-height: 40px;
  border-radius: 10px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover, button:not(.nav-group-toggle):hover { transform: translateY(-1px); }
.btn:active, button:not(.nav-group-toggle):active { transform: translateY(0); }

/* Form controls */
input, select, textarea {
  min-height: 42px;
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height: 100px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: var(--focus-ring) !important;
  outline: 0;
}

/* Sidebar refinement */
.sidebar { box-shadow: 10px 0 28px rgba(0,0,0,.10); }
.nav-item, .nav-group-toggle { min-height: 42px; }
.nav-item.active { font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }

/* Topbar */
.topbar, .topbar-row {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Dashboard/stat emphasis */
.stat-card .stat-value, .stat-card .value { letter-spacing: -.025em; }

/* Tables */
table { border-collapse: separate; border-spacing: 0; }
table thead th:first-child { border-top-left-radius: 8px; }
table thead th:last-child { border-top-right-radius: 8px; }
tbody tr:last-child td:first-child { border-bottom-left-radius: 8px; }
tbody tr:last-child td:last-child { border-bottom-right-radius: 8px; }

/* Alerts / status surfaces */
.alert, .notice, .flash, .toast { border-radius: 10px; }

/* Empty states */
.empty-state { padding: 32px 22px; border: 1px dashed var(--border-strong); }

/* Public landing / gateway */
.public-page .sl-tool-card,
.public-page .tool-card,
.public-page .practice-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.public-page .sl-tool-card:hover,
.public-page .tool-card:hover,
.public-page .practice-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15,23,42,.10);
  border-color: var(--border-strong);
}

/* Mobile spacing and touch targets */
@media (max-width: 768px) {
  :root { --radius: 12px; }
  .content { padding: 18px 14px !important; }
  .page-title { font-size: clamp(22px, 6vw, 30px); }
  .card, .panel, .box, .stat-card, .list-card { border-radius: 12px; }
  .btn, button, .nav-item, .nav-group-toggle { min-height: 44px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sidebar { box-shadow: 8px 0 24px rgba(0,0,0,.18); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* v5.1.51 CSS FINAL POLISH — shared visual layer */
:root { --focus-ring: 0 0 0 3px rgba(124,58,237,.16); --shadow-soft: 0 6px 20px rgba(15,23,42,.07); }
body { text-rendering: optimizeLegibility; }
button,input,select,textarea { font: inherit; }
button,.btn,.nav-item,.nav-group-toggle,.theme-toggle-btn,a { -webkit-tap-highlight-color: transparent; }
:where(a,button,input,select,textarea,[tabindex]):focus-visible { outline:0; box-shadow:var(--focus-ring)!important; }
.card,.panel,.box,.stat-card,.list-card,.table-wrap,.glass-card { border:1px solid var(--border); border-radius:var(--radius); }
.card,.panel,.box,.stat-card,.list-card,.table-wrap { box-shadow:var(--shadow-card); }
.card:hover,.stat-card:hover,.list-card:hover { border-color:var(--border-strong); }
.btn,button:not(.nav-group-toggle) { min-height:40px; border-radius:10px; transition:transform .15s ease,box-shadow .15s ease,background .15s ease,border-color .15s ease; }
.btn:hover,button:not(.nav-group-toggle):hover { transform:translateY(-1px); }
.btn:active,button:not(.nav-group-toggle):active { transform:translateY(0); }
input,select,textarea { min-height:42px; border-radius:10px; transition:border-color .15s ease,box-shadow .15s ease,background .15s ease; }
textarea { min-height:100px; }
input:focus,select:focus,textarea:focus { border-color:var(--accent)!important; box-shadow:var(--focus-ring)!important; outline:0; }
.sidebar { box-shadow:10px 0 28px rgba(0,0,0,.10); }
.nav-item,.nav-group-toggle { min-height:42px; }
.nav-item.active { font-weight:650; box-shadow:inset 3px 0 0 var(--accent); }
.topbar,.topbar-row { backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); }
.stat-card .stat-value,.stat-card .value { letter-spacing:-.025em; }
table { border-collapse:separate; border-spacing:0; }
table thead th:first-child { border-top-left-radius:8px; }
table thead th:last-child { border-top-right-radius:8px; }
tbody tr:last-child td:first-child { border-bottom-left-radius:8px; }
tbody tr:last-child td:last-child { border-bottom-right-radius:8px; }
.alert,.notice,.flash,.toast { border-radius:10px; }
.empty-state { padding:32px 22px; border:1px dashed var(--border-strong); }
.public-page .sl-tool-card,.public-page .tool-card,.public-page .practice-card { border-radius:16px; border:1px solid var(--border); box-shadow:var(--shadow-soft); transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease; }
.public-page .sl-tool-card:hover,.public-page .tool-card:hover,.public-page .practice-card:hover { transform:translateY(-3px); box-shadow:0 14px 32px rgba(15,23,42,.10); border-color:var(--border-strong); }
@media (max-width:768px) { :root{--radius:12px;} .content{padding:18px 14px!important;} .page-title{font-size:clamp(22px,6vw,30px);} .card,.panel,.box,.stat-card,.list-card{border-radius:12px;} .btn,button,.nav-item,.nav-group-toggle{min-height:44px;} .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;} .sidebar{box-shadow:8px 0 24px rgba(0,0,0,.18);} }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;} }

/* v5.1.65 — Stotra / Devotional admin final responsive polish */
.nav-group.open > .nav-group-toggle {
  background: transparent !important;
  color: var(--muted) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}
.nav-group.open > .nav-group-toggle:hover {
  background: rgba(139,92,246,.08) !important;
  color: var(--text-strong) !important;
}
[data-theme="light"] .sidebar .nav-group.open > .nav-group-toggle {
  background: transparent !important;
  color: #4b5563 !important;
  border-color: transparent !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}
[data-theme="light"] .sidebar .nav-group.open > .nav-group-toggle:hover {
  background: #f5f3ff !important;
  color: #5b21b6 !important;
}

/* Content pages */
.content {
  width: 100%;
  max-width: 1480px;
  box-sizing: border-box;
}
.content > .glass-card {
  width: 100%;
  box-sizing: border-box;
}
.content input,
.content select,
.content textarea,
.content .wp-classic-wrap,
.content .tox-tinymce {
  max-width: 100%;
  box-sizing: border-box;
}

.sl-module-tabs,
.sl-admin-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  margin: 0 0 14px;
}
.sl-module-tab,
.sl-admin-tab {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}
.sl-module-tab:hover,
.sl-admin-tab:hover {
  border-color: var(--border-strong);
  background: rgba(139,92,246,.07);
}
.sl-module-tab.active,
.sl-admin-tab.active {
  color: #5b21b6;
  background: #f3e8ff;
  border-color: #c4b5fd;
  font-weight: 700;
}
[data-theme="dark"] .sl-module-tab.active,
[data-theme="dark"] .sl-admin-tab.active {
  color: #ede9fe;
  background: rgba(124,58,237,.18);
  border-color: rgba(167,139,250,.5);
}
.sl-tab-panels {
  width: 100%;
  min-width: 0;
}
.sl-admin-panel {
  width: 100%;
  min-width: 0;
  padding: 2px 0 0;
  box-sizing: border-box;
}
.sl-admin-panel[hidden] { display: none !important; }
.sl-language-heading {
  margin: 6px 0 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.sl-tab-help {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.sl-save-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Editor action row — Copy and Clear are intentional controls. */
.wp-editor-head{
  display:flex !important; align-items:center !important; justify-content:space-between !important;
  gap:10px !important; flex-wrap:wrap !important; width:100% !important; margin:0 0 9px !important;
  min-height:34px !important; position:relative !important; z-index:20 !important;
}
.wp-editor-head .field-hint{margin:0 !important; flex:1 1 260px !important; min-width:0 !important;}
.wp-editor-actions{
  display:flex !important; visibility:visible !important; opacity:1 !important; align-items:center !important;
  justify-content:flex-end !important; gap:8px !important; flex:0 0 auto !important; min-height:34px !important;
  position:relative !important; z-index:30 !important; overflow:visible !important;
}
.wp-editor-actions .wp-ed-copy,
.wp-editor-actions .wp-ed-clear{
  display:inline-flex !important; visibility:visible !important; opacity:1 !important;
  align-items:center !important; justify-content:center !important; width:auto !important; min-width:74px !important;
  height:34px !important; min-height:34px !important; padding:7px 13px !important;
  margin:0 !important; border:1px solid #8b5cf6 !important; border-radius:8px !important;
  background:#8b5cf6 !important; color:#fff !important; font-size:12px !important; font-weight:700 !important;
  line-height:1 !important; text-align:center !important; white-space:nowrap !important; cursor:pointer !important;
  box-shadow:0 2px 7px rgba(124,58,237,.18) !important; transform:none !important;
}
.wp-editor-actions .wp-ed-clear{background:#64748b !important; border-color:#64748b !important;}
.wp-editor-actions .wp-ed-copy:hover{background:#7c3aed !important; border-color:#7c3aed !important;}
.wp-editor-actions .wp-ed-clear:hover{background:#475569 !important; border-color:#475569 !important;}
.wp-editor-actions .wp-ed-copy:active,.wp-editor-actions .wp-ed-clear:active{transform:translateY(1px) !important;}
.wp-editor-actions .wp-ed-status{display:inline-flex !important; visibility:visible !important; min-width:48px !important; color:var(--muted,#64748b) !important; font-size:11px !important; font-weight:700 !important; align-items:center !important;}
[data-theme="dark"] .wp-editor-actions .wp-ed-copy{background:#8b5cf6 !important;color:#fff !important;}
[data-theme="dark"] .wp-editor-actions .wp-ed-clear{background:#64748b !important;color:#fff !important;}
@media(max-width:640px){
  .wp-editor-head{display:flex !important; flex-direction:column !important; align-items:stretch !important; gap:7px !important;}
  .wp-editor-actions{width:100% !important; justify-content:flex-start !important; flex-wrap:wrap !important;}
  .wp-editor-actions .wp-ed-copy,.wp-editor-actions .wp-ed-clear{min-width:82px !important;height:36px !important;min-height:36px !important;}
}

/* TinyMCE sizing */
.wp-classic-wrap { width: 100%; min-width: 0; }
.wp-classic-wrap .tox-tinymce { width: 100% !important; max-width: 100% !important; }
.wp-classic-wrap .tox-edit-area__iframe { max-width: 100%; }

/* Audio/media controls */
.featured-image-box { width: 100%; box-sizing: border-box; }
.featured-image-box .fi-preview { flex: 0 0 140px; }

/* Tables should scroll instead of breaking the page on narrow screens. */
.content .table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.content table { min-width: 640px; }

@media (max-width: 900px) {
  .content { max-width: 100%; padding: 18px 14px !important; }
  .sl-module-tabs,
  .sl-admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }
  .sl-module-tab,
  .sl-admin-tab { flex: 0 0 auto; }
}

@media (max-width: 680px) {
  .content { padding: 14px 10px !important; }
  .content > .glass-card { border-radius: 12px; }
  .sl-module-tabs,
  .sl-admin-tabs { gap: 6px; margin-bottom: 10px; }
  .sl-module-tab,
  .sl-admin-tab { min-height: 42px; padding: 8px 11px; font-size: 13px; }
  .sl-save-bar { position: sticky; bottom: 0; z-index: 20; margin-left: -10px; margin-right: -10px; padding: 10px; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(12px); }
  .sl-save-bar .btn { flex: 1 1 auto; }
  .bilingual-grid,
  .content [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .featured-image-box { flex-direction: column; }
  .featured-image-box .fi-preview { flex-basis: auto; width: 100% !important; max-width: 260px; }
  .content .btn { max-width: 100%; }
  .wp-classic-wrap .tox-tinymce { height: 330px !important; min-height: 280px !important; }
  .wp-classic-wrap .tox-toolbar__group { padding: 0 2px !important; }
  .wp-classic-wrap .tox .tox-toolbar__overflow { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .content { padding: 10px 8px !important; }
  .content > .glass-card { padding: 12px !important; }
  .sl-module-tab,
  .sl-admin-tab { font-size: 12px; }
  .sl-save-bar { margin-left: -8px; margin-right: -8px; }
  .wp-classic-wrap .tox-tinymce { height: 300px !important; }
}


/* v5.1.95: compact stacked rich editors; prevent TinyMCE autoresize from creating giant gaps */
.wp-classic-wrap { display:block !important; margin:0 0 22px !important; padding:0 !important; min-height:0 !important; height:auto !important; }
.wp-classic-wrap .wp-editor-head { margin-bottom:8px !important; }
.wp-classic-wrap .tox-tinymce { height:360px !important; min-height:300px !important; max-height:480px !important; margin:0 !important; }
.wp-classic-wrap .tox .tox-edit-area { overflow:auto !important; }
.wp-classic-wrap .tox .tox-edit-area iframe { height:100% !important; }
.wp-classic-wrap + .wp-classic-wrap { margin-top:18px !important; }
@media (max-width:680px) {
  .wp-classic-wrap { margin-bottom:18px !important; }
  .wp-classic-wrap .tox-tinymce { height:320px !important; min-height:280px !important; max-height:420px !important; }
}
@media (max-width:480px) {
  .wp-classic-wrap .tox-tinymce { height:300px !important; min-height:260px !important; max-height:380px !important; }
}
