/* ============================================================
   Alp Fitness — Global Stylesheet (Cleaned & Consolidated)
   ------------------------------------------------------------
   TABLE OF CONTENTS
   01) CSS Variables & Brand Colors
   02) Base Styles & Reset
   03) Typography
   04) Layout Components (grids, containers)
   05) Navigation & Header
   06) Chat Interface
   07) Forms & Inputs
   08) Buttons
   09) Cards & Containers
   10) Modal Styles
   11) Utility Classes
   12) Animations
   13) Media Queries & Responsive
   14) Print Styles
   15) Performance Toolkit (page-specific)
   16) Tailwind Replacements (minimal shims)
   ------------------------------------------------------------
   Notes:
   • Tailwind utilities referenced in HTML are shimmed in §16 so the CDN can be removed.
   • Duplicate/overlapping rules were consolidated; ordering now avoids specificity fights.
   ============================================================ */


/* ============================================================
   01) CSS VARIABLES & BRAND COLORS
   ============================================================ */
:root {
    --alp-primary: #003366;
    /* Primary blue */
    --alp-secondary: #336600;
    /* Green */
    --alp-accent: #663300;
    /* Maroon (complementary) */
    --alp-light-blue: #eff7ff;
    /* Light blue tint */
    --alp-link: var(--alp-primary);
    /* Central place for link color */

    /* Neutral scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* ============================================================
   02) BASE STYLES & RESET
   ============================================================ */
html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #eff7ff 0%, #f8fafc 100%);
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
        "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Brand-colored selection */
::selection,
::-moz-selection {
    background: var(--alp-primary);
    color: #fff;
}

/* Global link behavior (no underline by default; accessible focus) */
a {
    color: var(--alp-primary);
    text-decoration: none;
}

a:visited {
    color: var(--alp-primary);
}

a:hover,
a:focus {
    color: var(--alp-accent);
    text-decoration: none;
}

a:focus-visible {
    outline: 2px solid rgba(0, 51, 102, .35);
    outline-offset: 2px;
}

/* Never underline these link-like buttons */
a:where(.btn-primary, .tool-nav-button, .calc-button, .topic-button, .action-button,
    .control-button, .nav-button-home, .tool-exit-button, .share-result,
    .tool-header-link, .ai-help-link, .header-title,
    #alp-header .brand-link, .formatted-content a) {
    text-decoration: none !important;
}

/* ============================================================
   03) TYPOGRAPHY
   ============================================================ */
.page-header {
    text-align: center;
    margin: 1rem 0 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--alp-primary);
    margin-bottom: .5rem;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 1rem;
}

h1,
h2,
h3 {
    font-weight: 700;
    color: var(--alp-primary);
    letter-spacing: 0;
}

h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin: .5rem 0 1rem;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    margin: .75rem 0 .75rem;
}

h3 {
    font-size: 1.25rem;
    line-height: 1.4;
    margin: .75rem 0 .5rem;
}

/* Rich/AI formatted blocks */
.formatted-content {
    line-height: 1.4;
    color: #333;
}

.formatted-content p {
    margin: .75rem 0;
}

.formatted-content ul,
.formatted-content ol {
    margin: .75rem 0;
    padding-left: 1.25rem;
}

.formatted-content li {
    margin-bottom: .35rem;
    line-height: 1.3;
}

.formatted-content h1,
.formatted-content h2,
.formatted-content h3 {
    color: var(--alp-primary);
    font-weight: 600;
    margin: 1.2rem 0 .4rem;
    line-height: 1.3;
}

.formatted-content h3 {
    font-size: 1.1rem;
}

.formatted-content strong {
    color: var(--alp-primary);
    font-weight: 600;
}

.formatted-content a {
    color: var(--alp-primary);
    font-weight: 500;
    background: var(--alp-light-blue);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(0, 51, 102, .2);
    transition: all .2s ease;
    display: inline-block;
    margin: 2px 0;
}

.formatted-content a:hover {
    background: var(--alp-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 51, 102, .2);
}

.ai-formatted-content h4 {
    color: #1e3a8a;
    font-size: 1.1rem;
    margin: 1rem 0 .5rem;
}

.ai-formatted-content p {
    line-height: 1.6;
}

.ai-formatted-content ol,
.ai-formatted-content ul {
    margin-left: 1rem;
}

.ai-formatted-content li {
    margin-bottom: .5rem;
    line-height: 1.6;
}

.ai-formatted-content strong {
    color: #1e293b;
}

.ai-response .ai-formatted-content>*:first-child {
    margin-top: 0;
}

.ai-response .ai-formatted-content>*:last-child {
    margin-bottom: 0;
}

/* ============================================================
   04) LAYOUT COMPONENTS (grids, containers)
   ============================================================ */
#auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

@supports (height: 100dvh) {
    #auth-screen {
        min-height: 100dvh;
    }
}

.toolkit-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Grids */
.input-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width:768px) {
    .input-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.input-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width:640px) {
    .input-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width:1024px) {
    .input-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Vertical spacing when a grid follows another grid or header inside cards */
.calculator-card :is(.section-header, .input-grid-2, .input-grid-3)+ :is(.input-grid-2, .input-grid-3) {
    margin-top: 1rem;
}

@media (min-width:768px) {
    .calculator-card :is(.section-header, .input-grid-2, .input-grid-3)+ :is(.input-grid-2, .input-grid-3) {
        margin-top: 1.25rem;
    }
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.time-grid>div {
    min-width: 0;
}

.distance-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem;
    align-items: end;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.results-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.results-grid.wide {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Page wrapper */
.page-container {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1rem;
}

/* Header title link reset */
.header-title a {
    color: inherit;
    text-decoration: none;
}

.header-title a:hover,
.header-title a:focus {
    color: var(--alp-primary);
    text-decoration: none;
}

/* ============================================================
   05) NAVIGATION & HEADER
   ============================================================ */
#alp-header {
    position: sticky;
    top: 0;
    z-index: 1100;
}

.header-bar {
    background: var(--alp-primary);
    border-bottom: 1px solid var(--alp-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.header-inner {
    padding: .75rem 1rem;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo area */
.logo-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.desktop-only {
    display: none;
}

.mobile-only {
    display: inline-block;
}

@media (min-width:1024px) {
    .desktop-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }
}

/* Right side nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Connection status */
.connection-status {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.status-dot {
    width: .75rem;
    height: .75rem;
    border-radius: 9999px;
    background: #34d399;
}

.status-text {
    font-size: .875rem;
    line-height: 1.25rem;
    color: #bfdbfe;
}

/* Small icon spacing */
.icon-right {
    margin-left: .25rem;
}

/* Dropdown */
/* Dropdown (scroll-safe) */
.alp-header .menu-dropdown {
    position: relative;
    /* anchor the absolute dropdown */
    display: inline-block;
    overflow: visible;
    /* ensure parent doesn't clip menu */
}

.alp-header .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    /* sit directly below the button */
    right: 0;

    /* sizing */
    width: min(92vw, 360px);
    max-height: min(80vh, 560px);
    /* limit to screen height */
    overflow-y: auto;
    /* scroll inside menu when long */
    overflow-x: hidden;
    /* 🚫 no horizontal scroll */
    box-sizing: border-box;
    /* include borders/padding in width */
    -webkit-overflow-scrolling: touch;
    /* smooth iOS scrolling */
    overscroll-behavior: contain;
    /* stop body scroll chaining */

    /* appearance & layering */
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    z-index: 1200;
    /* above page content */
}

.alp-header .dropdown-content.show {
    display: block;
}

/* Mobile: use full width with side gutters; never require horizontal scroll */
@media (max-width: 640px) {
    .alp-header .dropdown-content {
        left: 8px;
        /* gutter */
        right: 8px;
        /* gutter */
        width: auto;
        /* allow full width between left/right */
        max-width: none;
        /* remove 360px cap on small screens */
        max-height: calc(90vh - 16px);
        /* a bit taller on mobile */
    }

    /* Prevent long text from forcing horizontal scroll */
    .alp-header .dropdown-content a {
        white-space: normal;
        /* wrap text */
        word-break: break-word;
        /* break very long words/URLs */
    }

    /* Keep icon from shrinking; text gets the remaining space cleanly */
    .alp-header .dropdown-content .menu-item {
        display: grid;
        grid-template-columns: 20px 1fr;
        /* icon | text */
        align-items: center;
    }

    .menu-icon {
        width: 18px;
        height: 18px;
    }
}

/* Ensure no header container clips the dropdown */
#alp-header,
.header-inner,
.header-row,
.header-nav {
    overflow: visible;
}

/* Mobile: make dropdown fill the screen width and avoid horizontal scroll */
@media (max-width: 640px) {

    /* The trigger wrapper should be non-positioned so the fixed panel can anchor to the viewport */
    .alp-header .menu-dropdown {
        position: static;
    }

    /* Convert the dropdown into a fixed, full-width panel with vertical scroll only */
    .alp-header .dropdown-content {
        position: fixed;
        /* We’ll set top dynamically from JS so it sits right under the header */
        left: 12px;
        right: 12px;
        width: auto;
        /* prevent narrow column */
        min-width: 0;
        /* override desktop min-width */
        max-width: none;
        max-height: calc(100dvh - 64px);
        /* safe default; JS refines it */
        overflow-y: auto;
        overflow-x: hidden;
        /* no horizontal scroll */
        box-sizing: border-box;
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
    }

    /* Make items readable: allow wrapping, larger tap area */
    .alp-header .dropdown-content a {
        white-space: normal;
        /* wrap long labels instead of squeezing */
        line-height: 1.35;
        padding: 14px 16px;
    }

    /* Sections keep spacing but don’t force width */
    .alp-header .dropdown-content .menu-section {
        white-space: normal;
    }
}

.alp-header .dropdown-content a {
    color: var(--alp-primary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-decoration: none;
    transition: background-color .2s ease;
    cursor: pointer;
}

.alp-header .dropdown-content a:hover {
    background: var(--alp-light-blue);
}

.alp-header .dropdown-content a.active {
    background: var(--alp-primary);
    color: #fff;
}

.alp-header .dropdown-content .menu-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 8px 16px 4px;
    margin-top: 8px;
}

.alp-header .dropdown-content .menu-section:first-child {
    margin-top: 0;
}

.alp-header .menu-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all .2s;
}

.alp-header .menu-button:hover {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .5);
}

/* Menu icon sizing (Lucide & Material) */
.menu-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    line-height: 1;
    vertical-align: text-bottom;
}

.menu-icon.material-icons {
    font-size: 18px;
}

/* Return link bar (optional) */
.alp-header .return-link {
    background: var(--alp-light-blue);
    border-bottom: 1px solid rgba(0, 51, 102, .2);
}

.alp-header .return-link a {
    color: var(--alp-primary);
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}

.alp-header .return-link a:hover {
    color: var(--alp-accent);
}

/* Desktop logo sizing + responsive tweaks */
.alp-header .logo-desktop {
    height: 60px;
    width: auto;
    max-width: 253px;
}

@media (max-width:1024px) {
    .alp-header .logo-desktop {
        height: 52px;
    }
}

@media (max-width:820px) {
    .alp-header .logo-desktop {
        height: 46px;
    }
}

/* Fade-in for connection status */
.alp-header .connection-status {
    opacity: 0;
    animation: fadeIn .5s ease-in-out 1s forwards;
}

/* Title/link resets within header */
#alp-header h1 a,
#alp-header h2 a {
    color: inherit;
    text-decoration: none;
}

#alp-header h1 a:hover,
#alp-header h1 a:focus,
#alp-header h2 a:hover,
#alp-header h2 a:focus {
    color: inherit;
    text-decoration: none;
}

/* Title alignment with icon */
#alp-header :is(h1, h2) {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    line-height: 1.2;
    font-weight: 700;
}

#alp-header :is(h1, h2) a,
#alp-header :is(h1, h2) u {
    text-decoration: none !important;
    border-bottom: 0 !important;
    color: inherit;
}

#alp-header :is(h1, h2) [data-lucide] {
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

/* Brand lockup for mobile */
#alp-header .brand-lockup {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: .5rem;
    align-items: center;
}

#alp-header .brand-link,
#alp-header .brand-link:visited,
#alp-header .brand-link:hover,
#alp-header .brand-link:focus {
    text-decoration: none !important;
    color: inherit;
}

#alp-header .brand-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    line-height: 1;
}

#alp-header .brand-title {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
    font-size: 1.25rem;
    color: #fff !important;
}

#alp-header .brand-subtitle {
    grid-column: 2;
    grid-row: 2;
    margin: .125rem 0 0 0;
    font-weight: 600;
    line-height: 1.25;
    font-size: 1rem;
    color: #fff !important;
}

#alp-header .brand-link .underline,
#alp-header .brand-subtitle.underline,
#alp-header .brand-title.underline {
    text-decoration: none !important;
    border-bottom: 0 !important;
}

#alp-header .brand-icon [data-lucide] {
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: -0.125em;
}

.brand-icon,
.brand-icon [data-lucide] {
    color: #fff !important;
}

@media (max-width:640px) {
    #alp-header :is(h1, h2) {
        font-size: 1.125rem;
    }

    #alp-header .brand-title {
        font-size: 1.125rem !important;
    }

    #alp-header .brand-subtitle {
        font-size: .9375rem !important;
    }
}

/* Lock header title/subtitle sizes (don’t let global h2 mobile rule shrink them) */
#alp-header h1.brand-title,
#alp-header .brand-title {
    font-size: 1.25rem !important;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
}

#alp-header h2.brand-subtitle,
#alp-header .brand-subtitle {
    font-size: 1rem !important;
    line-height: 1.25;
    font-weight: 600;
    color: #fff;
}

/* ============================================================
   06) CHAT INTERFACE
   ============================================================ */
.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: .75rem;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-padding-bottom: 96px;
}

.message {
    max-width: 85%;
    margin-bottom: .75rem;
    padding: .6rem .85rem;
    border-radius: .75rem;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    hyphens: auto;
}

.message.user {
    margin-left: auto;
    background: var(--alp-primary);
    color: #fff;
}

.message.assistant {
    margin-right: auto;
    background: #fff;
    color: var(--alp-primary);
    border: 1px solid var(--gray-200);
}

.message.session {
    margin-right: auto;
    background: linear-gradient(135deg, var(--alp-light-blue) 0%, #f0fdf4 100%);
    color: var(--alp-primary);
    border: 2px solid var(--alp-secondary);
    border-left: 6px solid var(--alp-secondary);
}

.message.user {
    margin-right: .25rem;
}

.message.assistant {
    margin-left: .25rem;
}

/* Media inside messages */
.message .formatted-content img,
.message .formatted-content svg,
.message .formatted-content video,
.message .formatted-content canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.message .formatted-content pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: .5rem;
    background: #f8fafc;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
}

.message.assistant .formatted-content>*:first-child {
    margin-top: 0;
}

.message.assistant .formatted-content>*:last-child {
    margin-bottom: 0;
}

.typing-indicator {
    display: flex;
    gap: .25rem;
}

.typing-dot {
    width: .5rem;
    height: .5rem;
    background: var(--alp-secondary);
    border-radius: 50%;
    animation: bounce 1s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: .1s;
}

.typing-dot:nth-child(3) {
    animation-delay: .2s;
}

/* Welcome / helper content */
.welcome-content {
    background: var(--alp-light-blue);
    border: 1px solid rgba(0, 51, 102, .1);
    border-radius: 10px;
    padding: 12px;
    margin: 4px 0;
}

.welcome-content p {
    margin: 12px;
}

.welcome-content p:last-of-type {
    margin-bottom: 12px;
}

.welcome-content h3 {
    color: var(--alp-primary);
    margin: 0 0 16px;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.welcome-content .three-ways-grid {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.welcome-content .three-ways-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 8px;
}

.welcome-content .three-ways-card h4 {
    color: var(--alp-primary);
    margin: 0 0 12px;
    font-weight: 600;
    line-height: 1.2;
    font-size: 1.1rem;
}

.welcome-content .three-ways-card p {
    margin: 0 0 12px;
    color: #555;
    line-height: 1.3;
    font-size: 1rem;
}

.welcome-content .three-ways-card p:last-child {
    margin-bottom: 0 !important;
}

.welcome-content .three-ways-card button {
    background: var(--alp-secondary);
    color: #fff;
    border: 0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 2px;
}

.welcome-content .three-ways-card.calculators button {
    background: var(--alp-accent);
    margin: 2px 4px 2px 0;
    padding: 3px 6px;
    display: inline-block;
}

.welcome-content .three-ways-card .button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 2px;
}

.sample-starters {
    margin: 16px 0;
}

.sample-starters ul {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.sample-starters li {
    margin: 8px 0;
    padding-left: 0;
}

.knowledge-base-note {
    font-size: .9em;
    color: #666;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 51, 102, .1);
}

/* Chat footer: respect safe areas */
.chat-container>.border-t {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

@supports (padding: max(0px)) {
    .chat-container>.border-t {
        padding-bottom: max(1rem, calc(1rem + env(safe-area-inset-bottom)));
    }
}

/* ============================================================
   07) FORMS & INPUTS
   ============================================================ */
.input-group {
    position: relative;
}

/* Vertical rhythm between direct siblings inside calculator cards */
.calculator-card>.input-group+.input-group {
    margin-top: 1rem;
}

@media (max-width:640px) {
    .calculator-card>.input-group+.input-group {
        margin-top: .875rem;
    }
}

/* Inside grids, rely on grid gap for spacing */
.input-grid-2 .input-group,
.input-grid-3 .input-group,
.input-grid-2 .input-group+.input-group,
.input-grid-3 .input-group+.input-group {
    margin-top: 0 !important;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--alp-primary);
    margin-bottom: 8px;
}

/* Spacing: controls under input labels (ensures chips don't crowd inputs) */
.input-group>.unit-toggle,
.input-group>.toggle-group,
.input-group>.time-grid {
    margin-top: 1rem;
    /* 16px on mobile */
}

@media (min-width: 768px) {

    .input-group>.unit-toggle,
    .input-group>.toggle-group,
    .input-group>.time-grid {
        margin-top: 1.25rem;
        /* 20px on tablet/desktop for a bit more breath */
    }
}

/* Chat textarea */
#message-input {
    padding: .75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 3.5rem;
}

/* Form control baseline */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
    font: inherit;
    line-height: 1.5;
    color: var(--gray-800);
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: .5rem;
    caret-color: var(--alp-primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--gray-400);
    opacity: 1;
}

/* Focus */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--alp-primary);
    box-shadow: 0 0 0 2px rgba(0, 51, 102, .15);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: none;
    border-color: var(--alp-primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, .25);
}

input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible),
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    box-shadow: none;
}

/* Calculator input */
.calculator-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 16px;
    transition: all .2s ease;
    background: #fff;
}

.calculator-input:focus {
    outline: none;
    border-color: var(--alp-primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, .1);
}

.calculator-input.result {
    background: var(--alp-light-blue);
    font-weight: 600;
    color: var(--alp-primary);
}

/* Token styles */
.token-prefix {
    background: #f8fafc;
    border-right: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .025em;
}

.token-input {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.validation-feedback {
    transition: all .2s ease;
}

/* Range slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: var(--gray-200);
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-moz-range-track {
    background: var(--gray-200);
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--alp-primary);
    height: 24px;
    width: 24px;
    border-radius: 50%;
    margin-top: -8px;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}

input[type="range"]::-moz-range-thumb {
    background: var(--alp-primary);
    height: 24px;
    width: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
    border: none;
}

input[type="range"]:hover::-webkit-slider-thumb {
    background: var(--alp-secondary);
}

input[type="range"]:hover::-moz-range-thumb {
    background: var(--alp-secondary);
}

/* Status messages */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
}

.status-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
}

.status-success {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.status-info {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

/* Unit toggle (Miles/KM, Feet/Meters) — single, consolidated definition */
.unit-toggle {
    display: inline-flex;
    gap: .5rem;
    padding: .25rem;
    border-radius: 9999px;
    background: transparent;
    border: 0;
}

.toggle-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem .875rem;
    border-radius: 9999px;
    border: 1px solid var(--alp-primary);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    color: var(--gray-700);
    background: #fff;
    transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
    flex: 0 0 auto;
    white-space: nowrap;
    max-width: 100%;
}

.toggle-option:hover {
    border-color: var(--alp-primary);
}

/* Selected states (supports class, aria-pressed, and input+label patterns) */
.toggle-option.selected,
.toggle-option.active,
.unit-toggle [aria-pressed="true"],
.unit-toggle .is-selected,
.unit-toggle input:checked+.toggle-option {
    background: var(--alp-primary);
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--alp-primary);
}

.toggle-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-option:focus-within {
    outline: 2px solid var(--alp-primary);
    outline-offset: 2px;
}

/* Input helpers */
.field-note {
    display: block;
    margin-top: .25rem;
    font-size: .75rem;
    color: var(--gray-500);
    text-align: center;
}

.input-center {
    text-align: center;
}

/* (single definition) */

/* Preset distance chips */
.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
}

.preset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem .75rem;
    border-radius: 9999px;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--alp-primary);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.preset-btn:hover {
    background: var(--alp-light-blue);
    border-color: var(--alp-primary);
    transform: translateY(-1px);
}

.preset-btn:active {
    transform: translateY(0);
}

/* Number input normalize */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Calculator refinements */
.time-grid>div {
    min-width: 0;
}

.time-grid input.calculator-input {
    font-variant-numeric: tabular-nums;
}

.time-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.time-grid-2>div {
    min-width: 0;
}

/* Generic section spacer */
.section-spacer {
    margin-top: 1.5rem;
}

/* (single definition) */

/* ============================================================
   08) BUTTONS
   ============================================================ */
.btn-group {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
}

.btn-group .calc-button {
    flex: 1;
}

.btn-full {
    width: 100%;
}

/* Primary button (link or button) */
button.btn-primary,
a.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    background: var(--alp-primary);
    color: #fff;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
}

button.btn-primary:hover,
a.btn-primary:hover {
    background: #002244;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 51, 102, .2);
    color: #fff;
}

.btn-primary.accent {
    background: var(--alp-secondary);
}

.btn-primary.accent:hover {
    background: #2d5a00;
    box-shadow: 0 4px 8px rgba(51, 102, 0, .2);
}

/* Calculator/action */
.calc-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    background: var(--alp-primary);
    color: #fff;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}

.calc-button:hover {
    background: color-mix(in srgb, var(--alp-primary) 88%, black 12%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
}

.calc-button:active {
    background: color-mix(in srgb, var(--alp-primary) 80%, black 20%);
    transform: translateY(0);
    box-shadow: none;
}

.calc-button:focus-visible {
    outline: 2px solid var(--alp-accent);
    outline-offset: 2px;
}

.calc-button.secondary {
    background: var(--gray-600);
    color: #fff;
}

.calc-button.secondary:hover {
    background: color-mix(in srgb, var(--gray-600) 85%, black 15%);
    transform: translateY(-1px);
}

.calc-button.secondary:active {
    background: color-mix(in srgb, var(--gray-600) 78%, black 22%);
    transform: translateY(0);
}

.calc-button[disabled],
.calc-button.is-disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.calc-button i[data-lucide] {
    width: 20px;
    height: 20px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .calc-button {
        transition: none;
    }

    .calc-button:hover,
    .calc-button:active {
        transform: none;
    }
}

/* Topic button (home suggestions) */
.topic-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    padding: 12px 16px;
    background: var(--alp-primary);
    color: #fff;
    margin: 4px;
}

.topic-button:hover {
    background: var(--alp-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 51, 102, .2);
}

/* Tool navigation button */
.tool-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    padding: 14px 28px;
    background: #fff;
    color: var(--gray-500);
    width: 100%;
}

@media (min-width:640px) {
    .tool-nav-button {
        width: auto;
    }
}

.tool-nav-button:hover:not(:disabled) {
    border-color: var(--alp-primary);
    color: var(--alp-primary);
    background: var(--alp-light-blue);
}

.tool-nav-button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.tool-nav-button.primary,
.tool-nav-button.success {
    background: var(--alp-primary);
    color: #fff;
    border-color: var(--alp-primary);
}

.tool-nav-button.primary:hover:not(:disabled),
.tool-nav-button.success:hover:not(:disabled) {
    background: var(--alp-secondary);
    border-color: var(--alp-secondary);
    transform: translateY(-1px);
    color: #fff;
}

/* Exit link-like button */
.tool-exit-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

.tool-exit-button:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

/* Action buttons (privacy/completion) */
.action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    padding: 14px 28px;
    background: var(--alp-secondary);
    color: #fff;
    justify-content: center;
}

.action-button:hover {
    background: #2d5a00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(51, 102, 0, .2);
}

.action-button.secondary {
    background: var(--alp-primary);
}

.action-button.secondary:hover {
    background: #002244;
}

/* Home nav button */
.nav-button-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    padding: 14px 28px;
    background: var(--gray-500);
    color: #fff;
    justify-content: center;
}

.nav-button-home:hover {
    background: var(--gray-600);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
}

.nav-button-home.primary {
    background: var(--alp-primary);
}

.nav-button-home.primary:hover {
    background: var(--alp-secondary);
}

/* Touch target minimums across clickable controls */
button,
.button,
a.button,
button.btn-primary,
a.btn-primary,
.calc-button,
.tool-nav-button,
.action-button,
.control-button,
.nav-button-home,
.topic-button,
.share-result,
.guided-session-btn,
.tool-exit-button {
    min-height: 44px;
    min-width: 44px;
}

/* ============================================================
   09) CARDS & CONTAINERS
   ============================================================ */
.calculator-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 51, 102, .1);
    border: 1px solid rgba(0, 51, 102, .05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.calculator-card>*+* {
    margin-top: 1.5rem;
}

@media (max-width:640px) {
    .calculator-card>*+* {
        margin-top: 1.25rem;
    }
}

.calculator-card .section-spacer {
    margin-top: 0;
}

/* de-dupe padding if legacy markup exists */

.result-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .05);
    margin-bottom: 16px;
    border-left: 4px solid var(--alp-primary);
    transition: all .2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, .1);
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.result-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--alp-primary);
    margin-bottom: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.result-unit {
    font-size: 16px;
    color: var(--gray-500);
    font-weight: 500;
}

.info-box {
    background: var(--alp-light-blue);
    border: 1px solid rgba(0, 51, 102, .2);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.info-box h4 {
    color: var(--alp-primary);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
}

.info-box p {
    color: var(--gray-500);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box a {
    color: var(--alp-primary);
    font-weight: 600;
    text-decoration: none;
}

.info-box a:hover {
    text-decoration: none;
}

.data-display {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: .875rem;
    max-height: 200px;
    overflow-y: auto;
}

/* Results tables */
.results-table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .05);
}

.results-table th {
    background: var(--alp-light-blue);
    color: var(--alp-primary);
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
}

.results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.results-table tr:hover {
    background: #f8fafc;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.results-table th,
.results-table td {
    word-break: break-word;
}

.distance-label {
    font-weight: 600;
    color: var(--gray-700);
}

.time-result {
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 600;
    color: var(--alp-primary);
}

.pace-result {
    font-family: 'Monaco', 'Menlo', monospace;
    color: var(--gray-500);
}

/* Fueling accents */
.result-card.carbs {
    border-left-color: var(--alp-secondary);
}

.result-card.protein {
    border-left-color: var(--alp-accent);
}

.result-card.fluid {
    border-left-color: #0066cc;
}

.result-card.sodium {
    border-left-color: #cc6600;
}

.result-range {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
}

.fueling-schedule {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .05);
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-time {
    font-weight: 600;
    color: var(--alp-primary);
}

.schedule-action {
    color: var(--gray-500);
}

/* GAP comparison */
.result-card.highlight {
    border-left-color: var(--alp-secondary);
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.comparison-card {
    background: linear-gradient(135deg, var(--alp-primary), var(--alp-secondary));
    color: #fff;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    text-align: center;
}

.comparison-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.comparison-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.comparison-stat {
    background: rgba(255, 255, 255, .1);
    padding: 12px;
    border-radius: 8px;
}

.comparison-stat-value {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.comparison-stat-label {
    font-size: 12px;
    opacity: .9;
}

/* Pace / recent */
.recent-calculations {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-top: 24px;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
}

.recent-item:last-child {
    border-bottom: none;
}

.share-result {
    background: var(--alp-secondary);
    color: #fff;
    border: 0;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.share-result:hover {
    background: #2d5a00;
}

/* Zones */
.zone-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .05);
    margin-bottom: 16px;
    border-left: 4px solid;
    transition: all .2s ease;
}

.zone-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, .1);
}

.zone-card.easy {
    border-left-color: #3b82f6;
}

.zone-card.conversational {
    border-left-color: #10b981;
}

.zone-card.tempo {
    border-left-color: #f59e0b;
}

.zone-card.threshold {
    border-left-color: #ef4444;
}

.zone-card.vo2max {
    border-left-color: #8b5cf6;
}

.zone-card.anaerobic {
    border-left-color: #dc2626;
}

.zone-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--alp-primary);
    margin-bottom: 8px;
}

.zone-description {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 12px;
    line-height: 1.5;
}

.zone-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.zone-value {
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    text-align: center;
}

.zone-value-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.zone-value-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--alp-primary);
    font-family: 'Monaco', 'Menlo', monospace;
}

.zone-purpose {
    font-size: 12px;
    color: var(--alp-primary);
    background: var(--alp-light-blue);
    padding: 8px 12px;
    border-radius: 6px;
    font-style: italic;
}

.print-zones {
    background: var(--alp-secondary);
    color: #fff;
}

.print-zones:hover {
    background: #2d5a00;
}

.terrain-note {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 13px;
}

.vdot-display {
    font-size: 3rem;
    font-weight: 800;
    color: var(--alp-primary);
    margin: .5rem 0;
    text-align: center;
    font-family: 'Monaco', 'Menlo', monospace;
}

.result-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--alp-primary);
    margin-bottom: 8px;
    text-align: center;
}

.result-description {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 12px;
    line-height: 1.5;
    text-align: center;
}

.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.distance-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
}

/* Generic content card (privacy page) */
.content-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 20px rgba(0, 51, 102, .08);
    border: 1px solid rgba(0, 51, 102, .06);
}

/* Calculator section headings */
.section-header {
    margin: 0 0 1rem;
}

.calculator-card .section-header:not(:first-child) {
    margin-top: 1.5rem;
}

.section-header--md {
    margin-bottom: 1.5rem;
}

.section-header--lg {
    margin-bottom: 2rem;
}

.section-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--alp-primary);
    line-height: 1.25;
    margin: 0;
}

/* Notices & footer callouts */
.note {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
}

.note--info {
    background: var(--alp-light-blue);
    border-left: 4px solid var(--alp-primary);
}

.note-text {
    font-size: .875rem;
    color: var(--alp-primary);
    margin: 0;
}

.footer-note {
    text-align: center;
    margin-top: 1rem;
}

.footer-note__inline {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    color: var(--gray-500);
}

.footer-note__inline i[data-lucide] {
    width: 12px;
    height: 12px;
}

/* ============================================================
   10) MODAL STYLES (Updated for Alp Fitness Branding)
   ============================================================ */
:root {
    --alp-primary: #003366;
    /* Brand navy */
    --alp-maroon: #7a1e1e;
    /* Brand maroon */
    --alp-light-blue: #e6f0fa;
    /* Light brand tint */
    --alp-border: #e5e7eb;
    /* Neutral border */
}

.session-modal {
    position: fixed;
    inset: 0;
    /* KEY CHANGE: anchor below header instead of perfect-centering */
    align-items: flex-start;
    justify-content: center;

    /* leave room at the top for any fixed header + safe area */
    padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
    padding-right: 12px;
    padding-bottom: 12px;
    padding-left: 12px;

    background: rgba(0, 51, 102, .55);
    /* brand-tinted overlay */
    backdrop-filter: blur(2px);

    z-index: 2147483000;
    /* safely above header/toasts */
    display: none;
    /* toggled by .show */
}

.session-modal.show {
    display: flex;
}

.session-modal-content {
    background: #fff;
    border-radius: 16px;
    width: min(900px, 96%);

    /* KEY CHANGE: the panel scrolls; its top is never hidden */
    max-height: calc(100vh - (72px + 24px));
    /* header pad + top/bottom padding */
    overflow: auto;
    -webkit-overflow-scrolling: touch;

    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    border: 1px solid var(--alp-border, #e5e7eb);
    margin: 0 auto;
    /* center horizontally */
}

.session-modal-content .sticky {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid var(--alp-border);
    z-index: 1;
}

.session-card {
    background: #fff;
    border: 1px solid var(--alp-border);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    cursor: pointer;
    transition: all .2s ease;
}

.session-card:hover {
    border-color: var(--alp-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 51, 102, .15);
}

.session-card.available {
    border-color: var(--alp-primary);
    background: linear-gradient(135deg, var(--alp-light-blue) 0%, #fff 100%);
}

.session-progress {
    background: var(--alp-light-blue);
    border: 1px solid var(--alp-primary);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.guided-session-btn {
    background: var(--alp-primary);
    color: #fff;
    border: 0;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guided-session-btn:hover {
    background: var(--alp-maroon);
    transform: translateY(-1px);
}

.session-summary {
    background: linear-gradient(135deg, var(--alp-light-blue) 0%, #fff 100%);
    border: 2px solid var(--alp-primary);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}

/* NEW: Consistent status dot + badge */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--alp-primary);
}

.badge-new {
    background: var(--alp-light-blue);
    color: var(--alp-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

/* ============================================================
   11) UTILITY CLASSES
   ============================================================ */
.hidden {
    display: none;
}

/* (single definition) */
.is-hidden {
    display: none !important;
}

.text-mobile-hidden {
    display: none;
}

@media (min-width:640px) {
    .text-mobile-hidden {
        display: inline;
    }
}

@media (max-width:767px) {
    .text-mobile-hidden {
        display: none !important;
    }
}

.icon-text {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
}

.icon-text i[data-lucide] {
    width: 1.5rem;
    height: 1.5rem;
}

.privacy-notice {
    margin-top: auto;
    padding-top: 2rem;
}

/* Tool header link (single definition) */
.tool-header-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    transition: all .2s ease;
    color: var(--alp-link);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
}

.tool-header-link:hover {
    text-decoration: underline;
}

/* Privacy page sections */
.privacy-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--alp-primary);
}

.privacy-controls {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid #e2e8f0;
}

.privacy-section ul {
    margin: .5rem 0 0;
    padding-left: 1.25rem;
}

.privacy-section li {
    margin: .35rem 0;
}

/* Color systems per section */
.privacy-section.protected {
    background: #f0fdf4;
    border-left-color: #16a34a;
    color: #166534;
}

.privacy-section.protected :is(h3, h4, strong) {
    color: #166534;
}

.privacy-section.protected i[data-lucide] {
    color: #16a34a;
}

.privacy-section.local {
    background: #fef3c7;
    border-left-color: #d97706;
    color: #92400e;
}

.privacy-section.local :is(h3, h4, strong) {
    color: #92400e;
}

.privacy-section.local i[data-lucide] {
    color: #d97706;
}

.privacy-section.security {
    background: #eff6ff;
    border-left-color: #2563eb;
    color: #1e40af;
}

.privacy-section.security :is(h3, h4, strong) {
    color: #1e40af;
}

.privacy-section.security i[data-lucide] {
    color: #2563eb;
}

.privacy-section.danger {
    background: #fef2f2;
    border-left-color: #dc2626;
    color: #b91c1c;
}

.privacy-section.danger :is(h3, h4, strong),
.privacy-section.danger i[data-lucide] {
    color: #dc2626;
}

/* Prose helpers */
.prose-muted {
    color: var(--gray-600);
    font-size: .875rem;
    line-height: 1.6;
}

.bullet-list {
    margin: .5rem 0 1rem;
    padding-left: 1.25rem;
    color: var(--gray-600);
    font-size: .875rem;
    line-height: 1.6;
}

.bullet-list li {
    margin: .25rem 0;
}

.prose-note {
    font-style: italic;
    color: var(--gray-500);
    font-size: .8125rem;
}

/* Icon alignment baseline */
[data-lucide] {
    display: inline-block;
    vertical-align: -0.125em;
    line-height: 1;
    flex-shrink: 0;
}

button i[data-lucide],
.tool-nav-button i[data-lucide],
.calc-button i[data-lucide],
.control-button i[data-lucide],
.action-button i[data-lucide],
.nav-button-home i[data-lucide],
.icon-text i[data-lucide] {
    line-height: 1;
}

/* Interactive cursor for non-button roles */
[role="button"],
.tool-nav-button,
.calc-button,
.control-button,
.action-button,
.nav-button-home {
    cursor: pointer;
}

/* Simple rows & stacks */
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* Privacy Controls Button Layout */
.privacy-controls .button-row {
    display: grid;
    grid-template-columns: repeat(2, auto);
    /* two buttons per row */
    gap: 1rem;
    /* spacing between them */
    justify-content: center;
    /* center the whole grid */
    margin-top: 1.5rem;
}

.privacy-controls .button-row button {
    justify-self: center;
    /* center each button within its cell */
}

/* Center the icon-text heading in Privacy Controls */
.privacy-controls .icon-text {
    justify-content: center;
    /* centers icon + text as a group */
    text-align: center;
    /* centers the text itself */
}

/* Center the muted paragraph in Privacy Controls */
.privacy-controls .muted {
    text-align: center;
}

.muted {
    color: var(--gray-600);
}

.page-footer-note {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    font-size: .875rem;
    color: var(--gray-500);
}

.page-footer-note p+p {
    margin-top: .5rem;
}

/* ============================================================
   12) ANIMATIONS
   ============================================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    20%,
    53%,
    80%,
    100% {
        transform: translateY(0);
    }

    40%,
    43% {
        transform: translateY(-30px);
    }

    70% {
        transform: translateY(-15px);
    }

    90% {
        transform: translateY(-4px);
    }
}

/* ============================================================
   13) MEDIA QUERIES & RESPONSIVE
   ============================================================ */
@media (max-width:640px) {
    .privacy-notice {
        padding: 1rem;
        font-size: .75rem;
    }

    .tool-header-link {
        display: block;
        margin-top: .5rem;
    }

    /* Chat sizing */
    .messages-container {
        padding: .5rem;
    }

    .message {
        max-width: 92%;
    }

    .welcome-content {
        padding: 10px;
        margin: 6px 0;
    }
}

/* Very small phones: chat composer alignment */
@media (max-width:480px) {
    .chat-container .border-t .flex {
        align-items: stretch;
    }

    #message-input {
        min-height: 3rem;
        padding: .625rem .875rem;
    }

    #send-btn {
        padding: .5rem .75rem;
        min-width: 52px;
    }
}

/* Mobile-specific toolkit layout */
@media (max-width:767px) {
    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .toolkit-container {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    .bg-white.shadow-sm.border-b {
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 100;
        background: #fff;
    }

    .bg-white.shadow-sm.border-b h1 {
        font-size: 1.5rem;
    }

    .bg-white.shadow-sm.border-b p {
        font-size: .875rem;
    }

    .tool-exit-button {
        padding: .5rem;
        font-size: .875rem;
    }

    /* Progress */
    .progress-container {
        padding: 1rem;
        background: #fff;
        border-bottom: 1px solid var(--gray-200);
        margin-bottom: 1rem;
        position: sticky;
        top: 60px;
        z-index: 90;
    }

    .progress-bar {
        height: 8px;
        background: var(--gray-200);
        border-radius: 4px;
        overflow: visible;
        position: relative;
        margin-bottom: .5rem;
    }

    .progress-fill {
        height: 100%;
        border-radius: 4px;
        transition: width .3s ease;
        background: var(--alp-secondary);
    }

    .progress-label {
        font-size: .875rem;
        color: var(--gray-500);
        text-align: center;
    }

    /* Steps */
    .toolkit-step {
        display: none !important;
        flex-direction: column !important;
        padding: 1rem !important;
        max-width: 100% !important;
        margin: 0 !important;
        min-height: calc(100vh - 200px);
    }

    .toolkit-step.active {
        display: flex !important;
    }

    .step-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .step-navigation {
        display: none !important;
    }

    textarea {
        width: 100% !important;
        min-height: 100px;
        font-size: 16px !important;
        padding: .75rem !important;
        border: 2px solid var(--gray-200) !important;
        border-radius: .5rem !important;
    }

    textarea:focus {
        border-color: var(--alp-secondary) !important;
        outline: none !important;
    }

    input[type="range"] {
        width: 100% !important;
        margin: 1rem 0 !important;
    }

    #arousal-value {
        font-size: 1.5rem !important;
        font-weight: bold !important;
        color: var(--alp-primary) !important;
    }

    /* AI response panel */
    .ai-help-link {
        display: inline-flex;
        align-items: center;
        gap: .25rem;
        color: var(--alp-secondary);
        text-decoration: none;
        font-size: .9375rem;
        padding: .5rem 0;
        margin-top: .5rem;
    }

    .ai-response {
        margin-top: 1rem;
        padding: 1rem;
        background: #f9fafb;
        border-left: 4px solid var(--alp-secondary);
        border-radius: .375rem;
        font-size: .9375rem;
        line-height: 1.6;
    }

    .ai-response p {
        margin-bottom: .75rem;
    }

    .ai-response p:last-child {
        margin-bottom: 0;
    }

    .ai-response ul {
        margin: .75rem 0;
        padding-left: 1.5rem;
    }

    .ai-response li {
        margin-bottom: .5rem;
    }

    /* Completion screen */
    #completion-summary {
        padding: 1rem;
        background: #f9fafb;
        border-radius: .5rem;
        margin-bottom: 1.5rem;
    }

    #completion-summary h3 {
        font-size: 1.125rem;
        color: var(--alp-primary);
        margin-bottom: 1rem;
    }

    #completion-summary .response-section {
        margin-bottom: 1.25rem;
        padding-bottom: 1.25rem;
        border-bottom: 1px solid var(--gray-200);
    }

    #completion-summary .response-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    #completion-summary .response-label {
        font-weight: 600;
        color: var(--gray-600);
        font-size: .875rem;
        margin-bottom: .25rem;
        display: block;
    }

    #completion-summary .response-text {
        color: #1f2937;
        font-size: .9375rem;
        line-height: 1.5;
    }

    .download-pdf-button,
    .get-analysis-button {
        width: 100%;
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: .5rem;
        font-size: 1rem;
        font-weight: 500;
        border: 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .5rem;
    }

    .download-pdf-button {
        background: var(--alp-secondary);
        color: #fff;
    }

    .get-analysis-button {
        background: var(--alp-primary);
        color: #fff;
    }

    /* Loading */
    .animate-spin {
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        from {
            transform: rotate(0deg);
        }

        to {
            transform: rotate(360deg);
        }
    }

    .loading-text {
        color: var(--gray-500);
        font-style: italic;
    }

    /* Responsive type (content area only) */
    h2 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.125rem !important;
    }

    .step-intro {
        font-size: .9375rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    label {
        font-size: .9375rem !important;
        font-weight: 600;
        margin-bottom: .5rem;
        display: block;
    }

    /* Safe widths */
    * {
        max-width: 100%;
        word-wrap: break-word;
    }

    button,
    .button,
    a.button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Wrap segmented toggles on very small phones */
.toggle-group {
    justify-content: center;
    border-radius: 12px;
}

.toggle-option {
    padding: .5rem .75rem;
}

/* ============================================================
   14) PRINT STYLES
   ============================================================ */
@media print {

    /* Hide UI-only elements */
    #alp-header,
    .toolkit-progress,
    button,
    .save-indicator,
    #save-status,
    .toolkit-ai-response,
    .bg-blue-50,
    .privacy-notice,
    .max-w-4xl.mx-auto.px-6.py-4.mt-8,
    .mobile-nav-footer,
    .progress-container,
    .ai-help-link,
    .tool-exit-button {
        display: none !important;
    }

    @page {
        margin: .5in;
        size: letter;
    }

    body {
        font-size: 11pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
        counter-reset: step;
    }

    .toolkit-container {
        max-width: 100%;
        padding: 0;
    }

    /* Completion summary headings */
    .completion-screen h2 {
        font-size: 20pt;
        margin-bottom: 10pt;
        color: #000;
    }

    .completion-screen h3 {
        font-size: 14pt;
        margin-top: 15pt;
        margin-bottom: 10pt;
        color: #000;
        page-break-after: avoid;
    }

    .completion-screen h4 {
        font-size: 12pt;
        margin-top: 10pt;
        margin-bottom: 8pt;
        color: #000;
        page-break-after: avoid;
    }

    .bg-white.rounded-lg {
        page-break-inside: avoid;
        border: 1pt solid #ddd;
        padding: 10pt;
        margin-bottom: 10pt;
    }

    .bg-gray-50,
    .bg-green-50 {
        background: none !important;
        border: 1pt solid #ddd;
        padding: 10pt;
    }

    [data-lucide] {
        display: none !important;
    }

    .text-gray-600,
    .text-gray-700,
    .text-gray-900,
    .font-medium {
        color: #000 !important;
    }

    .completion-screen::before {
        content: "Alp Fitness - Race Prep Tool Summary";
        display: block;
        font-size: 10pt;
        color: #666;
        margin-bottom: 20pt;
        padding-bottom: 5pt;
        border-bottom: 1pt solid #ddd;
    }

    .completion-screen::after {
        content: "Generated on " attr(data-date);
        display: block;
        font-size: 9pt;
        color: #666;
        margin-top: 20pt;
        padding-top: 10pt;
        border-top: 1pt solid #ddd;
        text-align: center;
    }

    /* Show all steps */
    .toolkit-step {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }

    .toolkit-step h2::before {
        content: "Step " counter(step) ": ";
        counter-increment: step;
    }
}

/* ============================================================
   15) PERFORMANCE TOOLKIT (PAGE-SPECIFIC)
   ============================================================ */

/* Modals & Session Cards (Performance Toolkit + Calculators) */
:root {
    /* If any of these already exist in your file, keep your existing values
     and remove the duplicates here. */
    --alp-primary: #003366;
    /* brand navy */
    --alp-maroon: #7a1e1e;
    /* brand maroon (hover accents, optional) */
    --alp-light-blue: #e6f0fa;
    /* brand tint used elsewhere */
    --alp-border: #e5e7eb;
    /* neutral border */
}

/* Cards inside modals (Performance Toolkit & Calculators) */
.session-card {
    border: 1px solid var(--alp-border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .04s;
}

.session-card:hover {
    border-color: var(--alp-primary);
    box-shadow: 0 8px 24px rgba(0, 51, 102, .12);
}

/* Small status dot at the far right of each card */
.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    background: var(--alp-primary);
    /* replaces random green */
    /* optional outline for contrast on white */
    box-shadow: 0 0 0 2px #fff inset;
}

/* “NEW” badge – replace green pill with brand tint */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 11px;
    line-height: 1;
    border: 1px solid transparent;
}

.badge-new {
    background: var(--alp-light-blue);
    color: var(--alp-primary);
    border-color: color-mix(in srgb, var(--alp-primary) 18%, white);
}

/* Optional: “Coming soon” tag if you want a brand version */
.badge-soon {
    background: #fff6ee;
    color: #b45309;
    /* warm amber text */
    border-color: #fde7d6;
}

.toolkit-progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.toolkit-progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--alp-primary), var(--alp-secondary));
    transition: width .3s ease;
}

.toolkit-step {
    display: none;
    animation: fadeIn .3s;
}

.toolkit-step.active {
    display: block;
}

.toolkit-ai-response {
    background: var(--alp-light-blue);
    border-left: 3px solid var(--alp-primary);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 8px 8px 0;
    animation: slideIn .3s;
}

.toolkit-ai-response.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--alp-secondary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity .3s;
    z-index: 1000;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(51, 102, 0, .3);
    pointer-events: none;
}

.save-indicator.show {
    opacity: 1;
}

/* ============================================================
   16) TAILWIND REPLACEMENTS (minimal shims used in HTML)
   ============================================================ */
/* Display/position */
.block {
    display: block
}

.inline {
    display: inline
}

.flex {
    display: flex
}

.hidden {
    display: none
}

.sticky {
    position: sticky
}

.fixed {
    position: fixed
}

.top-0 {
    top: 0
}

.top-4 {
    top: 1rem
}

.right-4 {
    right: 1rem
}

.z-50 {
    z-index: 50
}

/* Containers & sizing */
.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto
}

.max-w-md {
    max-width: 28rem
}

.max-w-sm {
    max-width: 24rem
}

.w-full {
    width: 100%
}

.min-h-screen {
    min-height: 100vh
}

.min-w-\[60px\] {
    min-width: 60px
}

.w-3 {
    width: .75rem
}

.h-3 {
    height: .75rem
}

.w-4 {
    width: 1rem
}

.h-4 {
    height: 1rem
}

.w-5 {
    width: 1.25rem
}

.h-5 {
    height: 1.25rem
}

.w-6 {
    width: 1.5rem
}

.h-6 {
    height: 1.5rem
}

.w-12 {
    width: 3rem
}

.h-12 {
    height: 3rem
}

.w-16 {
    width: 4rem
}

.h-16 {
    height: 4rem
}

/* Spacing */
.m-0 {
    margin: 0
}

.mt-1 {
    margin-top: .25rem
}

.mt-2 {
    margin-top: .5rem
}

.mt-3 {
    margin-top: .75rem
}

.mt-6 {
    margin-top: 1.5rem
}

.mb-2 {
    margin-bottom: .5rem
}

.mb-3 {
    margin-bottom: .75rem
}

.mb-4 {
    margin-bottom: 1rem
}

.mb-6 {
    margin-bottom: 1.5rem
}

.mb-8 {
    margin-bottom: 2rem
}

.p-0 {
    padding: 0
}

.p-4 {
    padding: 1rem
}

.p-6 {
    padding: 1.5rem
}

.p-8 {
    padding: 2rem
}

.px-3 {
    padding-left: .75rem;
    padding-right: .75rem
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem
}

.py-1 {
    padding-top: .25rem;
    padding-bottom: .25rem
}

.py-3 {
    padding-top: .75rem;
    padding-bottom: .75rem
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem
}

.pt-4 {
    padding-top: 1rem
}

.border-t {
    border-top: 1px solid var(--gray-200)
}

.border-b {
    border-bottom: 1px solid var(--gray-200)
}

/* Flex helpers */
.items-center {
    align-items: center
}

.items-start {
    align-items: flex-start
}

.justify-center {
    justify-content: center
}

.justify-between {
    justify-content: space-between
}

.flex-1 {
    flex: 1 1 0%
}

.space-x-1>*+* {
    margin-left: .25rem
}

.space-x-2>*+* {
    margin-left: .5rem
}

.space-x-3>*+* {
    margin-left: .75rem
}

.space-x-4>*+* {
    margin-left: 1rem
}

.space-y-4>*+* {
    margin-top: 1rem
}

.gap-1 {
    gap: .25rem
}

.gap-2 {
    gap: .5rem
}

.gap-3 {
    gap: .75rem
}

.gap-4 {
    gap: 1rem
}

/* Typography */
.text-xs {
    font-size: .75rem;
    line-height: 1rem
}

.text-sm {
    font-size: .875rem;
    line-height: 1.25rem
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem
}

.font-medium {
    font-weight: 500
}

.font-semibold {
    font-weight: 600
}

.text-center {
    text-align: center
}

.leading-relaxed {
    line-height: 1.625
}

.whitespace-pre-wrap {
    white-space: pre-wrap
}

/* Colors mapped to variables */
.text-white {
    color: #fff
}

.text-blue-600 {
    color: var(--alp-primary)
}

.text-blue-200 {
    color: #bfdbfe
}

.text-blue-100 {
    color: #dbeafe
}

.text-green-600 {
    color: var(--alp-secondary)
}

.text-green-800 {
    color: #14532d
}

.text-orange-600 {
    color: #ea580c
}

.text-gray-400 {
    color: var(--gray-400)
}

.text-gray-500 {
    color: var(--gray-500)
}

.text-gray-600 {
    color: var(--gray-600)
}

.text-gray-700 {
    color: var(--gray-700)
}

.bg-white {
    background: #fff
}

.bg-blue-600 {
    background: var(--alp-primary)
}

.bg-blue-700 {
    background: #0a3672
}

.bg-green-100 {
    background: #dcfce7
}

.bg-green-500 {
    background: #22c55e
}

/* Borders & radii */
.border {
    border: 1px solid var(--gray-300)
}

.border-0 {
    border: 0
}

.border-2 {
    border-width: 2px
}

.border-gray-200 {
    border-color: var(--gray-200)
}

.border-gray-300 {
    border-color: var(--gray-300)
}

.rounded {
    border-radius: .25rem
}

.rounded-lg {
    border-radius: .5rem
}

.rounded-full {
    border-radius: 9999px
}

/* Effects & transitions */
.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)
}

.hover\:opacity-90:hover {
    opacity: .9
}

.hover\:bg-gray-100:hover {
    background: var(--gray-100)
}

.hover\:bg-blue-800:hover {
    background: #0b2d5e
}

.hover\:text-gray-600:hover {
    color: var(--gray-600)
}

.hover\:text-gray-700:hover {
    color: var(--gray-700)
}

.transition-opacity {
    transition: opacity .2s ease
}

.transition-all {
    transition: all .2s ease
}

/* States */
.disabled\:opacity-50:disabled {
    opacity: .5
}

.disabled\:cursor-not-allowed:disabled {
    cursor: not-allowed
}

/* Inputs & focus */
.resize-none {
    resize: none
}

.select-none {
    user-select: none
}

.focus\:outline-none:focus {
    outline: 0
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px var(--alp-primary)
}

.focus\:border-transparent:focus {
    border-color: transparent
}

/* Responsive shims (only what’s used) */
@media (min-width:1024px) {
    .lg\:block {
        display: block
    }

    .lg\:hidden {
        display: none
    }
}

@media (min-width:640px) {
    .sm\:flex-row {
        flex-direction: row
    }
}

/* Inline-style extractions / semantic helpers */
.bg-gradient-auth {
    background: linear-gradient(135deg, var(--alp-light-blue) 0%, var(--alp-primary) 100%);
}

.text-brand-primary {
    color: var(--alp-primary);
}

.text-brand-secondary {
    color: var(--alp-secondary);
}

.text-brand-accent {
    color: var(--alp-accent) !important;
}

.border-brand {
    border-color: var(--alp-primary);
}

.update-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    background: var(--alp-primary);
    color: #fff;
    padding: .75rem 1rem;
    border-radius: .5rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, .1);
    max-width: 24rem;
}

.update-notification .btn-primary-ghost {
    font-weight: 600;
    font-size: .75rem;
    padding: .25rem .75rem;
    border-radius: .25rem;
    background: #fff;
    color: var(--alp-primary);
}

.update-notification .btn-secondary {
    font-weight: 600;
    font-size: .75rem;
    padding: .25rem .75rem;
    border-radius: .25rem;
    background: #0a3672;
    color: #fff;
}

/* Normalize border thickness to Tailwind's default */
.border,
.border-gray-200,
.border-gray-300 {
    border-width: 1px;
}