/* HomeTask — static CSS (replaces Tailwind CDN + Google Fonts)
   Optimised for low-powered devices (Raspberry Pi 4).
   No runtime JIT, no backdrop-filter, system fonts only. */

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: #374151; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; line-height: 1.5; }
body { margin: 0; line-height: inherit; }
h1,h2,h3,h4,h5,h6,p { margin: 0; }
button { background: transparent; padding: 0; cursor: pointer; color: inherit; font: inherit; }
button, input, select, textarea { font-family: inherit; font-size: 100%; margin: 0; }
input, textarea, select, button { border: 0; }
input[type="text"], input[type="password"], input[type="date"], textarea, select {
    appearance: none; -webkit-appearance: none;
}
svg { display: inline-block; vertical-align: middle; }
img, svg { max-width: 100%; height: auto; }
::-moz-focus-inner { border: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

*, *::before, *::after { touch-action: manipulation; }

/* ── Theme variables ───────────────────────────────────────────── */
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
html.dark  { --bg: #111827; --text: #f3f4f6; --footer-bg: #111827; }
html:not(.dark) { --bg: #f8fafc; --text: #1e293b; --footer-bg: #f8fafc; }

html { background: var(--bg); }
body {
    -webkit-tap-highlight-color: transparent;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(55, 65, 81, 0.5); border-radius: 3px; }
html:not(.dark) ::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.5); }

select, input[type="date"] { min-height: 52px; }

/* ── Custom components ─────────────────────────────────────────── */

/* NOTE: No backdrop-filter — fully opaque backgrounds for Pi-friendly compositing. */
.glass {
    background: #1f2937;
    border: 1px solid rgba(55, 65, 81, 0.6);
}
html:not(.dark) .glass {
    background: #ffffff;
    border-color: rgba(203, 213, 225, 0.9);
}

.glass-card {
    background: #1f2937;
    border: 1px solid rgba(75, 85, 99, 0.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
html:not(.dark) .glass-card {
    background: #ffffff;
    border-color: rgba(203, 213, 225, 0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.top-gradient {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.06) 0%, transparent 150px);
}

/* Task cards: no hover transforms (expensive compositing, zero value on a kiosk). */
.task-card {
    transition: border-color 0.15s ease;
}

.task-done {
    background-color: rgba(16, 185, 129, 0.12) !important;
    background-image: none !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
}
html:not(.dark) .task-done { background-color: rgba(16, 185, 129, 0.10) !important; }

/* Modal animations — kept because they only run on open/close (rare) */
.modal-backdrop {
    transition: opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
}
.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-backdrop .modal-panel {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    transform: translateY(100%);
    opacity: 0;
}
@media (min-width: 640px) {
    .modal-backdrop .modal-panel { transform: translateY(1rem) scale(0.98); }
}
.modal-backdrop.active .modal-panel { transform: translateY(0) scale(1); opacity: 1; }
html:not(.dark) .modal-backdrop { background: rgba(0, 0, 0, 0.4); }

.btn-press { transition: transform 0.1s ease, background-color 0.15s ease; }
.btn-press:active { transform: scale(0.94); }

.add-btn-glow { box-shadow: 0 2px 12px rgba(16, 185, 129, 0.25); }

.progress-fill { transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

/* Task card entrance — only plays on the first page render (JS removes the class after) */
#task-list.first-render > div { animation: taskEnter 0.25s ease-out both; }
#task-list.first-render > div:nth-child(n+6) { animation: none; }
@keyframes taskEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Card insertion (after first render) — only the just-inserted node gets this */
.task-enter { animation: taskEnter 0.25s ease-out both; }

/* Card exit — fade + slide; siblings reflow instantly when node is removed. */
@keyframes taskExit {
    to { opacity: 0; transform: translateX(16px) scale(0.98); }
}
.task-exit {
    animation: taskExit 0.2s ease-in forwards;
    pointer-events: none;
}

/* Completed check celebration — fast, GPU-cheap */
@keyframes celebrateCheck {
    0%   { transform: scale(0.85); }
    60%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.task-done .check-btn { animation: celebrateCheck 0.3s ease-out; }

/* Empty-state float */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.float-anim { animation: float 3s ease-in-out infinite; }

/* Date slide */
.date-slide-enter { animation: dateSlide 0.2s ease-out; }
@keyframes dateSlide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Status tabs */
.status-tab { color: rgba(156, 163, 175, 0.85); background: transparent; }
.status-tab.active { color: #fff; background: rgba(16, 185, 129, 0.15); }
html:not(.dark) .status-tab { color: rgba(100, 116, 139, 0.9); }
html:not(.dark) .status-tab.active { color: #065f46; background: rgba(16, 185, 129, 0.12); }

.theme-toggle { transition: transform 0.2s ease, background 0.2s ease; }
.theme-toggle:active { transform: scale(0.9); }

/* ── Layout ────────────────────────────────────────────────────── */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.left-4 { left: 1rem; }
.right-4 { right: 1rem; }
.bottom-14 { bottom: 3.5rem; }

.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-\[55\] { z-index: 55; }
.z-\[60\] { z-index: 60; }
.z-\[70\] { z-index: 70; }

.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.resize-none { resize: none; }

.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.mx-0\.5 { margin-left: 0.125rem; margin-right: 0.125rem; }
.ml-0\.5 { margin-left: 0.125rem; }
.-mt-0\.5 { margin-top: -0.125rem; }
.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; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-2\.5 { margin-bottom: 0.625rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.pb-14 { padding-bottom: 3.5rem; }

.p-1\.5 { padding: 0.375rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.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-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.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-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }

/* ── Sizing ────────────────────────────────────────────────────── */
.w-px { width: 1px; }
.w-3 { width: 0.75rem; } .h-3 { height: 0.75rem; }
.w-3\.5 { width: 0.875rem; } .h-3\.5 { height: 0.875rem; }
.w-4 { width: 1rem; } .h-4 { height: 1rem; }
.w-5 { width: 1.25rem; } .h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; } .h-6 { height: 1.5rem; }
.w-7 { width: 1.75rem; } .h-7 { height: 1.75rem; }
.w-8 { width: 2rem; } .h-8 { height: 2rem; }
.w-10 { width: 2.5rem; } .h-10 { height: 2.5rem; }
.w-11 { width: 2.75rem; } .h-11 { height: 2.75rem; }
.w-12 { width: 3rem; } .h-12 { height: 3rem; }
.w-14 { width: 3.5rem; } .h-14 { height: 3.5rem; }
.w-20 { width: 5rem; } .h-20 { height: 5rem; }
.h-1\.5 { height: 0.375rem; }
.h-full { height: 100%; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.min-h-screen { min-height: 100vh; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-2xl { max-width: 42rem; }
.max-h-\[90vh\] { max-height: 90vh; }

/* ── Typography ────────────────────────────────────────────────── */
.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-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-sans { font-family: inherit; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-widest { letter-spacing: 0.1em; }

.leading-none { line-height: 1; }
.leading-snug { line-height: 1.375; }
.leading-relaxed { line-height: 1.625; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.capitalize { text-transform: capitalize; }
.align-middle { vertical-align: middle; }
.whitespace-nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }
.underline { text-decoration: underline; }

/* ── Colors ────────────────────────────────────────────────────── */
.text-white { color: #ffffff; }
.text-transparent { color: transparent; }
.text-gray-100 { color: #f3f4f6; }
.text-gray-200 { color: #e5e7eb; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-slate-500 { color: #64748b; }
.text-emerald-300 { color: #6ee7b7; }
.text-emerald-300\/90 { color: rgba(110, 231, 183, 0.9); }
.text-emerald-400 { color: #34d399; }
.text-emerald-400\/50 { color: rgba(52, 211, 153, 0.5); }
.text-amber-400 { color: #fbbf24; }
.text-amber-500 { color: #f59e0b; }
.text-red-400 { color: #f87171; }
.text-indigo-400 { color: #818cf8; }
.text-blue-400 { color: #60a5fa; }

.placeholder-gray-500::placeholder { color: #6b7280; }

.bg-transparent { background-color: transparent; }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.10); }
.bg-black\/70 { background-color: rgba(0, 0, 0, 0.7); }
.bg-gray-700\/30 { background-color: rgba(55, 65, 81, 0.30); }
.bg-gray-700\/40 { background-color: rgba(55, 65, 81, 0.40); }
.bg-gray-700\/50 { background-color: rgba(55, 65, 81, 0.50); }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-800\/80 { background-color: rgba(31, 41, 55, 0.80); }
.bg-gray-900 { background-color: #111827; }
.bg-gray-950 { background-color: #030712; }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.10); }
.bg-emerald-500\/15 { background-color: rgba(16, 185, 129, 0.15); }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.20); }
.bg-emerald-600 { background-color: #059669; }
.bg-indigo-500\/10 { background-color: rgba(99, 102, 241, 0.10); }
.bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.10); }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.10); }

/* Gradients (simplified to solid for the parts used) */
.bg-gradient-to-r,
.bg-gradient-to-br { background-image: linear-gradient(var(--grad-dir, to right), var(--grad-from, transparent), var(--grad-to, transparent)); }
.bg-gradient-to-r  { --grad-dir: to right; }
.bg-gradient-to-br { --grad-dir: to bottom right; }

.from-gray-100 { --grad-from: #f3f4f6; }
.from-gray-800 { --grad-from: #1f2937; }
.from-emerald-400 { --grad-from: #34d399; }
.from-emerald-500 { --grad-from: #10b981; }
.from-emerald-600 { --grad-from: #059669; }
.from-indigo-500 { --grad-from: #6366f1; }
.from-indigo-600 { --grad-from: #4f46e5; }
.from-amber-500 { --grad-from: #f59e0b; }
.from-amber-600 { --grad-from: #d97706; }

.to-gray-300 { --grad-to: #d1d5db; }
.to-gray-900 { --grad-to: #111827; }
.to-green-300 { --grad-to: #86efac; }
.to-emerald-400 { --grad-to: #34d399; }
.to-emerald-500 { --grad-to: #10b981; }
.to-emerald-600 { --grad-to: #059669; }
.to-indigo-400 { --grad-to: #818cf8; }
.to-indigo-500 { --grad-to: #6366f1; }
.to-amber-400 { --grad-to: #fbbf24; }
.to-amber-500 { --grad-to: #f59e0b; }

.bg-clip-text { -webkit-background-clip: text; background-clip: text; }

/* Border colors */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-transparent { border-color: transparent; }
.border-gray-600\/30 { border-color: rgba(75, 85, 99, 0.30); }
.border-gray-600\/40 { border-color: rgba(75, 85, 99, 0.40); }
.border-gray-600\/60 { border-color: rgba(75, 85, 99, 0.60); }
.border-gray-700\/30 { border-color: rgba(55, 65, 81, 0.30); }
.border-gray-700\/40 { border-color: rgba(55, 65, 81, 0.40); }
.border-gray-700\/50 { border-color: rgba(55, 65, 81, 0.50); }
.border-emerald-500 { border-color: #10b981; }
.border-emerald-500\/20 { border-color: rgba(16, 185, 129, 0.20); }
.border-indigo-500 { border-color: #6366f1; }
.border-indigo-500\/15 { border-color: rgba(99, 102, 241, 0.15); }
.border-indigo-500\/20 { border-color: rgba(99, 102, 241, 0.20); }
.border-indigo-500\/30 { border-color: rgba(99, 102, 241, 0.30); }
.border-amber-500 { border-color: #f59e0b; }
.border-amber-500\/15 { border-color: rgba(245, 158, 11, 0.15); }
.border-amber-500\/20 { border-color: rgba(245, 158, 11, 0.20); }
.border-amber-500\/25 { border-color: rgba(245, 158, 11, 0.25); }
.border-amber-500\/30 { border-color: rgba(245, 158, 11, 0.30); }
.border-red-500\/25 { border-color: rgba(239, 68, 68, 0.25); }
.border-red-500\/30 { border-color: rgba(239, 68, 68, 0.30); }

.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.rounded-t-3xl { border-top-left-radius: 1.5rem; border-top-right-radius: 1.5rem; }

/* ── Shadows ───────────────────────────────────────────────────── */
.shadow-md { box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.shadow-lg { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.shadow-xl { box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
.shadow-2xl { box-shadow: 0 10px 24px rgba(0,0,0,0.3); }

/* Colored shadows — declared AFTER plain shadows so they win when both classes coexist. */
.shadow-emerald-500\/10 { box-shadow: 0 4px 12px rgba(16,185,129,0.10); }
.shadow-emerald-500\/15 { box-shadow: 0 2px 6px rgba(16,185,129,0.15); }
.shadow-emerald-500\/20 { box-shadow: 0 4px 12px rgba(16,185,129,0.20); }
.shadow-emerald-600\/20 { box-shadow: 0 4px 12px rgba(5,150,105,0.20); }
.shadow-emerald-900\/10 { box-shadow: 0 4px 12px rgba(6,78,59,0.12); }
.shadow-indigo-500\/10  { box-shadow: 0 4px 12px rgba(99,102,241,0.12); }
.shadow-indigo-600\/20  { box-shadow: 0 4px 12px rgba(79,70,229,0.20); }
.shadow-amber-500\/10   { box-shadow: 0 4px 12px rgba(245,158,11,0.12); }
.shadow-amber-600\/20   { box-shadow: 0 4px 12px rgba(217,119,6,0.20); }

/* ── Transitions ───────────────────────────────────────────────── */
.transition-all    { transition: all 0.15s ease; }
.transition-colors { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }

.opacity-50 { opacity: 0.5; }

/* ── :hover variants ───────────────────────────────────────────── */
.hover\:bg-white\/5:hover { background-color: rgba(255, 255, 255, 0.05); }
.hover\:bg-white\/10:hover { background-color: rgba(255, 255, 255, 0.10); }
.hover\:bg-emerald-500:hover { background-color: #10b981; }
.hover\:bg-emerald-500\/10:hover { background-color: rgba(16, 185, 129, 0.10); }
.hover\:bg-indigo-500\/10:hover { background-color: rgba(99, 102, 241, 0.10); }
.hover\:bg-indigo-500\/20:hover { background-color: rgba(99, 102, 241, 0.20); }
.hover\:bg-amber-500\/10:hover { background-color: rgba(245, 158, 11, 0.10); }
.hover\:bg-amber-500\/20:hover { background-color: rgba(245, 158, 11, 0.20); }
.hover\:bg-red-400\/10:hover { background-color: rgba(248, 113, 113, 0.10); }
.hover\:bg-red-500\/20:hover { background-color: rgba(239, 68, 68, 0.20); }
.hover\:bg-blue-400\/10:hover { background-color: rgba(96, 165, 250, 0.10); }

.hover\:text-red-400:hover { color: #f87171; }
.hover\:text-blue-400:hover { color: #60a5fa; }
.hover\:text-gray-500:hover { color: #6b7280; }
.hover\:text-emerald-300:hover { color: #6ee7b7; }

.hover\:border-gray-400:hover { border-color: #9ca3af; }
.hover\:border-gray-600\/60:hover { border-color: rgba(75, 85, 99, 0.60); }
.hover\:border-emerald-500\/40:hover { border-color: rgba(16, 185, 129, 0.40); }
.hover\:border-indigo-500\/40:hover { border-color: rgba(99, 102, 241, 0.40); }
.hover\:border-amber-500\/40:hover { border-color: rgba(245, 158, 11, 0.40); }

.hover\:from-emerald-400:hover { --grad-from: #34d399; }
.hover\:from-emerald-500:hover { --grad-from: #10b981; }
.hover\:from-indigo-500:hover { --grad-from: #6366f1; }
.hover\:from-amber-500:hover { --grad-from: #f59e0b; }
.hover\:to-emerald-400:hover { --grad-to: #34d399; }
.hover\:to-emerald-500:hover { --grad-to: #10b981; }
.hover\:to-indigo-400:hover { --grad-to: #818cf8; }
.hover\:to-amber-400:hover { --grad-to: #fbbf24; }

/* ── :focus variants ───────────────────────────────────────────── */
.focus\:border-emerald-500:focus { border-color: #10b981; }
.focus\:border-emerald-500\/60:focus { border-color: rgba(16, 185, 129, 0.60); }
.focus\:border-indigo-500\/60:focus { border-color: rgba(99, 102, 241, 0.60); }
.focus\:border-amber-500\/60:focus { border-color: rgba(245, 158, 11, 0.60); }

.focus\:ring-1:focus { box-shadow: 0 0 0 1px currentColor; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(16,185,129,0.2); }
.focus\:ring-emerald-500:focus { box-shadow: 0 0 0 1px #10b981; }
.focus\:ring-emerald-500\/20:focus { box-shadow: 0 0 0 2px rgba(16,185,129,0.20); }
.focus\:ring-indigo-500\/20:focus { box-shadow: 0 0 0 2px rgba(99,102,241,0.20); }
.focus\:ring-amber-500\/20:focus { box-shadow: 0 0 0 2px rgba(245,158,11,0.20); }

/* ── :active variants ──────────────────────────────────────────── */
.active\:bg-emerald-700:active { background-color: #047857; }
.active\:scale-\[0\.98\]:active { transform: scale(0.98); }

/* ── :disabled ─────────────────────────────────────────────────── */
.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* ── peer-checked (sibling state) ──────────────────────────────── */
.peer:checked ~ .peer-checked\:border-indigo-500 { border-color: #6366f1; }
.peer:checked ~ .peer-checked\:bg-indigo-500\/10 { background-color: rgba(99,102,241,0.10); }
.peer:checked ~ .peer-checked\:text-indigo-400 { color: #818cf8; }
.peer:checked ~ .peer-checked\:shadow-lg { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.peer:checked ~ .peer-checked\:shadow-md { box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.peer:checked ~ .peer-checked\:shadow-indigo-500\/10 { box-shadow: 0 4px 12px rgba(99,102,241,0.15); }
.peer:checked ~ .peer-checked\:border-amber-500 { border-color: #f59e0b; }
.peer:checked ~ .peer-checked\:bg-amber-500\/10 { background-color: rgba(245,158,11,0.10); }
.peer:checked ~ .peer-checked\:text-amber-400 { color: #fbbf24; }
.peer:checked ~ .peer-checked\:shadow-amber-500\/10 { box-shadow: 0 4px 12px rgba(245,158,11,0.15); }

/* ── [color-scheme:dark] arbitrary utility ─────────────────────── */
.\[color-scheme\:dark\] { color-scheme: dark; }

/* ── Responsive sm: (>=640px) ──────────────────────────────────── */
@media (min-width: 640px) {
    .sm\:inline { display: inline; }
    .sm\:items-center { align-items: center; }
    .sm\:py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
    .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .sm\:rounded-3xl { border-radius: 1.5rem; }
}

/* ── Dark mode variants (class-based) ──────────────────────────── */
.dark .dark\:block { display: block; }
.dark .dark\:hidden { display: none; }
.dark .dark\:bg-gray-900 { background-color: #111827; }
.dark .dark\:bg-gray-950 { background-color: #030712; }
.dark .dark\:bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.dark .dark\:text-gray-100 { color: #f3f4f6; }
.dark .dark\:text-gray-600 { color: #4b5563; }
.dark .dark\:from-gray-100 { --grad-from: #f3f4f6; }
.dark .dark\:to-gray-300 { --grad-to: #d1d5db; }

/* ── Light-mode overrides (preserved from old inline <style>) ──── */
html:not(.dark) input[type="text"],
html:not(.dark) input[type="date"],
html:not(.dark) input[type="password"],
html:not(.dark) textarea,
html:not(.dark) select {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(203, 213, 225, 0.9) !important;
    color: #1e293b !important;
}
html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder { color: #94a3b8 !important; }

html:not(.dark) .text-gray-100,
html:not(.dark) .text-gray-200,
html:not(.dark) .text-gray-300 { color: #1e293b; }
html:not(.dark) .text-gray-400 { color: #64748b; }
html:not(.dark) .text-gray-500 { color: #64748b; }
html:not(.dark) .text-gray-600 { color: #94a3b8; }

html:not(.dark) #header-title {
    background: linear-gradient(to right, #1e293b, #475569);
    -webkit-background-clip: text; background-clip: text;
}
html:not(.dark) #date-label { color: #0f172a; }
html:not(.dark) #progress-text { color: #64748b; }
html:not(.dark) #progress-percent { color: #059669; }

html:not(.dark) .task-card h3 { color: #0f172a; }
html:not(.dark) .task-card p  { color: #64748b; }
html:not(.dark) .task-done h3 { color: #065f46; }
html:not(.dark) .task-done p  { color: #059669; }

html:not(.dark) .task-card .text-gray-600 { color: #94a3b8; }
html:not(.dark) .task-card .check-btn { border-color: #cbd5e1; }
html:not(.dark) .task-done .check-btn {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

html:not(.dark) #empty-state p:first-of-type { color: #475569; }
html:not(.dark) #empty-state p:last-of-type  { color: #94a3b8; }

html:not(.dark) .modal-panel h2 { color: #0f172a; }
html:not(.dark) .modal-panel .text-gray-400,
html:not(.dark) .modal-panel .text-gray-500 { color: #64748b; }
html:not(.dark) .modal-panel .text-gray-300 { color: #334155; }
html:not(.dark) .modal-panel .text-gray-200 { color: #1e293b; }
html:not(.dark) .modal-panel button svg.text-gray-400 { color: #94a3b8; }

html:not(.dark) #new-cat-preview-name,
html:not(.dark) #edit-cat-preview-name { filter: saturate(1.5) brightness(0.7); }

html:not(.dark) #filter-cat-label { color: #64748b; }

html:not(.dark) .peer:checked ~ .peer-checked\:text-indigo-400 { color: #4f46e5; }
html:not(.dark) .peer:checked ~ .peer-checked\:text-amber-400  { color: #d97706; }

html:not(.dark) .bg-white\/5 { background: rgba(0, 0, 0, 0.04); }
html:not(.dark) .hover\:bg-white\/10:hover { background: rgba(0, 0, 0, 0.08); }
html:not(.dark) .hover\:bg-white\/5:hover  { background: rgba(0, 0, 0, 0.04); }

html:not(.dark) #date-prev svg,
html:not(.dark) #date-next svg { color: #475569; }

html:not(.dark) #btn-toggle-theme { background: rgba(0, 0, 0, 0.05); }
html:not(.dark) #btn-toggle-theme:hover { background: rgba(0, 0, 0, 0.10); }

/* Respect prefers-reduced-motion — switches off all animations */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
