/* ──────────────────────────────────────────────────────────────────────────
   Static Tailwind subset — replaces the runtime Tailwind Play CDN.

   The Play CDN (cdn.tailwindcss.com) is a ~300 KB in-browser JIT compiler not
   intended for production; it delayed first paint and caused a flash of
   unstyled content on every load. This file hand-rolls exactly the Tailwind v3
   utilities the app uses (enumerate with:
     grep -rhoE 'class="[^"]*"' index.html js/*.js app.js) plus the parts of
   Preflight the layout relies on. Loaded before styles.css so the design
   system and inline styles still win on conflicts.

   If you add a NEW Tailwind class in markup, add its rule here too.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Preflight (subset used by the app) ─────────────────────────────────────
   Tailwind resets box-sizing globally, zeroes borders (so `.border` only needs
   a width), and strips default heading/paragraph margins — utilities like
   `.mb-3` on an <h5> assume that reset. */
*, ::before, ::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; margin: 0; }
p, figure, blockquote, dl, dd { margin: 0; }
button { background-color: transparent; background-image: none; }

/* ── Display / position ── */
.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

/* ── Flexbox / grid ── */
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }

/* ── Sizing ── */
.w-full { width: 100%; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.h-64 { height: 16rem; }
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.max-h-full { max-height: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ── Overflow ── */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* ── Padding ── */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.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; }
.pb-2 { padding-bottom: 0.5rem; }

/* ── Margin ── */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }

/* ── Borders / radius ── */
.border { border-width: 1px; }
.border-0 { border-width: 0; }
.border-b { border-bottom-width: 1px; }
.border-b-2 { border-bottom-width: 2px; }
.border-t { border-top-width: 1px; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* ── 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-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.text-gray-500 { color: #6b7280; }

/* ── Backgrounds (Tailwind opacity-variable pattern) ── */
.bg-white { --tw-bg-opacity: 1; background-color: rgba(255, 255, 255, var(--tw-bg-opacity)); }
.bg-black { --tw-bg-opacity: 1; background-color: rgba(0, 0, 0, var(--tw-bg-opacity)); }
.bg-gray-50 { --tw-bg-opacity: 1; background-color: rgba(249, 250, 251, var(--tw-bg-opacity)); }
.bg-gray-100 { --tw-bg-opacity: 1; background-color: rgba(243, 244, 246, var(--tw-bg-opacity)); }
.bg-opacity-40 { --tw-bg-opacity: 0.4; }

/* ── Effects ── */
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.resize-none { resize: none; }

/* ── Animation ── */
.animate-spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── State + responsive variants ── */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:text-gray-700:hover { color: #374151; }
@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:justify-between { justify-content: space-between; }
}
