/* styles.css — Liquid Glass Classic Theme (Zero CDN, Instant Boot) */
*, ::before, ::after { box-sizing: border-box; border: 0 solid rgba(255, 255, 255, 0.45); }
html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, sans-serif;
}
body {
  margin: 0;
  line-height: inherit;
  -webkit-tap-highlight-color: transparent;
  color: #1C1917;
  background-color: #F4F0E8;
  background-image:
    radial-gradient(at 85% 10%, rgba(201, 162, 77, 0.14) 0px, transparent 52%),
    radial-gradient(at 15% 88%, rgba(30, 58, 95, 0.08) 0px, transparent 52%),
    linear-gradient(180deg, #F8F5EE 0%, #F2EDE4 55%, #EBE4D8 100%);
}
.dark body {
  color: #F3EFE6;
  background-color: #0B0E14;
  background-image:
    radial-gradient(at 16% 8%, rgba(30, 58, 95, 0.30) 0px, transparent 52%),
    radial-gradient(at 86% 14%, rgba(201, 162, 77, 0.12) 0px, transparent 46%),
    linear-gradient(180deg, #090C12 0%, #0E121B 55%, #0A0D14 100%);
}

/* Classic Editorial Headings & Tabular Numerals */
h1, h2, h3, h4, p { margin: 0; }
#app-header-title, h1, h2 {
  font-family: 'New York', 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Amiri', 'Times New Roman', serif;
  letter-spacing: -0.01em;
}
.font-mono, .text-3xl {
  font-variant-numeric: tabular-nums;
}

button, input, select, textarea { font-family: inherit; font-size: 100%; color: inherit; margin: 0; padding: 0; }
button { background-color: transparent; background-image: none; cursor: pointer; touch-action: manipulation; transition: transform 0.14s ease, opacity 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease; }
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled, input:disabled, select:disabled { opacity: 0.52; cursor: not-allowed; }
svg { display: block; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Liquid Glass Floating Header */
header {
  background: rgba(252, 250, 245, 0.64) !important;
  -webkit-backdrop-filter: blur(10px) saturate(130%) !important;
  backdrop-filter: blur(10px) saturate(130%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 4px 22px rgba(28, 25, 23, 0.05), inset 0 -1px 0 rgba(30, 58, 95, 0.06);
}
.dark header {
  background: rgba(14, 18, 27, 0.64) !important;
  border-bottom: 1px solid rgba(255, 244, 222, 0.11) !important;
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.42), inset 0 -1px 0 rgba(201, 162, 77, 0.08);
}

/* Cards & Inputs (Clean semi-opaque surfaces without expensive per-card backdrop blur) */
.bg-white {
  background-color: rgba(255, 253, 249, 0.94);
  box-shadow:
    0 10px 28px rgba(28, 25, 23, 0.06),
    0 1px 2px rgba(28, 25, 23, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.dark .dark\:bg-slate-800 {
  background-color: rgba(22, 27, 38, 0.94);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 244, 222, 0.13);
}
input[type="text"], input[type="date"], input[type="number"], input[type="password"], select, textarea {
  transition: border-color 160ms, box-shadow 160ms;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(30, 58, 95, 0.55);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.14);
}
.dark input:focus, .dark select:focus, .dark textarea:focus {
  border-color: rgba(201, 162, 77, 0.65);
  box-shadow: 0 0 0 3px rgba(201, 162, 77, 0.16);
}

/* Layout & Positioning */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.inset-x-0 { left: 0; right: 0; }
.top-0 { top: 0; }
.-top-1 { top: -0.25rem; }
.bottom-0 { bottom: 0; }
.bottom-20 { bottom: 5.5rem; }
.left-1\/2 { left: 50%; }
.right-0 { right: 0; }
.z-10 { z-index: 10; }
.z-30 { z-index: 30; }
.z-50 { z-index: 50; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Flex & Grid */
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.gap-0\.5 { gap: 0.125rem; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }

/* Spacing */
.p-0\.5 { padding: 0.125rem; }
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pb-20 { padding-bottom: 6.25rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-2\.5 { margin-top: 0.625rem; margin-bottom: 0.625rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.mr-auto { margin-right: auto; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-2\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.625rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }

/* Sizing */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-7 { width: 1.75rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-48 { width: 12rem; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.max-w-sm { max-width: 24rem; }
.max-w-lg { max-width: 32rem; }
.max-w-\[90vw\] { max-width: 90vw; }
.h-2 { height: 0.5rem; }
.h-2\.5 { height: 0.625rem; }
.h-3 { height: 0.75rem; }
.h-3\.5 { height: 0.875rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-7 { height: 1.75rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-36 { height: 9rem; }
.h-40 { height: 10rem; }
.h-48 { height: 12rem; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.min-h-\[136px\] { min-height: 136px; }
.max-h-24 { max-height: 6rem; }
.max-h-\[460px\] { max-height: 460px; }

/* Typography */
.text-\[9px\] { font-size: 9px; line-height: 1.2; }
.text-\[10px\] { font-size: 10px; line-height: 1.3; }
.text-\[11px\] { font-size: 11px; line-height: 1.35; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.italic { font-style: italic; }
.line-through { text-decoration: line-through; }
.leading-none { line-height: 1; }
.leading-relaxed { line-height: 1.625; }
.tracking-wider { letter-spacing: 0.05em; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Colors: Text (Classic Ink, Oxford Navy & Antique Gold) */
.text-transparent { color: transparent; }
.text-white { color: #FFFFFF; }
.text-slate-100 { color: #F5F2EA; }
.text-slate-200 { color: #E7E1D5; }
.text-slate-400 { color: #8C857B; }
.text-slate-500 { color: #6B655C; }
.text-slate-600 { color: #4E4942; }
.text-slate-700 { color: #36322D; }
.text-slate-800 { color: #1C1917; }
.text-indigo-600 { color: #1E3A5F; }
.text-indigo-700 { color: #152A45; }
.text-emerald-600 { color: #1E7A5F; }
.text-sky-600 { color: #2E5B88; }
.text-amber-600 { color: #B28228; }
.text-amber-700 { color: #8F651A; }
.text-amber-800 { color: #714E12; }
.text-rose-500 { color: #C24554; }
.text-rose-600 { color: #A93242; }
.text-rose-700 { color: #8C2534; }
.text-rose-800 { color: #741D2A; }

/* Colors: Background (Classic Liquid Glass Surfaces) */
.bg-transparent { background-color: transparent; }
.bg-white\/90 { background-color: rgba(255, 253, 249, 0.76); }
.bg-white\/95 { background-color: rgba(255, 253, 249, 0.84); }
.bg-slate-50 { background-color: rgba(252, 249, 242, 0.62); }
.bg-slate-100 { background-color: rgba(242, 237, 227, 0.76); }
.bg-slate-200 { background-color: rgba(229, 222, 209, 0.82); }
.bg-slate-800 { background-color: rgba(28, 34, 46, 0.90); }
.bg-slate-900\/60 { background-color: rgba(12, 16, 24, 0.56); }
.bg-indigo-50 { background-color: rgba(30, 58, 95, 0.08); }
.bg-indigo-50\/70 { background-color: rgba(30, 58, 95, 0.06); }
.bg-indigo-500 { background-color: #2A4B76; }
.bg-indigo-600 {
  background: linear-gradient(135deg, #24456E, #162C49);
  box-shadow: 0 6px 18px rgba(22, 44, 73, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.bg-emerald-500 { background-color: #238365; }
.bg-emerald-600 {
  background: linear-gradient(135deg, #258768, #1A6850);
  box-shadow: 0 6px 18px rgba(26, 104, 80, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.bg-amber-100 { background-color: rgba(247, 236, 208, 0.82); }
.bg-amber-500 {
  background: linear-gradient(135deg, #C9A24D, #A87F2E);
  box-shadow: 0 6px 18px rgba(168, 127, 46, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.bg-rose-50 { background-color: rgba(250, 236, 238, 0.80); }
.bg-rose-100 { background-color: rgba(246, 222, 226, 0.84); }
.bg-rose-600 {
  background: linear-gradient(135deg, #BA3D4D, #962B3A);
  box-shadow: 0 6px 18px rgba(150, 43, 58, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-from, #1E3A5F), var(--tw-gradient-to, #C9A24D)); }
.from-indigo-600 { --tw-gradient-from: #1E3A5F; }
.to-sky-500 { --tw-gradient-to: #C9A24D; }

/* Borders & Dividers (Glass Specular Rims) */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-dashed { border-style: dashed; }
.border-slate-100 { border-color: rgba(255, 255, 255, 0.72); }
.border-slate-200 { border-color: rgba(255, 255, 255, 0.84); }
.border-slate-300 { border-color: rgba(186, 178, 164, 0.55); }
.border-slate-400 { border-color: #A0988B; }
.border-indigo-200 { border-color: rgba(30, 58, 95, 0.22); }
.border-emerald-500 { border-color: #238365; }
.border-amber-400 { border-color: #C9A24D; }
.border-rose-300 { border-color: rgba(186, 61, 77, 0.40); }
.border-rose-600 { border-color: #A93242; }
.divide-y > :not([hidden]) ~ :not([hidden]) { border-top-width: 1px; }
.divide-slate-100 > :not([hidden]) ~ :not([hidden]) { border-color: rgba(186, 178, 164, 0.28); }

/* Radius, Shadows, Effects & Transforms */
.rounded { border-radius: 0.4rem; }
.rounded-md { border-radius: 0.55rem; }
.rounded-lg { border-radius: 0.72rem; }
.rounded-xl { border-radius: 0.95rem; }
.rounded-2xl { border-radius: 1.45rem; }
.rounded-full { border-radius: 9999px; }
.shadow-sm { box-shadow: 0 8px 26px rgba(28, 25, 23, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.92); }
.shadow-lg { box-shadow: 0 14px 34px rgba(28, 25, 23, 0.12); }
.shadow-xl { box-shadow: 0 24px 48px rgba(28, 25, 23, 0.20); }
.drop-shadow-sm { filter: drop-shadow(0 2px 4px rgba(28, 25, 23, 0.14)); }
.backdrop-blur { -webkit-backdrop-filter: blur(12px) saturate(135%); backdrop-filter: blur(12px) saturate(135%); }
.backdrop-blur-xs { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.opacity-0 { opacity: 0; }
.cursor-pointer { cursor: pointer; }
.accent-indigo-600 { accent-color: #1E3A5F; }
.-rotate-90 { transform: rotate(-90deg); }
.-translate-x-1\/2 { transform: translateX(-50%); }
.transition { transition: transform 150ms ease, opacity 150ms ease, background-color 150ms ease, color 150ms ease; }
.transition-all { transition: transform 150ms ease, opacity 150ms ease, stroke-dashoffset 250ms ease; }
.transition-colors { transition: color 180ms, background-color 180ms, border-color 180ms; }
.transition-transform { transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1); }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.focus\:outline-none:focus { outline: none; }
.group:hover .group-hover\:-translate-y-1 { transform: translateY(-0.25rem); }

/* Hover States */
.hover\:bg-slate-50:hover { background-color: rgba(255, 253, 249, 0.85); }
.hover\:bg-slate-200:hover { background-color: rgba(226, 219, 206, 0.88); }
.hover\:bg-indigo-50:hover { background-color: rgba(30, 58, 95, 0.12); }
.hover\:bg-indigo-100:hover { background-color: rgba(30, 58, 95, 0.16); }
.hover\:bg-indigo-700:hover { filter: brightness(1.08); }
.hover\:bg-emerald-700:hover { filter: brightness(1.06); }
.hover\:bg-rose-200:hover { background-color: rgba(242, 208, 214, 0.9); }
.hover\:bg-rose-700:hover { filter: brightness(1.06); }
.hover\:text-rose-500:hover { color: #C24554; }
.hover\:text-slate-600:hover { color: #4E4942; }
.hover\:opacity-75:hover { opacity: 0.75; }

/* File Input Styling */
input[type="file"].file\:border-0::file-selector-button { border: 0; cursor: pointer; }
input[type="file"].file\:mr-3::file-selector-button { margin-right: 0.75rem; }
input[type="file"].file\:py-2::file-selector-button { padding-top: 0.5rem; padding-bottom: 0.5rem; }
input[type="file"].file\:px-3::file-selector-button { padding-left: 0.75rem; padding-right: 0.75rem; }
input[type="file"].file\:rounded-xl::file-selector-button { border-radius: 0.75rem; }
input[type="file"].file\:text-xs::file-selector-button { font-size: 0.75rem; }
input[type="file"].file\:font-bold::file-selector-button { font-weight: 700; }
input[type="file"].file\:bg-indigo-50::file-selector-button { background-color: rgba(30, 58, 95, 0.10); }
input[type="file"].file\:text-indigo-700::file-selector-button { color: #1E3A5F; }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Dark Mode — Smoked Obsidian & Champagne Gold Liquid Glass */
.dark .dark\:bg-slate-100 { background-color: rgba(243, 239, 230, 0.94); }
.dark .dark\:bg-slate-700 { background-color: rgba(38, 46, 62, 0.68); }
.dark .dark\:bg-slate-700\/60 { background-color: rgba(38, 46, 62, 0.52); }
.dark .dark\:bg-slate-800\/90 { background-color: rgba(18, 23, 34, 0.72); }
.dark .dark\:bg-slate-800\/95 { background-color: rgba(18, 23, 34, 0.80); }
.dark .dark\:bg-slate-900 { background-color: rgba(14, 18, 27, 0.66); }
.dark .dark\:bg-slate-900\/50 { background-color: rgba(14, 18, 27, 0.52); }
.dark .dark\:bg-slate-900\/60 { background-color: rgba(14, 18, 27, 0.62); }
.dark .dark\:bg-indigo-900\/20 { background-color: rgba(201, 162, 77, 0.10); }
.dark .dark\:bg-indigo-900\/30 { background-color: rgba(201, 162, 77, 0.15); }
.dark .dark\:bg-indigo-900\/40 { background-color: rgba(201, 162, 77, 0.20); }
.dark .dark\:bg-amber-900\/40 { background-color: rgba(146, 108, 36, 0.34); }
.dark .dark\:bg-rose-900\/30 { background-color: rgba(140, 37, 52, 0.30); }
.dark .dark\:bg-rose-900\/40 { background-color: rgba(140, 37, 52, 0.40); }
.dark .bg-indigo-600 {
  background: linear-gradient(135deg, #C9A24D, #A68032);
  color: #0E121B;
  box-shadow: 0 6px 20px rgba(201, 162, 77, 0.24), inset 0 1px 0 rgba(255, 250, 235, 0.38);
}
.dark .accent-indigo-600 { accent-color: #C9A24D; }
.dark .from-indigo-600 { --tw-gradient-from: #C9A24D; }
.dark .to-sky-500 { --tw-gradient-to: #E6CB88; }

.dark .dark\:text-white { color: #FFFFFF; }
.dark .dark\:text-slate-100 { color: #F3EFE6; }
.dark .dark\:text-slate-200 { color: #E2DCD0; }
.dark .dark\:text-slate-300 { color: #C4BDB0; }
.dark .dark\:text-slate-400 { color: #8E8A82; }
.dark .dark\:text-slate-700 { color: #3A4252; }
.dark .dark\:text-slate-900 { color: #0E121B; }
.dark .dark\:text-indigo-300 { color: #E5C87E; }
.dark .dark\:text-indigo-400 { color: #D4B263; }
.dark .dark\:text-emerald-400 { color: #48B590; }
.dark .dark\:text-sky-400 { color: #7EB2DC; }
.dark .dark\:text-amber-300 { color: #ECCF84; }
.dark .dark\:text-amber-400 { color: #D9B45B; }
.dark .dark\:text-rose-200 { color: #F5CCD2; }
.dark .dark\:text-rose-300 { color: #E89CA7; }

.dark .dark\:border-slate-600 { border-color: rgba(255, 244, 222, 0.16); }
.dark .dark\:border-slate-700 { border-color: rgba(255, 244, 222, 0.10); }
.dark .dark\:border-indigo-800 { border-color: rgba(201, 162, 77, 0.30); }
.dark .dark\:border-amber-500\/60 { border-color: rgba(201, 162, 77, 0.55); }
.dark .dark\:border-rose-700 { border-color: rgba(186, 61, 77, 0.45); }
.dark .dark\:divide-slate-700\/70 > :not([hidden]) ~ :not([hidden]) { border-color: rgba(255, 244, 222, 0.08); }

.dark .dark\:hover\:bg-slate-600:hover { background-color: rgba(54, 65, 86, 0.72); }
.dark .dark\:hover\:bg-slate-700\/40:hover { background-color: rgba(42, 51, 68, 0.50); }
.dark .dark\:hover\:bg-indigo-900\/40:hover { background-color: rgba(201, 162, 77, 0.22); }
.dark .dark\:hover\:bg-indigo-900\/50:hover { background-color: rgba(201, 162, 77, 0.28); }

.dark input[type="file"].dark\:file\:bg-indigo-900\/40::file-selector-button { background-color: rgba(201, 162, 77, 0.20); }
.dark input[type="file"].dark\:file\:text-indigo-300::file-selector-button { color: #E5C87E; }

/* RTL layout mirroring */
[dir="rtl"] .mr-auto { margin-right: 0; margin-left: auto; }
[dir="rtl"] .ml-1 { margin-left: 0; margin-right: 0.25rem; }
[dir="rtl"] .text-right { text-align: left; }

/* Animations */
@keyframes tabFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.tab-animate { animation: tabFadeIn 0.16s ease-out; }
@keyframes modalPopIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
#app-modal-backdrop:not(.hidden) > div { animation: modalPopIn 0.15s ease-out; }


/* === Enhanced Liquid Glass Classic Signature Details === */

/* 1. Sculpted Liquid Glass Card Sheen (Lightweight, Zero Blur Lag) */
.bg-white {
  background: linear-gradient(155deg, rgba(255, 254, 251, 0.92) 0%, rgba(250, 246, 238, 0.84) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow:
    0 8px 22px rgba(28, 25, 23, 0.06),
    inset 0 1.5px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(201, 162, 77, 0.12) !important;
}
.dark .dark\:bg-slate-800 {
  background: linear-gradient(155deg, rgba(30, 37, 52, 0.90) 0%, rgba(17, 22, 33, 0.86) 100%) !important;
  border: 1px solid rgba(255, 244, 222, 0.14);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.44),
    inset 0 1.5px 0 rgba(255, 246, 228, 0.16),
    inset 0 -1px 0 rgba(201, 162, 77, 0.10) !important;
}

/* 3. Circular Liquid Glass Focus Timer Medallion (Fast GPU-Free Sheen) */
.relative.w-48.h-48 {
  border-radius: 9999px;
  background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.96) 0%, rgba(247, 242, 232, 0.86) 65%, rgba(236, 229, 214, 0.82) 100%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 10px 24px rgba(28, 25, 23, 0.08),
    inset 0 2px 1px rgba(255, 255, 255, 1),
    inset 0 -6px 14px rgba(30, 58, 95, 0.05);
}
.dark .relative.w-48.h-48 {
  background: radial-gradient(circle at 30% 22%, rgba(42, 51, 70, 0.92) 0%, rgba(20, 25, 36, 0.90) 68%, rgba(13, 17, 26, 0.94) 100%);
  border: 1px solid rgba(255, 244, 222, 0.16);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.48),
    inset 0 2px 1px rgba(255, 244, 222, 0.18),
    inset 0 -6px 16px rgba(201, 162, 77, 0.08);
}
#focus-progress-ring {
  stroke-width: 7px;
}
#focus-clock-text {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}


/* === Global Cross-Device Alignment & Zero-Overflow Protection === */

/* Prevent any flex or grid child from pushing buttons outside the screen on iOS/Android */
.flex > *,
.grid > * {
  min-width: 0;
}

/* Keep native inputs & selects strictly inside their parent container */
input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="password"],
select,
textarea {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Fix iOS Safari native time/date picker overflow & enforce exact container width */
input[type="time"],
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: 2.5rem;
  overflow: hidden;
}
.items-end { align-items: flex-end; }

/* Normalize native iOS color picker so it aligns dead-level with inputs and buttons */
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  padding: 2px;
  flex-shrink: 0;
  vertical-align: middle;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 0.5rem;
}

/* Align all inline forms & action rows cleanly with uniform heights */
form.flex {
  align-items: center;
  max-width: 100%;
}
form.flex > input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
form.flex > select,
form.flex > button {
  min-height: 2.5rem;
  box-sizing: border-box;
  vertical-align: middle;
}
form.flex > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Keep modals safely within viewport with sticky header & footer */
#app-modal-backdrop > div {
  max-width: min(24rem, calc(100vw - 24px));
  max-height: min(88vh, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#app-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prevent accidental text selection & copying on tabs and app UI (keep inputs editable) */
html, body, header, nav, button, label, h1, h2, h3, h4, svg {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select, [contenteditable="true"], .allow-select {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Liquid Glass Floating Top Notification Toast */
#app-toast.glass-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-16px) scale(0.96);
  z-index: 90;
  min-width: 220px;
  max-width: min(92vw, 390px);
  padding: 10px 14px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px -8px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.06);
  color: #0f172a;
  opacity: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}
.dark #app-toast.glass-toast {
  background: rgba(17, 24, 39, 0.88);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 16px 38px -8px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.35);
  color: #f8fafc;
}
#app-toast.glass-toast.toast-visible {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}
.glass-toast-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.glass-toast-icon {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}
.glass-toast-msg {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}
.glass-toast-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  transform-origin: left center;
  animation: toastShrink 3s linear forwards;
}
[dir="rtl"] .glass-toast-bar {
  transform-origin: right center;
}
@keyframes toastShrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Book Slide-In & Golden Encyclopedia Shimmer */
@keyframes bookSlideIn {
  0% { opacity: 0; transform: translateY(-28px) scale(0.92); }
  70% { opacity: 1; transform: translateY(3px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes goldBookFlash {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); }
  40% { filter: drop-shadow(0 0 14px rgba(250, 204, 21, 0.95)); }
  70% { filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.65)); }
}
.book-slide-in {
  animation: bookSlideIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.book-gold-shimmer {
  animation: bookSlideIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both, goldBookFlash 1.8s ease-in-out 0.35s 2;
}

/* Zen Mode Fullscreen Focus */
.zen-only {
  display: none !important;
}
body.zen-mode-active header,
body.zen-mode-active .zen-hide {
  display: none !important;
}
body.zen-mode-active .zen-only {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 14px;
  z-index: 95;
}
body.zen-mode-active #app-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
body.zen-mode-active #tab-panel-focus {
  width: 100%;
}
body.zen-mode-active #focus-timer-card {
  padding: 2rem 1.5rem;
  border-radius: 28px;
}
body.zen-mode-active #focus-dial-container {
  transform: scale(1.16);
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Missing Utility Classes Required by New Cards (Heatmap, Peak Hours, Groups, Daily Recap) */
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-5 { padding: 1.25rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-3 { padding-top: 0.75rem; }
.pb-0\.5 { padding-bottom: 0.125rem; }
.pr-0\.5 { padding-right: 0.125rem; }
.mb-2\.5 { margin-bottom: 0.625rem; }
.mt-2\.5 { margin-top: 0.625rem; }
.-mx-2 { margin-left: -0.5rem; margin-right: -0.5rem; }
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.space-y-3\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.875rem; }
.w-6 { width: 1.5rem; }
.max-h-36 { max-height: 9rem; }
.max-w-\[60px\] { max-width: 60px; }
.top-5 { top: 1.25rem; }
.right-5 { right: 1.25rem; }
.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.1em; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-\[9px\] { font-size: 9px; line-height: 1.25; }
.text-\[10px\] { font-size: 10px; line-height: 1.3; }
.text-\[11px\] { font-size: 11px; line-height: 1.35; }
.bg-emerald-100 { background-color: rgba(16, 185, 129, 0.14); }
.bg-emerald-50\/50, .bg-emerald-50\/70 { background-color: rgba(16, 185, 129, 0.08); }
.bg-indigo-50\/50, .bg-indigo-50\/60, .bg-indigo-50\/70 { background-color: rgba(30, 58, 95, 0.07); }
.bg-amber-50\/70 { background-color: rgba(245, 158, 11, 0.10); }
.bg-slate-50\/50, .bg-slate-50\/60 { background-color: rgba(148, 163, 184, 0.08); }
.dark .dark\:bg-emerald-900\/20, .dark .dark\:bg-emerald-900\/30, .dark .dark\:bg-emerald-900\/40 { background-color: rgba(6, 78, 59, 0.35); }
.dark .dark\:bg-indigo-900\/20, .dark .dark\:bg-indigo-900\/30 { background-color: rgba(201, 162, 77, 0.14); }
.dark .dark\:bg-amber-900\/30 { background-color: rgba(120, 53, 15, 0.32); }
.dark .dark\:bg-slate-900\/40 { background-color: rgba(15, 23, 42, 0.45); }
.text-emerald-700 { color: #047857; }
.dark .dark\:text-emerald-300 { color: #6ee7b7; }
.border-emerald-400\/70 { border-color: rgba(52, 211, 153, 0.7); }
.border-emerald-200\/60 { border-color: rgba(167, 243, 208, 0.6); }
.border-indigo-400 { border-color: #2A4B76; }
.border-indigo-600 { border-color: #1E3A5F; }
.dark .border-indigo-600 { border-color: #C9A24D; }
.border-indigo-200\/60 { border-color: rgba(30, 58, 95, 0.22); }
.border-amber-200\/60 { border-color: rgba(253, 230, 138, 0.6); }
.border-white\/70 { border-color: rgba(255, 255, 255, 0.7); }
.from-emerald-500 { --tw-gradient-from: #10b981; }
.to-indigo-500 { --tw-gradient-to: #2A4B76; }

/* Classic Liquid Glass Palettes: Oxford Green & Burgundy Glass (Full Gradient & Surface Overrides) */
html[data-palette="oxford"] body {
  background-color: #EFF4EF;
  background-image:
    radial-gradient(at 84% 10%, rgba(27, 94, 67, 0.16) 0px, transparent 52%),
    radial-gradient(at 15% 88%, rgba(201, 162, 77, 0.16) 0px, transparent 52%),
    linear-gradient(180deg, #F4F8F4 0%, #EBF2EC 55%, #E0ECE2 100%);
}
html.dark[data-palette="oxford"] body {
  background-color: #07130E;
  background-image:
    radial-gradient(at 16% 8%, rgba(27, 94, 67, 0.42) 0px, transparent 52%),
    radial-gradient(at 86% 14%, rgba(201, 162, 77, 0.16) 0px, transparent 48%),
    linear-gradient(180deg, #06100C 0%, #0A1B14 55%, #07120D 100%);
}
html[data-palette="oxford"] .bg-indigo-600 {
  background: linear-gradient(135deg, #217352, #154C36) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(21, 76, 54, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}
html.dark[data-palette="oxford"] .bg-indigo-600 {
  background: linear-gradient(135deg, #2E8B63, #1D5E43) !important;
  color: #ffffff !important;
}
html[data-palette="oxford"] .text-indigo-600 { color: #1B5E43 !important; }
html.dark[data-palette="oxford"] .dark\:text-indigo-400 { color: #6EE7B7 !important; }
html[data-palette="oxford"] .bg-indigo-50 { background-color: rgba(27, 94, 67, 0.12) !important; }
html[data-palette="oxford"] .text-indigo-700 { color: #144933 !important; }
html.dark[data-palette="oxford"] .dark\:bg-slate-800 { background-color: rgba(13, 30, 23, 0.88) !important; }
html.dark[data-palette="oxford"] header { background: rgba(9, 22, 16, 0.72) !important; }

html[data-palette="burgundy"] body {
  background-color: #F8F1F2;
  background-image:
    radial-gradient(at 85% 10%, rgba(124, 35, 56, 0.15) 0px, transparent 52%),
    radial-gradient(at 15% 88%, rgba(201, 162, 77, 0.16) 0px, transparent 52%),
    linear-gradient(180deg, #FBF6F6 0%, #F5ECEE 55%, #EDE0E3 100%);
}
html.dark[data-palette="burgundy"] body {
  background-color: #14090D;
  background-image:
    radial-gradient(at 16% 8%, rgba(124, 35, 56, 0.44) 0px, transparent 52%),
    radial-gradient(at 86% 14%, rgba(201, 162, 77, 0.17) 0px, transparent 48%),
    linear-gradient(180deg, #11070B 0%, #1D0C13 55%, #13080C 100%);
}
html[data-palette="burgundy"] .bg-indigo-600 {
  background: linear-gradient(135deg, #8F2B43, #5E1A2B) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(94, 26, 43, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}
html.dark[data-palette="burgundy"] .bg-indigo-600 {
  background: linear-gradient(135deg, #A83853, #732035) !important;
  color: #ffffff !important;
}
html[data-palette="burgundy"] .text-indigo-600 { color: #7C2338 !important; }
html.dark[data-palette="burgundy"] .dark\:text-indigo-400 { color: #FDA4AF !important; }
html[data-palette="burgundy"] .bg-indigo-50 { background-color: rgba(124, 35, 56, 0.12) !important; }
html[data-palette="burgundy"] .text-indigo-700 { color: #631B2C !important; }
html.dark[data-palette="burgundy"] .dark\:bg-slate-800 { background-color: rgba(31, 14, 21, 0.88) !important; }
html.dark[data-palette="burgundy"] header { background: rgba(24, 10, 15, 0.72) !important; }

/* Turbo 60fps Mobile GPU Optimizations */
header {
  -webkit-backdrop-filter: blur(8px) saturate(120%) !important;
  backdrop-filter: blur(8px) saturate(120%) !important;
}
.bg-white, .dark .dark\:bg-slate-800 {
  contain: layout style;
}
.css-book-wrap {
  will-change: transform;
  transition: transform 0.16s ease;
}
.book-item:active .css-book-wrap {
  transform: translateY(-3px);
}

/* Slide-out Liquid Glass Navigation Drawer (v67) */
.pb-6 { padding-bottom: 1.5rem; }
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
body.drawer-open { overflow: hidden; }
html[dir="rtl"] .drawer-back-icon { transform: rotate(180deg); }

.app-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.app-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.app-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  width: 270px;
  max-width: 82vw;
  display: flex;
  flex-direction: column;
  background: rgba(255, 253, 249, 0.92);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-right: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 12px 0 34px rgba(15, 23, 42, 0.14);
  transform: translateX(-105%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html[dir="rtl"] .app-drawer {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: -12px 0 34px rgba(15, 23, 42, 0.14);
  transform: translateX(105%);
}
.app-drawer.is-open,
html[dir="rtl"] .app-drawer.is-open {
  transform: translateX(0);
}

.dark .app-drawer {
  background: rgba(16, 22, 34, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
html.dark[data-palette="oxford"] .app-drawer {
  background: rgba(11, 26, 20, 0.94);
}
html.dark[data-palette="burgundy"] .app-drawer {
  background: rgba(26, 11, 17, 0.94);
}

.app-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.app-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem 0.75rem;
}

.drawer-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  background: transparent;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
  text-align: start;
}
.dark .drawer-nav-item {
  color: #e2e8f0;
}
.drawer-nav-item:active {
  transform: scale(0.985);
}
.drawer-nav-icon {
  font-size: 1.15rem;
  line-height: 1;
  width: 1.6rem;
  text-align: center;
}
.drawer-nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: transparent;
}
.drawer-nav-item.is-active {
  background: rgba(30, 58, 95, 0.11);
  border-color: rgba(30, 58, 95, 0.24);
  color: #1E3A5F;
}
.dark .drawer-nav-item.is-active {
  background: rgba(201, 162, 77, 0.2);
  border-color: rgba(201, 162, 77, 0.34);
  color: #E5C87E;
}
.drawer-nav-item.is-active .drawer-nav-dot {
  background: currentColor;
}
html[data-palette="oxford"] .drawer-nav-item.is-active {
  background: rgba(27, 94, 67, 0.13);
  border-color: rgba(27, 94, 67, 0.28);
  color: #1B5E43;
}
html.dark[data-palette="oxford"] .drawer-nav-item.is-active {
  background: rgba(46, 139, 99, 0.22);
  color: #6EE7B7;
}
html[data-palette="burgundy"] .drawer-nav-item.is-active {
  background: rgba(124, 35, 56, 0.13);
  border-color: rgba(124, 35, 56, 0.28);
  color: #7C2338;
}
html.dark[data-palette="burgundy"] .drawer-nav-item.is-active {
  background: rgba(168, 56, 83, 0.24);
  color: #FDA4AF;
}

body.zen-mode-active #app-drawer-backdrop,
body.zen-mode-active #app-drawer {
  display: none !important;
}

/* v68 UI Polish: Missing Utilities, Logical RTL, File Input & Drawer Footer */
.border-transparent { border-color: transparent; }
.border-slate-200\/70 { border-color: rgba(226, 232, 240, 0.7); }
.dark .dark\:border-slate-700\/70 { border-color: rgba(51, 65, 85, 0.7); }
.dark .dark\:border-indigo-800\/50 { border-color: rgba(201, 162, 77, 0.34); }
.dark .dark\:border-emerald-800\/50 { border-color: rgba(6, 95, 70, 0.5); }
.dark .dark\:border-amber-800\/50 { border-color: rgba(146, 64, 14, 0.5); }
.font-semibold { font-weight: 600; }
.opacity-60 { opacity: 0.6; }
.opacity-85 { opacity: 0.85; }
.hover\:opacity-80:hover { opacity: 0.8; }
.hover\:opacity-85:hover { opacity: 0.85; }
.z-0 { z-index: 0; }
.max-h-\[65vh\] { max-height: 65vh; }
.me-auto { margin-inline-end: auto; }
.ms-1 { margin-inline-start: 0.25rem; }
.text-end { text-align: end; }

input[type="file"]::file-selector-button {
  margin-inline-end: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 0;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: rgba(30, 58, 95, 0.1);
  color: #1E3A5F;
  cursor: pointer;
}
.dark input[type="file"]::file-selector-button {
  background-color: rgba(201, 162, 77, 0.22);
  color: #E5C87E;
}

.app-drawer-nav {
  flex: 1 1 auto;
  overflow-y: auto;
}
.app-drawer-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.drawer-pref-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  background: rgba(148, 163, 184, 0.13);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: opacity 0.15s ease, transform 0.12s ease;
}
.dark .drawer-pref-btn {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}
.drawer-pref-btn:active {
  transform: scale(0.97);
}

/* v69 Study Hall YPT Desks & Sync Card Polish */
.hall-desk-card {
  padding: 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.72);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.dark .hall-desk-card {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.16);
}
.hall-desk-live {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.42);
}
.dark .hall-desk-live {
  background: rgba(6, 78, 59, 0.28);
  border-color: rgba(52, 211, 153, 0.4);
}
.hall-desk-paused {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.35);
}
.hall-avatar-ring {
  padding: 2px;
  border-radius: 9999px;
  border: 2px solid transparent;
  flex-shrink: 0;
}
.hall-avatar-ring.is-live {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}
.hall-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sync-recovery-details {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 0.5rem;
}
.sync-recovery-details summary {
  list-style: none;
}
.sync-recovery-details summary::-webkit-details-marker {
  display: none;
}
.tabular-nums { font-variant-numeric: tabular-nums; }
.h-1\.5 { height: 0.375rem; }
.bg-rose-50 { background-color: rgba(244, 63, 94, 0.08); }
.dark .dark\:bg-rose-900\/20 { background-color: rgba(136, 19, 55, 0.25); }
.dark .dark\:bg-slate-700\/70 { background-color: rgba(51, 65, 85, 0.7); }
.dark .dark\:bg-slate-900\/60 { background-color: rgba(15, 23, 42, 0.6); }

.items-baseline { align-items: baseline; }
.pb-1 { padding-bottom: 0.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.text-amber-500 { color: #f59e0b; }
.text-indigo-500 { color: #1E3A5F; }
.dark .text-indigo-500 { color: #C9A24D; }

/* v71 Modern UX Overhaul: iPad 2-Col Layout, Airy Focus Hero, Mobile Bottom Sheets */
.app-container {
  width: 100%;
  max-width: 32rem;
}
@media (min-width: 768px) {
  .app-container {
    max-width: 56rem;
  }
}
.focus-hero-wrap {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.focus-hero-stage {
  padding: 1rem 0.75rem 1.25rem;
  border-radius: 28px;
  background: rgba(255, 253, 249, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}
.dark .focus-hero-stage {
  background: rgba(15, 23, 42, 0.42);
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.focus-dial-lg {
  width: 14rem;
  height: 14rem;
}
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.max-w-\[160px\] { max-width: 160px; }
.max-w-xs { max-width: 20rem; }
.pointer-events-none { pointer-events: none; }
.opacity-0 { opacity: 0; }
.w-2\.5 { width: 0.625rem; }
.h-2\.5 { height: 0.625rem; }
.border-slate-200\/80 { border-color: rgba(226, 232, 240, 0.8); }
.bg-slate-100\/90 { background-color: rgba(241, 245, 249, 0.9); }
.bg-white\/90 { background-color: rgba(255, 255, 255, 0.9); }
.dark .dark\:bg-slate-800\/80 { background-color: rgba(30, 41, 59, 0.8); }
.dark .dark\:bg-slate-800\/90 { background-color: rgba(30, 41, 59, 0.9); }
.text-slate-200\/80 { color: rgba(226, 232, 240, 0.8); }

.settings-group-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #64748b;
  padding: 0.25rem 0.5rem 0;
}
.dark .settings-group-label {
  color: #94a3b8;
}

@keyframes modalSheetIn {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
#app-modal-backdrop:not(.hidden) > div {
  animation: modalSheetIn 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (max-width: 639px) {
  #app-modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  #app-modal-backdrop > div {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 86dvh !important;
    border-radius: 24px 24px 0 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* v72 Study Hall Upgrades: Vibes, Co-Study Glow, Shared Bookshelf & Deficit Badges */
.hall-vibe-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}
.hall-vibe-library {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.52), rgba(255, 253, 249, 0.88));
}
.dark .hall-vibe-library {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.34), rgba(30, 41, 59, 0.82));
}
.hall-vibe-cafe {
  background: linear-gradient(135deg, rgba(214, 211, 209, 0.45), rgba(245, 235, 224, 0.88));
}
.dark .hall-vibe-cafe {
  background: linear-gradient(135deg, rgba(68, 64, 60, 0.45), rgba(28, 25, 23, 0.85));
}
.hall-vibe-exam {
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.65), rgba(254, 226, 226, 0.45));
}
.dark .hall-vibe-exam {
  background: linear-gradient(135deg, rgba(49, 46, 129, 0.42), rgba(127, 29, 29, 0.3));
}
.hall-vibe-garden {
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.55), rgba(240, 253, 244, 0.88));
}
.dark .hall-vibe-garden {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.38), rgba(15, 23, 42, 0.85));
}

.hall-costudy-banner {
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(16, 185, 129, 0.16));
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.dark .hall-costudy-banner {
  color: #fcd34d;
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.3), rgba(6, 78, 59, 0.3));
}
.hall-desk-costudy {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.32), 0 6px 18px rgba(245, 158, 11, 0.14);
}

.hall-deficit-due {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(244, 63, 94, 0.12);
  color: #e11d48;
  white-space: nowrap;
}
.dark .hall-deficit-due {
  background: rgba(244, 63, 94, 0.22);
  color: #fda4af;
}
.hall-deficit-ok {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  white-space: nowrap;
}
.dark .hall-deficit-ok {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

.hall-mini-book {
  border-radius: 4px 4px 2px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  color: #ffffff;
  box-shadow: inset -3px 0 6px rgba(0, 0, 0, 0.22), inset 2px 0 3px rgba(255, 255, 255, 0.22), 0 2px 4px rgba(0, 0, 0, 0.15);
}
.hall-mini-book-init {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  opacity: 0.95;
}
.hall-mini-book-min {
  font-size: 8px;
  font-weight: 700;
  opacity: 0.85;
}
.hall-wood-plank {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(180deg, #c98a4b 0%, #925624 60%, #6b3b15 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.text-start { text-align: start; }
.bg-slate-50\/70 { background-color: rgba(248, 250, 252, 0.7); }
.bg-white\/80 { background-color: rgba(255, 255, 255, 0.8); }

/* v73 Personal Profile & Drawer Mini-Card */
.drawer-profile-card {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem;
  border-radius: 14px;
  transition: background-color 0.15s ease;
}
.drawer-profile-card:active,
.drawer-profile-card.is-active {
  background: rgba(30, 58, 95, 0.1);
}
.drawer-prof-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #ffffff;
  background: #1E3A5F;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.15);
}

.profile-hero-card {
  padding: 1.1rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 253, 249, 0.92), rgba(241, 245, 249, 0.8));
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.dark .profile-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.82));
  border-color: rgba(255, 255, 255, 0.1);
}
.profile-hero-avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.profile-badge-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: rgba(30, 58, 95, 0.08);
  border: 1px solid rgba(30, 58, 95, 0.22);
}
.dark .profile-badge-card {
  background: rgba(201, 162, 77, 0.14);
  border-color: rgba(201, 162, 77, 0.28);
}
.profile-badge-locked {
  opacity: 0.42;
  filter: grayscale(0.85);
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
}
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.scale-110 { transform: scale(1.1); }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }

/* v76 Missing Utility Classes Audit Fix */
.bg-white\/70 { background-color: rgba(255, 255, 255, 0.7); }
.dark .dark\:bg-slate-800\/70 { background-color: rgba(30, 41, 59, 0.7); }
.border-slate-200\/60 { border-color: rgba(226, 232, 240, 0.6); }
.dark .dark\:border-slate-700\/60 { border-color: rgba(51, 65, 85, 0.6); }
.border-slate-800 { border-color: #1e293b; }
.dark .dark\:border-white { border-color: #ffffff; }
.dark .dark\:text-rose-400 { color: #fb7185; }
.mb-5 { margin-bottom: 1.25rem; }
.pt-2\.5 { padding-top: 0.625rem; }
.shadow-md { box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14); }
.tracking-wide { letter-spacing: 0.025em; }

/* v83 Floating Glass Menu aligned flush with the ☰ button on iPhone & iPad */
.app-drawer {
  top: calc(env(safe-area-inset-top, 0px) + 62px);
  bottom: auto;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 78px);
  left: 16px;
  right: auto;
  width: 272px;
  max-width: calc(100vw - 32px);
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.11);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.97);
  transform-origin: top left;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}
html[dir="rtl"] .app-drawer {
  left: auto;
  right: 16px;
  border: 1px solid rgba(15, 23, 42, 0.11);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  transform: translateY(-10px) scale(0.97);
  transform-origin: top right;
}
.app-drawer.is-open,
html[dir="rtl"] .app-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
@media (min-width: 768px) {
  .app-drawer {
    left: max(16px, calc((100vw - 56rem) / 2 + 16px));
  }
  html[dir="rtl"] .app-drawer {
    left: auto;
    right: max(16px, calc((100vw - 56rem) / 2 + 16px));
  }
}

/* ==========================================================================
   v84 Top Profile Button, Embedded Settings Switcher, Floating Glass Bottom Tabs
   & Smooth Directional Tab Transitions
   ========================================================================== */

body.has-bottom-nav {
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}
body.zen-mode-active.has-bottom-nav {
  padding-bottom: 0;
}
body.zen-mode-active #app-bottom-nav {
  display: none !important;
}

/* 1. Top Header Profile Avatar Button */
.header-profile-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 2px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid rgba(148, 163, 184, 0.34);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}
.dark .header-profile-btn {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 244, 222, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.header-profile-btn:active {
  transform: scale(0.9);
}
.header-profile-btn.is-active {
  border-color: #1E3A5F;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.18), 0 4px 14px rgba(30, 58, 95, 0.22);
  transform: scale(1.06);
}
.dark .header-profile-btn.is-active {
  border-color: #C9A24D;
  box-shadow: 0 0 0 3px rgba(201, 162, 77, 0.25), 0 4px 16px rgba(201, 162, 77, 0.24);
}
html[data-palette="oxford"] .header-profile-btn.is-active {
  border-color: #1B5E43;
  box-shadow: 0 0 0 3px rgba(27, 94, 67, 0.2);
}
html[data-palette="burgundy"] .header-profile-btn.is-active {
  border-color: #7C2338;
  box-shadow: 0 0 0 3px rgba(124, 35, 56, 0.2);
}
.header-prof-avatar {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  color: #ffffff;
  background: #1E3A5F;
}

/* 2. Floating Liquid Glass Bottom Tab Bar */
.app-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 0 12px calc(10px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  display: flex;
  justify-content: center;
}
.bottom-nav-track {
  pointer-events: auto;
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 5px;
  border-radius: 26px;
  background: rgba(255, 253, 248, 0.86);
  -webkit-backdrop-filter: blur(12px) saturate(155%);
  backdrop-filter: blur(12px) saturate(155%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 14px 34px -6px rgba(15, 23, 42, 0.16),
    0 2px 8px rgba(15, 23, 42, 0.06),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.95);
}
.dark .bottom-nav-track {
  background: rgba(18, 24, 38, 0.86);
  border-color: rgba(255, 244, 222, 0.14);
  box-shadow:
    0 18px 40px -6px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 246, 228, 0.14);
}
html.dark[data-palette="oxford"] .bottom-nav-track {
  background: rgba(11, 27, 20, 0.88);
  border-color: rgba(167, 243, 208, 0.15);
}
html.dark[data-palette="burgundy"] .bottom-nav-track {
  background: rgba(28, 12, 18, 0.88);
  border-color: rgba(253, 164, 175, 0.15);
}

.bottom-nav-items {
  position: relative;
  z-index: 2;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: center;
  gap: 2px;
}

/* Sliding Active Glass Pill */
.bottom-nav-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  z-index: 1;
  border-radius: 21px;
  background: linear-gradient(145deg, rgba(30, 58, 95, 0.13), rgba(201, 162, 77, 0.14));
  border: 1px solid rgba(30, 58, 95, 0.14);
  box-shadow:
    0 4px 12px rgba(30, 58, 95, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  opacity: 0;
  will-change: transform, width;
  transition:
    transform 0.36s cubic-bezier(0.34, 1.32, 0.64, 1),
    width 0.32s cubic-bezier(0.34, 1.32, 0.64, 1),
    opacity 0.2s ease;
}
.dark .bottom-nav-indicator {
  background: linear-gradient(145deg, rgba(201, 162, 77, 0.22), rgba(201, 162, 77, 0.10));
  border-color: rgba(201, 162, 77, 0.30);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 244, 214, 0.18);
}
html[data-palette="oxford"] .bottom-nav-indicator {
  background: linear-gradient(145deg, rgba(27, 94, 67, 0.14), rgba(16, 185, 129, 0.10));
  border-color: rgba(27, 94, 67, 0.18);
}
html.dark[data-palette="oxford"] .bottom-nav-indicator {
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.20), rgba(16, 185, 129, 0.10));
  border-color: rgba(52, 211, 153, 0.28);
}
html[data-palette="burgundy"] .bottom-nav-indicator {
  background: linear-gradient(145deg, rgba(124, 35, 56, 0.14), rgba(225, 29, 72, 0.08));
  border-color: rgba(124, 35, 56, 0.18);
}
html.dark[data-palette="burgundy"] .bottom-nav-indicator {
  background: linear-gradient(145deg, rgba(251, 113, 133, 0.20), rgba(190, 18, 60, 0.12));
  border-color: rgba(251, 113, 133, 0.28);
}
.bottom-nav-indicator.no-transition,
.profile-subtabs-indicator.no-transition,
.seg-subtabs-indicator.no-transition {
  transition: none !important;
}

.bottom-nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 4px 6px;
  border-radius: 20px;
  color: #64748b;
  font-weight: 700;
  transition: color 0.22s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
}
.dark .bottom-nav-btn {
  color: #94a3b8;
}
.bottom-nav-btn:active {
  transform: scale(0.92);
}
.bottom-nav-btn.is-active {
  color: #1E3A5F;
}
.dark .bottom-nav-btn.is-active {
  color: #E5C87E;
}
html[data-palette="oxford"] .bottom-nav-btn.is-active {
  color: #1B5E43;
}
html.dark[data-palette="oxford"] .bottom-nav-btn.is-active {
  color: #6EE7B7;
}
html[data-palette="burgundy"] .bottom-nav-btn.is-active {
  color: #7C2338;
}
html.dark[data-palette="burgundy"] .bottom-nav-btn.is-active {
  color: #FDA4AF;
}

.bottom-nav-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -7px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 9999px;
  background: #e11d48;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(225, 29, 72, 0.4);
}
.bottom-nav-btn.is-active .bottom-nav-icon {
  transform: translateY(-1.5px) scale(1.08);
}
.bottom-nav-icon.is-popping {
  animation: tabIconPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bottom-nav-label {
  font-size: 10.5px;
  line-height: 1.15;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}

/* 3. Segmented Sub-Tab Switcher (shared across Profile, Library, Hall, Stats, Plan) */
.profile-subtabs,
.seg-subtabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--seg-cols, 2), minmax(0, 1fr));
  padding: 4px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.dark .profile-subtabs,
.dark .seg-subtabs {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 244, 222, 0.12);
}
.profile-subtabs-indicator,
.seg-subtabs-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  z-index: 1;
  border-radius: 14px;
  background: #1E3A5F;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
  opacity: 0;
  will-change: transform, width;
  transition:
    transform 0.34s cubic-bezier(0.34, 1.28, 0.64, 1),
    width 0.3s cubic-bezier(0.34, 1.28, 0.64, 1),
    opacity 0.18s ease;
}
.dark .profile-subtabs-indicator,
.dark .seg-subtabs-indicator {
  background: #C9A24D;
  box-shadow: 0 4px 14px rgba(201, 162, 77, 0.28);
}
html[data-palette="oxford"] .profile-subtabs-indicator,
html[data-palette="oxford"] .seg-subtabs-indicator {
  background: #1B5E43;
}
html.dark[data-palette="oxford"] .profile-subtabs-indicator,
html.dark[data-palette="oxford"] .seg-subtabs-indicator {
  background: #10B981;
}
html[data-palette="burgundy"] .profile-subtabs-indicator,
html[data-palette="burgundy"] .seg-subtabs-indicator {
  background: #7C2338;
}
html.dark[data-palette="burgundy"] .profile-subtabs-indicator,
html.dark[data-palette="burgundy"] .seg-subtabs-indicator {
  background: #E11D48;
}
.profile-subtab-btn,
.seg-subtab-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 8px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: color 0.22s ease, transform 0.16s ease;
}
.profile-subtab-btn > svg,
.seg-subtab-btn > svg {
  flex-shrink: 0;
}
.profile-subtab-btn > span,
.seg-subtab-btn > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
@media (max-width: 400px) {
  .profile-subtab-btn,
  .seg-subtab-btn {
    font-size: 10.5px;
    padding: 7px 5px;
    gap: 3px;
  }
}
.dark .profile-subtab-btn,
.dark .seg-subtab-btn {
  color: #cbd5e1;
}
.profile-subtab-btn:active,
.seg-subtab-btn:active {
  transform: scale(0.97);
}
.profile-subtab-btn.is-active,
.seg-subtab-btn.is-active {
  color: #ffffff;
}
.dark .profile-subtab-btn.is-active,
.dark .seg-subtab-btn.is-active {
  color: #090C12;
}

/* 4. Directional GPU-Accelerated Tab Transitions */
@keyframes tabIconPop {
  0%   { transform: translateY(0) scale(0.88); }
  55%  { transform: translateY(-4px) scale(1.22); }
  100% { transform: translateY(-2px) scale(1.12); }
}

@keyframes tabSlideFromTrailing {
  0%   { opacity: 0; transform: translate3d(26px, 0, 0) scale(0.985); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes tabSlideFromLeading {
  0%   { opacity: 0; transform: translate3d(-26px, 0, 0) scale(0.985); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes tabSlideDownIn {
  0%   { opacity: 0; transform: translate3d(0, -18px, 0) scale(0.975); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes tabSlideUpIn {
  0%   { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.985); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.tab-slide-next {
  animation: tabSlideFromTrailing 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.tab-slide-prev {
  animation: tabSlideFromLeading 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html[dir="rtl"] .tab-slide-next {
  animation-name: tabSlideFromLeading;
}
html[dir="rtl"] .tab-slide-prev {
  animation-name: tabSlideFromTrailing;
}
.tab-slide-down {
  animation: tabSlideDownIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.tab-slide-up {
  animation: tabSlideUpIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .tab-slide-next,
  .tab-slide-prev,
  .tab-slide-down,
  .tab-slide-up,
  .tab-animate,
  .bottom-nav-icon.is-popping {
    animation: none !important;
  }
  .bottom-nav-indicator,
  .profile-subtabs-indicator,
  .header-profile-btn,
  .bottom-nav-btn,
  .bottom-nav-icon {
    transition: none !important;
  }
}

/* v85 Continuous Finger-Scrubbing on Floating Bottom Tab Bar */
.bottom-nav-track {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.bottom-nav-track.is-scrubbing .bottom-nav-indicator {
  box-shadow:
    0 8px 22px rgba(30, 58, 95, 0.22),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.95);
}
.dark .bottom-nav-track.is-scrubbing .bottom-nav-indicator {
  box-shadow:
    0 8px 24px rgba(201, 162, 77, 0.26),
    inset 0 1px 0 rgba(255, 244, 214, 0.28);
}

/* ==========================================================================
   v85 Dark Mode Contrast & Readability Fix
   ========================================================================== */
html.dark {
  color-scheme: dark;
}

/* 1. Prevent .bg-white !important from bleeding white backgrounds into dark inputs & pill switchers */
.dark .dark\:bg-slate-900 {
  background: #0E121B !important;
  color: #F3EFE6;
}
.dark .dark\:bg-slate-900\/50 {
  background: rgba(14, 18, 27, 0.65) !important;
}
.dark .dark\:bg-slate-900\/60 {
  background: rgba(14, 18, 27, 0.78) !important;
}
.dark .dark\:bg-slate-700 {
  background: rgba(42, 51, 68, 0.92) !important;
}
.dark .dark\:bg-slate-700\/80 {
  background: rgba(42, 51, 68, 0.86) !important;
}
.dark .dark\:bg-slate-800\/80 {
  background: rgba(24, 31, 44, 0.88) !important;
}
.dark .dark\:bg-slate-800\/90 {
  background: rgba(24, 31, 44, 0.94) !important;
}

/* 2. Crisp dark-mode form controls & placeholders */
.dark input,
.dark select,
.dark textarea {
  color: #F3EFE6;
}
.dark input::placeholder,
.dark textarea::placeholder {
  color: #9CA3AF;
  opacity: 1;
}
.dark select option {
  background-color: #141A26;
  color: #F3EFE6;
}

/* 3. High-contrast secondary & muted text in dark mode (WCAG AA+) */
.dark .text-slate-400,
.dark .dark\:text-slate-400 {
  color: #B4AEA2;
}
.dark .text-slate-500 {
  color: #BDB7AB;
}
.dark .text-slate-600 {
  color: #D2CCC0;
}
.dark .text-slate-700 {
  color: #E2DCD0;
}
.dark .text-slate-800 {
  color: #F3EFE6;
}

/* 4. Guarantee crisp ink on Champagne Gold active buttons in Ivory dark mode */
.dark .bg-indigo-600,
.dark .bg-indigo-600.text-white {
  color: #0E121B !important;
}
html.dark[data-palette="oxford"] .bg-indigo-600,
html.dark[data-palette="oxford"] .bg-indigo-600.text-white,
html.dark[data-palette="burgundy"] .bg-indigo-600,
html.dark[data-palette="burgundy"] .bg-indigo-600.text-white {
  color: #FFFFFF !important;
}

/* ==========================================================================
   v85 Luminous Dark Mode Upgrade (Ivory, Oxford & Burgundy — Vibrant Glass)
   ========================================================================== */

/* 1. Default (Ivory) Dark: Luminous Midnight Sapphire + Warm Champagne Glow */
html.dark body {
  color: #F6F4EE;
  background-color: #131B2E;
  background-image:
    radial-gradient(at 15% 10%, rgba(201, 162, 77, 0.14) 0px, transparent 54%),
    radial-gradient(at 86% 14%, rgba(234, 179, 8, 0.14) 0px, transparent 48%),
    radial-gradient(at 52% 92%, rgba(30, 58, 95, 0.24) 0px, transparent 52%),
    linear-gradient(180deg, #121A2D 0%, #19243E 52%, #141D32 100%) !important;
  background-attachment: fixed;
}
html.dark header {
  background: rgba(23, 33, 56, 0.76) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13) !important;
  box-shadow: 0 8px 28px rgba(7, 11, 22, 0.34), inset 0 -1px 0 rgba(234, 179, 8, 0.12) !important;
}
html.dark .dark\:bg-slate-800 {
  background-color: rgba(31, 43, 69, 0.74) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  box-shadow:
    0 12px 32px rgba(7, 11, 22, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}
html.dark .dark\:bg-slate-800\/80 {
  background: rgba(33, 46, 74, 0.84) !important;
}
html.dark .dark\:bg-slate-800\/90 {
  background: rgba(31, 43, 69, 0.92) !important;
}
html.dark .dark\:bg-slate-900 {
  background: rgba(20, 29, 49, 0.88) !important;
  color: #F6F4EE;
}
html.dark .dark\:bg-slate-900\/50 {
  background: rgba(20, 29, 49, 0.62) !important;
}
html.dark .dark\:bg-slate-900\/60 {
  background: rgba(20, 29, 49, 0.74) !important;
}
html.dark .dark\:bg-slate-700 {
  background: rgba(51, 67, 102, 0.86) !important;
}
html.dark .dark\:bg-slate-700\/80 {
  background: rgba(51, 67, 102, 0.78) !important;
}
html.dark .dark\:border-slate-700 {
  border-color: rgba(148, 163, 184, 0.22) !important;
}
html.dark .bottom-nav-track {
  background: rgba(26, 37, 62, 0.82) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow:
    0 14px 36px rgba(7, 11, 22, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}
html.dark .dark\:bg-indigo-900\/40 {
  background-color: rgba(201, 162, 77, 0.20) !important;
}
html.dark .dark\:text-indigo-300 {
  color: #E5C87E !important;
}
html.dark .dark\:text-indigo-400 {
  color: #D4B263 !important;
}

/* 2. Oxford Dark: Luminous Forest Emerald + Warm Lantern Gold */
html.dark[data-palette="oxford"] body {
  background-color: #0F231C;
  background-image:
    radial-gradient(at 15% 10%, rgba(16, 185, 129, 0.30) 0px, transparent 54%),
    radial-gradient(at 86% 14%, rgba(234, 179, 8, 0.18) 0px, transparent 48%),
    radial-gradient(at 50% 92%, rgba(52, 211, 153, 0.12) 0px, transparent 52%),
    linear-gradient(180deg, #0E211A 0%, #153127 52%, #10251E 100%) !important;
}
html.dark[data-palette="oxford"] header {
  background: rgba(17, 39, 31, 0.78) !important;
  border-bottom: 1px solid rgba(167, 243, 208, 0.16) !important;
}
html.dark[data-palette="oxford"] .dark\:bg-slate-800 {
  background-color: rgba(24, 54, 43, 0.76) !important;
  border-color: rgba(110, 231, 183, 0.20) !important;
  box-shadow:
    0 12px 32px rgba(4, 14, 10, 0.34),
    inset 0 1px 0 rgba(167, 243, 208, 0.18) !important;
}
html.dark[data-palette="oxford"] .dark\:bg-slate-900 {
  background: rgba(15, 36, 28, 0.88) !important;
}
html.dark[data-palette="oxford"] .dark\:bg-slate-700,
html.dark[data-palette="oxford"] .dark\:bg-slate-700\/80 {
  background: rgba(36, 78, 62, 0.84) !important;
}
html.dark[data-palette="oxford"] .bottom-nav-track {
  background: rgba(20, 46, 36, 0.84) !important;
  border-color: rgba(167, 243, 208, 0.18) !important;
}
html.dark[data-palette="oxford"] .bg-indigo-600 {
  background: linear-gradient(135deg, #10B981, #059669) !important;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.26) !important;
}
html.dark[data-palette="oxford"] .dark\:text-indigo-300,
html.dark[data-palette="oxford"] .dark\:text-indigo-400 {
  color: #6EE7B7 !important;
}

/* 3. Burgundy Dark: Luminous Velvet Wine + Warm Rose Gold */
html.dark[data-palette="burgundy"] body {
  background-color: #24111B;
  background-image:
    radial-gradient(at 15% 10%, rgba(225, 29, 72, 0.28) 0px, transparent 54%),
    radial-gradient(at 86% 14%, rgba(234, 179, 8, 0.18) 0px, transparent 48%),
    radial-gradient(at 52% 92%, rgba(244, 114, 182, 0.12) 0px, transparent 52%),
    linear-gradient(180deg, #210F18 0%, #301624 52%, #24111C 100%) !important;
}
html.dark[data-palette="burgundy"] header {
  background: rgba(41, 19, 30, 0.78) !important;
  border-bottom: 1px solid rgba(253, 164, 175, 0.18) !important;
}
html.dark[data-palette="burgundy"] .dark\:bg-slate-800 {
  background-color: rgba(56, 26, 41, 0.76) !important;
  border-color: rgba(251, 113, 133, 0.22) !important;
  box-shadow:
    0 12px 32px rgba(18, 6, 12, 0.36),
    inset 0 1px 0 rgba(253, 164, 175, 0.18) !important;
}
html.dark[data-palette="burgundy"] .dark\:bg-slate-900 {
  background: rgba(36, 16, 26, 0.88) !important;
}
html.dark[data-palette="burgundy"] .dark\:bg-slate-700,
html.dark[data-palette="burgundy"] .dark\:bg-slate-700\/80 {
  background: rgba(82, 38, 60, 0.84) !important;
}
html.dark[data-palette="burgundy"] .bottom-nav-track {
  background: rgba(48, 22, 35, 0.84) !important;
  border-color: rgba(253, 164, 175, 0.20) !important;
}
html.dark[data-palette="burgundy"] .bg-indigo-600 {
  background: linear-gradient(135deg, #E11D48, #9F1239) !important;
  box-shadow: 0 8px 22px rgba(225, 29, 72, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
}
html.dark[data-palette="burgundy"] .dark\:text-indigo-300,
html.dark[data-palette="burgundy"] .dark\:text-indigo-400 {
  color: #FDA4AF !important;
}

/* 4. Brighter, cleaner typography in all 3 dark themes */
html.dark .text-slate-400,
html.dark .dark\:text-slate-400 {
  color: #C7C3B8 !important;
}
html.dark .text-slate-500 {
  color: #D2CEC3 !important;
}
html.dark .dark\:text-slate-100 {
  color: #F8FAFC !important;
}
html.dark .dark\:text-slate-200 {
  color: #E2E8F0 !important;
}

/* Additional missing Tailwind utilities used in HTML/JS templates */
.-right-1 { right: -0.25rem; }
.right-1 { right: 0.25rem; }
.top-1 { top: 0.25rem; }
.top-1\/2 { top: 50%; }
.-translate-y-1\/2 { transform: translateY(-50%); }

.h-9 { height: 2.25rem; }
.h-11 { height: 2.75rem; }
.h-12 { height: 3rem; }
.h-\[14px\] { height: 14px; }
.w-1\.5 { width: 0.375rem; }
.w-11 { width: 2.75rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-24 { width: 6rem; }
.min-h-0 { min-height: 0px; }
.min-h-\[120px\] { min-height: 120px; }
.min-w-\[14px\] { min-width: 14px; }
.max-h-\[220px\] { max-height: 220px; }
.max-h-\[380px\] { max-height: 380px; }
.max-h-\[42vh\] { max-height: 42vh; }
.max-h-\[60vh\] { max-height: 60vh; }
.max-h-\[70vh\] { max-height: 70vh; }
.max-w-2xl { max-width: 42rem; }
.max-w-\[115px\] { max-width: 115px; }
.max-w-\[220px\] { max-width: 220px; }
.max-w-full { max-width: 100%; }

.ms-auto { margin-inline-start: auto; }
.pt-0\.5 { padding-top: 0.125rem; }
.pt-1\.5 { padding-top: 0.375rem; }
.space-y-0\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.125rem; }
.self-start { align-self: flex-start; }

.object-contain { object-fit: contain; }
.object-cover { object-fit: cover; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }
.overflow-auto { overflow: auto; }
.resize-y { resize: vertical; }
.rounded-sm { border-radius: 0.125rem; }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

.break-words { overflow-wrap: break-word; }
.leading-snug { line-height: 1.375; }
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.text-\[10\.5px\] { font-size: 10.5px; }

.bg-amber-300 { background-color: #fcd34d; }
.bg-amber-50\/90 { background-color: rgba(255, 251, 235, 0.9); }
.bg-amber-600 { background-color: #d97706; }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.2); }
.bg-indigo-100 { background-color: #e0e7ff; }
.bg-rose-500\/15 { background-color: rgba(244, 63, 94, 0.15); }
.bg-slate-200\/80 { background-color: rgba(226, 232, 240, 0.8); }
.bg-slate-50\/80 { background-color: rgba(248, 250, 252, 0.8); }
.bg-slate-950 { background-color: #020617; }
.bg-white\/75 { background-color: rgba(255, 255, 255, 0.75); }

.border-0 { border-width: 0px; }
.border-amber-200\/70 { border-color: rgba(253, 230, 138, 0.7); }
.border-amber-300 { border-color: #fcd34d; }
.border-amber-500\/40 { border-color: rgba(245, 158, 11, 0.4); }
.border-black\/10 { border-color: rgba(0, 0, 0, 0.1); }
.border-indigo-200\/70 { border-color: rgba(199, 210, 254, 0.7); }
.border-rose-200 { border-color: #fecdd3; }
.border-slate-700 { border-color: #334155; }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }

.text-amber-300 { color: #fcd34d; }
.text-amber-700\/80 { color: rgba(180, 83, 9, 0.8); }
.text-cyan-500 { color: #06b6d4; }
.text-emerald-300 { color: #6ee7b7; }
.text-emerald-800 { color: #065f46; }
.text-indigo-800 { color: #3730a3; }
.text-slate-300 { color: #cbd5e1; }
.text-violet-500 { color: #8b5cf6; }

.hover\:bg-amber-600:hover { background-color: #d97706; }
.hover\:bg-rose-50:hover { background-color: #fff1f2; }
.hover\:bg-slate-100:hover { background-color: #f1f5f9; }
.hover\:border-indigo-300:hover { border-color: #a5b4fc; }
.hover\:border-indigo-400:hover { border-color: #818cf8; }
.hover\:opacity-90:hover { opacity: 0.9; }

html.dark .dark\:bg-amber-900\/20 { background-color: rgba(120, 53, 15, 0.2); }
html.dark .dark\:bg-amber-900\/25 { background-color: rgba(120, 53, 15, 0.25); }
html.dark .dark\:bg-indigo-900\/50 { background-color: rgba(49, 46, 129, 0.5); }
html.dark .dark\:bg-indigo-950\/60 { background-color: rgba(30, 27, 75, 0.6); }
html.dark .dark\:bg-rose-950\/60 { background-color: rgba(76, 5, 25, 0.6); }
html.dark .dark\:bg-slate-600 { background-color: #475569; }
html.dark .dark\:bg-slate-800\/75 { background-color: rgba(30, 41, 59, 0.75); }

html.dark .dark\:border-amber-700 { border-color: #b45309; }
html.dark .dark\:border-amber-700\/60 { border-color: rgba(180, 83, 9, 0.6); }
html.dark .dark\:border-amber-800\/40 { border-color: rgba(146, 64, 14, 0.4); }
html.dark .dark\:border-amber-800\/60 { border-color: rgba(146, 64, 14, 0.6); }
html.dark .dark\:border-emerald-800\/40 { border-color: rgba(6, 95, 70, 0.4); }
html.dark .dark\:border-rose-700\/60 { border-color: rgba(190, 18, 60, 0.6); }
html.dark .dark\:border-slate-700\/80 { border-color: rgba(51, 65, 85, 0.8); }
html.dark .dark\:border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }

html.dark .dark\:hover\:bg-rose-900\/30:hover { background-color: rgba(136, 19, 55, 0.3); }
html.dark .dark\:hover\:border-indigo-700:hover { border-color: #4338ca; }

html.dark .dark\:text-amber-200 { color: #fde68a; }
html.dark .dark\:text-amber-300\/80 { color: rgba(252, 211, 77, 0.8); }
html.dark .dark\:text-amber-600 { color: #d97706; }
html.dark .dark\:text-indigo-200 { color: #c7d2fe; }

@media (min-width: 640px) {
  .sm\:h-8 { height: 2rem; }
  .sm\:inline { display: inline; }
  .sm\:w-8 { width: 2rem; }
  .sm\:flex { display: flex; }
  .sm\:px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
  .sm\:p-4 { padding: 1rem; }
  .sm\:p-7 { padding: 1.75rem; }
}

.w-2 { width: 0.5rem; }
.bg-amber-50 { background-color: #fffbeb; }
.border-amber-200 { border-color: #fde68a; }
.bg-slate-900 { background-color: #0f172a; }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.opacity-70 { opacity: 0.7; }
.opacity-75 { opacity: 0.75; }
.opacity-95 { opacity: 0.95; }
.pe-2\.5 { padding-inline-end: 0.625rem; }
.text-rose-400 { color: #fb7185; }
.select-text { user-select: text; -webkit-user-select: text; }
.border-white\/30 { border-color: rgba(255, 255, 255, 0.3); }
.disabled\:opacity-40:disabled { opacity: 0.4; }
html.dark .dark\:hover\:bg-slate-700:hover { background-color: #334155; }
.h-6 { height: 1.5rem; }
.p-0 { padding: 0px; }
.max-h-\[420px\] { max-height: 420px; }
.hover\:underline:hover { text-decoration: underline; }
.bg-amber-400 { background-color: #fbbf24; }
.bg-amber-500\/15 { background-color: rgba(245, 158, 11, 0.15); }
.bg-emerald-400 { background-color: #34d399; }
.bg-emerald-50\/80 { background-color: rgba(236, 253, 245, 0.8); }
.border-emerald-200\/70 { border-color: rgba(167, 243, 208, 0.7); }
.border-white\/40 { border-color: rgba(255, 255, 255, 0.4); }
.capitalize { text-transform: capitalize; }
.h-24 { height: 6rem; }
.text-amber-400 { color: #fbbf24; }
.w-9 { width: 2.25rem; }
@media (min-width: 640px) {
  .sm\:hidden { display: none; }
  .sm\:py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .sm\:flex-nowrap { flex-wrap: nowrap; }
  .sm\:w-auto { width: auto; }
  .sm\:justify-end { justify-content: flex-end; }
  .sm\:p-6 { padding: 1.5rem; }
}
.opacity-55 { opacity: 0.55; }
@media (min-width: 768px) {
  .md\:inline { display: inline; }
}

/* ==========================================================================
   Liquid Glass 2.0 Elevation (Ultra-Glassy Frosted Depth + 60fps Compositing)
   ========================================================================== */

/* 1. Richer ambient gradient depth behind glass panes without paint lag */
body {
  background-image:
    radial-gradient(at 84% 8%, rgba(201, 162, 77, 0.22) 0px, transparent 50%),
    radial-gradient(at 12% 36%, rgba(56, 189, 248, 0.10) 0px, transparent 48%),
    radial-gradient(at 18% 88%, rgba(30, 58, 95, 0.14) 0px, transparent 52%),
    linear-gradient(180deg, #F8F5EE 0%, #EFE8DC 55%, #E7DDD0 100%);
}
html[data-palette="oxford"] body {
  background-image:
    radial-gradient(at 84% 8%, rgba(16, 185, 129, 0.20) 0px, transparent 50%),
    radial-gradient(at 14% 85%, rgba(201, 162, 77, 0.22) 0px, transparent 52%),
    linear-gradient(180deg, #F3F8F4 0%, #E7F0E9 55%, #DCEADF 100%);
}
html[data-palette="burgundy"] body {
  background-image:
    radial-gradient(at 84% 8%, rgba(190, 24, 93, 0.16) 0px, transparent 50%),
    radial-gradient(at 14% 85%, rgba(201, 162, 77, 0.22) 0px, transparent 52%),
    linear-gradient(180deg, #FBF5F6 0%, #F3E8EA 55%, #EADCE0 100%);
}

/* 2. Frosted Crystal Floating Chrome (GPU-promoted fixed/sticky surfaces) */
header {
  background: linear-gradient(180deg, rgba(255, 254, 250, 0.72), rgba(250, 246, 238, 0.56)) !important;
  -webkit-backdrop-filter: blur(18px) saturate(175%) !important;
  backdrop-filter: blur(18px) saturate(175%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    0 8px 28px rgba(28, 25, 23, 0.07),
    inset 0 -1px 0 rgba(255, 255, 255, 0.65) !important;
  transform: translateZ(0);
}
html.dark header {
  background: linear-gradient(180deg, rgba(26, 37, 62, 0.68), rgba(18, 26, 46, 0.54)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow:
    0 10px 32px rgba(4, 8, 18, 0.42),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12) !important;
}
html.dark[data-palette="oxford"] header {
  background: linear-gradient(180deg, rgba(19, 44, 35, 0.68), rgba(13, 31, 25, 0.54)) !important;
  border-bottom-color: rgba(167, 243, 208, 0.20) !important;
}
html.dark[data-palette="burgundy"] header {
  background: linear-gradient(180deg, rgba(46, 20, 33, 0.68), rgba(32, 13, 23, 0.54)) !important;
  border-bottom-color: rgba(253, 164, 175, 0.22) !important;
}

.bottom-nav-track {
  background: linear-gradient(180deg, rgba(255, 254, 250, 0.74), rgba(248, 243, 234, 0.60)) !important;
  -webkit-backdrop-filter: blur(20px) saturate(185%) !important;
  backdrop-filter: blur(20px) saturate(185%) !important;
  border: 1px solid rgba(255, 255, 255, 0.92) !important;
  box-shadow:
    0 16px 38px -8px rgba(15, 23, 42, 0.18),
    inset 0 1.5px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.35) !important;
  transform: translateZ(0);
}
html.dark .bottom-nav-track {
  background: linear-gradient(180deg, rgba(30, 42, 70, 0.66), rgba(19, 28, 48, 0.54)) !important;
  border-color: rgba(255, 255, 255, 0.20) !important;
  box-shadow:
    0 18px 42px -6px rgba(0, 0, 0, 0.52),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.22) !important;
}
html.dark[data-palette="oxford"] .bottom-nav-track {
  background: linear-gradient(180deg, rgba(22, 52, 41, 0.68), rgba(14, 34, 27, 0.56)) !important;
  border-color: rgba(167, 243, 208, 0.22) !important;
}
html.dark[data-palette="burgundy"] .bottom-nav-track {
  background: linear-gradient(180deg, rgba(54, 24, 39, 0.68), rgba(36, 15, 26, 0.56)) !important;
  border-color: rgba(253, 164, 175, 0.24) !important;
}

/* 3. Translucent Liquid Glass Cards with Specular Rim & 60fps GPU Efficiency */
/* Scope translucency to real card containers rather than tiny inner toggles/pills */
.glass-card,
.rounded-2xl.bg-white,
.rounded-3xl.bg-white {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78) 0%, rgba(252, 249, 243, 0.62) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    0 10px 26px rgba(28, 25, 23, 0.06),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28) !important;
}
html.dark .glass-card,
html.dark .rounded-2xl.dark\:bg-slate-800,
html.dark .rounded-3xl.dark\:bg-slate-800 {
  background: linear-gradient(145deg, rgba(38, 52, 82, 0.68) 0%, rgba(22, 32, 54, 0.56) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.17) !important;
  box-shadow:
    0 12px 28px rgba(5, 9, 20, 0.34),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.20),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05) !important;
}
html.dark[data-palette="oxford"] .glass-card,
html.dark[data-palette="oxford"] .rounded-2xl.dark\:bg-slate-800,
html.dark[data-palette="oxford"] .rounded-3xl.dark\:bg-slate-800 {
  background: linear-gradient(145deg, rgba(28, 63, 50, 0.68) 0%, rgba(16, 40, 31, 0.56) 100%) !important;
  border-color: rgba(167, 243, 208, 0.22) !important;
}
html.dark[data-palette="burgundy"] .glass-card,
html.dark[data-palette="burgundy"] .rounded-2xl.dark\:bg-slate-800,
html.dark[data-palette="burgundy"] .rounded-3xl.dark\:bg-slate-800 {
  background: linear-gradient(145deg, rgba(64, 28, 46, 0.68) 0%, rgba(40, 16, 28, 0.56) 100%) !important;
  border-color: rgba(253, 164, 175, 0.22) !important;
}
.glass-card {
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  contain: layout style;
}

/* Keep mobile scrolling smooth with lighter compositor cost */
@media (max-width: 640px) {
  html.dark body {
    background-attachment: scroll !important;
  }
  .glass-card {
    -webkit-backdrop-filter: blur(6px) saturate(135%);
    backdrop-filter: blur(6px) saturate(135%);
  }
}

/* 4. Glassmorphic Segmented Controls, Profile Button, Drawers, Modals & Inputs */
.seg-subtabs,
.profile-subtabs {
  background: rgba(255, 254, 250, 0.58) !important;
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.84) !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}
.dark .seg-subtabs,
.dark .profile-subtabs {
  background: rgba(24, 34, 58, 0.54) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

.app-drawer,
#app-toast.glass-toast {
  background: rgba(255, 254, 250, 0.72) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18), inset 0 1.5px 0 rgba(255, 255, 255, 0.95) !important;
}
html.dark .app-drawer,
html.dark #app-toast.glass-toast {
  background: rgba(22, 32, 54, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.52), inset 0 1.5px 0 rgba(255, 255, 255, 0.2) !important;
}

#app-modal-backdrop {
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  backdrop-filter: blur(8px) saturate(130%);
}
#app-modal-backdrop > div {
  background: rgba(255, 254, 251, 0.80) !important;
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22), inset 0 1.5px 0 rgba(255, 255, 255, 1) !important;
}
html.dark #app-modal-backdrop > div {
  background: rgba(24, 34, 56, 0.74) !important;
  border-color: rgba(255, 255, 255, 0.20) !important;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.56), inset 0 1.5px 0 rgba(255, 255, 255, 0.22) !important;
}
html.dark #app-modal-footer {
  background: rgba(15, 23, 42, 0.36) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

/* Inner glass pills, buttons, and form inputs */
.bg-slate-100 {
  background-color: rgba(255, 255, 255, 0.56) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
html.dark .dark\:bg-slate-700,
html.dark .dark\:bg-slate-700\/80 {
  background-color: rgba(51, 67, 102, 0.52) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
html.dark .dark\:bg-slate-900 {
  background-color: rgba(15, 23, 42, 0.56) !important;
}
.h-1\.5, .h-2, .h-2\.5 {
  border-width: 0 !important;
}

/* Focus Medallion Crystal Lens sheen */
.relative.w-48.h-48 {
  background: radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.92) 0%, rgba(248, 244, 236, 0.62) 60%, rgba(232, 224, 210, 0.52) 100%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.95) !important;
  box-shadow:
    0 18px 42px rgba(28, 25, 23, 0.10),
    inset 0 2px 3px rgba(255, 255, 255, 1),
    inset 0 -8px 18px rgba(30, 58, 95, 0.08) !important;
}
.dark .relative.w-48.h-48 {
  background: radial-gradient(circle at 28% 20%, rgba(62, 78, 114, 0.62) 0%, rgba(26, 36, 58, 0.54) 62%, rgba(14, 20, 35, 0.68) 100%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.45),
    inset 0 2px 3px rgba(255, 255, 255, 0.24),
    inset 0 -8px 20px rgba(201, 162, 77, 0.10) !important;
}

/* Glossy highlight rim on accent CTAs */
.bg-indigo-600 {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.34) !important;
}
.break-all { word-break: break-all; }
.max-w-4xl { max-width: 56rem; }
.w-14 { width: 3.5rem; }
.text-\[9\.5px\] { font-size: 9.5px; }
html.dark .dark\:bg-indigo-900\/25 { background-color: rgba(49, 46, 129, 0.25); }
html.dark .dark\:border-indigo-700\/40 { border-color: rgba(67, 56, 202, 0.4); }
@media (min-width: 640px) {
  .sm\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .sm\:py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
}

/* ==========================================================================
   Universal Smooth 60fps Liquid Glass Everywhere (Desks, Hero, Banners, Forms)
   ========================================================================== */
html {
  scroll-behavior: smooth;
}
body {
  overscroll-behavior-y: contain;
}

/* Focus Hero Stage + Header Profile Button */
.focus-hero-stage {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.64) 0%, rgba(250, 246, 238, 0.44) 100%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(165%);
  backdrop-filter: blur(12px) saturate(165%);
  border: 1px solid rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    0 14px 36px rgba(15, 23, 42, 0.06),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.98) !important;
}
html.dark .focus-hero-stage {
  background: linear-gradient(145deg, rgba(32, 44, 72, 0.50) 0%, rgba(19, 28, 48, 0.36) 100%) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  box-shadow:
    0 16px 40px rgba(4, 8, 18, 0.36),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.20) !important;
}

.header-profile-btn {
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* Study Hall Desks, Vibes, Co-Study & Profile Cards */
.hall-desk-card,
.hall-vibe-card,
.profile-hero-card {
  -webkit-backdrop-filter: blur(10px) saturate(155%);
  backdrop-filter: blur(10px) saturate(155%);
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  contain: layout style;
}
html.dark .hall-desk-card,
html.dark .hall-vibe-card,
html.dark .profile-hero-card {
  border-color: rgba(255, 255, 255, 0.16) !important;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.hall-desk-card {
  background: rgba(255, 255, 255, 0.60);
  border-color: rgba(255, 255, 255, 0.82);
}
html.dark .hall-desk-card {
  background: rgba(31, 43, 69, 0.48);
}
.hall-desk-live {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.16), rgba(255, 255, 255, 0.56)) !important;
  border-color: rgba(16, 185, 129, 0.48) !important;
}
html.dark .hall-desk-live {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.22), rgba(14, 42, 34, 0.52)) !important;
  border-color: rgba(52, 211, 153, 0.42) !important;
}
.hall-desk-paused {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.16), rgba(255, 255, 255, 0.56)) !important;
  border-color: rgba(245, 158, 11, 0.44) !important;
}
.hall-costudy-banner,
.hc-gsess-banner,
.profile-badge-card {
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* Soft Translucent Tinted Sheets Across Focus, Shelf, Stats, Organizer & Notes */
.bg-slate-50,
.bg-slate-50\/70 {
  background-color: rgba(255, 255, 255, 0.54) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
html.dark .dark\:bg-slate-900\/50,
html.dark .dark\:bg-slate-900\/60 {
  background-color: rgba(16, 24, 42, 0.46) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.bg-amber-50,
.bg-amber-50\/70,
.bg-amber-50\/90 {
  background-color: rgba(254, 243, 199, 0.54) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
html.dark .dark\:bg-amber-900\/30,
html.dark .dark\:bg-amber-900\/25 {
  background-color: rgba(120, 53, 15, 0.34) !important;
  box-shadow: inset 0 1px 0 rgba(253, 230, 138, 0.14);
}
.bg-emerald-50\/70,
.bg-emerald-50\/80 {
  background-color: rgba(209, 250, 229, 0.54) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
html.dark .dark\:bg-emerald-900\/20 {
  background-color: rgba(6, 78, 59, 0.32) !important;
  box-shadow: inset 0 1px 0 rgba(167, 243, 208, 0.14);
}
.bg-rose-50 {
  background-color: rgba(255, 228, 230, 0.54) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
html.dark .dark\:bg-rose-900\/30,
html.dark .dark\:bg-rose-900\/20 {
  background-color: rgba(136, 19, 55, 0.32) !important;
  box-shadow: inset 0 1px 0 rgba(253, 164, 175, 0.14);
}
.bg-indigo-50,
.bg-indigo-50\/60,
.bg-indigo-50\/70 {
  background-color: rgba(226, 232, 240, 0.54) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
html.dark .dark\:bg-indigo-950\/60,
html.dark .dark\:bg-indigo-900\/25,
html.dark .dark\:bg-indigo-900\/40 {
  background-color: rgba(30, 58, 95, 0.34) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Tactile Glass Form Controls (preserve transparent inputs inside reader/chat) */
#app-main input[type="text"],
#app-main input[type="search"],
#app-main input[type="number"],
#app-main input[type="date"],
#app-main input[type="url"],
#app-main input[type="password"],
#app-main select,
#app-main textarea,
#app-modal-backdrop input[type="text"],
#app-modal-backdrop input[type="search"],
#app-modal-backdrop input[type="number"],
#app-modal-backdrop input[type="date"],
#app-modal-backdrop input[type="url"],
#app-modal-backdrop input[type="password"],
#app-modal-backdrop select,
#app-modal-backdrop textarea {
  background-color: rgba(255, 255, 255, 0.62);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
html.dark #app-main input[type="text"],
html.dark #app-main input[type="search"],
html.dark #app-main input[type="number"],
html.dark #app-main input[type="date"],
html.dark #app-main input[type="url"],
html.dark #app-main input[type="password"],
html.dark #app-main select,
html.dark #app-main textarea,
html.dark #app-modal-backdrop input[type="text"],
html.dark #app-modal-backdrop input[type="search"],
html.dark #app-modal-backdrop input[type="number"],
html.dark #app-modal-backdrop input[type="date"],
html.dark #app-modal-backdrop input[type="url"],
html.dark #app-modal-backdrop input[type="password"],
html.dark #app-modal-backdrop select,
html.dark #app-modal-backdrop textarea {
  background-color: rgba(15, 23, 42, 0.48);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Mobile 60fps Smoothness Optimization */
@media (max-width: 640px) {
  .focus-hero-stage,
  .hall-desk-card,
  .hall-vibe-card,
  .profile-hero-card,
  .hall-costudy-banner,
  .profile-badge-card {
    -webkit-backdrop-filter: blur(6px) saturate(135%);
    backdrop-filter: blur(6px) saturate(135%);
  }
}

/* Additional layout & surface utility classes */
.aspect-square { aspect-ratio: 1 / 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.w-3\.5 { width: 0.875rem; }
.bg-emerald-50 { background-color: rgba(209, 250, 229, 0.72); }
.border-emerald-200 { border-color: rgba(167, 243, 208, 0.85); }
.dark .dark\:border-emerald-700\/60 { border-color: rgba(4, 120, 87, 0.6); }
.dark .dark\:border-indigo-700\/50 { border-color: rgba(45, 79, 130, 0.5); }
.dark .dark\:text-emerald-200 { color: #a7f3d0; }
