/* Colour/typography tokens live in tokens.css (single source of truth,
   light + dark). This file holds component styling only. */
:root {
    scroll-behavior: smooth;
    --nav-transition-timing: 0.3s ease;
}

table .orderable.desc {
    background: url("images/sort-down.bbbad99a2476.svg") no-repeat right center;
}

table .orderable.asc {
    background: url("images/sort-up.36c3ae3fb326.svg") no-repeat right center;
}

/* icons */
.bi-info-circle-fill {
    color: var(--brand-sage);
    font-size: 1rem;
}

.bi-square-fill {
    color: var(--brand-blue);
    font-size: 1rem;
}

/* Crispy Forms */
.asteriskField {
    display: none;
}

.popover {
    max-width: 600px;
}

/* ---------- THEME TOGGLE (light / system / dark) ----------
   Markup: main/templates/main/snippets/theme_toggle.html
   Logic:  main/static/main/js/theme.js (data-theme-control) */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--surface-sunken);
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--ink-muted);
    width: 28px;
    height: 24px;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.theme-toggle-btn:hover {
    color: var(--ink);
}

.theme-toggle-btn.active {
    background: var(--surface-raised);
    color: var(--brand-blue);
    box-shadow: var(--shadow-sm);
}

/* Labelled variant (Preferences) */
.theme-toggle-labelled .theme-toggle-btn {
    width: auto;
    height: auto;
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
}

#main-content {
    transition: padding-left var(--nav-transition-timing);
    will-change: padding-left;
}



/* ---------- AG GRID STYLING START ----------
   The grid theme itself (colours, fonts, dark mode) is defined once via
   the Theming API in ai_coaching/templates/ai_coaching/aggrid_components.html.
   Only behavioural/positioning rules live here. */

.ag-header-cell.ag-header-cell-checkbox .ag-header-select-all {
    cursor: pointer;
    margin-right: 5px;
}

.ag-row.ag-row-clickable,
.ag-row.ag-row-clickable .ag-cell {
    cursor: pointer !important;
}

/* Not-yet-completed rows (queued / processing / errored): muted text via token
   (theme-safe) so they read as not-clickable. Cells inherit this row colour;
   the NEW/Focus badges keep their own colours. */
.ag-row.ag-row-muted {
    color: var(--ink-muted);
}

.ag-row:not(.ag-row-clickable),
.ag-row:not(.ag-row-clickable) .ag-cell {
    cursor: default !important;
}

.selected-row {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
}

.ag-checkbox-input-wrapper {
    opacity: 1 !important;
    width: 16px !important;
    height: 16px !important;
}

.transcription-link {
    color: var(--bs-primary);
    text-decoration: none;
    position: relative;
    z-index: 5;
}

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

/* ---------- AG GRID STYLING END ---------- */

/* Collapse indicator caret for collapsible headings (shared by framework analysis steps) */
.collapse-indicator {
    transition: transform 0.3s;
}

.collapsed .collapse-indicator {
    transform: rotate(-90deg);
}


/* Responsive typography and spacing */
/* Mobile typography adjustments */
@media (max-width: 767.98px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Tablet typography adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* Large screen typography enhancements */
@media (min-width: 1400px) {
    h1 { font-size: 2.75rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.875rem; }
    
    .lead {
        font-size: 1.375rem;
    }
}

/* Responsive table improvements */
@media (max-width: 767.98px) {
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Form responsive improvements */
@media (max-width: 767.98px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .input-group {
        flex-wrap: wrap;
    }
    
    .input-group .btn {
        margin-top: 0.5rem;
    }
}

/* Card responsive spacing */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

@media (min-width: 1400px) {
    .card-body {
        padding: 2rem;
    }
}

/* Modal responsive improvements */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.375rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* Toast background comes from tokens.css (--surface-raised) */

/* Toast positioning for mobile */
@media (max-width: 767.98px) {
    .toast-container {
        position: fixed !important;
        top: 70px !important; /* Below mobile nav button */
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
    }
    
    .toast {
        max-width: none;
    }
}

/* Prevent text selection on clickable table rows (double-click flash) */
.dev-task-row {
    user-select: none;
}

/* Analysis Catalog Styles */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.focus-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Focus + depth badge colours (brand palette, no purple).
   Class slugs mirror Analysis.FocusChoices / DepthChoices values:
   get_badge_class() in ai_coaching/models.py and the focusRenderer in
   job_list_content.html derive them from the choice codes. Fixed
   mid-tone backgrounds + white text stay legible in both themes;
   the Markers badge is outlined and follows the surface tokens. */
.focus-badge-10co { background-color: #56789a; color: #fff; }  /* Coach - slate blue */
.focus-badge-20su { background-color: #9a7b5b; color: #fff; }  /* Client - warm caramel */
.focus-badge-30se { background-color: #6b7280; color: #fff; }  /* Session - grey */
.focus-badge-40fr {                                            /* Markers - outlined */
    background-color: var(--surface-sunken);
    color: var(--ink);
    border: 1px solid var(--ink-muted);
}
.focus-badge-50re { background-color: #5b8a8a; color: #fff; }  /* Relationship - teal */
.focus-badge-60cc { background-color: #6d7f74; color: #fff; }  /* Coach+Client - sage grey */
.focus-badge-unknown { background-color: #6b7280; color: #fff; }

.depth-badge { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
.depth-badge-l10 { background-color: #7a9d7f; color: #fff; }   /* Quick Scan - light sage */
.depth-badge-l20 { background-color: #5a7d5f; color: #fff; }   /* Standard - sage */
.depth-badge-l30 { background-color: #3d5a40; color: #fff; }   /* Deep Dive - forest */
.depth-badge-unknown { background-color: #6b7280; color: #fff; }

/* ---- Semantic status badge palette ---- */
/* Token-driven replacements for Bootstrap's raw bg-* badge classes.
   Use these everywhere instead of bg-secondary / bg-success / etc.
   Both themes are handled automatically via tokens.css CSS variables.  */
.badge-neutral   { background-color: var(--ink-muted);  color: var(--surface-raised); }
.badge-brand     { background-color: var(--brand-blue);  color: #fff; }
.badge-ok        { background-color: var(--brand-green); color: #fff; }
.badge-warn      { background-color: var(--brand-brown); color: #fff; }
.badge-bad       { background-color: var(--brand-error); color: #fff; }
.badge-soft-info { background-color: var(--brand-sage);  color: #fff; }
.badge-surface {
    background-color: var(--surface-raised);
    color: var(--ink);
    border: 1px solid var(--rule) !important;
}
.badge-ok-soft {
    background-color: var(--surface-raised);
    color: var(--brand-sage);
    border: 1px solid var(--brand-sage) !important;
}

/* ---- Session badge colour ring (8-step) ---- */
/* CSS variables for light/dark are defined in tokens.css.
   Matches SESSION_BADGE_COLORS in coaching_extras.py and
   SESSION_COLORS in _session_timestamps.html. */
.session-badge { color: #fff; }
.session-badge-1 { background-color: var(--sb-1); }
.session-badge-2 { background-color: var(--sb-2); }
.session-badge-3 { background-color: var(--sb-3); }
.session-badge-4 { background-color: var(--sb-4); }
.session-badge-5 { background-color: var(--sb-5); }
.session-badge-6 { background-color: var(--sb-6); }
.session-badge-7 { background-color: var(--sb-7); }
.session-badge-8 { background-color: var(--sb-8); }

/* Chevron rotation animation for collapsible cards */
.btn[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.bi-chevron-down {
    transition: transform 0.2s ease-in-out;
}

/* Navigation hover effects.
   No font-weight change here: animating/swapping weight reflows the text width
   and causes a visible "pop" when moving between items. Transition only colour
   so the hover is a smooth tint, not a jump. */
.vertical-navbar .nav-link:hover {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.navbar-brand:hover {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.vertical-navbar .nav-link[href*="admin"]:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Make checkboxes more visible with darker borders */
.form-check-input {
    border-color: var(--ink-muted) !important;
    border-width: 2px !important;
}

.form-check-input:focus {
    border-color: var(--brand-blue) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

.form-check-input:checked {
    background-color: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
}

.cursor-help {
    cursor: help;
}

/* ---------- MULTI-ANALYSIS STYLING START ---------- */

/* Section headings - subtle left accent instead of full bottom border.
   Display face gives analysis output an editorial, report-like voice. */
.analysis-section-heading {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-weight: 600;
    letter-spacing: -0.01em;
    border-left: 3px solid var(--bs-primary);
    padding-left: 0.75rem;
    margin-bottom: 1rem;
    color: var(--bs-body-color);
}

/* Overview card - extends Bootstrap .card with a softer border and subtle shadow.
   (bg + border-radius come from .card; only the overrides live here.) */
.analysis-overview-card {
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-sm);
}

.analysis-overview-card .card-body p {
    margin-bottom: 0.5rem;
}

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

/* Sessions list in job detail */
.analysis-sessions-list .list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.5rem 0.75rem;
}

.analysis-sessions-list .list-group-item:first-child {
    border-top: none;
}

/* Cross-session insights and development synthesis markdown content */
.cross-session-insights-content strong,
.development-synthesis-content strong {
    font-weight: 700;
}

.cross-session-insights-content em,
.development-synthesis-content em {
    font-style: italic;
}

.cross-session-insights-content p,
.development-synthesis-content p {
    margin-bottom: 1rem;
}

/* Synthesis/insights card - extends Bootstrap .card with a softer border.
   (bg + border-radius come from .card.) */
.analysis-synthesis-card {
    border: 1px solid var(--rule);
}

/* Turning point / pattern evolution cards - standardized text */
.analysis-turning-point .card-body p {
    color: var(--bs-body-color);
}

/* Accordion - lighter alerts inside */
.analysis-accordion .alert {
    border: none;
    font-size: 0.9rem;
}

.analysis-accordion .alert strong {
    font-weight: 600;
}

/* Practice swaps side-by-side backgrounds */
.practice-swap-replace {
    border-left: 3px solid var(--bs-danger);
    padding-left: 0.75rem;
}

.practice-swap-with {
    border-left: 3px solid var(--bs-success);
    padding-left: 0.75rem;
}

/* Theme-aware table header tint (replaces Bootstrap's .table-light,
   which stays hardcoded light in dark mode) */
.analysis-table-head {
    background-color: var(--surface-sunken);
}

/* Theme-aware sunken panel for the inline progress-history drawer
   (replaces Bootstrap's .bg-light, which stays hardcoded light in
   dark mode and left the panel white-on-white). */
.progress-history-panel {
    background-color: var(--surface-sunken);
}

.analysis-table-head th {
    background-color: transparent;
}

/* Quiet callout for interpretive asides inside analysis results
   (hypotheses, focus suggestions, journaling prompts). Replaces the
   saturated Bootstrap alert-info/alert-primary fills: cream surface,
   thin accent, body ink - reads as a considered aside, not a system
   notification. Variants recolour the accent only. */
.analysis-callout {
    background: var(--brand-cream);
    border: 1px solid var(--rule-soft);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    color: var(--bs-body-color);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* No left accent bar here - that mark is reserved for
   .analysis-section-heading, and reusing it made callouts read as
   section-level siblings. Semantics live in the lead-in label colour. */
.analysis-callout strong {
    font-weight: 600;
    color: var(--brand-blue);
}

.analysis-callout-sage strong {
    color: var(--brand-sage);
}

.analysis-callout-brown strong {
    color: var(--brand-brown);
}

/* Analysis reference (was emoji magnifying glass) */
.analysis-reference {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    font-style: italic;
}

/* ---------- MULTI-ANALYSIS STYLING END ---------- */

/* ---------- ANALYSIS PERSPECTIVE MARKDOWN FORMATTING ---------- */
.analysis-perspective-content strong {
    font-weight: 700 !important;
}
.analysis-perspective-content em {
    font-style: italic !important;
}
.analysis-perspective-content p {
    margin-bottom: 1rem;
}
.analysis-perspective-content ul, .analysis-perspective-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.analysis-perspective-content h1, .analysis-perspective-content h2,
.analysis-perspective-content h3, .analysis-perspective-content h4,
.analysis-perspective-content h5, .analysis-perspective-content h6 {
    font-weight: 600 !important;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* ---------- SHARED PAGE HEADER ----------
   Standard header for main app pages: eyebrow kicker + display title +
   optional actions on the right. Markup recipe:
     <header class="page-header">
       <div>
         <span class="eyebrow">...</span>
         <h1 class="page-title">...</h1>
       </div>
       <div class="page-header-actions">...buttons...</div>
     </header> */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.85rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule-soft);
}

.page-title {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.2;
    margin-bottom: 0;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Theme-aware replacement for bg-white on raised, non-card surfaces */
.bg-surface-raised {
    background-color: var(--surface-raised) !important;
}

/* Sticky table headers (development task tables, coachee detail) */
.sticky-table-header {
    position: sticky;
    top: 0;
    background-color: var(--surface-raised);
    z-index: 10;
}
/* Drop shadow so content scrolling underneath reads as "behind" the header */
.sticky-table-header th {
    box-shadow: 0 6px 6px -4px rgba(0, 0, 0, 0.18);
}

/* ---------- HOME & ADMIN CARD HOVER ---------- */
.home-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md) !important;
}
.home-card .card-body {
    padding-top: 1.5rem;
}

/* ---------- ICON TILES (iOS-style squircle) ----------
   Shared by home cards (.home-card-icon) and page headers (.page-header-icon).
   The host element sets --icon-color; tint, glow + glyph shadow all derive
   from it. Never hardcode the colour - pass it via --icon-color. */
.home-card-icon,
.page-header-icon,
.subheader-icon {
    --icon-color: var(--bs-primary);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 0.85rem;          /* squircle */
    font-size: 1.35rem;
    line-height: 1;
    color: var(--icon-color);
    background:
        radial-gradient(125% 125% at 30% 18%,
            color-mix(in srgb, var(--icon-color) 20%, var(--surface-raised)) 0%,
            color-mix(in srgb, var(--icon-color) 9%, var(--surface-raised)) 100%);
    border: 1px solid color-mix(in srgb, var(--icon-color) 22%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -2px 5px color-mix(in srgb, var(--icon-color) 14%, transparent),
        0 3px 8px color-mix(in srgb, var(--icon-color) 18%, transparent);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-card-icon > i,
.page-header-icon > i,
.subheader-icon > i {
    margin: 0;
    /* subtle lift on the glyph itself */
    filter: drop-shadow(0 1px 1px color-mix(in srgb, var(--icon-color) 28%, transparent));
}
.home-card:hover .home-card-icon {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 7px 16px color-mix(in srgb, var(--icon-color) 28%, transparent);
}
[data-bs-theme="dark"] .home-card-icon,
[data-bs-theme="dark"] .page-header-icon,
[data-bs-theme="dark"] .subheader-icon {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -2px 5px color-mix(in srgb, var(--icon-color) 22%, transparent),
        0 3px 8px rgba(0, 0, 0, 0.35);
}
[data-bs-theme="dark"] .home-card:hover .home-card-icon {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 7px 16px color-mix(in srgb, var(--icon-color) 30%, transparent);
}

/* Page-header variant: a touch larger to balance the display title, and
   nudged up so it aligns with the title rather than the eyebrow baseline. */
.page-header-icon {
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 0.95rem;
    font-size: 1.5rem;
    align-self: center;
}

/* Subheader variant: small squircle to sit beside an h5/h6 section heading
   (e.g. "New Analysis"). Same tile family, scaled down to the heading. */
.subheader-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.6rem;
    font-size: 1.05rem;
}

/* Card title: Fraunces display, tightened - classy, not shouty. */
.home-card-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.1;
}
/* ---------- SELECTION CARD PATTERN ---------- */
/* Shared by analysis type and upload type card selectors */
.selection-card {
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.selection-card:hover {
    border-color: var(--bs-primary);
}
.selection-card.active {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* ---------- JOB STATUS STYLING ----------
   --status-* tokens are defined in tokens.css (aliases of brand tokens). */
.job-status-container {
    text-align: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--status-cream) 0%, var(--surface-raised) 100%);
    border-radius: 12px;
    box-shadow: 0 2px 16px var(--status-shadow);
    margin-bottom: 1rem;
}

.job-status-icon-wrapper {
    margin-bottom: 1rem;
}

.job-status-heading {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--status-forest);
}

.job-status-message {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--status-warm-gray);
    margin: 0 auto 0.35rem;
    max-width: 500px;
}

.job-status-timing {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--status-warm-gray);
    margin-top: 0.35rem;
}

.job-status-error-details {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(193, 85, 79, 0.06);
    border-left: 3px solid var(--status-error);
    border-radius: 6px;
    text-align: left;
}

.job-status-error-details strong {
    color: var(--status-error);
    font-weight: 600;
}

.job-status-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(90, 125, 95, 0.1);
    border-top-color: var(--status-sage);
    border-radius: 50%;
    animation: jobStatusSpin 1s linear infinite;
    margin: 0 auto 1rem;
}

.job-status-icon {
    font-size: 3.5rem;
    display: inline-block;
}

.job-status-icon.success {
    color: var(--status-success);
}

.job-status-icon.error {
    color: var(--status-error);
}

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

/* ---------- ONBOARDING ---------- */
.onboarding-hero {
    background: linear-gradient(135deg, #0a4a6e 0%, #0f6797 40%, #1a8bc4 100%);
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}
.onboarding-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.onboarding-plan-card {
    border: 2px solid var(--bs-border-color);
    border-radius: 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.onboarding-plan-card:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 4px 20px rgba(15, 103, 151, 0.15);
    color: inherit;
}
.onboarding-plan-card.selected {
    border-color: var(--bs-primary);
    background-color: rgba(15, 103, 151, 0.04);
    box-shadow: 0 4px 20px rgba(15, 103, 151, 0.18);
}
.onboarding-plan-card:focus-visible {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(15, 103, 151, 0.25);
}
.onboarding-plan-card.annual-card {
    border-color: var(--bs-success);
}
.onboarding-plan-card.annual-card:hover {
    border-color: var(--bs-success);
    box-shadow: 0 4px 20px rgba(25, 135, 84, 0.2);
}
.onboarding-email-section {
    border-left: 3px solid var(--bs-primary);
    background: var(--surface-sunken);
    border-radius: 0 0.5rem 0.5rem 0;
}
.onboarding-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--bs-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}
.onboarding-divider::before,
.onboarding-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--bs-border-color);
}

/* ---------- AUTH SHELL (login / signup / password / MFA pages) ----------
   Shared backdrop + card treatment. Body class set in
   main/base_accounts.html and core/templates/allauth/layouts/base.html. */
.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 60% at 75% 20%, rgba(15, 103, 151, 0.07) 0%, transparent 65%),
        radial-gradient(ellipse 60% 70% at 15% 85%, rgba(90, 125, 95, 0.06) 0%, transparent 60%),
        linear-gradient(170deg, var(--surface) 0%, var(--surface-sunken) 100%);
}

.auth-body .card {
    border: 1px solid var(--rule-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.auth-body .card-footer {
    background: transparent;
    border-top: 1px solid var(--rule-soft);
    font-size: 0.85rem;
}

.auth-title {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ---------- SIGNUP ---------- */
@media (min-width: 768px) {
    .border-start-md {
        border-left: 1px solid var(--rule) !important;
    }
}
.password-help-icon {
    color: var(--bs-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    /* The icon lives inside a .form-floating > label, which Bootstrap sets to
       pointer-events: none. Re-enable them (and lift above the input) so the
       popover trigger stays hoverable/clickable. */
    pointer-events: auto;
    position: relative;
    z-index: 5;
}
.password-help-icon:hover {
    color: var(--bs-primary);
}
@media (max-width: 767.98px) {
    .signup-card .card-body { padding: 1rem !important; }
    .signup-card .form-check label { font-size: 0.85rem; }
    .signup-card .mb-3 { margin-bottom: 0.5rem !important; }
    .signup-card :not(.form-floating) > label[for="id_email"],
    .signup-card :not(.form-floating) > label[for="id_password1"],
    .signup-card :not(.form-floating) > label[for="id_password2"] { display: none; }
}

/* ---------- AG GRID HEADER CENTERING ---------- */
.ag-header-cell-center .ag-header-cell-label {
    justify-content: center;
}
.ag-header-cell-right .ag-header-cell-label {
    justify-content: flex-end;
}
/* Centre the checkbox in a selection ("Include") column cell. The empty
   cell-value span would otherwise grow and push the checkbox left, so collapse
   it and drop the checkbox's right margin before centring the wrapper. */
.ag-cell.ag-include-cell .ag-cell-wrapper {
    justify-content: center;
}
.ag-cell.ag-include-cell .ag-cell-value {
    display: none;
}
.ag-cell.ag-include-cell .ag-selection-checkbox {
    margin-right: 0;
}

/* ---------- UPPY DASHBOARD DARK MODE ----------
   Minimal overrides; the bundled uppy CSS is light-only. */
[data-bs-theme="dark"] .uppy-Dashboard-inner,
[data-bs-theme="dark"] .uppy-DragDrop-container {
    background-color: var(--surface-raised);
    border-color: var(--rule);
    color: var(--ink);
}

[data-bs-theme="dark"] .uppy-Dashboard-AddFiles {
    border-color: var(--rule);
}

[data-bs-theme="dark"] .uppy-Dashboard-AddFiles-title,
[data-bs-theme="dark"] .uppy-DragDrop-label {
    color: var(--ink);
}

[data-bs-theme="dark"] .uppy-StatusBar,
[data-bs-theme="dark"] .uppy-StatusBar-content {
    background-color: var(--surface-raised);
    color: var(--ink);
}

/* ---------- SCROLL MARGIN FOR LINKED ANALYSIS ITEMS ---------- */
[data-analysis-uuid] {
    scroll-margin-top: 100px;
}

/* ---------- ANALYSIS ADMIN SUMMARY ---------- */
.prompt-element-content {
    background-color: var(--surface-sunken);
}
.prompt-element:hover .prompt-element-content {
    background-color: var(--bs-tertiary-bg);
}
.analysis-admin-summary .card {
    border: none;
    border-radius: 8px;
}
.analysis-admin-summary .card-header {
    border-radius: 8px 8px 0 0 !important;
}
.analysis-admin-summary pre {
    margin: 0;
    tab-size: 2;
}

/* AG Grid custom tooltip used by the ethics column on the transcription list. */
.ag-tooltip.ethics-tooltip {
    max-width: 28rem;
    white-space: normal;
    line-height: 1.35;
    padding: 0.6rem 0.75rem;
}

/* ============================================================
   Walkthrough tour (driver.js) - friendly, branded popover styling.
   Uses native CSS nesting; all rules scoped under .walkthrough-popover.
   ============================================================ */

.driver-popover.walkthrough-popover {
    --wt-primary: var(--bs-primary);
    --wt-primary-rgb: var(--bs-primary-rgb);
    --wt-ink: var(--ink);
    --wt-ink-muted: var(--ink-muted);
    --wt-rule: var(--rule-soft);
    --wt-transition: 0.15s ease;

    background: var(--surface-raised);
    color: var(--wt-ink);
    border: none;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem 1.65rem 1.25rem;
    max-width: 380px;
    font-family: inherit;

    .driver-popover-title {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        color: var(--wt-primary);
        font-weight: 600;
        font-size: 1.1rem;
        line-height: 1.3;
        margin: 0 0 0.6rem 0;
        padding: 0;
    }

    .walkthrough-title-icon {
        flex-shrink: 0;
        display: inline-block;
    }

    .driver-popover-description {
        color: var(--wt-ink-muted);
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1.1rem;
    }

    .driver-popover-footer {
        border-top: 1px solid var(--wt-rule);
        padding-top: 0.85rem;
        margin-top: 0;
        align-items: center;
        gap: 0.5rem;
    }

    .driver-popover-progress-text {
        color: var(--wt-ink-muted);
        font-size: 0.825rem;
        font-weight: 500;
    }

    .driver-popover-prev-btn,
    .driver-popover-next-btn {
        display: inline-block;
        border-radius: 999px;
        border: 1px solid transparent;
        padding: 0.45rem 1.1rem;
        font-size: 0.875rem;
        font-weight: 500;
        line-height: 1.5;
        text-shadow: none;
        cursor: pointer;
        transition:
            background-color var(--wt-transition),
            border-color var(--wt-transition),
            color var(--wt-transition),
            box-shadow var(--wt-transition),
            transform var(--wt-transition);
    }

    .driver-popover-next-btn {
        background-color: var(--wt-primary);
        color: #fff;

        &:hover {
            background-color: rgba(var(--wt-primary-rgb), 0.88);
            color: #fff;
            box-shadow: 0 3px 10px rgba(var(--wt-primary-rgb), 0.25);
            transform: translateY(-1px);
        }
    }

    .driver-popover-prev-btn {
        background-color: transparent;
        color: var(--wt-primary);
        border-color: rgba(var(--wt-primary-rgb), 0.3);

        &:hover {
            background-color: rgba(var(--wt-primary-rgb), 0.08);
            border-color: var(--wt-primary);
        }
    }

    .driver-popover-btn-disabled {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .driver-popover-close-btn {
        color: var(--wt-ink-muted);
        font-size: 1.4rem;
        line-height: 1;
        width: 28px;
        height: 28px;
        top: 12px;
        right: 12px;
        opacity: 0.55;
        border-radius: 50%;
        transition:
            opacity var(--wt-transition),
            background-color var(--wt-transition),
            color var(--wt-transition);

        &:hover {
            opacity: 1;
            color: var(--wt-primary);
            background-color: rgba(var(--wt-primary-rgb), 0.08);
        }
    }
}