/*
|--------------------------------------------------------------------------
| HomeToThere
|--------------------------------------------------------------------------
|
| File        : assets/css/main.css
| Version     : 0.2
| Status      : Development
|
| Design Philosophy
|
| Calm.
| Clear.
| Mobile first.
| Accessible by design.
| Clarity Above Chaos™
|
|--------------------------------------------------------------------------
*/


/* ==========================================================================
   1. Design Tokens
   ========================================================================== */

:root {

    /* Brand colours */

    --navy-950: #031826;
    --navy-900: #062743;

    --blue-700: #0a5c91;
    --blue-500: #3a8dcc;
    --blue-100: #dbeafe;
    --blue-050: #eff6ff;

    --orange-500: #f59e0b;
    --orange-600: #d97706;
    --orange-100: #fef3c7;

    /* Neutral colours */

    --white: #ffffff;

    --slate-950: #0f172a;
    --slate-900: #1f2937;
    --slate-700: #475569;
    --slate-600: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-050: #f8fafc;

    /* Semantic colours */

    --background: var(--slate-050);
    --surface: var(--white);

    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-600);
    --text-inverse: var(--white);

    --border: var(--slate-200);
    --border-strong: var(--slate-300);

    --focus-colour: var(--orange-500);

    --success: #166534;
    --success-background: #f0fdf4;

    --warning: #9a3412;
    --warning-background: #fff7ed;

    --error: #b91c1c;
    --error-background: #fef2f2;

    /* Typography */

    --font-sans:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.375rem;
    --font-size-xl: 1.75rem;
    --font-size-2xl: 2.25rem;
    --font-size-3xl: 3rem;

    --line-height-tight: 1.15;
    --line-height-heading: 1.25;
    --line-height-body: 1.65;

    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing */

    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Layout */

    --site-width: 75rem;
    --reading-width: 46rem;
    --form-width: 38rem;

    --page-padding: 1rem;
    /* Borders and radius */

    --border-width: 1px;

    --radius-small: 0.5rem;
    --radius-medium: 0.875rem;
    --radius-large: 1.25rem;
    --radius-pill: 999px;

    /* Shadows */

    --shadow-small:
        0 2px 8px rgba(3, 24, 38, 0.06);

    --shadow-medium:
        0 10px 30px rgba(3, 24, 38, 0.10);

    --shadow-focus:
        0 0 0 4px rgba(245, 158, 11, 0.28);

    /* Motion */

    --transition-fast: 150ms ease;
    --transition-standard: 220ms ease;
}


/* ==========================================================================
   2. Reset and Document Defaults
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
    color-scheme: light;
    font-family: var(--font-sans);
    font-size: 100%;
    line-height: var(--line-height-body);
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    overflow-wrap: break-word;
}

img,
picture,
svg,
canvas {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    margin: 0;
    color: inherit;
    font: inherit;
}

button {
    border: 0;
}

textarea {
    resize: vertical;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

ul,
ol {
    padding-left: 1.35rem;
}

p,
ul,
ol,
blockquote,
figure {
    margin-top: 0;
}

p:last-child,
ul:last-child,
ol:last-child {
    margin-bottom: 0;
}

[hidden] {
    display: none !important;
}


/* ==========================================================================
   3. Typography
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: var(--space-md);
    color: var(--navy-900);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.025em;
    line-height: var(--line-height-heading);
}

h1 {
    font-size: clamp(
        var(--font-size-2xl),
        7vw,
        var(--font-size-3xl)
    );
    line-height: var(--line-height-tight);
}

h2 {
    font-size: clamp(
        var(--font-size-xl),
        5vw,
        var(--font-size-2xl)
    );
}

h3 {
    font-size: var(--font-size-lg);
}

p {
    margin-bottom: var(--space-lg);
}

a {
    color: var(--blue-700);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--navy-900);
}

a:focus-visible {
    border-radius: 0.2rem;
    outline: 3px solid var(--focus-colour);
    outline-offset: 3px;
}

strong {
    font-weight: var(--font-weight-bold);
}

small {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

code,
kbd,
samp {
    font-family:
        "Cascadia Code",
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.92em;
}

code {
    padding: 0.15em 0.35em;
    border-radius: 0.25rem;
    background: var(--slate-100);
    color: var(--navy-900);
}


/* ==========================================================================
   4. Accessibility
   ========================================================================== */

.skip-link {
    position: fixed;
    z-index: 1000;
    top: var(--space-md);
    left: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-small);
    background: var(--orange-500);
    color: var(--navy-950);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform var(--transition-fast);
}

.skip-link:focus {
    color: var(--navy-950);
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid var(--focus-colour);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* ==========================================================================
   5. Shared Layout
   ========================================================================== */

.site-header__inner,
.site-main,
.site-footer__inner,
.container {
    width: min(
        calc(100% - (var(--page-padding) * 2)),
        var(--site-width)
    );
    margin-inline: auto;
}

.site-main {
    flex: 1;
    width: 100%;
}

.content-section {
    padding-block: var(--space-3xl);
}

.content-section--compact {
    padding-block: var(--space-2xl);
}

.content-section--white {
    background: var(--surface);
}

.content-section--blue {
    background: var(--blue-050);
}

.reading-width {
    width: min(100%, var(--reading-width));
    margin-inline: auto;
}

.form-width {
    width: min(100%, var(--form-width));
    margin-inline: auto;
}

.stack > * {
    margin-top: 0;
    margin-bottom: 0;
}

.stack > * + * {
    margin-top: var(--space-lg);
}

.stack--small > * + * {
    margin-top: var(--space-md);
}

.stack--large > * + * {
    margin-top: var(--space-2xl);
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-md);
}


/* ==========================================================================
   6. Site Header
   ========================================================================== */

.site-header {
    position: relative;
    z-index: 20;
    background: var(--navy-900);
    color: var(--text-inverse);
    box-shadow: var(--shadow-small);
}

.site-header__inner {
    min-height: 5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    padding-block: var(--space-md);
}

.site-brand {
    min-width: 0;
    display: inline-flex;
    flex-direction: column;
    color: var(--white);
    text-decoration: none;
}

.site-brand:hover {
    color: var(--white);
}

.site-brand__name {
    font-size: 1.35rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.site-brand__tagline {
    margin-top: var(--space-2xs);
    color: var(--blue-100);
    font-size: var(--font-size-sm);
    line-height: 1.35;
}


/* ==========================================================================
   7. Navigation
   ========================================================================== */

.site-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-xs);
}

.site-navigation__link {
    min-height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-medium);
    background: transparent;
    color: var(--white);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

/* Current page */

.site-navigation__link.is-current,
.site-navigation__link[aria-current="page"] {
    border-color: var(--white);
    background: var(--white);
    color: var(--navy-900);
}

.site-navigation__link.is-current:hover,
.site-navigation__link[aria-current="page"]:hover {
    border-color: var(--white);
    background: var(--white);
    color: var(--navy-900);
}

/* Other navigation links */

.site-navigation__link:not(.is-current):not([aria-current="page"]):hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.60);
    color: var(--white);
}


/* ==========================================================================
   8. Hero and Introductory Content
   ========================================================================== */

.hero {
    padding-block: var(--space-4xl);
    background:
        linear-gradient(
            145deg,
            var(--navy-900) 0%,
            var(--blue-700) 100%
        );
    color: var(--white);
}

.hero__inner {
    width: min(
        calc(100% - (var(--page-padding) * 2)),
        var(--reading-width)
    );
    margin-inline: auto;
    text-align: center;
}

.hero__eyebrow {
    margin-bottom: var(--space-md);
    color: var(--blue-500);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.hero .hero__eyebrow {
    color: var(--blue-100);
}

.hero h1 {
    color: var(--white);
}

.hero__lead {
    max-width: 38rem;
    margin-inline: auto;
    color: var(--blue-100);
    font-size: clamp(
        var(--font-size-md),
        4vw,
        var(--font-size-lg)
    );
}

.hero__actions {
    margin-top: var(--space-xl);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
}

.page-intro {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-xl);
    text-align: center;
}

.page-intro__lead {
    max-width: var(--reading-width);
    margin-inline: auto;
    color: var(--text-secondary);
    font-size: var(--font-size-md);
}


/* ==========================================================================
   9. Buttons
   ========================================================================== */

.button,
button.button {
    min-height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.8rem 1.4rem;
    border: 1px solid transparent;
    border-radius: var(--radius-medium);
    background: var(--orange-500);
    color: var(--navy-950);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-small);
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
}

.button:hover,
button.button:hover {
    background: var(--orange-600);
    color: var(--white);
    transform: translateY(-1px);
}

.button:active,
button.button:active {
    transform: translateY(0);
}

.button:focus-visible,
button.button:focus-visible {
    outline: none;
    box-shadow:
        var(--shadow-small),
        var(--shadow-focus);
}

.button--secondary {
    border-color: var(--blue-700);
    background: var(--white);
    color: var(--blue-700);
}

.button--secondary:hover {
    background: var(--blue-050);
    color: var(--navy-900);
}

.button--quiet {
    border-color: var(--border);
    background: transparent;
    color: var(--text-primary);
    box-shadow: none;
}

.button--quiet:hover {
    border-color: var(--blue-700);
    background: var(--blue-050);
    color: var(--navy-900);
}

.button--block {
    width: 100%;
}

button:disabled,
.button[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}


.button.button--feedback,
a.button.button--feedback:link,
a.button.button--feedback:visited {
    border-color: var(--blue-700);
    background: var(--blue-700);
    color: var(--white);
}

.button.button--feedback:hover,
a.button.button--feedback:hover {
    border-color: var(--navy-900);
    background: var(--navy-900);
    color: var(--white);
}

.result-feedback-note {
    max-width: 34rem;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    text-align: center;
}

/* ==========================================================================
   10. Cards and Panels
   ========================================================================== */

.card {
    padding: var(--space-xl);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow-small);
}

.card--centred {
    text-align: center;
}

.card__title {
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-lg);
}

.card__text {
    color: var(--text-secondary);
}

.notice {
    padding: var(--space-md);
    border: var(--border-width) solid var(--border);
    border-left-width: 0.35rem;
    border-radius: var(--radius-small);
    background: var(--surface);
}

.notice--success {
    border-left-color: var(--success);
    background: var(--success-background);
    color: var(--success);
}

.notice--warning {
    border-left-color: var(--orange-500);
    background: var(--warning-background);
    color: var(--warning);
}

.notice--error {
    border-left-color: var(--error);
    background: var(--error-background);
    color: var(--error);
}


/* ==========================================================================
   11. Forms
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-xl);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--navy-900);
    font-weight: var(--font-weight-bold);
}

.form-hint {
    display: block;
    margin-top: var(--space-xs);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.form-control {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.75rem 0.9rem;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-medium);
    background: var(--white);
    color: var(--text-primary);
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.form-control:hover {
    border-color: var(--blue-500);
}

.form-control:focus {
    border-color: var(--blue-700);
    outline: none;
    box-shadow: var(--shadow-focus);
}

.form-control::placeholder {
    color: var(--slate-400);
}

.form-control[aria-invalid="true"],
.form-control.is-invalid {
    border-color: var(--error);
}

.form-error {
    display: block;
    margin-top: var(--space-xs);
    color: var(--error);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

fieldset {
    min-width: 0;
    margin: 0 0 var(--space-xl);
    padding: 0;
    border: 0;
}

legend {
    margin-bottom: var(--space-md);
    color: var(--navy-900);
    font-weight: var(--font-weight-bold);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}


/* ==========================================================================
   12. Planning Workflow
   ========================================================================== */

.planner {
    width: min(
        calc(100% - (var(--page-padding) * 2)),
        var(--form-width)
    );
    margin-inline: auto;
    padding-block: var(--space-3xl);
}

.planner-step {
    padding: var(--space-xl);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow-medium);
}

.planner-step[hidden] {
    display: none;
}

.step-progress {
    margin-bottom: var(--space-xl);
}

.step-progress__label {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-align: center;
}

.step-progress__dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.step-progress__dot {
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid var(--slate-300);
    border-radius: 50%;
    background: var(--white);
}

.step-progress__dot.is-complete {
    border-color: var(--blue-700);
    background: var(--blue-700);
}

.step-progress__dot.is-current {
    border-color: var(--orange-500);
    background: var(--orange-500);
    box-shadow:
        0 0 0 4px rgba(245, 158, 11, 0.18);
}

.planner-question {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.planner-question h1,
.planner-question h2 {
    margin-bottom: var(--space-sm);
}

.planner-question p {
    color: var(--text-secondary);
}

.planner-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}


/* ==========================================================================
   12A. Review Stage
   ========================================================================== */

/*
 * The Review Stage presents each confirmed answer as a calm information
 * panel with a matching Change control. On phones, the value and button use
 * the same two-column rhythm as the Back and Show my plan actions.
 */

.planner-step--review .planner-question {
    margin-bottom: var(--space-lg);
}

.plan-review {
    display: grid;
    gap: var(--space-md);
}

.plan-review__item {
    display: grid;
    gap: var(--space-xs);
    padding: var(--space-md);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-medium);
    background: var(--slate-050);
}

.plan-review__label {
    margin: 0;
    color: var(--navy-900);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-heading);
}

.plan-review__controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: var(--space-sm);
}

.plan-review__value {
    min-width: 0;
    min-height: 3.25rem;
    margin: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;

    padding: 0.75rem 0.9rem;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-medium);
    background: var(--surface);

    color: var(--navy-900);
    line-height: 1.2;
}

button.button.plan-review__change {
    width: 100%;
    min-width: 0;
    min-height: 3.25rem;
    margin: 0;

    border-color: var(--blue-700);
    background: var(--blue-700);
    color: var(--white);
}

button.button.plan-review__change:active {
    border-color: var(--navy-900);
    background: var(--navy-900);
    color: var(--white);
}

button.button.plan-review__change:hover {
    border-color: var(--navy-900);
    background: var(--navy-900);
    color: var(--white);
}

@media (min-width: 40rem) {

    .plan-review__item {
        grid-template-columns: minmax(9.5rem, 0.75fr) minmax(0, 2fr);
        align-items: center;
        column-gap: var(--space-lg);
    }

    .plan-review__controls {
        grid-template-columns: minmax(0, 1fr) minmax(8rem, auto);
    }

    .plan-review__change {
        width: auto;
        min-width: 8rem;
    }
}

@media (max-width: 39.99rem) {

    .planning-page .planner-step--review {
        padding: var(--space-md);
    }

    .planning-page .planner-step--review .planner-question {
        margin-bottom: var(--space-md);
    }

    .planning-page .plan-review {
        gap: var(--space-sm);
    }

    .planning-page .plan-review__item {
        gap: var(--space-2xs);
        padding: var(--space-sm);
    }

    .planning-page .plan-review__label {
        font-size: var(--font-size-sm);
    }

    .planning-page .plan-review__controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-xs);
    }

    .planning-page .plan-review__value,
    .planning-page .plan-review__change {
        min-height: 2.75rem;
        box-sizing: border-box;
    }

    .planning-page .plan-review__value {
        padding: 0.55rem 0.65rem;
        font-size: var(--font-size-sm);
    }

    .planning-page .plan-review__change {
        padding: 0.55rem 0.65rem;
        font-size: var(--font-size-sm);
    }
}

@media (max-width: 39.99rem) and (max-height: 760px) {

    .planning-page .plan-review {
        gap: var(--space-xs);
    }

    .planning-page .plan-review__item {
        padding: var(--space-xs) var(--space-sm);
    }

    .planning-page .plan-review__value,
    .planning-page .plan-review__change {
        min-height: 2.55rem;
    }
}


/* ==========================================================================
   13. Results Timeline
   ========================================================================== */

.timeline {
    width: min(100%, var(--reading-width));
    margin-inline: auto;
    padding: 0;
    list-style: none;
}

.timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: 2.65rem 1fr;
    gap: var(--space-sm);
    padding-bottom: var(--space-lg);
}

.timeline__item:last-child {
    padding-bottom: 0;
}

.timeline__item::before {
    position: absolute;
    top: 2.2rem;
    bottom: 0;
    left: 1.28rem;
    width: 2px;
    background: var(--border);
    content: "";
}

.timeline__item:last-child::before {
    display: none;
}

.timeline__marker {
    position: relative;
    z-index: 1;
    width: 2.65rem;
    height: 2.65rem;
    display: grid;
    place-items: center;
    border: 3px solid var(--white);
    border-radius: 50%;
    background: var(--blue-700);
    color: var(--white);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    box-shadow: 0 0 0 2px var(--blue-700);
}

/* Stage 1: change the timeline markers only

.timeline__item:last-child .timeline__marker {
    
*/

.timeline__item:nth-child(2) .timeline__marker {
    background: var(--orange-500);
    color: var(--navy-950);
    box-shadow: 0 0 0 2px var(--orange-500);
}    

/* Highlight the active departure step */

.timeline__item:nth-child(2) .timeline__content {
    border-color: var(--orange-500);
    box-shadow:
        0 0 0 2px rgb(245 158 11 / 0.28),
        0 0 18px rgb(245 158 11 / 0.30),
        0 10px 24px rgb(245 158 11 / 0.16);
}

/* Emphasise the active departure heading */

.timeline__item:nth-child(2) .timeline__label {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--navy-900);
}

.timeline__content {
    padding: var(--space-sm) var(--space-md);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-medium);
    background: var(--surface);
}

.timeline__label {
    margin-bottom: var(--space-2xs);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.timeline__time {
    margin: 0;
    color: var(--navy-900);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    line-height: 1.15;
}

.timeline__date {
    margin-top: var(--space-2xs);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.timeline__content .text-small {
    margin-top: var(--space-xs);
    line-height: 1.4;
}


/* ==========================================================================
   14. Footer
   ========================================================================== */

.site-footer {
    margin-top: auto;
    padding-block: var(--space-2xl);
    background: var(--navy-950);
    color: var(--blue-100);
}

.site-footer__inner {
    display: grid;
    gap: var(--space-xl);
}

.footer-brand__title {
    margin-bottom: var(--space-xs);
    color: var(--white);
    font-size: var(--font-size-lg);
}

.footer-brand__tagline {
    color: var(--blue-100);
}

.footer-navigation {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
}

.footer-navigation a {
    color: var(--blue-100);
    text-decoration: none;
}

.footer-navigation a:hover {
    color: var(--orange-500);
}

.footer-meta {
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    color: var(--slate-400);
    font-size: var(--font-size-sm);
}

.footer-meta p {
    margin: 0;
}


/* ==========================================================================
   15. Utility Classes
   ========================================================================== */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.text-centre {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-small {
    font-size: var(--font-size-sm);
}

.no-margin {
    margin: 0;
}

.margin-top-sm {
    margin-top: var(--space-sm);
}

.margin-top-md {
    margin-top: var(--space-md);
}

.margin-top-lg {
    margin-top: var(--space-lg);
}

.margin-top-xl {
    margin-top: var(--space-xl);
}


/* ==========================================================================
   16. Responsive Enhancements
   ========================================================================== */

@media (min-width: 40rem) {

    :root {
        --page-padding: 1.5rem;
    }

    .input-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .planner-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .planner-actions .button {
        width: auto;
    }

    .site-footer__inner {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .footer-navigation {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .footer-meta {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
    }
}


@media (min-width: 60rem) {

    :root {
        --page-padding: 2rem;
    }

    .site-header__inner {
        min-height: 5.5rem;
    }

    .content-section {
        padding-block: var(--space-4xl);
    }

    .planner-step {
        padding: var(--space-2xl);
    }
}


/* ==========================================================================
   17. Small-Screen Adjustments
   ========================================================================== */

@media (max-width: 39.99rem) {

    .site-header__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--space-md);
    }

    .site-navigation {
        width: 100%;
        justify-content: flex-start;
    }

    .site-navigation__link {
        flex: 1;
    }

    .hero {
        padding-block: var(--space-3xl);
    }

    .button {
        width: 100%;
    }

    .card,
    .planner-step {
        padding: var(--space-lg);
    }
}


/* ==========================================================================
   18. Result Page - Mobile Optimisation
   ========================================================================== */

@media (max-width: 768px) {

    .result-page .page-intro {
        padding-top: var(--space-md);
        padding-bottom: var(--space-lg);
    }

    .result-page .timeline__item {
        padding-bottom: var(--space-md);
    }

    .result-page .timeline__content {
        padding: var(--space-sm);
    }

    .result-page .timeline__marker {
        width: 2.65rem;
        height: 2.65rem;
    }

    .result-page .content-section {
        padding-block: var(--space-lg);
    }

    .result-page .card {
        padding: var(--space-lg);
    }
}

/* ==========================================================================
   19. Compact-Height Adjustments
   ========================================================================== */

@media (max-height: 760px) {

    .planner {
        padding-block: var(--space-lg);
    }

    .step-progress {
        margin-bottom: var(--space-md);
    }

    .planner-step {
        padding: var(--space-lg);
    }

    .planner-question {
        margin-bottom: var(--space-lg);
    }

    .planner-actions {
        margin-top: var(--space-lg);
    }

    .result-page .page-intro {
        padding-top: var(--space-md);
        padding-bottom: var(--space-lg);
    }

    .result-page .content-section {
        padding-block: var(--space-lg);
    }
}


/* ==========================================================================
   20. Feedback Form
   ========================================================================== */

.margin-bottom-xl {
    margin-bottom: var(--space-xl);
}

.feedback-form {
    display: grid;
    gap: var(--space-xl);
}

.feedback-question {
    margin: 0;
    padding: var(--space-xl);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow-small);
}

.feedback-question legend,
.feedback-question__label {
    margin-bottom: var(--space-md);
    color: var(--navy-900);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-heading);
}

.choice-list {
    display: grid;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.choice-card {
    min-height: 3.25rem;
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-medium);
    background: var(--white);
    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        background-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.choice-card:hover {
    border-color: var(--blue-500);
    background: var(--blue-050);
}

.choice-card:focus-within {
    border-color: var(--blue-700);
    box-shadow: var(--shadow-focus);
}

.choice-card:has(input:checked) {
    border-color: var(--blue-700);
    background: var(--blue-050);
}

.choice-card input {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
    margin-top: 0.1rem;
    accent-color: var(--blue-700);
}

.choice-card span {
    line-height: 1.4;
}

.feedback-textarea {
    width: 100%;
    min-height: 8rem;
}

.feedback-submit {
    display: grid;
    gap: var(--space-md);
}

.form-trap {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.feedback-thank-you {
    padding-block: var(--space-2xl);
}

.feedback-thank-you__icon {
    width: 4.5rem;
    height: 4.5rem;
    margin-inline: auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-700);
    color: var(--white);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

.feedback-thank-you__eyebrow {
    margin: 0;
    color: var(--blue-700);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
    text-transform: uppercase;
}

.feedback-thank-you__actions {
    justify-content: center;
}

@media (min-width: 40rem) {

}

@media (max-width: 39.99rem) {

    .feedback-question {
        padding: var(--space-lg);
    }

    .feedback-thank-you__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .feedback-thank-you__actions .button {
        width: 100%;
    }
}



/* ==========================================================================
   21. Definitive Mobile Planner Layout
   ========================================================================== */

/*
 * Keep every planning step compact enough that its actions remain visible
 * on ordinary and smaller phones before the on-screen keyboard opens.
 */
@media (max-width: 39.99rem) {

    .planning-page .site-header__inner {
        min-height: auto;
        padding-block: var(--space-xs);
        align-items: center;
        flex-direction: row;
        gap: var(--space-sm);
    }

    .planning-page .site-brand__tagline,
    .planning-page .site-navigation {
        display: none;
    }

    .planning-page .site-brand__name {
        font-size: 1.2rem;
    }

    .planning-page .planner {
        width: min(
            calc(100% - (var(--page-padding) * 2)),
            var(--form-width)
        );
        padding-block: var(--space-sm);
    }

    .planning-page .step-progress {
        margin-bottom: var(--space-sm);
    }

    .planning-page .step-progress__label {
        margin-bottom: var(--space-xs);
        font-size: var(--font-size-xs);
    }

    .planning-page .step-progress__dots {
        gap: var(--space-xs);
    }

    .planning-page .step-progress__dot {
        width: 0.65rem;
        height: 0.65rem;
    }

    .planning-page .planner-step {
        padding: var(--space-md);
        border-radius: var(--radius-medium);
    }

    .planning-page .planner-question {
        margin-bottom: var(--space-md);
    }

    .planning-page .planner-question .hero__eyebrow {
        margin-bottom: var(--space-xs);
        font-size: var(--font-size-xs);
    }

    .planning-page .planner-question h1,
    .planning-page .planner-question h2 {
        margin-bottom: var(--space-xs);
        font-size: clamp(1.55rem, 7vw, 1.9rem);
        line-height: 1.12;
    }

    .planning-page .planner-question p {
        margin-bottom: 0;
        font-size: var(--font-size-sm);
        line-height: 1.4;
    }

    .planning-page .form-group,
    .planning-page fieldset {
        margin-bottom: var(--space-md);
    }

    .planning-page .input-row {
        gap: var(--space-sm);
    }

    .planning-page .form-label,
    .planning-page legend {
        margin-bottom: var(--space-2xs);
        font-size: var(--font-size-sm);
    }

    .planning-page .form-hint {
        margin-top: var(--space-2xs);
        font-size: var(--font-size-xs);
        line-height: 1.35;
    }

    .planning-page .form-control {
        min-height: 2.9rem;
        padding: 0.6rem 0.75rem;
    }

    .planning-page .planner-actions {
        margin-top: var(--space-md);
        gap: var(--space-sm);
    }

    .planning-page .planner-actions .button {
        min-height: 2.9rem;
        padding: 0.65rem 1rem;
    }
}

/* Extra compression for short and small displays. */
@media (max-width: 39.99rem) and (max-height: 760px) {

    .planning-page .planner {
        padding-block: var(--space-xs);
    }

    .planning-page .planner-step {
        padding: var(--space-sm) var(--space-md);
    }

    .planning-page .planner-question {
        margin-bottom: var(--space-sm);
    }

    .planning-page .planner-question p {
        font-size: var(--font-size-xs);
    }

    .planning-page .form-group,
    .planning-page fieldset {
        margin-bottom: var(--space-sm);
    }

    .planning-page .planner-actions {
        margin-top: var(--space-sm);
    }
}

@media (max-width: 39.99rem) and (max-height: 680px) {

    .planning-page .planner-question p,
    .planning-page .form-hint {
        display: none;
    }

    .planning-page .planner-question h1,
    .planning-page .planner-question h2 {
        font-size: 1.45rem;
    }

    .planning-page .planner-step {
        padding-block: var(--space-sm);
    }
}


/* ==========================================================================
   22. Definitive Feedback Form Layout
   ========================================================================== */

/*
 * The questionnaire remains a single vertical reading sequence at every
 * viewport width. No answer group is arranged horizontally.
 */
.feedback-page .page-intro .reading-width,
.feedback-page .content-section .form-width,
.feedback-thank-you-page .content-section .reading-width {
    width: min(
        calc(100% - (var(--page-padding) * 2)),
        var(--form-width)
    );
    margin-inline: auto;
}

.feedback-form,
.choice-list,
.choice-list--grid {
    grid-template-columns: minmax(0, 1fr);
}

.feedback-question {
    width: 100%;
}

.choice-card {
    width: 100%;
}

@media (max-width: 39.99rem) {

    .feedback-page .page-intro {
        padding-top: var(--space-lg);
        padding-bottom: var(--space-lg);
    }

    .feedback-page .page-intro__lead {
        font-size: var(--font-size-base);
        line-height: 1.5;
    }

    .feedback-page .content-section {
        padding-block: var(--space-lg);
    }

    .feedback-page .feedback-form {
        gap: var(--space-lg);
    }

    .feedback-page .feedback-question {
        padding: var(--space-lg);
    }

    .feedback-page .feedback-question legend,
    .feedback-page .feedback-question__label {
        margin-bottom: var(--space-sm);
        font-size: var(--font-size-base);
        line-height: 1.35;
    }

    .feedback-page .choice-list {
        gap: var(--space-sm);
        margin-top: var(--space-sm);
    }

    .feedback-page .choice-card {
        min-height: 3rem;
        padding: var(--space-sm) var(--space-md);
        align-items: flex-start;
    }

    .feedback-page .choice-card input {
        margin-top: 0.15rem;
    }

    .feedback-page .feedback-textarea {
        min-height: 7rem;
    }

    .feedback-page .notice {
        padding: var(--space-md);
    }

    .feedback-thank-you-page .content-section {
        padding-block: var(--space-xl);
    }
}


/* ==========================================================================
   23. Very Small Width Safeguards
   ========================================================================== */

@media (max-width: 22rem) {

    :root {
        --page-padding: 0.75rem;
    }

    .button,
    button.button {
        padding-inline: 0.8rem;
        font-size: var(--font-size-sm);
    }

    .planning-page .planner-step,
    .feedback-page .feedback-question {
        padding-inline: var(--space-sm);
    }
}


/* ==========================================================================
   24. Accessible Time Picker
   ========================================================================== */

.time-picker {
    position: relative;
}

.time-picker__native--enhanced {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !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;
}

.time-picker__trigger {
    width: 100%;
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 0.75rem 0.9rem;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-medium);
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        color var(--transition-fast);
}

.time-picker__trigger::after {
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    color: var(--blue-700);
    content: "⌄";
    font-size: 0.95rem;
    font-weight: var(--font-weight-bold);
    line-height: 0.8;
}

.time-picker__trigger:hover {
    border-color: var(--blue-500);
}

.time-picker__trigger:focus-visible {
    border-color: var(--blue-700);
    outline: none;
    box-shadow: var(--shadow-focus);
}

.time-picker__trigger.has-value {
    color: var(--text-primary);
}

.time-picker__display {
    min-width: 0;
    overflow: hidden;
    font-weight: var(--font-weight-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.time-picker-dialog {
    width: min(
        calc(100% - (var(--page-padding) * 2)),
        29rem
    );
    max-width: 29rem;
    max-height: min(42rem, calc(100dvh - 2rem));
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: var(--radius-large);
    background: var(--surface);
    color: var(--text-primary);
    box-shadow:
        0 24px 70px rgba(3, 24, 38, 0.28);
    overflow: hidden;
}

.time-picker-dialog::backdrop {
    background: rgba(3, 24, 38, 0.62);
    backdrop-filter: blur(2px);
}

.time-picker-dialog__inner {
    max-height: min(42rem, calc(100dvh - 2rem));
    display: flex;
    flex-direction: column;
}

.time-picker-dialog__header {
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.time-picker-dialog__eyebrow {
    margin: 0 0 var(--space-2xs);
    color: var(--blue-700);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-transform: uppercase;
}

.time-picker-dialog__title {
    margin: 0;
    font-size: var(--font-size-xl);
}

.time-picker-format {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xs);
    margin: var(--space-md) var(--space-lg) 0;
    padding: var(--space-2xs);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--slate-100);
}

.time-picker-format__option {
    position: relative;
    min-height: 2.65rem;
    display: grid;
    place-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    text-align: center;
}

.time-picker-format__option:has(input:checked) {
    background: var(--white);
    color: var(--navy-900);
    box-shadow: var(--shadow-small);
}

.time-picker-format__option:focus-within {
    outline: 3px solid var(--focus-colour);
    outline-offset: 2px;
}

.time-picker-format__option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.time-picker-wheels {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xs);
    margin: var(--space-md) var(--space-lg);
    padding-inline: var(--space-sm);
}

.time-picker-wheels:has(
    [data-time-picker-meridiem-column]:not([hidden])
) {
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(4.5rem, 0.8fr);
}

.time-picker-wheels::before,
.time-picker-wheels::after {
    position: absolute;
    z-index: 2;
    left: var(--space-sm);
    right: var(--space-sm);
    height: calc(50% - 1.5rem);
    pointer-events: none;
    content: "";
}

.time-picker-wheels::before {
    top: 0;
    background:
        linear-gradient(
            to bottom,
            var(--white) 12%,
            rgba(255, 255, 255, 0.88) 55%,
            rgba(255, 255, 255, 0)
        );
}

.time-picker-wheels::after {
    bottom: 0;
    background:
        linear-gradient(
            to top,
            var(--white) 12%,
            rgba(255, 255, 255, 0.88) 55%,
            rgba(255, 255, 255, 0)
        );
}

.time-picker-wheel-column {
    min-width: 0;
}

.time-picker-wheel-column__label {
    margin: 0 0 var(--space-xs);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
}

.time-picker-wheel {
    position: relative;
    z-index: 3;
    height: 15rem;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-block: 1px solid var(--border);
    list-style: none;
    overscroll-behavior: contain;
    scrollbar-width: none;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.time-picker-wheel::-webkit-scrollbar {
    display: none;
}

.time-picker-wheel:focus-visible {
    border-radius: var(--radius-small);
    outline: 3px solid var(--focus-colour);
    outline-offset: 2px;
}

.time-picker-wheel__spacer {
    height: 6rem;
    scroll-snap-align: none;
}

.time-picker-wheel__option {
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius-small);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--font-size-lg);
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-weight-medium);
    line-height: 1;
    scroll-snap-align: center;
    user-select: none;
}

.time-picker-wheel__option.is-selected {
    background: var(--blue-050);
    color: var(--navy-900);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

.time-picker-selection-band {
    position: absolute;
    z-index: 1;
    top: calc(50% + 0.45rem);
    left: var(--space-sm);
    right: var(--space-sm);
    height: 3rem;
    border-block: 2px solid var(--blue-500);
    border-radius: var(--radius-small);
    background: var(--blue-050);
    pointer-events: none;
    transform: translateY(-50%);
}

.time-picker-dialog__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--border);
    background: var(--slate-050);
}

.time-picker-dialog__actions .button {
    width: 100%;
}

.time-picker-dialog__status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}


/* ==========================================================================
   25. Planner Above-the-Fold Mobile Refinement
   ========================================================================== */

@media (max-width: 39.99rem) {

    /*
     * Keep the entire planner as close to the top edge as possible.
     */
    .planning-page .site-header {
        position: relative;
    }

    .planning-page .site-header__inner {
        min-height: 2.8rem;
        padding-block: 0.4rem;
    }

    .planning-page .planner {
        padding-top: 0.35rem;
        padding-bottom: var(--space-sm);
    }

    .planning-page .step-progress {
        margin-bottom: 0.4rem;
    }

    .planning-page .step-progress__label {
        margin-bottom: 0.2rem;
        line-height: 1.2;
    }

    /*
     * Date and time, journey hours and minutes, and preparation hours and
     * minutes stay alongside one another to prevent needless vertical scroll.
     */
    .planning-page .input-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-xs);
    }

    .planning-page .planner-step {
        padding: 0.75rem;
    }

    .planning-page .planner-question {
        margin-bottom: 0.65rem;
    }

    .planning-page .planner-question .hero__eyebrow {
        margin-bottom: 0.15rem;
    }

    .planning-page .planner-question h1,
    .planning-page .planner-question h2 {
        margin-bottom: 0.25rem;
        font-size: clamp(1.35rem, 6.4vw, 1.7rem);
    }

    .planning-page .form-group,
    .planning-page fieldset {
        margin-bottom: 0.65rem;
    }

    .planning-page .form-control,
    .planning-page .time-picker__trigger {
        min-height: 2.75rem;
        padding: 0.55rem 0.65rem;
    }

    /*
     * Back/Cancel and Continue remain visible together rather than forming
     * a tall two-button stack.
     */
    .planning-page .planner-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-xs);
        margin-top: 0.65rem;
    }

    .planning-page .planner-actions .button {
        width: 100%;
        min-height: 2.75rem;
        padding: 0.55rem 0.65rem;
        font-size: var(--font-size-sm);
    }

    .time-picker-dialog {
        width: calc(100% - 1rem);
        max-height: calc(100dvh - 1rem);
        border-radius: var(--radius-medium);
    }

    .time-picker-dialog__inner {
        max-height: calc(100dvh - 1rem);
    }

    .time-picker-dialog__header {
        padding: var(--space-md) var(--space-md) var(--space-sm);
    }

    .time-picker-dialog__title {
        font-size: var(--font-size-lg);
    }

    .time-picker-format {
        margin: var(--space-sm) var(--space-md) 0;
    }

    .time-picker-wheels {
        margin: var(--space-sm) var(--space-md);
        padding-inline: 0;
    }

    .time-picker-wheel {
        height: 12rem;
    }

    .time-picker-wheel__spacer {
        height: 4.5rem;
    }

    .time-picker-selection-band {
        left: 0;
        right: 0;
        top: calc(50% + 0.4rem);
    }

    .time-picker-dialog__actions {
        padding: var(--space-sm) var(--space-md) var(--space-md);
    }
}

@media (max-width: 22rem) {

    .planning-page .planner-step {
        padding-inline: 0.6rem;
    }

    .planning-page .planner-question h1,
    .planning-page .planner-question h2 {
        font-size: 1.25rem;
    }

    .planning-page .form-label,
    .planning-page legend {
        font-size: var(--font-size-xs);
    }

    .time-picker-dialog {
        width: calc(100% - 0.5rem);
    }

    .time-picker-wheels {
        margin-inline: var(--space-sm);
    }
}



/* ==========================================================================
   26. Definitive Time Picker Layout
   ========================================================================== */

/*
 * These rules deliberately match the live plan.php structure:
 *
 * .time-picker-dialog__panel
 * .time-format-choice
 * .time-picker-wheel
 * .time-picker-wheel__list
 * .time-picker-wheels__separator
 * .time-picker-wheels__selection
 */

.time-picker-dialog__panel {
    max-height: min(42rem, calc(100dvh - 2rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.time-picker-dialog__header {
    flex: 0 0 auto;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.time-picker-dialog__header .hero__eyebrow {
    margin-bottom: var(--space-xs);
}

.time-picker-dialog__header h2 {
    margin-bottom: var(--space-xs);
}

.time-picker-dialog__header .text-small {
    margin-bottom: var(--space-md);
    line-height: 1.4;
}

.time-format-choice {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.time-format-choice__option {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-primary);
    cursor: pointer;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
}

.time-format-choice__option input {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
    accent-color: var(--blue-700);
}


/*
 * Twenty-four-hour mode:
 *
 *     HOURS  :  MINUTES
 *
 * Twelve-hour mode adds AM/PM as a third wheel:
 *
 *     HOURS  :  MINUTES  AM/PM
 */
.time-picker-wheels {
    --picker-row-height: 3rem;
    --picker-wheel-height: 15rem;

    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);
    align-items: stretch;
    gap: var(--space-sm);
    margin: var(--space-md) var(--space-lg);
    padding: 0;
    overflow: hidden;
}

.time-picker-wheels:has(
    [data-time-picker-meridiem-column]:not([hidden])
) {
    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr)
        minmax(4.75rem, 0.8fr);
}

.time-picker-wheel {
    position: relative;
    z-index: 3;
    min-width: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
}

.time-picker-wheel__label {
    flex: 0 0 auto;
    min-height: 1.4rem;
    margin: 0 0 var(--space-xs);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
}

.time-picker-wheel__list {
    position: relative;
    z-index: 3;
    height: var(--picker-wheel-height);
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-block: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: transparent;
    list-style: none;
    overscroll-behavior: contain;
    scrollbar-width: none;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.time-picker-wheel__list::-webkit-scrollbar {
    display: none;
}

.time-picker-wheel__list:focus-visible {
    outline: 3px solid var(--focus-colour);
    outline-offset: -3px;
}

.time-picker-wheel__spacer {
    height: calc(
        (var(--picker-wheel-height) - var(--picker-row-height)) / 2
    );
    flex: 0 0 auto;
    scroll-snap-align: none;
}

.time-picker-wheel__option {
    height: var(--picker-row-height);
    min-height: var(--picker-row-height);
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border-radius: var(--radius-small);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--font-size-lg);
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-weight-medium);
    line-height: 1;
    scroll-snap-align: center;
    user-select: none;
}

.time-picker-wheel__option.is-selected,
.time-picker-wheel__option[aria-selected="true"] {
    color: var(--navy-900);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

.time-picker-wheels__separator {
    position: relative;
    z-index: 4;
    width: 1rem;
    display: grid;
    place-items: center;
    padding-top: calc(
        1.4rem + var(--space-xs)
    );
    color: var(--navy-900);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    line-height: 1;
}

.time-picker-wheel--meridiem {
    min-width: 0;
}

.time-picker-wheels__selection {
    position: absolute;
    z-index: 1;
    top: calc(
        1.4rem
        + var(--space-xs)
        + (var(--picker-wheel-height) / 2)
    );
    left: 0;
    right: 0;
    height: var(--picker-row-height);
    border-block: 2px solid var(--blue-500);
    border-radius: var(--radius-small);
    background: var(--blue-050);
    pointer-events: none;
    transform: translateY(-50%);
}

.time-picker-wheels::before,
.time-picker-wheels::after {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    height: calc(
        (var(--picker-wheel-height) - var(--picker-row-height)) / 2
    );
    pointer-events: none;
    content: "";
}

.time-picker-wheels::before {
    top: calc(1.4rem + var(--space-xs));
    background:
        linear-gradient(
            to bottom,
            var(--white) 4%,
            rgba(255, 255, 255, 0.92) 45%,
            rgba(255, 255, 255, 0)
        );
}

.time-picker-wheels::after {
    bottom: 0;
    background:
        linear-gradient(
            to top,
            var(--white) 4%,
            rgba(255, 255, 255, 0.92) 45%,
            rgba(255, 255, 255, 0)
        );
}

.time-picker-dialog__actions {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--border);
    background: var(--slate-050);
}

.time-picker-dialog__actions .button {
    width: 100%;
}


/* ==========================================================================
   27. Definitive Time Picker Mobile Layout
   ========================================================================== */

@media (max-width: 39.99rem) {

    .time-picker-dialog {
        width: calc(100% - 1rem);
        max-width: none;
        max-height: calc(100dvh - 1rem);
        border-radius: var(--radius-medium);
    }

    .time-picker-dialog__panel {
        max-height: calc(100dvh - 1rem);
    }

    .time-picker-dialog__header {
        padding: var(--space-md) var(--space-md) var(--space-sm);
    }

    .time-picker-dialog__header .hero__eyebrow {
        margin-bottom: var(--space-2xs);
        font-size: var(--font-size-xs);
    }

    .time-picker-dialog__header h2 {
        margin-bottom: var(--space-2xs);
        font-size: 1.65rem;
    }

    .time-picker-dialog__header .text-small {
        margin-bottom: var(--space-sm);
        font-size: var(--font-size-sm);
    }

    .time-format-choice {
        gap: var(--space-md);
    }

    .time-format-choice__option {
        font-size: var(--font-size-base);
    }

    .time-picker-wheels {
        --picker-wheel-height: 12rem;

        gap: var(--space-xs);
        margin: var(--space-sm) var(--space-md);
    }

    .time-picker-wheels:has(
        [data-time-picker-meridiem-column]:not([hidden])
    ) {
        grid-template-columns:
            minmax(0, 1fr)
            auto
            minmax(0, 1fr)
            minmax(4rem, 0.72fr);
    }

    .time-picker-wheel__label {
        min-height: 1.2rem;
        margin-bottom: var(--space-2xs);
        font-size: 0.68rem;
    }

    .time-picker-wheel__option {
        font-size: var(--font-size-lg);
    }

    .time-picker-wheel__option.is-selected,
    .time-picker-wheel__option[aria-selected="true"] {
        font-size: 1.65rem;
    }

    .time-picker-wheels__separator {
        width: 0.65rem;
        padding-top: calc(
            1.2rem + var(--space-2xs)
        );
        font-size: var(--font-size-lg);
    }

    .time-picker-wheels__selection {
        top: calc(
            1.2rem
            + var(--space-2xs)
            + (var(--picker-wheel-height) / 2)
        );
    }

    .time-picker-wheels::before {
        top: calc(
            1.2rem + var(--space-2xs)
        );
    }

    .time-picker-dialog__actions {
        padding: var(--space-sm) var(--space-md) var(--space-md);
    }

    .time-picker-dialog__actions .button {
        min-height: 3rem;
        padding: 0.65rem 0.75rem;
    }
}

@media (max-width: 22rem) {

    .time-picker-dialog {
        width: calc(100% - 0.5rem);
    }

    .time-picker-wheels {
        margin-inline: var(--space-sm);
        gap: var(--space-2xs);
    }

    .time-picker-wheels:has(
        [data-time-picker-meridiem-column]:not([hidden])
    ) {
        grid-template-columns:
            minmax(0, 1fr)
            auto
            minmax(0, 1fr)
            minmax(3.65rem, 0.68fr);
    }

    .time-picker-wheels__separator {
        width: 0.45rem;
    }

    .time-picker-wheel__option {
        font-size: var(--font-size-md);
    }

    .time-picker-wheel__option.is-selected,
    .time-picker-wheel__option[aria-selected="true"] {
        font-size: var(--font-size-lg);
    }
}


/* ==========================================================================
   28. Definitive Results Page Above-the-Fold Layout
   ========================================================================== */

/*
 * Preserve the numbered timeline identity while making the result itself
 * faster to scan and compact enough to sit above the fold on ordinary phones.
 */

.result-page .site-header__inner {
    min-height: 4rem;
    padding-block: var(--space-sm);
}

.result-page .page-intro {
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
}

.result-page .page-intro .hero__eyebrow {
    margin-bottom: var(--space-2xs);
}

.result-page .page-intro h1 {
    margin-bottom: var(--space-xs);
    font-size: clamp(1.9rem, 5vw, 2.5rem);
}

.result-page .page-intro__lead {
    margin-bottom: 0;
    font-size: var(--font-size-base);
    line-height: 1.4;
}

.result-page .content-section--white {
    padding-top: var(--space-sm);
    padding-bottom: var(--space-lg);
}

.result-page .timeline {
    width: min(100%, 50rem);
}

.result-page .timeline__item {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: var(--space-sm);
    padding-bottom: var(--space-sm);
}

.result-page .timeline__item::before {
    top: 1.9rem;
    left: 1.08rem;
}

.result-page .timeline__marker {
    width: 2.25rem;
    height: 2.25rem;
    border-width: 2px;
    font-size: var(--font-size-xs);
}

.result-page .timeline__content {
    min-height: 0;
    display: grid;
    grid-template-columns:
        minmax(0, 1.25fr)
        auto
        minmax(8rem, auto);
    grid-template-areas:
        "label time date"
        "detail detail detail";
    align-items: center;
    column-gap: var(--space-md);
    row-gap: var(--space-2xs);
    padding: 0.55rem 0.75rem;
}

.result-page .timeline__label {
    grid-area: label;
    margin: 0;
    color: var(--navy-900);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
}

.result-page .timeline__time {
    grid-area: time;
    margin: 0;
    font-size: 1.45rem;
    white-space: nowrap;
}

.result-page .timeline__date {
    grid-area: date;
    margin: 0;
    font-size: var(--font-size-xs);
    line-height: 1.25;
    text-align: right;
    white-space: nowrap;
}

.result-page .timeline__content .text-small {
    grid-area: detail;
    margin: 0;
    font-size: var(--font-size-xs);
    line-height: 1.25;
}

.result-page .content-section--blue {
    padding-block: var(--space-lg);
}

.result-page .content-section--blue .card {
    padding: var(--space-lg);
}

.result-page .content-section--blue .stack > * + * {
    margin-top: var(--space-md);
}

.result-page .result-actions {
    justify-content: center;
    gap: var(--space-sm);
}

@media (max-width: 39.99rem) {

    .result-page .site-header__inner {
        min-height: 2.8rem;
        padding-block: 0.4rem;
        align-items: center;
        flex-direction: row;
    }

    .result-page .site-brand__tagline,
    .result-page .site-navigation {
        display: none;
    }

    .result-page .site-brand__name {
        font-size: 1.2rem;
    }

    .result-page .page-intro {
        padding-top: 0.45rem;
        padding-bottom: 0.55rem;
    }

    .result-page .page-intro .hero__eyebrow {
        margin-bottom: 0.1rem;
        font-size: 0.68rem;
    }

    .result-page .page-intro h1 {
        margin-bottom: 0.2rem;
        font-size: 1.55rem;
        line-height: 1.08;
    }

    .result-page .page-intro__lead {
        font-size: var(--font-size-sm);
        line-height: 1.3;
    }

    .result-page .content-section--white {
        padding-top: 0.25rem;
        padding-bottom: var(--space-sm);
    }

    .result-page .timeline {
        width: min(
            calc(100% - (var(--page-padding) * 2)),
            var(--reading-width)
        );
    }

    .result-page .timeline__item {
        grid-template-columns: 2rem minmax(0, 1fr);
        gap: 0.55rem;
        padding-bottom: 0.45rem;
    }

    .result-page .timeline__item::before {
        top: 1.7rem;
        left: 0.96rem;
    }

    .result-page .timeline__marker {
        width: 2rem;
        height: 2rem;
        font-size: 0.7rem;
    }

    .result-page .timeline__content {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "label time"
            "date detail";
        column-gap: var(--space-sm);
        row-gap: 0.12rem;
        padding: 0.42rem 0.55rem;
    }

    .result-page .timeline__label {
        font-size: 0.9rem;
    }

    .result-page .timeline__time {
        font-size: 1.35rem;
    }

    .result-page .timeline__date {
        text-align: left;
        white-space: normal;
    }

    .result-page .timeline__content .text-small {
        text-align: right;
        line-height: 1.2;
    }

    .result-page .content-section--blue {
        padding-block: var(--space-md);
    }

    .result-page .content-section--blue .card {
        padding: var(--space-md);
    }

    .result-page .content-section--blue .card__title {
        margin-bottom: var(--space-xs);
    }

    .result-page .result-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 39.99rem) and (max-height: 760px) {

    .result-page .page-intro .hero__eyebrow {
        display: none;
    }

    .result-page .page-intro {
        padding-top: 0.3rem;
        padding-bottom: 0.4rem;
    }

    .result-page .page-intro h1 {
        font-size: 1.4rem;
    }

    .result-page .timeline__item {
        padding-bottom: 0.35rem;
    }

    .result-page .timeline__content {
        padding-block: 0.35rem;
    }

    .result-page .timeline__content .text-small {
        font-size: 0.7rem;
    }
}


/* ==========================================================================
   29. Results Page Mobile Stacked Cards
   ========================================================================== */

/*
 * On phones, each result card becomes a clear vertical reading sequence:
 *
 * Stage label
 * Time
 * Date
 * Supporting explanation
 *
 * Desktop and tablet layouts remain unchanged.
 */
@media (max-width: 39.99rem) {

    .result-page .timeline__content {
        display: block;
        padding: 0.55rem 0.65rem;
    }

    .result-page .timeline__label {
        margin: 0 0 0.18rem;
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .result-page .timeline__time {
        margin: 0 0 0.18rem;
        font-size: 1.45rem;
        line-height: 1.1;
    }

    .result-page .timeline__date {
        margin: 0 0 0.28rem;
        font-size: var(--font-size-xs);
        line-height: 1.25;
        text-align: left;
        white-space: normal;
    }

    .result-page .timeline__content .text-small {
        margin: 0;
        font-size: var(--font-size-xs);
        line-height: 1.3;
        text-align: left;
    }
}

/* ==========================================================================
   30. Date Review Additional Mobile Elements
   ========================================================================== */

[data-review-required-arrival] {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.2rem;
}

[data-review-required-arrival] .review-date,
[data-review-required-arrival] .review-time {
    display: block;
    width: 100%;
    white-space: nowrap;
}

[data-review-required-arrival] .review-date {
    font-size: 1rem;
    line-height: 1.25;
}

[data-review-required-arrival] .review-time {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.15;
}




/* ==========================================================================
   End of File
   ========================================================================== */
/* ==========================================================================
   29. Definitive Mobile Review Control Alignment
   ========================================================================== */

@media (max-width: 39.99rem) {

    /*
     * Use the standard 3.25rem control rhythm throughout the Review stage.
     * Height remains automatic so the two-line Required arrival value is
     * never clipped. Its paired Change button stretches to match that row.
     */
    .planning-page .planner-step--review .plan-review__controls {
        align-items: stretch;
    }

    .planning-page .planner-step--review .plan-review__value,
    .planning-page .planner-step--review button.button.plan-review__change,
    .planning-page .planner-step--review .planner-actions .button {
        height: auto;
        min-height: 3.25rem;
        box-sizing: border-box;
    }

    .planning-page .planner-step--review button.button.plan-review__change {
        align-self: stretch;
        padding: 0.65rem 0.75rem;
    }

    .planning-page .planner-step--review .plan-review__value {
        padding: 0.65rem 0.75rem;
    }
}
