/* AABox Managed Business Systems. SupportPal brand override.
   Loaded after main.min.css. Mirrors public/styles.css from the marketing site.
   See docs/superpowers/specs/2026-05-29-supportpal-reskin-design.md */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --fs-display: clamp(2rem, 1.1rem + 2vw, 2.85rem);
  --fs-h2: clamp(1.4rem, 1rem + 1.2vw, 1.85rem);
  --fs-h3: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  --fs-lede: clamp(1.06rem, 0.95rem + 0.4vw, 1.2rem);
  --fs: 1rem;
  --fs-sm: 0.9rem;
  --fs-xs: 0.8rem;

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem; --s9: 6rem;

  --r-sm: 2px;
  --r-md: 4px;
  --hair: 1px;
  --rule-strong: 2px;

  --dur: 160ms;
  --ease: cubic-bezier(0.2, 0.6, 0.3, 1);

  /* Light palette. Warm bone paper, deep walnut ink. */
  color-scheme: light;
  --bg: #faf6ed;
  --bg-alt: #f3ecdc;
  --bg-deep: #ede5d2;
  --ink: #1a1612;
  --ink-2: #4a4239;
  --ink-3: #756a5a;
  --ink-4: #a39884;
  --line: #cdbfa3;
  --line-2: #a89878;
  --accent: #b8421a;
  --accent-2: #8e3211;
  --accent-soft: #f4d8c5;
  --accent-ink: #5a1f08;
  --on-accent: #faf6ed;

  /* Map onto SupportPal vars (light). SupportPal's CSS uses specific
     stops for specific roles, not a smooth scale. The mapping below
     is reverse-engineered from inspecting actual SupportPal rules:
       -800 = default button bg     (we want --accent, the rust)
       -900 = hover button bg       (we want --accent-2, the shifted shade)
       -100 = dark-mode link colour (handled in .sp-theme-dark below)
     With a 2-shade palette we collapse -300..-800 onto --accent so
     all primary surfaces read as the same rust, and let -900 carry
     the hover shift. */
  --color-primary-100: var(--accent-soft);
  --color-primary-200: var(--accent-soft);
  --color-primary-300: var(--accent);
  --color-primary-400: var(--accent);
  --color-primary-500: var(--accent);
  --color-primary-600: var(--accent);
  --color-primary-700: var(--accent);
  --color-primary-800: var(--accent);
  --color-primary-900: var(--accent-2);
  --color-background-primary:   var(--bg);
  --color-background-secondary: var(--bg-alt);
  --color-background-tertiary:  var(--bg-deep);
  --color-text-primary:   var(--ink);
  --color-text-secondary: var(--ink-2);
  --color-text-tertiary:  var(--ink-3);
}

.sp-theme-dark {
  color-scheme: dark;
  --bg: #15110b;
  --bg-alt: #1c1812;
  --bg-deep: #221d15;
  --ink: #f0e6d2;
  --ink-2: #c4b89e;
  --ink-3: #8c8470;
  --ink-4: #5a5446;
  --line: #2e2920;
  --line-2: #463f32;
  --accent: #d96535;
  --accent-2: #ef7e51;
  --accent-soft: #2c1a10;
  --accent-ink: #f4c4a6;
  --on-accent: #15110b;

  /* Dark mode: -100 is used by SupportPal for in-content link colour
     (`a:is(.sp-theme-dark *) { color: var(--color-primary-100) }`).
     In light mode --accent-soft is a readable pale rust, but in dark
     mode it's near-black, so dark-mode links rendered invisible. Map
     dark -100 to --accent so links stay rust-on-walnut and remain
     legible. The cost is that any `.sp-bg-primary-100` background in
     dark mode becomes saturated rust instead of soft dark — fine for
     our minimal palette. */
  --color-primary-100: var(--accent);
  --color-primary-200: var(--accent-soft);
  --color-primary-300: var(--accent);
  --color-primary-400: var(--accent);
  --color-primary-500: var(--accent);
  --color-primary-600: var(--accent);
  --color-primary-700: var(--accent);
  --color-primary-800: var(--accent);
  --color-primary-900: var(--accent-2);
  --color-background-primary:   var(--bg);
  --color-background-secondary: var(--bg-alt);
  --color-background-tertiary:  var(--bg-deep);
  --color-text-primary:   var(--ink);
  --color-text-secondary: var(--ink-2);
  --color-text-tertiary:  var(--ink-3);
}

/* OS-level dark mode preempt.
   SupportPal ships `<html class="sp-theme-system">` from the server. The
   .sp-theme-dark class is added client-side by preload.js. On a cold
   load the browser canvas defaults to white (because :root has no
   `color-scheme: dark`) and the inline `colourScheme` <style> hardcodes
   light SupportPal hexes on `:root` — so visitors on dark OSes see a
   bone-cream flash before our brand CSS + JS settle into dark mode.
   This @media block re-applies the dark palette + `color-scheme: dark`
   via the `sp-theme-system` class which is already on <html> at parse
   time, so the first paint is already dark even before preload.js
   runs. Targets `.sp-theme-system` (not :not(.sp-theme-light)) so the
   link rule specificity stays at (0,1,1) and equally-specific later
   overrides (.sp-breadcrumb a, .sp-nav a, etc.) still win by source
   order. Explicit user toggles drop the system class, so the manual-
   light/dark blocks above take over. */
@media (prefers-color-scheme: dark) {
  :root.sp-theme-system {
    color-scheme: dark;
    --bg: #15110b;
    --bg-alt: #1c1812;
    --bg-deep: #221d15;
    --ink: #f0e6d2;
    --ink-2: #c4b89e;
    --ink-3: #8c8470;
    --ink-4: #5a5446;
    --line: #2e2920;
    --line-2: #463f32;
    --accent: #d96535;
    --accent-2: #ef7e51;
    --accent-soft: #2c1a10;
    --accent-ink: #f4c4a6;
    --on-accent: #15110b;
    --color-primary-100: var(--accent);
    --color-primary-200: var(--accent-soft);
    --color-primary-300: var(--accent);
    --color-primary-400: var(--accent);
    --color-primary-500: var(--accent);
    --color-primary-600: var(--accent);
    --color-primary-700: var(--accent);
    --color-primary-800: var(--accent);
    --color-primary-900: var(--accent-2);
    --color-background-primary:   var(--bg);
    --color-background-secondary: var(--bg-alt);
    --color-background-tertiary:  var(--bg-deep);
    --color-text-primary:   var(--ink);
    --color-text-secondary: var(--ink-2);
    --color-text-tertiary:  var(--ink-3);
  }
  /* Mirror the dark-link selector against `.sp-theme-system` so it covers
     the pre-JS window. Specificity (0,1,1) matches `a:is(.sp-theme-dark *)`
     and other in-content link overrides, so source order resolves ties. */
  a:is(.sp-theme-system *) { color: var(--ink); }
  a:hover:is(.sp-theme-system *) {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

/* Typography */
html, body { font-family: var(--font); }
body { background: var(--bg); color: var(--ink); font-size: var(--fs); line-height: 1.6; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font); color: var(--ink); letter-spacing: -0.005em; }
h1 { font-size: var(--fs-display); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 600; }

/* Size utility classes. Do NOT set font-family here: FontAwesome icons
   use these for sizing (e.g. <i class="fas fa-fw sp-text-5xl">) and need
   their own .fas font-family to render glyphs. The body font cascades to
   non-FA text on its own. */
.sp-text-xl, .sp-text-2xl, .sp-text-3xl, .sp-text-4xl, .sp-text-5xl {
  letter-spacing: -0.005em;
}
.sp-font-semibold { font-weight: 600; }
.sp-font-bold { font-weight: 700; }

/* Tabular nums on tables and date/number text */
table tbody td, .sp-ticket-number, .sp-date, .sp-tabular { font-variant-numeric: tabular-nums; }

/* === Buttons: full apex parity ==========================================
   The apex marketing site has exactly three button variants:
     .btn-primary  — rust bg, --on-accent text, 1.5px same-hue border
     .btn-text     — transparent bg, --ink text, no border (text-button)
     .btn-secondary (implied) — transparent bg, --ink text, --line border
   Hover for .btn-primary swaps bg + border to --accent-2 while text
   stays --on-accent (cream-on-darker in light mode, walnut-on-lighter
   in dark mode). Active dips translateY(1px). Light + dark behaviour
   is identical because --accent / --accent-2 / --on-accent already
   carry the mode-correct hex.

   SupportPal emits several primary-button shapes for different contexts
   (header CTA, .sp-button-primary, unclassed `input[type=submit]`,
   `.sp-button-submit`). The single rule below catches all of them so
   one CSS pass keeps every primary button visually identical across
   header, modals, forms, and wizards. */

/* Shared chrome for ALL .sp-button shapes (size, family, transitions).
   Concrete colour comes from the variant rules below. */
.sp-button, .sp-btn, .btn,
button[type="submit"], button.sp-button,
input[type="submit"], input[type="button"],
.sp-button-submit, .sp-button-secondary,
a.sp-button {
  font-family: var(--font);
  font-weight: 600;
  border-radius: var(--r-sm) !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: -0.005em;
  line-height: 1.1;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* Primary: rust bg, --on-accent text, 1.5px same-hue border.
   appearance:none neutralises Chrome's native dark-mode tinting on
   `<input type=submit>` so it paints the *exact* --accent hex and
   matches the header CTA byte-for-byte. */
.sp-button-primary, .btn-primary,
.sp-button.sp-bg-primary-500, button.sp-bg-primary-500,
a.sp-button-primary,
input[type="submit"], .sp-button-submit,
header.sp-sticky a[href*="/login"]:not(.logout-link) {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  border: 1.5px solid var(--accent) !important;
  border-radius: var(--r-sm) !important;
  padding: 0.7rem 1.1rem !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  text-transform: none !important;
  box-shadow: none !important;
  transform: none !important;
}
.sp-button-primary:hover, .btn-primary:hover, a.sp-button-primary:hover,
.sp-button.sp-bg-primary-500:hover, button.sp-bg-primary-500:hover,
input[type="submit"]:hover, .sp-button-submit:hover,
header.sp-sticky a[href*="/login"]:not(.logout-link):hover {
  background: var(--accent-2) !important;
  border-color: var(--accent-2) !important;
  color: var(--on-accent) !important;
  text-decoration: none !important;
}
.sp-button-primary:active, .btn-primary:active,
input[type="submit"]:active, .sp-button-submit:active {
  transform: translateY(1px) !important;
}

/* Secondary / outline: transparent bg, --ink text, --line border.
   Used for cancel, "back", and the header Register CTA. */
.sp-button-secondary, .btn-secondary,
header.sp-sticky a[href*="/register"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  background: transparent !important;
  color: var(--ink) !important;
  border: 1.5px solid var(--line-2) !important;
  border-radius: var(--r-sm) !important;
  padding: 0.7rem 1.1rem !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  text-transform: none !important;
  box-shadow: none !important;
}
.sp-button-secondary:hover, .btn-secondary:hover,
header.sp-sticky a[href*="/register"]:hover {
  border-color: var(--ink) !important;
  color: var(--ink) !important;
  background: transparent !important;
  text-decoration: none !important;
}

/* Disabled state for any primary submit (e.g. Register button while the
   captcha is unsolved). Chrome's UA dimming on `<input disabled>` is
   harsh — explicit muted chrome keeps the button readable and signals
   "not yet" without competing with the rest of the form. */
.sp-button-primary:disabled, .btn-primary:disabled,
a.sp-button-primary[aria-disabled="true"],
input[type="submit"]:disabled, .sp-button-submit:disabled {
  background: var(--bg-alt) !important;
  color: var(--ink-3) !important;
  border-color: var(--line) !important;
  cursor: not-allowed !important;
}

/* "Add another phone number" utility button: same quiet outlined chrome
   as the password Show toggle, but medium size to sit beside a full-
   width input. */
.sp-add-number, button.sp-add-number {
  background: var(--bg-alt) !important;
  color: var(--ink-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-sm) !important;
  padding: 6px 14px !important;
  font-weight: 500 !important;
  font-size: var(--fs-sm) !important;
}
.sp-add-number:hover {
  border-color: var(--ink-3) !important;
  color: var(--ink) !important;
}

/* Small inline buttons (e.g. the password "Show" toggle). Apex has
   no equivalent; render as a quiet outlined button using line + ink-2
   so it lives next to the password input without competing with the
   primary submit. */
.sp-button-sm,
button.sp-button-sm,
input[type="button"].sp-button-sm,
input[type="submit"].sp-button-sm {
  background: var(--bg-alt) !important;
  color: var(--ink-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-sm) !important;
  padding: 4px 10px !important;
  font-weight: 500 !important;
  font-size: var(--fs-sm) !important;
}
.sp-button-sm:hover {
  border-color: var(--ink-3) !important;
  color: var(--ink) !important;
}

/* Forms */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="tel"], textarea, select, .sp-form-control {
  font-family: var(--font);
  border: 1px solid var(--line) !important;
  border-radius: var(--r-sm) !important;
  background: var(--bg);
  color: var(--ink);
  box-shadow: none !important;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent) !important;
}
label, .sp-form-label { font-weight: 500; font-size: var(--fs-sm); color: var(--ink-2); }

/* Links. Light mode: rust default, darker rust hover (apex pattern).
   Dark mode: bone default, orange hover. SupportPal's main.min.css ships
     a:is(.sp-theme-dark *)        { color: var(--color-primary-100); }
     a:hover:is(.sp-theme-dark *)  { color: var(--color-primary-200); }
   at specificity (0,1,1), which beats our plain `a` (0,0,1). Our scale
   maps -100 to --accent (rust) and -200 to --accent-soft (#2c1a10 near
   black) — so default links rendered dim rust and hover went invisible.
   The pair below matches SupportPal's selector shape so specificity
   ties, then wins by source order. Equally-specific later overrides
   (.sp-breadcrumb a, .sp-nav a, .sp-related-articles li a, etc.) still
   win because they appear further down the file. */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
a:is(.sp-theme-dark *) { color: var(--ink); }
a:hover:is(.sp-theme-dark *) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Tables */
table { border-collapse: collapse; width: 100%; background: transparent; }
table th {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-weight: 600;
  text-transform: none;
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: var(--s3);
  background: transparent;
}
table td {
  border-bottom: 1px solid var(--line);
  padding: var(--s3);
  background: transparent;
  color: var(--ink);
}
table tbody tr:hover { background: var(--bg-alt); }
table tbody tr:nth-child(even) { background: transparent; }

/* Status pills */
.sp-badge, .label, [class*="status-"]:not(.sp-icon) {
  border-radius: var(--r-sm) !important;
  border: 1px solid var(--line-2);
  background: transparent !important;
  color: var(--ink-2) !important;
  font-weight: 500;
  padding: 2px var(--s2);
  text-transform: none;
  box-shadow: none !important;
}

/* Article body. SupportPal's article reader puts the content inside
   `<div class="sp-article">` (NOT .sp-prose). Constrain reading width
   to ~65ch and apply the apex prose rhythm. */
.sp-prose, article, .article-content, .sp-article {
  max-width: 65ch;
  line-height: 1.65;
  color: var(--ink);
}
.sp-prose h2, article h2, .sp-article h2 { margin-top: var(--s7); margin-bottom: var(--s3); font-size: var(--fs-h2); font-weight: 700; }
.sp-prose h3, article h3, .sp-article h3 { margin-top: var(--s6); margin-bottom: var(--s2); font-size: var(--fs-h3); font-weight: 600; }
.sp-prose p, article p, .sp-article p { margin-bottom: var(--s4); }
.sp-prose ul, .sp-prose ol,
.sp-article ul, .sp-article ol { margin: 0 0 var(--s4) var(--s5); }
.sp-prose li, .sp-article li { margin-bottom: var(--s2); }
.sp-prose code, article code, .sp-article code {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95em;
}
.sp-prose pre, article pre, .sp-article pre {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--s4);
  overflow-x: auto;
}
.sp-prose img, .sp-article img { max-width: 100%; height: auto; border-radius: var(--r-sm); }

/* Article meta line + section dividers + related-article list. */
.sp-article-details { margin-bottom: var(--s4) !important; color: var(--ink-3) !important; }
.sp-article-details i.fas { color: var(--ink-3); }
hr { border: 0 !important; border-top: 1px solid var(--line) !important; margin: var(--s5) 0 !important; }
.sp-related-articles {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.sp-related-articles > li {
  padding: var(--s3) 0 !important;
  border-bottom: 1px solid var(--line);
  list-style: none !important;
  margin: 0 !important;
}
.sp-related-articles > li:last-child { border-bottom: 0; }
.sp-related-articles > li a { color: var(--ink) !important; text-decoration: none !important; }
.sp-related-articles > li a:hover { color: var(--accent) !important; }

/* Print button (anchor variant of .sp-button-sm). Add a.sp-button-sm
   to my .sp-button-sm rule's selector list above by repeating the
   selector here; CSS doesn't care about order, the !important values
   apply identically. */
a.sp-button.sp-button-sm {
  background: var(--bg-alt) !important;
  color: var(--ink-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-sm) !important;
  padding: 4px 10px !important;
  font-weight: 500 !important;
  font-size: var(--fs-sm) !important;
  text-decoration: none !important;
}
a.sp-button.sp-button-sm:hover {
  border-color: var(--ink-3) !important;
  color: var(--ink) !important;
}

/* Dashboard category panels: rebuilt as editorial list rows.
   SupportPal ships each card as an <a> wrapper carrying
   .sp-bg-secondary .sp-rounded .sp-shadow .sp-px-6 .sp-py-3 .sp-m-3
   with a .sp-dashboard-section flex container inside. The default
   look is a chunky shaded box; previous brand styling outlined the
   inner box with a hover border, which read as a "table border that
   lights up". This rebuild strips the wrapper chrome, kills the
   inner border, and puts a hairline rule under each row. Hover
   tints the row background and shifts icon + title to the accent
   colour. No transforms, no shadows, no rounding. */

a:has(> .sp-dashboard-section),
a:has(> .sp-collapsible > .sp-dashboard-section) {
  display: block;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  margin: 0 !important;
  padding: var(--s4) var(--s2) !important;
  transition: background var(--dur) var(--ease);
}
a:has(> .sp-dashboard-section):hover,
a:has(> .sp-collapsible > .sp-dashboard-section):hover {
  background: var(--bg-alt) !important;
}

/* Inner flex container: no chrome of its own. */
.sp-dashboard-section {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
}
.sp-dashboard-section:hover {
  border: 0 !important;
  transform: none !important;
}

/* Icon: muted by default, accent on row hover. Covers both the legacy
   FA glyphs (still used as fallback for unknown category icon classes)
   AND the apex-style line-drawn SVGs injected by the dashboard.twig
   `aabox_icon` macro for known categories. */
.sp-dashboard-section .sp-icon i.fas,
.sp-dashboard-section .sp-icon .aabox-cat-svg {
  color: var(--ink-3);
  transition: color var(--dur) var(--ease);
}
.sp-dashboard-section .sp-icon .aabox-cat-svg {
  width: 48px;
  height: 48px;
  display: block;
}
a:hover > .sp-dashboard-section .sp-icon i.fas,
a:hover > .sp-dashboard-section .sp-icon .aabox-cat-svg,
a:hover > .sp-collapsible > .sp-dashboard-section .sp-icon i.fas,
a:hover > .sp-collapsible > .sp-dashboard-section .sp-icon .aabox-cat-svg,
.sp-dashboard-section:hover .sp-icon .aabox-cat-svg {
  color: var(--accent);
}

/* Title + body within the row. */
.sp-dashboard-section h4 {
  font-size: var(--fs-lede);
  font-weight: 600;
  color: var(--ink) !important;
  margin: 0 0 0.15em;
  transition: color var(--dur) var(--ease);
}
/* Selfservice categories wrap title text in an inline <a>; force it to
   inherit the H4 colour so the text reads cream-on-walnut not dim rust. */
.sp-dashboard-section h4 a,
.sp-dashboard-section h4 a:visited {
  color: inherit !important;
  text-decoration: none !important;
}
.sp-dashboard-section p {
  color: var(--ink-2) !important;
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin: 0;
}

/* Hover the row (Pattern B: row contains multiple anchors, not wrapped
   by one). Tints the row, lifts the title + icon to accent. */
.sp-dashboard-section:hover {
  background: var(--bg-alt) !important;
}
.sp-dashboard-section:hover h4,
.sp-dashboard-section:hover h4 a,
a:hover > .sp-dashboard-section h4,
a:hover > .sp-collapsible > .sp-dashboard-section h4 {
  color: var(--accent) !important;
}
.sp-dashboard-section:hover .sp-icon i.fas {
  color: var(--accent);
}

/* The Submit Ticket / Track a Ticket pair lives in a wrapping flex
   row. Reset its negative margins so our hairline rows align flush. */
.sp-flex.sp-flex-wrap.sp--m-3,
.sp-flex.sp-flex-wrap.sp-m-3 {
  margin: 0 !important;
}

/* KB / dashboard tabs (`Popular Items` / `Latest Items`). SupportPal
   ships them as bullet list items with no visible active state; lay
   them out as inline tabs with an apex-style rust underline on the
   active tab so the eye knows which list is shown. */
ul.sp-tabs {
  list-style: none !important;
  padding: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  display: flex !important;
  gap: var(--s4);
  margin-bottom: var(--s4) !important;
}
ul.sp-tabs > li {
  display: inline-block !important;
  list-style: none !important;
  padding: var(--s2) 0 !important;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent !important;
}
ul.sp-tabs > li a {
  color: var(--ink-3) !important;
  font-weight: 500;
  text-decoration: none !important;
  display: inline-block;
  padding: 0 var(--s1);
}
ul.sp-tabs > li:hover a { color: var(--accent) !important; }
ul.sp-tabs > li.sp-active { border-bottom-color: var(--accent) !important; }
ul.sp-tabs > li.sp-active a { color: var(--accent) !important; font-weight: 600; }

/* KB article list (under the tabs on /knowledgebase, also on category
   landing pages). Default chrome gives zero padding + no dividers so
   it reads as a wall of rust links. Apply the same editorial-row
   pattern as the dashboard categories: hairline divider + hover tint,
   title text in --ink with accent on hover. */
ul.sp-article-list { list-style: none !important; padding: 0 !important; margin: 0 !important; }
ul.sp-article-list > li {
  padding: var(--s4) 0 !important;
  border-bottom: 1px solid var(--line);
  list-style: none !important;
  transition: padding var(--dur) var(--ease);
}
ul.sp-article-list > li:last-child { border-bottom: 0; }
ul.sp-article-list > li a {
  color: var(--ink) !important;
  text-decoration: none !important;
  display: block;
}
ul.sp-article-list > li a:hover { color: var(--accent) !important; }
ul.sp-article-list > li h4 {
  font-size: var(--fs);
  font-weight: 500;
  margin: 0;
  color: inherit;
}

/* KB category cards: bg-alt block with rust title text. Add hover tint
   so the row gives feedback on hover without resorting to box shadow. */
.sp-category-title {
  transition: background var(--dur) var(--ease);
}
.sp-category-title:hover {
  background: var(--bg-deep) !important;
}

/* Sidebar nav */
.sp-sidebar { background: transparent; border-right: 1px solid var(--line); }
.sp-sidebar a.current, .sp-sidebar a.active {
  border-left: 2px solid var(--accent);
  background: transparent;
  color: var(--accent-2);
  font-weight: 600;
}

/* Header chrome */
header.sp-sticky, header {
  background: var(--bg) !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: none !important;
}

/* Header Register CTA needs a small right margin to sit beside the
   Login CTA without crowding. All other chrome (size, colour, border)
   comes from the unified .sp-button-secondary block above. */
header.sp-sticky a[href*="/register"] { margin-right: var(--s2); }

/* Mobile nav drawer. SupportPal renders it with .sp-bg-primary-800 (rust
   in our palette) and `ul.sp-nav li a { color: var(--color-primary-200) }`
   which in dark mode would resolve to invisible dark-soft on rust. Quiet
   the bg to --bg-alt and force readable link colours. */
.sp-mobile-nav { background: var(--bg-alt) !important; }
.sp-mobile-nav ul.sp-nav li a,
.sp-mobile-nav ul.sp-nav li a:visited { color: var(--ink-2) !important; }
.sp-mobile-nav ul.sp-nav li a:hover { color: var(--accent) !important; }

/* Auth pages (login + register): wrap the form in .aabox-auth-grid so it
   sits left with an apex-style line illustration on the right at lg+.
   At small widths the illustration hides and the form spans full width.
   The form inside SupportPal already uses .sp-w-full md:sp-w-2/3 xl:sp-w-1/2
   which we override to full-width-of-cell so the column controls layout. */
.aabox-auth-grid {
  display: grid;
  gap: var(--s7);
  align-items: center;
}
@media (min-width: 900px) {
  .aabox-auth-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.aabox-auth-grid > form { width: 100% !important; max-width: 28rem; margin: 0 !important; }
.aabox-auth-aside { display: none; color: var(--ink-2); }
@media (min-width: 900px) { .aabox-auth-aside { display: block; } }
.aabox-auth-aside svg { width: 100%; height: auto; max-height: 460px; display: block; }
.aabox-auth-aside .grid-bg line { opacity: 0.16; }
.aabox-auth-aside .hatch line { opacity: 0.4; }
.aabox-auth-aside .annotation {
  fill: currentColor; stroke: none;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; letter-spacing: 0.14em; font-weight: 600;
}

/* Dashboard search */
.sp-search input[type="search"] {
  font-size: var(--fs-lede);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line) !important;
  border-radius: var(--r-sm) !important;
  background: var(--bg);
  color: var(--ink);
}

/* Navigation */
.sp-nav a, .sp-nav a:visited { color: var(--ink-2); font-weight: 500; }
.sp-nav a.current, .sp-nav a:hover { color: var(--accent); }
.sp-nav { gap: var(--s4); }

/* Anti-slop neutralizers. Override SupportPal defaults that violate the design system. */
.sp-text-uppercase, .sp-uppercase { text-transform: none !important; }
.sp-italic, em, i:not([class*="fa"]) { font-style: normal !important; }
.sp-shadow, .sp-shadow-sm, .sp-shadow-md, .sp-shadow-lg, .sp-shadow-xl { box-shadow: none !important; }
.sp-rounded, .sp-rounded-md, .sp-rounded-lg { border-radius: var(--r-sm) !important; }
.sp-rounded-full { border-radius: 999px !important; }

/* Body bg utility class mapping */
.sp-bg-primary { background-color: var(--bg) !important; }
.sp-bg-secondary { background-color: var(--bg-alt) !important; }
.sp-bg-tertiary { background-color: var(--bg-deep) !important; }
.sp-text-primary { color: var(--ink) !important; }
.sp-text-secondary { color: var(--ink-2) !important; }
.sp-text-tertiary { color: var(--ink-3) !important; }

/* Hardcoded color overrides. Common Tailwind grays SupportPal ships hardcoded. */
.sp-text-gray-500 { color: var(--ink-3) !important; }
.sp-text-gray-600 { color: var(--ink-2) !important; }
.sp-text-gray-700, .sp-text-gray-800, .sp-text-gray-900 { color: var(--ink) !important; }
.sp-bg-gray-50, .sp-bg-gray-100 { background-color: var(--bg-alt) !important; }
.sp-bg-gray-200 { background-color: var(--bg-deep) !important; }
.sp-border-gray-200, .sp-border-gray-300 { border-color: var(--line) !important; }

/* Marketing-style dashboard hero. Top of the page when on home route. */
.aabox-hero {
  padding: var(--s5) 0 var(--s4);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.aabox-hero h1 {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s3);
  line-height: 1.15;
}
.aabox-hero p.lede {
  font-size: var(--fs);
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 var(--s4);
  line-height: 1.5;
}

/* Empty-state layout shared by 404 + no-search-results.
   Vertically centred illustration -> heading -> short message -> CTA.
   Illustration inherits currentColor and follows light/dark mode. */
.aabox-empty-state {
  text-align: center;
  padding: var(--s7) var(--s4);
  max-width: 540px;
  margin: 0 auto;
}
.aabox-empty-state .aabox-empty-illo {
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: 0 auto var(--s5);
  display: block;
  color: var(--ink-3);
}
.aabox-empty-state .aabox-empty-illo .grid-bg line { opacity: 0.18; }
.aabox-empty-state .aabox-empty-illo .annotation {
  fill: currentColor; stroke: none;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px; letter-spacing: 0.14em; font-weight: 600;
}
.aabox-empty-state h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s3);
  color: var(--ink);
}
.aabox-empty-state p {
  color: var(--ink-2);
  max-width: 42ch;
  margin: 0 auto var(--s5);
  line-height: 1.55;
}
.aabox-empty-state .aabox-empty-actions {
  display: inline-flex;
  gap: var(--s3);
}

/* Hero: 2-column at lg+ with apex-style line illustration aside.
   Stacks on small screens (aside hidden) so the compact hero stays
   compact on mobile. */
.aabox-hero-grid { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 900px) {
  .aabox-hero-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
.aabox-hero-aside { display: none; color: var(--ink-2); }
@media (min-width: 900px) { .aabox-hero-aside { display: block; } }
.aabox-hero-aside svg { width: 100%; height: auto; max-height: 200px; display: block; }
.aabox-hero-aside .grid-bg line { opacity: 0.18; }
.aabox-hero-aside .annotation {
  fill: currentColor; stroke: none;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px; letter-spacing: 0.14em; font-weight: 600;
}

/* On the dashboard the SupportPal page-title H1 ("Support Portal") and
   the breadcrumb ("Support Portal » Home") are redundant with the hero
   above them. Hide only when the hero is present, so inner pages keep
   their breadcrumb. */
body:has(.aabox-hero) h1.sp-text-3xl.sp-font-normal { display: none; }
body:has(.aabox-hero) .sp-breadcrumb { display: none; }

/* Inner-page H1 ("Login", "Knowledgebase", "My Tickets") ships as
   `<h1 class="sp-text-3xl sp-font-normal">` — too thin against the
   marketing-site H2 weight. Lift to weight 600, tighten letter
   spacing, drop the size half-step to match the apex H2 scale. */
body:not(:has(.aabox-hero)) h1.sp-text-3xl.sp-font-normal {
  font-weight: 600 !important;
  font-size: var(--fs-h2) !important;
  letter-spacing: -0.01em;
  margin-bottom: var(--s3) !important;
  color: var(--ink) !important;
}

/* Empty-state pages provide their own H2 + illustration; the SupportPal
   page-title H1 and breadcrumb above them are redundant noise. Hide
   when `.aabox-empty-state` is present (matches 404 + no-results). */
body:has(.aabox-empty-state) h1.sp-text-3xl.sp-font-normal,
body:has(.aabox-empty-state) .sp-breadcrumb { display: none; }
.sp-breadcrumb {
  font-size: var(--fs-xs);
  color: var(--ink-3) !important;
  margin-bottom: var(--s3);
}
.sp-breadcrumb a { color: var(--ink-3); }
.sp-breadcrumb a:hover { color: var(--accent); }
.aabox-hero form {
  max-width: 36rem;
}
.aabox-hero input[type="search"] {
  width: 100%;
  font-size: var(--fs-lede);
  padding: var(--s4);
  border: 1px solid var(--line-2) !important;
}
