/*
===============================================================================
PRO COACH STUDIO - STYLES - Typography & Color System v9 - Aug 8, 2026
===============================================================================
*/

/* --- 1. Imports and Global Settings --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap');

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

/* --- Brand Colors and Theme Variables --- */
:root {
    /* Brand blue - single source of truth used across the whole app */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-active: #1d4ed8;
    --primary-tint: rgba(59, 130, 246, 0.16);
    --primary-ring: rgba(59, 130, 246, 0.35);

    /* Surfaces - one cohesive dark-slate scale (was 3 competing scales) */
    --bg-color: #10141c;          /* Page canvas */
    --bg-color-light: #1a2233;    /* Cards / sidebar / nav */
    --bg-color-lighter: #232c40;  /* Inputs and interactive elements */
    --bg-color-form: #1e2738;     /* Grouped form containers */
    --text-color: #cbd5e1;
    --heading-color: #f1f5f9;     /* Softer than pure white */
    --border-color: #2c3648;

    /* Additional variables for profile page */
    --card-bg: #1a2233;           /* Same as bg-color-light for consistency */
    --text-muted: #8b96ac;
    --input-bg: #232c40;          /* Same as bg-color-lighter */
    --hover-bg: #2b3552;          /* Slightly lighter than input-bg */
    --accent-color: #f59e0b;
    --accent-hover: #d97706;
    --cta-color: #fbbf24;
    --cta-hover: #f59e0b;

    --danger-color: #ef4444;
    --danger-tint: rgba(239, 68, 68, 0.12);
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --success-tint: rgba(16, 185, 129, 0.12);

    --gray-200: #e2e8f0;
    --gray-400: #8b96ac;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #232c40;

    /* Elevation + radius scale, reused instead of one-off values */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
    --transition-base: 160ms ease;

    --font-size-base: 0.875rem;
    --font-size-md: 1rem;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Select-arrow chevron - dark-theme (light chevron) by default */
    --select-arrow: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23cbd5e1' d='M8 11.5l-4-4h8l-4 4z'/></svg>");
}

/* --- Light theme --- */
:root[data-theme="light"] {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-active: #1e40af;
    --primary-tint: rgba(37, 99, 235, 0.10);
    --primary-ring: rgba(37, 99, 235, 0.30);

    /* Surfaces - light scale, each step a visible step apart */
    --bg-color: #f1f5f9;          /* Page canvas */
    --bg-color-light: #ffffff;    /* Cards / sidebar / nav */
    --bg-color-lighter: #f8fafc;  /* Inputs and interactive elements */
    --bg-color-form: #f8fafc;     /* Grouped form containers */
    --text-color: #475569;
    --heading-color: #0f172a;
    --border-color: #dbe1ea;

    --card-bg: #ffffff;
    --text-muted: #64748b;
    --input-bg: #f8fafc;
    --hover-bg: #eef2f8;
    --accent-color: #b45309;
    --accent-hover: #92400e;
    --cta-color: #fbbf24;
    --cta-hover: #d97706;

    --danger-color: #dc2626;
    --danger-tint: rgba(220, 38, 38, 0.08);
    --warning-color: #b45309;
    --success-color: #059669;
    --success-tint: rgba(5, 150, 105, 0.08);

    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #f8fafc;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

    --select-arrow: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23475569' d='M8 11.5l-4-4h8l-4 4z'/></svg>");
}

/* --- Utility Classes --- */
.hidden {
    display: none !important;
}

.mobile-hidden {
    display: inline;
}

/* --- Base Styles --- */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    color-scheme: dark;
    transition: background-color var(--transition-base), color var(--transition-base);
}

:root[data-theme="light"] body {
    color-scheme: light;
}

body, h1, h2, h3, h4, h5, h6, p, a, button, input, textarea, select, label, span, div {
    font-family: 'Roboto', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-weight: var(--font-weight-semibold);
}

/* Base link style - fills the gap for any <a> not covered by a more
   specific component class (navbar, footer, etc. already override this). */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

hr {
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* --- Button System --- */
.btn {
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;

    background-color: var(--primary-color);
    color: white;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    min-height: 48px;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-link,
.btn-danger-text {
    min-height: 48px;
    padding: 0.7rem 0;
    border: none;
    display: inline-flex;
    align-items: center;
    background: none;
    font: inherit;
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
}

.btn-link {
    color: var(--primary-color);
}

.btn-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.btn-danger-text {
    color: var(--danger-color);
}

.btn-danger-text:hover {
    color: var(--danger-color);
    text-decoration: underline;
}

.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-link:disabled,
.btn-danger-text:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

/* Prevent hover effects during loading */
.btn.loading-glow:hover {
    transform: none !important;
    box-shadow: none !important;
    background-color: var(--primary-color) !important;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    min-height: 48px;
}

.btn-secondary:hover {
    background-color: var(--bg-color-lighter);
    border-color: var(--primary-color);
    color: var(--heading-color);
    transform: none;
    box-shadow: none;
}

.btn[type="submit"],
.btn[hx-post] {
    padding: 0.7rem 1.4rem;
    font-weight: 600;
    margin: 0;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- Navbar --- */
.navbar {
    background-color: var(--bg-color-light);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 60px;
}

.navbar-brand-group {
    display: flex;
    align-items: center;
    height: 100%;
}

.navbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
}

.navbar-logo-desktop {
    height: 40px;
    width: auto;
}

.navbar-logo-mobile {
    height: 35px;
    width: auto;
    display: none;
}

.navbar-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-left: 2.5rem;
    height: 100%;
}

.navbar-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    font-size: 1rem;
    display: flex;
    align-items: center;
    transition: color var(--transition-base);
}

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

.navbar-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-color-light);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    z-index: 999;
}

.navbar-mobile-menu.open {
    display: block;
}

.navbar-mobile-link {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: color var(--transition-base);
}

.navbar-mobile-link:last-child {
    border-bottom: none;
}

.navbar-mobile-link:hover {
    color: var(--accent-color);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* --- Theme toggle --- */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background-color: var(--primary-tint);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Used on simpler pages that have no navbar to anchor the toggle in */
.theme-toggle-fixed {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.theme-toggle-fixed .theme-toggle-btn {
    background-color: var(--bg-color-light);
    box-shadow: var(--shadow-sm);
}

/* Sun shows while dark (click to go light); moon shows while light (click to go dark) */
.theme-toggle-btn .icon-moon {
    display: none;
}

:root[data-theme="light"] .theme-toggle-btn .icon-sun {
    display: none;
}

:root[data-theme="light"] .theme-toggle-btn .icon-moon {
    display: inline;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-base);
}

.navbar-toggle:hover {
    background-color: var(--primary-tint);
}

.navbar-cta {
    background-color: var(--cta-color);
    color: #1a1206;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-xl);
    border: 2px solid transparent;
    transition: background-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.navbar-cta:hover {
    background-color: var(--cta-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

/* Compact utility header for standalone admin and workspace views. */
.workspace-header {
    background-color: var(--bg-color-light);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.workspace-header-brand,
.workspace-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.workspace-header-brand img {
    width: 32px;
    height: 32px;
}

.workspace-header-title {
    color: var(--accent-color);
    margin: 0;
    font-size: 1.25rem;
}

.workspace-header-link,
.workspace-header-action {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
    transition: background-color var(--transition-base), color var(--transition-base);
}

.workspace-header-link:hover,
.workspace-header-action:hover {
    background-color: var(--primary-tint);
    color: var(--heading-color);
    text-decoration: none;
}

.workspace-header-action-danger {
    background-color: var(--danger-color);
    color: white;
}

.workspace-header-action-danger:hover {
    background-color: var(--danger-color);
    color: white;
}

@media (max-width: 700px) {
    .workspace-header {
        padding: 0.75rem 1rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* User account menu */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-trigger {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-base);
}

.user-menu-trigger:hover {
    background-color: var(--primary-tint);
}

.user-menu-arrow {
    font-size: 0.7rem;
    transition: transform var(--transition-base);
}

.user-menu.open .user-menu-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--bg-color-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 190px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
    margin-top: 0.5rem;
    overflow: hidden;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: background-color var(--transition-base);
}

.user-dropdown-link:last-child {
    border-bottom: none;
}

.user-dropdown-link:hover {
    background-color: var(--primary-tint);
}

.user-dropdown-link.admin {
    color: var(--accent-color);
    font-weight: 500;
}

.user-dropdown-link.admin:hover {
    background-color: rgba(245, 158, 11, 0.1);
}

.user-dropdown-link.danger {
    color: var(--danger-color);
}

.user-dropdown-link.danger:hover {
    background-color: var(--danger-tint);
}

/* Coach Kit navbar dropdown - reuses .user-menu/.user-dropdown open-state
   behavior but is wider to fit the download-item rows (icon + text + button)
   moved here from the sidebar. */
.coach-kit-dropdown {
    width: 320px;
    padding: 1rem;
    box-sizing: border-box;
}

.coach-kit-dropdown-description {
    color: var(--text-color);
    font-size: 13px;
    margin: 0 0 0.9rem;
}

.mobile-nav-section-label {
    padding: 0.75rem 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}

/* Mobile-first responsive navbar */
@media (max-width: 768px) {
    #desktop-nav-links {
        display: none !important;
    }

    .navbar-toggle {
        display: block;
    }

    .navbar-logo-desktop {
        display: none;
    }

    .navbar-logo-mobile {
        display: block;
    }
}

@media (min-width: 769px) {
    .navbar {
        margin: 0.75rem 1.5rem 0;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        top: 0.75rem;
    }

    .navbar-toggle {
        display: none !important;
    }

    .navbar-mobile-menu {
        display: none !important;
    }
}

/* --- Main Layout --- */
.main-container {
    max-width: 100vw;
    margin: 0;
    padding: 1rem 1.5rem 1.5rem;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    min-height: 100vh;
    overflow-x: hidden;
    justify-items: center;
}

@media (min-width: 768px) {
    .main-container:not(:has(.chat-active)) {
        padding-top: 0.5rem;
    }

    .main-content:not(.chat-active) {
        padding-top: 1.25rem;
    }

    .main-content:not(.chat-active) h1 {
        margin-top: 0;
    }

    .main-container:has(.chat-active) {
        align-items: start;
        justify-items: stretch;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .main-content.chat-active {
        justify-self: center;
        max-width: 920px;
        width: 100%;
    }
}

.sidebar, .downloads {
    background-color: var(--bg-color-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    /* No explicit height: the grid's default align-items:stretch keeps this
       matched to .main-content's height so the two cards' bottom edges line
       up, instead of the sidebar stopping short at its own content height. */
    justify-self: start;
    min-width: 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.main-content {
    position: relative;
    background-color: var(--bg-color-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 1200px;
    min-width: 0;
    box-shadow: var(--shadow-sm);
}

.main-content h1 {
    text-align: center;
    margin-bottom: 1.25rem;
    color: var(--primary-color);
}

.main-content > p {
    text-align: center;
    margin-bottom: 1.5rem;
}

.team-context {
    align-items: center;
    background-color: var(--bg-color-form);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
}

.team-context:not(.team-context-setup) {
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0;
    background-color: transparent;
    border: 0;
    border-radius: 0;
}

.team-context-setup {
    background-color: var(--success-tint);
    border-color: var(--success-color);
}

.team-context-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.team-context-eyebrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
}

.team-context-copy strong {
    color: var(--heading-color);
    font-size: var(--font-size-md);
}

.team-context-copy > span:last-child {
    color: var(--text-color);
    font-size: var(--font-size-base);
}

.team-context-actions {
    align-items: flex-end;
    display: flex;
    flex-shrink: 0;
    gap: 0.75rem;
}

.team-context-field {
    display: grid;
}

.team-context-field label {
    color: var(--heading-color);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    margin-bottom: 0.25rem;
}

.team-context-select {
    background-color: var(--bg-color-lighter);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    font: inherit;
    max-width: 16rem;
    padding: 0.55rem 2rem 0.55rem 0.75rem;
}

.team-context-level-select {
    min-width: 9rem;
}

.team-context-fundraising .team-context-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
}

.team-context-fundraising .team-context-select {
    width: 100%;
    max-width: none;
    min-height: 3.25rem;
    padding: 0.875rem 3.5rem 0.875rem 1rem;
}

.team-context-fundraising .team-context-level-select {
    min-width: 0;
}

.team-context-fundraising .team-context-manage-link {
    align-self: end;
    min-height: 3.25rem;
}

.team-context-active-label {
    display: none;
}

.team-context-link {
    align-items: center;
    color: var(--primary-color);
    display: inline-flex;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    gap: 0.4rem;
    white-space: nowrap;
}

.team-context-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.team-context-manage-link {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.team-context-manage-link:hover {
    color: var(--text-color);
}

.team-context-setup-link {
    background-color: var(--success-color);
    border-radius: var(--radius-sm);
    color: var(--heading-color);
    padding: 0.55rem 0.75rem;
    text-decoration: none;
}

.team-context-setup-link:hover {
    color: var(--heading-color);
    text-decoration: none;
}

/* The chat welcome message already introduces the tool, so the page header
   above it only needs to be a slim label, not a second full-size heading. */
.main-content.chat-active h1 {
    display: none;
}

.main-content.chat-active > p {
    display: none;
}

.main-content.chat-active .team-context {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin: 0;
}

/* The mode toggle makes the tool's purpose clear on its own, so Communication
   Scribe skips the usual subtitle under the title. */
.main-content.scribe-active > p {
    display: none;
}

.main-content.chat-active {
    padding: 0;
    overflow: hidden;
}

/* --- Sidebar Components --- */
.sidebar-title {
    color: var(--heading-color);
    margin-bottom: 1rem;
    text-align: center;
}

.sidebar-description {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 14px;
    text-align: center;
}

/* Override mobile-tools-grid for sidebar to be single column */
.sidebar .mobile-tools-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tool-button {
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    margin-bottom: 0;
    background-color: var(--bg-color-lighter);  /* Using harmonized color */
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.tool-button .badge-new {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
}

.tool-button-locked {
    padding-right: 3rem;
}

.tool-button .tool-button-lock {
    position: absolute;
    top: 50%;
    right: 1rem;
    width: auto;
    margin: 0;
    color: var(--text-muted);
    transform: translateY(-50%);
}

.tool-button-locked:hover .tool-button-lock,
.tool-button-locked.active .tool-button-lock {
    color: currentColor;
}

.tool-button {
    box-shadow: var(--shadow-sm);
}

.tool-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.tool-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tool-button i {
    color: var(--primary-color);
    width: 1.35rem;
    margin-right: 0.5rem;
    text-align: center;
    transition: color var(--transition-base);
}

/* Small pill badge to call out a flagship/new feature without adding new chrome */
.badge-new {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-color) 0%, #ffb300 100%);
    color: #1a1206;
    vertical-align: middle;
}

.tool-button.active i {
    color: white;
}

.tool-history {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.tool-history-title {
    color: var(--heading-color);
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.75rem;
}

.tool-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tool-history-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-color);
    transition: background-color var(--transition-base);
}

.tool-history-item:hover {
    background-color: var(--bg-color-lighter);
}

.tool-history-item i {
    color: var(--primary-color);
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.tool-history-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tool-history-item-title {
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-history-item-time {
    font-size: 11px;
    color: var(--text-muted);
}

.tool-history-empty {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
}

.main-container:has(.chat-active) .tool-history {
    display: none;
}

.chat-sidebar-account {
    display: none;
}

.chat-sidebar-home {
    display: none;
}

.chat-sidebar-header {
    display: contents;
}

.sidebar-mission-link {
    display: block;
    margin-top: 1rem;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-base);
}

.sidebar-mission-link:hover {
    color: var(--primary-color);
}

.downloads-list {
    display: grid;
    gap: 0.5rem;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color-lighter);
    transition: all 0.2s ease;
}

.download-item:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-tint);
}

.download-icon {
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background-color: var(--primary-tint);
    color: var(--primary-color);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.download-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.download-title {
    color: var(--heading-color);
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-description {
    color: var(--text-color);
    font-size: 11px;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-btn {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 6px;
    background-color: var(--gray-600);
    color: var(--gray-200);
    border: 1px solid var(--gray-500);
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.8rem;
}

.download-btn:hover {
    background-color: var(--gray-500);
    color: white;
    border-color: var(--gray-400);
}

.download-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.download-btn.locked {
    background-color: var(--gray-700);
    color: var(--gray-400);
    border-color: var(--gray-600);
    cursor: not-allowed;
    opacity: 0.8;
    position: relative;
}

.download-btn.locked:hover {
    background-color: var(--gray-700);
    color: var(--gray-400);
    border-color: var(--gray-600);
    cursor: not-allowed;
    transform: none;
}

.download-btn.locked::before {
    content: "🔒 ";
    margin-right: 0.25rem;
}

/* --- Mobile Tools Navigation --- */
.mobile-tools-nav {
    display: none;
    background-color: var(--bg-color-light);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
}

.mobile-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-tool-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.5rem;
    background-color: var(--bg-color-lighter);  /* Using harmonized color */
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    min-height: 55px;
}

.mobile-tool-button:hover,
.mobile-tool-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tool-icon {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
    line-height: 1;
}

.tool-name {
    font-size: 13px;
    line-height: 1.1;
    font-weight: 600;
}

/* --- Form Styling --- */
.form-group {
    margin: 0 0 1rem 0;
    position: relative;
    z-index: 1;
}

/* Form container for better visual grouping */
.form-container {
    background-color: var(--bg-color-form);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.form-group:last-of-type {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--heading-color);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
}

/* Marks a required form field's label. Applied via <span class="required-mark">*</span>
   right after the label text - see the form-field-consistency skill for the convention. */
.required-mark {
    color: var(--error-color, #ef4444);
    margin-left: 0.15rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--bg-color-lighter);  /* Using the new lighter tone */
    color: var(--heading-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: var(--font-size-md);
    min-height: 3.25rem;
    line-height: 1.5;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-group:focus-within {
    z-index: 20;
}

.form-group select {
    padding: 0.875rem 3.5rem 0.875rem 1rem !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    position: relative;
    z-index: 10;
}

/* Ensure select dropdown appears above other elements */
.form-group select:focus {
    z-index: 1000;
    position: relative;
}

/* Form rows with better responsive behavior */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    margin-bottom: 0;
    position: relative;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-tint);
}

.form-group textarea {
    min-height: 6rem;
    resize: vertical;
    line-height: 1.6;
}

.form-row.two-col {
    grid-template-columns: 1fr 1fr;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group small {
    color: var(--text-color);
    font-size: 12px;
    opacity: 0.8;
    margin-top: 0.5rem;
    display: block;
    line-height: 1.4;
}

.button-container {
    margin-top: 1.5rem;
    text-align: left;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    min-height: 48px;
}

.button-container .btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-container .loading-indicator {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.button-container .loading-indicator .spinner {
    flex: 0 0 auto;
}

.response-area {
    min-height: 12.5rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-color-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.response-area:empty {
    display: none;
}

/* Communication Scribe: Start New / Refine Email Draft segmented toggle */
.scribe-mode-toggle {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 480px;
    margin: 0 auto 1.75rem;
    background-color: var(--bg-color, #10141c);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.3rem;
    gap: 0.3rem;
}

/* Positioned out of the flex flow so it slides behind the tabs instead of
   claiming its own flex slot (which squeezed the two tabs to fit a third). */
.scribe-mode-thumb {
    position: absolute;
    top: 0.3rem;
    bottom: 0.3rem;
    left: 0.3rem;
    background-color: var(--primary-color);
    border-radius: 999px;
    transition: transform 0.2s ease, width 0.2s ease;
    pointer-events: none;
    z-index: 0;
}

.scribe-mode-tab {
    position: relative;
    z-index: 1;
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.scribe-mode-tab:hover:not(.active) {
    background-color: var(--bg-color-lighter);
}

.scribe-mode-tab.active {
    background-color: var(--primary-color);
    color: white;
}

.chat-interface {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: none;
    margin: 0;
    width: 100%;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 1.5rem 2rem;
    min-height: 0;
    max-width: 100%;
}

/* #chat-response is a child of .chat-messages, not a following sibling, so
   these rely on :has() rather than the (impossible here) ~ combinator. */
.chat-messages:has(.chat-response:not(:empty)) {
    justify-content: flex-start;
    align-items: center;
}

.chat-messages:has(.chat-response:not(:empty)) .welcome-message {
    display: none;
}

.chat-message {
    margin-bottom: 1.5rem;
    max-width: 100%;
    width: 100%;
}

.chat-response {
    max-width: 720px;
    width: 100%;
}

.chat-message-user {
    display: flex;
    justify-content: flex-end;
}

.chat-message-assistant {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.assistant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    margin-top: 2px;
    object-fit: cover;
}

@media (max-width: 600px) {
    .assistant-avatar {
        width: 28px;
        height: 28px;
    }
}

.user-message {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 18px 18px 4px 18px;
    max-width: 80%;
}

.assistant-message {
    background-color: var(--bg-color-lighter);  /* Using harmonized color */
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 4px 18px 18px 18px;
    flex: 1;
    min-width: 0;
    max-width: 95%;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}

.assistant-loading {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    min-height: 58px;
}

.response-loader {
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    height: 20px;
    width: 20px;
    animation: responseSpin 0.85s linear infinite;
    flex: 0 0 auto;
}

.loading-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.loading-label {
    color: var(--heading-color);
    font-size: 14px;
    font-weight: 600;
}

.loading-detail {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

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

@media (min-width: 1024px) {
    .assistant-message {
        max-width: 100%;
    }
    .user-message {
        max-width: 85%;
    }
}

.assistant-message h1,
.assistant-message h2,
.assistant-message h3,
.assistant-message h4 {
    color: var(--heading-color);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.assistant-message h3 {
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3rem;
}

.assistant-message ul,
.assistant-message ol {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
}

.assistant-message li {
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

.assistant-message p {
    margin: 0.8rem 0;
    line-height: 1.6;
}

.assistant-message p:first-child {
    margin-top: 0;
}

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

.assistant-message p + ul,
.assistant-message p + ol {
    margin-top: 0.4rem;
}

.assistant-message ul + p,
.assistant-message ol + p {
    margin-top: 1rem;
}

.assistant-message br {
    line-height: 1.8;
}

.assistant-message strong {
    color: var(--heading-color);
    font-weight: 600;
}

.assistant-message em {
    color: var(--text-color);
    font-style: italic;
}

/* Keep links blue */
.assistant-message a {
    color: var(--primary-color);
    text-decoration: underline;
}

.assistant-message a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.assistant-message hr {
    border: none;
    border-top: 2px solid var(--primary-color);
    margin: 1.5rem 0;
    opacity: 0.6;
}

.assistant-message code {
    background-color: var(--bg-color-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.sources-section {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--primary-tint);
    border-radius: 8px;
}

.sources-title {
    font-weight: 600;
    color: var(--heading-color);
    margin-bottom: 0.6rem;
    font-size: 13px;
}

.sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.source-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.source-icon {
    color: var(--primary-color);
    font-size: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

.source-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
}

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

.source-description {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
    line-height: 1.3;
}

.message-actions {
    margin-top: 1rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.chat-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-copy-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: var(--primary-tint);
}

.chat-message-assistant .error-message {
    flex: 1;
    background: var(--danger-tint);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 1rem;
    border-radius: 4px 18px 18px 18px;
}

.welcome-message {
    text-align: center;
    max-width: 680px;
    padding: 0;
}

.welcome-brand-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 0.9rem;
    object-fit: contain;
}

.welcome-message h3 {
    margin: 0.5rem 0;
    font-size: 1.8rem;
    color: var(--heading-color);
    font-weight: 600;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .welcome-message {
        padding: 0.5rem 0;
    }
    .welcome-brand-icon {
        width: 38px;
        height: 38px;
    }
    .welcome-message h3 {
        font-size: 1.35rem;
    }
}

.chat-suggestions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1.1rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
}

.suggestion-btn {
    background-color: var(--bg-color-lighter);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.7rem 0.9rem;
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 56px;
    line-height: 1.4;
}

.suggestion-btn:hover {
    background-color: var(--primary-tint);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.suggestion-btn:focus-visible {
    outline: 3px solid var(--primary-tint);
    outline-offset: 2px;
}

.suggestion-title {
    color: var(--heading-color);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

@media (max-width: 600px) {
    .chat-suggestions {
        gap: 0.5rem;
        margin-top: 1rem;
    }
    .suggestion-btn {
        min-height: 48px;
        padding: 0.55rem 0.7rem;
        border-radius: 14px;
    }
}

@media (min-width: 768px) {
    .chat-suggestions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
    .suggestion-btn {
        min-width: 0;
    }
    .welcome-message h2 {
        font-size: 1.75rem;
    }
}

@media (min-width: 768px) and (max-height: 700px) {
    .main-container:has(.chat-active) {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .chat-messages {
        padding: 0.75rem 1.25rem;
    }

    .welcome-brand-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 0.5rem;
    }

    .welcome-message h3 {
        font-size: 1.25rem;
    }

    .welcome-subtitle {
        display: none;
    }

    .chat-suggestions {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    .suggestion-btn {
        min-height: 40px;
        padding: 0.45rem 0.7rem;
    }
}

.chat-input-container {
    padding: 1rem 1.5rem 0.875rem;
    background-color: var(--bg-color-light);
    border-top: 1px solid var(--border-color);
}

.chat-disclaimer {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0.6rem auto 0;
    max-width: 600px;
}

.chat-context-bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.chat-context-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.chat-context-select {
    background-color: transparent;
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.35rem;
    font-size: 13px;
    cursor: pointer;
    min-width: 0;
}

.chat-context-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-tint);
}

@media (max-width: 600px) {
    .chat-input-container {
        padding: 0.75rem 1rem;
    }
}

.chat-form {
    max-width: none;
    margin: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .chat-form {
        max-width: 720px;
        margin: 0 auto;
    }
    .chat-input-container {
        position: sticky;
        bottom: 0;
    }
    .main-content.chat-active .chat-form {
        max-width: 720px;
    }
    .main-content.chat-active .chat-input-container {
        padding: 0.75rem 1.5rem 0.625rem;
        position: sticky;
        bottom: 0;
    }
}

.chat-input-wrapper {
    position: relative;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.1rem 0;
    box-shadow: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    min-height: 104px;
}

@media (max-width: 600px) {
    .chat-input-wrapper {
        min-height: 104px;
        border-radius: 8px;
    }
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-tint);
}

.chat-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 16px;
    font-family: inherit;
    resize: none;
    min-height: 24px;
    max-height: 132px;
    line-height: 1.5;
    overflow-y: hidden;
    padding: 0;
    margin: 0;
}

.chat-input::placeholder {
    color: var(--text-color);
    opacity: 0.6;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 15px;
    font-style: normal;
    letter-spacing: 0.01em;
}

.chat-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    margin-top: 0.75rem;
    min-height: 42px;
}

.chat-submit-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

@media (max-width: 600px) {
    .chat-submit-btn {
        width: 32px;
        height: 32px;
    }
}

.chat-submit-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.chat-submit-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

/* Ask ProCoach is a working surface, not another dashboard card. Keep the
   existing dashboard layout for the form tools; this scoped layout provides a
   dedicated conversation workspace on larger screens. */
@media (min-width: 768px) {
    body.chat-workspace {
        --chat-sidebar-width: 264px;
        height: 100dvh;
        overflow: hidden;
    }

    .main-container:has(.chat-active) {
        align-items: stretch;
        background: var(--bg-color);
        gap: 0;
        grid-template-columns: var(--chat-sidebar-width) minmax(0, 1fr);
        height: 100dvh;
        min-height: 0;
        padding: 0;
    }

    .main-container:has(.chat-active) .sidebar {
        align-self: stretch;
        background: var(--bg-color-light);
        border: 0;
        border-radius: 0;
        border-right: 1px solid var(--border-color);
        box-shadow: none;
        display: flex;
        flex-direction: column;
        height: 100dvh;
        min-width: 0;
        overflow-y: auto;
        padding: 0.5rem 0.9rem 1.25rem;
        width: auto;
    }

    .main-container:has(.chat-active) .chat-sidebar-home {
        align-items: center;
        border: 1px solid transparent;
        border-radius: var(--radius-sm);
        color: var(--text-muted);
        display: inline-flex;
        height: 32px;
        justify-content: center;
        margin: 0;
        text-decoration: none;
        width: 32px;
    }

    .main-container:has(.chat-active) .chat-sidebar-home:hover {
        background: var(--bg-color-lighter);
        border-color: var(--border-color);
        color: var(--heading-color);
        text-decoration: none;
    }

    .main-container:has(.chat-active) .sidebar-title {
        color: var(--text-muted);
        font-size: 0.7rem;
        letter-spacing: 0.08em;
        margin: 0;
        text-align: left;
        text-transform: uppercase;
    }

    .main-container:has(.chat-active) .chat-sidebar-header {
        align-items: center;
        display: flex;
        gap: 0.55rem;
        margin-bottom: 0.75rem;
    }

    .main-container:has(.chat-active) .sidebar-description,
    .main-container:has(.chat-active) .sidebar-mission-link {
        display: none;
    }

    .main-container:has(.chat-active) .chat-sidebar-account {
        border-top: 1px solid var(--border-color);
        display: grid;
        gap: 0.25rem;
        margin-top: auto;
        padding-top: 1rem;
    }

    .main-container:has(.chat-active) .chat-sidebar-account-link {
        align-items: center;
        background: transparent;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        color: var(--text-color);
        cursor: pointer;
        display: flex;
        font: inherit;
        font-size: var(--font-size-base);
        gap: 0.55rem;
        min-height: 40px;
        padding: 0.6rem 0.65rem;
        text-align: left;
        text-decoration: none;
        width: 100%;
    }

    .main-container:has(.chat-active) .chat-sidebar-account-link:hover {
        background: var(--bg-color-lighter);
        border-color: var(--border-color);
        color: var(--heading-color);
        text-decoration: none;
    }

    .main-container:has(.chat-active) .chat-sidebar-account-link i {
        color: var(--text-muted);
        text-align: center;
        width: 1.35rem;
    }

    .main-container:has(.chat-active) .chat-sidebar-create-account {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
    }

    .main-container:has(.chat-active) .chat-sidebar-create-account:hover {
        background: var(--primary-hover);
        border-color: var(--primary-hover);
        color: white;
    }

    .main-container:has(.chat-active) .chat-sidebar-create-account i,
    .main-container:has(.chat-active) .chat-sidebar-sign-out i {
        color: currentColor;
    }

    .main-container:has(.chat-active) .chat-sidebar-sign-out {
        color: var(--text-muted);
    }

    .main-container:has(.chat-active) .main-content.chat-active {
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        height: 100dvh;
        justify-self: stretch;
        max-width: none;
        min-height: 0;
        overflow: hidden;
        width: auto;
    }

    .chat-interface {
        flex: 1;
        min-height: 0;
    }

    body.chat-workspace .navbar {
        display: none !important;
    }

    body.chat-workspace .main-content.chat-active {
        padding-top: 0;
    }

    body.chat-workspace .chat-interface {
        min-height: 0;
    }

    body.chat-workspace .team-context {
        flex: 0 0 auto;
    }

    body.chat-workspace .footer,
    body.chat-workspace .back-to-top {
        display: none;
    }

    body.chat-workspace .welcome-brand-icon {
        display: none;
    }

    /* Empty state: keep the welcome block and the input glued together as one
       centered unit. Without this, .chat-messages's flex growth below fills
       the whole viewport-height column by itself and centers the welcome
       text within that huge box, stranding the input far beneath it. */
    .chat-interface:not(:has(.chat-response:not(:empty))) {
        justify-content: flex-start;
    }

    .chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 2rem 2rem 1.5rem;
    }

    /* Once a conversation exists, let the message list grow to fill the
       available height so the input bar stays pinned to the bottom. */
    .chat-interface:has(.chat-response:not(:empty)) .chat-messages {
        flex: 1;
    }

    .welcome-message {
        max-width: 760px;
        transform: translateY(-5%);
    }

    .welcome-brand-icon {
        height: 56px;
        margin-bottom: 1.25rem;
        width: 56px;
        object-fit: contain;
    }

    .chat-suggestions {
        gap: 0.75rem;
        margin-top: 2rem;
        max-width: 720px;
    }

    .suggestion-btn {
        min-height: 60px;
        padding: 0.8rem 1rem;
        border-radius: 18px;
    }

    .suggestion-title {
        font-size: 15px;
    }

    .chat-input-container {
        background: transparent;
        border: 0;
        flex: 0 0 auto;
        padding: 0 2rem 1.75rem;
    }

    .chat-form,
    .main-content.chat-active .chat-form {
        max-width: 780px;
    }

    .chat-input-wrapper {
        background: var(--bg-color-light);
        border-radius: 18px;
        box-shadow: var(--shadow-sm);
        min-height: 118px;
        padding: 1.1rem 1.25rem 0;
    }

    .chat-input-wrapper:focus-within {
        box-shadow: 0 0 0 3px var(--primary-tint), var(--shadow-sm);
    }

    .chat-input-footer {
        min-height: 46px;
    }

    .chat-disclaimer {
        margin-top: 0.7rem;
    }
}

@media (min-width: 768px) and (max-height: 700px) {
    body.chat-workspace .navbar {
        min-height: 44px;
        padding: 0.25rem 0.6rem;
        top: 0.4rem;
    }

    body.chat-workspace .main-content.chat-active {
        padding-top: 3.5rem;
    }

    body.chat-workspace .team-context {
        gap: 0.5rem;
        padding: 0.35rem 0.75rem;
    }

    body.chat-workspace .team-context-select {
        padding: 0.3rem 1.75rem 0.3rem 0.6rem;
    }

    body.chat-workspace .chat-messages {
        padding: 0.5rem 1.25rem 0.25rem;
    }

    body.chat-workspace .welcome-message {
        transform: none;
    }

    body.chat-workspace .welcome-message h3 {
        font-size: 1.1rem;
        margin: 0;
    }

    body.chat-workspace .welcome-subtitle,
    body.chat-workspace .chat-disclaimer {
        display: none;
    }

    body.chat-workspace .chat-suggestions {
        gap: 0.4rem;
        margin-top: 0.5rem;
    }

    body.chat-workspace .suggestion-btn {
        min-height: 34px;
        padding: 0.3rem 0.55rem;
    }

    body.chat-workspace .chat-input-container {
        padding: 0 1.25rem 0.4rem;
    }

    body.chat-workspace .chat-input-wrapper {
        border-radius: var(--radius-lg);
        min-height: 76px;
        padding: 0.5rem 0.75rem 0;
    }

    body.chat-workspace .chat-input-footer {
        margin-top: 0.3rem;
        min-height: 36px;
    }
}

@media (min-width: 768px) and (max-height: 480px) {
    body.chat-workspace .chat-interface:not(:has(.chat-response:not(:empty))) .chat-messages {
        display: none;
    }

    body.chat-workspace .chat-input-wrapper {
        min-height: 64px;
    }

    body.chat-workspace .chat-input-footer {
        min-height: 30px;
    }
}

.assistant-response-opener {
    margin: 0 0 0.65rem;
    color: var(--heading-color);
    font-weight: 600;
}

/* --- Footer --- */
.footer {
    background-color: var(--bg-color-light);
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 0 0.75rem;
    margin-top: 1.5rem;
}

.footer-content {
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo {
    height: 28px;
    width: auto;
    max-width: 150px;
}

.footer-tagline {
    color: var(--text-color);
    font-size: 14px;
    margin: 0;
}

.footer-contact h5 {
    color: var(--heading-color);
    display: none;
}

.footer-contact p {
    color: var(--text-color);
    display: inline;
    margin: 0;
    font-size: var(--font-size-base);
}

.footer-contact p + p::before {
    content: " | ";
    color: var(--text-muted);
}

.footer-contact .phone-number,
.footer-contact .email-address {
    color: var(--primary-color);
    font-weight: 500;
}

.footer-contact .hours {
    color: var(--text-color);
    font-size: 12px;
    opacity: 0.8;
    margin-left: 0.25rem;
}

.footer-bottom {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.footer-copyright {
    color: var(--text-color);
    font-size: 13px;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.back-to-top:hover {
    background: linear-gradient(135deg, #2563eb 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.back-to-top.show {
    display: flex;
}

.back-to-top::before {
    content: "↑";
    line-height: 1;
}

/* --- Loading Indicators --- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

.htmx-indicator {
    display: none;
    align-items: center;
    color: var(--text-color);
    margin-left: 1rem;
    font-size: 14px;
}

.htmx-request .htmx-indicator {
    display: flex;
}

.htmx-indicator.htmx-request {
    display: flex;
}

.htmx-request .htmx-indicator + span {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Subtle loading state for buttons */
.loading-glow {
    position: relative;
    animation: glow-pulse 1.6s ease-in-out infinite alternate;
    z-index: 1;
    /* Override button transitions and transforms during loading */
    transition: none !important;
    transform: none !important;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--primary-tint);
    }
    100% {
        box-shadow: 0 0 0 6px transparent;
    }
}

/* --- travel Result Styles --- */
.travel-content {
    margin: 0.5rem 0;
}

.travel-content .content-text {
    color: var(--text-color);
    line-height: 1.6;
    padding: 1rem;
    background-color: var(--bg-color-light);
    border-radius: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.travel-content .content-text h1 {
    color: var(--heading-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.travel-content .content-text h2 {
    color: var(--heading-color);
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.travel-content .content-text h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.travel-content .content-text strong {
    color: var(--heading-color);
    font-weight: 600;
}

.travel-content .content-text ul,
.travel-content .content-text ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.travel-content .content-text li {
    margin: 0.25rem 0;
    line-height: 1.4;
}

.travel-content .content-text p {
    margin: 0.75rem 0;
    line-height: 1.5;
}

.travel-content .content-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.travel-content .content-text a:hover {
    color: var(--primary-hover);
}

/* --- Fundraising Result Styles --- */
.fundraising-result {
    color: var(--text-color);
}

.fundraising-result .result-header h3 {
    color: var(--heading-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.fundraising-ideas {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.fundraising-result .fundraising-ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: 1.5rem;
    align-items: stretch;
    margin-top: 1.5rem;
}

.fundraising-result .fundraising-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color-lighter);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.fundraising-result .fundraising-card .card-header {
    padding: 1rem 1.25rem;
    margin: 0;
    background-color: var(--bg-color-form);
    border-bottom: 1px solid var(--border-color);
}

.fundraising-result .fundraising-card .card-header h4 {
    margin: 0;
    color: var(--heading-color);
    font-size: var(--font-size-md);
}

.fundraising-result .fundraising-card .card-content {
    flex: 1;
    padding: 1.25rem;
}

.fundraising-result .fundraising-card .card-content > div + div {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.fundraising-result .fundraising-card .card-content strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--heading-color);
    font-weight: var(--font-weight-semibold);
}

.fundraising-result .fundraising-card .card-content p {
    margin: 0;
    line-height: 1.5;
}

.fundraising-result .fundraising-card .card-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.fundraising-result .implementation-btn {
    width: 100%;
}

.implementation-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
}

.implementation-modal .modal-content {
    width: min(100%, 25rem);
    padding: 2rem;
    background-color: var(--bg-color-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.implementation-modal .loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 1rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.copy-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.fundraising-idea {
    background: linear-gradient(135deg, #1a2233 0%, #232c40 100%);
    border: 1px solid #475569;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.fundraising-idea h4 {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    margin: 0;
    padding: 1.25rem 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border: none;
}

.fundraising-idea .idea-section {
    margin: 0;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #475569;
    background: rgba(26, 34, 51, 0.5);
}

.fundraising-idea .idea-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.fundraising-idea .idea-section:nth-child(even) {
    background: rgba(51, 65, 85, 0.3);
}

.fundraising-idea .idea-section strong {
    color: #0ea5e9;
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fundraising-idea .description-content,
.fundraising-idea .suitability-content,
.fundraising-idea .potential-content,
.fundraising-idea .steps-content {
    color: #e2e8f0;
    margin: 0.5rem 0;
    line-height: 1.7;
    font-size: 1rem;
    white-space: pre-line;
    word-wrap: break-word;
    font-weight: 400;
}

.fundraising-idea .idea-section p {
    color: #e2e8f0;
    margin: 0.75rem 0;
    line-height: 1.7;
    font-size: 1rem;
}

.fundraising-idea .action-plan,
.fundraising-idea .key-roles {
    background: linear-gradient(135deg, #155e75 0%, #0e7490 100%);
    border-left: 4px solid #06b6d4;
    padding: 1.25rem;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(6, 182, 212, 0.1);
}

.fundraising-idea .action-plan h4,
.fundraising-idea .key-roles h4 {
    color: #a5f3fc;
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    border: none;
    padding: 0;
    font-weight: 600;
}

.fundraising-idea .action-plan p,
.fundraising-idea .key-roles p {
    color: #e2e8f0;
    margin: 0.75rem 0;
    line-height: 1.6;
}

.fundraising-idea .action-plan strong,
.fundraising-idea .key-roles strong {
    color: #67e8f9;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 600;
}

.fundraising-idea .action-plan ul,
.fundraising-idea .key-roles ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.fundraising-idea .action-plan li,
.fundraising-idea .key-roles li {
    color: #e2e8f0;
    margin: 0.75rem 0;
    line-height: 1.6;
    position: relative;
}

.fundraising-idea .action-plan li::marker,
.fundraising-idea .key-roles li::marker {
    color: #67e8f9;
}

.fundraising-idea .action-plan h4:not(:first-child),
.fundraising-idea .key-roles h4:not(:first-child) {
    margin-top: 1.5rem;
    color: #a5f3fc;
    border-top: 1px solid rgba(167, 243, 252, 0.3);
    padding-top: 1rem;
}

.fundraising-idea div {
    margin: 0.75rem 0;
    color: #e2e8f0;
    font-size: 1rem;
    line-height: 1.7;
}

.fundraising-idea strong {
    color: #0ea5e9;
    font-weight: 600;
}

.idea-description {
    padding: 1.25rem 1.5rem;
    color: #e2e8f0;
    margin: 0;
    line-height: 1.6;
    font-size: 1rem;
    background: rgba(26, 34, 51, 0.5);
}

/* --- Profile Page Styles --- */
.profile-container {
    min-height: 100vh;
    padding: 80px 2rem 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.profile-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.form-grid {
    display: grid;
    gap: 1.5rem;
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-select {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23888' d='M0 0l4 4 4-4H0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 8px 8px;
    padding-right: 2.5rem;
}

.checkbox-section {
    margin-top: 1rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-color);
}

.completion-section {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
}

.completion-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.completion-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.completion-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 48px;
    align-items: center;
}

.completion-buttons .btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Password Change Styles */
.password-change-section {
    border: 2px solid var(--accent-color);
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.05) 0%, 
        rgba(59, 130, 246, 0.05) 100%);
}

.password-change-section .card-title {
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input {
    padding-right: 45px !important;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: color 0.2s ease;
    z-index: 2;
}

.password-toggle-btn:hover {
    color: var(--accent-color);
}

.password-strength-indicator,
.password-match-indicator {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    display: none;
}

.password-strength-indicator.weak {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

.password-strength-indicator.medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    display: block;
}

.password-strength-indicator.strong {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: block;
}

.password-match-indicator.match {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: block;
}

.password-match-indicator.no-match {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

/* Profile Page Responsive Design */
@media (max-width: 768px) {
    .profile-container {
        padding: 70px 1rem 1rem 1rem;
    }
    
    .profile-title {
        font-size: 2rem;
    }
    
    .profile-subtitle {
        font-size: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .completion-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.75rem;
    }
    
    .card-header {
        padding-bottom: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .form-input, .form-select {
        padding: 0.75rem;
        font-size: 16px;
    }
    
    button, .checkbox-item {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .profile-container {
        padding: 60px 0.5rem 0.5rem 0.5rem;
    }
    
    .profile-card {
        padding: 1.25rem;
        border-radius: 8px;
    }
    
    .form-grid {
        gap: 1rem;
    }
    
    .form-label {
        font-size: 0.8rem;
    }
}

/* Extra small screens - single column forms */
@media (max-width: 480px) {
    .form-row,
    .form-row.two-col {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Small screens (phones) - single column forms */
@media (max-width: 600px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 1.5rem 0 1rem 0;  /* Increased top padding from 1rem to 1.5rem for mobile breathing room */
    }
    .sidebar {
        display: none !important;
    }
    .mobile-tools-nav {
        display: block;
        padding: 0.75rem 0.5rem;
    }
    .main-content {
        margin: 0 0.5rem 0.5rem 0.5rem;
        padding: 1rem 0.75rem;
        border-radius: 0;
    }
    .team-context:not(.team-context-setup) {
        justify-content: flex-start;
        margin-bottom: 1rem;
        padding: 0.6rem 0.75rem;
    }
    .team-context-select-active {
        display: none;
    }
    .team-context-active-label {
        color: var(--text-color);
        display: inline;
        flex: 1;
        font-size: var(--font-size-base);
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .team-context-actions {
        gap: 0.5rem;
        max-width: 100%;
        min-width: 0;
    }
    .team-context-manage-link {
        font-size: 0.7rem;
    }
    .mobile-hidden {
        display: none;
    }
    .form-row,
    .form-row.two-col {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    .mobile-tool-button {
        min-height: 45px;
        padding: 0.4rem 0.4rem;
    }
    .tool-icon {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }
    .tool-name {
        font-size: 10px;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    .footer-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
        text-align: left;
    }

    .footer-contact p {
        display: block;
    }

    .footer-contact p + p::before {
        content: none;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding: 0 1rem;
    }
    .footer-logo {
        height: 35px;
        max-width: 180px;
        align-self: center;
    }
}

/* Medium screens (tablets in portrait) - 2 column forms */
@media (min-width: 601px) and (max-width: 768px) {
    .sidebar {
        display: none !important;
    }
    .main-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .form-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
    }
    .form-row.two-col {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

/* Tablets and small laptops - better form spacing */
@media (min-width: 769px) and (max-width: 992px) {
    .form-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
    }
    .form-row.two-col {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

/* Large tablets and small laptops - 2 or 3 columns based on content */
@media (min-width: 993px) and (max-width: 1200px) {
    .navbar {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }

    .main-container {
        padding: 1rem 1.5rem 1.5rem;
        gap: 1.5rem;
    }
    
    /* Allow 3 columns but with more breathing room */
    .form-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1.25rem;
    }
    
    /* Keep 2 columns for .two-col class */
    .form-row.two-col {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }
}

/* Extra large screens - full 3 columns with generous spacing */
@media (min-width: 1201px) {
    .main-container {
        gap: 1.5rem;
    }
    .sidebar {
        min-width: 320px;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1.5rem;
    }
    
    .form-row.two-col {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* Additional responsive improvements for footer */
@media (max-width: 768px) {
    .footer {
        padding: 2rem 0 1rem 0;
        margin-top: 2rem;
    }
}
/* ============================================
   Player Stats tool
   ============================================ */

.stats-panel {
    position: relative;
}

.stats-section-title {
    color: var(--heading-color);
    font-size: 1.15rem;
    margin: 0 0 0.75rem 0;
}

/* Season list (home) */
.stats-season-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stats-season-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background-color: var(--bg-color-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.stats-season-card:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-tint);
}

.stats-season-card-name {
    color: var(--heading-color);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-md);
}

.stats-season-card-meta {
    color: var(--text-muted);
    font-size: var(--font-size-base);
}

.stats-retention-note {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    margin: 1rem 0 0 0;
}

/* Season header + tabs */
.stats-season-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.stats-season-heading {
    flex: 1;
    min-width: 200px;
}

.stats-season-name {
    color: var(--heading-color);
    font-size: 1.4rem;
    margin: 0;
}

.stats-season-sport {
    color: var(--text-muted);
    font-size: var(--font-size-base);
}

.stats-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
}

.stats-tab {
    padding: 0.6rem 1.1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-color);
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.stats-tab:hover {
    color: var(--heading-color);
}

.stats-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: var(--font-weight-medium);
}

/* Tables */
.stats-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-md);
}

.stats-table th,
.stats-table td {
    padding: 0.65rem 0.9rem;
    text-align: left;
    white-space: nowrap;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.stats-table thead th {
    background-color: var(--bg-color-light);
    color: var(--heading-color);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

.stats-table tbody tr:hover td {
    background-color: var(--primary-tint);
}

.stats-jersey {
    color: var(--text-muted);
    font-size: var(--font-size-base);
}

.stats-player-inactive td {
    color: var(--text-muted);
}

.stats-inactive-badge {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    font-style: italic;
}

/* Row action links */
.stats-row-actions {
    text-align: right;
}

.stats-link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: var(--font-size-base);
    padding: 0.25rem 0.4rem;
}

.stats-link-btn:hover {
    text-decoration: underline;
}

.stats-link-danger {
    color: var(--error-color, #ef4444);
}

/* Inline forms (roster add/edit) */
.stats-inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.stats-inline-form input,
.stats-inline-form select {
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-color-lighter);
    color: var(--heading-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: var(--font-size-md);
    min-height: 2.5rem;
}

.stats-inline-form input:focus,
.stats-inline-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-tint);
}

.stats-inline-form input[name="first_name"],
.stats-inline-form input[name="last_name"] {
    flex: 1;
    min-width: 120px;
}

.stats-inline-form input[name="jersey"] {
    width: 6.5rem;
}

.stats-add-player-form {
    margin-top: 0.5rem;
}

/* Multi-select roster field (e.g. track events) - keep it compact rather
   than letting the browser default to a tall listbox. */
.stats-inline-form select[multiple],
.stats-roster-review .stats-table select[multiple] {
    min-height: 5.5rem;
    padding: 0.35rem;
}

/* Entry form grid */
.stats-entries-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.stats-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Date/opponent row: the site-wide .form-group input styling stretches to
   fill its column, which makes a short date value look like an oversized
   empty bar - keep these compact and only as wide as they need to be. */
.stats-entry-form .form-row.two-col {
    align-items: start;
}

.stats-entry-form .form-row.two-col .form-group input {
    min-height: 2.75rem;
    padding: 0.6rem 0.85rem;
    width: auto;
}

.stats-entry-form input[type="date"] {
    max-width: 190px;
}

.stats-entry-form input[name="opponent"] {
    max-width: 320px;
    width: 100%;
}

.stats-entry-table td {
    padding: 0.4rem 0.5rem;
}

.stats-entry-table input,
.stats-entry-table select {
    padding: 0.45rem 0.6rem;
    background-color: var(--bg-color-lighter);
    color: var(--heading-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: var(--font-size-base);
    min-height: 2.25rem;
}

.stats-entry-table input:focus,
.stats-entry-table select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-tint);
}

.stats-entry-table input[type="number"] {
    width: 4.25rem;
}

.stats-entry-table input[type="text"] {
    width: 6.5rem;
}

.stats-entry-player-cell {
    color: var(--heading-color);
    white-space: nowrap;
}

.stats-add-row-btn {
    margin-bottom: 0.5rem;
}

.stats-form-hint {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    margin: 0.25rem 0 1rem 0;
}

.stats-optional {
    color: var(--text-muted);
    font-weight: normal;
    font-size: var(--font-size-base);
}

/* Empty states */
.stats-empty {
    padding: 1.5rem;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    margin-bottom: 1.25rem;
}

.stats-empty p {
    margin: 0;
}

.stats-signup-prompt {
    padding: 1.25rem 1.4rem;
}

.stats-signup-eyebrow {
    margin: 0 0 0.4rem 0;
    color: var(--primary-color);
    font-size: 0.76rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stats-signup-title {
    margin: 0 0 0.7rem 0;
    color: var(--heading-color);
    font-size: 1.18rem;
    line-height: 1.35;
}

.stats-signup-copy {
    margin: 0;
    color: var(--text-color);
    line-height: 1.6;
}

.stats-signup-cta {
    margin-top: 0.9rem;
}

/* ============================================
   Safe Messenger workspace
   ============================================ */

.sms-page {
    width: min(1440px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 2.5rem 0 4rem;
}

.sms-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sms-page-dashboard-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: var(--font-size-base);
    margin-bottom: 0.75rem;
}

.sms-page-dashboard-link:hover {
    color: var(--heading-color);
    text-decoration: none;
}

.sms-page-eyebrow {
    margin: 0 0 0.35rem;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sms-page-title {
    margin: 0;
    font-size: 2rem;
    line-height: 1.2;
}

.sms-page-description {
    max-width: 45rem;
    margin: 0.6rem 0 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.sms-page-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    max-width: 24rem;
}

.sms-page-status span {
    padding: 0.4rem 0.65rem;
    color: var(--text-color);
    background: var(--bg-color-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    white-space: nowrap;
}

.sms-workspace {
    display: grid;
    grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
    gap: 2rem;
    padding-top: 2rem;
}

.sms-workspace-aside {
    align-self: start;
    padding-right: 1.5rem;
    border-right: 1px solid var(--border-color);
}

.sms-workspace-aside h2 {
    margin: 0 0 0.8rem;
    font-size: var(--font-size-md);
}

.sms-workspace-aside ul {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sms-workspace-aside li {
    display: flex;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: var(--font-size-base);
    line-height: 1.45;
}

.sms-workspace-aside li i {
    color: var(--primary-color);
    padding-top: 0.15rem;
}

.sms-workspace-aside details {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.sms-workspace-aside summary {
    color: var(--heading-color);
    cursor: pointer;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

.sms-workspace-aside details p {
    margin: 0.75rem 0 0;
    color: var(--text-muted);
    font-size: var(--font-size-base);
    line-height: 1.55;
}

.sms-workspace-main {
    min-width: 0;
}

.sms-workspace-main .scribe-mode-toggle {
    max-width: none;
    margin: 0 0 1.5rem;
}

.sms-workspace-main .form-container {
    max-width: none;
}

.sms-history-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.sms-history-section h2 {
    margin: 0 0 1rem;
    font-size: var(--font-size-md);
}

@media (max-width: 900px) {
    .sms-page {
        width: min(100% - 2rem, 1440px);
        padding-top: 1.75rem;
    }

    .sms-page-header {
        flex-direction: column;
        gap: 1.25rem;
    }

    .sms-page-status {
        justify-content: flex-start;
        max-width: none;
    }

    .sms-workspace {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .sms-workspace-aside {
        padding: 0 0 1.25rem;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 600px) {
    .sms-page-title {
        font-size: 1.65rem;
    }

    .sms-page-status span {
        white-space: normal;
    }
}

/* Small button variant used across the stats UI */
.btn-sm {
    padding: 0.45rem 0.9rem !important;
    font-size: var(--font-size-base) !important;
    min-height: 0 !important;
}

/* Photo upload -> autofill (roster + log-a-game) */
.stats-upload-box {
    padding: 1.75rem 1.5rem;
    border: 1.5px dashed var(--border-color);
    border-radius: 14px;
    background-color: var(--bg-color-light);
    margin-bottom: 1.25rem;
    text-align: center;
}

.stats-upload-icon {
    font-size: 2.25rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stats-upload-title {
    color: var(--heading-color);
    font-weight: var(--font-weight-semibold);
    margin: 0 0 0.35rem 0;
}

.stats-upload-hint {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    margin: 0 auto 1.1rem;
    max-width: 460px;
}

.stats-upload-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.85rem;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.stats-upload-controls input[type="file"] {
    display: block;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    color: var(--text-color);
    font-size: var(--font-size-base);
}

.stats-upload-btn {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
}

.stats-upload-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.stats-inline-indicator {
    margin-left: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.stats-inline-indicator .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    margin-right: 0.4rem;
}

.stats-upload-btn.htmx-request {
    opacity: 0.8;
    pointer-events: none;
}

.stats-upload-device-note {
    width: 100%;
    max-width: 360px;
    margin: 0.7rem auto 0;
    padding: 0 0.35rem;
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.45;
    text-align: center;
}

/* Roster-photo review table */
.stats-roster-review .stats-table input,
.stats-roster-review .stats-table select {
    padding: 0.45rem 0.6rem;
    background-color: var(--bg-color-lighter);
    color: var(--heading-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: var(--font-size-base);
    min-height: 2.25rem;
}

.stats-roster-review .stats-table input[type="checkbox"] {
    min-height: 0;
    width: 1.1rem;
    height: 1.1rem;
}

/* Unmatched-name warning on the log-a-game photo flow */
.stats-extract-unmatched {
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--error-color, #ef4444);
    border-radius: 12px;
    background-color: var(--primary-tint);
    color: var(--text-color);
    margin-bottom: 1.25rem;
}

.stats-extract-unmatched p {
    margin: 0 0 0.5rem 0;
}

.stats-extract-unmatched ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Safe Messenger */

/* Callout for the compliance guidelines summary. A left-accent border (like
   the ad hoc .tool-description boxes other tools style inline) looked like a
   stray shading smear once this collapsed to a single summary line, so this
   uses a plain full border matching .form-container instead. */
.compliance-banner {
    background: var(--bg-color-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.compliance-banner ul {
    margin: 0;
    padding-left: 1.25rem;
}

.compliance-banner li {
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.compliance-banner li:last-child {
    margin-bottom: 0;
}

/* Collapsed by default so it doesn't eat vertical space on every visit once
   a coach already knows the rules (see the Sending Controls rail in
   safe_messenger.html, the only place this markup renders). */
.compliance-banner summary {
    margin: 0;
    color: var(--warning-color);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
}

.compliance-banner[open] summary {
    margin-bottom: 0.5rem;
}

/* Reminder shown under every visible phone number: this channel is the
   monitored/auditable one, never the coach's personal phone. */
.phone-reminder {
    display: block;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

/* Solid-fill status pill, e.g. a contact who has opted out via STOP. */
.badge-warning {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    background: var(--warning-color);
    color: #fff;
}

/* Per-message "Delivered %" in the send history table - the share of
   recipients whose latest Twilio status callback reported "delivered". */
.delivered-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 6rem;
}

.delivered-progress-track {
    flex: 1;
    height: 6px;
    border-radius: var(--radius-sm);
    background: var(--border-color);
    overflow: hidden;
}

.delivered-progress-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    background: var(--success-color);
}

.delivered-progress-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.text-muted {
    color: var(--text-muted);
}
