/*
 * Copyright (c) 2026 Trusted Cognetics Ltd. All rights reserved.
 * SPDX-License-Identifier: LicenseRef-Proprietary
 *
 * Proprietary and confidential. This file is part of Job Hunter AI
 * (jobseekercopilot.co.uk). Unauthorised copying, modification, distribution,
 * reverse engineering or use of this file, in whole or in part, by any means,
 * is strictly prohibited without the express written permission of the
 * copyright holder. See docs/TERMS_OF_SERVICE.md.
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* JobSeeker Web App Styles
   Design tokens are defined in tokens.css (loaded before this file).
   This :root block re-declares the legacy variable names used throughout
   this file with concrete values so they work in any context (including
   shadow DOM and third-party iframes).  The canonical equivalents are the
   --color-* / --space-* / --font-size-* names defined in tokens.css. */
:root {
    /* ---- Brand / status ---- */
    --primary-color:    #1e3a5f;
    --primary:          #1e3a5f;     /* kept for legacy references */
    --primary-hover:    #16304f;
    --secondary-color:  #f0f4f8;
    --success-color:    #059669;
    --warning-color:    #d97706;
    --error-color:      #dc2626;

    /* ---- Text / surfaces / borders ---- */
    --text-primary:     #0f172a;
    --text-secondary:   #64748b;
    --border-color:     #e2e8f0;
    --background-color: #f8fafc;
    --surface-color:    #ffffff;

    /* ---- Design-system token aliases ---- */
    --primary-light:    #3b82f6;
    --accent-from:      #1e3a5f;
    --accent-to:        #6366f1;
    --accent:           linear-gradient(135deg, #1e3a5f, #6366f1);
    --bg-main:          var(--background-color);
    --bg-card:          var(--surface-color);
    --remove-btn-bg:    #e2e8f0;
    --accent-color:     #4f46e5;

    /* ---- Typography ---- */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* ---- Border radius ---- */
    --radius:    12px;
    --radius-sm:  6px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* ---- Shadows ---- */
    --shadow:    0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 8px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.12);

    /* ---- Transitions ---- */
    --transition-fast:   0.15s ease;
    --transition-normal: 0.25s ease;

    /* ---- Spacing aliases ---- */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* Header */
[hidden] { display: none !important; }

.app-header {
    background: rgba(255,255,255,0.94);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    gap: var(--spacing-sm);
}

/* ---- Top Nav Center Zone ---- */
.header-center {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

.top-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-family);
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}
.top-nav-link:hover {
    background: var(--secondary-color);
    color: var(--text-primary);
}
.top-nav-link.active {
    background: linear-gradient(135deg, rgba(30,58,95,.1), rgba(99,102,241,.08));
    color: var(--primary-color);
    font-weight: 700;
}

/* Dropdown sub-menu */
.nav-dropdown {
    position: relative;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    z-index: 300;
}
.nav-dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-fast);
}
.dropdown-menu a:hover { background: var(--secondary-color); }
.dropdown-menu a.active-page {
    color: var(--primary-color);
    font-weight: 700;
    background: linear-gradient(135deg, rgba(30,58,95,.06), rgba(99,102,241,.05));
}
.dd-arrow { transition: transform 0.2s; display: inline-block; }
.nav-dropdown.open .dd-arrow { transform: rotate(180deg); }

/* Top nav right zone */
.top-nav-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.top-nav-logout:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
    z-index: 20;
    padding: 4px 8px;
    border-radius: 10px;
    transition: background var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
    user-select: none;
}
.logo-section:hover {
    background: rgba(99, 102, 241, 0.07);
    transform: translateY(-1px);
}
.logo-section:active {
    transform: translateY(0);
}

.logo-section .app-logo-img,
.logo-section .logo-icon,
.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo-section:hover .app-logo-img,
.logo-section:hover .logo-icon {
    transform: scale(1.08) rotate(-2deg);
}

/* .app-title is the non-heading form of the same lockup. A page whose own
   content already has an <h1> uses it so the document does not carry two. */
.logo-section h1,
.logo-section .app-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    white-space: nowrap;
    letter-spacing: -0.02em;
    margin: 0;
    transition: color var(--transition-fast);
}
.logo-section:hover h1,
.logo-section:hover .app-title {
    color: var(--accent-color, #4f46e5);
}
.logo-section { min-height: 44px; }

.header-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

/* --- Standardised header controls (nav.js v13) --- */
.hdr-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    min-height: 44px;
    transition: background 0.15s;
}

.hdr-profile-link:hover {
    background: var(--secondary-color);
}

.hdr-profile-link:hover .hdr-account-name {
    text-decoration: underline;
}

.hdr-account-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.2;
}

.hdr-account-level {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-color, #4f46e5);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.game-level-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color, #4f46e5);
    margin: 0.1rem 0 0.15rem;
    line-height: 1.25;
}

.hdr-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color, #6366f1));
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.hdr-account-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hdr-icon-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.hdr-icon-btn:hover {
    background: var(--secondary-color);
    color: var(--text-primary);
}

.hdr-icon-btn:active {
    background: var(--border-color);
}

#hdr-persona-container { position: relative; display: inline-flex; }
#hdr-persona-btn {
    width: auto;
    max-width: 155px;
    padding: 0 10px;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--secondary-color);
}
#hdr-persona-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 175px;
    max-height: calc(100dvh - 112px);
    overflow-y: auto;
    padding: 6px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 300;
}
#hdr-persona-menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 10px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
}
#hdr-persona-menu a:hover,
#hdr-persona-menu a:focus-visible,
#hdr-persona-menu [aria-checked="true"] { background: var(--secondary-color); }
.sidebar-preview-notice {
    margin: 8px 10px;
    padding: 8px;
    border: 1px dashed var(--primary-color);
    border-radius: 8px;
    font-size: 12px;
}
.sidebar-preview-notice button { min-height: 44px; }

/* --- */

.backend-status {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    background: var(--secondary-color);
    padding: 4px 10px;
    border-radius: 20px;
}

.budget-display {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Shell layout: sidebar + content */
.app-shell {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1 0 auto;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    overflow: hidden;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    transition: width var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 56px;
}

/* ---- Collapsible sidebar internals ---- */
.sidebar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 10px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    height: 52px;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-normal), max-width var(--transition-normal);
}
.sidebar.collapsed .sidebar-section-label { opacity: 0; max-width: 0; pointer-events: none; }

.sidebar-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-normal);
    flex-shrink: 0;
}
.sidebar-toggle-btn:hover { background: var(--secondary-color); color: var(--primary-color); }
.sidebar.collapsed .sidebar-toggle-btn { transform: rotate(180deg); }

.sidebar-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.sidebar-section { padding: 8px 0 4px; }

.sidebar-section-title {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-secondary, #475569);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 12px 4px 12px;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    box-sizing: border-box;
    width: 100%;
    line-height: 1.4;
    transition: opacity var(--transition-normal), height var(--transition-normal), padding var(--transition-normal);
}
.sidebar.collapsed .sidebar-section-title { opacity: 0; height: 0; padding: 0; overflow: hidden; pointer-events: none; }

.sidebar-goal-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.24);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-right: 4px;
    line-height: 1.25;
    vertical-align: 1px;
}

.sidebar-goal-title {
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    transition: background var(--transition-fast), color var(--transition-fast);
    position: relative;
}
.sidebar-nav-link:hover { background: var(--secondary-color); color: var(--text-primary); }
.sidebar-nav-link.active {
    background: linear-gradient(135deg, rgba(30,58,95,.1), rgba(99,102,241,.07));
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--primary-color);
}
.sidebar-nav-link svg { flex-shrink: 0; }
.sidebar-nav-link .link-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

/* Unread message badge */
.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: auto;
    background: var(--error-color, #e53e3e);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    line-height: 1;
}

/* Header notification bell */
.hdr-notifications-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.hdr-notifications-btn {
    position: relative;
}
.hdr-notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    margin-left: 0;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    pointer-events: none;
}
.hdr-notifications-panel {
    position: fixed;
    width: min(384px, calc(100vw - 16px));
    max-height: min(480px, calc(100vh - 80px));
    display: none;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    background: var(--surface, #fff);
    border: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 70%, transparent);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18), 0 3px 10px rgba(15, 23, 42, 0.06);
    z-index: var(--z-dropdown, 300);
    padding: 0;
    pointer-events: none;
}
.hdr-notifications-panel[popover] {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        overlay 0.18s ease allow-discrete,
        display 0.18s ease allow-discrete;
}
.hdr-notifications-panel[popover]:not(:popover-open),
.hdr-notifications-panel.hidden,
.hdr-notifications-panel:not(.open):not(:popover-open) {
    display: none !important;
    pointer-events: none !important;
}
.hdr-notifications-panel.open,
.hdr-notifications-panel[popover]:popover-open {
    display: flex !important;
    pointer-events: auto !important;
    opacity: 1;
    transform: translateY(0) scale(1);
}
@starting-style {
    .hdr-notifications-panel[popover]:popover-open {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
}
@media (prefers-reduced-motion: reduce) {
    .hdr-notifications-panel[popover],
    .hdr-notifications-panel[popover]:popover-open {
        transition: none;
        transform: none;
    }
}
.hdr-notifications-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.7rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 70%, transparent);
    color: var(--text-primary, #0f172a);
}
.hdr-notifications-panel-head strong {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.hdr-notifications-mark-all {
    border: none;
    background: transparent;
    color: var(--primary-color, #2563eb);
    border-radius: 6px;
    padding: 0.25rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.hdr-notifications-mark-all:hover:not(:disabled) { background: color-mix(in srgb, var(--primary-color, #2563eb) 10%, transparent); }
.hdr-notifications-mark-all:disabled { opacity: 0.4; cursor: default; }
.hdr-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.4rem;
    overflow-y: auto;
    flex: 1;
}
.hdr-notifications-list .empty-msg,
.hdr-notifications-list .error-msg {
    padding: 1.75rem 1rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
}
.hdr-notifications-view-all {
    display: block;
    padding: 0.75rem;
    border-top: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 70%, transparent);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-color, #2563eb);
    text-align: center;
    transition: background 0.15s ease;
}
.hdr-notifications-view-all:hover { background: var(--surface-alt, #f8fafc); }
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 0.6rem;
    background: transparent;
    cursor: pointer;
    outline: none;
    position: relative;
    transition: background var(--transition-fast, 0.15s ease);
}
.notification-item:hover,
.notification-item:focus-visible {
    background: var(--surface-alt, #f1f5f9);
}
.notif-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.notif-icon svg { width: 17px; height: 17px; }
.notif-icon--message { background: #eef2ff; color: #4f46e5; }
.notif-icon--application { background: #ecfdf5; color: #059669; }
.notif-icon--calendar { background: #fff7ed; color: #d97706; }
.notif-icon--alert { background: #f1f5f9; color: #475569; }
.notif-body { flex: 1; min-width: 0; }
.notif-title-row { display: flex; align-items: center; gap: 0.4rem; }
.notif-dot {
    flex-shrink: 0;
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
}
.notification-toast {
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    border-radius: 12px;
}
.notification-toast-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary, #94a3b8);
}
.notification-toast-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    line-height: 1.35;
}
.notification-toast-more {
    font-size: 0.74rem;
    color: var(--text-secondary, #64748b);
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.notification-item.unread {
    background: color-mix(in srgb, var(--primary-color, #2563eb) 6%, transparent);
}
.notification-item.unread:hover,
.notification-item.unread:focus-visible {
    background: color-mix(in srgb, var(--primary-color, #2563eb) 11%, transparent);
}
.notification-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notification-item.unread .notification-title { font-weight: 700; }
.notification-message {
    font-size: 0.78rem;
    color: var(--text-secondary, #64748b);
    margin-top: 0.12rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notification-meta {
    font-size: 0.7rem;
    color: var(--text-tertiary, #94a3b8);
    margin-top: 0.28rem;
}

.sidebar-nav-link .link-label {
    overflow: hidden;
    transition: opacity var(--transition-normal), max-width var(--transition-normal);
    max-width: 180px;
}
.sidebar.collapsed .link-label { opacity: 0; max-width: 0; }

/* Tooltip when collapsed */
.sidebar.collapsed .sidebar-nav-link::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 999;
}
.sidebar.collapsed .sidebar-nav-link:hover::after { opacity: 1; }

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 12px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm);
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--secondary-color);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(30,58,95,0.10) 0%, rgba(99,102,241,0.08) 100%);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary-color);
}

.nav-link .nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.65;
    flex-shrink: 0;
}

.nav-link.active .nav-icon {
    opacity: 1;
}

.content {
    flex: 1;
    min-width: 0;
    padding: var(--spacing-lg);
}

.jsk-legal-footer {
    width: 100%;
    box-sizing: border-box;
    margin-top: 1.5rem;
    padding: 0.75rem 0 0.25rem 0;
    font-size: 0.78rem;
    opacity: 0.72;
    text-align: center;
    line-height: 1.5;
    background: transparent;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    flex: 1;
    width: 100%;
    min-width: 0;
}

/* Error Bar */
.error-bar {
    background: var(--error-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    animation: slideDown 0.3s ease-out;
}

.saved-job-picker-status {
    margin-top: 0.5rem;
    font-size: 0.88rem;
    line-height: 1.45;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius, 8px);
    background: var(--surface-alt, #f8fafc);
    color: var(--text-secondary, #64748b);
    border-left: 3px solid var(--primary-color, #3f51b5);
}

.saved-job-picker-status.is-hidden {
    display: none;
}

.saved-job-picker-status.is-success {
    background: #ecfdf5;
    color: #065f46;
    border-left-color: #059669;
}

.saved-job-picker-status.is-warning {
    background: #fffbeb;
    color: #92400e;
    border-left-color: #d97706;
}

.saved-job-picker-status.is-error {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: #dc2626;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Section Cards */
.section-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s ease;
}

.section-card:hover {
    box-shadow: var(--shadow-md);
}

/* Modern rendering containment for long authenticated pages.
   Avoid above-the-fold cards; only offscreen follow-on panels opt in. */
.main-content > .section-card:nth-of-type(n+3),
.main-content > details.section-card:nth-of-type(n+3) {
    content-visibility: auto;
    contain-intrinsic-size: auto 420px;
}

.section-card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.section-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

/* CV Upload */
.cv-upload-area {
    margin-bottom: var(--spacing-lg);
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background-color);
    margin-bottom: var(--spacing-md);
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: rgba(30, 58, 95, 0.04);
}

.upload-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(30, 58, 95, 0.08);
    transform: scale(1.02);
}

.upload-icon {
    margin-bottom: var(--spacing-sm);
    opacity: 0.6;
}

.upload-formats {
    color: var(--text-secondary);
    font-size: 12px;
}

.cv-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.cv-status {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--background-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.cv-status label {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Form Controls */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-primary);
}

input:not([type="checkbox"]):not([type="radio"]), textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 14px;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="checkbox"], input[type="radio"] {
    width: auto;
    flex-shrink: 0;
    cursor: pointer;
}

/* Chat inputs: make wider/taller and resizable */
.chat-footer textarea.chat-input {
    min-height: 110px;
    resize: vertical;
}

/* Suggestions UI */
.chat-suggestions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.suggestion-chip {
    background: #fff8e1;
    border: 1px solid #f2e6b8;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
}
.suggestion-chip:hover { background: #fff0c2; }
.suggestion-chip .suggestion-meta { color: #795548; font-size: 11px; margin-left: 6px; }

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.10);
}

input:read-only, textarea:read-only {
    background-color: var(--background-color);
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 120px;
    justify-content: center;
    letter-spacing: 0.01em;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    min-width: 0;
    border-radius: 6px;
    line-height: 1.4;
    letter-spacing: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a5082 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(30, 58, 95, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1e3d66 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.30);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-color);
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color) 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.30);
}

#btn-stop-search[data-state="idle"],
#btn-stop-search-header[data-state="idle"] {
    opacity: 0.7;
    box-shadow: none;
}

#btn-stop-search[data-state="running"],
#btn-stop-search-header[data-state="running"] {
    opacity: 1;
    box-shadow: 0 6px 18px rgba(211, 47, 47, 0.35);
}

.button-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Job Details */
.job-input-section {
    margin-bottom: var(--spacing-lg);
}

.job-details-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-lg);
}

.job-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

/* Tables */
.table-container {
    overflow-x: auto;
    width: 100%;
    min-width: 0;
    margin: var(--spacing-md) 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
    font-size: 14px;
}

th, td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background: rgba(30, 58, 95, 0.03);
}

/* BUG-UI-004: constrain wide tables on the autonomous page so long URLs and
   column headers do not drive the table's minimum content width past the
   viewport.  overflow-wrap: anywhere allows URLs to break across lines; the
   max-width cap prevents any single column from dominating the table layout. */
#live-events-table td,
#top-matches-table td {
    overflow-wrap: anywhere;
    max-width: 220px;
}
/* URL cells in both tables - keep full URL visible but allow wrapping */
#live-events-table td:nth-child(7),
#top-matches-table td:nth-child(6) {
    word-break: break-all;
    max-width: 180px;
}

.clickable-cell {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}

.clickable-cell:hover {
    color: var(--primary-hover);
}

/* Match Analysis */
.match-analysis {
    margin: var(--spacing-lg) 0;
}

.match-info {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--background-color);
    border-radius: var(--radius);
}

.match-info span {
    font-weight: 600;
}

/* Generated Documents */
.generated-docs {
    margin: var(--spacing-lg) 0;
}

/* Tabs */
.tab-container {
    margin-top: var(--spacing-lg);
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
}

.tab-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: none;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.word-count, .char-count {
    color: var(--text-secondary);
    font-size: 12px;
    font-family: monospace;
}

/* CV Experience Editor */
.cv-experience-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.experience-block {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    background: var(--background-color);
}

.experience-header {
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.experience-bullets {
    width: 100%;
    min-height: 100px;
    font-family: var(--font-family);
    font-size: 14px;
    resize: vertical;
}

.identity-note {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: var(--spacing-xs);
}

/* Interview Editor */
.interview-editor {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.interview-question {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    background: var(--background-color);
}

.interview-question label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.interview-q {
    margin-bottom: var(--spacing-sm);
}

.interview-a {
    margin-bottom: var(--spacing-xs);
    resize: vertical;
    min-height: 80px;
}

/* Search Configuration */
.search-config {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.search-params {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.param-group {
    display: flex;
    flex-direction: column;
}

.param-group label {
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-secondary);
}

.param-group input, .param-group select {
    width: 100%;
}

.search-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* Targets */
.targets-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.targets-config {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.target-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.target-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.input-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.input-list input {
    flex: 1;
    min-width: 200px;
}

.input-list .input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

/* Results */
.results-subsection {
    margin-bottom: var(--spacing-xl);
}

.export-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

/* Scheduler */
.scheduler-config {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.cache-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.cache-controls span {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Budget */
.budget-controls {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.budget-input {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.budget-input label {
    font-weight: 600;
}

.budget-input input {
    width: 150px;
}

.budget-display {
    display: flex;
    gap: var(--spacing-lg);
    font-family: monospace;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

/* Thinking Overlay */
.thinking-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.thinking-content {
    background: var(--surface-color);
    padding: var(--spacing-xl);
    border-radius: var(--radius);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 300px;
}

.thinking-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#thinking-message,
.thinking-message {
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.thinking-content--enhanced {
    min-width: min(420px, 92vw);
    max-width: 480px;
    text-align: center;
}

.thinking-eta {
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 0.35rem;
    min-height: 1.2rem;
}

.thinking-stage {
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 0.15rem;
    min-height: 1.1rem;
}

.thinking-cancel-btn {
    margin-top: var(--spacing-md);
    min-width: 140px;
}

.motivation-agent-card {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--surface-alt, #f8fafc);
    border-left: 4px solid var(--primary-color, #3f51b5);
    border-radius: var(--radius, 8px);
    text-align: left;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.motivation-agent-card--visible {
    opacity: 1;
    transform: translateY(0);
}

.motivation-agent-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.5rem;
}

.motivation-agent-hook {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color, #3f51b5);
    margin-bottom: 0.35rem;
}

.motivation-agent-bridge {
    font-size: 0.88rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.75rem;
    line-height: 1.45;
}

.motivation-agent-quote {
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.5;
    color: var(--text-primary, #1e293b);
    border: none;
}

.motivation-agent-attribution {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-style: normal;
    color: var(--text-secondary, #94a3b8);
}

.thinking-cancel-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--surface-color, #fff);
    color: var(--text-primary, #1e293b);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius, 8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    font-size: 0.9rem;
    z-index: calc(var(--z-modal, 1000) + 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.thinking-cancel-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Dirty Indicator */
.dirty-indicator {
    color: var(--error-color);
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    margin-top: var(--spacing-sm);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Log Display */
.log-section {
    margin-top: var(--spacing-lg);
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
}

.log-display {
    background: #0f1724;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: var(--spacing-md);
    border-radius: var(--radius);
    height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.4;
    scrollbar-width: thin;
    scrollbar-color: #41526a #0b111d;
}

.log-display::-webkit-scrollbar {
    width: 6px;
}

.log-display::-webkit-scrollbar-track {
    background: #0b111d;
}

.log-display::-webkit-scrollbar-thumb {
    background: #41526a;
    border-radius: 3px;
}

.log-entry {
    padding: 2px 0;
    border-bottom: 1px solid rgba(65,82,106,0.2);
}
.log-entry:last-child { border-bottom: none; }
.log-success { color: #4ade80; }
.log-warning { color: #fbbf24; }
.log-error   { color: #f87171; }

/* ------------------------------------------------------------------ *
 * Sidebar toggle (hamburger) for mobile                               *
 * ------------------------------------------------------------------ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 6px;
    border-radius: var(--radius-sm);
    line-height: 0;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(30,58,95,0.08);
}

/* ------------------------------------------------------------------ *
 * Mobile Bottom Navigation Bar                                        *
 * Visible ONLY on small screens (<768px). Hidden on medium/large.     *
 * Z-index: 190 — below top nav (200) and its dropdowns (300),        *
 * but above sidebar (150). Spec layering: dropdown>topnav>mbn>sidebar *
 * ------------------------------------------------------------------ */
.mobile-bottom-nav {
    display: none; /* hidden by default; shown via @media rule below */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 190;
    height: 60px;
    background: rgba(255,255,255,0.97);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
}

.mbn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    padding: 6px 8px;
    border-radius: 10px;
    flex: 1;
    max-width: 72px;
    transition: color var(--transition-fast), background var(--transition-fast);
}
.mbn-item:hover { background: var(--secondary-color); }
.mbn-item.active { color: var(--primary-color); font-weight: 700; }
.mbn-item svg { display: block; }

/* ------------------------------------------------------------------ *
 * Responsive Breakpoints                                              *
 * ------------------------------------------------------------------ */

/* Medium screens (769px - 1023px): top nav condenses; sidebar auto-collapses to icon-only per spec */
@media (max-width: 1023px) and (min-width: 769px) {
    .header-center .top-nav-link { padding: 6px 8px; font-size: 13px; }
    /* Auto-collapse sidebar to icon-only regardless of user pref */
    .sidebar {
        width: 56px;
    }
    .sidebar .link-label {
        opacity: 0;
        max-width: 0;
        pointer-events: none;
    }
    .sidebar .sidebar-section-title {
        opacity: 0;
        height: 0;
        padding: 0;
        overflow: hidden;
    }
    .sidebar .sidebar-section-label {
        opacity: 0;
        max-width: 0;
        pointer-events: none;
    }
    .sidebar .sidebar-toggle-btn {
        transform: rotate(180deg);
    }
    /* Re-enable expand if user explicitly clicked (toggled to open state on medium) */
    .sidebar.medium-expanded {
        width: 240px;
    }
    .sidebar.medium-expanded .link-label {
        opacity: 1;
        max-width: 180px;
        pointer-events: auto;
    }
    .sidebar.medium-expanded .sidebar-section-title {
        opacity: 1;
        height: auto;
        padding: 8px 14px 5px;
        overflow: visible;
    }
    .sidebar.medium-expanded .sidebar-section-label {
        opacity: 1;
        max-width: 180px;
        pointer-events: auto;
    }
    .sidebar.medium-expanded .sidebar-toggle-btn {
        transform: none;
    }
}

/* Sign out in the sidebar drawer (nav.js). */
.sidebar-link--logout {
    color: var(--error-color, #e53e3e);
}
.sidebar-link--logout:hover {
    background: var(--error-bg, #fef2f2);
    color: var(--error-color, #e53e3e);
}
.sidebar-link--logout.btn-busy,
.hdr-icon-btn.btn-busy {
    opacity: 0.6;
    pointer-events: none;
}

/* Phone widths: drop the wordmark and the account name so the whole icon row
   fits on one line. The logo image and avatar still identify both. */
@media (max-width: 640px) {
    .logo-section h1,
    .logo-section .app-title {
        display: none;
    }
    .hdr-profile-link .hdr-account-stack,
    .hdr-profile-link .hdr-account-name,
    .hdr-profile-link .hdr-account-level {
        display: none;
    }
    .header-content {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }
}

/* Small screens (<768px): center nav hidden, bottom nav visible */
@media (max-width: 768px) {
    /* The header icon row was overflowing the viewport with `overflow:
       visible` and no page-level horizontal scroll, so "Go back" and "Log out"
       sat outside the screen with no way to reach them. Let the logo give up
       space first, then wrap as a guarantee that nothing lands off-screen. */
    .header-content {
        gap: var(--spacing-xs);
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        grid-template-rows: 44px 44px;
        position: relative;
        height: 104px;
        padding-top: 4px;
        padding-bottom: 4px;
    }
    .logo-section {
        grid-column: 2;
        grid-row: 1;
        justify-self: start;
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
    }
    .header-controls {
        grid-column: 1 / -1;
        grid-row: 2;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
    .header-center {
        display: none;
    }
    .logo-section h1,
    .logo-section .app-title {
        display: block;
        font-size: 16px;
    }
    .header-content:has(#hdr-persona-container) .logo-section h1,
    .header-content:has(#hdr-persona-container) .logo-section .app-title { display: none; }
    #hdr-persona-container { position: absolute; top: 4px; right: var(--spacing-sm); z-index: 1; }
    #header-controls .hdr-profile-link { width: 44px; padding: 0; justify-content: center; }
    .sidebar-toggle { grid-column: 1; grid-row: 1; }
    .content {
        padding: var(--spacing-md) var(--spacing-sm);
        padding-bottom: calc(60px + var(--spacing-md));
    }
    .main-content {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    .search-params {
        grid-template-columns: 1fr;
    }
    .job-meta {
        grid-template-columns: 1fr;
    }
    .search-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .tab-nav {
        overflow-x: auto;
        white-space: nowrap;
    }
    .tab-footer {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: stretch;
    }
    .button-group {
        justify-content: center;
    }
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    /* Mobile bottom nav: visible */
    .mobile-bottom-nav { display: flex; }
    /* Overlay sidebar on mobile */
    .app-shell > .sidebar,
    .page-layout > .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }
    .app-shell > .sidebar.open,
    .page-layout > .sidebar.open {
        transform: translateX(0);
        width: 240px !important;
    }
    .app-shell > .sidebar.collapsed {
        width: 240px !important;
        transform: translateX(-100%);
    }
    .app-shell > .sidebar.collapsed .link-label { opacity: 1; max-width: 180px; }
    .app-shell > .sidebar.collapsed .sidebar-section-title { opacity: 1; height: auto; padding: 4px 14px 6px; }
    .app-shell > .sidebar.collapsed .sidebar-section-label { opacity: 1; }
    .page-layout > .page-content {
        width: 100%;
    }
    /* Hide backend status text on very small screens to save space */
    .backend-status { display: none; }
    .budget-display { display: none; }

    /* Compress the top bar so its controls never overflow the viewport.
       Profile/Settings/Back/Home/Log out remain reachable via the hamburger
       Account section below — see .sidebar-account-section. */
    .header-controls { gap: 4px; min-width: 0; }
    #header-controls .hdr-account-stack { display: none; }   /* hide name/level text */
    #header-controls #hdr-back-btn,
    #header-controls #hdr-home-btn { display: none; }
    #header-controls #hdr-settings-btn,
    #header-controls #hdr-logout-btn { display: inline-flex; }
    /* Account section is also available in the hamburger sidebar on mobile. */
    .sidebar-account-section { display: block; }
}

/* Account section is a mobile-only affordance; the same actions live in the
   top bar on wider screens, so hide it there to avoid duplication. */
.sidebar-account-section { display: none; }
@media (max-width: 768px) {
    .sidebar-account-section { display: block; }
}

@media (max-width: 480px) {
    .section-card {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }

    .cv-actions {
        flex-direction: column;
    }

    .budget-input {
        flex-direction: column;
        align-items: stretch;
    }

    .budget-display {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}

/* ------------------------------------------------------------------ *
 * Dashboard page styles                                               *
 * ------------------------------------------------------------------ */

.dashboard-hero {
    background: linear-gradient(135deg, #0f2942 0%, #1e3a5f 40%, #2a5082 70%, #3b6da8 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 40px var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.dashboard-hero h2 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    color: #fff;
    letter-spacing: -0.02em;
    position: relative;
}

.dashboard-hero p {
    font-size: 16px;
    opacity: 0.80;
    margin-bottom: var(--spacing-lg);
    max-width: 540px;
    line-height: 1.6;
    position: relative;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.btn-hero {
    background: #fff;
    color: var(--primary-color);
    border: none;
    padding: 12px var(--spacing-lg);
    border-radius: 10px;
    font-weight: 700;
    font-family: var(--font-family);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.20);
}

.btn-hero-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.7);
}

.btn-hero-outline:hover {
    background: rgba(255,255,255,0.12);
    opacity: 1;
}

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-lg) var(--spacing-md);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Feature cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.feature-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-lg) var(--spacing-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    transition: all 0.25s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: rgba(30, 58, 95, 0.25);
}

.feature-card .fc-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, rgba(30,58,95,0.08) 0%, rgba(99,102,241,0.06) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.feature-card:hover .fc-icon {
    transform: scale(1.08);
}

.feature-card .fc-icon svg {
    width: 22px;
    height: 22px;
    color: var(--primary-color);
}

.feature-card .fc-title {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.feature-card .fc-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Activity feed */
.activity-feed {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    font-size: 14px;
    padding: var(--spacing-md) var(--spacing-sm);
    background: var(--background-color);
    border-radius: 10px;
    transition: background 0.15s ease;
}

.activity-item:hover {
    background: var(--secondary-color);
}

.activity-item .ai-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-item .ai-detail {
    flex: 1;
}

.activity-item .ai-ts {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.activity-empty {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
    padding: var(--spacing-md);
    text-align: center;
}

/* ------------------------------------------------------------------ *
 * Placeholder (coming soon) page                                      *
 * ------------------------------------------------------------------ */
.placeholder-hero {
    text-align: center;
    padding: 80px var(--spacing-lg);
}

.placeholder-hero h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.placeholder-hero p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.placeholder-hero .btn {
    text-decoration: none;
}

/* ------------------------------------------------------------------ *
 * Dark mode overrides                                                 *
 * Semantic token overrides (bg, surface, border, text, shadow) are   *
 * defined in tokens.css [data-theme="dark"] block.                   *
 * Only component-specific dark rules live here.                      *
 * ------------------------------------------------------------------ */

[data-theme="dark"] .app-header {
    background: var(--color-header-bg);
    border-bottom-color: var(--color-border);
}

[data-theme="dark"] .dashboard-hero {
    background: linear-gradient(135deg, #0a1628 0%, #162a45 40%, #1e3a5f 70%, #244c7a 100%);
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, var(--color-navy-600) 0%, var(--color-navy-500) 100%);
}

[data-theme="dark"] .feature-card .fc-icon {
    background: linear-gradient(135deg, rgba(42,80,130,0.2) 0%, rgba(99,102,241,0.12) 100%);
}

/* ------------------------------------------------------------------ *
 * Component classes                                                   *
 * ------------------------------------------------------------------ */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(30,58,95,0.08);
    color: var(--primary-color);
}

.badge.success { background: rgba(46,125,50,0.12); color: var(--success-color); }
.badge.warning { background: rgba(237,108,2,0.12); color: var(--warning-color); }
.badge.error   { background: rgba(211,47,47,0.12); color: var(--error-color); }

.input-field {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.10);
}

.input-field:user-invalid,
.form-control:user-invalid,
textarea:user-invalid,
select:user-invalid {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(211,47,47,0.10);
}

.input-field:user-valid,
.form-control:user-valid,
textarea:user-valid,
select:user-valid {
    border-color: rgba(46,125,50,0.55);
}

button:disabled,
.btn:disabled,
.disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.app-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex: 0 0 auto;
}

.tier-ladder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.tier-ladder-step {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface-color);
    padding: 0.85rem;
    min-height: 84px;
}

.tier-ladder-step.reached {
    border-color: rgba(46,125,50,0.5);
    background: rgba(46,125,50,0.06);
}

.tier-ladder-step.current {
    border-color: var(--accent-color, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.14);
}

.tier-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--border-color);
    margin-bottom: 0.5rem;
}

.tier-ladder-step.reached .tier-dot,
.tier-ladder-step.current .tier-dot {
    background: var(--accent-color, #4f46e5);
}

.tier-step-name {
    font-weight: 700;
    color: var(--text-primary);
}

.tier-step-points {
    margin-top: 0.25rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.progress-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
    transition: width var(--transition-normal);
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-box {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
    max-width: 540px;
    width: 100%;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    z-index: 300;
}

.toast {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-md);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    min-width: 280px;
    font-size: 14px;
    animation: slideRight 0.25s ease;
}

/* === Complex element styles extracted from inline HTML (BUG-UI-001 CSP fix) === */

/* ats-scanner.html */
#ats-results-content { display: flex; flex-direction: column; gap: 1.25rem; }

/* dashboard.html */
#streak-tile {
    background: linear-gradient(90deg, var(--accent-color,#4f46e5) 0%, #7c3aed 100%);
    color: #fff; border-radius: 12px; padding: 0.6rem 1.2rem;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.25rem;
}
#streak-reset-note {
    background: #fefce8; border: 1px solid #fde68a; border-radius: 8px;
    padding: 0.5rem 0.9rem; font-size: 0.87rem; color: #92400e; margin-bottom: 0.25rem;
}
#motivation-error { color: #dc2626; font-size: 0.9rem; }
#motivation-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
#dash-map-panel { margin-top: 0.75rem; }
#welcome-back-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    border: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
}
#welcome-back-overlay:not([open]) { display: none; }

/* hero_thread.html, session_detail.html */
#page-notfound, #page-denied { text-align: center; padding: 3rem; }

/* profile.html */
#avatar-preview-img { width: 64px; height: 64px; object-fit: cover; }

/* rewards.html */
#tier-demotion-banner {
    background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px;
    padding: 0.6rem 0.9rem; margin-bottom: 0.75rem; font-size: 0.87rem; color: #92400e;
}
#rw-challenges-empty, #ledger-empty, #lb-empty, #hl-empty {
    color: var(--text-secondary,#64748b); font-style: italic;
}
#badges-grid, #hero-badges-grid, #enterprise-badges-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem;
}

@keyframes slideRight {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.toast.success { border-left-color: var(--success-color); }
.toast.error   { border-left-color: var(--error-color); }
.toast.warning { border-left-color: var(--warning-color); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(30,58,95,0.20);
}

/* ------------------------------------------------------------------ *
 * Layout helpers                                                      *
 * ------------------------------------------------------------------ */
.page-layout {
    display: flex;
    min-height: 100vh;
}

.page-layout > .sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.page-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-area {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* nav-inner: wraps the nav items inside the aside */
.nav-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.nav-brand {
    cursor: default;
    user-select: none;
    border-radius: 10px;
    transition: background 0.15s ease;
}
.nav-brand:hover {
    background: rgba(30, 58, 95, 0.06);
}
[data-theme="dark"] .nav-brand:hover {
    background: rgba(255, 255, 255, 0.06);
}

.nav-section-bottom {
    margin-top: auto;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

/* ------------------------------------------------------------------ *
 * CSP-safe utility classes                                            *
 * Replaces all inline style="" attributes and element.style.cssText   *
 * writes that would violate the Content-Security-Policy style-src     *
 * directive.                                                          *
 * ------------------------------------------------------------------ */

/* Generic JS-controlled hide/show (replaces style="display:none") */
.js-hidden { display: none !important; }

/* App header logo image */
.app-logo-img {
    height: 34px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

/* Logout button busy / disabled state */
.btn-busy { opacity: 0.5; }

/* Sidebar unclaimed badge dot */
.badge-unclaimed-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f97316;
    margin-left: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Gamification micro-bar (injected by nav.js) */
#gam-micro-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.3rem 1rem;
    background: var(--surface-alt, #f8fafc);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    flex-wrap: wrap;
}

.gam-micro-bar-link {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--accent-color, #4f46e5);
    text-decoration: none;
    white-space: nowrap;
}

/* Micro chip spans (streak / credits / HP) */
.gam-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

/* Floating delta overlay (e.g. "+5 Credits") */
.gam-delta-overlay {
    position: fixed;
    font-size: 0.72rem;
    font-weight: 700;
    color: #4f46e5;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 0.1rem 0.35rem;
    pointer-events: none;
    z-index: 99999;
    transition: opacity 1.2s ease-out 0.3s, transform 1.2s ease-out 0.3s;
    opacity: 1;
}

@media (max-width: 480px) {
    #gam-micro-bar { display: none; }
}

@keyframes microBarFlame {
    0%   { transform: scale(1);    filter: brightness(1);   }
    40%  { transform: scale(1.25); filter: brightness(1.4); }
    80%  { transform: scale(1.1);  filter: brightness(1.2); }
    100% { transform: scale(1);    filter: brightness(1);   }
}

/* Toast / slide-in notification (used by showMessage in script.js) */
.app-toast-msg {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: var(--shadow);
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* Stop-search header button */
.btn-stop-search-header {
    margin-right: 12px;
    padding: 8px 16px;
    font-weight: bold;
}

/* Cover-letters / regenerate button icon alignment */
.btn-icon-mid { vertical-align: middle; }

/* Inline layout helpers used across pages */
.d-flex        { display: flex; }
.d-flex-col    { display: flex; flex-direction: column; }
.d-inline-flex { display: inline-flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm  { gap: 0.5rem; }
.gap-md  { gap: var(--spacing-md, 1rem); }
.gap-lg  { gap: 1.5rem; }
.flex-wrap     { flex-wrap: wrap; }
.ml-auto       { margin-left: auto; }
.mb-0  { margin: 0; }
.mb-sm { margin-bottom: var(--spacing-sm, 0.5rem); }
.mb-md { margin-bottom: var(--spacing-md, 1rem); }
.txt-secondary { color: var(--text-secondary, #64748b); }
.txt-sm        { font-size: 0.88rem; }
.txt-xs        { font-size: 0.78rem; }
.txt-bold      { font-weight: 700; }

/* BUG-UI-001 additional utility classes */
.m-0           { margin: 0; }
.section-mb    { margin: 0 0 0.75rem; }
.muted-italic  { color: var(--text-secondary,#64748b); font-style: italic; }
.color-error   { color: var(--error-color, red); }
.center-state  { text-align: center; padding: 2rem; }
.v-mid         { vertical-align: middle; }
.v-mid-mr      { vertical-align: middle; margin-right: 4px; }
.w-full        { width: 100%; }
.flex-1        { flex: 1; }
.txt-600       { font-weight: 600; }
.fs-08         { font-size: 0.8rem; }
.th-r          { text-align: right; padding: 0.4rem 0; font-weight: 600; }
.th-l          { text-align: left; padding: 0.4rem 0; font-weight: 600; }
.grid-2col     { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); }

/* Additional utility classes for common patterns */
.text-secondary-mb  { color: var(--text-secondary); margin-bottom: 1rem; }
.text-secondary-mb05 { color: var(--text-secondary); margin: 0 0 0.5rem; }
.text-secondary-mb125 { color: var(--text-secondary); margin: 0 0 1.25rem; }
.text-secondary-col { color: var(--text-secondary); }
.mt-3q         { margin-top: 0.75rem; }
.fs-085        { font-size: 0.85rem; }
.fs-084        { font-size: 0.84rem; }
.accent-color  { color: var(--accent-color,#4f46e5); }
/* rewards.html credit pack card component classes */
.credit-pack-icon  { font-size: 1.6rem; margin-bottom: 0.3rem; }
.credit-pack-name  { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.2rem; }
.credit-pack-desc  { font-size: 0.82rem; color: var(--text-secondary,#64748b); margin-bottom: 0.6rem; }
.credit-pack-price { font-weight: 700; color: var(--accent-color,#4f46e5); font-size: 1.1rem; margin-bottom: 0.75rem; }
.credit-pack-btn   { width: 100%; font-size: 0.82rem; }
.badge-pill-sm     { font-size: 12px; padding: 4px 10px; }

/* Third-pass utility classes */
.center-state-lg   { text-align: center; padding: 3rem; }
.mb-1              { margin-bottom: 1rem; }
.txt-600           { font-weight: 600; }
.mt-md             { margin-top: var(--spacing-md); }
.d-inline-block    { display: inline-block; }
.p-0               { padding: 0; }
.p-12              { padding: 12px; }
.row-divider       { border-bottom: 2px solid var(--border-color,#e2e8f0); }
.color-green       { color: #16a34a; }
.d-flex-wrap-sm    { display: flex; gap: var(--spacing-sm); flex-wrap: wrap; }
.txt-meta          { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.fs-082-mt         { font-size: 0.82rem; margin-top: 0.3rem; }
.txt-sm-muted      { font-size: 0.85rem; color: var(--text-secondary,#64748b); }

/* login.html */
#success-msg { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; border-radius: var(--radius-sm,4px); padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.auth-footer-p { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.auth-footer-p a, .auth-footer-link { color: var(--primary-color); font-weight: 600; text-decoration: none; }

/* settings.html */
.settings-page-title { font-size: 1.5rem; font-weight: 800; color: var(--primary-color,#1e3a5f); margin-bottom: 1.25rem; letter-spacing: -0.02em; }
.settings-section-desc { font-size: 0.85rem; color: var(--text-secondary,#64748b); margin-bottom: 0.75rem; }
#reset-confirm-input { width: 100%; margin-bottom: 0.75rem; }
.flex-end-gap { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* autonomous.html */
#btn-stop-search-header { margin-right: 12px; padding: 8px 16px; font-weight: bold; }

/* calendar.html */
.loading-msg { grid-column: 1 / -1; padding: 2rem; }

/* manage_cv.html */
#cv-stream { height: 160px; overflow: auto; }

/* profile.html */
#prof-avatar-img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: var(--shadow-md); }
#avatar-preview-wrap { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--primary-color); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: #fff; flex-shrink: 0; }
#ef-avatar { display: block; margin-bottom: 8px; font-size: 13px; }
#btn-upload-avatar { padding: 6px 16px; font-size: 13px; }
#avatar-feedback { font-size: 13px; margin-top: 6px; }
.avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }

/* hero_thread.html */
.content--no-pad { padding: 0; overflow: hidden; }
.back-link-primary { color: var(--primary-color); text-decoration: none; font-weight: 700; }

/* auto_apply.html */
#credit-gate-panel { background: var(--surface-alt,#f8fafc); border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.88rem; }
#cg-earn-hint { margin-top: 0.4rem; }

/* cover_letters.html */
#cl-edit-hint { font-size: 12px; color: var(--text-secondary); }

/* dashboard.html */
#motivation-framework-badge { font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--accent-color,#4f46e5); color: #fff; }
#daily-challenges-section { border-left: 4px solid #f59e0b; }
#wb-credits { background: #f0fdf4; border-radius: 8px; padding: 0.5rem 1rem; margin-bottom: 1.25rem; font-weight: 600; color: #16a34a; }
#wb-title { margin: 0 0 0.5rem; font-size: 1.3rem; }
#wb-body { color: var(--text-secondary,#64748b); margin: 0 0 1rem; font-size: 0.95rem; }

/* db_viewer.html */
#modal-err { font-size: 0.8rem; color: #b91c1c; margin-top: 0.25rem; }

/* rewards.html - elements with display:none embedded in multi-style */
#rw-challenges-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
#ledger-list { list-style: none; padding: 0; margin: 0; font-size: 0.87rem; }
#lb-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
#pack-msg { margin-top: 0.75rem; font-size: 0.87rem; }
.w-full        { width: 100%; }

/* ---- map_component.js popup styles ---- */
.map-popup { min-width: 240px; max-width: 320px; font-family: inherit; line-height: 1.5; padding: 4px 0; }
.map-popup__title { display: block; font-size: 1rem; font-weight: 700; margin-bottom: 4px; color: #1e293b; }
.map-popup__company { color: #475569; margin-bottom: 6px; font-size: 0.85rem; }
.map-popup__grade { font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 10px; display: inline-block; margin-bottom: 5px; color: white; letter-spacing: 0.02em; }
.map-popup__grade--green { background: #16a34a; }
.map-popup__grade--amber { background: #d97706; }
.map-popup__grade--blue { background: #2563eb; }
.map-popup__grade--grey { background: #6b7280; }
.map-popup__grade--neutral { background: #4f46e5; }
.map-popup__grade-label { font-size: 0.73rem; color: #475569; margin-bottom: 5px; }
.map-popup__distance { font-size: 0.82rem; color: #1e293b; margin-bottom: 5px; font-weight: 600; }
.map-popup__distance--hint { font-size: 0.75rem; color: #64748b; font-style: italic; font-weight: 400; }
.map-popup__distance-band { font-size: 0.8rem; color: #334155; margin-bottom: 4px; }
.map-popup__travel { background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 6px; padding: 8px 10px; margin: 6px 0; font-size: 0.77rem; }
.map-popup__travel-head { font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.map-popup__travel-content { color: #475569; }
.map-popup__travel-row { display: flex; justify-content: space-between; color: #475569; padding: 2px 0; }
.map-popup__travel-row-val { font-weight: 600; color: #1e293b; }
.map-popup__travel-flight { color: #475569; font-style: italic; padding-top: 2px; }
.map-popup__candidate-count { font-size: 0.8rem; color: #4b5563; margin-bottom: 6px; }
.map-popup__salary { font-size: 0.85rem; color: #1e293b; margin-bottom: 6px; font-weight: 600; background: #f0fdf4; border: 1px solid #bbf7d0; padding: 3px 8px; border-radius: 4px; display: inline-block; }
.map-popup__btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 8px; border-top: 1px solid #e2e8f0; }
.map-popup__btn { display: inline-flex; align-items: center; justify-content: center; padding: 7px 16px; border-radius: 6px; color: white; font-size: 0.82rem; font-weight: 600; text-decoration: none; line-height: 1.3; border: none; cursor: pointer; transition: opacity 0.15s, transform 0.1s; min-width: 70px; text-align: center; }
.map-popup__btn:hover { opacity: 0.88; transform: translateY(-1px); }
.map-popup__btn--apply,
.leaflet-popup-content a.map-popup__btn--apply,
.leaflet-popup-content a.map-popup__btn { 
    background: #2563eb !important; 
    color: #ffffff !important; 
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3) !important;
    text-decoration: none !important;
    font-weight: 700 !important;
}
.map-popup__btn--apply:hover,
.leaflet-popup-content a.map-popup__btn--apply:hover,
.leaflet-popup-content a.map-popup__btn:hover {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}
.map-popup__btn--save { background: #475569; }
.map-popup__btn--save:hover { background: #334155; }
.map-popup__btn--candidates { background: #0f766e; }
.map-popup__cluster-badge { background: #4f46e5; color: white; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; margin: 0 auto 6px; }
.map-popup__cluster-area { text-align: center; }
.map-popup__cluster-note { font-size: 0.75rem; color: #6b7280; text-align: center; margin-top: 4px; }

/* ---- map icon (makeIcon) styles ---- */
.map-icon-wrapper { position: relative; }
.map-icon-pin { border: 2px solid white; border-radius: 50% 50% 50% 0; width: 32px; height: 32px; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,0.35); }
.map-icon-pin--green { background: #16a34a; }
.map-icon-pin--amber { background: #d97706; }
.map-icon-pin--blue { background: #2563eb; }
.map-icon-pin--grey { background: #6b7280; }
.map-icon-pin--neutral { background: #4f46e5; }
.map-icon-pin-inner { transform: rotate(45deg); line-height: 0; }
.mc-pulse-ring { position: absolute; top: 0; left: 0; width: 32px; height: 32px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid; animation: mc-pulse 1.6s ease-out infinite; }
.mc-pulse-ring--green { border-color: #16a34a; }
.mc-pulse-ring--amber { border-color: #d97706; }
.mc-pulse-ring--blue { border-color: #2563eb; }
.mc-pulse-ring--grey { border-color: #6b7280; }
.mc-pulse-ring--neutral { border-color: #4f46e5; }
@keyframes mc-pulse { 0% { transform: scale(1); opacity: 0.7; } 70% { transform: scale(1.8); opacity: 0; } 100% { transform: scale(1.8); opacity: 0; } }

/* =====================================================================
 * Auto-generated utility classes for CSP compliance (BUG-UI-001)
 * These replace inline style="" attributes in HTML files.
 * ===================================================================== */
.il-w-0pct { width: 0% }
.il-w-20pct { width: 20% }
.il-w-36px { width: 36px }
.il-flex-sb-center-mb { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--spacing-md); }
.il-flex-sb-wrap-gap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.il-flex-center-1rem-wrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.il-flex-center-15rem-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.il-flex-col-gap-sm { display: flex; flex-direction: column; gap: 0.5rem; }
.il-flex-gap-04 { display: flex; gap: 0.4rem; }
.il-flex-gap-sm { display: flex; gap: 0.5rem; }
.il-flex-gap-06-wrap { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.25rem; }
.il-flex-gap-1rem-wrap-mb { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.il-flex-sb-center-075-wrap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.il-flex-gap-spacing-sm { display: flex; gap: var(--spacing-sm); }
.il-flex-center-8px-ptr { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.il-flex-center-md { display: flex; align-items: center; gap: var(--spacing-md); }
.il-flex-sb-center-mb-wrap { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--spacing-md); flex-wrap: wrap; gap: var(--spacing-sm); }
.il-grid-auto-180 { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.il-tier-bar-track { background: var(--border-color, #e2e8f0); border-radius: 999px; height: 10px; overflow: hidden; }
.il-text-primary-lg { font-size: 18px; font-weight: 700; color: var(--primary-color, #1e3a5f); }
.il-text-sec-norm { font-weight: 400; color: var(--text-secondary, #64748b); }
.il-text-sec-label-01 { font-size: 0.78rem; color: var(--text-secondary, #64748b); font-weight: 600; margin-bottom: 0.1rem; }
.il-text-sec-label-025 { font-size: 0.78rem; color: var(--text-secondary, #64748b); font-weight: 600; margin-bottom: 0.25rem; }
.il-field-label-12px { font-size: 12px; color: var(--text-secondary); font-weight: 600; display: block; margin-bottom: 6px; }
.il-text-sec-08 { font-size: 0.8rem; color: var(--text-secondary, #64748b); }
.il-text-sec-075 { font-size: 0.75rem; color: var(--text-secondary, #64748b); }
.il-text-sec-085-mb { font-size: 0.85rem; color: var(--text-secondary, #64748b); margin-bottom: 0.75rem; }
.il-text-sec-088-mb075 { font-size: 0.88rem; color: var(--text-secondary, #64748b); margin: 0 0 0.75rem; }
.il-text-sec-088-mb1 { font-size: 0.88rem; color: var(--text-secondary, #64748b); margin: 0 0 1rem; }
.il-text-090-bold { font-size: 0.9rem; font-weight: 600; }
.il-h4-sm-bold { font-size: 0.85rem; font-weight: 700; margin: 0 0 0.5rem; }
.il-flex1-min280 { flex: 1; min-width: 280px; }
.il-flex1-minw0 { flex: 1; min-width: 0; }
.il-pos-rel { position: relative; }
.il-mb-125 { margin-bottom: 1.25rem; }
.il-mb-04 { margin-bottom: 0.4rem; }
.il-m-025 { margin: 0 0 0.25rem; }
.il-m0-sec-090 { margin: 0; color: var(--text-secondary, #64748b); font-size: 0.9rem; }
.il-min-h-120 { min-height: 120px; }
.il-color-error { color: #dc2626; }
.il-color-sec { color: var(--text-secondary, #64748b); }
.il-input-full { width: 100%; padding: 0.5rem 0.75rem; font-size: 0.88rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; margin: 0; box-sizing: border-box; }
.il-icon-48-border { width: 48px; height: 48px; color: var(--border-color, #e2e8f0); margin-bottom: 0.75rem; }
.il-tab-card { text-align: center; border: 2px solid var(--border-color, #e2e8f0); padding: 1.25rem 0.75rem; cursor: pointer; transition: border-color 0.2s; }
.il-suggestions-list { padding-left: 1.2rem; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }

/* ----- Second-pass inline style utility classes (BUG-UI-001 cont.) ----- */
.il-bg-cyan600 { background: #0891b2 }
.il-bg-green600 { background: #16a34a }
.il-bg-blue600 { background: #2563eb }
.il-bg-violet600 { background: #7c3aed }
.il-bg-orange600 { background: #e67300 }
.il-bg-slate50-text { background: #f1f5f9; color: var(--text-primary, #0f172a); }
.il-modal-card { background: #fff; border-radius: 16px; padding: 2rem; max-width: 400px; width: 90%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.il-motivation-box { background: var(--surface-alt, #f8fafc); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 0.5rem; }
.il-accent-border-left { border-left: 4px solid var(--accent-color, #4f46e5); }
.il-color-blue700 { color: #0369a1; }
.il-color-emerald600 { color: #059669; }
.il-color-green600-bold { color: #16a34a; font-weight: 600; }
.il-color-gray500-bold { color: #6b7280; font-weight: 600; }
.il-color-amber600-bold { color: #d97706; font-weight: 600; }
.il-link-white-082 { color: #fff; text-decoration: underline; font-size: 0.82rem; }
.il-color-accent-bold { color: var(--accent-color, #4f46e5); font-weight: 600; }
.il-summary-095 { cursor: pointer; font-weight: 600; font-size: 0.95rem; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.il-summary-1rem { cursor: pointer; font-weight: 600; font-size: 1rem; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.il-img-center-muted { display: block; margin: 0 auto var(--spacing-md); opacity: 0.3; }
.il-flex-center-10px { display: flex; align-items: center; gap: 10px; }
.il-flex-center-12px { display: flex; align-items: center; gap: 12px; }
.il-flex-gap-sm-mt-md-wrap { display: flex; gap: var(--spacing-sm); margin-top: var(--spacing-md); flex-wrap: wrap; }
.il-flex-sb-12px-mb4 { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.il-flex-center-sm-ptr { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.il-flex-sb-wrap-05 { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.il-flex-sb-mb075 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.il-flex-sb-mt035-wrap { display: flex; align-items: center; justify-content: space-between; margin-top: 0.35rem; flex-wrap: wrap; gap: 0.5rem; }
.il-flex-sb-mt05-wrap { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; flex-wrap: wrap; gap: 0.5rem; }
.il-flex-tags-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.il-flex-gap04-mt05-wrap { display: flex; gap: 0.4rem; margin-top: 0.5rem; flex-wrap: wrap; }
.il-flex-gap05-mt035-wrap { display: flex; gap: 0.5rem; margin-top: 0.35rem; flex-wrap: wrap; }
.il-flex-gap075-wrap { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.il-flex-gap15-wrap-center { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.il-flex2 { flex: 2; }
.il-micro-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary, #64748b); margin-bottom: 0.25rem; }
.il-text-sec-078-mt03 { font-size: 0.78rem; color: var(--text-secondary, #64748b); margin-top: 0.3rem; }
.il-font-082 { font-size: 0.82rem; }
.il-badge-082 { font-size: 0.82rem; padding: 0.2rem 0.6rem; border-radius: 8px; }
.il-link-accent-085-mb1 { font-size: 0.85rem; color: #4f46e5; font-weight: 600; margin-bottom: 1rem; }
.il-text-sec-085-mb075 { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.il-text-italic-085 { font-size: 0.85rem; color: var(--text-secondary, #64748b); font-style: italic; margin-bottom: 0.75rem; }
.il-text-sec-08-mt04 { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.4rem; }
.il-text-sec-08-mb05 { font-size: 0.8rem; color: var(--text-secondary, #64748b); margin: 0 0 0.5rem 0; }
.il-btn-accent-outline-active { font-size: 0.8rem; padding: 0.2rem 0.65rem; border: 1px solid var(--accent-color, #4f46e5); border-radius: 6px; background: transparent; color: var(--accent-color, #4f46e5); cursor: pointer; font-weight: 700; text-decoration: underline; }
.il-btn-outline-inactive { font-size: 0.8rem; padding: 0.2rem 0.65rem; border: 1px solid var(--border-color, #e2e8f0); border-radius: 6px; background: transparent; color: var(--text-secondary, #64748b); cursor: pointer; font-weight: 400; text-decoration: none; }
.il-text-sec-09-mb1 { font-size: 0.9rem; color: var(--text-secondary, #64748b); margin-bottom: 1rem; }
.il-headline-105 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.5rem; }
.il-badge-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.4rem; }
.il-font-14rem { font-size: 1.4rem; }
.il-flash-title { font-size: 1.8rem; font-weight: 800; }
.il-font-12px { font-size: 12px; }
.il-text-12px-sec-mt { font-size: 12px; color: var(--text-secondary); margin-top: var(--spacing-sm); }
.il-font-12px-sec { font-size: 12px; color: var(--text-secondary); }
.il-font-12px-sec-mb12 { font-size: 12px; color: var(--text-secondary); margin: 0 0 12px; }
.il-font-13px { font-size: 13px; }
.il-font-13px-sec-pad { font-size: 13px; color: var(--text-secondary); padding: var(--spacing-sm); }
.il-font-14px-bold-mb { font-size: 14px; font-weight: 700; margin-bottom: var(--spacing-sm); }
.il-flash-sub { font-size: 1rem; opacity: 0.85; }
.il-emoji-25rem { font-size: 2.5rem; margin-bottom: 0.5rem; }
.il-emoji-35rem { font-size: 3.5rem; margin-bottom: 0.5rem; }
.il-emoji-4rem { font-size: 4rem; }
.il-text-sec-085-norm { font-weight: 400; font-size: 0.85rem; color: var(--text-secondary, #64748b); }
.il-text-sec-09-norm { font-weight: 400; font-size: 0.9rem; color: var(--text-secondary, #64748b); }
.il-label-block { font-weight: 600; display: block; margin-bottom: 0.4rem; }
.il-bold-105 { font-weight: 700; font-size: 1.05rem; }
.il-tier-name { font-weight: 700; font-size: 1.15rem; text-transform: capitalize; color: var(--accent-color, #4f46e5); }
.il-grid-full-span { grid-column: 1 / -1; padding: 2rem; }
.il-tier-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-color, #4f46e5), #7c3aed); border-radius: 999px; width: 0%; transition: width 0.6s ease; }
.il-map-350 { height: 350px; width: 100%; border-radius: 10px; border: 1px solid var(--border, #e2e8f0); }
.il-map-400 { height: 400px; border-radius: 10px; border: 1px solid var(--border-color, #e2e8f0); }
.il-map-500 { height: 500px; border-radius: 10px; border: 1px solid var(--border, #e2e8f0); }
.il-list-col-06 { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.il-list-col-087 { list-style: none; padding: 0; margin: 0; font-size: 0.87rem; display: flex; flex-direction: column; gap: 0.5rem; }
.il-mb-spacing-md { margin-bottom: var(--spacing-md); }
.il-mb-spacing-md2 { margin-bottom: var(--spacing-md); }
.il-mb-spacing-sm { margin-bottom: var(--spacing-sm); }
.il-ent-accent-label { margin-bottom: 0.5rem; font-weight: 600; font-size: 0.95rem; color: var(--accent-color, #4f46e5); }
.il-mb-8px { margin-bottom: 8px; }
.il-tier-badge-pill { margin-left: auto; background: rgba(255,255,255,0.2); border-radius: 999px; padding: 0.2rem 0.8rem; font-size: 0.8rem; font-weight: 600; }
.il-mt-spacing-md { margin-top: var(--spacing-md); }
.il-helper-text { margin-top: 0.35rem; font-size: 0.78rem; color: var(--text-secondary, #64748b); padding-left: 0.1rem; }
.il-text-085-mt05 { margin-top: 0.5rem; font-size: 0.85rem; }
.il-info-box { margin-top: 0.5rem; padding: 0.5rem 0.75rem; background: #f8fafc; border-radius: 8px; font-size: 0.82rem; color: var(--text-secondary, #64748b); border: 1px solid var(--border-color, #e2e8f0); }
.il-mt-15rem { margin-top: 1.5rem; }
.il-mt-1rem { margin-top: 1rem; }
.il-mt-8px { margin-top: 8px; }
.il-divider-section { margin-top: var(--spacing-md); border-top: 1px solid var(--border-color); padding-top: var(--spacing-md); }
.il-m2-0-14-sec { margin: 2px 0 14px; color: var(--text-secondary); }
.il-m-050 { margin: 0 0 0.5rem; }
.il-body-text-mb075 { margin: 0 0 0.75rem; color: var(--text-secondary, #64748b); line-height: 1.55; }
.il-m0-500 { margin: 0; font-weight: 500; }
.il-modal-subhead { margin: 1rem 0 0.5rem; font-size: 1rem; }
.il-max-h-chat { max-height: calc(100vh - 220px); }
.il-max-h-150 { max-height: 150px; }
.il-mw-300-mb075 { max-width: 300px; margin-bottom: 0.75rem; }
.il-full-no-gap { padding: 0; gap: 0; max-width: 100%; }
.il-overflow-hidden-cell { padding: 0; overflow: hidden; min-width: 0; }
.il-py-1rem { padding: 1rem 0; }
.il-popular-pill { position: absolute; top: -0.5rem; left: 50%; transform: translateX(-50%); background: var(--accent-color, #4f46e5); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.il-svg-progress-init { stroke-dasharray: 201.06; stroke-dashoffset: 201.06; }
.il-tab-card-accent { text-align: center; border: 2px solid var(--accent-color, #4f46e5); padding: 1.25rem 0.75rem; cursor: pointer; position: relative; }
.il-inline-link { text-decoration: none; margin-top: 16px; display: inline-flex; }
.il-w-0pct-b { width: 0%; }
.il-table-full { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.il-textarea-full { width: 100%; resize: vertical; }
.il-w-15pct { width: 15%; }
.il-w-22pct { width: 22%; }
.il-w-30pct { width: 30%; }
.il-w-160px { width: 160px; }
.il-w-80px { width: 80px; }
.il-icon-16px { width: 16px; height: 16px; }

/* --- Undo / redo zone (ur-*) -------------------------------------------- */
.ur-zone {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 12px;
  border-left: 1px solid var(--border-color, #e2e8f0);
  padding-left: 12px;
  flex-shrink: 0;
}
.ur-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #64748b);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background var(--transition-fast, 0.15s ease), color var(--transition-fast, 0.15s ease);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ur-btn:hover:not(:disabled) {
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent-color, #4f46e5);
}
.ur-btn:focus-visible {
  outline: 2px solid var(--accent-color, #4f46e5);
  outline-offset: 2px;
}
.ur-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Action undo/redo toast */
#ur-action-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 40, 0.88);
  color: #fff;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.82rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}
#ur-action-toast.ur-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Shared job-board / seeker preferences chips (static — CSP-safe) */
.jb-prefs-panel { padding: 0.25rem 0 0.5rem; }
.jb-prefs-section {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
  background: var(--surface-alt, #f8fafc);
}
.jb-prefs-field {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: 0.65rem 1rem;
  align-items: start;
  margin-bottom: 0.75rem;
}
.jb-prefs-label,
.jb-prefs-field label {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-primary, #334155);
  padding-top: 0.35rem;
}
.jb-prefs-help {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  margin: 0.25rem 0 0;
  line-height: 1.4;
}
.jb-prefs-industries,
.jb-prefs-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 100%;
}
.jb-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--surface-color, #fff);
  color: var(--text-primary, #334155);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  line-height: 1.25;
  max-width: 100%;
}
.jb-chip:hover:not(:disabled) {
  border-color: var(--accent-color, #2563eb);
  color: var(--accent-color, #2563eb);
}
.jb-chip[aria-pressed="true"] {
  background: var(--accent-color, #2563eb);
  border-color: var(--accent-color, #2563eb);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.22);
}
.jb-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.jb-prefs-chip-meta {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  margin: 0 0 0.55rem;
}
.jb-prefs-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.jb-career-focus {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.jb-prefs-industry-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.jb-prefs-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
}
.jb-prefs-status--success { color: #059669; font-weight: 600; }
.jb-prefs-status--error { color: #dc2626; font-weight: 600; }
@media (max-width: 640px) {
  .jb-prefs-field { grid-template-columns: 1fr; }
}

/* --- Compact header on small screens ---------------------------------------
   The icon cluster (back/home/settings/logout + profile + bell) overflowed the
   viewport at phone widths; app-header's overflow:hidden then CLIPPED the
   right-hand controls instead of showing a scrollbar. Shrink and shed. */
@media (max-width: 600px) {
    .header-controls {
        flex-shrink: 1;
        min-width: 0;
        gap: 4px;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
    .hdr-account-stack { display: none; }   /* avatar stays, name/level go */
    .hdr-profile-link { padding: 2px; }
    .backend-status { display: none; }
}
@media (max-width: 480px) {
    /* Browser back exists; bottom nav has Home. */
    #hdr-back-btn,
    #hdr-home-btn { display: none; }
    .logo-section h1,
    .logo-section .app-title { display: none; }
    .header-content { padding: 0 var(--spacing-sm); }
}

/* === Phase 13: Shared Auto-Apply Credentials Panel Styles === */
.credentials-panel {
    background: var(--surface-color, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
    padding: 20px;
    margin: 16px 0 24px 0;
    transition: all 0.2s ease;
}

.credentials-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.credentials-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading, #0f172a);
    display: flex;
    align-items: center;
    gap: 8px;
}

.credentials-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.credentials-badges .badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-status { background: #dcfce7; color: #166534; }
.badge-type { background: #e0f2fe; color: #0369a1; }

.badge-channel {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-channel-gated {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}
.badge-channel-nongated {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}
.badge-channel-email {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #ddd6fe;
}
.badge-channel-redirect {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}
.badge-channel-unknown {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.credentials-notice {
    font-size: 0.875rem;
    color: var(--text-muted, #475569);
    line-height: 1.5;
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.credentials-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.credentials-row {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.credentials-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color, #334155);
}

.credentials-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: #0f172a;
    word-break: break-all;
}

.text-masked { color: #64748b; letter-spacing: 2px; }
.text-revealed {
    color: #2563eb;
    font-weight: 700;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid #bfdbfe;
}

.credentials-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.credentials-meta-row {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: #64748b;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
    flex-wrap: wrap;
}

.credentials-controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.credentials-update-form,
.credentials-reauth-form {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.credentials-update-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.credentials-update-form label,
.reauth-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.reauth-desc {
    margin: 0;
    font-size: 0.84rem;
    color: #64748b;
}

.reauth-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.reauth-row input {
    flex: 1 1 240px;
}

.credentials-update-form .form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.credentials-feedback {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.credentials-feedback.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.credentials-feedback.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

.credentials-panel button:focus-visible,
.credentials-panel input:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .credentials-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .credentials-actions {
        margin-top: 6px;
        justify-content: flex-start;
    }
    .credentials-meta-row {
        gap: 12px;
    }
}

@media print {
    .credentials-panel [data-sensitive="revealed"] .text-revealed,
    .text-revealed {
        filter: blur(8px) !important;
        color: transparent !important;
    }
}

/* ---- Phase 7: Application Card Correspondence Thread ---- */
.app-card-correspondence-details {
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--surface-color, #ffffff);
    overflow: hidden;
    margin-top: 8px;
}
.app-card-correspondence-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary, #0f172a);
    user-select: none;
}
.app-card-correspondence-summary:hover {
    background: #f1f5f9;
}
.correspondence-thread-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
}
.corr-message-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    background: #ffffff;
    font-size: 0.82rem;
}
.corr-message-item.corr-sent {
    border-left: 4px solid #3b82f6;
    background: #f8faff;
}
.corr-message-item.corr-received {
    border-left: 4px solid #10b981;
    background: #fbfdfc;
}
.corr-message-item.corr-otp {
    border-left: 4px solid #f59e0b;
    background: #fffdf5;
}
.corr-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.corr-msg-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.4;
}
.corr-badge-dir-sent {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
}
.corr-badge-dir-recv {
    background: #d1fae5;
    color: #065f46;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
}
.corr-badge-otp {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
}
.corr-badge-state {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}
.corr-msg-body {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #1e293b;
    word-break: break-word;
    white-space: pre-wrap;
    margin-top: 6px;
}
.corr-msg-body.long-body {
    max-height: 130px;
    overflow-y: auto;
    background: #f8fafc;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}
.corr-attachments {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.corr-attachment-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #334155;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
}
.corr-attachment-hash {
    font-family: monospace;
    color: #64748b;
}

@media (max-width: 640px) {
    .corr-msg-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .corr-msg-meta {
        font-size: 0.72rem;
    }
}
