/* 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);
}

/* Liquid Glass Cards & Inputs (Specular Rim + Warm Frosted Depth) */
.bg-white {
  background-color: rgba(255, 253, 249, 0.68);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  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.62);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  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(79, 70, 229, 0.08); }
.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(49, 46, 129, 0.32); }
.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: #818cf8; }
.border-indigo-600 { border-color: #4f46e5; }
.border-indigo-200\/60 { border-color: rgba(199, 210, 254, 0.6); }
.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: #6366f1; }

/* 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(79, 70, 229, 0.11);
  border-color: rgba(79, 70, 229, 0.22);
  color: #4f46e5;
}
.dark .drawer-nav-item.is-active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(129, 140, 248, 0.3);
  color: #a5b4fc;
}
.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(55, 48, 163, 0.5); }
.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(79, 70, 229, 0.1);
  color: #4338ca;
  cursor: pointer;
}
.dark input[type="file"]::file-selector-button {
  background-color: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
}

.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: #6366f1; }

/* 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-ipad-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.05fr);
    gap: 1.5rem;
    align-items: start;
  }
}
@media (max-width: 767px) {
  .focus-ipad-grid {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
  }
}

.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(79, 70, 229, 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: #4f46e5;
  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(79, 70, 229, 0.07);
  border: 1px solid rgba(79, 70, 229, 0.2);
}
.dark .profile-badge-card {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(129, 140, 248, 0.24);
}
.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: #4f46e5;
}

/* 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-template-columns: repeat(4, 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 {
  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 {
  font-size: 1.18rem;
  line-height: 1.15;
  display: inline-block;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bottom-nav-btn.is-active .bottom-nav-icon {
  transform: translateY(-2px) scale(1.12);
}
.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. Profile / Settings Segmented Switcher */
.profile-subtabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(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 {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 244, 222, 0.12);
}
.profile-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 {
  background: #C9A24D;
  box-shadow: 0 4px 14px rgba(201, 162, 77, 0.28);
}
html[data-palette="oxford"] .profile-subtabs-indicator {
  background: #1B5E43;
}
html.dark[data-palette="oxford"] .profile-subtabs-indicator {
  background: #10B981;
}
html[data-palette="burgundy"] .profile-subtabs-indicator {
  background: #7C2338;
}
html.dark[data-palette="burgundy"] .profile-subtabs-indicator {
  background: #E11D48;
}
.profile-subtab-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  transition: color 0.22s ease, transform 0.16s ease;
}
.dark .profile-subtab-btn {
  color: #cbd5e1;
}
.profile-subtab-btn:active {
  transform: scale(0.97);
}
.profile-subtab-btn.is-active {
  color: #ffffff;
}
.dark .profile-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;
}
