/* ==========================================================================
   Regulo Two Design System
   Inspired by Business.gov.uk patterns
   ==========================================================================

   TABLE OF CONTENTS
   -----------------
   1. DESIGN TOKENS (:root custom properties)        ~line 9
   2. BASE STYLES (reset, body, html elements)        ~line 129
   3. LAYOUT (header, footer, containers, breadcrumbs) ~line 176
   4. TYPOGRAPHY (headings, rich text, links)         ~line 354
   5. COMPONENTS                                      ~line 607
      - Cards System                                  ~line 607
      - Data Points Grid                              ~line 949
      - Action Lists                                  ~line 1029
      - Snippet Containers                            ~line 1098
      - Comparison Tables                             ~line 1242
      - Penalty Callouts                              ~line 1318
      - Link Collections                              ~line 1498
      - Callout Boxes                                 ~line 1602
      - Badges and Tags                               ~line 1835
      - Buttons                                       ~line 2035
   6. PAGE-SPECIFIC STYLES                            ~line 2412
      - Guide Page                                    ~line 2521
      - Journey Page                                  ~line 2669
      - Topic Hub Page                                ~line 2761
      - Home Page                                     ~line 2775
      - Index Pages                                   ~line 2893
      - Sector Journey Page                           ~line 2986
   7. SIDEBAR & NAVIGATION                            ~line 3149
      - Related Content Sidebar                       ~line 3149
      - Content Connections                           ~line 3306
      - Section Navigation                            ~line 3482
      - Collapsible Sections                          ~line 3568
      - Facet Filters                                 ~line 3660
   8. DOMAIN COMPONENTS                               ~line 3877
      - Related Legislation                           ~line 3877
      - Legislation Groups                            ~line 4160
      - Support Organisations                         ~line 4253
      - Authoritative Guidance                        ~line 4398

   SEPARATE FILES (loaded via base.html):
   - css/faceted-callouts.css     Geographic, sector, threshold callouts
   - css/regulators.css           Regulator profile page
   - css/legislation.css          Legislation detail page
   - css/editorial.css            Editorial/updates page
   - css/sectors-browse.css       Sector index, browser, detail pages
   - css/signposting-cards.css    Signposting resource cards
   - css/accordion.css            Accordion sections
   - css/export-explorer.css      Export markets, blocs, regions
   - css/nav-dropdown.css         Sector dropdown navigation
   - css/navigation-clarity.css   Enhanced navigation states
   - css/facet-overlay.css        Testing overlay
   - css/chatbot.css              Chatbot widget

   ========================================================================== */

/* CSS Custom Properties - Design Tokens
   Based on GOV.UK Frontend v5.11.2 + Business.gov.uk patterns
   Primary font: Noto Sans (loaded via Google Fonts in base.html) */
:root {
    /* Colors - GOV.UK Official Palette */
    --color-navy: #0b1f35;
    --color-navy-dark: #081729;
    --color-great-blue: #1e1348;
    --color-gov-blue: #1d70b8;
    --color-gov-blue-dark: #003078;
    --color-gov-blue-active: #006ccc;
    --color-link: #1d70b8;
    --color-link-hover: #003078;
    --color-link-visited: #4c2c92;

    --color-text-primary: #0b0c0c;
    --color-text-black: #0b0c0c;
    --color-text-secondary: #505a5f;
    --color-text-muted: #6f777b;
    --color-text-tertiary: #6f777b;

    --color-bg-page: #f3f2f1;
    --color-bg-light: #f3f2f1;
    --color-bg-hover: #e8e6e3;
    --color-bg-alt: #f4f8fb;
    --color-bg-white: #ffffff;

    --color-border: #b1b4b6;
    --color-border-light: #d8d8d8;

    --color-info-bg: #e8f5fc;
    --color-info-border: #1d70b8;

    --color-success: #00703c;
    --color-success-dark: #002d18;
    --color-success-bg: #cce2d8;
    --color-success-light: #e6f3ec;

    --color-error: #d4351c;
    --color-error-dark: #942514;
    --color-error-bg: #fce4e4;
    --color-error-light: #fef2f2;

    --color-warning: #f47738;
    --color-warning-bg: #fef4ed;

    --color-focus: #ffdd00;
    --color-focus-text: #0b0c0c;

    --color-teal: #10b981;
    --color-teal-light: #d1fae5;

    /* Geographic Region Colours - UK Nations */
    --color-scotland: #0065bd;
    --color-wales: #d4351c;
    --color-northern-ireland: #912b88;
    --color-england: #00703c;

    /* Additional Colours - Semantic */
    --color-purple: #8b5cf6;
    --color-purple-dark: #6d2066;
    --color-gray-medium: #6b7280;
    --color-amber: #f59e0b;
    --color-turquoise: #28a197;
    --color-turquoise-dark: #10403d;
    --color-deep-blue: #1e40af;
    --color-light-blue: #5694ca;
    --color-light-blue-dark: #2e75b6;
    --color-warning-dark: #c25614;

    /* Typography - Noto Sans body + Instrument Sans headings (Google Fonts) */
    --font-stack: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 19px;      /* 1.1875rem - GOV.UK body standard */
    --font-size-sm: 16px;        /* 1rem - body small */
    --font-size-xs: 14px;        /* 0.875rem - body xs */
    --font-size-lg: 24px;        /* 1.5rem - heading m */
    --font-size-xl: 36px;        /* 2.25rem - heading l */
    --font-size-xxl: 48px;       /* 3rem - heading xl */

    --font-weight-regular: 400;
    --font-weight-bold: 700;

    --line-height-base: 1.5;
    --line-height-tight: 1.15;
    --line-height-loose: 1.625;

    /* Spacing - GOV.UK Scale */
    --space-1: 5px;
    --space-2: 10px;
    --space-3: 15px;
    --space-4: 20px;
    --space-5: 25px;
    --space-6: 30px;
    --space-7: 40px;
    --space-8: 50px;
    --space-9: 60px;

    /* Layout */
    --max-width: 960px;
    --border-radius: 0;
    --border-radius-sm: 4px;
    --border-radius-pill: 100px;

    /* Focus ring */
    --focus-offset: 3px;
    --focus-width: 3px;

    /* Transitions - Standardised timing */
    --transition-fast: 0.1s ease;
    --transition-base: 0.15s ease;
    --transition-slow: 0.2s ease;

    /* Shadows - Elevation levels */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);

    /* Breakpoints - Reference only (use in media queries)
       --bp-mobile: 640px   (max-width for mobile/content)
       --bp-tablet: 768px   (for navigation elements)
       --bp-desktop: 960px  (for two-column layouts) */
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

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

body {
    font-family: var(--font-stack);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    background: var(--color-bg-page);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0;
}

/* Headings — Instrument Sans for editorial character */
h1, h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

h3, h4 {
    font-family: var(--font-heading);
    font-weight: 650;
    letter-spacing: -0.01em;
}

/* Links */
a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: max(1px, .0625rem);
    text-underline-offset: .1em;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration-thickness: max(3px, .1875rem);
}

a:focus {
    outline: var(--focus-width) solid transparent;
    background-color: var(--color-focus);
    box-shadow: 0 -2px var(--color-focus), 0 4px var(--color-focus-text);
    text-decoration: none;
    color: var(--color-focus-text);
}

a:visited {
    color: var(--color-link-visited);
}

/* ==========================================================================
   Site Header - GOV.UK Style
   ========================================================================== */

.site-header {
    background: var(--color-navy);
    border-bottom: 3px solid var(--color-gov-blue);
}

/* Top row: logo + search bar */
.site-header__top {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 14px var(--space-3) 10px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--space-4);
}

.site-header__logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.site-header__crown {
    width: 30px;
    height: 26px;
}

.site-header h1 {
    margin: 0;
    font-family: var(--font-stack);
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
}

.site-header h1 a {
    color: white;
    text-decoration: none;
}

.site-header h1 a:hover {
    text-decoration: underline;
    text-decoration-thickness: 3px;
}

.site-header h1 a:focus {
    background-color: transparent;
    box-shadow: none;
    outline: var(--focus-width) solid var(--color-focus);
    outline-offset: 2px;
}

/* Nav strip below the top row */
.site-header__nav {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.site-header__nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-3);
    display: flex;
    align-items: stretch;
    gap: 0;
}

.site-header nav a,
.site-header nav button.nav-dropdown__trigger {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    padding: 10px 16px;
    text-decoration: none;
    white-space: nowrap;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    transition: color 100ms ease, border-color 100ms ease, background 100ms ease;
}

.site-header nav a:hover,
.site-header nav button.nav-dropdown__trigger:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: var(--color-gov-blue);
}

.site-header nav a:focus-visible {
    outline: var(--focus-width) solid var(--color-focus);
    outline-offset: -2px;
}

/* Header responsive */
@media (max-width: 768px) {
    .site-header__top {
        grid-template-columns: 1fr;
        gap: var(--space-2);
        padding: 10px var(--space-3) 8px;
    }

    .site-header nav a,
    .site-header nav button.nav-dropdown__trigger {
        font-size: 13px;
        padding: 8px 12px;
    }

    .site-header h1 {
        font-size: 17px;
    }

    .site-header__crown {
        width: 24px;
        height: 20px;
    }
}

/* ==========================================================================
   Page Content Container
   ========================================================================== */

.page-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-6) var(--space-3) var(--space-9);
}

@media (max-width: 640px) {
    .page-content {
        padding: var(--space-4) var(--space-3) var(--space-7);
    }
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumbs {
    margin-bottom: var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin: 0 var(--space-2);
    border-right: 2px solid var(--color-text-muted);
    border-top: 2px solid var(--color-text-muted);
    transform: rotate(45deg);
}

.breadcrumbs a {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.breadcrumbs .current {
    color: var(--color-text-primary);
}

@media (max-width: 640px) {
    .breadcrumbs {
        margin-bottom: var(--space-4);
        font-size: var(--font-size-xs);
    }

    .breadcrumbs li:not(:last-child)::after {
        width: 6px;
        height: 6px;
        margin: 0 var(--space-1);
    }

    .breadcrumbs a {
        font-size: var(--font-size-xs);
    }
}

/* ==========================================================================
   Page Header
   ========================================================================== */

.page-header {
    margin-bottom: var(--space-7);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.page-header .page-type {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-2) 0;
}

.page-header h1 {
    margin: 0 0 var(--space-4) 0;
    font-size: var(--font-size-xxl);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
    letter-spacing: -0.5px;
}

@media (max-width: 640px) {
    .page-header {
        margin-bottom: var(--space-5);
        padding-bottom: var(--space-4);
    }

    .page-header h1 {
        font-size: 28px;
        letter-spacing: -0.25px;
        margin-bottom: var(--space-3);
    }

    .page-header .page-type {
        font-size: var(--font-size-xs);
    }
}

.page-header .short-desc {
    margin: 0;
    font-size: 21px;
    color: var(--color-text-secondary);
    line-height: var(--line-height-base);
}

.page-header .page-meta {
    margin: var(--space-4) 0 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Section Divider */
.section-divider {
    margin: var(--space-8) 0;
    border: none;
    border-top: 1px solid var(--color-border);
}

@media (max-width: 640px) {
    .section-divider {
        margin: var(--space-6) 0;
    }
}

/* Guide Content Wrapper - White panel for main content */
.guide-content {
    background: var(--color-bg-white);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    border: 1px solid var(--color-border-light);
}

@media (max-width: 640px) {
    .guide-content {
        padding: var(--space-4);
        margin-left: calc(-1 * var(--space-3));
        margin-right: calc(-1 * var(--space-3));
        border-left: none;
        border-right: none;
    }
}

/* Content Section - Used in guide/regulator pages */
.content-section {
    margin-bottom: var(--space-6);
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-section h2 {
    margin: 0 0 var(--space-3) 0;
    font-size: 22px;
    font-weight: 700;
    line-height: var(--line-height-tight);
}

.content-section p {
    margin: 0 0 var(--space-3) 0;
    line-height: var(--line-height-base);
}

.content-section p:last-child {
    margin-bottom: 0;
}

.content-section ul {
    margin: var(--space-3) 0;
    padding-left: var(--space-5);
}

.content-section li {
    margin-bottom: var(--space-2);
}

/* Contact details section */
.contact-details {
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--space-4);
}

.contact-details p {
    margin: 0 0 var(--space-2) 0;
    word-break: break-word;
}

.contact-details a {
    word-break: break-all;
}

/* Intro Text Spacing */
.intro-text {
    margin-bottom: var(--space-6);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.section-header {
    margin: var(--space-8) 0 var(--space-5) 0;
    padding-bottom: var(--space-3);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-primary);
    border-bottom: 3px solid var(--color-text-primary);
}

/* ==========================================================================
   Rich Text Content
   ========================================================================== */

.richtext {
    line-height: var(--line-height-loose);
}

.richtext p {
    margin: 0 0 var(--space-4) 0;
}

.richtext p:last-child {
    margin-bottom: 0;
}

.richtext h2 {
    margin: var(--space-8) 0 var(--space-4) 0;
    font-size: 27px;
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

.richtext h2:first-child {
    margin-top: 0;
}

.richtext h3 {
    margin: var(--space-6) 0 var(--space-3) 0;
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

.richtext h4 {
    margin: var(--space-5) 0 var(--space-3) 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.richtext ul, .richtext ol {
    margin: 0 0 var(--space-5) 0;
    padding-left: var(--space-5);
}

.richtext li {
    margin-bottom: var(--space-2);
    padding-left: var(--space-1);
}

.richtext li::marker {
    color: var(--color-text-primary);
}

/* Bold lead text in lists - common GOV.UK pattern */
.richtext li strong:first-child {
    font-weight: var(--font-weight-bold);
}

/* Checklist - Business.gov.uk green checkmarks */
.richtext ul.checklist,
ul.checklist {
    list-style: none;
    padding-left: 0;
    margin: var(--space-4) 0;
}

.richtext ul.checklist li,
ul.checklist li {
    position: relative;
    padding-left: 36px;
    margin-bottom: var(--space-3);
    min-height: 28px;
    display: flex;
    align-items: flex-start;
}

.richtext ul.checklist li::before,
ul.checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 24px;
    height: 24px;
    background: var(--color-teal);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    background-size: 16px;
    background-position: center;
    background-repeat: no-repeat;
}

/* ==========================================================================
   Cards System
   Refined GOV.UK panel style: white bg, left border accent, subtle shadow
   ========================================================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.card {
    background: var(--color-bg-white);
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
    border: none;
    border-left: 4px solid var(--color-gov-blue);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h3, .card h4 {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--font-size-base);
    font-weight: 650;
    line-height: var(--line-height-tight);
}

.card h3 a, .card h4 a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: max(1px, .0625rem);
    text-underline-offset: .1578em;
}

.card h3 a:hover, .card h4 a:hover {
    color: var(--color-link-hover);
    text-decoration-thickness: max(3px, .1875rem);
}

.card h3 a:focus, .card h4 a:focus {
    outline: var(--focus-width) solid transparent;
    background-color: var(--color-focus);
    box-shadow: 0 -2px var(--color-focus), 0 4px var(--color-focus-text);
    text-decoration: none;
    color: var(--color-focus-text);
}

.card p {
    margin: 0 0 var(--space-3) 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-base);
}

.card p:last-child {
    margin-bottom: 0;
}

.card-link {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: max(1px, .0625rem);
}

.card-link:hover {
    text-decoration-thickness: max(3px, .1875rem);
}

/* Card type indicators - left border colour variants */
.card.subtopic {
    border-left-color: var(--color-gov-blue);
}

.card.guide {
    border-left-color: var(--color-success);
}

.card.journey {
    border-left-color: #8b5cf6;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.card.journey h3 {
    margin-bottom: var(--space-2);
}

.card.journey p {
    flex-grow: 1;
    margin-bottom: var(--space-3);
}

.card.journey .card-link {
    margin-top: auto;
}

.card.signpost {
    border-left-color: var(--color-warning);
}

/* Regulator card styles */
.regulator-card {
    border-left: 4px solid var(--color-gov-blue);
}

.regulator-full-name {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin: 0 0 var(--space-3) 0;
}

.regulator-remit {
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    margin-bottom: var(--space-4);
}

.regulator-sectors {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-4);
}

.regulator-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-light);
    margin-top: auto;
}

.regulator-links .card-link {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.regulator-links .card-link:hover {
    color: var(--color-link-hover);
    text-decoration-thickness: max(3px, 0.1875rem);
}

.regulator-links .external-link {
    display: inline-block;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 0;
    border-top: none;
}

.regulator-links .external-link:hover {
    color: var(--color-link);
    text-decoration: underline;
}

/* ==========================================================================
   LEGISLATION LIST STYLES (Regulator pages)
   ========================================================================== */

.enforced-legislation,
.regulatory-documents {
    margin-bottom: var(--space-6);
}

.section-intro {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-4);
}

.legislation-group {
    margin-bottom: var(--space-5);
}

.legislation-type-header {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--govuk-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--space-3) 0;
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--govuk-blue);
}

.legislation-list,
.document-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.legislation-item,
.document-item {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
}

.legislation-item:last-child,
.document-item:last-child {
    border-bottom: none;
}

.legislation-link,
.document-link {
    font-weight: var(--font-weight-semibold);
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    flex: 1 1 auto;
    min-width: 60%;
}

.legislation-link:hover,
.document-link:hover {
    color: var(--color-link-hover);
    text-decoration-thickness: max(3px, 0.1875rem);
}

.legislation-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.legislation-meta .badge {
    font-size: var(--font-size-xs);
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
    font-weight: var(--font-weight-semibold);
}

.legislation-meta .badge.act {
    background: var(--color-accent-purple);
    color: white;
}

.legislation-meta .badge.si {
    background: var(--color-accent-teal);
    color: white;
}

.legislation-meta .year {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.legislation-meta .coverage {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    background: var(--color-bg-secondary);
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
}

.legislation-more,
.document-more {
    padding: var(--space-3) 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.document-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

/* ==========================================================================
   END LEGISLATION LIST STYLES
   ========================================================================== */

/* Signpost block for compliance pages - Related Topic Guides */
.signpost-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-link);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0 4px 4px 0;
}

.signpost-card:hover {
    border-left-color: var(--color-link-hover);
    background: #fafafa;
}

.signpost-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.signpost-title a {
    color: var(--color-link);
    text-decoration: none;
}

.signpost-title a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.signpost-description {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.signpost-link {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-link);
    text-decoration: none;
}

.signpost-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Data Points Grid - Key Information Panel
   Refined GOV.UK panel: white bg, left border accent, subtle shadow
   ========================================================================== */

.data-points-grid {
    background: var(--color-bg-white);
    border-left: 4px solid var(--color-gov-blue);
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.data-points-grid dl {
    display: grid;
    grid-template-columns: minmax(120px, 28%) 1fr;
    gap: 0 var(--space-4);
    margin: 0;
}

.data-points-grid dt {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    color: var(--color-text-secondary);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.data-points-grid dd {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.data-points-grid dt:last-of-type,
.data-points-grid dd:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.data-points-grid dt:first-of-type,
.data-points-grid dd:first-of-type {
    padding-top: 0;
}

@media (max-width: 640px) {
    .data-points-grid {
        padding: var(--space-4);
    }

    .data-points-grid dl {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .data-points-grid dt {
        padding-top: var(--space-3);
        padding-bottom: var(--space-1);
        border-bottom: none;
    }

    .data-points-grid dt:first-of-type {
        padding-top: 0;
    }

    .data-points-grid dd {
        padding-top: 0;
        padding-bottom: var(--space-3);
        border-bottom: 1px solid var(--color-border-light);
    }

    .data-points-grid dd:last-of-type {
        border-bottom: none;
        padding-bottom: 0;
    }
}

/* ==========================================================================
   Action List - Numbered Steps
   ========================================================================== */

.action-list {
    list-style: none;
    counter-reset: action-counter;
    padding: 0;
    margin: 0 0 var(--space-6) 0;
}

.action-item {
    position: relative;
    padding: var(--space-5);
    padding-left: 80px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    margin-bottom: var(--space-3);
    counter-increment: action-counter;
    min-height: 80px;
}

.action-item::before {
    content: counter(action-counter);
    position: absolute;
    left: var(--space-5);
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--color-navy);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-base);
}

.action-item__title {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text-primary);
}

.action-item__description {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-base);
}

@media (max-width: 640px) {
    .action-item {
        padding: var(--space-4);
        padding-top: 60px;
    }

    .action-item::before {
        left: var(--space-4);
        top: var(--space-3);
        transform: none;
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   Snippet Container - Reusable Content Blocks
   ========================================================================== */

.snippet-container {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    border-left: 4px solid var(--color-gov-blue);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

/* When snippet is standalone (outside guide-content), use white background */
.page-content > .snippet-container,
.topic-overview > .snippet-container {
    background: var(--color-bg-white);
    border-color: var(--color-border);
}

.snippet-title {
    margin: 0 0 var(--space-3) 0;
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    line-height: var(--line-height-tight);
}

.snippet-description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin: 0 0 var(--space-5) 0;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
    line-height: var(--line-height-base);
}

/* Snippet data points - compact version, now using panel style */
.snippet-data-points {
    display: grid;
    grid-template-columns: minmax(120px, 28%) 1fr;
    gap: 0 var(--space-4);
    margin: var(--space-4) 0;
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-page);
    border-left: 3px solid var(--color-border);
}

.snippet-data-points dt {
    font-weight: var(--font-weight-regular);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.snippet-data-points dd {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-bold);
    margin: 0;
    padding: var(--space-2) 0;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--color-border-light);
}

.snippet-data-points dt:last-of-type,
.snippet-data-points dd:last-of-type {
    border-bottom: none;
}

/* Snippet actions - numbered list */
.snippet-actions {
    margin: var(--space-4) 0;
    padding-left: var(--space-5);
    line-height: var(--line-height-loose);
}

.snippet-actions li {
    margin-bottom: var(--space-3);
    padding-left: var(--space-2);
}

.snippet-actions li strong {
    color: var(--color-text-primary);
}

/* Snippet rich content */
.snippet-content {
    margin: var(--space-4) 0;
}

.snippet-content p:last-child {
    margin-bottom: 0;
}

/* GOV Service Link - Call to Action Button */
.snippet-service-link {
    margin: var(--space-5) 0 var(--space-6) 0;
}

.gov-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 12px 20px;
    background: var(--color-success);
    color: white !important;
    font-size: var(--font-size-base);
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 0 var(--color-success-dark);
    transition: background-color var(--transition-base);
}

.gov-link:hover {
    background: #005a30;
    text-decoration: none;
    color: white !important;
}

.gov-link:active {
    top: 2px;
    box-shadow: none;
}

.gov-link:focus {
    outline: var(--focus-width) solid transparent;
    background: var(--color-focus);
    color: var(--color-focus-text) !important;
    box-shadow: 0 4px 0 var(--color-focus-text);
}

.gov-link::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 3px solid currentColor;
    border-top: 3px solid currentColor;
    transform: rotate(45deg);
    margin-left: var(--space-1);
}

/* ==========================================================================
   Comparison Table
   ========================================================================== */

.comparison-table {
    margin: var(--space-6) 0;
}

.comparison-table__heading {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--font-size-lg);
    color: var(--color-text-primary);
    line-height: var(--line-height-tight);
}

.comparison-table__description {
    margin: 0 0 var(--space-3) 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-base);
}

.comparison-table__wrapper {
    overflow-x: auto;
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-sm);
    background: var(--color-bg-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.comparison-table__table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table__caption {
    text-align: left;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    padding: var(--space-2) var(--space-3);
}

.comparison-table__table th,
.comparison-table__table td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: top;
}

.comparison-table__table th {
    background: var(--color-bg-page);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
}

.comparison-table__table td {
    color: var(--color-text-secondary);
    line-height: var(--line-height-base);
}

.comparison-table__table tr:last-child td {
    border-bottom: none;
}

@media (max-width: 640px) {
    .comparison-table__heading {
        font-size: 20px;
    }

    .comparison-table__table th,
    .comparison-table__table td {
        padding: var(--space-2);
    }
}

/* ==========================================================================
   Penalty Callout
   ========================================================================== */

.penalty-callout {
    border-left: 5px solid var(--color-warning);
    background: var(--color-warning-bg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.penalty-callout--critical {
    border-color: var(--color-error);
    background: var(--color-error-bg);
}

.penalty-callout--info {
    border-color: var(--color-info-border);
    background: var(--color-info-bg);
}

.penalty-callout__label {
    margin: 0 0 var(--space-1) 0;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.penalty-callout__heading {
    margin: 0 0 var(--space-3) 0;
    font-size: 22px;
    color: var(--color-text-primary);
    line-height: var(--line-height-tight);
}

.penalty-callout__amount {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    margin: 0 0 var(--space-3) 0;
}

.penalty-callout__amount-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.penalty-callout__amount-value {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.penalty-callout__description {
    margin: 0 0 var(--space-3) 0;
    color: var(--color-text-secondary);
    line-height: var(--line-height-base);
}

.penalty-callout__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
    margin: 0 0 var(--space-3) 0;
}

.penalty-callout__meta-item {
    background: rgba(255, 255, 255, 0.6);
    padding: var(--space-3);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-border-light);
}

.penalty-callout__meta-item dt {
    margin: 0 0 var(--space-1) 0;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-muted);
}

.penalty-callout__meta-item dd {
    margin: 0;
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-base);
}

.penalty-callout__action {
    margin: 0 0 var(--space-3) 0;
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-border-light);
}

.penalty-callout__action h4 {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
}

.penalty-callout__action p {
    margin: 0;
    color: var(--color-text-primary);
    line-height: var(--line-height-base);
}

.penalty-callout__footer {
    margin-top: var(--space-2);
}

.penalty-callout__link {
    font-weight: var(--font-weight-bold);
    color: var(--color-link);
    text-decoration: underline;
}

.penalty-callout__link:hover {
    color: var(--color-link-hover);
}

.penalty-callout__link:focus {
    outline: var(--focus-width) solid transparent;
    background: var(--color-focus);
    box-shadow: 0 -2px var(--color-focus), 0 4px var(--color-focus-text);
    color: var(--color-focus-text);
    text-decoration: none;
}

@media (max-width: 640px) {
    .penalty-callout {
        padding: var(--space-4);
        margin: var(--space-5) 0;
    }

    .penalty-callout__meta {
        grid-template-columns: 1fr;
    }

    .penalty-callout__amount-value {
        font-size: 20px;
    }
}

@media (max-width: 640px) {
    .snippet-container {
        padding: var(--space-4);
    }

    .snippet-data-points {
        grid-template-columns: 1fr;
        gap: 0;
        padding: var(--space-3);
    }

    .snippet-data-points dt {
        padding-bottom: 0;
    }

    .snippet-data-points dd {
        padding-top: var(--space-1);
        padding-bottom: var(--space-3);
        border-bottom: 1px solid var(--color-border-light);
    }

    .snippet-data-points dd:last-of-type {
        border-bottom: none;
        padding-bottom: 0;
    }
}

/* ==========================================================================
   Link Collection - External Resources
   ========================================================================== */

.link-collection {
    background: var(--color-bg-white);
    border-left: 4px solid var(--color-gov-blue);
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
    margin-top: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}

/* Standalone link-collection uses same styling */
.page-content > .link-collection,
.topic-overview > .link-collection {
    /* Same as base - unified panel style */
}

.link-collection__heading {
    margin: 0 0 var(--space-3) 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.link-collection__intro {
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-4) 0;
    font-size: var(--font-size-sm);
}

.link-collection__links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.external-link {
    padding: var(--space-3) 0;
    border-top: 1px solid var(--color-border-light);
}

.external-link:first-child {
    border-top: none;
    padding-top: 0;
}

.external-link:last-child {
    padding-bottom: 0;
}

.external-link__title {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-base);
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: max(1px, .0625rem);
    text-underline-offset: .15em;
}

.external-link__title:hover {
    color: var(--color-link-hover);
    text-decoration-thickness: max(3px, .1875rem);
}

.external-link__title::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231d70b8'%3E%3Cpath d='M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.external-link__description {
    margin: var(--space-2) 0;
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-base);
}

.external-link__source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

.external-link__source::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236f777b'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ==========================================================================
   Callout Boxes - Eligibility Panels
   ========================================================================== */

.callout {
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    border-left: 5px solid;
}

.callout p:last-child {
    margin-bottom: 0;
}

.callout--positive {
    background: var(--color-success-light);
    border-left-color: var(--color-success);
}

.callout--negative {
    background: var(--color-error-light);
    border-left-color: var(--color-error);
}

.callout--info {
    background: var(--color-info-bg);
    border-left-color: var(--color-info-border);
}

.callout--warning {
    background: var(--color-warning-bg);
    border-left-color: var(--color-warning);
}

/* Callout Block - Used in guide pages via CalloutBlock */
.callout-block {
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    border-left: 5px solid var(--color-info-border);
    background: var(--color-info-bg);
}

.callout-block p:last-child {
    margin-bottom: 0;
}

.callout-block h3 {
    margin: 0 0 var(--space-3) 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
}

.callout-block .callout-icon {
    margin-right: var(--space-2);
}

.callout-block--info {
    border-left-color: var(--color-info-border);
    background: var(--color-info-bg);
}

.callout-block--warning {
    border-left-color: var(--color-warning);
    background: var(--color-warning-bg);
}

.callout-block--tip {
    border-left-color: var(--color-success);
    background: var(--color-success-light);
}

.callout-block--important {
    border-left-color: var(--color-error);
    background: var(--color-error-light);
}

/* GOV.UK Warning Text - For raw HTML fallback */
.govuk-warning-text {
    position: relative;
    padding: var(--space-4) var(--space-4) var(--space-4) 55px;
    margin: var(--space-4) 0;
    background: var(--color-warning-bg);
    border-left: 5px solid var(--color-warning);
}

.govuk-warning-text__icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 3px solid var(--color-text-primary);
    border-radius: 50%;
    font-weight: var(--font-weight-bold);
    font-size: 20px;
    line-height: 1;
}

.govuk-warning-text__text {
    display: block;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

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

/* Simple paragraph-level warning text (without icon markup) */
p.govuk-warning-text {
    padding: var(--space-4);
    padding-left: var(--space-4);
    background: var(--color-warning-bg);
    border-left: 5px solid var(--color-warning);
    font-weight: var(--font-weight-bold);
}

/* Eligibility panels - side by side */
.eligibility-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.eligibility-panel {
    padding: var(--space-5);
    border-radius: var(--border-radius-sm);
}

.eligibility-panel--can {
    background: var(--color-teal-light);
}

.eligibility-panel--cannot {
    background: var(--color-error-light);
}

.eligibility-panel h3 {
    margin: 0 0 var(--space-4) 0;
    font-size: var(--font-size-base);
    font-weight: 700;
}

.eligibility-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.eligibility-panel li {
    position: relative;
    padding-left: 32px;
    margin-bottom: var(--space-3);
}

.eligibility-panel--can li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    background: var(--color-teal);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.eligibility-panel--cannot li::before {
    content: "✕";
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    color: var(--color-error);
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    line-height: 20px;
}

@media (max-width: 640px) {
    .eligibility-panels {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Topic Overview Section
   ========================================================================== */

.topic-overview {
    margin-bottom: var(--space-8);
}

.topic-overview > * {
    margin-bottom: var(--space-6);
}

.topic-overview > *:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Core Content Block Spacing
   ========================================================================== */

.core-content {
    margin-bottom: var(--space-6);
}

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

/* ==========================================================================
   Badges and Tags - GOV.UK Pill Style
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 5px 10px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    border-radius: var(--border-radius-pill);
    margin-right: var(--space-2);
    margin-bottom: var(--space-2);
    border: 1px solid transparent;
    line-height: 1.2;
}

.badge.sector {
    background: #e8f4fc;
    color: #0b4a7a;
    border-color: #b8d4ea;
}

/* DBT Industry Sector (338-sector taxonomy) */
.badge--dbt-sector {
    background: #f3f2f1;
    color: #0b0c0c;
    border-color: #b1b4b6;
    font-size: 13px;
}

.badge--dbt-sector:hover {
    background: #e8f4fc;
    border-color: #1d70b8;
}

/* Region badges */
.badge--region {
    background: #fdf2e9;
    color: #6e3619;
    border-color: #f5d4bd;
}

/* Business type badges */
.badge--type {
    background: #f0f0f0;
    color: var(--color-text-secondary);
    border-color: #d0d0d0;
}

/* Intent badges */
.badge--intent {
    background: #e3f5ec;
    color: #0a5132;
    border-color: #a7dfc4;
}

.badge.region {
    background: #fdf2e9;
    color: #6e3619;
    border-color: #f5d4bd;
}

.badge.type {
    background: #f0f0f0;
    color: var(--color-text-secondary);
    border-color: #d0d0d0;
}

.badge.intent {
    background: #e3f5ec;
    color: #0a5132;
    border-color: #a7dfc4;
}

.badge.legal,
.badge.compliance {
    background: #1d70b8;
    color: #ffffff;
    border-color: #1d70b8;
}

/* Stage badges (lifecycle stage indicators) */
.badge.stage-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-2);
    display: inline-block;
}

/* Stage-specific colors */
.badge.stage-starting {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

.badge.stage-growing {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #90caf9;
}

.badge.stage-changing {
    background: #fff3e0;
    color: #e65100;
    border-color: #ffcc80;
}

.badge.stage-international {
    background: #f3e5f5;
    color: #7b1fa2;
    border-color: #ce93d8;
}

.facet-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.facet-badges .badge {
    margin: 0;
}

/* Sector-specific label */
.sector-specific-label {
    display: inline-block;
    background: var(--color-warning);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: 2px 8px;
    margin-left: var(--space-2);
    text-transform: none;
    letter-spacing: 0;
    vertical-align: middle;
}

/* ==========================================================================
   Wrapper Block (Journey Context)
   ========================================================================== */

.wrapper {
    border: 2px solid var(--color-border);
    background: var(--color-bg-white);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}

.wrapper__context {
    font-style: italic;
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border-light);
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.empty-state {
    padding: var(--space-8);
    text-align: center;
    color: var(--color-text-secondary);
    background: var(--color-bg-white);
    border: 2px dashed var(--color-border);
}

/* ==========================================================================
   Back Link
   ========================================================================== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.back-link::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.back-link:hover {
    color: var(--color-text-primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    background: var(--color-bg-white);
    color: var(--color-link);
    border: 2px solid var(--color-border);
    cursor: pointer;
    transition: background-color var(--transition-base), border-color var(--transition-base);
}

.btn:hover {
    background: var(--color-bg-page);
    border-color: var(--color-text-secondary);
    color: var(--color-link-hover);
    text-decoration: none;
}

.btn:focus {
    outline: var(--focus-width) solid transparent;
    background-color: var(--color-focus);
    box-shadow: 0 4px 0 var(--color-focus-text);
    color: var(--color-focus-text);
}

@media (max-width: 640px) {
    .btn {
        padding: 8px 12px;
        font-size: var(--font-size-xs);
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Utility - Lists in Cards/Guides
   ========================================================================== */

.list-numbered {
    padding-left: var(--space-5);
    line-height: var(--line-height-loose);
}

.list-numbered li {
    margin-bottom: var(--space-3);
    padding-left: var(--space-2);
}

/* ==========================================================================
   Datapoints within Guides (Legacy Support)
   ========================================================================== */

.datapoints {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.datapoint {
    background: var(--color-info-bg);
    padding: var(--space-4);
    border-left: 4px solid var(--color-info-border);
}

.datapoint strong {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

/* ==========================================================================
   Skip Link (Accessibility)
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    display: block;
    padding: var(--space-2) var(--space-3);
    background: var(--color-focus);
    color: var(--color-focus-text);
    font-weight: 700;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
    outline: var(--focus-width) solid transparent;
    background: var(--color-focus);
    box-shadow: none;
}

/* ==========================================================================
   Page Width Container
   ========================================================================== */

.page-width-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-3);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */

.site-footer {
    background: var(--color-bg-page);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-9);
    padding: var(--space-7) 0;
}

.site-footer__content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-3);
}

.site-footer__disclaimer {
    margin: 0 0 var(--space-4) 0;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.site-footer__text {
    margin: 0 0 var(--space-3) 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.site-footer__meta {
    margin: 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.site-footer__meta a {
    color: var(--color-text-secondary);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .breadcrumbs,
    .back-link,
    .card-link,
    .gov-link,
    .skip-link {
        display: none !important;
    }

    body {
        background: white;
        font-size: 12pt;
    }

    .page-content {
        max-width: 100%;
        padding: 0;
    }

    .card,
    .snippet-container,
    .data-points-grid,
    .callout {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a {
        color: black;
        text-decoration: none;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}

/* ==========================================================================
   Comparison Table Block
   ========================================================================== */
.comparison-table-block {
    margin: 30px 0;
}

.comparison-table-heading {
    margin-bottom: 15px;
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.comparison-table-description {
    margin-bottom: 20px;
    color: var(--color-text-secondary);
}

.comparison-table {
    margin-top: 0;
    margin-bottom: 0;
}

.comparison-table .govuk-table__header {
    font-weight: 700;
    vertical-align: top;
}

.comparison-table .govuk-table__cell {
    vertical-align: top;
    padding: 15px 20px 15px 0;
}

/* Responsive table wrapper */
.govuk-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    .comparison-table .govuk-table__cell,
    .comparison-table .govuk-table__header {
        padding-right: 10px;
        font-size: 0.875rem;
    }
}

/* ==========================================================================
   Penalty Callout Block
   ========================================================================== */
.penalty-callout {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin: 30px 0;
    border-left: 5px solid;
    background-color: var(--color-bg-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Severity variants */
.penalty-callout--info {
    border-left-color: var(--color-info-border);
    background-color: var(--color-info-bg);
}

.penalty-callout--warning {
    border-left-color: var(--color-warning-border);
    background-color: var(--color-warning-bg);
}

.penalty-callout--critical {
    border-left-color: var(--color-error-border);
    background-color: var(--color-error-bg);
}

.penalty-callout__icon {
    flex-shrink: 0;
    font-size: 1.75rem;
    line-height: 1;
}

.penalty-icon {
    display: block;
}

.penalty-callout__content {
    flex: 1;
}

.penalty-callout__heading {
    margin: 0 0 15px 0;
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.penalty-callout__details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.penalty-amount {
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.penalty-amount__label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.penalty-amount__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-error-text, #d4351c);
}

.penalty-description {
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.penalty-meta {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

.penalty-meta strong {
    color: var(--color-text-primary);
    font-weight: 700;
}

.penalty-action {
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

.penalty-action strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.penalty-action p {
    margin: 0;
    color: var(--color-text-secondary);
}

.penalty-link {
    padding-top: 5px;
}

.penalty-link .govuk-link {
    font-weight: 600;
}

@media (max-width: 640px) {
    .penalty-callout {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .penalty-callout__icon {
        font-size: 1.5rem;
    }

    .penalty-amount__value {
        font-size: 1.125rem;
    }
}

/* ==========================================================================
   Page Type Styling System
   Consistent styling across all page types: Guide, Journey, Sector, Topic
   ========================================================================== */

/* Page type badge - colored inline label */
.page-header .page-type {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-3);
    padding: 4px 12px;
    background: var(--color-text-secondary);
    color: white;
}

/* Page type colors */
.page-header.guide-header .page-type,
.page-header .page-type.guide-type {
    background: var(--color-success);
}

.page-header.journey-header .page-type,
.page-header .page-type.journey-type {
    background: #8b5cf6;
}

.page-header.sector-header .page-type,
.page-header .page-type.sector-type {
    background: var(--color-gov-blue);
}

.page-header.topic-header .page-type,
.page-header .page-type.topic-type {
    background: var(--color-warning);
}

/* Short description styling */
.page-header .short-desc {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    max-width: 700px;
    margin-bottom: 0;
    line-height: var(--line-height-base);
}

/* Page meta (last updated, etc) */
.page-header .page-meta {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-3);
}

/* Intro text - consistent across all page types */
.intro-text,
.journey-intro,
.sector-intro,
.topic-intro {
    font-size: var(--font-size-base);
    line-height: var(--line-height-loose);
    max-width: 700px;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border-light);
}

.intro-text:last-child,
.journey-intro:last-child {
    border-bottom: none;
    padding-bottom: 0;
}


/* ==========================================================================
   Section Headers - Consistent across all pages
   ========================================================================== */

.section-header {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-4) 0;
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-border-light);
}

/* Section header inside header element (for content blocks) */
header.section-header {
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: var(--space-5);
}

header.section-header h2 {
    font-size: var(--font-size-lg);
    margin: 0 0 var(--space-3) 0;
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-border-light);
}

/* Section dividers */
.section-divider {
    border: none;
    border-top: 1px solid var(--color-border-light);
    margin: var(--space-7) 0;
}

/* ==========================================================================
   Guide Page Styles
   ========================================================================== */

.guide-header {
    border-bottom: none;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-5);
}

.guide-content {
    margin-bottom: var(--space-7);
}

.guide-content .core-content {
    margin-bottom: var(--space-5);
}

/* ==========================================================================
   Rich Text Tables (GOV.UK Style)
   Tables within guide content that don't have explicit classes
   ========================================================================== */

.guide-content table,
.core-content table,
.rich-text table {
    width: 100%;
    margin: var(--space-5) 0;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: var(--font-size-base);
}

/* Table header styling */
.guide-content table thead,
.core-content table thead,
.rich-text table thead {
    background-color: var(--color-bg-page);
}

.guide-content table th,
.core-content table th,
.rich-text table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    border-bottom: 2px solid var(--color-text-primary);
    vertical-align: top;
}

/* Table cell styling */
.guide-content table td,
.core-content table td,
.rich-text table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: top;
    line-height: var(--line-height-base);
}

/* Remove border from last row */
.guide-content table tbody tr:last-child td,
.core-content table tbody tr:last-child td,
.rich-text table tbody tr:last-child td {
    border-bottom: none;
}

/* Zebra striping for better readability (optional - GOV.UK uses subtle hover) */
.guide-content table tbody tr:hover,
.core-content table tbody tr:hover,
.rich-text table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Responsive table wrapper for overflow */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-5) 0;
}

.table-responsive table {
    margin: 0;
}

/* Mobile responsive tables */
@media (max-width: 640px) {
    .guide-content table,
    .core-content table,
    .rich-text table {
        font-size: var(--font-size-sm);
    }

    .guide-content table th,
    .core-content table th,
    .rich-text table th,
    .guide-content table td,
    .core-content table td,
    .rich-text table td {
        padding: var(--space-2) var(--space-3);
    }

    /* Stack cells on very small screens if needed */
    .table-stack-mobile thead {
        display: none;
    }

    .table-stack-mobile tbody tr {
        display: block;
        margin-bottom: var(--space-4);
        border: 1px solid var(--color-border-light);
        border-radius: var(--border-radius-sm);
        padding: var(--space-3);
    }

    .table-stack-mobile tbody td {
        display: block;
        padding: var(--space-2) 0;
        border-bottom: none;
    }

    .table-stack-mobile tbody td::before {
        content: attr(data-label);
        display: block;
        font-weight: var(--font-weight-bold);
        font-size: var(--font-size-xs);
        color: var(--color-text-secondary);
        margin-bottom: var(--space-1);
    }
}

/* Caption styling */
.guide-content table caption,
.core-content table caption,
.rich-text table caption {
    text-align: left;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    padding: var(--space-2) 0;
    margin-bottom: var(--space-2);
    font-style: normal;
}

/* ==========================================================================
   Journey Page Styles
   ========================================================================== */

.journey-header {
    border-bottom: none;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-5);
}

/* Journey steps overview */
.journey-steps-overview {
    background: var(--color-bg-alt);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    border-radius: 4px;
}

.journey-steps-overview .section-header {
    margin-bottom: var(--space-4);
}

.journey-steps-list {
    list-style: none;
    margin: 0 0 var(--space-5) 0;
    padding: 0;
    counter-reset: step-counter;
}

.journey-step-item {
    background: var(--color-bg-white);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    border: 1px solid var(--color-border-light);
    border-left: 3px solid #8b5cf6;
    border-radius: 0 4px 4px 0;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.journey-step-item:hover {
    border-color: var(--color-border);
    border-left-color: #7c3aed;
    box-shadow: var(--shadow-md);
}

.journey-step-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: inherit;
}

.journey-step-link:hover .step-title {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #8b5cf6;
    color: white;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    border-radius: 50%;
    flex-shrink: 0;
}

.step-title {
    font-weight: var(--font-weight-bold);
    color: var(--color-link);
    flex-grow: 1;
}

.step-time {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    background: var(--color-bg-page);
    padding: 2px 8px;
    border-radius: 12px;
}

.step-summary {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: var(--space-2) 0 0 calc(32px + var(--space-3));
}

/* ==========================================================================
   Topic Hub Page Styles
   ========================================================================== */

.topic-header {
    border-bottom: none;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-5);
}

.topic-overview {
    margin-bottom: var(--space-6);
}

/* ==========================================================================
   Home Page Styles
   ========================================================================== */

/* Home Hero Banner — full-bleed dark banner anchored to the nav */
.home-hero {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    margin-top: calc(-1 * var(--space-6));
    background: var(--color-navy);
    border-bottom: 4px solid var(--color-gov-blue);
    padding: var(--space-7) 0 var(--space-6);
    margin-bottom: var(--space-6);
}

.home-hero__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-3);
}

.home-hero__title {
    color: #fff;
    font-size: clamp(30px, 3.8vw, 42px);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin: 0 0 var(--space-3) 0;
    max-width: 700px;
    text-wrap: balance;
}

.home-hero__lede p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 20px;
    line-height: 1.55;
    margin: 0;
    max-width: 580px;
}

@media (max-width: 640px) {
    .home-hero {
        padding: var(--space-5) 0 var(--space-4);
    }

    .home-hero__title {
        font-size: 28px;
        letter-spacing: -0.25px;
    }

    .home-hero__lede p {
        font-size: 18px;
    }
}

/* Homepage section layout */
.home-section {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.home-section:last-child {
    border-bottom: none;
}

.home-section .section-header {
    margin-bottom: var(--space-4);
}

.section-intro {
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.section-cta {
    margin-top: var(--space-4);
    text-align: center;
}

.btn-secondary {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: transparent;
    color: var(--color-link);
    border: 2px solid var(--color-link);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-slow);
}

.btn-secondary:hover {
    background: var(--color-link);
    color: white;
    text-decoration: none;
}

/* Journey groups on homepage */
.journey-group {
    margin-bottom: var(--space-5);
}

.subsection-header {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border-light);
}

/* Topic cards */
.card.topic {
    border-left: 4px solid var(--color-gov-blue);
}

.card.topic h3 a {
    color: var(--color-gov-blue-dark);
}

.card-meta {
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.guide-count {
    background: var(--color-bg-light);
    padding: 2px 8px;
    border-radius: var(--border-radius-pill);
}

/* Compact cards for recent guides */
.card.compact {
    padding: var(--space-3);
}

.card.compact h3 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-1);
}

.card-tag {
    display: inline-block;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    background: var(--color-bg-light);
    padding: 2px 8px;
    border-radius: var(--border-radius-pill);
}

/* Topic/sector/journey chip list */
.topic-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-pill);
    color: var(--color-link);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
}

.topic-chip:hover {
    background: var(--color-link);
    color: #fff;
    border-color: var(--color-link);
    text-decoration: none;
}

.topic-chip__count {
    font-size: var(--font-size-xs);
    background: var(--color-bg-light);
    padding: 0 6px;
    border-radius: var(--border-radius-pill);
    color: var(--color-text-muted);
}

.topic-chip:hover .topic-chip__count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.sector-chip {
    border-color: #b8d4ea;
}

/* Stats bar */
.home-stats {
    border-bottom: none;
    padding-bottom: 0;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    padding: var(--space-4) 0;
    border-top: 2px solid var(--color-border);
}

@media (max-width: 640px) {
    .stats-grid {
        gap: var(--space-4);
        flex-wrap: wrap;
    }
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    color: var(--color-navy);
    line-height: 1;
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Index Page Styles
   ========================================================================== */

.index-header {
    border-bottom: none;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-5);
}

.index-header .page-type {
    background: var(--color-gov-blue-dark);
}

.journey-index .page-type {
    background: #8b5cf6;
}

.sector-index .page-type {
    background: var(--color-gov-blue);
}

.guidance-index .page-type {
    background: var(--color-success);
}

/* Guidance area sections */
.guidance-area-section {
    margin-bottom: var(--space-6);
}

.guidance-area-section .section-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-border);
}

/* Guide tags (sector badges on cards) */
.guide-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin: var(--space-2) 0;
}

.guide-tags .badge {
    background: #e8f4fc;
    color: #0b4a7a;
    border: 1px solid #b8d4ea;
}

/* Clear filter link */
.clear-filter {
    display: inline-block;
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
}

/* ==========================================================================
   Card Type Enhancements
   ========================================================================== */

/* Sector card styling */
.card.sector {
    border-left: 4px solid var(--color-gov-blue);
}

.card.sector h3 a {
    color: var(--color-gov-blue);
}

.card.sector:hover {
    border-left-color: var(--color-gov-blue-dark);
}

/* Card description for rich text content */
.card-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
}

.card-description p {
    margin: 0;
}

/* Meta text in cards */
.card .meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

/* ==========================================================================
   Sector Journey Page Styles (Components)
   ========================================================================== */

/* Sector regulators - compact card style */
.sector-regulators {
    background: var(--color-bg-alt);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    border-radius: 4px;
}

.sector-regulators h2 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-4) 0;
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-gov-blue);
    display: inline-block;
}

.sector-regulators .regulator-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-3);
}

.sector-regulators .regulator-list li {
    background: var(--color-bg-white);
    padding: var(--space-4);
    border: 1px solid var(--color-border-light);
    border-left: 3px solid var(--color-gov-blue);
    border-radius: 0 4px 4px 0;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.sector-regulators .regulator-list li:hover {
    border-color: var(--color-border);
    border-left-color: var(--color-gov-blue-dark);
    box-shadow: var(--shadow-md);
}

.sector-regulators .regulator-list li a {
    display: block;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-base);
    color: var(--color-link);
    text-decoration: none;
    margin-bottom: var(--space-2);
}

.sector-regulators .regulator-list li a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.sector-regulators .regulator-remit {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-base);
    margin: 0;
}

/* Sector page sections */
.sector-journeys,
.sector-journey-content section,
section[aria-labelledby] {
    margin-bottom: var(--space-7);
}

.sector-journeys .section-header,
section .section-header {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-4) 0;
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-border-light);
}

/* Section dividers for smooth flow */
.section-divider {
    border: none;
    border-top: 1px solid var(--color-border-light);
    margin: var(--space-7) 0;
}

/* Key guides section heading - matches "Journeys for X" style */
section[aria-labelledby="related-guides-heading"] .section-header,
.sector-journey-content > h2 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-4) 0;
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-border-light);
}

/* Sector journey content area */
.sector-journey-content {
    margin-bottom: var(--space-7);
}

.sector-journey-content .section-intro {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    max-width: 700px;
    margin-bottom: var(--space-5);
}

/* Journey cards for sector pages */
.sector-journeys .card.journey {
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

.sector-journeys .card.journey h3 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-2);
}

.sector-journeys .card.journey p {
    flex-grow: 1;
    margin-bottom: var(--space-3);
}

.sector-journeys .card.journey .card-link {
    margin-top: auto;
    font-weight: var(--font-weight-bold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sector-journeys .card.journey .card-link::after {
    content: " →";
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .sector-regulators .regulator-list {
        grid-template-columns: 1fr;
    }

    .sector-header .short-desc {
        font-size: var(--font-size-base);
    }

    .sector-regulators {
        padding: var(--space-4);
    }

    .sector-regulators .regulator-list li {
        padding: var(--space-3);
    }
}

/* ==========================================================================
   RELATED CONTENT SIDEBAR - Deeply Intertwingled Experience
   ========================================================================== */

/* Guide layout with sidebar */
.guide-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 960px) {
    .guide-layout {
        grid-template-columns: 2fr 1fr;
    }
}

/* Related content sidebar */
.related-content-sidebar {
    background: var(--color-bg-alt);
    padding: var(--space-4);
    border-left: 4px solid var(--color-gov-blue);
}

@media (max-width: 959px) {
    .related-content-sidebar {
        border-left: none;
        border-top: 4px solid var(--color-gov-blue);
        margin-top: var(--space-6);
    }
}

.related-content-section {
    margin-bottom: var(--space-5);
}

.related-content-section:last-child {
    margin-bottom: 0;
}

.related-content-heading {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-3) 0;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border-light);
}

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

.related-content-item {
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border-light);
}

.related-content-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.related-content-link {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.related-content-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}

.related-content-description {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin: var(--space-1) 0 0 0;
}

/* Continuation items have arrow indicator */
.related-content-item--continuation .related-content-link::after {
    content: " →";
}

/* Prerequisite banner */
.govuk-inset-text--prerequisite {
    background: var(--color-info-bg);
    border-left-color: var(--color-info-border);
    margin-bottom: var(--space-5);
}

.govuk-inset-text--prerequisite h3 {
    margin-top: 0;
    margin-bottom: var(--space-2);
}

/* Next steps section */
.next-steps-section {
    background: var(--color-bg-alt);
    padding: var(--space-5);
    border-top: 4px solid var(--color-success);
    margin-top: var(--space-6);
}

.next-step-item {
    margin-bottom: var(--space-3);
}

.next-step-item:last-child {
    margin-bottom: 0;
}

.next-step-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    text-decoration: none;
    transition: border-color var(--transition-base), background-color var(--transition-base);
}

.next-step-link:hover {
    border-color: var(--color-gov-blue);
    background: var(--color-bg-white);
}

.next-step-title {
    font-weight: var(--font-weight-bold);
    color: var(--color-link);
}

.next-step-arrow {
    color: var(--color-gov-blue);
    flex-shrink: 0;
    margin-left: var(--space-3);
}

/* Impact scope panel (for editors) */
.impact-scope-panel {
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
    padding: var(--space-4);
    margin-top: var(--space-4);
}

.impact-scope-panel h4 {
    margin-top: 0;
}

/* ==========================================================================
   CONTENT CONNECTIONS - Graph-aware Related Content (Redesigned)
   Replaces the sidebar approach with a GOV.UK-native bottom section
   ========================================================================== */

/* Remove the grid layout - keep full-width content */
.guide-layout {
    display: block;
}

/* Hide the old sidebar (if it exists) */
.related-content-sidebar {
    display: none;
}

/* Content Connections Section */
.content-connections {
    margin-top: var(--space-7);
    padding: var(--space-5);
    background: var(--color-bg-white);
    border-left: 4px solid var(--color-gov-blue);
    box-shadow: var(--shadow-sm);
}

.content-connections__header {
    margin-bottom: var(--space-5);
}

.content-connections__header h2 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.content-connections__icon {
    color: var(--color-gov-blue);
    flex-shrink: 0;
}

.content-connections__intro {
    color: var(--color-text-secondary);
    margin: 0;
    max-width: 42em;
}

/* Sections within connections */
.content-connections__section {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border-light);
}

.content-connections__section:last-child {
    border-bottom: none;
}

.content-connections__section h3 {
    color: var(--color-text-primary);
    margin-bottom: var(--space-3);
}

/* "What to do next" gets special treatment */
.content-connections__section--next {
    background: var(--color-bg-page);
    padding: var(--space-4);
    border-left: 3px solid var(--color-success);
    margin-bottom: var(--space-5);
}

.content-connections__section--next h3 {
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Connection list */
.content-connections__list {
    margin: 0;
    padding: 0;
}

.content-connections__item {
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px dotted var(--color-border-light);
}

.content-connections__item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Next step items have arrow */
.content-connections__item--next .content-connections__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: var(--font-weight-bold);
    text-decoration: none;
    padding: var(--space-2) 0;
}

.content-connections__item--next .content-connections__link:hover {
    text-decoration: underline;
}

.content-connections__arrow {
    color: var(--color-success);
    font-size: 1.2em;
    transition: transform var(--transition-base);
}

.content-connections__item--next .content-connections__link:hover .content-connections__arrow {
    transform: translateX(4px);
}

.content-connections__description {
    color: var(--color-text-secondary);
    margin: var(--space-1) 0 0 0;
}

/* Details component for snippets */
.content-connections__details {
    margin-top: var(--space-4);
    border: 1px solid var(--color-border-light);
    background: var(--color-bg-white);
}

.content-connections__details .govuk-details__summary {
    padding: var(--space-3) var(--space-4);
}

.content-connections__details .govuk-details__text {
    padding: var(--space-3) var(--space-4);
    padding-top: 0;
}

.content-connections__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    height: 1.5em;
    background: var(--color-gov-blue);
    color: white;
    border-radius: 50%;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    margin-left: var(--space-2);
}

.content-connections__snippets {
    margin-top: var(--space-3);
    font-size: var(--font-size-sm);
}

.content-connections__snippets li {
    margin-bottom: var(--space-1);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .content-connections {
        padding-top: var(--space-4);
        margin-top: var(--space-5);
    }

    .content-connections__section--next {
        padding: var(--space-3);
    }
}

/* ==========================================================================
   Section Navigation - Jump links for long index pages
   ========================================================================== */

.section-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    border-left: 4px solid var(--color-gov-blue);
    margin-bottom: var(--space-6);
    position: sticky;
    top: 0;
    z-index: 100;
}

.section-nav__label {
    font-weight: var(--font-weight-bold);
    color: var(--color-text-secondary);
    margin-right: var(--space-2);
}

.section-nav__link {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-page);
    border: 1px solid var(--color-border);
    color: var(--color-link);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: background var(--transition-base), border-color var(--transition-base);
}

.section-nav__link:hover {
    background: var(--color-info-bg);
    border-color: var(--color-gov-blue);
    text-decoration: underline;
}

.section-nav__link:focus {
    outline: 3px solid var(--color-focus);
    outline-offset: 0;
    background: var(--color-focus);
    color: var(--color-focus-text);
}

/* Subsector links (within decomposed Sector-Specific section) */
/* Now styled consistently with other nav links for visual uniformity */
.section-nav__link--subsector {
    /* Inherits all styles from .section-nav__link */
}

.section-nav__count {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-left: 2px;
}

.section-nav__controls {
    margin-left: auto;
    display: flex;
    gap: var(--space-2);
}

.section-nav__btn {
    padding: var(--space-1) var(--space-2);
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: background var(--transition-base);
}

.section-nav__btn:hover {
    background: var(--color-bg-page);
}

.section-nav__btn:focus {
    outline: 3px solid var(--color-focus);
    outline-offset: 0;
}

/* ==========================================================================
   Collapsible Sections - Native <details> with GOV.UK styling
   ========================================================================== */

.collapsible-section {
    border: 0;
    margin-bottom: var(--space-6);
}

.collapsible-section > summary {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    cursor: pointer;
    list-style: none;
    border-bottom: 2px solid var(--color-gov-blue);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.collapsible-section > summary::-webkit-details-marker {
    display: none;
}

.collapsible-section > summary::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border: solid var(--color-text-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(-45deg);
    transition: transform var(--transition-slow);
    flex-shrink: 0;
}

.collapsible-section[open] > summary::before {
    transform: rotate(45deg);
}

.collapsible-section > summary:hover {
    color: var(--color-gov-blue);
}

.collapsible-section > summary:focus {
    outline: 3px solid var(--color-focus);
    outline-offset: 0;
    background: var(--color-focus);
}

.collapsible-section__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2em;
    height: 2em;
    background: var(--color-gov-blue);
    color: white;
    border-radius: 50%;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}

.collapsible-section__description {
    margin: var(--space-3) 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.collapsible-section__content {
    padding-top: var(--space-4);
}

/* Section type badge - indicates sector vs topic sections */
.section-type-badge {
    display: inline-block;
    padding: 0.125em 0.5em;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: 3px;
    margin-left: var(--space-2);
    vertical-align: middle;
}

.section-type-badge.sector-badge {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ==========================================================================
   Facet Filters - Inline filter pills
   ========================================================================== */

.facet-filters-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    margin-bottom: var(--space-6);
}

.facet-filters-inline__group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.facet-filters-inline__label {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.facet-filters-inline__pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.facet-pill {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-page);
    border: 1px solid var(--color-border);
    color: var(--color-link);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: background var(--transition-base), border-color var(--transition-base);
}

.facet-pill:hover {
    background: var(--color-info-bg);
    border-color: var(--color-gov-blue);
}

.facet-pill:focus {
    outline: 3px solid var(--color-focus);
    outline-offset: 0;
    background: var(--color-focus);
    color: var(--color-focus-text);
}

.facet-pill--active {
    background: var(--color-gov-blue);
    border-color: var(--color-gov-blue);
    color: white;
}

.facet-pill--active:hover {
    background: var(--color-gov-blue-dark);
    color: white;
}

.facet-pill.active {
    background: var(--color-gov-blue);
    border-color: var(--color-gov-blue);
    color: white;
}

.facet-pill.active:hover {
    background: var(--color-gov-blue-dark);
    color: white;
}

/* Facet pills container with label */
.facet-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background: var(--color-bg-page);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.facet-pills__label {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-right: var(--space-2);
}

/* View mode toggle tabs */
.view-mode-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-border);
}

.view-mode-toggle__label {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-right: var(--space-2);
}

.view-mode-toggle__btn {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-page);
    border: 2px solid var(--color-border);
    border-bottom: none;
    color: var(--color-link);
    text-decoration: none;
    font-size: var(--font-size-base);
    font-weight: 500;
    margin-bottom: -2px;
    position: relative;
    transition: background var(--transition-base), border-color var(--transition-base);
}

.view-mode-toggle__btn:hover {
    background: var(--color-info-bg);
    border-color: var(--color-gov-blue);
}

.view-mode-toggle__btn:focus {
    outline: 3px solid var(--color-focus);
    outline-offset: 0;
    background: var(--color-focus);
    color: var(--color-focus-text);
}

.view-mode-toggle__btn.active {
    background: white;
    border-color: var(--color-gov-blue);
    border-bottom: 2px solid white;
    color: var(--color-text);
    font-weight: 700;
}

/* Intent badge (for journey cards in sector view) */
.badge.intent-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-2);
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

/* Sector badge (for journey cards in intent view) */
.badge.sector-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-2);
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    border-color: #90caf9;
}

.badge.sector-badge.cross-sector {
    background: #f5f5f5;
    color: #616161;
    border-color: #e0e0e0;
}

/* ==========================================================================
   Responsive - Section Nav and Collapsible
   ========================================================================== */

@media (max-width: 768px) {
    .section-nav {
        position: relative;
        top: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .section-nav__controls {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    .section-nav__link {
        padding: var(--space-2) var(--space-3);
    }

    .facet-filters-inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .facet-filters-inline__group {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   Related Legislation Component
   GOV.UK-style legal basis section with institutional precision
   ========================================================================== */

.related-legislation {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
    background: var(--color-bg-white);
    border-left: 4px solid var(--color-gov-blue);
    box-shadow: var(--shadow-sm);
}

.related-legislation__heading {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-1) 0;
    line-height: var(--line-height-tight);
}

.related-legislation__intro {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-4) 0;
    max-width: 60ch;
    line-height: var(--line-height-base);
}

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

.related-legislation__item {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-3);
    align-items: start;
}

.related-legislation__item:first-child {
    padding-top: 0;
}

.related-legislation__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-legislation__content {
    min-width: 0;
}

.related-legislation__title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    margin: 0 0 var(--space-1) 0;
    line-height: var(--line-height-tight);
}

.related-legislation__title a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: max(1px, .0625rem);
    text-underline-offset: .1578em;
}

.related-legislation__title a:hover {
    color: var(--color-link-hover);
    text-decoration-thickness: max(3px, .1875rem);
}

.related-legislation__title a:focus {
    outline: var(--focus-width) solid transparent;
    background-color: var(--color-focus);
    box-shadow: 0 -2px var(--color-focus), 0 4px var(--color-focus-text);
    text-decoration: none;
    color: var(--color-focus-text);
}

/* External link indicator */
.related-legislation__title a::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231d70b8'%3E%3Cpath d='M12.5 8.5v4a1 1 0 01-1 1h-8a1 1 0 01-1-1v-8a1 1 0 011-1h4M9.5 2.5h4v4M6.5 9.5l6-6'/%3E%3Cpath fill='none' stroke='%231d70b8' stroke-width='1.5' d='M9.5 2.5h4v4M6.5 9.5l6-6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    opacity: 0.7;
}

.related-legislation__title a:hover::after {
    opacity: 1;
}

.related-legislation__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    margin-top: var(--space-1);
}

/* Legislation type badges */
.legislation-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 13px;
    font-weight: var(--font-weight-regular);
    border-radius: var(--border-radius-sm);
    line-height: 1.4;
    white-space: nowrap;
}

.legislation-type-badge--act {
    background: #f3e8ff;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

.legislation-type-badge--si {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.legislation-type-badge--scottish {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.legislation-type-badge--welsh {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.legislation-type-badge--ni {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.legislation-type-badge--eu {
    background: #fce7f3;
    color: #9d174d;
    border: 1px solid #fbcfe8;
}

/* Year display */
.related-legislation__year {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

/* Geographic scope indicators */
.legislation-scope {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    padding: 2px 8px;
    background: var(--color-bg-page);
    border-radius: var(--border-radius-sm);
}

.legislation-scope__icon {
    width: 14px;
    height: 10px;
    border-radius: 1px;
    flex-shrink: 0;
}

/* Mini flag representations */
.legislation-scope__icon--uk {
    background: linear-gradient(180deg, #012169 33%, #fff 33%, #fff 40%, #c8102e 40%, #c8102e 60%, #fff 60%, #fff 67%, #012169 67%);
}

.legislation-scope__icon--scotland {
    background: #0065bd;
    position: relative;
}

.legislation-scope__icon--scotland::before {
    content: "×";
    position: absolute;
    color: white;
    font-size: 10px;
    line-height: 10px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.legislation-scope__icon--wales {
    background: linear-gradient(180deg, #fff 50%, #00ab39 50%);
}

.legislation-scope__icon--ni {
    background: linear-gradient(180deg, #fff 50%, #cf142b 50%);
}

.legislation-scope__icon--england {
    background: #fff;
    border: 1px solid #ddd;
    position: relative;
}

.legislation-scope__icon--england::before {
    content: "+";
    position: absolute;
    color: #c8102e;
    font-size: 12px;
    font-weight: bold;
    line-height: 8px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Sidebar alignment for badges */
.related-legislation__badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-2);
}

/* Reference count */
.legislation-refs {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-align: right;
}

/* Empty state */
.related-legislation--empty {
    padding: var(--space-4);
    background: var(--color-bg-page);
    border-radius: var(--border-radius-sm);
    text-align: center;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* Compact variant for sidebars */
.related-legislation--compact {
    padding: var(--space-4);
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-gov-blue);
}

.related-legislation--compact .related-legislation__heading {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-3);
}

.related-legislation--compact .related-legislation__item {
    grid-template-columns: 1fr;
    padding: var(--space-3) 0;
}

.related-legislation--compact .related-legislation__title {
    font-size: var(--font-size-sm);
}

.related-legislation--compact .related-legislation__badges {
    flex-direction: row;
    align-items: center;
    margin-top: var(--space-2);
}

/* === LEGISLATION GROUPS (Aggregated legal basis by type) === */
.legislation-group {
    margin-bottom: var(--space-5);
}

.legislation-group:last-child {
    margin-bottom: 0;
}

.legislation-group__heading {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--space-3) 0;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border-light);
}

/* Group-specific accent colors - subtle distinction */
.legislation-group--primary .legislation-group__heading {
    color: var(--color-text-secondary);
}

.legislation-group--secondary .legislation-group__heading {
    color: var(--color-text-muted);
}

.legislation-group--other .legislation-group__heading {
    color: var(--color-text-muted);
}

/* Guide-level indicator - no longer using nested border (panel has border)
   Keep class for potential future use but don't add visual distinction */
.related-legislation__item--guide-level {
    /* No additional styling - panel border provides hierarchy */
}

/* Nested heading level for accessibility */
.legislation-group h4.related-legislation__title {
    font-size: var(--font-size-base);
}

/* Accessible screen reader text for external links */
.related-legislation .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .related-legislation__item {
        grid-template-columns: 1fr;
    }

    .related-legislation__badges {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        margin-top: var(--space-2);
    }

    .related-legislation {
        padding: var(--space-4);
        margin: var(--space-5) 0;
    }
}

/* === PROVISION SUMMARIES (duties/offences under each Act in sidebar) === */

.provision-summary {
    list-style: none;
    margin: var(--space-2) 0 0;
    padding: var(--space-2) 0 0;
    border-top: 1px solid var(--color-border-light);
    grid-column: 1 / -1;
}

.provision-summary__item {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    padding: 2px 0;
    font-size: var(--font-size-xs);
    line-height: var(--line-height-base);
}

.provision-summary__ref {
    flex-shrink: 0;
    min-width: 3rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.provision-summary__title {
    flex: 1;
    color: var(--color-text-secondary);
}

.provision-summary__type {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 5px;
    border-radius: 2px;
}

.provision-summary__type--duty {
    color: #0369a1;
    background: #e0f2fe;
}

.provision-summary__type--offence {
    color: #9f1239;
    background: #ffe4e6;
}


/* === PROVISION PULL-QUOTE (inline statutory text block) === */

.provision-quote {
    margin: var(--space-5) 0;
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-page);
    border-left: 4px solid var(--color-gov-blue);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.provision-quote__text {
    margin: 0 0 var(--space-3);
    font-size: var(--font-size-base);
    line-height: 1.65;
    color: var(--color-text-primary);
    font-style: italic;
    quotes: "\201C" "\201D";
}

.provision-quote__text::before {
    content: open-quote;
    font-size: 1.5em;
    line-height: 0;
    vertical-align: -0.15em;
    color: var(--color-text-muted);
}

.provision-quote__text::after {
    content: close-quote;
    font-size: 1.5em;
    line-height: 0;
    vertical-align: -0.15em;
    color: var(--color-text-muted);
}

.provision-quote__citation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.provision-quote__section {
    font-family: var(--font-mono, monospace);
    font-size: 0.8125rem;
    color: var(--color-text-primary);
    font-weight: 600;
}

.provision-quote__act {
    color: var(--color-text-secondary);
}

.provision-quote__act a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.provision-quote__act a:hover {
    color: var(--color-link-hover);
}

.provision-quote__type {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 5px;
    border-radius: 2px;
}

.provision-quote__type--duty {
    color: #0369a1;
    background: #e0f2fe;
}

.provision-quote__type--offence {
    color: #9f1239;
    background: #ffe4e6;
}

.provision-quote__type--definition {
    color: #4338ca;
    background: #e0e7ff;
}

.provision-quote__type--exemption {
    color: #166534;
    background: #dcfce7;
}

.provision-quote__type--power {
    color: #92400e;
    background: #fef3c7;
}

/* Responsive */
@media (max-width: 640px) {
    .provision-summary__item {
        flex-wrap: wrap;
    }

    .provision-quote {
        padding: var(--space-3) var(--space-4);
    }
}

/* Print styles */
@media print {
    .related-legislation {
        border-left-color: #000;
        box-shadow: none;
        break-inside: avoid;
    }

    .related-legislation__title a::after {
        content: " (" attr(href) ")";
        font-size: 10px;
        background: none;
        width: auto;
        height: auto;
    }

    .provision-quote {
        border-left-color: #000;
        break-inside: avoid;
    }
}

/* =============================================================================
   SUPPORT ORGANIZATIONS - GOV.UK Panel Style
   Left border accent, clean hierarchy, compact but readable
   ============================================================================= */

.support-orgs {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
    background: var(--color-bg-white);
    border-left: 4px solid var(--color-turquoise);
    box-shadow: var(--shadow-sm);
}

.support-orgs__heading {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-1) 0;
    line-height: var(--line-height-tight);
}

.support-orgs__lede {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-4) 0;
    line-height: var(--line-height-base);
}

.support-orgs__lede strong {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-bold);
}

.support-orgs__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.support-orgs__item {
    border-top: 1px solid var(--color-border-light);
}

.support-orgs__item:first-child {
    border-top: none;
}

.support-orgs__link {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.support-orgs__link:hover {
    background: var(--color-bg-alt);
    margin-left: calc(var(--space-5) * -1);
    margin-right: calc(var(--space-4) * -1);
    padding-left: var(--space-5);
    padding-right: var(--space-4);
}

.support-orgs__link:focus {
    outline: var(--focus-width) solid transparent;
    background: var(--color-focus);
    box-shadow: 0 -2px var(--color-focus), 0 4px var(--color-text-primary);
}

.support-orgs__link:focus .support-orgs__name {
    color: var(--color-text-primary);
}

.support-orgs__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-link);
    flex: 1;
    min-width: 0;
}

.support-orgs__link:hover .support-orgs__name {
    text-decoration: underline;
    text-decoration-thickness: max(3px, .1875rem);
    color: var(--color-link-hover);
}

.support-orgs__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.support-orgs__tag {
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.support-orgs__tag--govt {
    color: var(--color-turquoise-dark);
}

.support-orgs__fee {
    font-size: 12px;
    color: var(--color-text-muted);
    padding-left: var(--space-2);
    border-left: 1px solid var(--color-border-light);
    white-space: nowrap;
}

/* Responsive: Stack on narrow screens */
@media (max-width: 480px) {
    .support-orgs__link {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }

    .support-orgs__meta {
        margin-top: var(--space-1);
    }
}

/* Print styles */
@media print {
    .support-orgs {
        border-left: 2px solid #000;
        box-shadow: none;
        break-inside: avoid;
    }

    .support-orgs__link:hover {
        background: none;
        margin: 0;
        padding: var(--space-3) 0;
    }
}

/* ==========================================================================
   AUTHORITATIVE GUIDANCE
   Official regulator guidance that explains legislation
   ========================================================================== */

.authoritative-guidance {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
    background: var(--color-bg-white);
    border-left: 4px solid var(--color-turquoise);
    box-shadow: var(--shadow-sm);
}

.authoritative-guidance__heading {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-1) 0;
    line-height: var(--line-height-tight);
}

.authoritative-guidance__intro {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-4) 0;
    max-width: 60ch;
    line-height: var(--line-height-base);
}

.authoritative-guidance__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.authoritative-guidance__item {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.authoritative-guidance__item:first-child {
    padding-top: 0;
}

.authoritative-guidance__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.authoritative-guidance__link {
    display: block;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: max(1px, .0625rem);
    text-underline-offset: .1578em;
    margin-bottom: var(--space-1);
}

.authoritative-guidance__link:hover {
    color: var(--color-link-hover);
    text-decoration-thickness: max(3px, .1875rem);
}

.authoritative-guidance__link:focus {
    outline: var(--focus-width) solid transparent;
    background-color: var(--color-focus);
    box-shadow: 0 -2px var(--color-focus), 0 4px var(--color-focus-text);
    text-decoration: none;
    color: var(--color-focus-text);
}

.authoritative-guidance__link::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%231d70b8' d='M6 0v1h4.3L3.6 7.6l.7.7L11 1.7V6h1V0z'/%3E%3Cpath fill='%231d70b8' d='M1 2v9h9V6h-1v4H2V3h4V2z'/%3E%3C/svg%3E") no-repeat center;
    opacity: 0.7;
}

.authoritative-guidance__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.authoritative-guidance__publisher {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* Guidance type badges */
.guidance-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 6px;
    border-radius: 2px;
    line-height: 1.3;
}

.guidance-type-badge--factsheet {
    background: #f3f2f1;
    color: #505a5f;
}

.guidance-type-badge--guidance {
    background: var(--color-turquoise-light);
    color: var(--color-turquoise-dark);
}

.guidance-type-badge--publication {
    background: #d4e4f7;
    color: #1d70b8;
}

.guidance-type-badge--form {
    background: #fef4f2;
    color: #b4451d;
}

.guidance-type-badge--tool {
    background: #f3f2f1;
    color: #505a5f;
}

.guidance-type-badge--code {
    background: #e5f0e0;
    color: #00703c;
}

.guidance-type-badge--approved_doc {
    background: #fbe5d6;
    color: #8f4800;
}

.guidance-type-badge--tech_note {
    background: #f3f2f1;
    color: #505a5f;
}

.guidance-type-badge--legislation {
    background: #d4e4f7;
    color: #1d70b8;
}

.guidance-type-badge--other {
    background: #f3f2f1;
    color: #505a5f;
}

/* Guidance list for regulator profile pages */
.guidance-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.guidance-item {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
}

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

.guidance-link {
    display: block;
    font-weight: var(--font-weight-bold);
    color: var(--color-link);
    text-decoration: underline;
    margin-bottom: var(--space-1);
}

.guidance-link:hover {
    color: var(--color-link-hover);
}

.guidance-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.guidance-jurisdiction {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.guidance-more {
    padding-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* Responsive */
@media (max-width: 640px) {
    .authoritative-guidance {
        padding: var(--space-4);
        margin: var(--space-5) 0;
    }
}

/* Print styles */
@media print {
    .authoritative-guidance {
        border-left-color: #000;
        box-shadow: none;
        break-inside: avoid;
    }
}
