/*
 * Copyright (C) 2026 Nuvoola AI, Inc.
 * All rights reserved.
 *
 * MILA Design System — CSS tokens and component styles.
 * Source: LUKE 5.1.8 Figma Make (xA1MQkOfjYbfMxG2zg22Ao)
 *
 * @since  1.0.0
 * @author Geremy Turcotte
 */

/* ═══════════════════════════════════════════════════════════════════════════
   TOKENS
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Font */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;

  /* Brand (LUKE) */
  --luke-primary:       #009CA6;
  --luke-primary-dark:  #047481;
  --luke-primary-light: #CDEFF0;
  --luke-bg:            #F3F5F6;
  --luke-header:        #FFFFFF;

  /* Semantic */
  --color-accent:       var(--luke-primary);
  --color-accent-hover: var(--luke-primary-dark);
  --color-accent-soft:  var(--luke-primary-light);
  --color-bg:           var(--luke-bg);
  --color-surface:      #ffffff;
  --color-text:         #1f2937;
  --color-text-muted:   #6b7280;
  --color-text-inverse: #ffffff;
  --color-border:       #e5e7eb;
  --color-border-light: #f3f4f6;

  /* Callouts */
  --callout-note-bg:         #eff6ff;
  --callout-note-border:     #3b82f6;
  --callout-warning-bg:      #fef2f2;
  --callout-warning-border:  #ef4444;
  --callout-tip-bg:          #f0fdf4;
  --callout-tip-border:      #22c55e;
  --callout-business-bg:     #fffbeb;
  --callout-business-border: #fbbf24;

  /* Layout */
  --header-h:   4rem;
  --toc-w:      320px;
  --toc-w-min:  240px;
  --toc-w-max:  520px;

  /* Component */
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:  0 8px 24px rgba(15, 23, 42, 0.08);
  --focus-ring: 0 0 0 2px var(--luke-primary-light), 0 0 0 4px var(--luke-primary);

  /* Code */
  --code-bg:     #f8fafc;
  --code-border: #e2e8f0;
  --code-text:   #334155;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY (WCAG AA)
   ═══════════════════════════════════════════════════════════════════════ */

/* Skip-to-content link (WCAG 2.4.1) — visible only on focus */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--color-surface);
  color: var(--color-accent-hover);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus {
  top: 8px;
}

/* Screen-reader-only utility (WCAG — visually hidden, accessible to AT) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus-visible for all interactive elements (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════ */

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHELL — CSS Grid (header + body)
   ═══════════════════════════════════════════════════════════════════════ */

#app {
  display: grid;
  grid-template-rows: var(--header-h) minmax(0, 1fr);
  height: var(--shell-h, 100dvh);
  overflow: hidden;
}

/* ── Modal mode (embedded via iframe with ?mode=modal) ─────────────────── */

.mila-modal { --shell-h: 100%; overscroll-behavior: contain; }
.mila-modal #app { border-radius: var(--radius-lg); }
.mila-modal .header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

/* ── Header ────────────────────────────────────────────────────────────── */

.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--luke-header);
  border-bottom: 1px solid var(--color-border);
  z-index: 20;
}

.header__menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: background .15s, color .15s;
}
.header__menu-btn:hover { background: rgba(0,0,0,.04); color: var(--color-text); }

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-accent-hover);
  font-weight: 700;
  font-size: 1.1rem;
}
.header__logo svg { flex-shrink: 0; }

.header__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  white-space: nowrap;
}
.header__luke-logo { height: 28px; width: auto; flex-shrink: 0; }
.header__title-block {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  white-space: nowrap;
}
.header__title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--luke-primary-dark, #047481);
  white-space: nowrap;
}
.header__subtitle {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.header__nuvoola-logo {
  height: 20px;
  width: auto;
  margin-left: auto;
  flex-shrink: 0;
}

.header__search {
  flex: 0 1 320px;
  max-width: 320px;
  margin-left: 16px;
  position: relative;
}

@media (max-width: 680px) {
  .header__subtitle { display: none; }
  .header__nuvoola-logo { display: none; }
  .header__search { flex: 1 1 auto; }
}
.header__search input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 38px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-family: inherit;
  font-size: .875rem;
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.header__search input:focus {
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}
.header__search input::placeholder { color: var(--color-text-muted); }
.header__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.section__print-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  color: var(--color-accent-hover);
  font-size: .8125rem;
  font-weight: 500;
  transition: background .15s;
}
.section__print-btn:hover { background: var(--color-accent-soft); }

/* Close button (visible in modal mode only) */
.header__close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: background .15s, color .15s;
  margin-inline-start: 8px;
}
.header__close-btn:hover { background: rgba(0,0,0,.06); color: var(--color-text); }
.mila-modal .header__close-btn { display: flex; }

/* Search clear button */
.header__search-clear {
  display: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
}
.header__search-clear:hover { color: var(--color-text); background: rgba(0,0,0,.06); }
.header__search-clear--visible { display: flex; }

/* ── Body (TOC + Content) ──────────────────────────────────────────────── */

.body {
  display: grid;
  grid-template-columns: var(--toc-w) 4px minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

/* Desktop TOC hidden (data-toc-open=false on desktop) */
.body[data-toc-hidden] { grid-template-columns: minmax(0, 1fr); }
.body[data-toc-hidden] .toc { position: absolute; visibility: hidden; width: 0; overflow: hidden; }
.body[data-toc-hidden] .divider { display: none; }
.body[data-toc-hidden] .content { grid-column: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   TOC PANEL (left)
   ═══════════════════════════════════════════════════════════════════════ */

.toc {
  overflow-y: auto;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 16px 0;
}
.toc::-webkit-scrollbar, .content::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb, .content::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 3px;
}
.toc::-webkit-scrollbar-thumb:hover, .content::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-hover);
}
.toc::-webkit-scrollbar-track, .content::-webkit-scrollbar-track { background: transparent; }

.toc__section { margin-bottom: 4px; }

.toc__section > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: .875rem;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-left: 3px solid transparent;
  transition: background .12s;
}
.toc__section > summary:hover { background: rgba(0,0,0,.03); }
.toc__section > summary::-webkit-details-marker { display: none; }
.toc__section > summary::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(-45deg);
  transition: transform .15s;
  flex-shrink: 0;
}
.toc__section[open] > summary::before { transform: rotate(45deg); }
.toc__section[open] > summary { color: var(--color-accent-hover); }

.toc__section.toc__section--active > summary {
  border-left-color: var(--color-accent);
  color: var(--color-accent-hover);
  background: rgba(0, 156, 166, .04);
}

.toc__children { padding: 2px 0 6px 0; }

.toc__item {
  display: block;
  padding: 6px 16px 6px 38px;
  font-size: .8125rem;
  color: var(--color-text-muted);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
  text-decoration: none;
}
.toc__item:hover {
  background: rgba(0,0,0,.03);
  color: var(--color-text);
  text-decoration: none;
}
.toc__item--active {
  border-left-color: var(--color-accent);
  color: var(--color-accent-hover);
  background: var(--color-accent-soft);
  font-weight: 500;
}

/* ── Divider (resize handle) ───────────────────────────────────────────── */

.divider {
  cursor: col-resize;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  z-index: 10;
  width: 8px;
  margin: 0 -2px;
}
.divider:hover, .divider--active { background: var(--color-accent-soft); }
.divider::after {
  content: "";
  width: 2px;
  height: 32px;
  border-radius: 1px;
  background: var(--color-border);
}
.divider:hover::after, .divider--active::after { background: var(--color-accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT PANEL (right)
   ═══════════════════════════════════════════════════════════════════════ */

.content {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  min-width: 0;
  min-height: 0;
  overscroll-behavior-y: contain;
}

.toc { overscroll-behavior-y: contain; }

/* ── Categories View (home) ────────────────────────────────────────────── */

.categories {
  max-width: min(960px, 100%);
  margin: 0 auto;
  padding: 0 32px 48px;
}

.categories__header {
  background: linear-gradient(180deg, var(--color-accent-soft) 0%, var(--color-surface) 100%);
  padding: 40px 32px 32px;
  margin: 0 -32px 32px;
  text-align: center;
}
.categories__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--color-accent);
}
.categories__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-accent-hover);
  margin-bottom: 4px;
}
.categories__sub {
  font-size: .875rem;
  color: var(--color-text-muted);
}

.categories__group {
  margin-bottom: 28px;
}
.categories__group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.categories__group-bar {
  width: 4px;
  height: 24px;
  background: var(--color-accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.categories__group-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.categories__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.categories__card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  text-decoration: none;
  color: inherit;
}
.categories__card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}
.categories__card-icon {
  flex-shrink: 0;
  color: var(--color-accent);
}
.categories__card-body { flex: 1; min-width: 0; }
.categories__card-title {
  font-weight: 600;
  font-size: .875rem;
  color: var(--color-text);
  margin-bottom: 2px;
}
.categories__card-desc {
  font-size: .75rem;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.categories__card-chevron {
  flex-shrink: 0;
  color: var(--color-border);
}

/* ── Section View (content reader) ─────────────────────────────────────── */

.section {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 40px 64px;
}

.section__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.section__back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-accent-hover);
}
.section__back:hover { text-decoration: underline; }

.section__head {
  margin-bottom: 24px;
}
.section__title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--color-accent-hover);
  margin-bottom: 8px;
  line-height: 1.3;
}
.section__badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 500;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  color: var(--color-accent-hover);
  background: var(--color-surface);
}

/* ── Rendered content ──────────────────────────────────────────────────── */

.section__body {
  color: var(--color-text);
  line-height: 1.75;
}

.section__body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent-hover);
  margin: 2rem 0 .75rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border-light);
}
.section__body h3 {
  font-size: 1.075rem;
  font-weight: 600;
  color: var(--color-accent-hover);
  margin: 1.5rem 0 .5rem;
}
.section__body h4 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 1.25rem 0 .5rem;
}

.section__body p { margin-bottom: .875rem; }

.section__body ul, .section__body ol {
  margin: 0 0 1rem 1.5rem;
}
.section__body li { margin-bottom: .3rem; }

.section__body strong { font-weight: 600; }

.section__body img {
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin: 1rem 0;
}

.section__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .875rem;
}
.section__body th, .section__body td {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  text-align: left;
}
.section__body th {
  background: var(--color-bg);
  font-weight: 600;
}

.section__body blockquote {
  border-left: 4px solid var(--callout-note-border);
  background: var(--callout-note-bg);
  padding: 12px 16px;
  margin: 1rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .875rem;
}

/* Callouts (rendered from Markdown) */
.section__body .callout-note      { border-left-color: var(--callout-note-border);     background: var(--callout-note-bg);     }
.section__body .callout-warning   { border-left-color: var(--callout-warning-border);  background: var(--callout-warning-bg);  }
.section__body .callout-tip       { border-left-color: var(--callout-tip-border);      background: var(--callout-tip-bg);      }
.section__body .callout-business  { border-left-color: var(--callout-business-border); background: var(--callout-business-bg); }

/* Code blocks (server-side highlight.js) */
.section__body pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: .8125rem;
  line-height: 1.6;
}
.section__body code {
  font-family: var(--font-mono);
  font-size: .85em;
}
.section__body :not(pre) > code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--code-text);
}

/* ── Prev/Next Navigation ──────────────────────────────────────────────── */

.section__pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}
.section__pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color .15s;
  max-width: 48%;
}
.section__pager a:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}
.section__pager-label {
  font-size: .75rem;
  color: var(--color-text-muted);
}
.section__pager-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-accent-hover);
}
.section__pager-next { margin-left: auto; text-align: right; }

/* ── Search Results ────────────────────────────────────────────────────── */

.search-results {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 40px;
}
.search-results__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}
.search-results__item {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
}
.search-results__item:hover { background: rgba(0,0,0,.015); }
.search-results__item-title {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--color-accent-hover);
  margin-bottom: 2px;
}
.search-results__item-group {
  font-size: .75rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.search-results__item-snippet {
  font-size: .8125rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.search-results__item-snippet mark {
  background: var(--color-accent-soft);
  color: var(--color-accent-hover);
  padding: 1px 2px;
  border-radius: 2px;
}
.search-results__empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-muted);
  font-size: .9375rem;
}

/* ── Loading ───────────────────────────────────────────────────────────── */

.loading {
  display: flex;
  justify-content: center;
  padding: 64px 0;
}
.loading__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   SCRIM (backdrop for mobile TOC drawer)
   ═══════════════════════════════════════════════════════════════════════ */

.scrim {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(15, 23, 42, .38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s cubic-bezier(.16, 1, .3, 1);
  z-index: 25;
}
.scrim--visible { opacity: 1; pointer-events: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Council-validated 3-tier (mobile drawer / tablet rail / desktop)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Mobile: < 768px — modal drawer with scrim ─────────────────────────── */

@media (max-width: 767.98px) {
  .body { grid-template-columns: minmax(0, 1fr); }

  .content { grid-column: 1; }

  .toc {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: min(86vw, 22rem);
    max-width: calc(100vw - 32px);
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.16, 1, .3, 1);
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    z-index: 30;
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    visibility: visible;
    padding: 12px 0;
    background: var(--color-surface);
  }
  .body[data-toc-open="true"] .toc { transform: translateX(0); }

  .divider { display: none; }

  .toc__item { min-height: 44px; display: flex; align-items: center; }
  .toc__section > summary { min-height: 44px; }

  .categories__grid { grid-template-columns: 1fr; }
  .categories__header { padding: 24px 16px 20px; margin: 0 -16px 24px; }
  .categories { padding: 0 16px 32px; }
  .section { padding: 20px 16px 48px; }
}

/* ── Very narrow: < 480px ──────────────────────────────────────────────── */

@media (max-width: 480px) {
  .toc { width: 100vw !important; max-width: 100vw; }
  .section { padding: 12px 8px 32px; }
  .section__title { font-size: 1.25rem; }
}

/* ── Modal mode: TOC collapsed by default, drawer overlay ──────────────── */

.mila-modal .body { grid-template-columns: minmax(0, 1fr); }
.mila-modal .divider { display: none; }
.mila-modal .content { grid-column: 1; }

.mila-modal .toc {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  transform: translateX(-100%);
  transition: transform .22s cubic-bezier(.16, 1, .3, 1);
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  z-index: 30;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  visibility: visible;
  padding: 12px 0;
  background: var(--color-surface);
}
.mila-modal .body[data-toc-open="true"] .toc { transform: translateX(0); }

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════════════ */

@media print {
  .header, .toc, .divider, .scrim, .section__nav, .section__pager,
  .header__close-btn, .header__search-clear { display: none !important; }
  #app { display: block !important; height: auto !important; overflow: visible !important; }
  .body { display: block !important; height: auto !important; overflow: visible !important; }
  .content { overflow: visible !important; height: auto !important; }
  .section { padding: 20px; max-width: 100%; }
  .section__body pre, .section__body table,
  .section__body blockquote, .section__body .callout-note,
  .section__body .callout-warning, .section__body .callout-tip,
  .section__body .callout-business { break-inside: avoid; }
  .section__body h1, .section__body h2, .section__body h3 { break-after: avoid; }
  .categories { max-width: 100%; }
}

/* ── Business Value Callout (AC6) ──────────────────────────────────── */

.callout-business {
  background-color: #fffbeb; /* amber-50 */
  border-left: 4px solid #f59e0b; /* amber-400 */
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 0.375rem 0.375rem 0;
}

.callout-business p:first-child strong:first-child {
  color: #78350f; /* amber-900 */
}

/* ── Role Badge (AC3) ──────────────────────────────────────────────── */

.categories__role-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #047481;
  background-color: #CDEFF0;
  border: 1px solid #009CA6;
  border-radius: 9999px;
}

/* ── Role-Excluded Section (AC4) ───────────────────────────────────── */

.section__role-excluded {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: #6b7280;
}

.section__role-excluded h2 {
  font-size: 1.25rem;
  color: #374151;
  margin-bottom: 0.5rem;
}

.section__role-excluded p {
  margin-bottom: 1.5rem;
}

.section__clear-filter {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #047481;
  background: transparent;
  border: 1px solid #009CA6;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.section__clear-filter:hover {
  background-color: #CDEFF0;
}

/* ── Debounced Spinner (AC7) ───────────────────────────────────────── */

.loading {
  animation: fadeIn 200ms ease 200ms both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Search Clear Transition (AC7) ─────────────────────────────────── */

.header__search-clear {
  transition: opacity 150ms ease;
}
