/*
 * Horoscopes.FYi design system — second pass (work #367, November 2026)
 *
 * Supersedes the #239/#240 charcoal dark theme and the "no visible toggle"
 * rule. Light and dark are related purple palettes; visitors choose Light,
 * System or Dark in the header (static/js/theme.js). See
 * docs/design/refresh-367.md for the palette, type and layout decisions.
 *
 *   1. Tokens: light, dark (explicit and no-JS system fallback), motion
 *   2. Bootstrap 5.3 bridge and colour utilities
 *   3. Base: canvas, typography, links
 *   4. Header: brand, navigation, search, appearance selector
 *   5. Page bands: home hero, page masthead, breadcrumb, sections
 *   6. Components: cards, buttons, chips, meta, callouts, pagination,
 *      forms, dropdowns, tables, overlays, empty states
 *   7. Layouts: sign grid, preview grids, reading layout, sign page
 *   8. Page features: constellation art, compatibility, archive, date
 *      bar, 404
 *   9. Footer
 *  10. Interaction: focus, motion, responsive, print
 *
 * Rules: every foreground token is paired with the surface it sits on;
 * cards are flat surfaces with a 1px border; hover never moves or resizes
 * anything; text meets WCAG 2.2 AA in both themes; theme swaps are instant
 * (no colour cross-fade through low-contrast intermediate colours).
 */

/* ------------------------------------------------------------------ */
/* 1. Tokens                                                           */
/* ------------------------------------------------------------------ */

:root {
    color-scheme: light;

    /* Canvas and surfaces */
    --hf-canvas: #f6f2fc;            /* airy lavender page */
    --hf-canvas-alt: #efe8fa;        /* alternate section band */
    --hf-surface: #ffffff;           /* cards */
    --hf-surface-2: #f7f3fd;         /* insets inside cards, hover rows */
    --hf-surface-elevated: #ffffff;  /* menus, overlays */
    --hf-surface-head: #f3edfd;      /* card headers */
    --hf-header-bg: rgba(250, 247, 254, 0.94);

    /* Text */
    --hf-heading: #241747;           /* 15.9:1 on surface */
    --hf-ink: #2e2450;               /* body copy, 14.4:1 on surface */
    --hf-ink-muted: #5c5380;         /* secondary, 7.0:1 surface, 6.0:1 canvas-alt */
    --hf-link: #5634c0;              /* 7.5:1 on surface */
    --hf-link-hover: #3f2299;

    /* Accent (purple) */
    --hf-accent: #6643d1;            /* fills; white text 6.3:1 */
    --hf-accent-hover: #5432bd;      /* white text 7.9:1 */
    --hf-on-accent: #ffffff;
    --hf-accent-soft: #ece4fd;       /* tinted chips, hover */
    --hf-accent-soft-strong: #ddd0fa;
    --hf-accent-ink: #3b2391;        /* text on accent-soft 9.5:1 */
    --hf-star: #b8860b;              /* celestial highlight (decoration/icons) */

    /* Lines and controls */
    --hf-border: #e2d9f3;
    --hf-border-strong: #8a7fae;     /* control boundaries 3.7:1 on surface */
    --hf-control-bg: #ffffff;

    /* Hero and masthead bands */
    --hf-glow-purple: rgba(197, 168, 255, 0.55);
    --hf-glow-blush: rgba(255, 214, 236, 0.6);
    --hf-hero-bg: radial-gradient(90% 120% at 0% 100%, var(--hf-glow-blush) 0%, transparent 60%),
        linear-gradient(135deg, #f1eaff 0%, #f8f2fd 100%);
    --hf-hero-ink: #241747;
    --hf-hero-muted: #4f4574;        /* 7.4:1 on the darkest hero stop */
    --hf-hero-border: #ddd0fa;
    --hf-hero-art: #6643d1;
    --hf-hero-art-soft: rgba(102, 67, 209, 0.14);
    --hf-hero-star: #b8860b;

    /* Footer */
    --hf-footer-bg: #2b1f57;
    --hf-footer-ink: #f3eefe;
    --hf-footer-muted: #cdc3ee;
    --hf-footer-line: rgba(255, 255, 255, 0.16);

    /* Status (compatibility, notifications): dark text on tint */
    --hf-status-excellent-bg: #dcfce7;   --hf-status-excellent-fg: #14532d;
    --hf-status-good-bg: #d5f5f0;        --hf-status-good-fg: #134e4a;
    --hf-status-neutral-bg: #fdf3d7;     --hf-status-neutral-fg: #713f12;
    --hf-status-challenging-bg: #fde2e2; --hf-status-challenging-fg: #7f1d1d;
    --hf-status-self-bg: #ece6f7;        --hf-status-self-fg: #3f3a5c;

    /* Focus: two colours, visible on every surface */
    --hf-focus-outline: #3b2391;
    --hf-focus-halo: #ffffff;
    --hf-focus-soft: rgba(102, 67, 209, 0.28);

    /* Elevation */
    --hf-shadow-1: 0 1px 2px rgba(43, 31, 87, 0.06), 0 1px 1px rgba(43, 31, 87, 0.03);
    --hf-shadow-2: 0 12px 32px rgba(43, 31, 87, 0.14);

    /* Typography */
    --hf-font-display: 'Cormorant Garamond', 'Cormorant', 'Noto Sans Symbols', Garamond, 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
    --hf-font-body: 'Figtree', 'Noto Sans Symbols', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --hf-text-xs: 0.8125rem;   /* 13: labels, eyebrows */
    --hf-text-sm: 0.9375rem;   /* 15: metadata, navigation, utility */
    --hf-text-md: 1.0625rem;   /* 17: body and previews */
    --hf-text-lg: 1.1875rem;   /* 19: full readings, lead */
    --hf-title-sm: 1.375rem;   /* 22: small card titles (serif) */
    --hf-title-md: 1.625rem;   /* 26: card titles (serif) */
    --hf-title-lg: clamp(1.875rem, 1.5rem + 1.2vw, 2.375rem);  /* 30-38: section titles */
    --hf-title-xl: clamp(2.125rem, 1.5rem + 3vw, 3.75rem);     /* 34-60: page titles */
    --hf-leading-tight: 1.12;
    --hf-leading-snug: 1.35;
    --hf-leading-body: 1.65;

    /* Spacing (4px base) and rhythm */
    --hf-space-1: 0.25rem;
    --hf-space-2: 0.5rem;
    --hf-space-3: 0.75rem;
    --hf-space-4: 1rem;
    --hf-space-5: 1.5rem;
    --hf-space-6: 2rem;
    --hf-space-7: 3rem;
    --hf-space-8: 4rem;
    --hf-section-y: clamp(2.5rem, 1.75rem + 3vw, 4.5rem);
    --hf-card-pad: clamp(1.125rem, 0.9rem + 0.8vw, 1.75rem);
    --hf-gutter: clamp(1rem, 0.6rem + 1.2vw, 1.75rem);

    /* Radius */
    --hf-radius-sm: 8px;
    --hf-radius-md: 14px;
    --hf-radius-lg: 22px;
    --hf-radius-pill: 999px;

    /* Controls */
    --hf-control-h: 2.75rem;   /* 44px touch target */

    /* Layout */
    --hf-measure: 68ch;
    --hf-reading-width: 46rem; /* full-reading column: text fills the card */
    --hf-aside-min: 18rem;

    /* Motion: only borders/shadows animate; palette swaps are instant */
    --hf-duration: 150ms;
    --hf-ease: cubic-bezier(0.2, 0, 0, 1);
    --hf-transition: border-color var(--hf-duration) var(--hf-ease), box-shadow var(--hf-duration) var(--hf-ease);

    /* Legacy aliases kept for any remaining references */
    --hf-page: var(--hf-canvas);
    --hf-surface-sunken: var(--hf-surface-2);
    --hf-brand-500: var(--hf-accent);
    --hf-brand-600: var(--hf-accent-hover);
    --hf-brand-text: var(--hf-link);
    --hf-brand-soft: var(--hf-accent-soft);
    --hf-brand-soft-strong: var(--hf-accent-soft-strong);
    --hf-brand-ink: var(--hf-accent-ink);
    --primary-color: var(--hf-accent);
    --secondary-color: var(--hf-accent-hover);
    --text-primary: var(--hf-ink);
    --text-secondary: var(--hf-ink-muted);
    --bg-light: var(--hf-surface-2);
    --border-color: var(--hf-border);
    --shadow: var(--hf-shadow-1);
    --shadow-lg: var(--hf-shadow-2);
}

/*
 * Dark: medium-deep plum/indigo canvas, clearly lighter violet cards and
 * controls, luminous off-white text. Not charcoal, not near-black.
 *
 * The same block appears twice: once for an explicit/JS-resolved dark theme
 * ([data-theme="dark"]), once for visitors without JavaScript whose OS is
 * dark (no data-theme attribute). Keep the two in sync.
 */
:root[data-theme="dark"] {
    color-scheme: dark;
    --hf-canvas: #2a2050;
    --hf-canvas-alt: #31265c;
    --hf-surface: #3a2e6b;
    --hf-surface-2: #33285f;
    --hf-surface-elevated: #44377a;
    --hf-surface-head: #43357a;
    --hf-header-bg: rgba(42, 32, 80, 0.94);
    --hf-heading: #fbf8ff;
    --hf-ink: #efe9ff;
    --hf-ink-muted: #cfc4f2;
    --hf-link: #d6c6ff;
    --hf-link-hover: #f1ebff;
    --hf-accent: #c8b4ff;
    --hf-accent-hover: #ddd0ff;
    --hf-on-accent: #20164a;
    --hf-accent-soft: #4b3c8a;
    --hf-accent-soft-strong: #58479c;
    --hf-accent-ink: #f1ebff;
    --hf-star: #ffd98a;
    --hf-border: #594a96;
    --hf-border-strong: #a194d6;
    --hf-control-bg: #2f2559;
    --hf-glow-purple: rgba(176, 132, 255, 0.18);
    --hf-glow-blush: rgba(226, 112, 196, 0.12);
    --hf-hero-bg: radial-gradient(90% 120% at 0% 100%, var(--hf-glow-blush) 0%, transparent 60%),
        linear-gradient(135deg, #4a3794 0%, #3b2c7a 100%);
    --hf-hero-ink: #fdfbff;
    --hf-hero-muted: #e3daff;
    --hf-hero-border: #6553ad;
    --hf-hero-art: #e6dcff;
    --hf-hero-art-soft: rgba(230, 220, 255, 0.16);
    --hf-hero-star: #ffd98a;
    --hf-footer-bg: #211946;
    --hf-footer-ink: #f3eefe;
    --hf-footer-muted: #cdc3ee;
    --hf-footer-line: rgba(255, 255, 255, 0.14);
    --hf-status-excellent-bg: #1f4d3c;   --hf-status-excellent-fg: #c9f7dc;
    --hf-status-good-bg: #1c4a52;        --hf-status-good-fg: #bff3ec;
    --hf-status-neutral-bg: #574420;     --hf-status-neutral-fg: #ffe9a8;
    --hf-status-challenging-bg: #5c2440; --hf-status-challenging-fg: #ffd3e3;
    --hf-status-self-bg: #4b3f80;        --hf-status-self-fg: #ece6ff;
    --hf-focus-outline: #ffe4a3;
    --hf-focus-halo: #20164a;
    --hf-focus-soft: rgba(200, 180, 255, 0.35);
    --hf-shadow-1: 0 1px 2px rgba(10, 4, 30, 0.25);
    --hf-shadow-2: 0 14px 36px rgba(10, 4, 30, 0.45);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --hf-canvas: #2a2050;
        --hf-canvas-alt: #31265c;
        --hf-surface: #3a2e6b;
        --hf-surface-2: #33285f;
        --hf-surface-elevated: #44377a;
        --hf-surface-head: #43357a;
        --hf-header-bg: rgba(42, 32, 80, 0.94);
        --hf-heading: #fbf8ff;
        --hf-ink: #efe9ff;
        --hf-ink-muted: #cfc4f2;
        --hf-link: #d6c6ff;
        --hf-link-hover: #f1ebff;
        --hf-accent: #c8b4ff;
        --hf-accent-hover: #ddd0ff;
        --hf-on-accent: #20164a;
        --hf-accent-soft: #4b3c8a;
        --hf-accent-soft-strong: #58479c;
        --hf-accent-ink: #f1ebff;
        --hf-star: #ffd98a;
        --hf-border: #594a96;
        --hf-border-strong: #a194d6;
        --hf-control-bg: #2f2559;
        --hf-glow-purple: rgba(176, 132, 255, 0.18);
        --hf-glow-blush: rgba(226, 112, 196, 0.12);
        --hf-hero-bg: radial-gradient(90% 120% at 0% 100%, var(--hf-glow-blush) 0%, transparent 60%),
            linear-gradient(135deg, #4a3794 0%, #3b2c7a 100%);
        --hf-hero-ink: #fdfbff;
        --hf-hero-muted: #e3daff;
        --hf-hero-border: #6553ad;
        --hf-hero-art: #e6dcff;
        --hf-hero-art-soft: rgba(230, 220, 255, 0.16);
        --hf-hero-star: #ffd98a;
        --hf-footer-bg: #211946;
        --hf-footer-ink: #f3eefe;
        --hf-footer-muted: #cdc3ee;
        --hf-footer-line: rgba(255, 255, 255, 0.14);
        --hf-status-excellent-bg: #1f4d3c;   --hf-status-excellent-fg: #c9f7dc;
        --hf-status-good-bg: #1c4a52;        --hf-status-good-fg: #bff3ec;
        --hf-status-neutral-bg: #574420;     --hf-status-neutral-fg: #ffe9a8;
        --hf-status-challenging-bg: #5c2440; --hf-status-challenging-fg: #ffd3e3;
        --hf-status-self-bg: #4b3f80;        --hf-status-self-fg: #ece6ff;
        --hf-focus-outline: #ffe4a3;
        --hf-focus-halo: #20164a;
        --hf-focus-soft: rgba(200, 180, 255, 0.35);
        --hf-shadow-1: 0 1px 2px rgba(10, 4, 30, 0.25);
        --hf-shadow-2: 0 14px 36px rgba(10, 4, 30, 0.45);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root { --hf-duration: 0ms; }
}

/* ------------------------------------------------------------------ */
/* 2. Bootstrap 5.3 bridge                                             */
/* ------------------------------------------------------------------ */

/* Bootstrap's own [data-bs-theme] rules load first; these win by order. */
:root,
:root[data-bs-theme] {
    --bs-primary: var(--hf-accent);
    --bs-body-font-family: var(--hf-font-body);
    --bs-body-font-size: var(--hf-text-md);
    --bs-body-line-height: var(--hf-leading-body);
    --bs-body-bg: var(--hf-canvas);
    --bs-body-color: var(--hf-ink);
    --bs-emphasis-color: var(--hf-heading);
    --bs-heading-color: var(--hf-heading);
    --bs-secondary-color: var(--hf-ink-muted);
    --bs-secondary-bg: var(--hf-surface-2);
    --bs-tertiary-bg: var(--hf-surface-2);
    --bs-tertiary-color: var(--hf-ink-muted);
    --bs-border-color: var(--hf-border);
    --bs-border-color-translucent: var(--hf-border);
    --bs-border-radius: var(--hf-radius-sm);
    --bs-border-radius-lg: var(--hf-radius-md);
    --bs-link-color: var(--hf-link);
    --bs-link-hover-color: var(--hf-link-hover);
    --bs-box-shadow-sm: var(--hf-shadow-1);
    --bs-focus-ring-color: var(--hf-focus-soft);
}

/* Colour utilities used by templates map onto the semantic tokens. */
.text-primary { color: var(--hf-link) !important; }
.text-dark,
.text-body { color: var(--hf-ink) !important; }
.text-muted,
.text-body-secondary,
.text-secondary,
.text-secondary-emphasis { color: var(--hf-ink-muted) !important; }
.bg-light,
.bg-body-tertiary { background-color: var(--hf-canvas-alt) !important; }
.bg-white,
.bg-body { background-color: var(--hf-surface) !important; }
.bg-transparent { background-color: transparent !important; }
.shadow-sm { box-shadow: var(--hf-shadow-1) !important; }
.border,
.border-bottom,
.border-top { border-color: var(--hf-border) !important; }

/* ------------------------------------------------------------------ */
/* 3. Base                                                             */
/* ------------------------------------------------------------------ */

html {
    background-color: var(--hf-canvas);   /* covers overscroll and short pages */
    accent-color: var(--hf-accent);
    -webkit-text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--hf-font-body);
    font-size: var(--hf-text-md);
    line-height: var(--hf-leading-body);
    color: var(--hf-ink);
    background-color: var(--hf-canvas);
    isolation: isolate; /* keep the fixed ambient layer behind content */
    font-optical-sizing: auto;
    /* Zodiac signs default to emoji presentation; show them as text glyphs
       that take the theme colour. */
    font-variant-emoji: text;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Decorative light only: one viewport-sized clip, never document-sized.
   The two composited axes are a quarter-cycle apart, tracing a soft ellipse
   near the perimeter. Both turn smoothly; no background/paint animation, JS
   frame loop, filter, opacity pulse or moving content. Half-periods below
   produce full cycles of 194–238s with independent starting phases. */
.hf-ambient {
    --hf-drift-half: 109s;
    --hf-drift-phase-x: -37s;
    --hf-drift-phase-y: -91.5s;
    --hf-drift-x: 28%;
    --hf-drift-y: 26%;
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: var(--hf-radius-lg);
    pointer-events: none;
}

.hf-ambient::before {
    content: "";
    position: absolute;
    inset: -40%;
    /* Transparent before every raster edge, so translation exposes no seams. */
    background: radial-gradient(ellipse at 50% 50%, var(--hf-glow-purple) 0%, transparent 65%);
    /* A considered static composition, including live reduced-motion changes. */
    translate: 22% 0;
    transform: translateY(-20%);
}

.hf-ambient--canvas {
    --hf-drift-half: 113s;
    --hf-drift-phase-x: -31s;
    --hf-drift-phase-y: -87.5s;
    --hf-drift-y: 28%;
    position: fixed;
    z-index: -1;
    border-radius: 0;
    opacity: 0.28;
}

.hf-hero__panel > .hf-ambient {
    --hf-drift-half: 97s;
    --hf-drift-phase-x: -71s;
    --hf-drift-phase-y: -119.5s;
    --hf-drift-x: -29%;
    --hf-drift-y: 25%;
}

section.bg-gradient-primary > .container > .hf-ambient {
    inset-inline: var(--hf-panel-inset);
}

.error-container > .hf-ambient {
    --hf-drift-half: 119s;
    --hf-drift-phase-x: -53s;
    --hf-drift-phase-y: -112.5s;
    --hf-drift-x: -27%;
}

@keyframes hf-ambient-x {
    from { translate: calc(-1 * var(--hf-drift-x)) 0; }
    to { translate: var(--hf-drift-x) 0; }
}

@keyframes hf-ambient-y {
    from { transform: translateY(calc(-1 * var(--hf-drift-y))); }
    to { transform: translateY(var(--hf-drift-y)); }
}

@media (prefers-reduced-motion: no-preference) {
    .hf-ambient::before {
        animation:
            hf-ambient-x var(--hf-drift-half) ease-in-out var(--hf-drift-phase-x) infinite alternate,
            hf-ambient-y var(--hf-drift-half) ease-in-out var(--hf-drift-phase-y) infinite alternate-reverse;
    }
}

main { flex: 1 0 auto; }
main:focus { outline: none; }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--hf-heading);
    line-height: var(--hf-leading-tight);
    margin-bottom: var(--hf-space-3);
    text-wrap: balance;
}

/* Serif display face: page, section and card titles (h1-h3). */
h1, h2, h3, .h1, .h2, .h3,
.card-title,
.display-4, .display-5, .display-6 {
    font-family: var(--hf-font-display);
    font-weight: 700;
    letter-spacing: -0.005em;
}

/* Figtree for small headings and labels (h4-h6). */
h4, h5, h6, .h4, .h5, .h6 {
    font-family: var(--hf-font-body);
    font-weight: 650;
    letter-spacing: 0;
}

h1, .h1, .display-4 { font-size: var(--hf-title-xl); line-height: 1.04; }
h2, .h2, .display-5 { font-size: var(--hf-title-lg); }
h3, .h3, .display-6 { font-size: var(--hf-title-md); }
h4, .h4 { font-size: 1.1875rem; line-height: var(--hf-leading-snug); }
h5, .h5 { font-size: 1.0625rem; line-height: var(--hf-leading-snug); }
h6, .h6 { font-size: var(--hf-text-sm); line-height: var(--hf-leading-snug); }

i.display-1, i.display-2 { font-size: 3.5rem; }
i.display-4 { font-size: 2.5rem; }
i.display-6 { font-size: 1.75rem; }

.lead {
    font-size: var(--hf-text-lg);
    line-height: 1.55;
    font-weight: 400;
}

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

p, li, dd { overflow-wrap: break-word; }

a {
    color: var(--hf-link);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

a:hover { color: var(--hf-link-hover); }

hr { border-color: var(--hf-border); opacity: 1; }

strong, b { font-weight: 650; }

::selection { background: var(--hf-accent-soft-strong); color: var(--hf-heading); }

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

/* Font Awesome 7: keep icon font resolution consistent across pages. */
.fas, .far, .fab, .fa {
    font-family: "Font Awesome 7 Free", "Font Awesome 7 Pro", "Font Awesome 7 Brands" !important;
    font-weight: 900;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.fab { font-weight: 400; }

/* Skip link: hidden until focused */
.hf-skip-link {
    position: absolute;
    top: -100px;
    left: var(--hf-space-4);
    z-index: 2000;
    padding: var(--hf-space-2) var(--hf-space-4);
    border-radius: var(--hf-radius-sm);
    background: var(--hf-accent);
    color: var(--hf-on-accent);
    font-weight: 600;
    text-decoration: none;
}

.hf-skip-link:focus { top: var(--hf-space-3); color: var(--hf-on-accent); }

.container { --bs-gutter-x: calc(var(--hf-gutter) * 2); }

@media (min-width: 1400px) {
    .container { max-width: 1280px; }
}

/* ------------------------------------------------------------------ */
/* 4. Header                                                           */
/* ------------------------------------------------------------------ */

.hf-header {
    background: var(--hf-header-bg);
    border-bottom: 1px solid var(--hf-border);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    z-index: 1030;
}

.hf-header .navbar {
    --bs-navbar-padding-y: 0.625rem;
    --bs-navbar-color: var(--hf-ink);
    --bs-navbar-hover-color: var(--hf-accent-ink);
    --bs-navbar-active-color: var(--hf-accent-ink);
    --bs-navbar-brand-color: var(--hf-heading);
    --bs-navbar-brand-hover-color: var(--hf-heading);
    --bs-navbar-nav-link-padding-x: 0.8rem;
    --bs-navbar-toggler-border-color: var(--hf-border-strong);
    --bs-navbar-toggler-focus-width: 0;
    background: transparent;
}

.hf-header__row {
    flex-wrap: wrap;
    gap: 0 var(--hf-space-3);
}

/* Brand */
.hf-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-right: 0;
    padding: 0;
    color: var(--hf-heading);
    text-decoration: none;
    white-space: nowrap;
}

.hf-brand:hover { color: var(--hf-heading); }

.hf-brand__mark {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--hf-accent);
    color: var(--hf-on-accent);
    font-size: 1rem;
    flex: none;
}

.hf-brand__name {
    font-family: var(--hf-font-display);
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
}

.hf-brand__tld { color: var(--hf-link); }

/* Appearance selector + menu button: always visible, before the collapse */
.hf-header__tools {
    display: flex;
    align-items: center;
    gap: var(--hf-space-2);
    margin-left: auto;
}

.hf-theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-pill);
    background: var(--hf-surface);
    flex: none;
}

/* Without JavaScript the selector could not work; the OS theme applies. */
html:not(.js) .hf-theme-switch { display: none; }

.hf-theme-opt {
    display: inline-grid;
    place-items: center;
    width: 2.125rem;
    height: 2.125rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--hf-ink-muted);
    cursor: pointer;
}

.hf-theme-opt svg { width: 1.125rem; height: 1.125rem; }

.hf-theme-opt:hover {
    background: var(--hf-accent-soft);
    color: var(--hf-accent-ink);
}

.hf-theme-opt[aria-pressed="true"] {
    background: var(--hf-accent);
    color: var(--hf-on-accent);
}

/* Menu toggle (below xl) */
.hf-header .navbar-toggler {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.375rem 0.85rem;
    border: 1px solid var(--hf-border-strong);
    border-radius: var(--hf-radius-pill);
    color: var(--hf-ink);
    font-size: var(--hf-text-sm);
    font-weight: 600;
    background: var(--hf-surface);
}

.hf-header .navbar-toggler:hover { background: var(--hf-accent-soft); color: var(--hf-accent-ink); }

.hf-toggler-icon {
    position: relative;
    display: inline-block;
    width: 1.05rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

/* Navigation links */
.hf-header .nav-link {
    font-size: var(--hf-text-sm);
    font-weight: 550;
    white-space: nowrap;
    border-radius: var(--hf-radius-pill);
}

.hf-header .nav-link:hover,
.hf-header .nav-link:focus-visible,
.hf-header .nav-link.show {
    background: var(--hf-accent-soft);
    color: var(--hf-accent-ink);
}

.hf-header .nav-link.active,
.hf-header .nav-link[aria-current="page"] {
    color: var(--hf-accent-ink);
    background: var(--hf-accent-soft);
    font-weight: 650;
}

/* Labels and CSS triangles share a control-sized alignment box in every
   expanded/collapsed, hover, focus and open state. */
.hf-header .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hf-header .dropdown-toggle::after {
    flex: none;
    margin: 0;
    vertical-align: 0;
    border-top: 0.3em solid;
    border-right: 0.25em solid transparent;
    border-bottom: 0;
    border-left: 0.25em solid transparent;
}

/* Header search */
.hf-search {
    position: relative;
    display: flex;
    align-items: center;
}

.hf-search .form-control {
    min-height: 2.5rem;
    padding-right: 2.75rem;
    border-radius: var(--hf-radius-pill);
    background: var(--hf-control-bg);
    font-size: var(--hf-text-sm);
}

.hf-search .form-control::-webkit-search-cancel-button { margin-right: 0.25rem; }

.hf-search__btn {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--hf-link);
}

.hf-search__btn:hover { background: var(--hf-accent-soft); color: var(--hf-accent-ink); }

@media (min-width: 1200px) {
    .hf-header .navbar-collapse { gap: var(--hf-space-3); min-width: 0; }
    .hf-header .navbar-nav { gap: 0.125rem; }
    .hf-header .navbar-nav .nav-link { padding: 0.5rem 0.75rem; }
    .hf-header__tools { margin-left: 0; }
    .hf-search { flex: 1 1 12.5rem; min-width: 0; }
    .hf-search .form-control { width: 100%; }
    .hf-header .navbar-toggler { display: none; }
}

@media (min-width: 1400px) {
    .hf-search { flex-basis: 14rem; }
}

@media (max-width: 1199.98px) {
    .hf-header .navbar-collapse {
        padding: var(--hf-space-3) 0 var(--hf-space-4);
    }
    .hf-header .navbar-nav { gap: 0.125rem; }
    .hf-header .navbar-nav .nav-link {
        padding: 0.7rem 0.9rem;
        font-size: var(--hf-text-md);
        border-radius: var(--hf-radius-sm);
    }
    .hf-search { margin-top: var(--hf-space-3); }
    .hf-search .form-control { width: 100%; min-height: var(--hf-control-h); font-size: var(--hf-text-md); }
    .hf-header .dropdown-menu {
        border: 0;
        box-shadow: none;
        background: var(--hf-surface-2);
        margin: 0.25rem 0 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .hf-toggler-label { display: none; }
    .hf-header .navbar-toggler { width: 2.5rem; justify-content: center; padding: 0; }
    .hf-brand { gap: 0.45rem; }
    .hf-brand__mark { width: 2rem; height: 2rem; font-size: 0.9rem; }
    .hf-brand__name { font-size: 1.4rem; }
    .hf-header__row { gap: 0 0.5rem; }
    .hf-header__tools { gap: 0.375rem; }
    .hf-theme-opt { width: 2rem; height: 2rem; }
}

@media (max-width: 374.98px) {
    .hf-brand__mark { display: none; }
    .hf-brand__name { font-size: 1.25rem; }
    .hf-header .navbar-toggler { width: 2.25rem; min-height: 2.25rem; }
}

/* Zodiac Signs menu: two columns so twelve signs do not run off screen. */
.hf-sign-menu { min-width: 20rem; padding: 0.5rem; }

.hf-sign-menu__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.125rem;
}

.hf-sign-menu .dropdown-item { border-radius: var(--hf-radius-sm); }

.hf-sign-menu__glyph {
    display: inline-block;
    width: 1.5rem;
    color: var(--hf-link);
    font-size: 1.05rem;
}

.hf-sign-menu .dropdown-item:active .hf-sign-menu__glyph,
.hf-sign-menu .dropdown-item.active .hf-sign-menu__glyph { color: inherit; }

/* ------------------------------------------------------------------ */
/* 5. Page bands                                                       */
/* ------------------------------------------------------------------ */

/* Shared hero/masthead panel: contained, rounded, softly luminous. */
.hf-hero__panel,
section.bg-gradient-primary > .container::before {
    background: var(--hf-hero-bg);
    border: 1px solid var(--hf-hero-border);
    border-radius: var(--hf-radius-lg);
}

.hf-hero__panel > :not(.hf-ambient) { position: relative; z-index: 1; }

.hf-hero__panel {
    position: relative;
    overflow: hidden;
    color: var(--hf-hero-ink);
}

/* Masthead: the panel is painted inside the container's gutters so its
   edges line up with the content column below. */
section.bg-gradient-primary > .container {
    --hf-panel-inset: calc(var(--bs-gutter-x) * 0.5);
    position: relative;
    color: var(--hf-hero-ink);
}

section.bg-gradient-primary > .container::before {
    content: "";
    position: absolute;
    inset: 0 var(--hf-panel-inset);
    z-index: 0;
    pointer-events: none;
}

/* Interior page mastheads (all templates use section.bg-gradient-primary) */
section.bg-gradient-primary,
section.hero-section {
    background: transparent !important;
    color: var(--hf-hero-ink) !important;
    padding: var(--hf-space-2) 0 var(--hf-space-5) !important;
}

section.bg-gradient-primary > .container {
    padding: clamp(1.75rem, 1rem + 3vw, 3.25rem) calc(var(--hf-panel-inset) + clamp(1.25rem, 0.75rem + 3vw, 3.5rem));
}

/* Decorative constellation on the free right side of text-only mastheads. */
section.bg-gradient-primary > .container::after {
    content: "";
    position: absolute;
    top: 50%;
    right: calc(var(--hf-panel-inset) + clamp(1rem, 4vw, 4rem));
    width: min(30%, 360px);
    aspect-ratio: 5 / 3;
    transform: translateY(-50%);
    background: var(--hf-hero-art);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 240'%3E%3Cpolyline points='40,180 120,118 196,140 270,62 352,100' fill='none' stroke='%23000' stroke-opacity='.45' stroke-width='1.5' stroke-dasharray='2 6' stroke-linecap='round'/%3E%3Cpath d='M40 166q2 12 14 14q-12 2-14 14q-2-12-14-14q12-2 14-14z'/%3E%3Cpath d='M120 100q3 15 18 18q-15 3-18 18q-3-15-18-18q15-3 18-18z'/%3E%3Cpath d='M196 128q2 10 12 12q-10 2-12 12q-2-10-12-12q10-2 12-12z'/%3E%3Cpath d='M270 40q4 18 22 22q-18 4-22 22q-4-18-22-22q18-4 22-22z'/%3E%3Cpath d='M352 88q2 10 12 12q-10 2-12 12q-2-10-12-12q10-2 12-12z'/%3E%3Ccircle cx='80' cy='60' r='2.5' fill-opacity='.6'/%3E%3Ccircle cx='230' cy='200' r='2' fill-opacity='.5'/%3E%3Ccircle cx='330' cy='190' r='3' fill-opacity='.6'/%3E%3Ccircle cx='160' cy='40' r='2' fill-opacity='.5'/%3E%3Ccircle cx='380' cy='30' r='2' fill-opacity='.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 240'%3E%3Cpolyline points='40,180 120,118 196,140 270,62 352,100' fill='none' stroke='%23000' stroke-opacity='.45' stroke-width='1.5' stroke-dasharray='2 6' stroke-linecap='round'/%3E%3Cpath d='M40 166q2 12 14 14q-12 2-14 14q-2-12-14-14q12-2 14-14z'/%3E%3Cpath d='M120 100q3 15 18 18q-15 3-18 18q-3-15-18-18q15-3 18-18z'/%3E%3Cpath d='M196 128q2 10 12 12q-10 2-12 12q-2-10-12-12q10-2 12-12z'/%3E%3Cpath d='M270 40q4 18 22 22q-18 4-22 22q-4-18-22-22q18-4 22-22z'/%3E%3Cpath d='M352 88q2 10 12 12q-10 2-12 12q-2-10-12-12q10-2 12-12z'/%3E%3Ccircle cx='80' cy='60' r='2.5' fill-opacity='.6'/%3E%3Ccircle cx='230' cy='200' r='2' fill-opacity='.5'/%3E%3Ccircle cx='330' cy='190' r='3' fill-opacity='.6'/%3E%3Ccircle cx='160' cy='40' r='2' fill-opacity='.5'/%3E%3Ccircle cx='380' cy='30' r='2' fill-opacity='.5'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.55;
    pointer-events: none;
}

/* Pages with their own sign artwork, and narrow screens where the art would
   sit behind the title, do not get the decorative constellation. */
section.bg-gradient-primary > .container:has(.hero-graphic)::after { display: none; }

@media (max-width: 991.98px) {
    section.bg-gradient-primary > .container::after { display: none; }
}

section.bg-gradient-primary > .container > .row { position: relative; z-index: 1; }

.bg-gradient-primary h1,
.bg-gradient-primary h2,
.bg-gradient-primary h3,
.hf-hero h1 {
    color: var(--hf-hero-ink) !important;
}

.bg-gradient-primary h1 {
    overflow-wrap: break-word;
    font-size: var(--hf-title-xl);
    margin-bottom: var(--hf-space-2);
}

.bg-gradient-primary p,
.bg-gradient-primary .lead,
.bg-gradient-primary small,
.bg-gradient-primary .opacity-75,
.hf-hero p {
    color: var(--hf-hero-muted) !important;
    opacity: 1 !important;
}

.bg-gradient-primary .lead { font-size: var(--hf-text-lg); max-width: var(--hf-measure); margin-top: var(--hf-space-2); }

.bg-gradient-primary.text-white,
.bg-gradient-primary .text-white { color: var(--hf-hero-ink) !important; }

/* Title icon next to the page title: a soft disc instead of a tiny glyph */
.bg-gradient-primary .d-flex > i.display-6 {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 3.25rem;
    height: 3.25rem;
    margin-top: 0.35rem !important;
    border-radius: 50%;
    background: var(--hf-hero-art-soft);
    color: var(--hf-hero-art);
    font-size: 1.375rem;
}

@media (max-width: 575.98px) {
    .bg-gradient-primary .d-flex > i.display-6 { display: none; }
}

.bg-gradient-primary .d-flex.mb-3,
.bg-gradient-primary .d-flex.mb-4 { margin-bottom: 0 !important; }

/* Home hero */
.hf-hero { padding-top: var(--hf-space-3); }

.hf-hero__panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: var(--hf-space-6);
    padding: clamp(2rem, 1rem + 4vw, 4.25rem) clamp(1.25rem, 0.5rem + 4vw, 4.25rem);
}

@media (min-width: 992px) {
    .hf-hero__panel { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); }
}

.hf-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 var(--hf-space-3);
    font-size: var(--hf-text-xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--hf-link);
}

.hf-hero .hf-eyebrow { color: var(--hf-hero-muted) !important; }
.hf-eyebrow i { color: var(--hf-hero-star); }

.hf-hero h1 {
    font-size: clamp(2.6rem, 1.6rem + 3.6vw, 4.25rem);
    line-height: 1;
    margin-bottom: var(--hf-space-4);
}

.hf-hero .lead { max-width: 36rem; margin-bottom: var(--hf-space-5); }

.hf-hero__actions { display: flex; flex-wrap: wrap; gap: var(--hf-space-3); }

.hf-hero__art {
    justify-self: center;
    width: min(100%, 22rem);
    color: var(--hf-hero-art);
}

.hf-hero__art svg { display: block; width: 100%; height: auto; }
.hf-hero__art .hf-art-ring { fill: none; stroke: currentColor; stroke-opacity: 0.35; }
.hf-hero__art .hf-art-ring--dash { stroke-dasharray: 2 7; stroke-linecap: round; stroke-opacity: 0.55; }
.hf-hero__art .hf-art-tick { stroke: currentColor; stroke-opacity: 0.45; }
.hf-hero__art .hf-art-disc { fill: var(--hf-hero-art-soft); }
.hf-hero__art .hf-art-moon { fill: currentColor; }
.hf-hero__art .hf-art-star { fill: var(--hf-hero-star); }
.hf-hero__art .hf-art-dot { fill: currentColor; fill-opacity: 0.6; }

@media (max-width: 991.98px) {
    .hf-hero__art { width: min(60%, 14rem); justify-self: start; order: -1; }
}

@media (max-width: 575.98px) {
    .hf-hero__art { display: none; }
}

/* Breadcrumb: quiet text on the canvas, directly above the masthead */
#breadcrumb,
#breadcrumb.bg-light {
    background: transparent !important;
    padding-top: var(--hf-space-4) !important;
    padding-bottom: var(--hf-space-2) !important;
    border: 0 !important;
    font-size: var(--hf-text-sm);
}

.breadcrumb {
    --bs-breadcrumb-divider-color: var(--hf-ink-muted);
    --bs-breadcrumb-item-active-color: var(--hf-ink-muted);
    flex-wrap: wrap;
    gap: 0.375rem 0.65rem;
    align-items: start;
}

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

.breadcrumb-item a:hover {
    color: var(--hf-link-hover);
    text-decoration: underline !important;
}

.breadcrumb-item.active { color: var(--hf-ink-muted); }

/* Each separator belongs to its following list item. A separate grid column
   keeps it beside the first text line when a long label wraps. Empty CSS
   geometry has no spoken glyph; the ordered-list semantics stay intact. */
.breadcrumb-item {
    min-width: 0;
    max-width: 100%;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.breadcrumb-item + .breadcrumb-item {
    display: grid;
    grid-template-columns: 0.5rem minmax(0, 1fr);
    column-gap: 0.65rem;
    padding-left: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "";
    float: none;
    display: block;
    box-sizing: border-box;
    width: 0.4rem;
    height: 0.4rem;
    padding: 0;
    margin-top: calc((1.5em - 0.4rem) / 2);
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    color: var(--hf-ink-muted);
    transform: rotate(45deg);
}

/* Sections: one vertical rhythm; alternate bands use the deeper canvas */
main > section.py-5:not(.bg-gradient-primary) { padding-top: var(--hf-section-y) !important; padding-bottom: var(--hf-section-y) !important; }

/* Content directly under a masthead starts closer to it. */
main > section.bg-gradient-primary + section.py-5:not(.bg-light),
main > section.bg-gradient-primary + section.py-4:not(.bg-light) { padding-top: var(--hf-space-3) !important; }

section.bg-light:not(#breadcrumb) {
    border-top: 1px solid var(--hf-border);
    border-bottom: 1px solid var(--hf-border);
}

/* Bands that close a page (Explore More, related links) sit before the footer */
main > section.bg-light:last-child { border-bottom: 0; }

.hf-section-title {
    color: var(--hf-heading);
    margin-bottom: var(--hf-space-2);
}

.hf-section-subtitle {
    color: var(--hf-ink-muted) !important;
    font-size: var(--hf-text-md);
    margin-bottom: var(--hf-space-5);
}

.hf-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: var(--hf-space-2) var(--hf-space-5);
    margin-bottom: var(--hf-space-5);
}

.hf-section-head .hf-section-title,
.hf-section-head .hf-section-subtitle { margin-bottom: 0; }

/* ------------------------------------------------------------------ */
/* 6. Components                                                       */
/* ------------------------------------------------------------------ */

/* Cards: flat surface, 1px border, one radius, one padding scale. */
.card {
    --bs-card-bg: var(--hf-surface);
    --bs-card-color: var(--hf-ink);
    --bs-card-title-color: var(--hf-heading);
    --bs-card-border-color: var(--hf-border);
    --bs-card-border-radius: var(--hf-radius-md);
    --bs-card-inner-border-radius: calc(var(--hf-radius-md) - 1px);
    --bs-card-cap-bg: var(--hf-surface-head);
    --bs-card-cap-color: var(--hf-heading);
    --bs-card-spacer-x: var(--hf-card-pad);
    --bs-card-spacer-y: var(--hf-card-pad);
    --bs-card-cap-padding-x: var(--hf-card-pad);
    --bs-card-cap-padding-y: var(--hf-space-4);
    background-color: var(--hf-surface);
    color: var(--hf-ink);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    box-shadow: var(--hf-shadow-1);
}

.card.border-0 { border: 1px solid var(--hf-border) !important; }
.card.bg-light { background-color: var(--hf-surface) !important; box-shadow: none !important; }
.card-body.p-4,
.card-body.p-3 { padding: var(--hf-card-pad) !important; }

.card-header {
    background: var(--hf-surface-head) !important;
    color: var(--hf-heading) !important;
    border-bottom: 1px solid var(--hf-border) !important;
    border-radius: calc(var(--hf-radius-md) - 1px) calc(var(--hf-radius-md) - 1px) 0 0 !important;
    padding: var(--hf-space-4) var(--hf-card-pad) !important;
}

/* One title treatment for every card header (reading and utility cards). */
.card-header h1, .card-header h2, .card-header h3,
.card-header h4, .card-header h5, .card-header h6,
.card-header .card-title {
    font-family: var(--hf-font-display);
    font-size: var(--hf-title-sm);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
    color: var(--hf-heading) !important;
    margin-bottom: 0;
}

.card-header a,
.card-header .text-white { color: var(--hf-heading) !important; }

.card-header .opacity-75,
.card-header small,
.card-header time {
    opacity: 1 !important;
    color: var(--hf-ink-muted) !important;
    font-family: var(--hf-font-body);
    font-size: var(--hf-text-sm);
}

.card-header i,
.card-title > i { color: var(--hf-link); font-size: 0.8em; }

.card-title { color: var(--hf-heading); line-height: 1.15; }
.card-body > .card-title,
.card-body > h3.card-title { font-size: var(--hf-title-sm); }

.card-footer {
    background: transparent !important;
    border-top: 0 !important;
    padding: 0 var(--hf-card-pad) var(--hf-card-pad) !important;
}

.card-text,
.card-title,
.mood-value { overflow-wrap: anywhere; }

/* Horoscope preview card (includes/horoscope_card.html) */
.horoscope-card { position: relative; overflow: visible; }

.horoscope-card .card-header { padding-top: var(--hf-space-4) !important; padding-bottom: var(--hf-space-4) !important; }

.hf-card-head {
    display: flex;
    align-items: center;
    gap: var(--hf-space-3);
    min-width: 0;
}

.hf-card-head__text { min-width: 0; }

.horoscope-card .card-header .card-title { font-size: 1.5rem; }

/* Sign name links to the sign page; underline only on hover/focus. */
.hf-card-title-link {
    color: inherit !important;
    text-decoration: none;
}

.hf-card-title-link:hover,
.hf-card-title-link:focus-visible {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

.hf-card-sub {
    display: block;
    margin-top: 0.15rem;
    font-family: var(--hf-font-body);
    font-size: var(--hf-text-sm) !important;
    font-weight: 500;
    line-height: 1.35;
    color: var(--hf-ink-muted) !important;
}

.hf-card-sub__sep { margin: 0 0.35em; color: var(--hf-border-strong); }

.horoscope-card .card-body { padding: var(--hf-card-pad); }

/* Reading text. Previews are whole-sentence excerpts at natural height (no
   clamping). Containers set the measure, so text fills its card instead of
   leaving a narrow strip inside a wide card. */
.horoscope-card .card-text,
.hf-excerpt,
.hf-reading {
    font-size: var(--hf-text-md);
    line-height: var(--hf-leading-body);
    text-wrap: pretty;
    color: var(--hf-ink);
}

.hf-excerpt { margin-bottom: var(--hf-space-4); }

.hf-reading > p { margin: 0 0 1em; }
.hf-reading > p:last-child { margin-bottom: 0; }

/* Full readings: one size up, generous leading. */
.hf-reading,
.horoscope-card .card-text.hf-reading {
    font-size: var(--hf-text-lg);
    line-height: 1.7;
    max-width: none;
}

.hf-reading > p:first-child::first-letter {
    font-family: var(--hf-font-display);
    font-weight: 700;
    font-size: 3.35em;
    float: left;
    line-height: 0.8;
    margin: 0.08em 0.1em 0 0;
    color: var(--hf-link);
}

/* Zodiac glyph disc */
.zodiac-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.4rem !important;
    line-height: 1;
    color: var(--hf-link) !important;
    -webkit-text-fill-color: currentColor;
    background: var(--hf-surface);
    border: 1px solid var(--hf-border);
    border-radius: 50%;
}

.zodiac-symbol-large {
    font-size: 2rem;
    line-height: 1;
    color: var(--hf-link);
}

/* Static content cards */
.hf-content-card .card-body > p:last-child { margin-bottom: 0; }
.hf-prose { max-width: var(--hf-measure); }

article.card .card-body > h2,
article.card .card-body > h3 { margin-top: var(--hf-space-5); }
article.card .card-body > h2:first-child,
article.card .card-body > h3:first-child { margin-top: 0; }
/* Prose stays at a comfortable measure; discrete cards use the full container. */
.hf-prose-column {
    max-width: calc(var(--hf-reading-width) + var(--bs-gutter-x));
    margin-inline: auto;
}

.hf-page-wide { width: 100%; min-width: 0; }
.hf-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--hf-gutter);
}
.hf-card-grid > * { min-width: 0; margin-bottom: 0 !important; }
.hf-step-list { padding: 0; margin: 0; list-style: none; }
.hf-step-list > li { display: flex; }
.hf-step-list .card { width: 100%; }
.hf-with-toc { min-width: 0; }
.hf-with-toc .hf-prose-column { width: 100%; }
.hf-with-toc h2[id] { scroll-margin-top: 7rem; }
.hf-section-nav { display: none; }

@media (min-width: 768px) {
    .hf-card-grid--terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
    .hf-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hf-with-toc {
        display: grid;
        grid-template-columns: minmax(14rem, 1fr) minmax(0, var(--hf-reading-width));
        gap: var(--hf-gutter);
        align-items: start;
    }
    .hf-with-toc .hf-prose-column { max-width: none; margin: 0; min-width: 0; }
    .hf-section-nav {
        display: block;
        position: sticky;
        top: 6rem;
        max-height: calc(100dvh - 7rem);
        overflow-y: auto;
        /* Leave room for the existing focus ring inside the scroll area. */
        padding: var(--hf-space-2);
        margin: calc(-1 * var(--hf-space-2));
    }
    .hf-section-nav li + li { margin-top: var(--hf-space-3); }
    .hf-section-nav a { display: inline-block; overflow-wrap: anywhere; }
}
@media (min-width: 1200px) {
    .hf-card-grid--terms { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Links inside cards are underlined (not colour alone). */
.card a:not(.btn):not(.linked-card):not(.hf-card-title-link):not(.dropdown-item):not(.page-link),
.linked-card h5 {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.linked-card {
    display: block;
    height: 100%;
    color: var(--hf-ink);
    text-decoration: none;
}

.linked-card:hover { color: var(--hf-ink); }
.linked-card .card { transition: var(--hf-transition); }

.linked-card:hover .card,
.linked-card:focus-visible .card {
    border-color: var(--hf-accent) !important;
}

/* Buttons: pill controls, colour change only on hover. */
.btn {
    --bs-btn-font-family: var(--hf-font-body);
    --bs-btn-font-weight: 600;
    --bs-btn-font-size: var(--hf-text-sm);
    --bs-btn-padding-y: 0.55rem;
    --bs-btn-padding-x: 1.15rem;
    --bs-btn-border-radius: var(--hf-radius-pill);
    --bs-btn-border-width: 1px;
    --bs-btn-focus-box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    border-radius: var(--hf-radius-pill);
    transition: var(--hf-transition);
}

.btn i { line-height: 1; }
.btn > i.me-1, .btn > i.me-2, .btn > i.me-3, .btn > i.ms-2 { margin: 0 !important; }

.btn-sm {
    --bs-btn-padding-y: 0.35rem;
    --bs-btn-padding-x: 0.85rem;
    --bs-btn-font-size: var(--hf-text-sm);
    --bs-btn-border-radius: var(--hf-radius-pill);
    min-height: 2.25rem;
}

.btn-lg {
    --bs-btn-padding-y: 0.75rem;
    --bs-btn-padding-x: 1.5rem;
    --bs-btn-font-size: var(--hf-text-md);
    --bs-btn-border-radius: var(--hf-radius-pill);
    min-height: 3rem;
}

.btn-primary {
    --bs-btn-color: var(--hf-on-accent);
    --bs-btn-bg: var(--hf-accent);
    --bs-btn-border-color: var(--hf-accent);
    --bs-btn-hover-color: var(--hf-on-accent);
    --bs-btn-hover-bg: var(--hf-accent-hover);
    --bs-btn-hover-border-color: var(--hf-accent-hover);
    --bs-btn-active-color: var(--hf-on-accent);
    --bs-btn-active-bg: var(--hf-accent-hover);
    --bs-btn-active-border-color: var(--hf-accent-hover);
    --bs-btn-disabled-color: var(--hf-on-accent);
    --bs-btn-disabled-bg: var(--hf-accent);
    --bs-btn-disabled-border-color: var(--hf-accent);
}

.btn-outline-primary {
    --bs-btn-color: var(--hf-link);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--hf-accent);
    --bs-btn-hover-color: var(--hf-accent-ink);
    --bs-btn-hover-bg: var(--hf-accent-soft);
    --bs-btn-hover-border-color: var(--hf-accent);
    --bs-btn-active-color: var(--hf-on-accent);
    --bs-btn-active-bg: var(--hf-accent);
    --bs-btn-active-border-color: var(--hf-accent);
    --bs-btn-disabled-color: var(--hf-ink-muted);
    --bs-btn-disabled-border-color: var(--hf-border-strong);
}

.btn-outline-primary.active,
.btn-outline-primary[aria-current="page"] {
    background: var(--hf-accent);
    border-color: var(--hf-accent);
    color: var(--hf-on-accent);
}

.btn-outline-secondary {
    --bs-btn-color: var(--hf-ink);
    --bs-btn-border-color: var(--hf-border-strong);
    --bs-btn-hover-color: var(--hf-ink);
    --bs-btn-hover-bg: var(--hf-surface-2);
    --bs-btn-hover-border-color: var(--hf-ink-muted);
    --bs-btn-active-color: var(--hf-ink);
    --bs-btn-active-bg: var(--hf-surface-2);
    --bs-btn-active-border-color: var(--hf-ink-muted);
    --bs-btn-disabled-color: var(--hf-ink-muted);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--hf-border);
}

.btn.disabled,
.btn:disabled { opacity: 1; }

.btn-outline-secondary.disabled,
.btn-outline-secondary:disabled { color: var(--hf-ink-muted); border-style: dashed; }

/* Secondary buttons on hero/masthead panels */
.btn-light {
    --bs-btn-color: var(--hf-accent-ink);
    --bs-btn-bg: var(--hf-surface);
    --bs-btn-border-color: var(--hf-border);
    --bs-btn-hover-color: var(--hf-accent-ink);
    --bs-btn-hover-bg: var(--hf-accent-soft);
    --bs-btn-hover-border-color: var(--hf-accent);
    --bs-btn-active-color: var(--hf-accent-ink);
    --bs-btn-active-bg: var(--hf-accent-soft-strong);
    --bs-btn-active-border-color: var(--hf-accent);
}

.btn-outline-light {
    --bs-btn-color: var(--hf-hero-ink);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--hf-hero-ink);
    --bs-btn-hover-color: var(--hf-hero-ink);
    --bs-btn-hover-bg: var(--hf-hero-art-soft);
    --bs-btn-hover-border-color: var(--hf-hero-ink);
    --bs-btn-active-color: var(--hf-hero-ink);
    --bs-btn-active-bg: var(--hf-hero-art-soft);
    --bs-btn-active-border-color: var(--hf-hero-ink);
}

.btn-success {
    --bs-btn-color: var(--hf-status-excellent-fg);
    --bs-btn-bg: var(--hf-status-excellent-bg);
    --bs-btn-border-color: var(--hf-status-excellent-fg);
    --bs-btn-hover-color: var(--hf-status-excellent-fg);
    --bs-btn-hover-bg: var(--hf-status-excellent-bg);
    --bs-btn-hover-border-color: var(--hf-status-excellent-fg);
}

.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-top-left-radius: var(--hf-radius-pill); border-bottom-left-radius: var(--hf-radius-pill); }
.btn-group > .btn:last-child { border-top-right-radius: var(--hf-radius-pill); border-bottom-right-radius: var(--hf-radius-pill); }

/* Explore-more groups: separate pills that wrap instead of a joined bar */
.btn-group.hf-stack-sm {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--hf-space-2);
}

.btn-group.hf-stack-sm > .btn {
    flex: 0 1 auto;
    border-radius: var(--hf-radius-pill) !important;
    margin-left: 0 !important;
}

@media (max-width: 575.98px) {
    .btn-group.hf-stack-sm { flex-direction: column; width: 100%; }
}

/* Sign chips (legacy quick nav) */
.zodiac-btn { border-radius: var(--hf-radius-pill); }

/* Badges and chips: soft tint with strong text */
.badge {
    --bs-badge-font-size: var(--hf-text-xs);
    --bs-badge-font-weight: 650;
    --bs-badge-padding-x: 0.7rem;
    --bs-badge-padding-y: 0.35rem;
    border-radius: var(--hf-radius-pill);
    letter-spacing: 0.01em;
}

.badge.bg-gradient-primary,
.hf-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--hf-accent-soft) !important;
    color: var(--hf-accent-ink) !important;
    font-family: var(--hf-font-body);
    font-size: var(--hf-text-xs);
    font-weight: 650;
    line-height: 1.2;
    padding: 0.35rem 0.75rem;
    border-radius: var(--hf-radius-pill);
    white-space: nowrap;
}

.hf-chip i { color: inherit; font-size: 0.9em; }

.hf-chip--soft {
    background: var(--hf-surface-2) !important;
    color: var(--hf-ink) !important;
    border: 1px solid var(--hf-border);
}

.hf-chip--neutral {
    background: var(--hf-status-self-bg) !important;
    color: var(--hf-status-self-fg) !important;
}

/* Bootstrap light badges (how-to step numbers) */
.badge.bg-light {
    background: var(--hf-accent) !important;
    color: var(--hf-on-accent) !important;
}

/* Compatibility status chips: dark text on tint, the word is always shown. */
.hf-status {
    display: inline-block;
    min-width: 4rem;
    font-size: var(--hf-text-xs);
    font-weight: 650;
    line-height: 1.2;
    padding: 0.3rem 0.55rem;
    border-radius: var(--hf-radius-pill);
    text-align: center;
}

.hf-status--excellent { background: var(--hf-status-excellent-bg) !important; color: var(--hf-status-excellent-fg) !important; }
.hf-status--good { background: var(--hf-status-good-bg) !important; color: var(--hf-status-good-fg) !important; }
.hf-status--neutral { background: var(--hf-status-neutral-bg) !important; color: var(--hf-status-neutral-fg) !important; }
.hf-status--challenging { background: var(--hf-status-challenging-bg) !important; color: var(--hf-status-challenging-fg) !important; }
.hf-status--self { background: var(--hf-status-self-bg) !important; color: var(--hf-status-self-fg) !important; }

/* Legacy mood colour helpers */
.bg-excellent { background-color: var(--hf-status-excellent-bg) !important; color: var(--hf-status-excellent-fg) !important; }
.bg-good { background-color: var(--hf-status-good-bg) !important; color: var(--hf-status-good-fg) !important; }
.bg-average { background-color: var(--hf-status-neutral-bg) !important; color: var(--hf-status-neutral-fg) !important; }
.bg-challenging { background-color: var(--hf-status-challenging-bg) !important; color: var(--hf-status-challenging-fg) !important; }
.bg-transformative { background-color: var(--hf-accent-soft) !important; color: var(--hf-accent-ink) !important; }

/* Reading meta (mood, lucky colour, numbers): a compact definition grid. */
.hf-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
    gap: var(--hf-space-3) var(--hf-space-4);
    margin: auto 0 0;
    padding-top: var(--hf-space-4);
    border-top: 1px solid var(--hf-border);
}

.hf-meta__item { min-width: 0; }

.hf-meta dt {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--hf-text-xs);
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hf-ink-muted);
    margin: 0;
}

.hf-meta dt i { color: var(--hf-link); font-size: 0.95em; }

.hf-meta dd {
    font-size: var(--hf-text-sm);
    font-weight: 600;
    color: var(--hf-ink);
    margin: 0.15rem 0 0;
    overflow-wrap: anywhere;
}

.hf-meta--lg dd { font-size: var(--hf-text-md); }

/* Stacked meta in sidebars */
.hf-meta--stack {
    grid-template-columns: minmax(0, 1fr);
    border-top: 0;
    padding-top: 0;
}

/* Callouts (advice, notes, search summaries) */
.alert {
    --bs-alert-border-radius: var(--hf-radius-md);
    --bs-alert-padding-x: var(--hf-space-5);
    --bs-alert-padding-y: var(--hf-space-4);
}

.alert-info,
.hf-callout {
    --bs-alert-bg: var(--hf-accent-soft);
    --bs-alert-color: var(--hf-ink);
    --bs-alert-border-color: var(--hf-border);
    background-color: var(--hf-accent-soft);
    color: var(--hf-ink);
    border: 1px solid var(--hf-border);
    border-left: 4px solid var(--hf-accent);
    border-radius: var(--hf-radius-md);
}

.alert-info strong { color: var(--hf-heading); }

.alert-info .alert-heading,
.hf-callout .alert-heading {
    color: var(--hf-accent-ink);
    font-family: var(--hf-font-body);
    font-size: var(--hf-text-sm);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: var(--hf-space-2);
}

.alert-info .alert-heading i,
.alert-info > i { color: var(--hf-link); }

.alert-warning {
    --bs-alert-bg: var(--hf-status-neutral-bg);
    --bs-alert-color: var(--hf-status-neutral-fg);
    --bs-alert-border-color: var(--hf-status-neutral-fg);
    border-left: 4px solid var(--hf-status-neutral-fg);
}

/* Notifications created by script.js use the same status palette. */
.alert-success {
    --bs-alert-bg: var(--hf-status-excellent-bg);
    --bs-alert-color: var(--hf-status-excellent-fg);
    --bs-alert-border-color: var(--hf-status-excellent-fg);
}

.alert-danger {
    --bs-alert-bg: var(--hf-status-challenging-bg);
    --bs-alert-color: var(--hf-status-challenging-fg);
    --bs-alert-border-color: var(--hf-status-challenging-fg);
}

/* Validation */
.invalid-feedback { color: var(--hf-status-challenging-fg); }
.form-control.is-invalid,
.was-validated .form-control:invalid { border-color: var(--hf-status-challenging-fg); }

/* Pagination */
.pagination {
    --bs-pagination-color: var(--hf-link);
    --bs-pagination-bg: var(--hf-surface);
    --bs-pagination-border-color: var(--hf-border);
    --bs-pagination-hover-color: var(--hf-accent-ink);
    --bs-pagination-hover-bg: var(--hf-accent-soft);
    --bs-pagination-hover-border-color: var(--hf-accent);
    --bs-pagination-focus-color: var(--hf-accent-ink);
    --bs-pagination-focus-bg: var(--hf-accent-soft);
    --bs-pagination-focus-box-shadow: none;
    --bs-pagination-active-color: var(--hf-on-accent);
    --bs-pagination-active-bg: var(--hf-accent);
    --bs-pagination-active-border-color: var(--hf-accent);
    --bs-pagination-disabled-color: var(--hf-ink-muted);
    --bs-pagination-disabled-bg: var(--hf-surface-2);
    --bs-pagination-disabled-border-color: var(--hf-border);
    --bs-pagination-padding-x: 0.9rem;
    --bs-pagination-padding-y: 0.5rem;
    --bs-pagination-font-size: var(--hf-text-sm);
    flex-wrap: wrap;
    gap: var(--hf-space-2);
}

.pagination .page-link {
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hf-radius-pill) !important;
    margin: 0;
    font-weight: 600;
    transition: var(--hf-transition);
}

.pagination .page-item .page-link { margin-left: 0; }

/* Forms */
.form-control,
.form-select {
    min-height: var(--hf-control-h);
    background-color: var(--hf-control-bg);
    color: var(--hf-ink);
    border: 1px solid var(--hf-border-strong);
    border-radius: var(--hf-radius-sm);
    font-size: var(--hf-text-md);
}

.form-control-sm { min-height: 2.5rem; font-size: var(--hf-text-sm); }

.form-control::placeholder { color: var(--hf-ink-muted); opacity: 1; }

.form-control:disabled,
.form-select:disabled {
    color: var(--hf-ink-muted);
    background-color: var(--hf-surface-2);
    border-style: dashed;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--hf-control-bg);
    color: var(--hf-ink);
    border-color: var(--hf-accent);
    box-shadow: 0 0 0 3px var(--hf-focus-soft);
}

/* Chromium moves keyboard focus to the calendar button inside date fields;
   the input itself then loses :focus, so show the ring from :focus-within. */
input.form-control:focus-within:not(:focus) {
    border-color: var(--hf-accent);
    outline: 3px solid var(--hf-focus-outline);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px var(--hf-focus-halo);
}

.form-label {
    color: var(--hf-heading);
    font-size: var(--hf-text-sm);
    font-weight: 650;
    margin-bottom: 0.35rem;
}

/* Select arrow follows the resolved theme (also for the no-JS OS fallback). */
:root[data-theme="dark"] .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e3daff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

:root[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .form-select {
        --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e3daff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    }
    :root:not([data-theme]) .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
}

/* Filter panel (All Horoscopes) */
.hf-filter-section .form-label { font-size: var(--hf-text-sm); }

/* Search suggestions (static/js/script.js) */
.search-form { position: relative; }

.search-suggestions {
    background: var(--hf-surface-elevated);
    color: var(--hf-ink);
    border: 1px solid var(--hf-border) !important;
    border-radius: var(--hf-radius-sm);
    box-shadow: var(--hf-shadow-2) !important;
    margin-top: 0.25rem;
}

.search-suggestions > div { border-bottom: 1px solid var(--hf-border) !important; padding: 0.6rem 0.9rem !important; }
.search-suggestions > div:last-child { border-bottom: 0 !important; }
.search-suggestions > div:hover { background: var(--hf-accent-soft); color: var(--hf-accent-ink); }

/* Dropdowns (overlays may use elevation) */
.dropdown-menu {
    --bs-dropdown-bg: var(--hf-surface-elevated);
    --bs-dropdown-color: var(--hf-ink);
    --bs-dropdown-border-color: var(--hf-border);
    --bs-dropdown-border-radius: var(--hf-radius-md);
    --bs-dropdown-inner-border-radius: calc(var(--hf-radius-md) - 1px);
    --bs-dropdown-link-color: var(--hf-ink);
    --bs-dropdown-link-hover-color: var(--hf-accent-ink);
    --bs-dropdown-link-hover-bg: var(--hf-accent-soft);
    --bs-dropdown-link-active-color: var(--hf-on-accent);
    --bs-dropdown-link-active-bg: var(--hf-accent);
    --bs-dropdown-divider-bg: var(--hf-border);
    --bs-dropdown-header-color: var(--hf-ink-muted);
    --bs-dropdown-font-size: var(--hf-text-sm);
    --bs-dropdown-item-padding-y: 0.5rem;
    --bs-dropdown-item-padding-x: 0.85rem;
    padding: 0.4rem;
    box-shadow: var(--hf-shadow-2);
}

.dropdown-item { border-radius: var(--hf-radius-sm); font-weight: 500; }
.dropdown-header { font-size: var(--hf-text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; }
.dropdown-item i { color: var(--hf-link); width: 1.1rem; }
.dropdown-item:active i,
.dropdown-item.active i { color: inherit; }

/* Overlay components */
.modal {
    --bs-modal-bg: var(--hf-surface-elevated);
    --bs-modal-color: var(--hf-ink);
    --bs-modal-border-color: var(--hf-border);
    --bs-modal-header-border-color: var(--hf-border);
    --bs-modal-footer-border-color: var(--hf-border);
    --bs-modal-border-radius: var(--hf-radius-lg);
}

.popover {
    --bs-popover-bg: var(--hf-surface-elevated);
    --bs-popover-body-color: var(--hf-ink);
    --bs-popover-border-color: var(--hf-border-strong);
    --bs-popover-header-bg: var(--hf-surface-head);
    --bs-popover-header-color: var(--hf-heading);
}

.tooltip {
    --bs-tooltip-bg: var(--hf-heading);
    --bs-tooltip-color: var(--hf-canvas);
}

/* Tables */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--hf-ink);
    --bs-table-border-color: var(--hf-border);
    --bs-table-hover-bg: transparent;
    --bs-table-hover-color: var(--hf-ink);
    --bs-table-striped-bg: var(--hf-surface-2);
    --bs-table-striped-color: var(--hf-ink);
}

.table-primary {
    --bs-table-color: var(--hf-heading);
    --bs-table-bg: var(--hf-surface-head);
    --bs-table-border-color: var(--hf-border);
}

.table-responsive {
    border-radius: var(--hf-radius-sm);
    -webkit-overflow-scrolling: touch;
}

/* Blockquote */
.blockquote-footer { color: var(--hf-ink-muted); }

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--hf-border);
    border-top-color: var(--hf-link);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty states */
.hf-empty i,
.card.bg-light .card-body > i { color: var(--hf-link) !important; }
.hf-empty h3 { color: var(--hf-heading); }
.hf-empty p { color: var(--hf-ink-muted); }

.card.bg-light .card-body.py-5 { padding-block: var(--hf-space-7) !important; }
.card.bg-light .card-body.py-5 > p { max-width: 36rem; margin-inline: auto; }

/* ------------------------------------------------------------------ */
/* 7. Layouts                                                          */
/* ------------------------------------------------------------------ */

/* Home: sign navigation as a grid of tiles */
.hf-sign-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--hf-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 576px) { .hf-sign-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .hf-sign-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .hf-sign-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.hf-sign-tile {
    display: flex;
    align-items: center;
    gap: var(--hf-space-3);
    height: 100%;
    min-height: 4.25rem;
    padding: 0.7rem 0.85rem;
    background: var(--hf-surface);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    color: var(--hf-ink);
    text-decoration: none;
    transition: var(--hf-transition);
}

.hf-sign-tile:hover {
    color: var(--hf-ink);
    border-color: var(--hf-accent);
    box-shadow: var(--hf-shadow-1);
}

.hf-sign-tile__glyph {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--hf-accent-soft);
    color: var(--hf-accent-ink);
    font-size: 1.25rem;
    line-height: 1;
}

.hf-sign-tile__text { min-width: 0; line-height: 1.2; }

.hf-sign-tile__name {
    display: block;
    font-family: var(--hf-font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--hf-heading);
}

.hf-sign-tile:hover .hf-sign-tile__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }

@media (max-width: 1399.98px) {
    .hf-sign-tile { gap: 0.5rem; padding: 0.6rem; }
    .hf-sign-tile__glyph { width: 2rem; height: 2rem; font-size: 1.05rem; }
    .hf-sign-tile__name { font-size: 1.15rem; }
}

@media (max-width: 374.98px) {
    .hf-sign-tile__glyph { display: none; }
}

.hf-sign-tile__dates {
    display: block;
    margin-top: 0.1rem;
    font-size: var(--hf-text-xs);
    color: var(--hf-ink-muted);
}

/* Reading layout: the reading column sets the measure and the aside sits
   beside it. The card is as wide as a comfortable line, so there is no
   narrow strip of text stranded inside a broad card. */
.hf-reading-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--hf-gutter);
    align-items: start;
}

@media (min-width: 992px) {
    .hf-reading-layout {
        /* Reading column capped at its measure; the aside takes the rest,
           so both edges line up with the masthead and the grids below. */
        grid-template-columns: minmax(0, var(--hf-reading-width)) minmax(var(--hf-aside-min), 1fr);
    }
}

.hf-reading-card .card-body { padding: clamp(1.25rem, 0.8rem + 1.6vw, 2.5rem); }

.hf-aside {
    display: grid;
    gap: var(--hf-gutter);
    min-width: 0;
}

@media (min-width: 992px) {
    .hf-aside--sticky { position: sticky; top: 5.5rem; }
}

.hf-aside .card-body { padding: var(--hf-space-5); }

.hf-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--hf-space-3) var(--hf-space-4);
    margin: 0 0 var(--hf-space-4);
}

.hf-facts dt {
    font-size: var(--hf-text-xs);
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hf-ink-muted);
}

.hf-facts dd { margin: 0.1rem 0 0; font-weight: 600; color: var(--hf-heading); }
.hf-facts__wide { grid-column: 1 / -1; }

.hf-note {
    font-size: var(--hf-text-sm);
    color: var(--hf-ink-muted);
    line-height: 1.6;
}

.hf-related { list-style: none; margin: 0; padding: 0; }

.hf-related li + li {
    border-top: 1px solid var(--hf-border);
    margin-top: var(--hf-space-4);
    padding-top: var(--hf-space-4);
}

.hf-related__title { display: block; font-weight: 650; margin-bottom: 0.25rem; }
.hf-related p { font-size: var(--hf-text-sm); color: var(--hf-ink-muted); margin: 0; }

.hf-share { margin-top: var(--hf-space-5); padding-top: var(--hf-space-4); border-top: 1px solid var(--hf-border); }
.hf-share h2 { font-family: var(--hf-font-body); font-size: var(--hf-text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hf-ink-muted); }

/* Sign page facts strip */
.hf-fact__label {
    font-family: var(--hf-font-body);
    font-size: var(--hf-text-xs) !important;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hf-ink-muted) !important;
}

/* Reading column (detail pages) */
.horoscope-content p { font-size: var(--hf-text-md); line-height: 1.7; }
.horoscope-content .lead,
.horoscope-content .lead p { font-size: var(--hf-text-lg); line-height: 1.75; }

/* Home features and call to action */
.feature-icon i {
    display: inline-grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--hf-accent-soft);
    color: var(--hf-link) !important;
    font-size: 1.4rem;
}

.hf-feature h3 { font-size: var(--hf-title-sm); }
.hf-feature p { max-width: 30ch; margin-inline: auto; }

.hf-cta {
    background: var(--hf-surface);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-lg);
    padding: clamp(1.5rem, 1rem + 2vw, 2.75rem) !important;
    box-shadow: var(--hf-shadow-1);
}

.hf-cta h2,
.hf-cta h3 { color: var(--hf-heading); }
.hf-cta p { color: var(--hf-ink-muted); }

/* ------------------------------------------------------------------ */
/* 8. Page features                                                    */
/* ------------------------------------------------------------------ */

.hero-graphic { position: relative; z-index: 2; }

/* Zodiac constellation medallion (sign and horoscope detail mastheads).
   Static except a gentle star twinkle; nothing floats, glows or pulses. */
.zodiac-constellation {
    position: relative;
    width: clamp(200px, 22vw, 280px);
    aspect-ratio: 1;
    height: auto;
    margin: 0 auto;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, var(--hf-hero-art-soft) 0%, transparent 70%);
    border: 1px solid var(--hf-hero-border);
    overflow: hidden;
}

.zodiac-constellation::before {
    content: "";
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 1px dashed var(--hf-hero-art);
    opacity: 0.4;
}

.constellation-bg {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zodiac-icon-large {
    position: relative;
    z-index: 3;
    font-size: clamp(4.5rem, 3rem + 3vw, 6.75rem);
    line-height: 1;
    color: var(--hf-hero-art);
}

.constellation-dots { position: absolute; inset: 0; z-index: 1; }

.dot {
    position: absolute;
    width: 5px;
    height: 5px;
    background: var(--hf-hero-star);
    border-radius: 50%;
    opacity: 0.85;
    animation: hf-twinkle 4s ease-in-out infinite;
}

.zodiac-element-icon {
    position: absolute;
    top: 13%;
    right: 13%;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--hf-surface);
    border: 1px solid var(--hf-hero-border);
    color: var(--hf-link);
    font-size: 1rem;
}

.zodiac-constellation[data-sign="aries"] .dot-1 { top: 20%; left: 30%; animation-delay: 0s; }
.zodiac-constellation[data-sign="aries"] .dot-2 { top: 15%; left: 50%; animation-delay: 0.2s; }
.zodiac-constellation[data-sign="aries"] .dot-3 { top: 25%; left: 70%; animation-delay: 0.4s; }
.zodiac-constellation[data-sign="aries"] .dot-4 { top: 40%; left: 25%; animation-delay: 0.6s; }
.zodiac-constellation[data-sign="aries"] .dot-5 { top: 60%; left: 75%; animation-delay: 0.8s; }
.zodiac-constellation[data-sign="aries"] .dot-6 { top: 75%; left: 45%; animation-delay: 1s; }
.zodiac-constellation[data-sign="aries"] .dot-7 { top: 80%; left: 65%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="aries"] .dot-8 { top: 85%; left: 35%; animation-delay: 1.4s; }

.zodiac-constellation[data-sign="taurus"] .dot-1 { top: 15%; left: 40%; animation-delay: 0s; }
.zodiac-constellation[data-sign="taurus"] .dot-2 { top: 20%; left: 60%; animation-delay: 0.3s; }
.zodiac-constellation[data-sign="taurus"] .dot-3 { top: 35%; left: 20%; animation-delay: 0.6s; }
.zodiac-constellation[data-sign="taurus"] .dot-4 { top: 35%; left: 80%; animation-delay: 0.9s; }
.zodiac-constellation[data-sign="taurus"] .dot-5 { top: 55%; left: 30%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="taurus"] .dot-6 { top: 55%; left: 70%; animation-delay: 1.5s; }
.zodiac-constellation[data-sign="taurus"] .dot-7 { top: 75%; left: 25%; animation-delay: 1.8s; }
.zodiac-constellation[data-sign="taurus"] .dot-8 { top: 75%; left: 75%; animation-delay: 2.1s; }

.zodiac-constellation[data-sign="gemini"] .dot-1 { top: 10%; left: 35%; animation-delay: 0s; }
.zodiac-constellation[data-sign="gemini"] .dot-2 { top: 10%; left: 65%; animation-delay: 0.1s; }
.zodiac-constellation[data-sign="gemini"] .dot-3 { top: 30%; left: 30%; animation-delay: 0.2s; }
.zodiac-constellation[data-sign="gemini"] .dot-4 { top: 30%; left: 70%; animation-delay: 0.3s; }
.zodiac-constellation[data-sign="gemini"] .dot-5 { top: 60%; left: 35%; animation-delay: 0.4s; }
.zodiac-constellation[data-sign="gemini"] .dot-6 { top: 60%; left: 65%; animation-delay: 0.5s; }
.zodiac-constellation[data-sign="gemini"] .dot-7 { top: 85%; left: 30%; animation-delay: 0.6s; }
.zodiac-constellation[data-sign="gemini"] .dot-8 { top: 85%; left: 70%; animation-delay: 0.7s; }

.zodiac-constellation[data-sign="cancer"] .dot-1 { top: 25%; left: 50%; animation-delay: 0s; }
.zodiac-constellation[data-sign="cancer"] .dot-2 { top: 35%; left: 30%; animation-delay: 0.4s; }
.zodiac-constellation[data-sign="cancer"] .dot-3 { top: 35%; left: 70%; animation-delay: 0.8s; }
.zodiac-constellation[data-sign="cancer"] .dot-4 { top: 50%; left: 20%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="cancer"] .dot-5 { top: 50%; left: 80%; animation-delay: 1.6s; }
.zodiac-constellation[data-sign="cancer"] .dot-6 { top: 70%; left: 35%; animation-delay: 2s; }
.zodiac-constellation[data-sign="cancer"] .dot-7 { top: 70%; left: 65%; animation-delay: 2.4s; }
.zodiac-constellation[data-sign="cancer"] .dot-8 { top: 85%; left: 50%; animation-delay: 2.8s; }

.zodiac-constellation[data-sign="leo"] .dot-1 { top: 15%; left: 50%; animation-delay: 0s; }
.zodiac-constellation[data-sign="leo"] .dot-2 { top: 25%; left: 30%; animation-delay: 0.2s; }
.zodiac-constellation[data-sign="leo"] .dot-3 { top: 25%; left: 70%; animation-delay: 0.4s; }
.zodiac-constellation[data-sign="leo"] .dot-4 { top: 45%; left: 25%; animation-delay: 0.6s; }
.zodiac-constellation[data-sign="leo"] .dot-5 { top: 45%; left: 75%; animation-delay: 0.8s; }
.zodiac-constellation[data-sign="leo"] .dot-6 { top: 65%; left: 40%; animation-delay: 1s; }
.zodiac-constellation[data-sign="leo"] .dot-7 { top: 65%; left: 60%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="leo"] .dot-8 { top: 80%; left: 50%; animation-delay: 1.4s; }

.zodiac-constellation[data-sign="virgo"] .dot-1 { top: 20%; left: 45%; animation-delay: 0s; }
.zodiac-constellation[data-sign="virgo"] .dot-2 { top: 35%; left: 25%; animation-delay: 0.3s; }
.zodiac-constellation[data-sign="virgo"] .dot-3 { top: 35%; left: 55%; animation-delay: 0.6s; }
.zodiac-constellation[data-sign="virgo"] .dot-4 { top: 50%; left: 35%; animation-delay: 0.9s; }
.zodiac-constellation[data-sign="virgo"] .dot-5 { top: 50%; left: 65%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="virgo"] .dot-6 { top: 65%; left: 45%; animation-delay: 1.5s; }
.zodiac-constellation[data-sign="virgo"] .dot-7 { top: 75%; left: 30%; animation-delay: 1.8s; }
.zodiac-constellation[data-sign="virgo"] .dot-8 { top: 80%; left: 60%; animation-delay: 2.1s; }

.zodiac-constellation[data-sign="libra"] .dot-1 { top: 25%; left: 30%; animation-delay: 0s; }
.zodiac-constellation[data-sign="libra"] .dot-2 { top: 25%; left: 70%; animation-delay: 0.2s; }
.zodiac-constellation[data-sign="libra"] .dot-3 { top: 40%; left: 20%; animation-delay: 0.4s; }
.zodiac-constellation[data-sign="libra"] .dot-4 { top: 40%; left: 50%; animation-delay: 0.6s; }
.zodiac-constellation[data-sign="libra"] .dot-5 { top: 40%; left: 80%; animation-delay: 0.8s; }
.zodiac-constellation[data-sign="libra"] .dot-6 { top: 65%; left: 35%; animation-delay: 1s; }
.zodiac-constellation[data-sign="libra"] .dot-7 { top: 65%; left: 65%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="libra"] .dot-8 { top: 80%; left: 50%; animation-delay: 1.4s; }

.zodiac-constellation[data-sign="scorpio"] .dot-1 { top: 15%; left: 20%; animation-delay: 0s; }
.zodiac-constellation[data-sign="scorpio"] .dot-2 { top: 25%; left: 40%; animation-delay: 0.3s; }
.zodiac-constellation[data-sign="scorpio"] .dot-3 { top: 35%; left: 60%; animation-delay: 0.6s; }
.zodiac-constellation[data-sign="scorpio"] .dot-4 { top: 45%; left: 80%; animation-delay: 0.9s; }
.zodiac-constellation[data-sign="scorpio"] .dot-5 { top: 60%; left: 70%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="scorpio"] .dot-6 { top: 70%; left: 50%; animation-delay: 1.5s; }
.zodiac-constellation[data-sign="scorpio"] .dot-7 { top: 75%; left: 30%; animation-delay: 1.8s; }
.zodiac-constellation[data-sign="scorpio"] .dot-8 { top: 85%; left: 45%; animation-delay: 2.1s; }

.zodiac-constellation[data-sign="sagittarius"] .dot-1 { top: 20%; left: 25%; animation-delay: 0s; }
.zodiac-constellation[data-sign="sagittarius"] .dot-2 { top: 30%; left: 45%; animation-delay: 0.2s; }
.zodiac-constellation[data-sign="sagittarius"] .dot-3 { top: 40%; left: 65%; animation-delay: 0.4s; }
.zodiac-constellation[data-sign="sagittarius"] .dot-4 { top: 50%; left: 80%; animation-delay: 0.6s; }
.zodiac-constellation[data-sign="sagittarius"] .dot-5 { top: 55%; left: 30%; animation-delay: 0.8s; }
.zodiac-constellation[data-sign="sagittarius"] .dot-6 { top: 70%; left: 50%; animation-delay: 1s; }
.zodiac-constellation[data-sign="sagittarius"] .dot-7 { top: 75%; left: 70%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="sagittarius"] .dot-8 { top: 85%; left: 40%; animation-delay: 1.4s; }

.zodiac-constellation[data-sign="capricorn"] .dot-1 { top: 15%; left: 40%; animation-delay: 0s; }
.zodiac-constellation[data-sign="capricorn"] .dot-2 { top: 25%; left: 60%; animation-delay: 0.4s; }
.zodiac-constellation[data-sign="capricorn"] .dot-3 { top: 40%; left: 30%; animation-delay: 0.8s; }
.zodiac-constellation[data-sign="capricorn"] .dot-4 { top: 45%; left: 70%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="capricorn"] .dot-5 { top: 60%; left: 25%; animation-delay: 1.6s; }
.zodiac-constellation[data-sign="capricorn"] .dot-6 { top: 65%; left: 55%; animation-delay: 2s; }
.zodiac-constellation[data-sign="capricorn"] .dot-7 { top: 75%; left: 75%; animation-delay: 2.4s; }
.zodiac-constellation[data-sign="capricorn"] .dot-8 { top: 85%; left: 45%; animation-delay: 2.8s; }

.zodiac-constellation[data-sign="aquarius"] .dot-1 { top: 20%; left: 35%; animation-delay: 0s; }
.zodiac-constellation[data-sign="aquarius"] .dot-2 { top: 25%; left: 65%; animation-delay: 0.3s; }
.zodiac-constellation[data-sign="aquarius"] .dot-3 { top: 40%; left: 25%; animation-delay: 0.6s; }
.zodiac-constellation[data-sign="aquarius"] .dot-4 { top: 45%; left: 55%; animation-delay: 0.9s; }
.zodiac-constellation[data-sign="aquarius"] .dot-5 { top: 60%; left: 75%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="aquarius"] .dot-6 { top: 70%; left: 40%; animation-delay: 1.5s; }
.zodiac-constellation[data-sign="aquarius"] .dot-7 { top: 80%; left: 60%; animation-delay: 1.8s; }
.zodiac-constellation[data-sign="aquarius"] .dot-8 { top: 85%; left: 30%; animation-delay: 2.1s; }

.zodiac-constellation[data-sign="pisces"] .dot-1 { top: 25%; left: 20%; animation-delay: 0s; }
.zodiac-constellation[data-sign="pisces"] .dot-2 { top: 25%; left: 80%; animation-delay: 0.2s; }
.zodiac-constellation[data-sign="pisces"] .dot-3 { top: 40%; left: 35%; animation-delay: 0.4s; }
.zodiac-constellation[data-sign="pisces"] .dot-4 { top: 40%; left: 65%; animation-delay: 0.6s; }
.zodiac-constellation[data-sign="pisces"] .dot-5 { top: 55%; left: 45%; animation-delay: 0.8s; }
.zodiac-constellation[data-sign="pisces"] .dot-6 { top: 55%; left: 55%; animation-delay: 1s; }
.zodiac-constellation[data-sign="pisces"] .dot-7 { top: 75%; left: 30%; animation-delay: 1.2s; }
.zodiac-constellation[data-sign="pisces"] .dot-8 { top: 75%; left: 70%; animation-delay: 1.4s; }

@keyframes hf-twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@media (max-width: 991.98px) {
    .hero-graphic { margin-top: var(--hf-space-5); }
    .zodiac-constellation { width: 180px; }
    .zodiac-icon-large { font-size: 4.25rem; }
}

/* On phones the medallion would push the reading far down the page. */
@media (max-width: 767.98px) {
    section.bg-gradient-primary .hero-graphic { display: none; }
}

/* Compatibility matrix */
#compatibility-table th,
#compatibility-table td {
    vertical-align: middle;
    transition: var(--hf-transition);
}

#compatibility-table thead th a { color: var(--hf-heading); }

/* Row labels stay on one line so long names (Sagittarius, Capricorn) do not
   drop below their symbol; the table scrolls horizontally in its region. */
#compatibility-table tbody th[scope="row"] { white-space: nowrap; }

#compatibility-table > :not(caption) > * > * {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
}

#compatibility-table tbody tr:hover > * { background-color: var(--hf-surface-2); }
#compatibility-table .column-highlight { background-color: var(--hf-accent-soft) !important; }
#compatibility-table tbody tr:hover td.column-highlight { background-color: var(--hf-accent-soft-strong) !important; }

.hf-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--hf-space-2) var(--hf-space-4);
    align-items: center;
    margin: 0 0 var(--hf-space-4);
    padding: 0;
    list-style: none;
    font-size: var(--hf-text-sm);
    color: var(--hf-ink-muted);
}

/* Archive calendar */
.calendar-month-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    font-weight: 600;
}

.archive-card,
.filter-card {
    background: var(--hf-surface);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
}

/* Today date bar: one row except on the smallest phones. */
.hf-datebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--hf-space-2);
    flex-wrap: nowrap;
}

.hf-date-menu { min-width: 16rem; }

.hf-datebar > div:first-child .btn,
.hf-datebar > div:last-child .btn { white-space: nowrap; }

.hf-datebar__center {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: var(--hf-space-2);
    flex-wrap: wrap;
}

@media (max-width: 575.98px) {
    .hf-datebar .btn { --bs-btn-padding-x: 0.7rem; --bs-btn-font-size: var(--hf-text-sm); }
    .hf-datebar__center .btn { white-space: normal; }
    .hf-datebar__label { display: none; }
}

@media (max-width: 359.98px) {
    .hf-datebar { flex-wrap: wrap; }
    .hf-datebar > div:last-child { margin-inline-start: auto; }
}

/* 404 */
.error-container {
    min-height: 70vh;
    background: var(--hf-hero-bg);
    color: var(--hf-hero-ink);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: var(--hf-space-7) 0;
    border-bottom: 1px solid var(--hf-hero-border);
}

.error-content { position: relative; z-index: 2; }

.error-404 {
    font-family: var(--hf-font-display);
    font-size: clamp(5.5rem, 3rem + 9vw, 9rem);
    font-weight: 700;
    line-height: 1;
    /* Leave room under the numerals before the subtitle. */
    margin: var(--hf-space-6) 0 0.2em;
    color: var(--hf-hero-ink);
}

.error-subtitle {
    font-size: var(--hf-title-md);
    font-weight: 700;
    margin-bottom: var(--hf-space-5);
    color: var(--hf-hero-ink);
}

.error-subtitle i { color: var(--hf-hero-art); font-size: 0.8em; }

.error-message {
    font-size: var(--hf-text-lg);
    margin: 0 auto var(--hf-space-5);
    max-width: var(--hf-measure);
}

.error-message p,
.error-message .lead { color: var(--hf-hero-muted); }

.cosmic-icons {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.cosmic-icon {
    position: absolute;
    color: var(--hf-hero-art);
    opacity: 0.16;
    font-size: 2.5rem;
}

/* Decoration stays in the outer margins, never behind the message. */
.cosmic-icon:nth-child(1) { top: 10%; left: 5%; }
.cosmic-icon:nth-child(2) { top: 14%; right: 6%; }
.cosmic-icon:nth-child(3) { top: 58%; left: 4%; }
.cosmic-icon:nth-child(4) { top: 46%; right: 4%; }
.cosmic-icon:nth-child(5) { bottom: 4%; left: 3%; }
.cosmic-icon:nth-child(6) { bottom: 6%; right: 3%; }

@media (max-width: 1199.98px) {
    .cosmic-icon:nth-child(n+3) { display: none; }
}

.helpful-links {
    background: var(--hf-surface);
    color: var(--hf-ink);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-lg);
    margin-top: var(--hf-space-6);
    padding: var(--hf-card-pad);
    position: relative;
    z-index: 2;
    box-shadow: var(--hf-shadow-1);
}

.helpful-links h4,
.helpful-links h5 { color: var(--hf-heading); }
.helpful-links h4 { font-family: var(--hf-font-display); font-size: var(--hf-title-sm); font-weight: 700; margin-bottom: var(--hf-space-5); }
.helpful-links h4 i,
.helpful-links h5 i { color: var(--hf-link); }

.error-container .constellation {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 6%;
    right: 2%;
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
}

.error-container .star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--hf-hero-star);
    border-radius: 50%;
}

.error-container .star:nth-child(1) { top: 20px; left: 50px; }
.error-container .star:nth-child(2) { top: 40px; left: 80px; }
.error-container .star:nth-child(3) { top: 70px; left: 60px; }
.error-container .star:nth-child(4) { top: 90px; left: 90px; }
.error-container .star:nth-child(5) { top: 120px; left: 40px; }

@media (max-width: 767.98px) {
    .error-container .constellation { display: none; }
    .cosmic-icon { font-size: 1.5rem; }
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: var(--hf-space-3);
}

.helpful-link {
    display: flex;
    align-items: center;
    gap: var(--hf-space-4);
    padding: var(--hf-space-4);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    color: var(--hf-ink);
    text-decoration: none;
    text-align: left;
    transition: var(--hf-transition);
}

.helpful-link:hover {
    background: var(--hf-surface);
    border-color: var(--hf-accent);
    color: var(--hf-ink);
}

.helpful-link:hover strong { text-decoration: underline; text-underline-offset: 0.15em; }

.helpful-link i { font-size: 1.35rem; color: var(--hf-link); }
.helpful-link strong { color: var(--hf-heading); }
.helpful-link small { color: var(--hf-ink-muted); }

/* ------------------------------------------------------------------ */
/* 9. Footer                                                           */
/* ------------------------------------------------------------------ */

.site-footer {
    background: var(--hf-footer-bg);
    color: var(--hf-footer-ink);
    padding: var(--hf-space-8) 0 var(--hf-space-6);
    font-size: var(--hf-text-sm);
}

.hf-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--hf-space-6) var(--hf-space-5);
}

@media (min-width: 576px) {
    .hf-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hf-footer__about { grid-column: 1 / -1; }
}

@media (min-width: 992px) {
    .hf-footer__grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 1.2fr); }
    .hf-footer__about { grid-column: auto; }
}

.hf-footer__brand {
    font-family: var(--hf-font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--hf-footer-ink);
    margin-bottom: var(--hf-space-3);
}

.hf-footer__brand i { color: var(--hf-hero-star); font-size: 0.8em; }

:root[data-theme="light"] .hf-footer__brand i,
:root:not([data-theme]) .hf-footer__brand i { color: #ffd98a; }

.hf-footer__about p:not(.hf-footer__brand) { color: var(--hf-footer-muted); max-width: 34ch; margin: 0; }

.hf-footer__head {
    font-family: var(--hf-font-body);
    font-size: var(--hf-text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--hf-footer-muted);
    margin-bottom: var(--hf-space-3);
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.hf-footer__signs ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--hf-space-4); }

.site-footer li a {
    display: inline-block;
    padding: 0.25rem 0;
}

.site-footer a {
    color: var(--hf-footer-ink);
    text-decoration: none;
}

.site-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.hf-footer__legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--hf-space-3) var(--hf-space-5);
    margin-top: var(--hf-space-7);
    padding-top: var(--hf-space-5);
    border-top: 1px solid var(--hf-footer-line);
    color: var(--hf-footer-muted);
}

.footer-legal { display: flex; flex-wrap: wrap; gap: 0 var(--hf-space-4); }

/* Keep the legal links at least 24px tall for touch (WCAG 2.5.8). */
.footer-legal a { display: inline-block; padding-block: 0.25rem; }

/* ------------------------------------------------------------------ */
/* 10. Interaction                                                     */
/* ------------------------------------------------------------------ */

/* Feedback belongs to links and controls; nothing lifts or scales. */
.btn:hover { text-decoration: none; }

/* Kept for older markup: animations are not used for entrance effects. */
.fade-in { opacity: 1 !important; }

/* Focus: a two-colour ring that stays visible on every surface. */
:focus-visible {
    outline: 3px solid var(--hf-focus-outline) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px var(--hf-focus-halo) !important;
}

.site-footer :focus-visible {
    outline-color: #ffe4a3 !important;
    box-shadow: 0 0 0 5px #211946 !important;
}

.btn:focus:not(:focus-visible),
.form-control:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Responsive spacing */
@media (max-width: 575.98px) {
    .card-footer { padding: 0 var(--hf-card-pad) var(--hf-card-pad) !important; }
    .btn-lg { --bs-btn-font-size: 1rem; --bs-btn-padding-y: 0.65rem; --bs-btn-padding-x: 1.25rem; }
    .hf-hero__actions .btn { flex: 1 1 auto; }
}

/* Print */
@media print {
    .hf-header,
    .site-footer,
    .btn,
    .hf-theme-switch,
    .hf-ambient { display: none !important; }

    :root { color-scheme: light; }

    section.bg-gradient-primary > .container,
    .hf-hero__panel,
    .error-container {
        background: none !important;
        border: 0;
    }

    section.bg-gradient-primary > .container::after { display: none; }

    .card {
        break-inside: avoid;
        margin-bottom: 1rem;
        box-shadow: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
        background: #ffffff;
        color: #000000;
    }
}
