/* ============================================================
   Free Scottish Wills - Main Stylesheet
   Modern, accessible, responsive design
   ============================================================ */
/* --- CSS Custom Properties --- */
:root {
    /* Primary palette - Scottish-inspired navy and teal */
    --color-primary: #003078;
    --color-primary-dark: #001f4e;
    --color-primary-light: #1a5276;
    --color-accent: #48A9A6;
    --color-accent-dark: #3a8a87;
    --color-accent-light: #6bc4c1;
    /* Neutrals */
    --color-white: #ffffff;
    --color-off-white: #f8f9fa;
    --color-light-grey: #e9ecef;
    --color-mid-grey: #adb5bd;
    --color-dark-grey: #495057;
    --color-text: #212529;
    --color-text-light: #6c757d;
    /* Semantic */
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #17a2b8;
    /* Typography */
    --font-body: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    /* Layout */
    --container-max: 1200px;
    --container-narrow: 800px;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    /* Transitions */
    --transition: 0.2s ease;
}
/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main {
    flex: 1;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}
ul, ol {
    padding-left: 1.5rem;
}
/* --- Skip Link (Accessibility) --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius-sm);
    z-index: 10000;
    font-weight: 600;
}
.skip-link:focus {
    top: var(--space-sm);
    text-decoration: none;
}
/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; margin-top: var(--space-2xl); }
h3 { font-size: 1.35rem; margin-top: var(--space-xl); }
h4 { font-size: 1.15rem; }
p {
    margin-bottom: var(--space-md);
}
.lead-text {
    font-size: 1.2rem;
    color: var(--color-dark-grey);
    line-height: 1.7;
}
.text-centre { text-align: center; }
.text-muted { color: var(--color-text-light); font-size: 0.9rem; }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
/* --- Container --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}
.content-wrapper {
    max-width: var(--container-narrow);
    margin: 0 auto;
}
.text-content h2 {
    margin-top: var(--space-2xl);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-light-grey);
}
.text-content ul, .text-content ol {
    margin-bottom: var(--space-md);
}
.text-content li {
    margin-bottom: var(--space-sm);
}
/* --- Header --- */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-light-grey);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.logo:hover {
    color: var(--color-primary);
    text-decoration: none;
}
.logo-icon {
    flex-shrink: 0;
}
.main-nav .nav-list {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
    padding: 0;
    margin: 0;
}
.main-nav .nav-list a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--color-dark-grey);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}
.main-nav .nav-list a:hover,
.main-nav .nav-list a.active {
    color: var(--color-primary);
    background: var(--color-off-white);
    text-decoration: none;
}
/* Nav buttons */
.nav-btn {
    padding: var(--space-sm) var(--space-lg) !important;
    border-radius: var(--border-radius) !important;
    font-weight: 600 !important;
}
.nav-btn-primary {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
}
.nav-btn-primary:hover {
    background: var(--color-primary-dark) !important;
    color: var(--color-white) !important;
}
.nav-btn-outline {
    border: 2px solid var(--color-primary) !important;
    color: var(--color-primary) !important;
}
.nav-btn-outline:hover {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
}
/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}
.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    position: relative;
    transition: all var(--transition);
}
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    left: 0;
    transition: all var(--transition);
}
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
/* --- Flash Messages --- */
.flash-messages {
    padding: var(--space-sm) 0;
}
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-sm);
    font-size: 0.95rem;
}
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.flash-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.flash-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
}
.flash-close:hover { opacity: 1; }
/* --- Alerts --- */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-lg);
    font-size: 0.95rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert p { margin-bottom: var(--space-sm); }
.alert p:last-child { margin-bottom: 0; }
.alert ul { margin-top: var(--space-sm); }
/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: var(--font-body);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-white);
}
.btn-secondary {
    background: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}
.btn-secondary:hover {
    background: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    color: var(--color-white);
}
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}
.btn-outline-light {
    background: transparent;
    color: var(--color-white);
    border-color: rgba(255,255,255,0.5);
}
.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--color-white);
    color: var(--color-white);
}
.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
    border-color: var(--color-danger);
}
.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    color: var(--color-white);
}
.btn-warning {
    background: var(--color-warning);
    color: var(--color-text);
    border-color: var(--color-warning);
}
.btn-full { display: block; width: 100%; }
.btn-large { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.85rem; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.8rem; }
/* --- Forms --- */
.form-group {
    margin-bottom: var(--space-lg);
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
    font-size: 0.95rem;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group input[type="tel"],
.form-group input[type="search"],
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    font-family: var(--font-body);
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-white);
    border: 2px solid var(--color-light-grey);
    border-radius: var(--border-radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 48, 120, 0.1);
}
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: var(--color-danger);
}
.field-error {
    display: block;
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}
.field-hint {
    display: block;
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}
.field-hint a { color: var(--color-primary); }
.required { color: var(--color-danger); }
.form-row {
    display: grid;
    gap: var(--space-md);
}
.form-row-2col { grid-template-columns: 1fr 1fr; }
.form-row-3col { grid-template-columns: 1fr 1fr 1fr; }
.form-group-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/* Checkboxes and Radios */
.checkbox-label,
.radio-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    font-weight: 400;
    line-height: 1.5;
}
.checkbox-label input,
.radio-label input {
    margin-top: 0.25rem;
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--color-primary);
}
.radio-group {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}
.important-checkbox {
    background: #fff3cd;
    padding: var(--space-md);
    border-radius: var(--border-radius);
    border: 1px solid #ffeeba;
}
/* --- Auth Forms --- */
.auth-form-wrapper {
    max-width: 500px;
    margin: 0 auto;
    padding: var(--space-2xl) 0;
}
.auth-subtitle {
    color: var(--color-text-light);
    margin-bottom: var(--space-xl);
}
.auth-switch {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--color-text-light);
}
.forgot-link {
    font-size: 0.9rem;
}
/* --- Page Header --- */
.page-header {
    background: #174B73;
    color: var(--color-white);
    padding: var(--space-3xl) 0;
    margin-bottom: var(--space-2xl);
}
.page-header h1 {
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}
.page-header .page-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.15rem;
}
.page-content {
    padding: var(--space-xl) 0 var(--space-3xl);
}
/* --- Hero Section --- */
.hero-section {
    background: #174B73;
    color: var(--color-white);
    padding: 5rem 0;
    overflow: hidden;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 5rem;
    align-items: center;
}
.hero-content h1 {
    color: var(--color-white);
    max-width: 620px;
    font-size: 3.5rem;
    line-height: 1.07;
    letter-spacing: -0.035em;
    margin-bottom: 0;
}
.hero-subtitle {
    max-width: 580px;
    margin-top: 1.5rem;
    margin-bottom: 0;
    font-size: 1.1875rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 2rem;
}
.hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2.25rem;
    margin-bottom: 0;
}
.hero-actions .btn-primary {
    background: #0C2F55;
    border-color: transparent;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(5, 27, 52, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.hero-actions .btn-primary:hover {
    background: #092645;
    border-color: transparent;
    color: var(--color-white);
}
.hero-actions .btn-outline {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    border-width: 1px;
    border-radius: 8px;
    padding: 0.95rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
}
.hero-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--color-white);
}
.hero-note,
.hero-trust {
    margin-bottom: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.6);
}
.hero-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.hero-note svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}
.hero-trust {
    margin-top: 0.5rem;
}
.hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-image img {
    max-width: 100%;
    height: auto;
}
/* --- Features Section --- */
.features-section {
    padding: var(--space-3xl) 0;
}
.section-header {
    margin-bottom: var(--space-2xl);
}
.section-header h2 {
    margin-top: 0;
}
.section-header p {
    color: var(--color-text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}
.feature-card {
    text-align: center;
    padding: var(--space-xl);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-light-grey);
    transition: all var(--transition);
}
.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    border-radius: 14px;
    background: #EAF6F5;
    color: #267F7C;
}
.feature-icon svg {
    width: 36px;
    height: 36px;
}
.feature-card h3 {
    margin-top: 0;
    font-size: 1.2rem;
}
.feature-card p {
    color: var(--color-text-light);
    font-size: 0.95rem;
}
/* --- How It Works Steps --- */
.how-it-works-section {
    padding: var(--space-3xl) 0;
}
.bg-light {
    background: var(--color-off-white);
}
.steps-grid {
    --steps-gap: var(--space-xl);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--steps-gap);
    position: relative;
}
.steps-grid::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: calc(var(--space-xl) + 24px);
    left: calc((100% - 2 * var(--steps-gap)) / 6);
    right: calc((100% - 2 * var(--steps-gap)) / 6);
    height: 1px;
    background: #C8D3DC;
    pointer-events: none;
}
.step-card {
    text-align: center;
    padding: var(--space-xl);
}
.step-number {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #123F70;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 auto var(--space-lg);
    box-shadow: 0 0 0 8px var(--color-off-white);
}
.how-it-works-cta {
    margin-top: 4rem;
}
.how-it-works-section .how-it-works-cta .btn-primary {
    background: #123F70;
    border-color: #123F70;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 0.9375rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
.how-it-works-section .how-it-works-cta .btn-primary:hover {
    background: #0C3158;
    border-color: #0C3158;
    color: var(--color-white);
}
.step-card h3 {
    margin-top: 0;
}
/* --- Two Column Layout --- */
.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    padding: var(--space-3xl) 0;
}
.col-content .check-list {
    list-style: none;
    padding: 0;
}
.check-list li {
    padding-left: 1.8rem;
    position: relative;
    margin-bottom: var(--space-sm);
}
.check-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: 700;
}
.quote-box {
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--space-2xl);
    border-radius: var(--border-radius-lg);
    font-size: 1.1rem;
    line-height: 1.7;
    font-style: italic;
}
.quote-box .legal-term {
    color: var(--color-white) !important;
    border-bottom: 1px dashed var(--color-accent-light) !important;
    cursor: help;
}

.quote-box .legal-term:hover,
.quote-box .legal-term:focus {
    color: var(--color-white) !important;
    border-bottom: 1px solid var(--color-accent-light) !important;
    outline: none;
}
.scots-law-section .two-col-layout {
    align-items: start;
}
.col-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}
.home-region-chart {
    margin: 0;
    padding: var(--space-lg);
    background: var(--color-off-white);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-light-grey);
}
.home-region-chart-visual {
    display: flex;
    justify-content: center;
}
.home-region-donut {
    width: 220px;
    height: 220px;
}
.home-region-donut-track {
    stroke: var(--color-light-grey);
}
.home-region-slice-glasgow_west,
.home-region-swatch-glasgow_west { stroke: #003078; background: #003078; }
.home-region-slice-edinburgh_lothians,
.home-region-swatch-edinburgh_lothians { stroke: #E67E22; background: #E67E22; }
.home-region-slice-north_east,
.home-region-swatch-north_east { stroke: #48A9A6; background: #48A9A6; }
.home-region-slice-fife_tayside_central,
.home-region-swatch-fife_tayside_central { stroke: #1a5276; background: #1a5276; }
.home-region-slice-highlands_islands,
.home-region-swatch-highlands_islands { stroke: #F4A261; background: #F4A261; }
.home-region-slice-south_borders,
.home-region-swatch-south_borders { stroke: #6C5B7B; background: #6C5B7B; }
.home-region-caption {
    margin: var(--space-md) 0 var(--space-sm);
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}
.home-region-legend {
    list-style: none;
    padding: 0;
    margin: 0;
}
.home-region-legend li {
    display: grid;
    grid-template-columns: 0.85rem 1fr auto;
    gap: 0.55rem;
    align-items: center;
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
    color: var(--color-text);
}
.home-region-swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 2px;
    display: inline-block;
}
.home-region-legend-pct {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
/* --- CTA Section --- */
.cta-section {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: var(--color-white);
    padding: var(--space-3xl) 0;
}
.cta-section h2 {
    color: var(--color-white);
    margin-top: 0;
}
.cta-section p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    margin-bottom: var(--space-xl);
}
.cta-section .btn-primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
}
.cta-section .btn-primary:hover {
    background: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
}
.cta-box {
    background: var(--color-off-white);
    padding: var(--space-2xl);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-light-grey);
}
.cta-box h3 { margin-top: 0; }
/* --- Info / Tooltip Boxes --- */
.info-box,
.tooltip-box {
    background: #e8f4f8;
    border-left: 4px solid var(--color-accent);
    padding: var(--space-lg);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin-bottom: var(--space-xl);
}
.info-box h3,
.tooltip-box h3 {
    margin-top: 0;
    color: var(--color-primary);
    font-size: 1.05rem;
}
.info-box p:last-child,
.tooltip-box p:last-child {
    margin-bottom: 0;
}
/* --- FAQ --- */
.faq-nav {
    max-width: var(--container-narrow);
    margin: 0 auto var(--space-2xl);
    background: var(--color-off-white);
    border: 1px solid var(--color-light-grey);
    border-radius: var(--border-radius);
    padding: var(--space-lg) var(--space-xl);
}
.faq-nav-label {
    font-weight: 600;
    margin-bottom: var(--space-sm);
}
.faq-nav ol {
    margin: 0;
    padding-left: 1.25rem;
}
.faq-nav li {
    margin-bottom: var(--space-xs);
}
.faq-nav li:last-child {
    margin-bottom: 0;
}
.faq-list {
    max-width: var(--container-narrow);
    margin: 0 auto;
}
.faq-list h2 {
    margin-top: var(--space-2xl);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-light-grey);
    scroll-margin-top: 8rem;
}
.faq-list h2:first-child {
    margin-top: 0;
}
.faq-item {
    border-bottom: 1px solid var(--color-light-grey);
    padding: var(--space-xl) 0;
}
.faq-item h3 {
    margin-top: 0;
    color: var(--color-primary);
    font-size: 1.15rem;
}
.faq-item p:last-child,
.faq-item ul:last-child { margin-bottom: 0; }
.faq-item ul {
    margin: 0 0 var(--space-md) 1.25rem;
}
.faq-item li {
    margin-bottom: var(--space-sm);
}
/* --- Timeline --- */
.timeline {
    max-width: var(--container-narrow);
    margin: var(--space-2xl) auto;
    position: relative;
    padding-left: 60px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-light-grey);
}
.timeline-item {
    position: relative;
    margin-bottom: var(--space-2xl);
}
.timeline-number {
    position: absolute;
    left: -60px;
    top: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    z-index: 1;
}
.timeline-content h2 {
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
}
/* --- Dashboard --- */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}
.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    background: var(--color-off-white);
    border-radius: var(--border-radius-lg);
    border: 2px dashed var(--color-light-grey);
}
.icon-xlarge {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    color: var(--color-mid-grey);
}
.icon-large {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
}
.icon-success { color: var(--color-success); }
.icon-error { color: var(--color-danger); }
.icon-info { color: var(--color-info); }
.wills-list {
    display: grid;
    gap: var(--space-lg);
}
.will-card {
    background: var(--color-white);
    border: 1px solid var(--color-light-grey);
    border-radius: var(--border-radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}
.will-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}
.will-card-header h2 {
    margin: 0;
    font-size: 1.3rem;
}
.will-card-meta {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}
.will-card-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.dashboard-info-box {
    margin-top: var(--space-2xl);
    background: var(--color-off-white);
    padding: var(--space-xl);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-light-grey);
}
.dashboard-info-box h3 { margin-top: 0; }
/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-primary { background: #cce5ff; color: #004085; }
.badge-default { background: var(--color-light-grey); color: var(--color-dark-grey); }
/* --- Review Tables --- */
.review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.review-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-light-grey);
    vertical-align: top;
}
.review-table td:first-child {
    font-weight: 600;
    width: 35%;
    color: var(--color-dark-grey);
}
/* --- Account --- */
.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}
.account-card {
    background: var(--color-white);
    border: 1px solid var(--color-light-grey);
    border-radius: var(--border-radius-lg);
    padding: var(--space-xl);
}
.account-card h2 {
    margin-top: 0;
    font-size: 1.2rem;
}
.settings-sections {
    max-width: 600px;
}
.settings-section {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-2xl);
    border-bottom: 1px solid var(--color-light-grey);
}
.settings-section:last-child {
    border-bottom: none;
}
.settings-section h2 {
    margin-top: 0;
}
/* --- Footer --- */
.site-footer {
    background: var(--color-text);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-3xl) 0 var(--space-lg);
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}
.footer-grid h3 {
    color: var(--color-white);
    font-size: 1rem;
    margin-bottom: var(--space-md);
}
.footer-grid ul {
    list-style: none;
    padding: 0;
}
.footer-grid li {
    margin-bottom: var(--space-sm);
}
.footer-grid a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}
.footer-grid a.footer-message-link {
    color: #fff;
    text-decoration: underline;
}
.footer-grid a:hover {
    color: var(--color-white);
}
.footer-company {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}
.footer-grid p {
    font-size: 0.9rem;
    line-height: 1.6;
}
.footer-disclaimer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-xl);
    margin-bottom: var(--space-xl);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}
.footer-disclaimer a {
    color: var(--color-accent-light);
}
.footer-solicitor-cta {
    text-align: center;
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-xl);
}
.footer-solicitor-cta p {
    margin-bottom: var(--space-sm);
    color: rgba(255, 255, 255, 0.7);
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-lg);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}
/* Homepage trust strip and footer, scoped so other pages keep the existing footer. */
.home-trust-bar {
    background: #F5F7F8;
    border-bottom: 1px solid #DDE5EB;
}
.home-trust-list {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 68px;
    margin: 0 auto;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    list-style: none;
}
.home-trust-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #405468;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}
.home-trust-list svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    color: #2E9F9B;
}
.home-trust-divider {
    width: 1px;
    height: 1.25rem;
    flex: 0 0 1px;
    padding: 0;
    background: #D7E0E7;
}
.page-home .site-footer {
    background: #20272D;
    padding-top: 0;
    padding-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.65);
}
.page-home .site-footer > .container {
    padding-top: 5rem;
}
.page-home .footer-grid {
    grid-template-columns: 1.35fr 0.8fr 0.8fr 1.45fr;
    gap: 4rem;
    margin-bottom: 4rem;
}
.page-home .footer-grid h3 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.page-home .footer-col:first-child h3 {
    margin-bottom: 1rem;
    font-size: 1.0625rem;
    letter-spacing: normal;
    text-transform: none;
}
.page-home .footer-grid p,
.page-home .footer-grid li,
.page-home .footer-grid a {
    font-size: 0.8125rem;
    line-height: 1.6;
}
.page-home .footer-grid ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.page-home .footer-grid li {
    margin-bottom: 0;
}
.page-home .footer-col:first-child p {
    max-width: 260px;
    color: rgba(255, 255, 255, 0.65);
}
.page-home .footer-col:first-child .footer-company {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}
.page-home .footer-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}
.page-home .footer-grid a {
    color: rgba(255, 255, 255, 0.6);
}
.page-home .footer-grid a:hover {
    color: #fff;
    text-decoration: none;
}
.page-home .footer-grid a.footer-message-link,
.page-home .footer-grid a.footer-message-link:hover {
    color: #67C4C0;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.page-home .footer-col:last-child p {
    max-width: none;
    color: rgba(255, 255, 255, 0.6);
}
.page-home .footer-col:last-child strong,
.page-home .footer-disclaimer strong {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}
.page-home .footer-disclaimer {
    margin-bottom: 2rem;
    padding-top: 2rem;
    font-size: 0.75rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.5);
}
.page-home .footer-disclaimer strong {
    color: rgba(255, 255, 255, 0.7);
}
.page-home .footer-disclaimer a {
    color: #67C4C0;
    text-underline-offset: 2px;
}
.page-home .footer-solicitor-cta {
    margin-bottom: 2.5rem;
    padding: 1.75rem 1.5rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
}
.page-home .footer-solicitor-cta p {
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}
.page-home .footer-solicitor-cta .btn {
    border-color: rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    padding: 0.625rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
}
.page-home .footer-bottom {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.4);
}
/* --- Admin --- */
.admin-header {
    margin-bottom: var(--space-xl);
}
.admin-nav {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-top: var(--space-md);
    border-bottom: 2px solid var(--color-light-grey);
    padding-bottom: var(--space-sm);
}
.admin-nav a {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-dark-grey);
}
.admin-nav a:hover,
.admin-nav a.active {
    background: var(--color-off-white);
    color: var(--color-primary);
    text-decoration: none;
}
.admin-nav a.active {
    border-bottom: 2px solid var(--color-primary);
    margin-bottom: -2px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}
.stat-card {
    background: var(--color-white);
    border: 1px solid var(--color-light-grey);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    text-align: center;
}
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}
.stat-card-success .stat-number { color: var(--color-success); }
.stat-card-warning .stat-number { color: #e67e22; }
.stat-card-danger .stat-number { color: var(--color-danger); }
.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-sub {
    font-size: 0.8rem;
    color: var(--color-text-light);
}
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}
.admin-section {
    background: var(--color-white);
    border: 1px solid var(--color-light-grey);
    border-radius: var(--border-radius);
    padding: var(--space-xl);
    min-width: 0;
}
.admin-table-scroll {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.admin-table-scroll .admin-table {
    margin-bottom: 0;
}
.admin-section .admin-card-heading,
.admin-card-heading {
    text-align: left;
    padding-bottom: 0;
    margin: 0 0 0.75rem 0;
    border-bottom: none;
    font-size: 1.2rem;
}
.admin-message-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin: 0 0 var(--space-xl);
    align-items: start;
}
.admin-message-meta {
    margin: 0 0 0.4rem 0;
}
.admin-message-meta-muted {
    color: var(--color-text-light);
    font-size: 0.9rem;
}
.crm-firm-status {
    margin: 0 0 0.75rem 0;
}
.crm-firm-status-muted,
.crm-firm-status-muted + .field-hint {
    color: var(--color-text-light);
}
.crm-firm-summary-actions,
.crm-firm-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.crm-firm-na-form {
    display: inline;
    margin: 0;
}
.crm-firm-picker {
    border: none;
    padding: 0;
    margin: 0 0 1rem 0;
}
.crm-firm-picker-legend {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}
.crm-firm-picker-list {
    max-height: 12.5rem;
    overflow-y: auto;
    border: 2px solid var(--color-light-grey);
    border-radius: var(--border-radius);
    background: var(--color-white);
}
.crm-firm-picker-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.75rem;
    margin: 0;
    cursor: pointer;
    border-bottom: 1px solid var(--color-light-grey);
    font-weight: 400;
}
.crm-firm-picker-item:last-of-type {
    border-bottom: none;
}
.crm-firm-picker-item:hover {
    background: var(--color-off-white);
}
.crm-firm-picker-item:has(input:checked) {
    background: #eef4ff;
    box-shadow: inset 3px 0 0 var(--color-primary);
}
.crm-firm-picker-item input {
    flex-shrink: 0;
}
.crm-firm-picker-empty {
    margin: 0;
    padding: 0.75rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
}
@media (max-width: 800px) {
    .admin-message-top {
        grid-template-columns: 1fr;
    }
}
.admin-section h2 {
    margin-top: 0;
    font-size: 1.2rem;
}
.admin-table.crm-locations-table {
    font-size: 0.85rem;
}
.admin-table.crm-locations-table th,
.admin-table.crm-locations-table td {
    padding: 0.4rem 0.65rem;
    vertical-align: middle;
}
.admin-table.crm-locations-table .crm-location-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    align-items: center;
}
.admin-toolbar .toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.admin-table th,
.admin-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--color-light-grey);
}
.admin-table th {
    font-weight: 600;
    color: var(--color-dark-grey);
    background: var(--color-off-white);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.admin-table tbody tr.crm-row-partial,
.admin-table tbody tr.crm-row-partial td {
    background-color: #fff8e1;
}
.admin-table tbody tr.crm-row-sparse,
.admin-table tbody tr.crm-row-sparse td {
    background-color: #fdecea;
}
.crm-row-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin: 0 0 var(--space-md);
    font-size: 0.85rem;
    color: var(--color-text-light);
}
.crm-row-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.crm-swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 2px;
    flex-shrink: 0;
}
.crm-swatch-complete {
    background: #ffffff;
}
.crm-swatch-partial {
    background: #fff8e1;
}
.crm-swatch-sparse {
    background: #fdecea;
}
.crm-filter-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 var(--space-lg);
}
.crm-filter-card {
    display: block;
    background: #ffffff;
    border: 1px solid var(--color-light-grey);
    border-radius: var(--border-radius);
    padding: 0.85rem 0.75rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
}
.crm-filter-card:hover {
    border-color: var(--color-primary);
    text-decoration: none;
    color: inherit;
}
.crm-filter-card.is-active {
    border-color: var(--color-primary);
    background: #eef4ff;
    box-shadow: 0 0 0 1px var(--color-primary);
    cursor: default;
}
.crm-filter-pct {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}
.crm-filter-label {
    font-size: 0.85rem;
    color: var(--color-dark-grey);
    margin-top: 0.2rem;
}
.crm-filter-hint {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: 0.15rem;
}
.crm-filter-clear {
    font-size: 0.85rem;
    margin: -0.5rem 0 var(--space-md);
}
.crm-firm-trading {
    font-size: 0.85em;
    color: #475569;
    font-weight: 400;
}
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}
.search-form {
    display: flex;
    gap: var(--space-sm);
}
.search-form input {
    padding: 0.4rem 0.8rem;
    border: 2px solid var(--color-light-grey);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}
.filter-buttons {
    display: flex;
    gap: var(--space-xs);
}
.toolbar-info {
    color: var(--color-text-light);
    font-size: 0.9rem;
}
.inline-form {
    display: inline;
}
/* --- Pagination --- */
.pagination {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    margin-top: var(--space-xl);
}
.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-light-grey);
    font-size: 0.9rem;
    color: var(--color-dark-grey);
}
.pagination a:hover,
.pagination a.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    text-decoration: none;
}

/* === NEW RULE: REMOVE OUTER SECTION BOXES === */
.section-plain {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 0 40px 0 !important;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-content h1,
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-content h1 { font-size: 2.6rem; }
    .hero-image { display: none; }
    .hero-actions,
    .hero-note { justify-content: center; }
    .steps-grid::before { content: none; }
    .home-trust-list {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 0.7rem;
        min-height: 0;
        padding-top: 0.9rem;
        padding-bottom: 0.9rem;
    }
    .home-trust-divider { display: none; }
    .home-trust-list li { padding: 0.15rem 0.7rem; }
    .page-home .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr 1fr;
    }
    .two-col-layout {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .admin-grid {
        grid-template-columns: 1fr;
    }
    .account-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    html { font-size: 15px; }
    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.45rem; }
    .hero-content h1 { font-size: 2rem; }
    .mobile-menu-toggle { display: block; }
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-white);
        z-index: 999;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    .main-nav.open {
        transform: translateX(0);
    }
    .main-nav .nav-list {
        flex-direction: column;
        padding: var(--space-lg);
        gap: var(--space-xs);
    }
    .main-nav .nav-list a {
        padding: var(--space-md);
        font-size: 1.05rem;
    }
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }
    .form-row-2col,
    .form-row-3col {
        grid-template-columns: 1fr;
    }
    .footer-grid,
    .page-home .footer-grid {
        grid-template-columns: 1fr;
    }
    .home-trust-list {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 0.7rem;
        min-height: 0;
        padding-top: 0.9rem;
        padding-bottom: 0.9rem;
    }
    .home-trust-divider { display: none; }
    .home-trust-list li { padding: 0.15rem 0.7rem; }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .page-header {
        padding: var(--space-2xl) 0;
    }
    .hero-section {
        padding: var(--space-2xl) 0;
    }
    .will-card-actions {
        flex-direction: column;
    }
    .will-card-actions .btn {
        text-align: center;
    }
}

/* === STATISTICS PAGE TWEAKS === */
/* Remove large outer section boxes + full-width underline under each H2 */
.admin-section.section-plain {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 0 40px 0 !important;
}

.admin-section h2 {
    text-align: center;
    padding-bottom: 16px;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--color-light-grey);
}

.stats-dash {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 210px));
    gap: 24px;
    justify-content: center;
    padding: 24px 24px;
    margin: 0 auto;
    max-width: 1200px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 270px));
    gap: 24px;
    justify-content: center;
    padding: 40px 20px;
    margin: 0 auto;
    max-width: 1200px;
}

.stat-card {
    text-align: center;
    background: #ffffff;
    padding: 24px 12px;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card-success {
    background: #f0fdf4;
}
.stat-card-success .stat-number { color: #10b981; }

.stat-card-warning {
    background: #fff7ed;
}
.stat-card-warning .stat-number { color: #f59e0b; }

.stat-card-danger {
    background: #fee2e2;
}
.stat-card-danger .stat-number { color: #ef4444; }

/* Default blue numbers for Total Users / Total Wills */
.stat-card .stat-number {
    color: #1e40af;
}

.stat-note {
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.9rem;
    max-width: 720px;
    margin: -16px auto 8px;
    line-height: 1.45;
}

.stat-subheading {
    text-align: center;
    font-size: 1rem;
    margin: 24px 0 0;
    color: var(--color-dark-grey);
}

.stat-bar-list {
    max-width: 880px;
    margin: 0 auto;
    padding: 8px 20px 24px;
}

.stat-bar-row {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr minmax(140px, 180px);
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.stat-bar-label {
    font-size: 0.85rem;
    color: var(--color-dark-grey);
}

.stat-bar-track {
    background: #e5e7eb;
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
}

.stat-bar-fill {
    background: #1e40af;
    height: 100%;
    border-radius: 999px;
}

.stat-bar-value {
    font-size: 0.85rem;
    color: var(--color-dark-grey);
    text-align: right;
}

.stat-bar-value span {
    color: var(--color-text-light);
}

@media (max-width: 768px) {
    .stat-bar-row {
        grid-template-columns: 1fr;
        gap: 4px;
        margin-bottom: 16px;
    }
    .stat-bar-value {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 var(--space-md); }
    .hero-actions {
        flex-direction: column;
    }
    .hero-actions .btn { width: 100%; }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive beta banner improvements */
#beta-banner {
    padding: 14px 20px !important; /* keep some breathing room */
    flex-wrap: wrap !important;    /* allow text to wrap nicely */
    gap: 12px !important;
    line-height: 1.4 !important;
}

/* Make text smaller and more readable on small screens */
@media (max-width: 768px) {
    #beta-banner {
        padding: 12px 16px !important;
        font-size: 13.5px !important;
        gap: 10px !important;
    }
    
    #beta-banner span {
        flex: 1 1 100% !important; /* force text to full width on very small screens */
        text-align: left !important;
    }
    
    #beta-banner a {
        white-space: nowrap !important;
    }
    
    #beta-banner button {
        margin-left: 0 !important;
        margin-top: 4px !important;
    }
}

/* Extra safety for very narrow screens (e.g. iPhone SE) */
@media (max-width: 480px) {
    #beta-banner {
        font-size: 13px !important;
        padding: 10px 14px !important;
    }
}

/* Improve spacing in mobile menu between Log In and Create Your Will */
@media (max-width: 768px) {
    .main-nav .nav-list li:last-child,
    .main-nav .nav-list li:nth-last-child(2) {
        margin-top: 12px !important; /* more space above each button */
    }
    
    .main-nav .nav-btn {
        margin: 8px 0 !important;     /* vertical spacing between buttons */
        width: 100% !important;       /* full width for better touch targets */
        padding: 14px 20px !important; /* taller buttons = easier tap */
    }
    
    /* Optional: make Create Your Will button stand out more */
    .main-nav .nav-btn-primary {
        margin-top: 16px !important;
    }
}

.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;
}
.job-title-handle-col {
    width: 2.25rem;
}
.job-title-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid var(--color-light-grey);
    border-radius: var(--border-radius);
    background: #fff;
    color: #64748b;
    cursor: grab;
    letter-spacing: -0.15em;
    line-height: 1;
}
.job-title-handle:active {
    cursor: grabbing;
}
.job-titles-table tbody tr.is-dragging {
    opacity: 0.45;
}
