/* ============================================================
   HIGHLIGHT.CSS — A Minimalist Design System
   Inspired by evenbettermotherfucking.website & jamesclear.com
   Highlighter-pen aesthetics · Modular type scale · Bootstrap classes
   ============================================================ */

/* --- CSS Custom Properties --------------------------------- */
:root {
  /* Surface & Text */
  --bg:              #f6f4f0;
  --bg-alt:          #edeae4;
  --surface:         #fdfcfa;
  --text:            #2e2e2e;
  --text-muted:      #6b6560;
  --text-light:      #9a938c;
  --border:          #ddd7cf;
  --border-light:    #e8e4dd;

  /* Highlighter Palette — pastel, translucent, pen-like */
  --hl-yellow:       rgba(253, 240, 148, 0.55);
  --hl-yellow-solid: #fdf094;
  --hl-pink:         rgba(255, 179, 186, 0.50);
  --hl-pink-solid:   #ffb3ba;
  --hl-green:        rgba(186, 237, 186, 0.50);
  --hl-green-solid:  #baedba;
  --hl-blue:         rgba(173, 216, 255, 0.50);
  --hl-blue-solid:   #add8ff;
  --hl-purple:       rgba(211, 190, 244, 0.48);
  --hl-purple-solid: #d3bef4;
  --hl-orange:       rgba(255, 213, 153, 0.50);
  --hl-orange-solid: #ffd599;

  /* Accent */
  --primary:         #3a6b4e;
  --primary-hover:   #2e5640;
  --primary-light:   rgba(58, 107, 78, 0.08);
  --danger:          #b44a4a;
  --danger-hover:    #943d3d;
  --warning:         #b48a2e;
  --info:            #3a6b8a;
  --success:         #3a6b4e;

  /* Typography — Modular Scale (ratio ~1.25 "Major Third") */
  --font-body:       'Source Serif 4', 'Georgia', serif;
  --font-heading:    'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono:       'JetBrains Mono', 'Menlo', monospace;

  --fs-xs:           clamp(0.70rem,  0.65rem + 0.25vw, 0.80rem);
  --fs-sm:           clamp(0.80rem,  0.75rem + 0.30vw, 0.90rem);
  --fs-base:         clamp(1.00rem,  0.92rem + 0.40vw, 1.125rem);
  --fs-lg:           clamp(1.15rem,  1.05rem + 0.50vw, 1.35rem);
  --fs-xl:           clamp(1.35rem,  1.15rem + 0.80vw, 1.75rem);
  --fs-2xl:          clamp(1.60rem,  1.30rem + 1.20vw, 2.25rem);
  --fs-3xl:          clamp(2.00rem,  1.50rem + 1.80vw, 3.00rem);
  --fs-4xl:          clamp(2.50rem,  1.80rem + 2.50vw, 4.00rem);

  /* Spacing scale */
  --sp-1:  0.25rem;
  --sp-2:  0.50rem;
  --sp-3:  0.75rem;
  --sp-4:  1.00rem;
  --sp-5:  1.50rem;
  --sp-6:  2.00rem;
  --sp-7:  3.00rem;
  --sp-8:  4.00rem;

  /* Misc */
  --radius:      4px;
  --radius-lg:   8px;
  --radius-pill:  100px;
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.05);
  --shadow:      0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg:   0 4px 20px rgba(0,0,0,0.08);
  --transition:  180ms ease;
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --bg:           #1a1a1a;
    --bg-alt:       #242424;
    --surface:      #2a2a2a;
    --text:         #e8e4dd;
    --text-muted:   #9a938c;
    --text-light:   #6b6560;
    --border:       #3a3a3a;
    --border-light: #333333;

    --primary:       #5a9b6e;
    --primary-hover: #6dae80;
    --primary-light: rgba(90, 155, 110, 0.12);

    --danger:       #d06060;
    --danger-hover: #e07070;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow:    0 2px 8px rgba(0,0,0,0.25);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.3);
  }
} */


/* === RESET & BASE ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.78;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: env(safe-area-inset-top, 0)
           env(safe-area-inset-right, 0)
           env(safe-area-inset-bottom, 0)
           env(safe-area-inset-left, 0);
}


/* === LAYOUT ================================================ */
.container {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.container-lg {
  max-width: 960px;
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.container-fluid {
  width: 100%;
  padding-inline: var(--sp-5);
}

/* Simple responsive grid */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-inline: calc(var(--sp-4) * -0.5);
}

.row > [class*="col"] {
  padding-inline: calc(var(--sp-4) * 0.5);
  width: 100%;
}

.col    { flex: 1 0 0%; }
.col-6  { flex: 0 0 50%;  max-width: 50%; }
.col-4  { flex: 0 0 33.333%; max-width: 33.333%; }
.col-3  { flex: 0 0 25%;  max-width: 25%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

@media (max-width: 768px) {
  .col-md-6  { flex: 0 0 50%;  max-width: 50%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  .row > [class*="col"] { flex: 0 0 100%; max-width: 100%; }
  .row > .col { flex: 0 0 100%; max-width: 100%; }
}

.d-flex       { display: flex; }
.flex-wrap    { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center  { justify-content: center; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }

.text-center { text-align: center; }
.text-end    { text-align: right; }

.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); } .mt-6 { margin-top: var(--sp-6); }
.mb-1 { margin-bottom: var(--sp-1); } .mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); } .mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); } .mb-6 { margin-bottom: var(--sp-6); }
.my-4 { margin-block: var(--sp-4); } .my-5 { margin-block: var(--sp-5); }
.my-6 { margin-block: var(--sp-6); } .my-7 { margin-block: var(--sp-7); }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-3 { padding: var(--sp-3); } .p-4 { padding: var(--sp-4); }
.p-5 { padding: var(--sp-5); } .p-6 { padding: var(--sp-6); }
.px-4 { padding-inline: var(--sp-4); }
.py-4 { padding-block: var(--sp-4); }
.py-5 { padding-block: var(--sp-5); }
.py-6 { padding-block: var(--sp-6); }
.py-7 { padding-block: var(--sp-7); }
.py-8 { padding-block: var(--sp-8); }


/* === TYPOGRAPHY ============================================ */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0.5em;
  letter-spacing: -0.01em;
}

h1, .h1 { font-size: var(--fs-4xl); font-weight: 700; letter-spacing: -0.025em; }
h2, .h2 { font-size: var(--fs-3xl); letter-spacing: -0.02em; }
h3, .h3 { font-size: var(--fs-2xl); }
h4, .h4 { font-size: var(--fs-xl); }
h5, .h5 { font-size: var(--fs-lg); }
h6, .h6 { font-size: var(--fs-base); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }

p {
  margin-bottom: 1.2em;
  max-width: 65ch; /* optimal reading width */
}

.lead {
  font-size: var(--fs-lg);
  line-height: 1.65;
  color: var(--text-muted);
}

small, .small  { font-size: var(--fs-sm); }
.text-xs       { font-size: var(--fs-xs); }
.text-muted    { color: var(--text-muted); }
.text-light    { color: var(--text-light); }
.fw-bold       { font-weight: 700; }
.fw-semibold   { font-weight: 600; }
.fw-normal     { font-weight: 400; }
.fst-italic    { font-style: italic; }

a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--transition);
  
  cursor:pointer;
}

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

mark-link {
  color: var(--primary);
  text-decoration: none;
  padding: 0.08em 0 0 0;

  cursor:pointer;

  /* The "Ink" */
  background-image: linear-gradient(
    104deg,
    transparent 0.9%,
    var(--hl-yellow) 2.4%,
    var(--hl-yellow) 97.2%,
    transparent 98.6%
  );
  background-repeat: no-repeat;
  background-position: bottom left;
  background-size: 100% 0%; /* Start empty */
  
  /* The "Underline" - Always visible for UX */
  box-shadow: inset 0 -0.15em 0 var(--hl-yellow-solid);
  
  /* The Animation */
  transition: background-size 0.3s ease-in-out;
  
  /* Ensure it wraps beautifully across lines */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

mark-link:hover {
  background-size: 100% 100%;
}

blockquote {
  border-left: 3px solid var(--hl-yellow-solid);
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  background: var(--hl-yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

blockquote p:last-child { margin-bottom: 0; }

code, .code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: var(--radius);
}

pre {
  background: #2e2e2e;
  color: #e8e4dd;
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.6;
  margin-bottom: var(--sp-5);
}

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

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-6) 0;
}

::selection {
  background: var(--hl-yellow);
}


/* === HIGHLIGHTER MARKS ===================================== */
/* The signature look — mimics a real highlighting pen on paper.
   Uses a gradient trick + padding to create that hand-drawn feel. */

mark, .mark {
  background: none;
  color: inherit;
  padding: 0.08em 0 0 0;
  background-image: linear-gradient(
    104deg,
    transparent 0.9%,
    var(--hl-yellow) 2.4%,
    var(--hl-yellow) 97.2%,
    transparent 98.6%
  );
  box-shadow: inset 0 -0.15em 0 var(--hl-yellow-solid);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 58%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  border-radius: 2px;
}

.mark-pink {
  background-image: linear-gradient(
    104deg, transparent 0.9%, var(--hl-pink) 2.4%, var(--hl-pink) 97.2%, transparent 98.6%
  );
  box-shadow: inset 0 -0.15em 0 var(--hl-pink-solid);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 58%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.mark-green {
  background-image: linear-gradient(
    104deg, transparent 0.9%, var(--hl-green) 2.4%, var(--hl-green) 97.2%, transparent 98.6%
  );
  box-shadow: inset 0 -0.15em 0 var(--hl-green-solid);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 58%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.mark-blue {
  background-image: linear-gradient(
    104deg, transparent 0.9%, var(--hl-blue) 2.4%, var(--hl-blue) 97.2%, transparent 98.6%
  );
  box-shadow: inset 0 -0.15em 0 var(--hl-blue-solid);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 58%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.mark-purple {
  background-image: linear-gradient(
    104deg, transparent 0.9%, var(--hl-purple) 2.4%, var(--hl-purple) 97.2%, transparent 98.6%
  );
  box-shadow: inset 0 -0.15em 0 var(--hl-purple-solid);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 58%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.mark-orange {
  background-image: linear-gradient(
    104deg, transparent 0.9%, var(--hl-orange) 2.4%, var(--hl-orange) 97.2%, transparent 98.6%
  );
  box-shadow: inset 0 -0.15em 0 var(--hl-orange-solid);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 58%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Block-level highlight — like a rectangle highlight over a line */
.highlight-block {
  background: var(--hl-yellow);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  display: inline-block;
}

.highlight-block-pink   { background: var(--hl-pink); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); display: inline-block; }
.highlight-block-green  { background: var(--hl-green); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); display: inline-block; }
.highlight-block-blue   { background: var(--hl-blue); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); display: inline-block; }
.highlight-block-purple { background: var(--hl-purple); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); display: inline-block; }


/* === NAVBAR ================================================ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1360px;
  margin-inline: auto;
  padding: var(--sp-4) var(--sp-5);
}

.navbar-wrapper {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(253, 252, 250, 0.92);
}

.navbar-brand {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.navbar-brand:hover { color: var(--text); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: var(--primary-light);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Mobile hamburger toggle */
.navbar-toggler {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2);
  cursor: pointer;
  line-height: 1;
  font-size: 1.25rem;
  color: var(--text);
}

@media (max-width: 768px) {
  .navbar { flex-wrap: wrap; }
  .navbar-toggler { display: inline-flex; }
  .navbar-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-top: var(--sp-3);
    gap: 0;
  }
  .navbar-nav.show { display: flex; }
  .nav-link {
    padding: var(--sp-3) var(--sp-2);
    width: 100%;
  }
}


/* === BUTTONS =============================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  padding: 0.65em 1.3em;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform 120ms ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Primary */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

/* Outline primary */
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

/* Secondary / subtle */
.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--border);
}

/* Ghost — minimal */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
  color: #fff;
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger);
  color: #fff;
}

/* Highlight button — pastel filled */
.btn-highlight {
  background: var(--hl-yellow);
  color: var(--text);
  border-color: var(--hl-yellow-solid);
}
.btn-highlight:hover { background: var(--hl-yellow-solid); }

.btn-highlight-pink { background: var(--hl-pink); color: var(--text); border-color: var(--hl-pink-solid); }
.btn-highlight-pink:hover { background: var(--hl-pink-solid); }

.btn-highlight-green { background: var(--hl-green); color: var(--text); border-color: var(--hl-green-solid); }
.btn-highlight-green:hover { background: var(--hl-green-solid); }

.btn-highlight-blue { background: var(--hl-blue); color: var(--text); border-color: var(--hl-blue-solid); }
.btn-highlight-blue:hover { background: var(--hl-blue-solid); }

/* Sizes */
.btn-sm { font-size: var(--fs-xs); padding: 0.5em 1em; }
.btn-lg { font-size: var(--fs-base); padding: 0.8em 1.6em; }

/* Block */
.btn-block { display: flex; width: 100%; }

/* Disabled */
.btn:disabled, .btn.disabled {
  opacity: 0.50;
  cursor: not-allowed;
  pointer-events: none;
}


/* === FORMS ================================================= */
.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  color: var(--text);
}

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

.form-control {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55em 0.85em;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
  color: var(--text-light);
}

/* Highlighted focus — the pen effect on active inputs */
.form-control-highlight:focus {
  border-color: var(--hl-yellow-solid);
  box-shadow: 0 0 0 3px var(--hl-yellow);
  background-image: linear-gradient(
    to bottom,
    transparent 60%,
    var(--hl-yellow) 60%
  );
  background-size: 100% 100%;
}

.form-control-sm { font-size: var(--fs-sm); padding: 0.4em 0.7em; }
.form-control-lg { font-size: var(--fs-lg); padding: 0.7em 1em; }

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6560' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 0.85em center;
  background-size: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55em 2.2em 0.55em 0.85em;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Input groups */
.input-group {
  display: flex;
}
.input-group .form-control {
  border-radius: 0;
  flex: 1;
}
.input-group .form-control:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .form-control:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.input-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .btn:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.input-group .input-group-text {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
}

.mb-3 > .form-label + .form-control,
.mb-3 > .form-label + .form-select { margin-top: 0; }


/* === CHECKBOXES & RADIOS =================================== */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  cursor: pointer;
}

.form-check-input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.3em;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.form-check-input[type="checkbox"] {
  border-radius: 3px;
}

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

.form-check-input:checked {
  background: var(--primary);
  border-color: var(--primary);
  animation: scale-in 150ms ease;
}

.form-check-input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M10 3L5 9.5 2 6.5l1-1 2 2 4-5.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 75%;
}

.form-check-input[type="radio"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='4' cy='4' r='3' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.form-check-input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Highlighted checkbox/radio — pastel check */
.form-check-highlight .form-check-input:checked {
  background: var(--hl-yellow-solid);
  border-color: var(--hl-yellow-solid);
}
.form-check-highlight .form-check-input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232e2e2e' d='M10 3L5 9.5 2 6.5l1-1 2 2 4-5.5z'/%3E%3C/svg%3E");
}

.form-check-label {
  font-size: var(--fs-base);
  cursor: pointer;
  line-height: 1.5;
}

/* Toggle / switch */
.form-switch .form-check-input {
  width: 2.2em;
  height: 1.25em;
  border-radius: 1em;
  position: relative;
  background: var(--border);
  border-color: var(--border);
  transition: background var(--transition);
}

.form-switch .form-check-input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.25em - 7px);
  height: calc(1.25em - 7px);
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}

.form-switch .form-check-input:checked {
  background: var(--primary);
  background-image: none;
}

.form-switch .form-check-input:checked::after {
  transform: translateX(calc(2.2em - 1.25em + 1px));
}


/* === CARDS ================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform 200ms ease;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-body {
  padding: var(--sp-5);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

.card-text {
  font-size: var(--fs-base);
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.card-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-sm);
}

.card-footer {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border-light);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.card-img-top {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Highlighted card — pastel border accent */
.card-highlight {
  border-left: 4px solid var(--hl-yellow-solid);
}

.card-highlight-pink   { border-left: 4px solid var(--hl-pink-solid); }
.card-highlight-green  { border-left: 4px solid var(--hl-green-solid); }
.card-highlight-blue   { border-left: 4px solid var(--hl-blue-solid); }
.card-highlight-purple { border-left: 4px solid var(--hl-purple-solid); }


/* === BADGES / LABELS ======================================= */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.25em 0.6em;
  border-radius: var(--radius);
  line-height: 1.4;
  white-space: nowrap;
}

.badge-primary   { background: var(--primary); color: #fff; }
.badge-secondary { background: var(--bg-alt);  color: var(--text-muted); border: 1px solid var(--border); }
.badge-danger    { background: var(--danger);  color: #fff; }
.badge-warning   { background: var(--warning); color: #fff; }
.badge-info      { background: var(--info);    color: #fff; }
.badge-success   { background: var(--success); color: #fff; }

/* Highlighted badges — the star of the show */
.badge-highlight         { background: var(--hl-yellow); color: var(--text); }
.badge-highlight-pink    { background: var(--hl-pink);   color: var(--text); }
.badge-highlight-green   { background: var(--hl-green);  color: var(--text); }
.badge-highlight-blue    { background: var(--hl-blue);   color: var(--text); }
.badge-highlight-purple  { background: var(--hl-purple); color: var(--text); }
.badge-highlight-orange  { background: var(--hl-orange); color: var(--text); }


/* === PILLS ================================================= */
.badge-pill, .pill {
  border-radius: var(--radius-pill);
  padding: 0.3em 0.8em;
}

.pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0.3em 0.8em;
}

/* Pill variants reuse badge colors */
.pill-primary          { background: var(--primary); color: #fff; }
.pill-secondary        { background: var(--bg-alt);  color: var(--text-muted); border: 1px solid var(--border); }
.pill-highlight        { background: var(--hl-yellow); color: var(--text); }
.pill-highlight-pink   { background: var(--hl-pink);   color: var(--text); }
.pill-highlight-green  { background: var(--hl-green);  color: var(--text);}
.pill-highlight-blue   { background: var(--hl-blue);   color: var(--text);}
.pill-highlight-purple { background: var(--hl-purple); color: var(--text);}


/* Utilities */
.d-none         { display: none; }
.d-block        { display: block; }
.d-inline       { display: inline; }
.d-inline-flex  { display: inline-flex; }
.d-grid         { display: grid; }

/* Responsive show/hide */
@media (max-width: 768px) {
  .d-md-none  { display: none; }
  .d-md-block { display: block; }
}

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

.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed    { position: fixed; }
.position-sticky   { position: sticky; }

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

/* === TABS ================================================== */
.nav-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  list-style: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-tabs .nav-link {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--sp-3) var(--sp-4);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  border-radius: 0;
  background: none;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.nav-tabs .nav-link:hover {
  color: var(--text);
  background: none;
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: none;
}

/* Highlighted tab variant — underline looks like a marker stroke */
.nav-tabs-highlight .nav-link.active {
  color: var(--text);
  border-bottom: 3px solid transparent;
  background-image: linear-gradient(var(--bg), var(--bg)),
    linear-gradient(to right, var(--hl-yellow-solid), var(--hl-yellow-solid));
  background-size: 100% 100%, 100% 3px;
  background-position: 0 0, 0 100%;
  background-repeat: no-repeat;
  padding-bottom: calc(var(--sp-3) - 1.5px);
}

/* Pill tabs — for horizontal filter-style tabs */
.nav-pills {
  display: flex;
  gap: var(--sp-2);
  list-style: none;
  flex-wrap: wrap;
}

.nav-pills .nav-link {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  transition: color var(--transition), background var(--transition);
  cursor: pointer;
}

.nav-pills .nav-link:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.nav-pills .nav-link.active {
  background: var(--primary);
  color: #fff;
}

/* Highlighted pills */
.nav-pills-highlight .nav-link.active {
  background: var(--hl-yellow);
  color: var(--text);
}


/* === ALERTS ================================================ */
.alert {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin-bottom: var(--sp-4);
  animation: fade-in-up 300ms ease both;
}

.alert-primary { background: var(--primary-light); border-left: 3px solid var(--primary); color: var(--text); }
.alert-danger  { background: rgba(180,74,74,0.08); border-left: 3px solid var(--danger);  color: var(--text); }
.alert-warning { background: rgba(180,138,46,0.08); border-left: 3px solid var(--warning); color: var(--text); }
.alert-info    { background: rgba(58,107,138,0.08); border-left: 3px solid var(--info);    color: var(--text); }
.alert-success { background: rgba(58,107,78,0.08);  border-left: 3px solid var(--success); color: var(--text); }

/* Highlighted alerts — pastel backgrounds like note cards */
.alert-highlight        { background: var(--hl-yellow); border-left: 3px solid var(--hl-yellow-solid); }
.alert-highlight-pink   { background: var(--hl-pink);   border-left: 3px solid var(--hl-pink-solid); }
.alert-highlight-green  { background: var(--hl-green);  border-left: 3px solid var(--hl-green-solid); }
.alert-highlight-blue   { background: var(--hl-blue);   border-left: 3px solid var(--hl-blue-solid); }
.alert-highlight-purple { background: var(--hl-purple); border-left: 3px solid var(--hl-purple-solid); }


/* === TABLE ================================================= */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-5);
}

.table th {
  font-family: var(--font-heading);
  font-weight: 600;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
}

.table tbody tr:hover {
  background: var(--primary-light);
}

.table-striped tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.015);
}


/* === LIST GROUP ============================================ */
.list-group {
  list-style: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.list-group-item {
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border-light);
  font-size: var(--fs-base);
  transition: background var(--transition);
}

.list-group-item:last-child { border-bottom: none; }

.list-group-item:hover {
  background: var(--primary-light);
}

.list-group-item.active {
  background: var(--hl-yellow);
}


/* === MODAL-LIKE DIALOG ===================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  z-index: 200;
  animation: fade-in 200ms ease;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: calc(100% - var(--sp-6));
  max-height: 85vh;
  overflow-y: auto;
  z-index: 201;
}

.modal-header {
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 600;
}

.modal-body {
  padding: var(--sp-3) var(--sp-5);
}

.modal-footer {
  padding: var(--sp-3) var(--sp-5) var(--sp-5);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
}


/* === BREADCRUMB ============================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  margin-right: var(--sp-1);
  color: var(--text-light);
}

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

.breadcrumb-item a:hover {
  color: var(--primary);
}

.breadcrumb-item.active {
  color: var(--text);
}


/* === PROGRESS ============================================== */
.progress {
  height: 8px;
  background: var(--bg-alt);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 300ms ease;
}

.progress-bar-highlight        { background: var(--hl-yellow-solid); }
.progress-bar-highlight-pink   { background: var(--hl-pink-solid); }
.progress-bar-highlight-green  { background: var(--hl-green-solid); }
.progress-bar-highlight-blue   { background: var(--hl-blue-solid); }


/* === TOOLTIP-LIKE HINT ===================================== */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: #fff;
  background: var(--text);
  padding: 0.35em 0.65em;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

[data-tooltip]:hover::after {
  opacity: 1;
}


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

.rounded      { border-radius: var(--radius); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-pill { border-radius: var(--radius-pill); }

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

.border        { border: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }

.bg-surface { background: var(--surface); }
.bg-alt     { background: var(--bg-alt); }

.w-100 { width: 100%; }

.overflow-hidden { overflow: hidden; }

/* Section spacing */
.section {
  padding-block: var(--sp-7);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--sp-8);
  }
}

/* Divider with highlight */
.divider-highlight {
  border: none;
  height: 3px;
  background: linear-gradient(to right,
    transparent,
    var(--hl-yellow-solid) 20%,
    var(--hl-yellow-solid) 80%,
    transparent
  );
  margin: var(--sp-6) 0;
  border-radius: 2px;
}

/* ── Sidebar Layout ── */
.layout-sidebar {
  display: flex;
  gap: var(--sp-6);
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

.layout-sidebar .main-content {
  flex: 1;
  min-width: 0;
}

.layout-sidebar .sidebar {
  width: 400px;
  flex-shrink: 0;
  border-left: 1px solid var(--border-light);
}

.sidebar-sticky {
  position: sticky;
  top: calc(var(--sp-4) + 60px);
}

.sidebar-widget {
  background: var(--bg-surface);
  /* border: 1px solid var(--border-light); */
  /* border-radius: var(--radius-md); */
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.sidebar-widget-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.sidebar-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-widget li {
  margin-bottom: var(--sp-2);
}

.sidebar-widget li a {
  color: var(--text-body);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color var(--transition);
}

.sidebar-widget li a:hover {
  color: var(--hl-yellow-solid);
}

.sidebar-widget .post-date {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.sidebar-author {
  text-align: center;
}

.sidebar-author .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--hl-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--fs-xl);
  color: var(--text-heading);
  margin-bottom: var(--sp-2);
}

.sidebar-author .name {
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

.sidebar-author .bio {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.sidebar-tags a {
  text-decoration: none;
}

@media (max-width: 768px) {
  .layout-sidebar {
    flex-direction: column;
  }

  .layout-sidebar .sidebar {
    width: 100%;
  }

  .sidebar-sticky {
    position: static;
  }
}

/* Print */
@media print {
  body { background: #fff; }
  .navbar-wrapper, .btn, .sidebar { display: none; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}


/* App Shell Components */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  padding: var(--sp-2) 0;
  padding-bottom: calc(var(--sp-2) + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(253, 252, 250, 0.92);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius);
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
  min-width: 64px;       /* touch-friendly */
  min-height: 48px;      /* touch-friendly */
}

.bottom-nav-item.active {
  color: var(--primary);
}

/* Highlighted variant — active dot or marker underline */
.bottom-nav-highlight .bottom-nav-item.active {
  color: var(--text);
}

.bottom-nav-highlight .bottom-nav-item.active::after {
  content: '';
  display: block;
  width: 20px;
  height: 3px;
  background: var(--hl-yellow-solid);
  border-radius: 2px;
  margin-top: 2px;
}

/* Body padding to prevent content from hiding behind bottom nav */
body.has-bottom-nav {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 299;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(320px, 85vw);
  background: var(--surface);
  z-index: 300;
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-lg);
}

.drawer.open {
  transform: translateX(0);
}

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

.drawer-right.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-heading);
  font-weight: 600;
}

.drawer-body {
  padding: var(--sp-4) var(--sp-5);
}
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 299;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.bottom-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 300;
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-sheet.open {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: var(--sp-3) auto var(--sp-2);
}

.bottom-sheet-body {
  padding: var(--sp-3) var(--sp-5) var(--sp-5);
}

/* Other Components */

.toast-container {
  position: fixed;
  bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

@media (min-width: 768px) {
  .toast-container {
    bottom: auto;
    top: var(--sp-5);
    left: auto;
    right: var(--sp-5);
    transform: none;
  }
}

.toast {
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 300ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast.toast-out {
  animation: toast-out 200ms ease forwards;
}

.toast-highlight { background: var(--hl-yellow-solid); color: var(--text); }
.toast-danger    { background: var(--danger); color: #fff; }
.toast-success   { background: var(--success); color: #fff; }

.skeleton {
  background: var(--bg-alt);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s ease infinite;
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--sp-2);
  width: 100%;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-heading {
  height: 1.5em;
  width: 40%;
  margin-bottom: var(--sp-3);
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 16/9;
}

.spinner {
  width: 1.25em;
  height: 1.25em;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

.spinner-sm { width: 1em; height: 1em; }
.spinner-lg { width: 2em; height: 2em; }

/* Highlighted spinner */
.spinner-highlight {
  border-color: var(--hl-yellow);
  border-top-color: var(--hl-yellow-solid);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-alt);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm  { width: 28px; height: 28px; font-size: var(--fs-xs); }
.avatar-lg  { width: 56px; height: 56px; font-size: var(--fs-lg); }
.avatar-xl  { width: 80px; height: 80px; font-size: var(--fs-2xl); }

/* Stacked avatar group */
.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  border: 2px solid var(--surface);
  margin-left: -8px;
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

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

.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--sp-1));
  left: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  padding: var(--sp-1) 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.dropdown-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-menu-end {
  left: auto;
  right: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  color: var(--text);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  transition: background var(--transition);
}

.dropdown-item:hover {
  background: var(--primary-light);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--sp-1) 0;
}
.accordion {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.accordion-item + .accordion-item {
  border-top: 1px solid var(--border-light);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
}

.accordion-header:hover {
  background: var(--primary-light);
}

.accordion-header::after {
  content: '+';
  font-size: var(--fs-lg);
  color: var(--text-light);
  transition: transform 200ms ease;
}

.accordion-header[aria-expanded="true"]::after {
  content: '−';
}

.accordion-body {
  padding: 0 var(--sp-5) var(--sp-5);
  font-size: var(--fs-base);
  color: var(--text-muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--sp-2);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}

.page-link:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.page-link.active {
  background: var(--primary);
  color: #fff;
}

.page-link.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Highlighted variant */
.pagination-highlight .page-link.active {
  background: var(--hl-yellow);
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: var(--fs-4xl);
  margin-bottom: var(--sp-4);
  opacity: 0.4;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.empty-state-text {
  font-size: var(--fs-sm);
  max-width: 40ch;
  margin-inline: auto;
  margin-bottom: var(--sp-5);
}

/* Animations */


/* Toast slide-in / out */
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

/* Skeleton shimmer */
@keyframes skeleton-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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

/* General-purpose entrance animations */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-fade-in     { animation: fade-in 300ms ease both; }
.animate-fade-in-up  { animation: fade-in-up 350ms cubic-bezier(0.4, 0, 0.2, 1) both; }
.animate-fade-in-down{ animation: fade-in-down 350ms cubic-bezier(0.4, 0, 0.2, 1) both; }
.animate-scale-in    { animation: scale-in 250ms cubic-bezier(0.4, 0, 0.2, 1) both; }

/* Stagger children (apply to parent) */
.stagger-children > * { animation: fade-in-up 350ms cubic-bezier(0.4, 0, 0.2, 1) both; }
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 50ms; }
.stagger-children > *:nth-child(3) { animation-delay: 100ms; }
.stagger-children > *:nth-child(4) { animation-delay: 150ms; }
.stagger-children > *:nth-child(5) { animation-delay: 200ms; }
.stagger-children > *:nth-child(6) { animation-delay: 250ms; }

@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;
  }
}

/* Touch target sizing */
@media (pointer: coarse) {
  .btn, .nav-link, .form-check, .dropdown-item,
  .page-link, .list-group-item, .accordion-header {
    min-height: 44px;
  }
}