/*
 * Dark mode. <html class="dark"> is set before the page paints (see the
 * theme script in the layout) from the visitor's choice, or their system's.
 * Every colour class the views use has its dark counterpart here, so views
 * stay single-themed; test/dark_mode_coverage_test.rb fails when a view uses
 * a colour class that is missing below. Mode-neutral classes (solid buttons
 * like bg-sky-600 with text-white, rings) need no entry.
 */
.dark { color-scheme: dark; }

/* Surfaces */
.dark .bg-slate-50 { background-color: #020617; }
.dark .bg-white { background-color: #0f172a; }
.dark .bg-slate-100 { background-color: #1e293b; }
.dark .hover\:bg-slate-50:hover { background-color: #1e293b; }
.dark .hover\:bg-slate-200:hover { background-color: #334155; }
.dark .bg-slate-900 { background-color: #020617; }

/* Text */
.dark .text-slate-900 { color: #f1f5f9; }
.dark .text-slate-800 { color: #e2e8f0; }
.dark .text-slate-700 { color: #cbd5e1; }
.dark .text-slate-600 { color: #a3b1c6; }
.dark .text-slate-500 { color: #94a3b8; }
.dark .text-slate-400 { color: #64748b; }
.dark .text-slate-100 { color: #f1f5f9; }
.dark .text-gray-600 { color: #a3b1c6; }

/* Lines */
.dark .border-slate-100, .dark .divide-slate-100 > :not(:last-child) { border-color: #1e293b; }
.dark .border-slate-200, .dark .divide-slate-200 > :not(:last-child) { border-color: #1e293b; }
.dark .border-slate-300 { border-color: #334155; }

/* Accents: text */
.dark .text-sky-600, .dark .hover\:text-sky-600:hover { color: #38bdf8; }
.dark .text-sky-800, .dark .hover\:text-sky-800:hover { color: #7dd3fc; }
.dark .text-emerald-600, .dark .text-emerald-700 { color: #34d399; }
.dark .text-emerald-800 { color: #6ee7b7; }
.dark .text-red-600, .dark .text-red-700, .dark .hover\:text-red-700:hover { color: #f87171; }
.dark .text-red-800, .dark .hover\:text-red-800:hover { color: #fca5a5; }
.dark .text-amber-600, .dark .text-amber-700 { color: #fbbf24; }
.dark .text-amber-800, .dark .text-amber-900, .dark .hover\:text-amber-800:hover { color: #fcd34d; }
.dark .text-green-700 { color: #4ade80; }
.dark .text-green-800 { color: #86efac; }

/* Accents: tinted surfaces */
.dark .bg-emerald-100 { background-color: rgb(16 185 129 / 0.18); }
.dark .hover\:bg-emerald-200:hover { background-color: rgb(16 185 129 / 0.30); }
.dark .bg-sky-100 { background-color: rgb(14 165 233 / 0.18); }
.dark .bg-red-50, .dark .bg-red-100 { background-color: rgb(239 68 68 / 0.15); }
.dark .bg-green-100 { background-color: rgb(34 197 94 / 0.18); }
.dark .bg-amber-50 { background-color: rgb(245 158 11 / 0.12); }
.dark .bg-amber-100 { background-color: rgb(245 158 11 / 0.18); }
.dark .bg-amber-50\/60 { background-color: rgb(245 158 11 / 0.07); }
.dark .bg-amber-200 { background-color: rgb(245 158 11 / 0.35); }

/* Accents: lines */
.dark .border-red-200 { border-color: rgb(239 68 68 / 0.35); }
.dark .border-amber-200 { border-color: rgb(245 158 11 / 0.35); }
.dark .hover\:border-sky-300:hover { border-color: #0369a1; }
.dark .hover\:border-emerald-300:hover { border-color: #047857; }

/* Form controls follow the theme */
.dark input:not([type=checkbox]):not([type=radio]):not([type=submit]),
.dark select, .dark textarea { background-color: #0f172a; color: #f1f5f9; }
/* The app icon's own dark square needs an edge on the dark header. */
.dark .logo-icon { border-radius: 22%; box-shadow: 0 0 0 1px #334155; }

/* Screenshots come in both themes (script/screenshots.rb); show the matching one. */
.screen-dark { display: none; }
.dark .screen-dark { display: block; }
.dark .screen-light { display: none; }
.dark img.screenshot { box-shadow: 0 0 0 1px #1e293b, 0 20px 40px -20px rgb(0 0 0 / 0.8); }
