/**
 * Monochrome Framework
 * A grayscale-first CSS boilerplate covering layout, components and utilities.
 * No build step required, no dependencies. Just link this file.
 *
 * Table of contents:
 *   1.  Design Tokens (CSS custom properties)
 *   2.  Reset & Base Elements
 *   3.  Typography
 *   4.  Layout: Container & Grid
 *   5.  Flexbox Utilities
 *   6.  Spacing Utilities
 *   7.  Sizing Utilities
 *   8.  Display & Position Utilities
 *   9.  Text & Color Utilities
 *   10. Border, Radius & Shadow Utilities
 *   11. Buttons
 *   12. Forms
 *   13. Cards
 *   14. Navbar
 *   15. Alerts
 *   16. Badges
 *   17. Tables
 *   18. Tabs
 *   19. Accordion
 *   20. Dropdown
 *   21. Modal
 *   22. Tooltip
 *   23. Toast
 *   24. Pagination & Breadcrumb
 *   25. Progress & Spinner
 *   26. Avatar & List Group
 *   27. Drawer / Offcanvas
 *   28. Skeleton Loader
 *   29. Misc Utilities
 *   30. Dark Mode
 *   31. Accessibility
 *   32. Print Styles
 */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
    /* Grayscale palette. 50 is near-white, 900 is near-black. */
    --gray-0: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f2f2f2;
    --gray-150: #e9e9e9;
    --gray-200: #dddddd;
    --gray-300: #c4c4c4;
    --gray-400: #a3a3a3;
    --gray-500: #808080;
    --gray-600: #5f5f5f;
    --gray-700: #4f4f4f;
    --gray-800: #333333;
    --gray-900: #1a1a1a;
    --gray-1000: #000000;

    /* Semantic surface / text roles, mapped to the grayscale above.
       Swap these three lines to re-skin the whole framework. */
    --color-bg: var(--gray-0);
    --color-surface: var(--gray-50);
    --color-surface-alt: var(--gray-100);
    --color-border: var(--gray-200);
    --color-text: var(--gray-800);
    --color-text-muted: var(--gray-600);
    --color-text-inverse: var(--gray-0);

    /* Brand/action color. Kept black-on-white rather than a hue, on purpose. */
    --color-action: var(--gray-900);
    --color-action-hover: var(--gray-1000);
    --color-action-muted: var(--gray-150);

    /* Feedback colors. Real interfaces still need a way to say "this failed"
       that isn't just "darker gray" — so these stay slightly desaturated
       rather than pure red/green. Delete this block if you truly want zero hue. */
    --color-success: #2e7d4f;
    --color-success-bg: #eaf5ee;
    --color-danger: #b3261e;
    --color-danger-bg: #fbeae9;
    --color-warning: #8a6d1d;
    --color-warning-bg: #fbf3df;
    --color-info: #375a7f;
    --color-info-bg: #eaf0f7;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: Georgia, "Times New Roman", serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.125rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 1.875rem;
    --fs-3xl: 2.25rem;
    --fs-4xl: 3rem;

    --lh-tight: 1.2;
    --lh-normal: 1.5;
    --lh-loose: 1.75;

    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* Spacing scale, 4px base unit */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px  */
    --space-2: 0.5rem;    /* 8px  */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.5rem;    /* 24px */
    --space-6: 2rem;      /* 32px */
    --space-7: 3rem;      /* 48px */
    --space-8: 4rem;      /* 64px */
    --space-9: 6rem;      /* 96px */

    /* Radius */
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 16px;
    --radius-pill: 999px;

    /* Shadows — kept faint and neutral, no colored glow */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.16);
    --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.08);

    /* Motion */
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 120ms;
    --duration-base: 200ms;
    --duration-slow: 320ms;

    /* Layout */
    --container-sm: 540px;
    --container-md: 720px;
    --container-lg: 960px;
    --container-xl: 1140px;
    --container-xxl: 1320px;
    --gutter: 1.5rem;

    /* z-index scale, named instead of arbitrary numbers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-navbar: 1030;
    --z-drawer: 1040;
    --z-modal-backdrop: 1050;
    --z-modal: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* Breakpoints (for reference — CSS custom properties can't be used inside
   @media conditions, so these are documented here and hard-coded below):
     sm:  576px
     md:  768px
     lg:  992px
     xl:  1200px
     xxl: 1400px
*/


/* ==========================================================================
   2. RESET & BASE ELEMENTS
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
}

body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

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

button {
    cursor: pointer;
    background: none;
    border: none;
}

a {
    color: var(--color-action);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--color-action-hover);
}

ul,
ol {
    padding-left: 1.25rem;
}

table {
    border-collapse: collapse;
    width: 100%;
}

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-5) 0;
}

::selection {
    background-color: var(--gray-900);
    color: var(--gray-0);
}


/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
    color: var(--color-text);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); text-transform: uppercase; letter-spacing: 0.04em; }

p {
    margin-bottom: var(--space-4);
}

small, .text-small { font-size: var(--fs-sm); }

blockquote {
    border-left: 3px solid var(--color-border);
    padding-left: var(--space-4);
    color: var(--color-text-muted);
    font-style: italic;
}

code, kbd, samp, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

code {
    background-color: var(--color-surface-alt);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
}

pre {
    background-color: var(--gray-900);
    color: var(--gray-100);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.lead {
    font-size: var(--fs-md);
    font-weight: var(--fw-normal);
    color: var(--color-text-muted);
}


/* ==========================================================================
   4. LAYOUT: CONTAINER & GRID
   ========================================================================== */

.container {
    width: 100%;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-xl { max-width: var(--container-xl); }
.container-xxl { max-width: var(--container-xxl); }
.container-fluid { max-width: none; }

@media (min-width: 576px) { .container { max-width: var(--container-sm); } }
@media (min-width: 768px) { .container { max-width: var(--container-md); } }
@media (min-width: 992px) { .container { max-width: var(--container-lg); } }
@media (min-width: 1200px) { .container { max-width: var(--container-xl); } }
@media (min-width: 1400px) { .container { max-width: var(--container-xxl); } }

/* 12-column flex grid, Bootstrap-style */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-inline: calc(var(--gutter) / -2);
}

.row > * {
    padding-inline: calc(var(--gutter) / 2);
    width: 100%;
}

.col { flex: 1 0 0%; }

/* Generate .col-1 .. .col-12 */
.col-1  { flex: 0 0 auto; width: 8.3333%; }
.col-2  { flex: 0 0 auto; width: 16.6667%; }
.col-3  { flex: 0 0 auto; width: 25%; }
.col-4  { flex: 0 0 auto; width: 33.3333%; }
.col-5  { flex: 0 0 auto; width: 41.6667%; }
.col-6  { flex: 0 0 auto; width: 50%; }
.col-7  { flex: 0 0 auto; width: 58.3333%; }
.col-8  { flex: 0 0 auto; width: 66.6667%; }
.col-9  { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.3333%; }
.col-11 { flex: 0 0 auto; width: 91.6667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

.col-auto { flex: 0 0 auto; width: auto; }

/* Responsive column variants, one breakpoint shown fully; repeat pattern as needed */
@media (min-width: 768px) {
    .col-md-1  { flex: 0 0 auto; width: 8.3333%; }
    .col-md-2  { flex: 0 0 auto; width: 16.6667%; }
    .col-md-3  { flex: 0 0 auto; width: 25%; }
    .col-md-4  { flex: 0 0 auto; width: 33.3333%; }
    .col-md-5  { flex: 0 0 auto; width: 41.6667%; }
    .col-md-6  { flex: 0 0 auto; width: 50%; }
    .col-md-7  { flex: 0 0 auto; width: 58.3333%; }
    .col-md-8  { flex: 0 0 auto; width: 66.6667%; }
    .col-md-9  { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 992px) {
    .col-lg-1  { flex: 0 0 auto; width: 8.3333%; }
    .col-lg-2  { flex: 0 0 auto; width: 16.6667%; }
    .col-lg-3  { flex: 0 0 auto; width: 25%; }
    .col-lg-4  { flex: 0 0 auto; width: 33.3333%; }
    .col-lg-5  { flex: 0 0 auto; width: 41.6667%; }
    .col-lg-6  { flex: 0 0 auto; width: 50%; }
    .col-lg-7  { flex: 0 0 auto; width: 58.3333%; }
    .col-lg-8  { flex: 0 0 auto; width: 66.6667%; }
    .col-lg-9  { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

/* CSS Grid alternative, for when flex-grid isn't the right tool */
.grid {
    display: grid;
    gap: var(--gutter);
    grid-template-columns: repeat(12, 1fr);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}


/* ==========================================================================
   5. FLEXBOX UTILITIES
   ========================================================================== */

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.flex-row { flex-direction: row; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-column { flex-direction: column; }
.flex-column-reverse { flex-direction: column-reverse; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }
.flex-grow-0 { flex-grow: 0; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.items-baseline { align-items: baseline; }

.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }
.self-stretch { align-self: stretch; }

.gap-0 { gap: var(--space-0); }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }


/* ==========================================================================
   6. SPACING UTILITIES (margin / padding, 0–9 scale)
   ========================================================================== */

/* Generated for all four sides, plus x/y/t/r/b/l shorthand, for margin (m)
   and padding (p). Values map to the --space-* scale above. */

.m-0 { margin: var(--space-0); } .p-0 { padding: var(--space-0); }
.m-1 { margin: var(--space-1); } .p-1 { padding: var(--space-1); }
.m-2 { margin: var(--space-2); } .p-2 { padding: var(--space-2); }
.m-3 { margin: var(--space-3); } .p-3 { padding: var(--space-3); }
.m-4 { margin: var(--space-4); } .p-4 { padding: var(--space-4); }
.m-5 { margin: var(--space-5); } .p-5 { padding: var(--space-5); }
.m-6 { margin: var(--space-6); } .p-6 { padding: var(--space-6); }
.m-7 { margin: var(--space-7); } .p-7 { padding: var(--space-7); }
.m-8 { margin: var(--space-8); } .p-8 { padding: var(--space-8); }
.m-auto { margin: auto; }

.mt-0 { margin-top: var(--space-0); } .pt-0 { padding-top: var(--space-0); }
.mt-1 { margin-top: var(--space-1); } .pt-1 { padding-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); } .pt-2 { padding-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .pt-3 { padding-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); } .pt-4 { padding-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); } .pt-5 { padding-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); } .pt-6 { padding-top: var(--space-6); }
.mt-auto { margin-top: auto; }

.mb-0 { margin-bottom: var(--space-0); } .pb-0 { padding-bottom: var(--space-0); }
.mb-1 { margin-bottom: var(--space-1); } .pb-1 { padding-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); } .pb-2 { padding-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); } .pb-3 { padding-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); } .pb-4 { padding-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); } .pb-5 { padding-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); } .pb-6 { padding-bottom: var(--space-6); }
.mb-auto { margin-bottom: auto; }

.ms-0 { margin-left: var(--space-0); } .ps-0 { padding-left: var(--space-0); }
.ms-1 { margin-left: var(--space-1); } .ps-1 { padding-left: var(--space-1); }
.ms-2 { margin-left: var(--space-2); } .ps-2 { padding-left: var(--space-2); }
.ms-3 { margin-left: var(--space-3); } .ps-3 { padding-left: var(--space-3); }
.ms-4 { margin-left: var(--space-4); } .ps-4 { padding-left: var(--space-4); }
.ms-auto { margin-left: auto; }

.me-0 { margin-right: var(--space-0); } .pe-0 { padding-right: var(--space-0); }
.me-1 { margin-right: var(--space-1); } .pe-1 { padding-right: var(--space-1); }
.me-2 { margin-right: var(--space-2); } .pe-2 { padding-right: var(--space-2); }
.me-3 { margin-right: var(--space-3); } .pe-3 { padding-right: var(--space-3); }
.me-4 { margin-right: var(--space-4); } .pe-4 { padding-right: var(--space-4); }
.me-auto { margin-right: auto; }

.mx-0 { margin-inline: var(--space-0); } .px-0 { padding-inline: var(--space-0); }
.mx-1 { margin-inline: var(--space-1); } .px-1 { padding-inline: var(--space-1); }
.mx-2 { margin-inline: var(--space-2); } .px-2 { padding-inline: var(--space-2); }
.mx-3 { margin-inline: var(--space-3); } .px-3 { padding-inline: var(--space-3); }
.mx-4 { margin-inline: var(--space-4); } .px-4 { padding-inline: var(--space-4); }
.mx-5 { margin-inline: var(--space-5); } .px-5 { padding-inline: var(--space-5); }
.mx-auto { margin-inline: auto; }

.my-0 { margin-block: var(--space-0); } .py-0 { padding-block: var(--space-0); }
.my-1 { margin-block: var(--space-1); } .py-1 { padding-block: var(--space-1); }
.my-2 { margin-block: var(--space-2); } .py-2 { padding-block: var(--space-2); }
.my-3 { margin-block: var(--space-3); } .py-3 { padding-block: var(--space-3); }
.my-4 { margin-block: var(--space-4); } .py-4 { padding-block: var(--space-4); }
.my-5 { margin-block: var(--space-5); } .py-5 { padding-block: var(--space-5); }
.my-6 { margin-block: var(--space-6); } .py-6 { padding-block: var(--space-6); }
.my-auto { margin-block: auto; }


/* ==========================================================================
   7. SIZING UTILITIES
   ========================================================================== */

.w-25 { width: 25%; }
.w-50 { width: 50%; }
.w-75 { width: 75%; }
.w-100 { width: 100%; }
.w-auto { width: auto; }
.w-screen { width: 100vw; }

.h-25 { height: 25%; }
.h-50 { height: 50%; }
.h-75 { height: 75%; }
.h-100 { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }

.mw-100 { max-width: 100%; }
.mh-100 { max-height: 100%; }
.min-w-0 { min-width: 0; }
.min-h-screen { min-height: 100vh; }


/* ==========================================================================
   8. DISPLAY & POSITION UTILITIES
   ========================================================================== */

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-grid { display: grid; }
.d-table { display: table; }

@media (min-width: 768px) {
    .d-md-none { display: none; }
    .d-md-block { display: block; }
    .d-md-flex { display: flex; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none; }
    .d-lg-block { display: block; }
    .d-lg-flex { display: flex; }
}

.position-static { position: static; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; top: 0; }

.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.start-0 { left: 0; }
.end-0 { right: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

.translate-middle {
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
}

.float-start { float: left; }
.float-end { float: right; }
.clearfix::after { content: ""; display: table; clear: both; }


/* ==========================================================================
   9. TEXT & COLOR UTILITIES
   ========================================================================== */

.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); }
.text-md { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }

.fw-normal { font-weight: var(--fw-normal); }
.fw-medium { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold { font-weight: var(--fw-bold); }
.fst-italic { font-style: italic; }

.text-start { text-align: left; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-justify { text-align: justify; }

.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }
.text-decoration-none { text-decoration: none; }
.text-nowrap { white-space: nowrap; }

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Multi-line clamp, bonus over Bootstrap's single-line truncate */
.text-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.text-white { color: var(--gray-0); }
.text-black { color: var(--gray-1000); }
.text-muted { color: var(--color-text-muted); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-600 { color: var(--gray-600); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }

.bg-white { background-color: var(--gray-0); }
.bg-black { background-color: var(--gray-1000); }
.bg-surface { background-color: var(--color-surface); }
.bg-surface-alt { background-color: var(--color-surface-alt); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-gray-200 { background-color: var(--gray-200); }
.bg-gray-800 { background-color: var(--gray-800); }
.bg-gray-900 { background-color: var(--gray-900); }
.bg-success { background-color: var(--color-success-bg); }
.bg-danger { background-color: var(--color-danger-bg); }
.bg-warning { background-color: var(--color-warning-bg); }
.bg-info { background-color: var(--color-info-bg); }
.bg-transparent { background-color: transparent; }


/* ==========================================================================
   10. BORDER, RADIUS & SHADOW UTILITIES
   ========================================================================== */

.border { border: 1px solid var(--color-border); }
.border-0 { border: none; }
.border-top { border-top: 1px solid var(--color-border); }
.border-bottom { border-bottom: 1px solid var(--color-border); }
.border-start { border-left: 1px solid var(--color-border); }
.border-end { border-right: 1px solid var(--color-border); }
.border-dashed { border-style: dashed; }
.border-2 { border-width: 2px; }

.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-pill { border-radius: var(--radius-pill); }
.rounded-circle { border-radius: 50%; }

.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }


/* ==========================================================================
   11. BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.55rem 1.1rem;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background-color var(--duration-base) var(--ease-standard),
                border-color var(--duration-base) var(--ease-standard),
                color var(--duration-base) var(--ease-standard),
                transform var(--duration-fast) var(--ease-standard);
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background-color: var(--color-action);
    color: var(--color-text-inverse);
    border-color: var(--color-action);
}
.btn-primary:hover:not(:disabled) { background-color: var(--color-action-hover); color: var(--color-text-inverse); }

.btn-secondary {
    background-color: var(--color-surface-alt);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) { background-color: var(--gray-150); color: var(--color-text); }

.btn-outline {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--gray-400);
}
.btn-outline:hover:not(:disabled) { background-color: var(--color-surface-alt); color: var(--color-text); }

.btn-ghost {
    background-color: transparent;
    color: var(--color-text);
    border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background-color: var(--color-surface-alt); color: var(--color-text); }

.btn-danger {
    background-color: var(--color-danger);
    color: var(--gray-0);
    border-color: var(--color-danger);
}
.btn-danger:hover:not(:disabled) { filter: brightness(0.9); }

.btn-link {
    background: none;
    border-color: transparent;
    color: var(--color-action);
    text-decoration: underline;
    padding-inline: 0;
}

.btn-sm { padding: 0.35rem 0.75rem; font-size: var(--fs-sm); }
.btn-lg { padding: 0.85rem 1.5rem; font-size: var(--fs-md); }
.btn-icon { padding: 0.55rem; aspect-ratio: 1; }
.btn-block { display: flex; width: 100%; }

.btn-group {
    display: inline-flex;
}
.btn-group .btn {
    border-radius: 0;
    margin-left: -1px;
}
.btn-group .btn:first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); margin-left: 0; }
.btn-group .btn:last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }
.btn-group .btn:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--gray-900);
    z-index: 1;
}
.btn-group .btn-primary:focus-visible,
.btn-group .btn-danger:focus-visible {
    box-shadow: inset 0 0 0 2px var(--gray-0);
}


/* ==========================================================================
   12. FORMS
   ========================================================================== */

.form-group { margin-bottom: var(--space-4); }

.form-label {
    display: block;
    font-weight: var(--fw-medium);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-2);
}

.form-label .required { color: var(--color-danger); margin-left: 2px; }

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: var(--fs-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-base) var(--ease-standard),
                box-shadow var(--duration-base) var(--ease-standard);
}

.form-control::placeholder { color: var(--gray-400); }

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--gray-600);
    box-shadow: 0 0 0 3px var(--gray-150);
}

.form-control:disabled {
    background-color: var(--color-surface-alt);
    color: var(--gray-400);
    cursor: not-allowed;
}

textarea.form-control { min-height: 6rem; resize: vertical; }

.form-text { font-size: var(--fs-xs); color: var(--color-text-muted); margin-top: var(--space-1); }

.form-control.is-invalid { border-color: var(--color-danger); }
.form-control.is-valid { border-color: var(--color-success); }
.invalid-feedback { font-size: var(--fs-xs); color: var(--color-danger); margin-top: var(--space-1); }
.valid-feedback { font-size: var(--fs-xs); color: var(--color-success); margin-top: var(--space-1); }

/* Checkbox / radio, custom styled rather than left as browser default */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.form-check-input {
    appearance: none;
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    border: 1px solid var(--gray-400);
    border-radius: var(--radius-sm);
    margin-top: 0.15rem;
    display: grid;
    place-content: center;
    cursor: pointer;
}

.form-check-input[type="radio"] { border-radius: 50%; }

.form-check-input::before {
    content: "";
    width: 0.6rem;
    height: 0.6rem;
    transform: scale(0);
    transition: transform var(--duration-fast) var(--ease-standard);
    box-shadow: inset 1em 1em var(--color-action);
    border-radius: 2px;
}

.form-check-input[type="radio"]::before { border-radius: 50%; }
.form-check-input:checked::before { transform: scale(1); }
.form-check-input:checked { border-color: var(--color-action); }

.form-check-label { font-size: var(--fs-sm); }

/* Toggle switch */
.form-switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.form-switch input {
    appearance: none;
    width: 2.5rem;
    height: 1.4rem;
    background-color: var(--gray-300);
    border-radius: var(--radius-pill);
    position: relative;
    cursor: pointer;
    transition: background-color var(--duration-base) var(--ease-standard);
}

.form-switch input::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.4rem - 4px);
    height: calc(1.4rem - 4px);
    background-color: var(--gray-0);
    border-radius: 50%;
    transition: transform var(--duration-base) var(--ease-standard);
}

.form-switch input:checked { background-color: var(--color-action); }
.form-switch input:checked::before { transform: translateX(1.1rem); }

/* Input group, e.g. prefix/suffix icons or buttons attached to a field */
.input-group {
    display: flex;
}
.input-group .form-control {
    border-radius: 0;
}
.input-group > :first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.input-group > :last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }
.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    background-color: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}

/* Floating label, common Bootstrap 5 pattern */
.form-floating {
    position: relative;
}
.form-floating .form-control {
    padding: 1.3rem 0.75rem 0.4rem;
}
.form-floating label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.75rem;
    color: var(--gray-500);
    pointer-events: none;
    transform-origin: 0 0;
    transition: transform var(--duration-base) var(--ease-standard), color var(--duration-base) var(--ease-standard);
}
.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.8) translateY(-0.6rem);
    color: var(--color-text-muted);
}


/* ==========================================================================
   13. CARDS
   ========================================================================== */

.card {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: var(--space-5); }
.card-title { margin-bottom: var(--space-2); font-size: var(--fs-lg); }
.card-subtitle { color: var(--color-text-muted); font-size: var(--fs-sm); margin-bottom: var(--space-3); }
.card-text { color: var(--color-text-muted); }
.card-footer {
    padding: var(--space-4) var(--space-5);
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
}
.card-hover {
    transition: box-shadow var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
}
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }


/* ==========================================================================
   14. NAVBAR
   ========================================================================== */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--gutter);
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: var(--z-navbar);
}

.navbar-brand {
    font-weight: var(--fw-bold);
    font-size: var(--fs-lg);
    text-decoration: none;
    color: var(--color-text);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    list-style: none;
    padding: 0;
}

.navbar-nav a {
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
}
.navbar-nav a:hover,
.navbar-nav a.active { color: var(--color-text); }

.navbar-toggler { display: none; }

@media (max-width: 767px) {
    .navbar-nav { display: none; }
    .navbar-toggler { display: block; }
}


/* ==========================================================================
   15. ALERTS
   ========================================================================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-4);
}

.alert-neutral { background-color: var(--color-surface-alt); border-color: var(--color-border); color: var(--color-text); }
.alert-success { background-color: var(--color-success-bg); border-color: #c6e6d1; color: var(--color-success); }
.alert-danger  { background-color: var(--color-danger-bg); border-color: #f1c9c6; color: var(--color-danger); }
.alert-warning { background-color: var(--color-warning-bg); border-color: #eeddb0; color: var(--color-warning); }
.alert-info    { background-color: var(--color-info-bg); border-color: #c9d8e8; color: var(--color-info); }

.alert-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
}
.alert-dismiss:hover { opacity: 1; }


/* ==========================================================================
   16. BADGES
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    border-radius: var(--radius-pill);
    line-height: 1.4;
}

.badge-neutral { background-color: var(--color-surface-alt); color: var(--color-text); }
.badge-dark { background-color: var(--gray-900); color: var(--gray-0); }
.badge-outline { background-color: transparent; border: 1px solid var(--gray-400); color: var(--color-text); }
.badge-success { background-color: var(--color-success-bg); color: var(--color-success); }
.badge-danger { background-color: var(--color-danger-bg); color: var(--color-danger); }
.badge-warning { background-color: var(--color-warning-bg); color: var(--color-warning); }
.badge-info { background-color: var(--color-info-bg); color: var(--color-info); }

.badge-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    display: inline-block;
    margin-right: var(--space-2);
}


/* ==========================================================================
   17. TABLES
   ========================================================================== */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

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

.table th {
    font-weight: var(--fw-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: var(--fs-xs);
    letter-spacing: 0.04em;
    background-color: var(--color-surface);
}

.table-striped tbody tr:nth-child(odd) { background-color: var(--color-surface); }
.table-hover tbody tr:hover { background-color: var(--color-surface-alt); }
.table-bordered th, .table-bordered td { border: 1px solid var(--color-border); }
.table-borderless th, .table-borderless td { border: none; }
.table-sm th, .table-sm td { padding: var(--space-2) var(--space-3); }

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


/* ==========================================================================
   18. TABS
   ========================================================================== */

.tabs {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.tab-list {
    display: flex;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.tab-button {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--color-text-muted);
    border-right: 1px solid var(--color-border);
    transition: background-color var(--duration-base) var(--ease-standard), color var(--duration-base) var(--ease-standard);
}
.tab-button:last-child { border-right: none; }
.tab-button:hover { background-color: var(--color-surface-alt); }
.tab-button.active { background-color: var(--gray-900); color: var(--gray-0); }

/* Grouped buttons sit flush against each other, so the default
   outline + outline-offset (see section 31) pokes out past the button's
   own edge and overlaps the neighbor — the "chunky double border" look.
   An inset box-shadow stays entirely inside the button instead, and
   flips to a light ring automatically when the tab's own background
   is already dark. */
.tab-button:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--gray-900);
    position: relative;
    z-index: 1;
}
.tab-button.active:focus-visible {
    box-shadow: inset 0 0 0 2px var(--gray-0);
}

.tab-panel { display: none; padding: var(--space-5); }
.tab-panel.active { display: block; }


/* ==========================================================================
   19. ACCORDION
   ========================================================================== */

.accordion-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-4);
    font-weight: var(--fw-medium);
    background-color: var(--color-bg);
    cursor: pointer;
}

.accordion-header:hover { background-color: var(--color-surface); }

.accordion-icon {
    transition: transform var(--duration-base) var(--ease-standard);
    flex-shrink: 0;
}
.accordion-item.open .accordion-icon { transform: rotate(180deg); }

/* Grid-rows trick: animating from 0fr to 1fr animates a "height: auto"
   target smoothly, without any JS measuring scrollHeight. Far fewer
   moving parts than the old max-height/scrollHeight approach, and it
   can't get out of sync with content that changes size dynamically. */
.accordion-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--duration-base) var(--ease-standard);
}
.accordion-item.open .accordion-body {
    grid-template-rows: 1fr;
}
.accordion-body > * {
    overflow: hidden;
    min-height: 0;
}
/* This element must stay padding-free — it's the one grid measures for the
   0fr/1fr collapse, and padding on it would show up as a leftover sliver
   even at "0" height, since padding is part of an element's own box and
   isn't something overflow:hidden can clip away. Put the visible padding
   one level deeper instead, on .accordion-body-content. */
.accordion-body-inner {
    padding: 0;
}
.accordion-body-content {
    padding: 0 var(--space-4) var(--space-4);
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
}

@media (prefers-reduced-motion: reduce) {
    .accordion-body { transition: none; }
}


/* ==========================================================================
   20. DROPDOWN
   ========================================================================== */

.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-2);
    z-index: var(--z-dropdown);
    display: none;
}

.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: var(--color-text);
    text-decoration: none;
}
.dropdown-item:hover { background-color: var(--color-surface-alt); }
.dropdown-divider { border-top: 1px solid var(--color-border); margin: var(--space-2) 0; }


/* ==========================================================================
   21. MODAL
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: var(--z-modal-backdrop);
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal.open,
.modal-backdrop.open { display: flex; }

.modal-dialog {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-in var(--duration-base) var(--ease-standard);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.modal-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.modal-close { background: none; border: none; font-size: var(--fs-lg); cursor: pointer; color: var(--color-text-muted); }
.modal-body { padding: var(--space-5); }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}


/* ==========================================================================
   22. TOOLTIP
   ========================================================================== */

.tooltip-wrapper { position: relative; display: inline-block; }

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: var(--gray-900);
    color: var(--gray-0);
    font-size: var(--fs-xs);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
    z-index: var(--z-tooltip);
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-900);
}

.tooltip-wrapper:hover .tooltip-content {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ==========================================================================
   23. TOAST
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: var(--z-toast);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 280px;
    max-width: 360px;
    padding: var(--space-3) var(--space-4);
    background-color: var(--gray-900);
    color: var(--gray-0);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-sm);
    animation: toast-in var(--duration-base) var(--ease-standard);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}


/* ==========================================================================
   24. PAGINATION & BREADCRUMB
   ========================================================================== */

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: var(--space-1);
}

.page-item a,
.page-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-text);
    font-size: var(--fs-sm);
}

.page-item a:hover { background-color: var(--color-surface-alt); }
.page-item.active span { background-color: var(--gray-900); color: var(--gray-0); border-color: var(--gray-900); }
.page-item.disabled span { color: var(--gray-300); cursor: not-allowed; }

.breadcrumb {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    margin: 0 var(--space-2);
    color: var(--gray-300);
}

.breadcrumb-item a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--color-text); }
.breadcrumb-item.active { color: var(--color-text); }


/* ==========================================================================
   25. PROGRESS & SPINNER
   ========================================================================== */

.progress {
    width: 100%;
    height: 0.5rem;
    background-color: var(--color-surface-alt);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--gray-900);
    border-radius: var(--radius-pill);
    transition: width var(--duration-slow) var(--ease-standard);
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%,
        rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--color-border);
    border-top-color: var(--gray-900);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm { width: 1rem; height: 1rem; border-width: 2px; }
.spinner-lg { width: 2.5rem; height: 2.5rem; border-width: 3px; }

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


/* ==========================================================================
   26. AVATAR & LIST GROUP
   ========================================================================== */

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--color-surface-alt);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--fw-semibold);
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
}

.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: var(--fs-xs); }
.avatar-lg { width: 3.5rem; height: 3.5rem; font-size: var(--fs-md); }

.avatar-group {
    display: flex;
}
.avatar-group .avatar {
    border: 2px solid var(--color-bg);
    margin-left: -0.6rem;
}
.avatar-group .avatar:first-child { margin-left: 0; }

.list-group {
    list-style: none;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.list-group-item {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg);
}
.list-group-item:last-child { border-bottom: none; }
.list-group-item.active { background-color: var(--gray-900); color: var(--gray-0); }
.list-group-item-action:hover { background-color: var(--color-surface-alt); cursor: pointer; }


/* ==========================================================================
   27. DRAWER / OFFCANVAS
   ========================================================================== */

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(360px, 90vw);
    background-color: var(--color-bg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-drawer);
    transform: translateX(100%);
    transition: transform var(--duration-slow) var(--ease-standard);
    display: flex;
    flex-direction: column;
}

.drawer.open { transform: translateX(0); }
.drawer-left { right: auto; left: 0; transform: translateX(-100%); }
.drawer-left.open { transform: translateX(0); }

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.drawer-body { padding: var(--space-5); overflow-y: auto; flex: 1; }


/* ==========================================================================
   28. SKELETON LOADER
   ========================================================================== */

.skeleton {
    background: linear-gradient(90deg, var(--color-surface-alt) 25%, var(--gray-150) 37%, var(--color-surface-alt) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text { height: 0.9em; margin-bottom: var(--space-2); }
.skeleton-title { height: 1.5em; width: 60%; margin-bottom: var(--space-3); }
.skeleton-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; }

@keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}


/* ==========================================================================
   29. MISC UTILITIES
   ========================================================================== */

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-grab { cursor: grab; }

.select-none { user-select: none; }
.select-all { user-select: all; }

.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-scroll { overflow: scroll; }

.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-portrait { aspect-ratio: 3 / 4; }

.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-dropdown { z-index: var(--z-dropdown); }
.z-modal { z-index: var(--z-modal); }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.divider {
    height: 1px;
    background-color: var(--color-border);
    border: none;
    margin: var(--space-5) 0;
}

.divider-vertical {
    width: 1px;
    align-self: stretch;
    background-color: var(--color-border);
}


/* ==========================================================================
   30. DARK MODE
   ========================================================================== */

/* Toggle by adding data-theme="dark" to <html> or <body>.
   Everything else in this file references the semantic tokens, so
   components repaint automatically — no component-level overrides needed. */

[data-theme="dark"] {
    --color-bg: var(--gray-1000);
    --color-surface: #141414;
    --color-surface-alt: #1f1f1f;
    --color-border: #2e2e2e;
    --color-text: var(--gray-100);
    --color-text-muted: var(--gray-400);
    --color-text-inverse: var(--gray-1000);
    --color-action: var(--gray-0);
    --color-action-hover: var(--gray-150);
    --color-action-muted: #2a2a2a;
}

/* Optional: follow system preference automatically when no explicit
   data-theme attribute is set. Remove this block if you want the toggle
   to be the only way dark mode activates. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: var(--gray-1000);
        --color-surface: #141414;
        --color-surface-alt: #1f1f1f;
        --color-border: #2e2e2e;
        --color-text: var(--gray-100);
        --color-text-muted: var(--gray-400);
        --color-text-inverse: var(--gray-1000);
        --color-action: var(--gray-0);
        --color-action-hover: var(--gray-150);
    }
}


/* ==========================================================================
   31. ACCESSIBILITY
   ========================================================================== */

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background-color: var(--gray-900);
    color: var(--gray-0);
    padding: var(--space-2) var(--space-4);
    z-index: 2000;
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

:focus-visible {
    outline: 2px solid var(--gray-900);
    outline-offset: 2px;
}

[data-theme="dark"] :focus-visible {
    outline-color: var(--gray-0);
}

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


/* ==========================================================================
   32. PRINT STYLES
   ========================================================================== */

@media print {
    .navbar, .drawer, .modal, .modal-backdrop, .toast-container, .btn, .no-print {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
    a { text-decoration: underline; color: #000; }
    .card, .table { box-shadow: none !important; border: 1px solid #999; }
}


/* ==========================================================================
   33. ADVANCED TRICKS — things Bootstrap doesn't ship with
   ========================================================================== */

/* Native form controls (date pickers, scrollbars, selection UI) render in
   the browser's dark theme automatically when this is set, instead of
   staying stuck light inside a dark page. */
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

/* Makes native checkboxes/radios/range inputs that you didn't restyle
   still match the palette, cheaply. */
input, select, textarea { accent-color: var(--color-action); }

/* --- Scroll reveal ---------------------------------------------------
   Pair with the IntersectionObserver in framework.js. Add .reveal to any
   element; it fades/slides in once .revealed is toggled on by JS. */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--duration-slow) var(--ease-standard),
                transform var(--duration-slow) var(--ease-standard);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* --- Sticky header shadow-on-scroll -----------------------------------
   framework.js toggles this class once the page scrolls past a threshold,
   so the navbar only casts a shadow when there's content sliding under it. */
.navbar-scrolled {
    box-shadow: var(--shadow-sm);
    border-bottom-color: transparent;
}

/* --- Glassmorphism, used sparingly (e.g. a navbar over a hero image) -- */
.glass {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
[data-theme="dark"] .glass {
    background-color: rgba(20, 20, 20, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

/* --- Gradient text, grayscale only so it stays on-brand --------------- */
.text-gradient {
    background: linear-gradient(90deg, var(--gray-900), var(--gray-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent; /* Safari ignores color:transparent here without this */
}
[data-theme="dark"] .text-gradient {
    background: linear-gradient(90deg, var(--gray-0), var(--gray-400));
    -webkit-background-clip: text;
    background-clip: text;
}

/* --- Custom scrollbar (WebKit + Firefox) ------------------------------ */
.scroll-styled {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) transparent;
}
.scroll-styled::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-styled::-webkit-scrollbar-track { background: transparent; }
.scroll-styled::-webkit-scrollbar-thumb {
    background-color: var(--gray-400);
    border-radius: var(--radius-pill);
}
.scroll-styled::-webkit-scrollbar-thumb:hover { background-color: var(--gray-600); }

/* --- Masonry-style columns, no JS needed for the layout itself -------- */
.masonry {
    column-count: 3;
    column-gap: var(--gutter);
}
.masonry > * {
    break-inside: avoid;
    margin-bottom: var(--gutter);
}
@media (max-width: 991px) { .masonry { column-count: 2; } }
@media (max-width: 575px) { .masonry { column-count: 1; } }

/* --- Container queries -------------------------------------------------
   A card that switches to a horizontal layout once its own container is
   wide enough, regardless of viewport width. Wrap it in .card-container. */
.card-container { container-type: inline-size; container-name: card; }

@container card (min-width: 420px) {
    .card-adaptive { display: flex; }
    .card-adaptive .card-img { width: 40%; aspect-ratio: 1; }
    .card-adaptive .card-body { flex: 1; }
}

/* --- Notification pulse, for "something needs your attention" dots --- */
.badge-pulse { position: relative; }
.badge-pulse::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    animation: pulse-ring 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse-ring {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 0; transform: scale(2.2); }
}

/* --- Ripple effect surface ---------------------------------------------
   framework.js injects a .ripple-dot span with inline position/size on
   click; this just defines what that span looks like and how it animates. */
.ripple-surface { position: relative; overflow: hidden; }
.ripple-dot {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple 550ms var(--ease-standard);
    pointer-events: none;
}
.btn-outline .ripple-dot,
.btn-secondary .ripple-dot,
.btn-ghost .ripple-dot { background-color: rgba(0, 0, 0, 0.08); }
@keyframes ripple {
    to { transform: scale(2.5); opacity: 0; }
}

/* --- Copy-to-clipboard button state ------------------------------------
   framework.js toggles [data-copied] on the trigger for ~1.5s after a
   successful copy; style the "Copied!" state here instead of in JS. */
[data-copy][data-copied] { color: var(--color-success); border-color: var(--color-success); }

/* --- Count-up numbers, purely typographic; JS drives the actual count - */
.stat-number {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* --- Marquee / ticker, pure CSS, pauses on hover ------------------------ */
.marquee {
    overflow: hidden;
    white-space: nowrap;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 18s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* --- Focus trap boundary marker (used by JS, no visual by itself) ----- */
[data-focus-trap] { outline: none; }

/* --- Skip-to-top button, appears once page has scrolled --------------- */
.back-to-top {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background-color: var(--gray-900);
    color: var(--gray-0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--duration-base) var(--ease-standard),
                transform var(--duration-base) var(--ease-standard),
                visibility var(--duration-base);
    z-index: var(--z-sticky);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* --- High-contrast mode support ----------------------------------------- */
@media (prefers-contrast: more) {
    :root {
        --color-border: var(--gray-700);
        --color-text-muted: var(--gray-800);
    }
    .btn, .form-control { border-width: 2px; }
}

/* --- View Transitions API hook ------------------------------------------
   If the browser supports it, cross-page or state navigations get a
   quiet built-in crossfade for free — nothing else needs to change. */
@media (prefers-reduced-motion: no-preference) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: var(--duration-slow);
    }
}


/* ==========================================================================
   34. CODE SAMPLE / SNIPPET VIEWER
   Reusable "view code" disclosure with a one-click copy button, used
   throughout documentation or demo pages. Needs no JS to open/close
   (native <details>); the copy button is wired by data-copy-target
   in framework.js.
   ========================================================================== */

.code-sample {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-top: var(--space-3);
}

.code-sample summary {
    list-style: none;
    cursor: pointer;
    padding: var(--space-2) var(--space-3);
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    user-select: none;
}
.code-sample summary::-webkit-details-marker { display: none; }
.code-sample summary::before {
    content: "▸";
    transition: transform var(--duration-fast) var(--ease-standard);
}
.code-sample[open] summary::before { transform: rotate(90deg); }
.code-sample summary:hover { color: var(--color-text); background-color: var(--color-surface); }

.code-block {
    position: relative;
    border-top: 1px solid var(--color-border);
}

.code-block pre {
    margin: 0;
    border-radius: 0;
    max-height: 320px;
    overflow: auto;
}

.code-block .code-copy-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
}


/* ==========================================================================
   35. STACK & DIVIDE UTILITIES  (Chakra UI's Stack, Tailwind's space-x/y)
   Chakra composes layout with <VStack>/<HStack> instead of manually gapping
   every parent; Tailwind's space-y-* adds margin between children instead
   of using gap. Both land on the same trick: style the relationship between
   siblings, not each child individually.
   ========================================================================== */

.stack-v { display: flex; flex-direction: column; }
.stack-h { display: flex; flex-direction: row; align-items: center; }

.stack-v > * + * { margin-top: var(--space-4); }
.stack-h > * + * { margin-left: var(--space-4); }

/* Divide: adds a rule *between* children without adding one at the edges —
   the classic `> * + *` sibling trick, so you don't need a wrapper div per
   divider. */
.divide-y > * + * { border-top: 1px solid var(--color-border); }
.divide-x > * + * { border-left: 1px solid var(--color-border); }
.divide-y-thick > * + * { border-top-width: 2px; }


/* ==========================================================================
   36. RING UTILITY  (Tailwind's focus/ring system)
   Tailwind deliberately separates "ring" (an outer glow, box-shadow based)
   from "border" (part of layout). Useful when you want a focus/selection
   indicator that doesn't reflow surrounding content the way a border does.
   ========================================================================== */

.ring { box-shadow: 0 0 0 3px var(--gray-150); }
.ring-dark { box-shadow: 0 0 0 3px var(--gray-400); }
.ring-offset { box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--gray-900); }


/* ==========================================================================
   37. STRETCHED LINK  (Bootstrap)
   Makes an entire card clickable via a single link inside it, without
   wrapping the whole card in an <a> (which breaks nested interactive
   elements like buttons). Add .stretched-link to the link/heading, and
   .position-relative to the card ancestor.
   ========================================================================== */

.stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}


/* ==========================================================================
   38. BUTTON LOADING STATE  (Bulma's `is-loading`)
   Toggle with Mono.setLoading(button, true/false) in framework.js, or add
   data-loading directly for a static example. The label stays in the DOM
   (screen readers still announce it) but is visually replaced by a spinner.
   ========================================================================== */

.btn[data-loading] {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}
.btn[data-loading]::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-outline[data-loading]::after,
.btn-secondary[data-loading]::after,
.btn-ghost[data-loading]::after {
    border-color: var(--color-border);
    border-top-color: var(--gray-900);
}


/* ==========================================================================
   39. FLOATING ACTION BUTTON  (Material Design FAB)
   ========================================================================== */

.fab {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: var(--gray-900);
    color: var(--gray-0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xl);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-sticky);
    transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard);
}
.fab:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.fab-extended { width: auto; border-radius: var(--radius-pill); padding: 0 var(--space-5); gap: var(--space-2); font-size: var(--fs-base); }


/* ==========================================================================
   40. CHIPS / TAGS  (Material Chips, Bulma Tags — interactive, removable;
   distinct from .badge, which is a static label)
   ========================================================================== */

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.3rem 0.5rem 0.3rem 0.85rem;
    border-radius: var(--radius-pill);
    background-color: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    font-size: var(--fs-sm);
}

.chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: none;
    color: var(--color-text-muted);
    font-size: var(--fs-xs);
    line-height: 1;
}
.chip-remove:hover { background-color: var(--gray-200); color: var(--color-text); }

.chip-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }


/* ==========================================================================
   41. SEGMENTED CONTROL  (Material/iOS segmented buttons, Ant Design's
   Radio.Group buttonStyle="solid" — a toggle group styled as one control,
   visually distinct from .tabs even though the interaction is similar)
   ========================================================================== */

.segmented {
    display: inline-flex;
    padding: 3px;
    background-color: var(--color-surface-alt);
    border-radius: var(--radius-md);
    gap: 2px;
}

.segmented-option {
    padding: 0.4rem 0.9rem;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--color-text-muted);
    border-radius: calc(var(--radius-md) - 3px);
    transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.segmented-option:hover { color: var(--color-text); }
.segmented-option.active {
    background-color: var(--color-bg);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}
.segmented-option:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--gray-900);
}
.segmented-option.active:focus-visible {
    box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--gray-900);
}


/* ==========================================================================
   42. ELEVATION SCALE  (Material Design's numbered elevation levels —
   same box-shadow tokens as section 10, just exposed under the naming
   convention Material developers already know)
   ========================================================================== */

.elevation-0 { box-shadow: none; }
.elevation-1 { box-shadow: var(--shadow-sm); }
.elevation-2 { box-shadow: var(--shadow-md); }
.elevation-3 { box-shadow: var(--shadow-lg); }
.elevation-4 { box-shadow: var(--shadow-xl); }
.elevation-5 { box-shadow: 0 24px 56px rgba(0, 0, 0, 0.22); }


/* ==========================================================================
   43. KBD  (Chakra/Semantic/GitHub-style keyboard key)
   ========================================================================== */

.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6em;
    padding: 0.15em 0.5em;
    font-family: var(--font-mono);
    font-size: 0.8em;
    color: var(--color-text);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
}


/* ==========================================================================
   44. STAR RATING  (Ant Design's Rate — pure CSS, no JS)
   Radio inputs in reverse DOM order + the general sibling combinator, so
   hovering or selecting a star also fills every star before it, using only
   forward CSS selectors (CSS can't select backwards, so the trick is to
   lay the stars out backwards and un-reverse them visually with flex).
   ========================================================================== */

.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    font-size: var(--fs-xl);
}
.star-rating input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.star-rating label {
    color: var(--gray-300);
    cursor: pointer;
    padding: 0 0.05em;
    transition: color var(--duration-fast) var(--ease-standard);
}
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: var(--gray-900);
}


/* ==========================================================================
   45. EMPTY STATE  (Ant Design's Empty)
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--color-text-muted);
}
.empty-state-icon {
    font-size: var(--fs-4xl);
    margin-bottom: var(--space-4);
    opacity: 0.4;
}
.empty-state-title {
    font-weight: var(--fw-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-2);
}


/* ==========================================================================
   46. RESULT / STATUS PAGE  (Ant Design's Result — the "big icon, heading,
   description, actions" pattern used for 404s, success confirmations,
   permission-denied pages, etc.)
   ========================================================================== */

.result {
    max-width: 480px;
    margin-inline: auto;
    text-align: center;
    padding: var(--space-8) var(--space-4);
}
.result-icon { font-size: var(--fs-4xl); margin-bottom: var(--space-5); }
.result-icon.success { color: var(--color-success); }
.result-icon.danger { color: var(--color-danger); }
.result-title { margin-bottom: var(--space-2); }
.result-description { color: var(--color-text-muted); margin-bottom: var(--space-5); }
.result-actions { display: flex; justify-content: center; gap: var(--space-3); }


/* ==========================================================================
   47. DIVIDER WITH TEXT  (Semantic UI's Divider — the "or continue with"
   pattern on login screens)
   ========================================================================== */

.divider-text {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: var(--space-5) 0;
}
.divider-text::before,
.divider-text::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--color-border);
}


/* ==========================================================================
   48. STEPPER / STEPS  (Material Stepper, Ant Design Steps)
   ========================================================================== */

.steps {
    display: flex;
    align-items: flex-start;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}

.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 1rem;
    left: 50%;
    width: 100%;
    height: 1px;
    background-color: var(--color-border);
    z-index: 0;
}

.step-circle {
    position: relative;
    z-index: 1;
    width: 2rem;
    height: 2rem;
    margin: 0 auto var(--space-2);
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--fw-semibold);
}

.step.done .step-circle { background-color: var(--gray-900); border-color: var(--gray-900); color: var(--gray-0); }
.step.done:not(:last-child)::after { background-color: var(--gray-900); }
.step.active .step-circle { border-color: var(--gray-900); border-width: 2px; }
.step.active { color: var(--color-text); font-weight: var(--fw-medium); }


/* ==========================================================================
   49. TIMELINE  (Ant Design's Timeline)
   ========================================================================== */

.timeline {
    position: relative;
    padding-left: var(--space-5);
    border-left: 2px solid var(--color-border);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-6);
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: "";
    position: absolute;
    left: calc(var(--space-5) * -1 - 5px);
    top: 0.2rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--gray-900);
    border: 2px solid var(--color-bg);
    box-shadow: 0 0 0 1px var(--color-border);
}

.timeline-time { font-size: var(--fs-xs); color: var(--color-text-muted); margin-bottom: var(--space-1); }
.timeline-title { font-weight: var(--fw-medium); }


/* ==========================================================================
   50. STATISTIC  (Ant Design's Statistic — a formal version of the bare
   .stat-number from section 33, with a label and optional trend indicator)
   ========================================================================== */

.statistic-label {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}
.statistic-value {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
}
.statistic-trend { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.statistic-trend.up { color: var(--color-success); }
.statistic-trend.down { color: var(--color-danger); }
