/*
 * Assigns the legacy Bootstrap 5 template CSS to the "legacy" cascade layer,
 * without going through the Next.js/Turbopack build (which tries — and fails
 * — to resolve root-relative @import paths as local modules). This file is
 * served as-is from /public, so the browser resolves these @imports natively
 * at runtime.
 *
 * THE LINE BELOW IS THE ACTUAL SOURCE OF TRUTH FOR GLOBAL LAYER ORDER, not
 * the one in styles/app.css. This file's <link> is placed first in <head>
 * (see the (portal)/(full-width) layouts), so whichever `@layer` statement
 * this file encounters first is what fixes the order for the WHOLE
 * document — every later `@layer` statement (including the one in
 * styles/app.css) just populates the already-decided slots and cannot
 * reorder them. Keep the two files' declarations identical; this comment
 * exists because the order genuinely can't be reasoned about from app.css
 * alone.
 *
 * ORDER, AND WHY IT'S THIS WAY (verified against a real bug — read before
 * changing): `tw-theme, tw-utilities, legacy`. Tailwind's layers are
 * declared BEFORE `legacy`, and the utilities layer is imported with the
 * `important` keyword in styles/app.css. Both halves matter:
 *
 *   - For NORMAL declarations, cascade layers apply in declaration order —
 *     LATER wins. That alone would make `legacy` (last here) beat Tailwind,
 *     which is backwards from the whole point of this migration.
 *   - `important` flips it: an `!important` declaration in the
 *     tw-utilities layer beats `legacy`'s NORMAL declarations regardless of
 *     layer order, because importance always beats non-importance within
 *     the same origin.
 *   - But the purchased Bootstrap template ALSO marks its own utility
 *     classes `!important` throughout (confirmed: public/css/style-rtl.css
 *     defines `.py-8 { padding: 7rem !important; }` — a real collision with
 *     Tailwind's own `.py-8` = 2rem, which silently broke a dashboard
 *     layout in production testing before this was understood). For TWO
 *     important declarations in different layers, the spec reverses layer
 *     order again: the EARLIER-declared layer wins. That's exactly why
 *     `tw-utilities` is declared BEFORE `legacy` here — so Tailwind's
 *     important utilities win that fight too.
 *
 * Getting this backwards (legacy declared first) was tried and reverted:
 * it protects normal-declaration priority correctly but silently loses
 * every Tailwind utility whose name collides with an !important Bootstrap
 * utility — a large, silent surface (Bootstrap marks nearly all of its own
 * utility classes !important: opacity-*, shadow-*, top-*, border-*, and
 * many more overlap with Tailwind's own naming).
 *
 * `auth-gate` is declared FIRST, ahead of tw-theme, and holds exactly one
 * rule (styles/app.css, bottom of file): the pre-paint `data-auth` gate that
 * hides the half of the chrome a given viewer must not see. By the same
 * reversed-order rule explained above, the earliest layer wins among
 * important declarations — so this is what lets that one rule beat Tailwind's
 * own important `hidden` / `lg:flex` on the elements it hides. Written
 * unlayered it silently lost, because for the important tier unlayered ranks
 * BELOW every layer.
 */
@layer auth-gate, tw-theme, tw-utilities, legacy;

@import url("template.css") layer(legacy);
@import url("style-rtl.css") layer(legacy);
