/* TowAdmin app layer. Built only from the Xilyxis tokens and primitives in ./xds (synced, never edited here).
   Light and dark both resolve through the tokens; nothing here names a color directly. */

/* Every page is set in the design system's sans, Inter (--xlx-font-sans), self-hosted with the tokens. The design
   system's serif reading system (typography.css) is for reading-heavy products and is not used here. */

/* =========================================================================
   Xilyxis Design System — Core tokens
   Colors, typography, spacing, radii, shadows, glass effects.

   Light + dark variants. Default: dark (matches current marketing site).
   Toggle by setting [data-theme="light"] on <html> or any ancestor.
   ========================================================================= */

/* ---------- Fonts ----------
   The webfonts are self-hosted beside this file (fonts/, Latin + Latin
   Extended, SIL OFL 1.1): served from the app's own origin, so a
   Content-Security-Policy of 'self' admits them and no page view reaches a
   third party. Each family falls back to the system stack in its token below.
   ------------------------------------------------------------------- */

/* Self-hosted webfonts for the Xilyxis design system (Latin + Latin Extended).
   Generated from Google Fonts' css2 stylesheet; every file is served from the
   app's own origin, so the Content-Security-Policy stays 'self' and no page view
   reaches a third party. The families are licensed under the SIL Open Font
   License 1.1 (see OFL.txt). Regenerate rather than hand-edit. */

/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-italic-400-latin-ext-B7_fu1kp.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-italic-400-latin-BqAiT5Ww.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-italic-500-latin-ext-xMSC0T8m.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-italic-500-latin-As4cCeDr.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-normal-400-latin-ext-BmRBH3aV.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-normal-400-latin-DMJ8VG8y.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-normal-500-latin-ext-CAhNIIs5.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-normal-500-latin-DSY6xOcd.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-normal-600-latin-ext-D38SheWl.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-normal-600-latin-BgSNZQsw.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/inter-normal-400-latin-ext-DO1Apj_S.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/inter-normal-400-latin-Dx4kXJAl.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/inter-normal-400-latin-ext-DO1Apj_S.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/inter-normal-400-latin-Dx4kXJAl.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/inter-normal-400-latin-ext-DO1Apj_S.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/inter-normal-400-latin-Dx4kXJAl.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/inter-normal-400-latin-ext-DO1Apj_S.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/inter-normal-400-latin-Dx4kXJAl.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/inter-normal-400-latin-ext-DO1Apj_S.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/inter-normal-400-latin-Dx4kXJAl.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/jetbrains-mono-normal-400-latin-ext-DIC32ArD.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/jetbrains-mono-normal-400-latin-6fWv1k7M.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/jetbrains-mono-normal-400-latin-ext-DIC32ArD.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/jetbrains-mono-normal-400-latin-6fWv1k7M.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/jetbrains-mono-normal-400-latin-ext-DIC32ArD.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/jetbrains-mono-normal-400-latin-6fWv1k7M.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/literata-italic-400-700-latin-ext--EJQ9LTF.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/literata-italic-400-700-latin-Ckc1vdjp.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/literata-normal-400-700-latin-ext--vWOuwpV.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/literata-normal-400-700-latin-Cedbco83.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/source-serif-4-italic-400-700-latin-ext-BhUEwDRF.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/source-serif-4-italic-400-700-latin-BOLXpvkj.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/source-serif-4-normal-400-700-latin-ext-HoL-AExg.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/source-serif-4-normal-400-700-latin-BpEBLj1O.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fraunces-italic-400-700-latin-ext-Dz662GA1.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fraunces-italic-400-700-latin-Gj8mmBt-.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fraunces-normal-400-700-latin-ext-BgdtRcEq.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fraunces-normal-400-700-latin-BBJlbjAS.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/dm-serif-display-italic-400-latin-ext-DiLdooSn.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/dm-serif-display-italic-400-latin-DpcbibHm.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/dm-serif-display-normal-400-latin-ext-p18AlW_x.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/dm-serif-display-normal-400-latin-C5_t9oOD.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Courier Prime';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/courier-prime-italic-400-latin-ext-BTeyNO-8.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Courier Prime';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/courier-prime-italic-400-latin-CaR7PCvg.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Courier Prime';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/courier-prime-italic-700-latin-ext-BzK4HIs4.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Courier Prime';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/courier-prime-italic-700-latin-CZikIXQl.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/courier-prime-normal-400-latin-ext-B-EsvyE4.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/courier-prime-normal-400-latin-BbyBr73r.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/courier-prime-normal-700-latin-ext-ByMJlNdM.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/courier-prime-normal-700-latin-D1YCjmaD.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  /* ============ Neutral scale (Tailwind gray) ============ */
  --xlx-gray-50:   #f9fafb;
  --xlx-gray-100:  #f3f4f6;
  --xlx-gray-200:  #e5e7eb;
  --xlx-gray-300:  #d1d5db;
  --xlx-gray-400:  #9ca3af;
  --xlx-gray-500:  #6b7280;
  --xlx-gray-600:  #4b5563;
  --xlx-gray-700:  #374151;
  --xlx-gray-800:  #1f2937;
  --xlx-gray-900:  #111827;
  --xlx-gray-950:  #0b1220;

  /* ============ Semantic status ============
     Brand and the status TEXT tones are theme-specific, so they live in the
     theme blocks below, never here: a value on bare `:root` is what a nested
     `[data-theme="dark"]` scope inside a light page would inherit. */
  --xlx-neutral-muted-rgb:   156, 163, 175; /* raw RGB for rgba() usage */
  --xlx-ink-on-color:        rgba(255, 255, 255, 0.92); /* text on a saturated colour chip */

  /* Status TEXT and status FILL are different tokens, because they pull in
     opposite directions: text wants a tone that stands off the background
     (light at night, deep in daylight), while a solid fill under white ink
     wants a deep tone in every theme. `--xlx-danger` was once both and passed
     as neither at night (white on #F87171 is 2.77:1). The fills below are
     theme-invariant: white ink clears 4.5:1 on each in any theme. */
  --xlx-danger-fill:  #B91C1C;         /* danger button / solid danger surface */
  --xlx-danger-ink:   #ffffff;         /* foreground on --xlx-danger-fill */
  --xlx-success-fill: #166534;         /* solid success surface (e.g. a done step) */
  --xlx-success-ink:  #ffffff;         /* foreground on --xlx-success-fill */
  --xlx-overlay:    var(--xlx-scrim);  /* modal/dialog backdrop */

  /* ============ Spacing scale (4px base) ============ */
  --xlx-space-0:   0;
  --xlx-space-1:   0.25rem;   /*  4 */
  --xlx-space-2:   0.5rem;    /*  8 */
  --xlx-space-3:   0.75rem;   /* 12 */
  --xlx-space-4:   1rem;      /* 16 */
  --xlx-space-5:   1.25rem;   /* 20 */
  --xlx-space-6:   1.5rem;    /* 24 */
  --xlx-space-7:   1.75rem;   /* 28 */
  --xlx-space-8:   2rem;      /* 32 */
  --xlx-space-10:  2.5rem;    /* 40 */
  --xlx-space-12:  3rem;      /* 48 */
  --xlx-space-16:  4rem;      /* 64 */
  --xlx-space-20:  5rem;      /* 80 */

  /* ============ Radii ============ */
  --xlx-radius-sm:   0.375rem;  /*  6 — small tags/chips */
  --xlx-radius-md:   0.5rem;    /*  8 — buttons, inputs */
  --xlx-radius-lg:   0.75rem;   /* 12 — cards, header */
  --xlx-radius-xl:   1rem;      /* 16 — big panels */
  --xlx-radius-2xl:  1.5rem;    /* 24 — hero cards */
  --xlx-radius-full: 9999px;

  /* ============ Button sizing scale ============
     The shared Button, IconButton and SegmentedControl (@xlx/ui) size themselves from these, so
     the scale is tuned here without touching a component. `lg` is a page's primary call to action
     and the touch-target step. */
  --xlx-btn-font-xs:      11px;
  --xlx-btn-font-sm:      12px;
  --xlx-btn-font-md:      13px;
  --xlx-btn-font-lg:      15px;
  --xlx-btn-line-xs:      16px;
  --xlx-btn-line-sm:      18px;
  --xlx-btn-line-md:      20px;
  --xlx-btn-line-lg:      22px;
  --xlx-btn-pad-y-xs:     3px;
  --xlx-btn-pad-y-sm:     4px;
  --xlx-btn-pad-y-md:     5px;
  --xlx-btn-pad-y-lg:     10px;
  --xlx-btn-pad-x-xs:     8px;
  --xlx-btn-pad-x-sm:     10px;
  --xlx-btn-pad-x-md:     14px;
  --xlx-btn-pad-x-lg:     22px;
  --xlx-btn-min-h-lg:     48px;
  --xlx-icon-btn-size-lg: 44px;

  /* ============ Button and DetailHero component tokens: shape ============
     @xlx/ui's Button and DetailHero read every visual value from `--xlx-btn-*` and
     `--xlx-detail-hero-*` (the manifest's componentTokenFamilies). These are the core's values; a
     product overlay may redeclare tokens in those two families, and no other core token.
     The variant colours, rings and hover states are in the theme-aware block further down. */
  --xlx-btn-radius-xs:    var(--xlx-radius-md);
  --xlx-btn-radius-sm:    var(--xlx-radius-md);
  --xlx-btn-radius-md:    var(--xlx-radius-md);
  --xlx-btn-radius-lg:    var(--xlx-radius-md);
  --xlx-btn-weight:       500;
  --xlx-btn-gap:          6px;
  --xlx-btn-justify:      normal;
  --xlx-btn-align:        center;   /* align-items: a multi-line label's cross-axis placement */
  --xlx-btn-white-space:  nowrap;   /* a label stays on one line unless a product or variant wraps it */
  --xlx-btn-font-family:  inherit;  /* the label face: the surrounding text's, unless a product sets one */
  --xlx-btn-border-width: 0px;
  --xlx-btn-icon-xs:      12px;
  --xlx-btn-icon-sm:      13px;
  --xlx-btn-icon-md:      15px;
  --xlx-btn-icon-lg:      17px;
  --xlx-btn-press-transform:   none;
  --xlx-btn-disabled-opacity:  0.45;
  --xlx-detail-hero-title-size:    18px;
  --xlx-detail-hero-title-weight:  700;
  --xlx-detail-hero-subtitle-size: 13px;
  --xlx-detail-hero-gap:           14px;
  --xlx-detail-hero-pad-block:     24px;
  --xlx-detail-hero-pad-top:       0px;
  --xlx-detail-hero-title-margin-top:    0px;
  --xlx-detail-hero-title-line:    1.3;
  --xlx-detail-hero-subtitle-margin-top: 4px;
  --xlx-detail-hero-subtitle-line: 1.5;
  --xlx-detail-hero-subtitle-font: var(--xlx-font-body);
  --xlx-detail-hero-subtitle-vf:   var(--xlx-font-body-vf);

  /* ============ Stacking ============
     One scale for every layer, so an overlay never has to guess a number.
     Menus and popovers sit above the modal so one opened from inside a
     dialog shows over it; while a modal is open nothing behind it can open
     a menu, so they never cover a dialog from outside. */
  --xlx-z-below:    -1;     /* fixed backdrops behind the page */
  --xlx-z-base:     0;
  --xlx-z-raised:   10;     /* sticky table heads, floating controls inside a pane */
  --xlx-z-sticky:   50;     /* sticky page header */
  --xlx-z-overlay:  1000;   /* scrim behind a modal */
  --xlx-z-modal:    1100;
  --xlx-z-dropdown: 1200;   /* menus and selects anchored to a control */
  --xlx-z-popover:  1300;   /* popovers and hover cards */
  --xlx-z-toast:    1400;
  --xlx-z-tooltip:  1500;

  /* ============ Motion ============ */
  --xlx-ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --xlx-ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --xlx-duration-1:  150ms;
  --xlx-duration-2:  200ms;
  --xlx-duration-3:  300ms;

  /* ============ Font families ============ */
  --xlx-font-sans:  'Inter', system-ui, Avenir, Helvetica, Arial, sans-serif;
  --xlx-font-mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Book-writing app stack — additive, opt-in.
     Use on the manuscript surface itself; UI chrome stays on --xlx-font-sans. */
  --xlx-font-reading:    'Literata', Georgia, serif;                                     /* long-form body */
  --xlx-font-editorial:  'Source Serif 4', 'Source Serif Pro', Georgia, Cambria, serif; /* alt manuscript */
  --xlx-font-draft:      'Courier Prime', 'IBM Plex Mono', monospace;                   /* typewriter draft */

  /* ============ Type scale ============ */
  --xlx-text-xs:   0.75rem;   /* 12 */
  --xlx-text-sm:   0.875rem;  /* 14 */
  --xlx-text-base: 1rem;      /* 16 */
  --xlx-text-lg:   1.125rem;  /* 18 */
  --xlx-text-xl:   1.25rem;   /* 20 */
  --xlx-text-2xl:  1.5rem;    /* 24 */
  --xlx-text-3xl:  1.875rem;  /* 30 */
  --xlx-text-4xl:  2.25rem;   /* 36 */
  --xlx-text-5xl:  3rem;      /* 48 */
  --xlx-text-6xl:  3.75rem;   /* 60 */

  --xlx-leading-tight: 1.15;
  --xlx-leading-snug:  1.35;
  --xlx-leading-base:  1.55;
  --xlx-leading-loose: 1.75;

  --xlx-tracking-tight:  -0.02em;
  --xlx-tracking-normal:  0;
  --xlx-tracking-wide:    0.02em;
  --xlx-tracking-caps:    0.12em;
}

/* The severity ramp: a finding's or a check's level, as a status colour and its subtle ground.
   Aliases of the status tokens, declared wherever a theme or palette is, so each resolves in its
   own pairing. */
:root,
[data-theme],
[data-palette] {
  --xlx-sev-ok:      var(--xlx-success);
  --xlx-sev-ok-bg:   var(--xlx-success-subtle);
  --xlx-sev-low:     var(--xlx-info);
  --xlx-sev-low-bg:  var(--xlx-info-subtle);
  --xlx-sev-med:     var(--xlx-warning);
  --xlx-sev-med-bg:  var(--xlx-warning-subtle);
  --xlx-sev-high:    var(--xlx-danger);
  --xlx-sev-high-bg: var(--xlx-danger-subtle);
}

/* The Button variants' colours, rings and hover states. Declared wherever a theme or palette is, as the
   severity ramp is, so each resolves against its own brand and surface tokens.
   `-ring` is a complete box-shadow layer, never `none` (`none` cannot sit in a shadow list beside a
   glow); a variant with no ring is the zero shadow. `-hover-shadow` is drawn with the ring, so it is
   a layer too, never `none`. A hover token that is `initial` is a hover with no change for that
   property. */
:root,
[data-theme],
[data-palette] {
  --xlx-btn-primary-bg:             var(--xlx-brand);
  --xlx-btn-primary-fg:             var(--xlx-fg-on-brand);
  --xlx-btn-primary-ring:           0 0 0 0 transparent;
  --xlx-btn-primary-border:         transparent;
  --xlx-btn-primary-hover-bg:       initial;
  --xlx-btn-primary-hover-fg:       initial;
  --xlx-btn-primary-hover-shadow:   initial;
  --xlx-btn-primary-hover-filter:   initial;

  --xlx-btn-secondary-bg:           var(--xlx-control);
  --xlx-btn-secondary-fg:           var(--xlx-fg);
  --xlx-btn-secondary-ring:         inset 0 0 0 1px var(--xlx-border-subtle);
  --xlx-btn-secondary-border:       transparent;
  --xlx-btn-secondary-hover-bg:     var(--xlx-control-hover);
  --xlx-btn-secondary-hover-fg:     initial;
  --xlx-btn-secondary-hover-shadow: initial;
  --xlx-btn-secondary-hover-filter: initial;

  --xlx-btn-outline-bg:             transparent;
  --xlx-btn-outline-fg:             var(--xlx-brand);
  --xlx-btn-outline-ring:           inset 0 0 0 1px var(--xlx-brand);
  --xlx-btn-outline-border:         transparent;
  --xlx-btn-outline-hover-bg:       var(--xlx-brand);
  --xlx-btn-outline-hover-fg:       var(--xlx-fg-on-brand);
  --xlx-btn-outline-hover-shadow:   initial;
  --xlx-btn-outline-hover-filter:   initial;

  --xlx-btn-ghost-bg:               transparent;
  --xlx-btn-ghost-fg:               var(--xlx-fg);
  --xlx-btn-ghost-ring:             inset 0 0 0 1px var(--xlx-border);
  --xlx-btn-ghost-border:           transparent;
  --xlx-btn-ghost-hover-bg:         initial;
  --xlx-btn-ghost-hover-fg:         initial;
  --xlx-btn-ghost-hover-shadow:     initial;
  --xlx-btn-ghost-hover-filter:     initial;

  --xlx-btn-danger-bg:              var(--xlx-danger-fill);
  --xlx-btn-danger-fg:              var(--xlx-danger-ink);
  --xlx-btn-danger-ring:            0 0 0 0 transparent;
  --xlx-btn-danger-border:          transparent;
  --xlx-btn-danger-hover-bg:        initial;
  --xlx-btn-danger-hover-fg:        initial;
  --xlx-btn-danger-hover-shadow:    initial;
  --xlx-btn-danger-hover-filter:    initial;

  /* quiet: ghost without the resting ring, for in-context actions that sit inside a bordered
     container (rows, headers, toolbars). The surface tint on hover is its only edge. */
  --xlx-btn-quiet-bg:               transparent;
  --xlx-btn-quiet-fg:               var(--xlx-fg);
  --xlx-btn-quiet-ring:             0 0 0 0 transparent;
  --xlx-btn-quiet-border:           transparent;
  --xlx-btn-quiet-hover-bg:         var(--xlx-surface-muted);
  --xlx-btn-quiet-hover-fg:         initial;
  --xlx-btn-quiet-hover-shadow:     initial;
  --xlx-btn-quiet-hover-filter:     initial;

  /* danger-outline: a destructive secondary action, beside a neutral one, where the full danger
     fill would outshout the page's main action. Fills with the danger fill on hover, as outline
     fills with brand. */
  --xlx-btn-danger-outline-bg:           transparent;
  --xlx-btn-danger-outline-fg:           var(--xlx-danger);
  --xlx-btn-danger-outline-ring:         inset 0 0 0 1px var(--xlx-danger);
  --xlx-btn-danger-outline-border:       transparent;
  --xlx-btn-danger-outline-hover-bg:     var(--xlx-danger-fill);
  --xlx-btn-danger-outline-hover-fg:     var(--xlx-danger-ink);
  --xlx-btn-danger-outline-hover-shadow: initial;
  --xlx-btn-danger-outline-hover-filter: initial;
}

/* =========================================================================
   DARK THEME (default — matches current marketing site)
   ========================================================================= */
:root,
[data-theme="dark"] {
  color-scheme: dark;   /* UA chrome (scrollbars, form controls) follows the applied theme */

  /* Brand */
  --xlx-brand:           #A3DAFF;   /* primary — light cyan / sky blue */
  --xlx-brand-dark:      #7BC4F2;   /* primary hover */
  --xlx-brand-light:     #C2EEFF;   /* accents, borders */
  --xlx-brand-ink:       #0B1220;   /* foreground when on brand fill */
  --xlx-brand-rgb:       163, 218, 255;   /* raw RGB for rgba() usage */
  --xlx-brand-dark-rgb:  123, 196, 242;   /* --xlx-brand-dark raw RGB */

  --xlx-bg:              #0b1220;                          /* page background (slightly deeper than gray-900 for depth) */
  --xlx-bg-raised:       #111827;                          /* gray-900 */
  --xlx-surface:         #1f2937;                          /* gray-800 — opaque cards */
  --xlx-surface-2:       #374151;                          /* gray-700 — hover on surface */
  --xlx-surface-muted:   rgba(31, 41, 55, 0.5);            /* translucent feature tiles */
  --xlx-surface-1:       #161e2b;                          /* nested panels, between bg-raised and surface */
  --xlx-surface-hover:   var(--xlx-surface-2);             /* row/cell hover fill */
  --xlx-surface-accent:  rgba(var(--xlx-brand-rgb), 0.10); /* hover/active fill on menu rows and segmented controls */
  /* Control fill — neutral medium-emphasis button surface, lifted above cards
     without going full brand. */
  --xlx-control:         #2f3a4d;
  --xlx-control-hover:   #3a4659;

  --xlx-fg:              #ffffff;                          /* headings, emphasized */
  --xlx-fg-1:            #e5e7eb;                          /* high-contrast body */
  --xlx-fg-2:            #d1d5db;                          /* body */
  --xlx-fg-muted:        #aab1bc;                          /* descriptions */
  --xlx-fg-subtle:       #6b7280;                          /* decoration and disabled only, never readable text */
  --xlx-fg-inverse:      #ffffff;                          /* text on a dark solid chip */
  --xlx-fg-on-brand:     var(--xlx-brand-ink);             /* text on a brand fill */
  --xlx-toggle-thumb:    #ffffff;                          /* switch knob */

  --xlx-border:          #374151;                          /* standard divider */
  --xlx-border-subtle:   #1f2937;                          /* barely-there lines */
  --xlx-border-strong:   #4b5563;                          /* focused borders */

  /* Glass — the signature treatment */
  --xlx-glass:           rgba(255, 255, 255, 0.08);
  --xlx-glass-strong:    rgba(255, 255, 255, 0.14);
  --xlx-glass-border:    rgba(255, 255, 255, 0.18);
  --xlx-glass-border-hi: rgba(255, 255, 255, 0.28);
  --xlx-glass-blur:      16px;                              /* slightly stronger than legacy 12px */
  --xlx-glass-saturate:  140%;

  /* Shadows */
  --xlx-shadow-sm:  0 1px 2px  rgba(0, 0, 0, 0.25);
  --xlx-shadow-md:  0 4px 12px rgba(0, 0, 0, 0.30);
  --xlx-shadow-lg:  0 10px 30px rgba(0, 0, 0, 0.38);
  --xlx-shadow-xl:  0 24px 60px rgba(0, 0, 0, 0.45);
  --xlx-shadow-glow: 0 0 0 1px rgba(163, 218, 255, 0.25), 0 8px 30px rgba(163, 218, 255, 0.18);

  /* Scrim — full-screen darkening overlay */
  --xlx-scrim:      rgba(0, 0, 0, 0.60);
  --xlx-scrim-soft: rgba(0, 0, 0, 0.20);

  /* Status text, and the one tint vocabulary (`*-subtle`) for status
     backgrounds. Amber is opaque at night so it stays legible over a
     background image. */
  --xlx-success:         #6EE7B7;
  --xlx-warning:         #FBBF24;
  --xlx-danger:          #FECACA;
  --xlx-info:            #bcc5fd;   /* soft indigo, distinct from the cyan brand; 6.2:1 or more on every dark surface */
  --xlx-success-rgb:     110, 231, 183;
  --xlx-warning-rgb:     251, 191, 36;
  --xlx-danger-rgb:      254, 202, 202;
  --xlx-success-subtle:  rgba(var(--xlx-success-rgb), 0.12);
  --xlx-warning-subtle:  #3b3b35;
  --xlx-danger-subtle:   rgba(var(--xlx-danger-rgb), 0.12);
  --xlx-info-subtle:     rgba(188, 197, 253, 0.12);

  /* Brand tints */
  --xlx-brand-subtle:    rgba(var(--xlx-brand-rgb), 0.12);
  --xlx-brand-alpha-20:  rgba(var(--xlx-brand-rgb), 0.20);
  --xlx-brand-alpha-40:  rgba(var(--xlx-brand-rgb), 0.40);

  /* Accent — secondary violet, distinct from brand blue; used for category/icon badges */
  --xlx-accent:         #c084fc;   /* violet-400 — secondary accent */

  /* Focus ring */
  --xlx-ring:       0 0 0 2px var(--xlx-bg), 0 0 0 4px var(--xlx-brand-dark);

}

/* =========================================================================
   LIGHT THEME — new, for the "extendable" case
   Keeps the same brand primary but inverts the neutral stack.
   Glass sits on top of a soft off-white rather than a photo background.
   ========================================================================= */
[data-theme="light"] {
  color-scheme: light;

  /* Brand shifts deeper in light mode so links/icons meet contrast on white */
  --xlx-brand:           #16639A;   /* deep sky — 5.3:1 as text on every light surface, 6.4:1 under white */
  --xlx-brand-dark:      #114E7A;   /* hover */
  --xlx-brand-light:     #A3DAFF;   /* accent / surface tint */
  --xlx-brand-ink:       #ffffff;   /* foreground when on brand fill */
  --xlx-brand-rgb:       22, 99, 154;    /* raw RGB of --xlx-brand, for tints */
  --xlx-brand-dark-rgb:  17, 78, 122;    /* raw RGB of --xlx-brand-dark */

  --xlx-bg:              #EEF2F7;
  --xlx-bg-raised:       #ffffff;
  --xlx-surface:         #ffffff;
  --xlx-surface-2:       #E4EBF3;
  --xlx-surface-muted:   rgba(17, 24, 39, 0.05);
  --xlx-surface-1:       #F4F7FB;
  --xlx-surface-hover:   var(--xlx-surface-2);
  --xlx-surface-accent:  rgba(var(--xlx-brand-rgb), 0.08);
  --xlx-control:         #dce4ef;   /* distinct from white cards */
  --xlx-control-hover:   #c9d6e7;

  --xlx-fg:              #0b1220;
  --xlx-fg-1:            #111827;
  --xlx-fg-2:            #1f2937;
  --xlx-fg-muted:        #334155;
  --xlx-fg-subtle:       #475569;
  --xlx-fg-inverse:      #ffffff;
  --xlx-fg-on-brand:     var(--xlx-brand-ink);
  --xlx-toggle-thumb:    #ffffff;

  --xlx-border:          #D1D9E2;
  --xlx-border-subtle:   #E4EBF3;
  --xlx-border-strong:   #A3B2C2;

  /* Glass on light: lower opacity + stronger borders so the backdrop blur reads */
  --xlx-glass:           rgba(255, 255, 255, 0.50);
  --xlx-glass-strong:    rgba(255, 255, 255, 0.70);
  --xlx-glass-border:    rgba(17, 24, 39, 0.18);
  --xlx-glass-border-hi: rgba(17, 24, 39, 0.28);
  --xlx-glass-blur:      20px;
  --xlx-glass-saturate:  180%;

  --xlx-shadow-sm:  0 1px 2px rgba(15, 23, 42, 0.08);
  --xlx-shadow-md:  0 4px 14px rgba(15, 23, 42, 0.12);
  --xlx-shadow-lg:  0 14px 36px rgba(15, 23, 42, 0.16);
  --xlx-shadow-xl:  0 28px 70px rgba(15, 23, 42, 0.22);
  --xlx-shadow-glow: 0 0 0 1px rgba(var(--xlx-brand-rgb), 0.40), 0 8px 30px rgba(var(--xlx-brand-rgb), 0.30);

  /* Scrim — full-screen darkening overlay (lighter in light mode) */
  --xlx-scrim:      rgba(15, 23, 42, 0.55);
  --xlx-scrim-soft: rgba(15, 23, 42, 0.12);

  /* Status text — deepened for daylight. The dark theme's 400-weight tones
     fall to ~2.3:1 on cream and white; these reach 4.5:1 on every light
     surface, including small badge text on its own `*-subtle` tint. Solid
     fills use the invariant `--xlx-*-fill` tokens instead. */
  --xlx-success:        #166534;
  --xlx-warning:        #92400E;
  --xlx-danger:         #A61B1B;
  --xlx-info:           #1D4ED8;
  --xlx-success-rgb:    22, 101, 52;
  --xlx-warning-rgb:    146, 64, 14;
  --xlx-danger-rgb:     166, 27, 27;
  --xlx-success-subtle: #dcfce7;
  --xlx-warning-subtle: #fef3c7;
  --xlx-danger-subtle:  #fee2e2;
  --xlx-info-subtle:    #dbeafe;

  --xlx-brand-subtle:   rgba(var(--xlx-brand-rgb), 0.10);
  --xlx-brand-alpha-20: rgba(var(--xlx-brand-rgb), 0.20);
  --xlx-brand-alpha-40: rgba(var(--xlx-brand-rgb), 0.40);

  /* Accent — secondary violet; meets contrast on light backgrounds */
  --xlx-accent:         #7c3aed;   /* violet-700 — secondary accent */

  --xlx-ring:       0 0 0 2px var(--xlx-bg), 0 0 0 4px var(--xlx-brand-dark);

}

/* =========================================================================
   Semantic element defaults — opt-in via class="xlx"
   Use on a root wrapper so these don't leak into other systems on the page.
   ========================================================================= */
.xlx,
.xlx * {
  box-sizing: border-box;
}

.xlx {
  font-family: var(--xlx-font-sans);
  color: var(--xlx-fg-2);
  background-color: transparent;
  font-size: var(--xlx-text-base);
  line-height: var(--xlx-leading-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.xlx h1, .xlx .h1 {
  font-size: clamp(var(--xlx-text-4xl), 4vw + 1rem, var(--xlx-text-6xl));
  font-weight: 700;
  letter-spacing: var(--xlx-tracking-tight);
  line-height: var(--xlx-leading-tight);
  color: var(--xlx-fg);
  margin: 0 0 var(--xlx-space-6) 0;
}

.xlx h2, .xlx .h2 {
  font-size: var(--xlx-text-3xl);
  font-weight: 700;
  letter-spacing: var(--xlx-tracking-tight);
  line-height: var(--xlx-leading-snug);
  color: var(--xlx-fg);
  margin: 0 0 var(--xlx-space-4) 0;
}

.xlx h3, .xlx .h3 {
  font-size: var(--xlx-text-xl);
  font-weight: 700;
  line-height: var(--xlx-leading-snug);
  color: var(--xlx-fg);
  margin: 0 0 var(--xlx-space-3) 0;
}

.xlx h4, .xlx .h4 {
  font-size: var(--xlx-text-lg);
  font-weight: 600;
  color: var(--xlx-fg-1);
  margin: 0 0 var(--xlx-space-2) 0;
}

.xlx p, .xlx .body {
  font-size: var(--xlx-text-base);
  color: var(--xlx-fg-2);
  line-height: var(--xlx-leading-base);
  margin: 0 0 var(--xlx-space-4) 0;
}

.xlx .lead {
  font-size: var(--xlx-text-xl);
  color: var(--xlx-fg-2);
  line-height: var(--xlx-leading-snug);
}

.xlx .small,
.xlx small {
  font-size: var(--xlx-text-sm);
  color: var(--xlx-fg-muted);
}

.xlx .eyebrow {
  font-size: var(--xlx-text-xs);
  letter-spacing: var(--xlx-tracking-caps);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--xlx-brand);
}

.xlx code, .xlx .mono {
  font-family: var(--xlx-font-mono);
  font-size: 0.95em;
}

.xlx a {
  color: var(--xlx-brand);
  text-decoration: none;
  transition: color var(--xlx-duration-2) var(--xlx-ease);
}
.xlx a:hover { color: var(--xlx-brand-light); }

/* Brand word — used in the hero ("XILYXIS") */
.xlx .brand {
  color: var(--xlx-brand);
}

/* =========================================================================
   LINEN PALETTE — alternate color scheme
   Orthogonal to light/dark. Activate by setting [data-palette="linen"] on
   <html> (or any ancestor). Default palette = "blue" (the stack above).

   Philosophy: the book-writing aesthetic — cream paper, warm ink, oxblood
   accent. In dark mode we invert to deep espresso backgrounds with a warm
   cream foreground and a lifted terracotta accent for AA contrast.
   ========================================================================= */

/* ---------- Linen LIGHT (default pairing) ---------- */
[data-palette="linen"],
[data-palette="linen"][data-theme="light"] {
  /* Accent — warm oxblood */
  --xlx-brand:           #7a2e1f;   /* primary — oxblood */
  --xlx-brand-dark:      #5c2216;   /* hover — deeper */
  --xlx-brand-light:     #c7b8a0;   /* soft accent — warm taupe */
  --xlx-brand-ink:       #fbfaf7;   /* foreground when on brand fill */
  --xlx-brand-rgb:       122, 46, 31;
  --xlx-brand-dark-rgb:  92, 34, 22;

  /* Surfaces — cream & paper */
  --xlx-bg:              #eeeae0;   /* page — warm cream */
  --xlx-bg-raised:       #fbfaf7;   /* paper */
  --xlx-surface:         #ffffff;   /* chrome — pure white cards */
  --xlx-surface-2:       #f5f3ee;   /* paper-2 — hover/recessed */
  --xlx-surface-muted:   rgba(20, 24, 31, 0.04);
  --xlx-surface-1:       #f7f4ee;
  --xlx-surface-hover:   var(--xlx-surface-2);
  --xlx-surface-accent:  rgba(var(--xlx-brand-rgb), 0.08);
  --xlx-control:         #ece6da;
  --xlx-control-hover:   #dfd6c6;

  /* Ink scale */
  --xlx-fg:              #14181f;   /* headings */
  --xlx-fg-1:            #2b323c;   /* high-contrast body */
  --xlx-fg-2:            #4b5563;   /* body */
  --xlx-fg-muted:        #5f6571;   /* descriptions */
  --xlx-fg-subtle:       #8a8577;   /* warm-tinted disabled */
  --xlx-fg-inverse:      #ffffff;
  --xlx-fg-on-brand:     var(--xlx-brand-ink);
  --xlx-toggle-thumb:    #ffffff;

  /* Rules — warm, slightly desaturated */
  --xlx-border:          #d9d4c7;   /* rule-2 */
  --xlx-border-subtle:   #e6e2d8;   /* rule */
  --xlx-border-strong:   #c7b8a0;   /* brand-light doubles as strong rule */

  /* Glass — warm cream instead of cool white */
  --xlx-glass:           rgba(251, 250, 247, 0.60);
  --xlx-glass-strong:    rgba(251, 250, 247, 0.80);
  --xlx-glass-border:    rgba(20, 24, 31, 0.14);
  --xlx-glass-border-hi: rgba(20, 24, 31, 0.24);
  --xlx-glass-blur:      20px;
  --xlx-glass-saturate:  160%;

  /* Shadows — softer, warm-tinted */
  --xlx-shadow-sm:  0 1px 2px  rgba(20, 24, 31, 0.06);
  --xlx-shadow-md:  0 4px 14px rgba(20, 24, 31, 0.09);
  --xlx-shadow-lg:  0 16px 40px rgba(20, 24, 31, 0.12);
  --xlx-shadow-xl:  0 28px 70px rgba(20, 24, 31, 0.16);
  --xlx-shadow-glow: 0 0 0 1px rgba(122, 46, 31, 0.30), 0 8px 30px rgba(122, 46, 31, 0.22);

  --xlx-ring:       0 0 0 2px var(--xlx-bg), 0 0 0 4px var(--xlx-brand);

  /* Scrim — warm-tinted overlay for linen light */
  --xlx-scrim:      rgba(20, 24, 31, 0.55);
  --xlx-scrim-soft: rgba(20, 24, 31, 0.12);

  /* Status text — deepened for daylight (see the light block). */
  --xlx-success:        #166534;
  --xlx-warning:        #92400E;
  --xlx-danger:         #A61B1B;
  --xlx-success-rgb:    22, 101, 52;
  --xlx-warning-rgb:    146, 64, 14;
  --xlx-danger-rgb:     166, 27, 27;
  --xlx-success-subtle: #dcfce7;
  --xlx-warning-subtle: #fef3c7;
  --xlx-danger-subtle:  #fee2e2;

  --xlx-brand-subtle:   rgba(var(--xlx-brand-rgb), 0.10);
  --xlx-brand-alpha-20: rgba(var(--xlx-brand-rgb), 0.20);
  --xlx-brand-alpha-40: rgba(var(--xlx-brand-rgb), 0.40);

  /* Accent — warm slate, distinct from oxblood brand; complements linen palette */
  --xlx-accent:         #4d6b7a;   /* warm slate — secondary accent on cream */

  /* Info status — warm slate, distinct from the oxblood brand; a blue info
     sits off-palette here. */
  --xlx-info:           #425c69;   /* 4.99:1 on its own tint, 5.89:1 on the page */
  --xlx-info-subtle:    rgba(66, 92, 105, 0.12);
}

/* ---------- Linen DARK — inverted, warm espresso ---------- */
[data-palette="linen"][data-theme="dark"] {
  /* Accent — terracotta lifted for AA contrast on dark ink */
  --xlx-brand:           #e8a990;   /* primary — lifted terracotta */
  --xlx-brand-dark:      #c9826a;   /* hover — muted rust */
  --xlx-brand-light:     #f5d9c8;   /* soft accent — warm sand */
  --xlx-brand-ink:       #1a1410;   /* foreground when on brand fill */
  --xlx-brand-rgb:       232, 169, 144;
  --xlx-brand-dark-rgb:  201, 130, 106;

  /* Surfaces — deep espresso with warm undertone */
  --xlx-bg:              #17130f;   /* page — warm near-black */
  --xlx-bg-raised:       #1f1a15;   /* raised — espresso */
  --xlx-surface:         #2a231c;   /* cards — cocoa */
  --xlx-surface-2:       #3a3128;   /* hover */
  --xlx-surface-muted:   rgba(232, 169, 144, 0.06);
  --xlx-surface-1:       #1a150f;
  --xlx-surface-hover:   var(--xlx-surface-2);
  --xlx-surface-accent:  rgba(var(--xlx-brand-rgb), 0.10);
  --xlx-control:         #382c20;
  --xlx-control-hover:   #463727;

  /* Foreground — warm cream */
  --xlx-fg:              #faf4ea;   /* headings */
  --xlx-fg-1:            #ede4d2;   /* high-contrast body */
  --xlx-fg-2:            #d9cdb5;   /* body */
  --xlx-fg-muted:        #a89a80;   /* descriptions */
  --xlx-fg-subtle:       #75685a;   /* disabled */
  --xlx-fg-inverse:      #ffffff;
  --xlx-fg-on-brand:     var(--xlx-brand-ink);
  --xlx-toggle-thumb:    #ffffff;

  /* Rules — warm dividers */
  --xlx-border:          #3a3128;
  --xlx-border-subtle:   #2a231c;
  --xlx-border-strong:   #5a4d3f;

  /* Glass — warm-tinted translucency */
  --xlx-glass:           rgba(250, 244, 234, 0.06);
  --xlx-glass-strong:    rgba(250, 244, 234, 0.12);
  --xlx-glass-border:    rgba(250, 244, 234, 0.16);
  --xlx-glass-border-hi: rgba(250, 244, 234, 0.26);
  --xlx-glass-blur:      16px;
  --xlx-glass-saturate:  140%;

  /* Shadows — deeper, for depth against warm bg */
  --xlx-shadow-sm:  0 1px 2px  rgba(0, 0, 0, 0.32);
  --xlx-shadow-md:  0 4px 14px rgba(0, 0, 0, 0.40);
  --xlx-shadow-lg:  0 14px 36px rgba(0, 0, 0, 0.50);
  --xlx-shadow-xl:  0 28px 70px rgba(0, 0, 0, 0.60);
  --xlx-shadow-glow: 0 0 0 1px rgba(232, 169, 144, 0.30), 0 8px 30px rgba(232, 169, 144, 0.22);

  --xlx-ring:       0 0 0 2px var(--xlx-bg), 0 0 0 4px var(--xlx-brand);

  /* Scrim — warm-tinted overlay for linen dark */
  --xlx-scrim:      rgba(23, 19, 15, 0.60);
  --xlx-scrim-soft: rgba(23, 19, 15, 0.20);

  /* Status text — the base dark tones, restated. The light pairing above is
     also selected by bare `[data-palette="linen"]`, which matches at night too,
     so without these its daylight values would win here. */
  --xlx-success:        #6EE7B7;
  --xlx-warning:        #FBBF24;
  --xlx-danger:         #FECACA;
  --xlx-success-rgb:    110, 231, 183;
  --xlx-warning-rgb:    251, 191, 36;
  --xlx-danger-rgb:     254, 202, 202;
  --xlx-success-subtle: rgba(var(--xlx-success-rgb), 0.14);
  --xlx-warning-subtle: #47391d;
  --xlx-danger-subtle:  rgba(var(--xlx-danger-rgb), 0.14);

  --xlx-brand-subtle:   rgba(var(--xlx-brand-rgb), 0.12);
  --xlx-brand-alpha-20: rgba(var(--xlx-brand-rgb), 0.20);
  --xlx-brand-alpha-40: rgba(var(--xlx-brand-rgb), 0.40);

  /* Accent — warm slate, distinct from terracotta brand; secondary accent on espresso */
  --xlx-accent:         #8faab8;   /* warm slate — secondary accent */

  /* Info status — warm slate, distinct from terracotta brand */
  --xlx-info:           #a6bcc7;   /* 6.4:1 or more on every linen-dark surface */
  --xlx-info-subtle:    rgba(166, 188, 199, 0.14);
}

/* =========================================================================
   VERDIGRIS PALETTE — alternate color scheme
   Orthogonal to light/dark. Activate by setting [data-palette="verdigris"]
   on <html> (or any ancestor). Default palette = "blue".

   Philosophy: a studio and score aesthetic — cool stone neutrals with a
   faint green cast (no cream), deep green as the brand, and brass as the
   secondary accent. In dark mode the neutrals go to green-black, and the
   brand lifts to sage and the brass brightens, both for AA contrast.
   ========================================================================= */

/* ---------- Verdigris LIGHT (default pairing) ---------- */
[data-palette="verdigris"],
[data-palette="verdigris"][data-theme="light"] {
  /* Brand — deep green */
  --xlx-brand:           #2a6049;
  --xlx-brand-dark:      #1f4c39;   /* hover — deeper */
  --xlx-brand-light:     #a9cdb9;   /* soft accent — pale sage */
  --xlx-brand-ink:       #ffffff;   /* foreground when on brand fill */
  --xlx-brand-rgb:       42, 96, 73;
  --xlx-brand-dark-rgb:  31, 76, 57;

  /* Surfaces — cool stone */
  --xlx-bg:              #edf1ec;   /* page */
  --xlx-bg-raised:       #fafcfa;
  --xlx-surface:         #ffffff;   /* cards */
  --xlx-surface-2:       #e3e9e3;   /* hover / recessed */
  --xlx-surface-muted:   rgba(20, 32, 26, 0.04);
  --xlx-surface-1:       #f4f7f3;
  --xlx-surface-hover:   var(--xlx-surface-2);
  --xlx-surface-accent:  rgba(var(--xlx-brand-rgb), 0.08);
  --xlx-control:         #dee6df;
  --xlx-control-hover:   #cdd8cf;

  /* Ink scale — green-black */
  --xlx-fg:              #14201a;   /* headings */
  --xlx-fg-1:            #1f2d26;   /* high-contrast body */
  --xlx-fg-2:            #34433b;   /* body */
  --xlx-fg-muted:        #4b5a52;   /* descriptions */
  --xlx-fg-subtle:       #7a877f;   /* decoration and disabled only */
  --xlx-fg-inverse:      #ffffff;
  --xlx-fg-on-brand:     var(--xlx-brand-ink);
  --xlx-toggle-thumb:    #ffffff;

  /* Rules */
  --xlx-border:          #cfd9d1;
  --xlx-border-subtle:   #e1e8e2;
  --xlx-border-strong:   #a3b5a8;

  /* Glass — cool white */
  --xlx-glass:           rgba(250, 252, 250, 0.60);
  --xlx-glass-strong:    rgba(250, 252, 250, 0.80);
  --xlx-glass-border:    rgba(20, 32, 26, 0.14);
  --xlx-glass-border-hi: rgba(20, 32, 26, 0.24);
  --xlx-glass-blur:      20px;
  --xlx-glass-saturate:  160%;

  /* Shadows — soft, green-black tinted */
  --xlx-shadow-sm:  0 1px 2px  rgba(20, 32, 26, 0.06);
  --xlx-shadow-md:  0 4px 14px rgba(20, 32, 26, 0.09);
  --xlx-shadow-lg:  0 16px 40px rgba(20, 32, 26, 0.12);
  --xlx-shadow-xl:  0 28px 70px rgba(20, 32, 26, 0.16);
  --xlx-shadow-glow: 0 0 0 1px rgba(var(--xlx-brand-rgb), 0.30), 0 8px 30px rgba(var(--xlx-brand-rgb), 0.22);

  --xlx-ring:       0 0 0 2px var(--xlx-bg), 0 0 0 4px var(--xlx-brand);

  --xlx-scrim:      rgba(20, 32, 26, 0.55);
  --xlx-scrim-soft: rgba(20, 32, 26, 0.12);

  /* Status text — deepened for daylight (see the light block). */
  --xlx-success:        #166534;
  --xlx-warning:        #92400E;
  --xlx-danger:         #A61B1B;
  --xlx-info:           #1D4ED8;
  --xlx-success-rgb:    22, 101, 52;
  --xlx-warning-rgb:    146, 64, 14;
  --xlx-danger-rgb:     166, 27, 27;
  --xlx-success-subtle: #dcfce7;
  --xlx-warning-subtle: #fef3c7;
  --xlx-danger-subtle:  #fee2e2;
  --xlx-info-subtle:    #dbeafe;

  --xlx-brand-subtle:   rgba(var(--xlx-brand-rgb), 0.10);
  --xlx-brand-alpha-20: rgba(var(--xlx-brand-rgb), 0.20);
  --xlx-brand-alpha-40: rgba(var(--xlx-brand-rgb), 0.40);

  /* Accent — brass, distinct from the green brand */
  --xlx-accent:         #7c5110;
}

/* ---------- Verdigris DARK — green-black ---------- */
[data-palette="verdigris"][data-theme="dark"] {
  /* Brand — sage, lifted for AA contrast */
  --xlx-brand:           #8fd3b0;
  --xlx-brand-dark:      #6fbf96;   /* hover */
  --xlx-brand-light:     #c3ebd6;
  --xlx-brand-ink:       #0e1512;   /* foreground when on brand fill */
  --xlx-brand-rgb:       143, 211, 176;
  --xlx-brand-dark-rgb:  111, 191, 150;

  /* Surfaces — green-black */
  --xlx-bg:              #0e1512;   /* page */
  --xlx-bg-raised:       #141d19;
  --xlx-surface:         #1a2420;   /* cards */
  --xlx-surface-2:       #26332d;   /* hover */
  --xlx-surface-muted:   rgba(143, 211, 176, 0.05);
  --xlx-surface-1:       #121a16;
  --xlx-surface-hover:   var(--xlx-surface-2);
  --xlx-surface-accent:  rgba(var(--xlx-brand-rgb), 0.10);
  --xlx-control:         #24302a;
  --xlx-control-hover:   #2e3c35;

  /* Foreground — cool pale green */
  --xlx-fg:              #f2f7f3;
  --xlx-fg-1:            #e3ece6;
  --xlx-fg-2:            #cad6ce;
  --xlx-fg-muted:        #9aa9a0;
  --xlx-fg-subtle:       #64736a;   /* decoration and disabled only */
  --xlx-fg-inverse:      #ffffff;
  --xlx-fg-on-brand:     var(--xlx-brand-ink);
  --xlx-toggle-thumb:    #ffffff;

  /* Rules */
  --xlx-border:          #2a3731;
  --xlx-border-subtle:   #1d2823;
  --xlx-border-strong:   #44564c;

  /* Glass */
  --xlx-glass:           rgba(242, 247, 243, 0.06);
  --xlx-glass-strong:    rgba(242, 247, 243, 0.12);
  --xlx-glass-border:    rgba(242, 247, 243, 0.16);
  --xlx-glass-border-hi: rgba(242, 247, 243, 0.26);
  --xlx-glass-blur:      16px;
  --xlx-glass-saturate:  140%;

  /* Shadows */
  --xlx-shadow-sm:  0 1px 2px  rgba(0, 0, 0, 0.32);
  --xlx-shadow-md:  0 4px 14px rgba(0, 0, 0, 0.40);
  --xlx-shadow-lg:  0 14px 36px rgba(0, 0, 0, 0.50);
  --xlx-shadow-xl:  0 28px 70px rgba(0, 0, 0, 0.60);
  --xlx-shadow-glow: 0 0 0 1px rgba(var(--xlx-brand-rgb), 0.30), 0 8px 30px rgba(var(--xlx-brand-rgb), 0.22);

  --xlx-ring:       0 0 0 2px var(--xlx-bg), 0 0 0 4px var(--xlx-brand);

  --xlx-scrim:      rgba(14, 21, 18, 0.60);
  --xlx-scrim-soft: rgba(14, 21, 18, 0.20);

  /* Status text — the base dark tones, restated. The light pairing above is
     also selected by bare `[data-palette="verdigris"]`, which matches at night
     too, so without these its daylight values would win here. */
  --xlx-success:        #6EE7B7;
  --xlx-warning:        #FBBF24;
  --xlx-danger:         #FECACA;
  --xlx-info:           #bcc5fd;
  --xlx-success-rgb:    110, 231, 183;
  --xlx-warning-rgb:    251, 191, 36;
  --xlx-danger-rgb:     254, 202, 202;
  --xlx-success-subtle: rgba(var(--xlx-success-rgb), 0.14);
  --xlx-warning-subtle: #3a3620;
  --xlx-danger-subtle:  rgba(var(--xlx-danger-rgb), 0.14);
  --xlx-info-subtle:    rgba(188, 197, 253, 0.12);

  --xlx-brand-subtle:   rgba(var(--xlx-brand-rgb), 0.12);
  --xlx-brand-alpha-20: rgba(var(--xlx-brand-rgb), 0.20);
  --xlx-brand-alpha-40: rgba(var(--xlx-brand-rgb), 0.40);

  /* Accent — brass, brightened for the dark ground */
  --xlx-accent:         #e2b66a;
}
/* =========================================================================
   Xilyxis Design System — Components
   Reusable class-based primitives. Load AFTER colors_and_type.css.

   All components sit inside a .xlx wrapper so they pick up theme tokens.
   ========================================================================= */

/* ---------- Page root ----------------------------------------------------
   The page behind every surface is the theme's own ground, so overscroll and
   the area under a short page never show the browser's white. `html.xlx`
   outranks `.xlx`, which stays transparent where it is only a wrapper. */
html,
html.xlx {
  background-color: var(--xlx-bg);
}

/* The UA's 8px body margin makes every full-height shell overflow the
   viewport by that much. */
body {
  margin: 0;
}

/* Scrollbars: a thin token-coloured thumb on a transparent track.
   Blink and WebKit honour the `::-webkit-scrollbar-*` pseudo-elements only
   while the standard `scrollbar-width` is unset, so the standard properties
   are scoped to engines without the pseudo-element (Firefox). */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--xlx-border-strong);
  border: 3px solid transparent;
  border-radius: var(--xlx-radius-full);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--xlx-fg-muted);
}

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--xlx-border-strong) transparent;
  }
}

/* ---------- App background (Mt. Rainier silhouette, fixed) --------------- */
.xlx-bg-hero {
  position: fixed;
  inset: 0;
  z-index: var(--xlx-z-below);
  background-color: var(--xlx-bg);
  background-image:
    /* Dark overlay keeps contrast over the photo */
    linear-gradient(180deg, rgba(11, 18, 32, 0.45) 0%, rgba(11, 18, 32, 0.70) 100%),
    url('/assets/mt-rainier-silhouette.webp');
  background-size: cover;
  background-position: center bottom;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

[data-palette="linen"][data-theme="dark"] .xlx-bg-hero,
[data-palette="linen"]:not([data-theme="light"]) .xlx-bg-hero {
  background-image:
    linear-gradient(180deg, rgba(23, 19, 15, 0.55) 0%, rgba(23, 19, 15, 0.88) 100%),
    url('/assets/mt-rainier-silhouette.webp');
}
[data-palette="linen"][data-theme="light"] .xlx-bg-hero {
  background-image:
    linear-gradient(180deg, rgba(238, 234, 224, 0.60) 0%, rgba(238, 234, 224, 0.25) 100%),
    url('/assets/mt-rainier-silhouette.webp');
}

[data-palette="verdigris"][data-theme="dark"] .xlx-bg-hero,
[data-palette="verdigris"]:not([data-theme="light"]) .xlx-bg-hero {
  background-image:
    linear-gradient(180deg, rgba(14, 21, 18, 0.55) 0%, rgba(14, 21, 18, 0.88) 100%),
    url('/assets/mt-rainier-silhouette.webp');
}
[data-palette="verdigris"][data-theme="light"] .xlx-bg-hero {
  background-image:
    linear-gradient(180deg, rgba(237, 241, 236, 0.60) 0%, rgba(237, 241, 236, 0.25) 100%),
    url('/assets/mt-rainier-silhouette.webp');
}

[data-theme="light"] .xlx-bg-hero {
  background-image:
    linear-gradient(180deg, rgba(238, 242, 247, 0.55) 0%, rgba(238, 242, 247, 0.15) 100%),
    url('/assets/mt-rainier-silhouette.webp');
}

/* ========================== Glass surfaces ============================== */
.xlx-glass {
  background-color: var(--xlx-glass);
  backdrop-filter: blur(var(--xlx-glass-blur)) saturate(var(--xlx-glass-saturate));
  -webkit-backdrop-filter: blur(var(--xlx-glass-blur)) saturate(var(--xlx-glass-saturate));
  border: 1px solid var(--xlx-glass-border);
  box-shadow: var(--xlx-shadow-md);
  border-radius: var(--xlx-radius-lg);
}

.xlx-glass-strong {
  background-color: var(--xlx-glass-strong);
  backdrop-filter: blur(calc(var(--xlx-glass-blur) * 1.25)) saturate(var(--xlx-glass-saturate));
  -webkit-backdrop-filter: blur(calc(var(--xlx-glass-blur) * 1.25)) saturate(var(--xlx-glass-saturate));
  border: 1px solid var(--xlx-glass-border-hi);
  box-shadow: var(--xlx-shadow-lg);
  border-radius: var(--xlx-radius-xl);
}

/* ============================== Buttons ================================= */
.xlx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--xlx-radius-md);
  font-family: inherit;
  font-size: var(--xlx-text-base);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--xlx-duration-1) var(--xlx-ease),
              background-color var(--xlx-duration-2) var(--xlx-ease),
              color var(--xlx-duration-2) var(--xlx-ease),
              border-color var(--xlx-duration-2) var(--xlx-ease),
              box-shadow var(--xlx-duration-2) var(--xlx-ease);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.xlx-btn:focus-visible { outline: none; box-shadow: var(--xlx-ring); }
.xlx-btn:active       { transform: translateY(1px); }
.xlx-btn:disabled     { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Sizes */
.xlx-btn-sm { padding: 0.375rem 0.875rem; font-size: var(--xlx-text-sm); border-radius: var(--xlx-radius-sm); }

/* Variants */
.xlx-btn-primary {
  background-color: var(--xlx-brand);
  color: var(--xlx-brand-ink);
}
.xlx-btn-primary:hover {
  /* --xlx-brand-dark is each theme's declared hover fill; it keeps --xlx-brand-ink at 5.9:1 or
     more in every theme and palette. --xlx-brand-light (an accent tint) fell to 1.5:1 in light. */
  background-color: var(--xlx-brand-dark);
  box-shadow: var(--xlx-shadow-glow);
}

.xlx-btn-secondary {
  background-color: transparent;
  border-color: var(--xlx-brand);
  color: var(--xlx-brand);
}
.xlx-btn-secondary:hover {
  background-color: var(--xlx-brand);
  color: var(--xlx-brand-ink);
}

/* ============================== Cards =================================== */

.xlx-card-solid {
  background-color: var(--xlx-surface);
  border: 1px solid var(--xlx-border);
  border-radius: var(--xlx-radius-lg);
  padding: var(--xlx-space-6);
  box-shadow: var(--xlx-shadow-sm);
  transition: all var(--xlx-duration-3) var(--xlx-ease);
}
.xlx-card-solid:hover {
  background-color: var(--xlx-bg-raised);
  border-color: var(--xlx-border-strong);
  box-shadow: var(--xlx-shadow-md);
}

/* ============================== Inputs ================================== */
.xlx-input, .xlx-select, .xlx-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background-color: var(--xlx-surface);
  border: 1px solid var(--xlx-border);
  border-radius: var(--xlx-radius-md);
  color: var(--xlx-fg);
  font-family: inherit;
  font-size: var(--xlx-text-base);
  line-height: var(--xlx-leading-snug);
  transition: border-color var(--xlx-duration-2) var(--xlx-ease),
              box-shadow var(--xlx-duration-2) var(--xlx-ease),
              background-color var(--xlx-duration-2) var(--xlx-ease);
}
.xlx-input::placeholder,
.xlx-textarea::placeholder { color: var(--xlx-fg-muted); }

/* Read-only: focusable and selectable, only editing is refused. Marked by a
   dashed, stronger frame on the recessed surface rather than by fading, so
   the text keeps full contrast in every theme. */
.xlx-textarea:read-only,
.xlx-input:read-only {
  background-color: var(--xlx-surface-2);
  border-style: dashed;
  border-color: var(--xlx-border-strong);
  cursor: text;
}

.xlx-input:focus,
.xlx-select:focus,
.xlx-textarea:focus {
  outline: none;
  border-color: var(--xlx-brand);
  box-shadow: 0 0 0 3px rgba(var(--xlx-brand-rgb), 0.18);
}

.xlx-label {
  display: block;
  font-size: var(--xlx-text-sm);
  font-weight: 500;
  color: var(--xlx-fg-1);
  margin-bottom: var(--xlx-space-2);
}

.xlx-hint {
  font-size: var(--xlx-text-sm);
  color: var(--xlx-fg-muted);
  margin-top: var(--xlx-space-2);
}

/* ============================== Badges ================================== */
.xlx-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--xlx-radius-full);
  font-size: var(--xlx-text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  background-color: var(--xlx-surface-muted);
  color: var(--xlx-fg-1);
  border: 1px solid var(--xlx-border-subtle);
}
.xlx-badge-success { background: var(--xlx-success-subtle); color: var(--xlx-success); border-color: rgba(var(--xlx-success-rgb), 0.35); }
.xlx-badge-warning { background: var(--xlx-warning-subtle); color: var(--xlx-warning); border-color: rgba(var(--xlx-warning-rgb), 0.35); }
.xlx-badge-danger  { background: var(--xlx-danger-subtle);  color: var(--xlx-danger);  border-color: rgba(var(--xlx-danger-rgb), 0.35); }

/* ============================== Container =============================== */
.xlx-container {
  width: 100%;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--xlx-space-4);
  padding-right: var(--xlx-space-4);
}
@media (min-width: 640px) {
  .xlx-container { padding-left: var(--xlx-space-6); padding-right: var(--xlx-space-6); }
}
@media (min-width: 1024px) {
  .xlx-container { padding-left: var(--xlx-space-8); padding-right: var(--xlx-space-8); }
}
.xlx-container-lg { max-width: 72rem; }

/* =================== Spin animation utility ============================== */
.xlx-spin {
  animation: xlx-spin 1s linear infinite;
}

@keyframes xlx-spin {
  to { transform: rotate(360deg); }
}

/* Reduced motion is the app's own setting, stamped on the root as
   `data-reduced-motion="on"`. Each app defaults it from the OS
   `prefers-reduced-motion` preference and lets the user change it, so the
   design system keys off the attribute alone. */
[data-reduced-motion='on'] .xlx-spin { animation: none; }

/* =================== Focus-ring helper for any element ================== */
.xlx-focusable:focus-visible {
  outline: none;
  box-shadow: var(--xlx-ring);
  border-radius: var(--xlx-radius-md);
}

/* =========================================================================
   Layout patterns: list rows. Built only from --xlx-* tokens, so light, dark
   and the palettes all resolve through them. The rules each class keeps are
   in its comments.
   ========================================================================= */

/* ---------- List rows ---------- */
.xlx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--xlx-space-3);
}

/* The action sits under the text below 40rem and to its right from 40rem, whatever the text's length, so every row
   on a page has the same shape. No flex-wrap: wrapping would depend on the text. */
.xlx-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--xlx-space-4);
  padding: var(--xlx-space-4) var(--xlx-space-5);
  border-radius: var(--xlx-radius-md);
  background-color: var(--xlx-surface);
  border: 1px solid var(--xlx-border);
}

.xlx-list-item-main {
  display: flex;
  flex-direction: column;
  gap: var(--xlx-space-1);
  min-width: 0;
}

@media (min-width: 40rem) {
  .xlx-list-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .xlx-list-item > :not(.xlx-list-item-main) {
    flex-shrink: 0;
  }
}

.xlx-list-item-title {
  font-weight: 600;
}

/* The theme ground is on html (components.css colors html.xlx); body stays transparent, so the fixed Mt. Rainier
   backdrop (.xlx-bg-hero, z-index below the page) shows between html's ground and the content. */
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--xlx-font-sans);
  color: var(--xlx-fg);
}

html {
  background-color: var(--xlx-bg);
}

/* Chrome type: one sans face throughout, weights and tracking per the design system (700 H1–H3, 600 H4, 400 body). */
h1,
h2,
h3,
h4 {
  color: var(--xlx-fg);
  line-height: 1.25;
}

h1,
h2,
h3 {
  overflow-wrap: break-word;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h4 {
  font-weight: 600;
}

/* Section headings sit well below the page title (h1 is sized by .app-page-header). */
h2 {
  font-size: var(--xlx-text-2xl);
}

h3 {
  font-size: var(--xlx-text-xl);
}

ul {
  padding-left: 1.25rem;
}

li + li {
  margin-top: var(--xlx-space-1);
}

p {
  color: var(--xlx-fg-2);
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--xlx-brand);
}

a:hover {
  color: var(--xlx-brand-dark);
}

/* colors_and_type.css colors every link inside .xlx (.xlx a, specificity 0,1,1), which outranks the button and nav
   classes (0,1,0) when they are applied to <a>. Restore each variant's own colors for links. */
.xlx a.xlx-btn-primary,
.xlx a.xlx-btn-primary:hover,
.xlx a.xlx-btn-secondary:hover {
  color: var(--xlx-brand-ink);
}

.xlx a.xlx-btn-secondary {
  color: var(--xlx-brand);
}

/* The frame and the glass card are the app's own: the design system dropped these classes for its @xlx/ui
   components, so they are built here from its tokens. */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--xlx-glass);
  backdrop-filter: blur(var(--xlx-glass-blur)) saturate(var(--xlx-glass-saturate));
  -webkit-backdrop-filter: blur(var(--xlx-glass-blur)) saturate(var(--xlx-glass-saturate));
  border-bottom: 1px solid var(--xlx-glass-border);
}

.app-header-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 var(--xlx-space-6);
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-nav-link {
  position: relative;
  color: var(--xlx-fg-2);
  font-weight: 500;
  padding: 0.25rem 0;
  text-decoration: none;
  transition: color var(--xlx-duration-2) var(--xlx-ease);
}

.app-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: var(--xlx-brand);
  transition: width var(--xlx-duration-2) var(--xlx-ease);
}

.app-nav-link:hover {
  color: var(--xlx-fg);
}

.app-nav-link:hover::after {
  width: 100%;
}

.app-btn-ghost {
  background-color: transparent;
  color: var(--xlx-fg-2);
}

.app-btn-ghost:hover {
  background-color: var(--xlx-surface-2);
  color: var(--xlx-fg);
}

[data-theme="light"] .app-btn-ghost:hover {
  background-color: var(--xlx-surface-muted);
}

.app-glass-card {
  background-color: var(--xlx-glass);
  backdrop-filter: blur(var(--xlx-glass-blur)) saturate(var(--xlx-glass-saturate));
  -webkit-backdrop-filter: blur(var(--xlx-glass-blur)) saturate(var(--xlx-glass-saturate));
  border: 1px solid var(--xlx-glass-border);
  box-shadow: var(--xlx-shadow-md);
  border-radius: var(--xlx-radius-lg);
  padding: var(--xlx-space-5);
  transition: transform var(--xlx-duration-3) var(--xlx-ease-out), background-color var(--xlx-duration-3) var(--xlx-ease),
    border-color var(--xlx-duration-3) var(--xlx-ease), box-shadow var(--xlx-duration-3) var(--xlx-ease);
}

.app-glass-card:hover {
  transform: translateY(-4px);
  background-color: var(--xlx-glass-strong);
  border-color: var(--xlx-glass-border-hi);
  box-shadow: var(--xlx-shadow-lg);
}

/* colors_and_type.css colors every link inside .xlx (.xlx a), which outranks these link colors. */
.xlx a.app-btn-ghost,
.xlx a.app-nav-link {
  color: var(--xlx-fg-2);
}

.xlx a.app-btn-ghost:hover,
.xlx a.app-nav-link:hover,
.xlx a.app-nav-link.active {
  color: var(--xlx-fg);
}

/* Text for assistive technology only (labels a visible control already explains, e.g. a search box). */
.app-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-stack {
  display: flex;
  flex-direction: column;
  gap: var(--xlx-space-6);
}

.app-skip-link {
  position: absolute;
  left: -9999px;
}

.app-skip-link:focus {
  left: var(--xlx-space-4);
  top: var(--xlx-space-4);
  z-index: 100;
}

/* ---------- Header and navigation ---------- */
.app-brand {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  color: var(--xlx-fg);
  text-decoration: none;
  font-size: var(--xlx-text-lg);
  min-width: 0;
}

.app-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: var(--xlx-space-5);
}

.app-menu-toggle {
  display: none;
}

@media (max-width: 860px) {
  .app-menu-toggle {
    display: inline-flex;
  }

  .app-nav {
    display: none;
  }

  .app-nav.is-open {
    display: flex;
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--xlx-space-2);
    padding: var(--xlx-space-4);
    background-color: var(--xlx-bg-raised);
    box-shadow: var(--xlx-shadow-lg);
    border-bottom: 1px solid var(--xlx-glass-border);
  }
}

/* ---------- Page frame ---------- */
.app-main {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: var(--xlx-space-8) 0 var(--xlx-space-12);
}

.app-page-header {
  margin-bottom: var(--xlx-space-6);
}

.app-page-header h1 {
  margin: 0;
  font-size: clamp(var(--xlx-text-2xl), 3vw + 1rem, var(--xlx-text-3xl));
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-page-header p {
  margin: var(--xlx-space-2) 0 0;
  color: var(--xlx-fg-2);
  font-size: var(--xlx-text-lg);
}

.app-page-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--xlx-space-4);
}

.app-back {
  display: inline-flex;
  align-items: center;
  gap: var(--xlx-space-1);
  margin-bottom: var(--xlx-space-3);
  color: var(--xlx-fg-2);
  text-decoration: none;
  font-size: var(--xlx-text-sm);
}

.app-back:hover {
  color: var(--xlx-fg);
}

/* Its own frosted surface, like the header: the background photo is darkest at the bottom, where light-theme text
   would otherwise sit unreadable on the mountains. */
.app-footer {
  background-color: var(--xlx-glass-strong);
  backdrop-filter: blur(var(--xlx-glass-blur)) saturate(var(--xlx-glass-saturate));
  -webkit-backdrop-filter: blur(var(--xlx-glass-blur)) saturate(var(--xlx-glass-saturate));
  border-top: 1px solid var(--xlx-border-subtle);
  padding: var(--xlx-space-6) 0;
  color: var(--xlx-fg-muted);
  font-size: var(--xlx-text-sm);
}

.app-footer p {
  margin: var(--xlx-space-1) 0;
}

/* ---------- Grids, cards, lists ---------- */
/* Cards share the row evenly and never sit beside empty columns. One column on phones; two from tablet width, where an
   odd last card takes the whole row; three only for a grid of exactly three cards on a window wide enough to keep each
   readable. Four cards stay a 2 by 2 block rather than four narrow columns. */
.app-grid {
  display: grid;
  gap: var(--xlx-space-5);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 48rem) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 80rem) {
  .app-grid:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-grid:has(> :nth-child(3):last-child) > :last-child {
    grid-column: auto;
  }
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: var(--xlx-space-3);
  padding: var(--xlx-space-6);
}

.app-card h2,
.app-card h3 {
  margin: 0;
  font-size: var(--xlx-text-xl);
  font-weight: 700;
}

.app-card p {
  margin: 0;
  color: var(--xlx-fg-2);
}

/* Icons keep their size when a button's label is long. */
.xlx-btn svg {
  flex-shrink: 0;
}

/* A button whose label can be long (an action row, or a full-width link such as a download) wraps rather than
   overflowing its card on a narrow screen. */
.app-card-actions .xlx-btn,
.app-card > .xlx-btn {
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

/* A full-width link in a card (a download) reads as a list row: icon and label start at the left edge. */
.app-card > .xlx-btn {
  justify-content: flex-start;
  text-align: left;
}

.app-card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--xlx-space-2);
  padding-top: var(--xlx-space-2);
}

.app-icon-brand {
  color: var(--xlx-brand);
}

.app-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--xlx-space-3);
}

/* A row's action sits under its text on a phone and to its right on anything wider, whatever the text's length, so
   every row on a page has the same shape. */
.app-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--xlx-space-4);
  padding: var(--xlx-space-4) var(--xlx-space-5);
  border-radius: var(--xlx-radius-md);
  background-color: var(--xlx-surface);
  border: 1px solid var(--xlx-border);
}

.app-list-item-main {
  display: flex;
  flex-direction: column;
  gap: var(--xlx-space-1);
  min-width: 0;
}

@media (min-width: 40rem) {
  .app-list-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .app-list-item > :not(.app-list-item-main) {
    flex-shrink: 0;
  }
}

.app-list-item-title {
  font-weight: 600;
}

.app-muted {
  color: var(--xlx-fg-muted);
  font-size: var(--xlx-text-sm);
}

.app-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--xlx-space-3);
  margin-bottom: var(--xlx-space-4);
}

.app-toolbar .xlx-input {
  flex: 1 1 16rem;
  max-width: 28rem;
}

/* ---------- Notices and states ---------- */
.app-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--xlx-space-3);
  padding: var(--xlx-space-4) var(--xlx-space-5);
  border-radius: var(--xlx-radius-md);
  border: 1px solid var(--xlx-border);
  background-color: var(--xlx-surface);
  margin-bottom: var(--xlx-space-5);
}

.app-notice-body {
  flex: 1;
}

.app-notice-body p {
  margin: 0;
}

.app-notice-success {
  border-color: rgba(var(--xlx-success-rgb), 0.45);
}

.app-notice-success > svg {
  color: var(--xlx-success);
}

.app-notice-warning {
  border-color: rgba(var(--xlx-warning-rgb), 0.45);
}

.app-notice-warning > svg {
  color: var(--xlx-warning);
}

.app-notice-danger {
  border-color: rgba(var(--xlx-danger-rgb), 0.55);
}

.app-notice-danger > svg {
  color: var(--xlx-danger);
}

.app-notice-info > svg {
  color: var(--xlx-info);
}

.app-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--xlx-space-3);
  padding: var(--xlx-space-12) var(--xlx-space-6);
}

.app-state h2 {
  margin: 0;
  font-size: var(--xlx-text-xl);
}

.app-state p {
  margin: 0;
  color: var(--xlx-fg-2);
}

/* ---------- Forms ---------- */
.app-form {
  display: flex;
  flex-direction: column;
  gap: var(--xlx-space-6);
}

.app-fieldset {
  border: 0;
  margin: 0;
  padding: var(--xlx-space-6);
  display: grid;
  gap: var(--xlx-space-4);
  /* A fixed column count keeps fields in the same places at every window width: two side by side, one on phones. */
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 48rem) {
  .app-fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The heading spans its own row inside the card. Floating it stops the browser drawing it on the card's border, which
   makes it an ordinary grid item, so it needs the full-row span or it takes a field's place. */
.app-fieldset > legend {
  float: left;
  width: 100%;
  grid-column: 1 / -1;
  padding: 0;
  margin-bottom: var(--xlx-space-2);
  font-size: var(--xlx-text-lg);
  font-weight: 700;
}

.app-field {
  display: flex;
  flex-direction: column;
  gap: var(--xlx-space-1);
  min-width: 0;
}

.app-field-wide {
  grid-column: 1 / -1;
}

.app-required {
  color: var(--xlx-warning);
  margin-left: 0.15em;
}

.app-field-error {
  color: var(--xlx-danger);
  font-size: var(--xlx-text-sm);
}

.app-field .xlx-input[aria-invalid='true'],
.app-field .xlx-select[aria-invalid='true'] {
  border-color: var(--xlx-danger);
}

.app-check {
  display: flex;
  align-items: flex-start;
  gap: var(--xlx-space-3);
}

.app-check input {
  /* Long agreement text must not squeeze the box. */
  flex-shrink: 0;
  margin-top: 0.3em;
  width: 1rem;
  height: 1rem;
  accent-color: var(--xlx-brand);
}

.app-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--xlx-space-3);
  justify-content: flex-end;
}

.app-code-boxes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--xlx-space-2);
}

.app-code-boxes .xlx-input {
  width: 5.5rem;
  text-align: center;
  font-family: var(--xlx-font-mono);
}

.app-amount {
  font-size: var(--xlx-text-2xl);
  font-weight: 700;
}

/* Label and value pairs. On a phone each label sits above its value, so a long value (a VIN, an email address) keeps
   the full width instead of breaking inside a word; from 40rem labels take their natural width beside the values. */
.app-definition {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--xlx-space-1) var(--xlx-space-6);
  margin: 0;
}

.app-definition dt {
  color: var(--xlx-fg-muted);
}

.app-definition dd {
  margin: 0 0 var(--xlx-space-2);
  min-width: 0;
  overflow-wrap: break-word;
}

@media (min-width: 40rem) {
  .app-definition {
    grid-template-columns: max-content minmax(0, 1fr);
    row-gap: var(--xlx-space-2);
  }

  .app-definition dd {
    margin-bottom: 0;
  }
}

/* Money: labels take the room and amounts their natural width at every size, right-aligned, so a figure never wraps
   and the amounts read as a column. */
.app-definition.app-amounts {
  grid-template-columns: minmax(0, 1fr) max-content;
  row-gap: var(--xlx-space-2);
}

.app-definition.app-amounts dd {
  margin-bottom: 0;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.app-balance {
  font-size: var(--xlx-text-lg);
}

/* An address is set like the text around it, not in the browser's default italics. */
address {
  font-style: normal;
}

/* The native file picker button, in the design system's secondary-button style for both themes. */
.xlx-input::file-selector-button {
  margin-right: var(--xlx-space-3);
  padding: var(--xlx-space-1) var(--xlx-space-3);
  border: 1px solid var(--xlx-brand);
  border-radius: var(--xlx-radius-sm);
  background-color: transparent;
  color: var(--xlx-brand);
  font: inherit;
  cursor: pointer;
}

.xlx-input::file-selector-button:hover {
  background-color: var(--xlx-brand);
  color: var(--xlx-brand-ink);
}

.app-table-wrap {
  overflow-x: auto;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--xlx-surface);
  border: 1px solid var(--xlx-border);
  border-radius: var(--xlx-radius-md);
}

.app-table th,
.app-table td {
  padding: var(--xlx-space-3) var(--xlx-space-4);
  text-align: left;
  border-bottom: 1px solid var(--xlx-border-subtle);
}

.app-table th {
  color: var(--xlx-fg-muted);
  font-weight: 500;
  font-size: var(--xlx-text-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* A revealed notice, or a section a page scrolls to, comes into view below the sticky header; 8rem must clear the
   .app-header height. */
.app-notice,
.app-scroll-target {
  scroll-margin-top: 8rem;
}
