/* =========================================================================
   Rankd - Styles & Themes
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---------------------------------------------------------------------------
   CSS Custom Properties (Themes)
   --------------------------------------------------------------------------- */

.theme-light {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a2e;
    --text-secondary: #495057;
    --text-muted: #868e96;
    --accent: #4361ee;
    --accent-hover: #3a56d4;
    --accent-light: rgba(67, 97, 238, 0.1);
    --accent-glow: rgba(67, 97, 238, 0.25);
    --border: #dee2e6;
    --border-light: #e9ecef;
    --success: #2ecc71;
    --success-light: rgba(46, 204, 113, 0.12);
    --error: #e74c3c;
    --error-light: rgba(231, 76, 60, 0.1);
    --warning: #f39c12;
    --warning-light: rgba(243, 156, 18, 0.12);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --nav-bg: rgba(255, 255, 255, 0.85);
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --table-stripe: #f1f3f5;
    --table-hover: #e9ecef;
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
    --score-high-bg: rgba(46, 204, 113, 0.15);
    --score-high-text: #16a34a;
    --score-high-border: rgba(46, 204, 113, 0.3);
    --score-med-bg: rgba(243, 156, 18, 0.15);
    --score-med-text: #d97706;
    --score-med-border: rgba(243, 156, 18, 0.3);
    --score-low-bg: rgba(232, 89, 12, 0.12);
    --score-low-text: #dc2626;
    --score-low-border: rgba(232, 89, 12, 0.25);
    --score-vlow-bg: rgba(107, 114, 128, 0.1);
    --score-vlow-text: #6b7280;
    --score-vlow-border: rgba(107, 114, 128, 0.2);
}

.theme-dark {
    --bg-primary: #0f1119;
    --bg-secondary: #1a1d2e;
    --bg-tertiary: #252836;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --text-muted: #6c6c7e;
    --accent: #4cc9f0;
    --accent-hover: #3ab8df;
    --accent-light: rgba(76, 201, 240, 0.12);
    --accent-glow: rgba(76, 201, 240, 0.3);
    --border: #2d3048;
    --border-light: #252836;
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --error: #f87171;
    --error-light: rgba(248, 113, 113, 0.12);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.12);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.4), 0 8px 16px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(26, 29, 46, 0.75);
    --glass-border: rgba(45, 48, 72, 0.6);
    --nav-bg: rgba(26, 29, 46, 0.88);
    --card-bg: #1a1d2e;
    --input-bg: #252836;
    --input-border: #2d3048;
    --table-stripe: #23263a;
    --table-hover: #252836;
    --scrollbar-track: #1a1d2e;
    --scrollbar-thumb: #3d4056;
    --score-high-bg: rgba(52, 211, 153, 0.18);
    --score-high-text: #34d399;
    --score-high-border: rgba(52, 211, 153, 0.3);
    --score-med-bg: rgba(251, 191, 36, 0.15);
    --score-med-text: #fbbf24;
    --score-med-border: rgba(251, 191, 36, 0.3);
    --score-low-bg: rgba(248, 113, 113, 0.14);
    --score-low-text: #f87171;
    --score-low-border: rgba(248, 113, 113, 0.25);
    --score-vlow-bg: rgba(107, 114, 128, 0.15);
    --score-vlow-text: #9ca3af;
    --score-vlow-border: rgba(107, 114, 128, 0.25);
}

.theme-orange {
    --bg-primary: #fef7f0;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fdecd5;
    --text-primary: #2d2013;
    --text-secondary: #5c4a36;
    --text-muted: #9b8a78;
    --accent: #e8590c;
    --accent-hover: #d14b08;
    --accent-light: rgba(232, 89, 12, 0.1);
    --accent-glow: rgba(232, 89, 12, 0.25);
    --border: #f0d9bf;
    --border-light: #fdecd5;
    --success: #2ecc71; --success-light: rgba(46,204,113,0.12);
    --error: #e74c3c; --error-light: rgba(231,76,60,0.1);
    --warning: #f39c12; --warning-light: rgba(243,156,18,0.12);
    --shadow-xs: 0 1px 2px rgba(139,90,43,0.04);
    --shadow: rgba(139, 90, 43, 0.08);
    --shadow-sm: 0 1px 3px rgba(139,90,43,0.06), 0 1px 2px rgba(139,90,43,0.04);
    --shadow-md: 0 4px 6px rgba(139,90,43,0.06), 0 2px 4px rgba(139,90,43,0.04);
    --shadow-lg: rgba(139, 90, 43, 0.12);
    --shadow-xl: 0 20px 40px rgba(139,90,43,0.08), 0 8px 16px rgba(139,90,43,0.06);
    --glass-bg: rgba(255,255,255,0.7); --glass-border: rgba(255,255,255,0.5);
    --nav-bg: rgba(255,255,255,0.85);
    --card-bg: #ffffff; --input-bg: #ffffff; --input-border: #e8d5be;
    --table-stripe: #fef0e3; --table-hover: #fdecd5;
    --scrollbar-track: #fef7f0; --scrollbar-thumb: #d4b896;
    --score-high-bg: rgba(46,204,113,0.15); --score-high-text: #16a34a; --score-high-border: rgba(46,204,113,0.3);
    --score-med-bg: rgba(243,156,18,0.15); --score-med-text: #d97706; --score-med-border: rgba(243,156,18,0.3);
    --score-low-bg: rgba(232,89,12,0.12); --score-low-text: #dc2626; --score-low-border: rgba(232,89,12,0.25);
    --score-vlow-bg: rgba(107,114,128,0.1); --score-vlow-text: #6b7280; --score-vlow-border: rgba(107,114,128,0.2);
}

.theme-blue {
    --bg-primary: #f0f4ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #dbe4ff;
    --text-primary: #1a1a2e;
    --text-secondary: #3d4663;
    --text-muted: #7c86a2;
    --accent: #2563eb;
    --accent-hover: #1d55cc;
    --accent-light: rgba(37, 99, 235, 0.1);
    --accent-glow: rgba(37, 99, 235, 0.25);
    --border: #c3d1f0;
    --border-light: #dbe4ff;
    --success: #2ecc71; --success-light: rgba(46,204,113,0.12);
    --error: #e74c3c; --error-light: rgba(231,76,60,0.1);
    --warning: #f39c12; --warning-light: rgba(243,156,18,0.12);
    --shadow-xs: 0 1px 2px rgba(37,99,235,0.03);
    --shadow: rgba(37, 99, 235, 0.06);
    --shadow-sm: 0 1px 3px rgba(37,99,235,0.06), 0 1px 2px rgba(37,99,235,0.04);
    --shadow-md: 0 4px 6px rgba(37,99,235,0.06), 0 2px 4px rgba(37,99,235,0.04);
    --shadow-lg: rgba(37, 99, 235, 0.1);
    --shadow-xl: 0 20px 40px rgba(37,99,235,0.08), 0 8px 16px rgba(37,99,235,0.06);
    --glass-bg: rgba(255,255,255,0.7); --glass-border: rgba(255,255,255,0.5);
    --nav-bg: rgba(255,255,255,0.85);
    --card-bg: #ffffff; --input-bg: #ffffff; --input-border: #b8c9e8;
    --table-stripe: #f5f8ff; --table-hover: #dbe4ff;
    --scrollbar-track: #f0f4ff; --scrollbar-thumb: #a3b5d6;
    --score-high-bg: rgba(46,204,113,0.15); --score-high-text: #16a34a; --score-high-border: rgba(46,204,113,0.3);
    --score-med-bg: rgba(243,156,18,0.15); --score-med-text: #d97706; --score-med-border: rgba(243,156,18,0.3);
    --score-low-bg: rgba(232,89,12,0.12); --score-low-text: #dc2626; --score-low-border: rgba(232,89,12,0.25);
    --score-vlow-bg: rgba(107,114,128,0.1); --score-vlow-text: #6b7280; --score-vlow-border: rgba(107,114,128,0.2);
}

.theme-green {
    --bg-primary: #f0fdf4;
    --bg-secondary: #ffffff;
    --bg-tertiary: #dcfce7;
    --text-primary: #14532d;
    --text-secondary: #3b6d52;
    --text-muted: #7ba593;
    --accent: #16a34a;
    --accent-hover: #138a3e;
    --accent-light: rgba(22, 163, 74, 0.1);
    --accent-glow: rgba(22, 163, 74, 0.25);
    --border: #bbf7d0;
    --border-light: #dcfce7;
    --success: #2ecc71; --success-light: rgba(46,204,113,0.12);
    --error: #e74c3c; --error-light: rgba(231,76,60,0.1);
    --warning: #f39c12; --warning-light: rgba(243,156,18,0.12);
    --shadow-xs: 0 1px 2px rgba(22,163,74,0.03);
    --shadow: rgba(22, 163, 74, 0.06);
    --shadow-sm: 0 1px 3px rgba(22,163,74,0.06), 0 1px 2px rgba(22,163,74,0.04);
    --shadow-md: 0 4px 6px rgba(22,163,74,0.06), 0 2px 4px rgba(22,163,74,0.04);
    --shadow-lg: rgba(22, 163, 74, 0.1);
    --shadow-xl: 0 20px 40px rgba(22,163,74,0.08), 0 8px 16px rgba(22,163,74,0.06);
    --glass-bg: rgba(255,255,255,0.7); --glass-border: rgba(255,255,255,0.5);
    --nav-bg: rgba(255,255,255,0.85);
    --card-bg: #ffffff; --input-bg: #ffffff; --input-border: #a7f3d0;
    --table-stripe: #f5fcf7; --table-hover: #dcfce7;
    --scrollbar-track: #f0fdf4; --scrollbar-thumb: #86d8a8;
    --score-high-bg: rgba(46,204,113,0.15); --score-high-text: #16a34a; --score-high-border: rgba(46,204,113,0.3);
    --score-med-bg: rgba(243,156,18,0.15); --score-med-text: #d97706; --score-med-border: rgba(243,156,18,0.3);
    --score-low-bg: rgba(232,89,12,0.12); --score-low-text: #dc2626; --score-low-border: rgba(232,89,12,0.25);
    --score-vlow-bg: rgba(107,114,128,0.1); --score-vlow-text: #6b7280; --score-vlow-border: rgba(107,114,128,0.2);
}

.theme-purple {
    --bg-primary: #faf5ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3e8ff;
    --text-primary: #2e1065;
    --text-secondary: #553c8b;
    --text-muted: #9a7ec4;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-light: rgba(139, 92, 246, 0.1);
    --accent-glow: rgba(139, 92, 246, 0.25);
    --border: #e4d4f4;
    --border-light: #f3e8ff;
    --success: #2ecc71; --success-light: rgba(46,204,113,0.12);
    --error: #e74c3c; --error-light: rgba(231,76,60,0.1);
    --warning: #f39c12; --warning-light: rgba(243,156,18,0.12);
    --shadow-xs: 0 1px 2px rgba(139,92,246,0.03);
    --shadow: rgba(139, 92, 246, 0.06);
    --shadow-sm: 0 1px 3px rgba(139,92,246,0.06), 0 1px 2px rgba(139,92,246,0.04);
    --shadow-md: 0 4px 6px rgba(139,92,246,0.06), 0 2px 4px rgba(139,92,246,0.04);
    --shadow-lg: rgba(139, 92, 246, 0.1);
    --shadow-xl: 0 20px 40px rgba(139,92,246,0.08), 0 8px 16px rgba(139,92,246,0.06);
    --glass-bg: rgba(255,255,255,0.7); --glass-border: rgba(255,255,255,0.5);
    --nav-bg: rgba(255,255,255,0.85);
    --card-bg: #ffffff; --input-bg: #ffffff; --input-border: #d4bfea;
    --table-stripe: #fcf9ff; --table-hover: #f3e8ff;
    --scrollbar-track: #faf5ff; --scrollbar-thumb: #c4a8e0;
    --score-high-bg: rgba(46,204,113,0.15); --score-high-text: #16a34a; --score-high-border: rgba(46,204,113,0.3);
    --score-med-bg: rgba(243,156,18,0.15); --score-med-text: #d97706; --score-med-border: rgba(243,156,18,0.3);
    --score-low-bg: rgba(232,89,12,0.12); --score-low-text: #dc2626; --score-low-border: rgba(232,89,12,0.25);
    --score-vlow-bg: rgba(107,114,128,0.1); --score-vlow-text: #6b7280; --score-vlow-border: rgba(107,114,128,0.2);
}

/* ---------------------------------------------------------------------------
   Reset & Base
   --------------------------------------------------------------------------- */

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { opacity: 0.8; }

/* ---------------------------------------------------------------------------
   Navbar
   --------------------------------------------------------------------------- */

.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(12px) saturate(1.8);
    -webkit-backdrop-filter: blur(12px) saturate(1.8);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}
.nav-brand:hover {
    text-decoration: none;
}
.nav-brand:hover .nav-logo {
    transform: scale(1.08);
    box-shadow: 0 2px 8px var(--shadow-lg);
}

.nav-logo {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-title {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.nav-link:hover {
    background: var(--accent-light);
    color: var(--accent);
    text-decoration: none;
}
.nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */

.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    transition: max-width 0.3s ease;
}
.main-content.table-width-default {
    max-width: 1200px;
}
.main-content.table-width-wide {
    max-width: 51vw;
}
.main-content.table-width-full {
    max-width: 100vw;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.page-header {
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.page-header .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-light);
    letter-spacing: 0.03em;
    background: var(--bg-secondary);
}

/* ---------------------------------------------------------------------------
   Card
   --------------------------------------------------------------------------- */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s ease, transform 0.3s ease;
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--accent-light);
}
.card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.15em;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}
.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}
.btn-primary:hover::after {
    left: 100%;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent));
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-primary:disabled::after {
    display: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--border);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}
.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
}
.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* ---------------------------------------------------------------------------
   Inputs
   --------------------------------------------------------------------------- */

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s;
}
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light), 0 1px 3px var(--accent-glow);
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* ---------------------------------------------------------------------------
    Index Page - URL Input
    --------------------------------------------------------------------------- */

.input-group {
    margin-bottom: 0;
}
.input-group label {
    margin-bottom: 0.5rem;
}

.label-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.3rem;
    cursor: help;
}

.prompt-hint {
    margin-top: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--accent-light);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.prompt-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.url-input-row {
    display: flex;
    gap: 0.75rem;
}
.url-input-row input {
    flex: 1;
}

/* ---------------------------------------------------------------------------
    Index Page - Progress
    --------------------------------------------------------------------------- */

.timer-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.timer-label {
    color: var(--text-muted);
    font-weight: 500;
}

.timer-value {
    color: var(--accent);
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    opacity: 0.4;
    transition: opacity 0.3s;
}
.step.active {
    opacity: 1;
}
.step.done {
    opacity: 0.7;
}
.step.done .step-icon {
    color: var(--success);
}

.step-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}
.step.active .step-icon {
    color: var(--accent);
}

.step-info {
    flex: 1;
}
.step-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.step-bar {
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 0.4rem;
    overflow: hidden;
}
.step-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 2px;
    transition: width 0.5s;
}
.step.active .step-bar-fill {
    width: 60%;
    animation: pulse-bar 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover), var(--accent));
    background-size: 200% 100%;
}
.step.done .step-bar-fill {
    width: 100%;
    background: linear-gradient(90deg, var(--success), #27ae60);
    animation: none;
}

@keyframes pulse-bar {
    0%, 100% { width: 40%; }
    50% { width: 80%; }
}

/* ---------------------------------------------------------------------------
   Index Page - Results
   --------------------------------------------------------------------------- */

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

.detail-item {
    display: flex;
    flex-direction: column;
}
.detail-item label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.detail-item span {
    font-size: 0.95rem;
    color: var(--text-primary);
}
.detail-item.full-width {
    margin-top: 0.5rem;
}

/* Collapsible text */
.collapsible-text {
    position: relative;
}
.collapsible-text .collapsible-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.collapsible-text.collapsed .collapsible-content {
    max-height: 100px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.btn-collapse {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    font-weight: 500;
}
.btn-collapse:hover {
    text-decoration: underline;
}

/* Recommendation box */
.recommendation-box {
    background: linear-gradient(135deg, var(--accent-light), var(--bg-secondary));
    border: 1px solid var(--accent-glow);
    border-radius: 14px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}
.recommendation-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover), var(--accent));
}
.rec-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.rec-badge {
    color: var(--success);
    flex-shrink: 0;
}
.rec-header-info {
    flex: 1;
}
.rec-filename {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.rec-scores {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.rec-score {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}
.rec-score-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}
.rec-score-badge.score-high {
    background: var(--score-high-bg);
    color: var(--score-high-text);
    border: 1px solid var(--score-high-border);
}
.rec-score-badge.score-medium {
    background: var(--score-med-bg);
    color: var(--score-med-text);
    border: 1px solid var(--score-med-border);
}
.rec-score-badge.score-low {
    background: var(--score-low-bg);
    color: var(--score-low-text);
    border: 1px solid var(--score-low-border);
}
.rec-score-badge.score-very-low {
    background: var(--score-vlow-bg);
    color: var(--score-vlow-text);
    border: 1px solid var(--score-vlow-border);
}
.rec-reasoning {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.likelihood-info {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    margin: 0.75rem 0;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid var(--accent);
    font-weight: 500;
    color: var(--text-primary);
}

.rec-gaps {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.rec-gaps strong {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}
.rec-gaps ul {
    padding-left: 1.25rem;
}
.rec-gaps li {
    margin-bottom: 0.2rem;
}

/* Other resumes section */
.other-resumes-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}
.other-resumes-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}
.other-resumes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.other-resume-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--text-muted);
}
.other-resume-card:hover {
    background: var(--bg-primary);
    border-color: var(--accent-light);
    border-left-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}
.other-resume-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.other-resume-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.other-resume-filename {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.other-resume-filename::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.5;
}
.other-resume-scores {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.other-resume-score-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.other-resume-score-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.other-resume-score-badge.score-high {
    background: var(--score-high-bg);
    color: var(--score-high-text);
    border: 1px solid var(--score-high-border);
}
.other-resume-score-badge.score-medium {
    background: var(--score-med-bg);
    color: var(--score-med-text);
    border: 1px solid var(--score-med-border);
}
.other-resume-score-badge.score-low {
    background: var(--score-low-bg);
    color: var(--score-low-text);
    border: 1px solid var(--score-low-border);
}
.other-resume-score-badge.score-very-low {
    background: var(--score-vlow-bg);
    color: var(--score-vlow-text);
    border: 1px solid var(--score-vlow-border);
}
.other-resume-reason {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    padding-left: 1.5rem;
}

/* Cover letter actions */
.cover-letter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.rewrite-group {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    min-width: 250px;
}
.rewrite-group input {
    flex: 1;
}

/* ---------------------------------------------------------------------------
   Log Page
   --------------------------------------------------------------------------- */

.log-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.log-controls-left {
    flex: 1;
}
.search-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.search-group select {
    width: auto;
    min-width: 130px;
}
.search-group input {
    flex: 1;
    min-width: 180px;
}

/* Multi-select dropdown */
.multiselect {
    position: relative;
    flex-shrink: 0;
}
.multiselect-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    height: 36px;
}
.multiselect-toggle:hover {
    border-color: var(--accent);
}
.multiselect.open .multiselect-toggle {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.multiselect-label {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    line-height: 1;
}
.multiselect-toggle svg {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.multiselect.open .multiselect-toggle svg {
    transform: rotate(180deg);
}
.multiselect-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 160px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px var(--shadow-lg);
    z-index: 200;
    padding: 0.3rem 0;
    max-height: 260px;
    overflow-y: auto;
}
.multiselect.open .multiselect-dropdown {
    display: block;
}
label.multiselect-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: normal;
    color: var(--text-primary);
    transition: background-color 0.15s;
    margin: 0;
    line-height: 1;
}
label.multiselect-option:hover {
    background: var(--accent-light);
}
label.multiselect-option input[type="checkbox"] {
    -webkit-appearance: auto;
    appearance: auto;
    width: 14px !important;
    height: 14px !important;
    min-width: 14px;
    max-width: 14px;
    flex: 0 0 14px;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 3px;
    box-shadow: none;
    vertical-align: middle;
}
label.multiselect-option span {
    white-space: nowrap;
    line-height: 1;
}
.log-controls-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.log-controls-right label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    margin-bottom: 0;
    white-space: nowrap;
}
.log-controls-right input {
    width: auto;
}

.table-wrapper {
    overflow-x: auto;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 1000px;
}
.log-table.table-width-default {
    width: 100%;
}
.log-table.table-width-wide {
    width: 100%;
}
.log-table.table-width-full {
    width: 100%;
}
.table-wrapper {
    overflow-x: auto;
}
.table-wrapper.table-width-default {
    margin: -0.5rem -1.5rem 0 -1.5rem;
    padding: 0.5rem 1.5rem 0 1.5rem;
}
.table-wrapper.table-width-wide,
.table-wrapper.table-width-full {
    margin: 0;
    padding: 0;
}
#log-card.table-width-wide,
#log-card.table-width-full {
    padding: 1.5rem 0;
}
#log-card.table-width-wide .log-controls,
#log-card.table-width-full .log-controls {
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}
#log-card.table-width-wide .pagination,
#log-card.table-width-full .pagination {
    padding: 1rem 1.5rem 0;
}
#log-card.table-width-wide,
#log-card.table-width-full {
    padding: 1.5rem 0;
}
#log-card.table-width-wide .log-controls,
#log-card.table-width-full .log-controls {
    padding: 0 1.5rem;
}
#log-card.table-width-wide .pagination,
#log-card.table-width-full .pagination {
    padding: 0 1.5rem;
}
#log-card.table-width-wide .page-header,
#log-card.table-width-full .page-header {
    padding: 0 1.5rem;
}

.log-table th,
.log-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}
.log-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
    white-space: nowrap;
    user-select: none;
    border-bottom: 2px solid var(--border);
}

.log-table th.sortable {
    cursor: pointer;
}
.log-table th.sortable:hover {
    color: var(--accent);
}

.sort-arrow {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.7rem;
}
.sort-arrow::after {
    content: "\2195";
    opacity: 0.4;
}
th.sort-asc .sort-arrow::after {
    content: "\2191";
    opacity: 1;
    color: var(--accent);
}
th.sort-desc .sort-arrow::after {
    content: "\2193";
    opacity: 1;
    color: var(--accent);
}

.log-table tbody tr:nth-child(even) {
    background: var(--table-stripe);
}
.log-table tbody tr:nth-child(odd) {
    background: transparent;
}
.log-table tbody tr {
    transition: background-color 0.15s, opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.log-table tbody tr:hover {
    background: var(--table-hover);
}

/* Smooth fade-in animation for table rows */
@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.log-table tbody tr.row-animate-in {
    animation: fadeInRow 0.25s ease-out forwards;
}

/* Stagger animation for multiple rows */
.log-table tbody tr.row-animate-in:nth-child(1) { animation-delay: 0ms; }
.log-table tbody tr.row-animate-in:nth-child(2) { animation-delay: 20ms; }
.log-table tbody tr.row-animate-in:nth-child(3) { animation-delay: 40ms; }
.log-table tbody tr.row-animate-in:nth-child(4) { animation-delay: 60ms; }
.log-table tbody tr.row-animate-in:nth-child(5) { animation-delay: 80ms; }
.log-table tbody tr.row-animate-in:nth-child(6) { animation-delay: 100ms; }
.log-table tbody tr.row-animate-in:nth-child(7) { animation-delay: 120ms; }
.log-table tbody tr.row-animate-in:nth-child(8) { animation-delay: 140ms; }
.log-table tbody tr.row-animate-in:nth-child(9) { animation-delay: 160ms; }
.log-table tbody tr.row-animate-in:nth-child(10) { animation-delay: 180ms; }

/* Loading overlay for table */
.table-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.table-wrapper {
    position: relative;
}

.table-wrapper.loading .table-loading-overlay {
    opacity: 1;
    pointer-events: auto;
}

.table-wrapper.loading .log-table {
    opacity: 0.4;
}

/* Cell types */
.cell-truncated {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-expandable {
    max-width: 250px;
}
.cell-expandable .cell-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
    cursor: pointer;
    color: var(--accent);
    font-size: 0.82rem;
}
.cell-expandable .cell-full {
    display: none;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.82rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-top: 0.3rem;
}
.cell-expandable.expanded .cell-preview {
    display: none;
}
.cell-expandable.expanded .cell-full {
    display: block;
}

.cell-link a {
    color: var(--accent);
    word-break: break-all;
    font-size: 0.82rem;
}

/* Score cells and badges */
.score-cell {
    text-align: center;
    padding: 0.35rem 0.5rem;
}

.score-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 45px;
}

.score-badge.score-high {
    background: var(--score-high-bg);
    color: var(--score-high-text);
    border: 1px solid var(--score-high-border);
}

.score-badge.score-medium {
    background: var(--score-med-bg);
    color: var(--score-med-text);
    border: 1px solid var(--score-med-border);
}

.score-badge.score-low {
    background: var(--score-low-bg);
    color: var(--score-low-text);
    border: 1px solid var(--score-low-border);
}

.score-badge.score-very-low {
    background: var(--score-vlow-bg);
    color: var(--score-vlow-text);
    border: 1px solid var(--score-vlow-border);
}

/* Status cell */
.cell-status {
    padding: 0.35rem 0.5rem;
}
.status-select {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}
.status-select:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}
.status-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* Status color coding — theme-aware */
.status-select[data-status="Applied"] {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 500;
}
.status-select[data-status="Interview 1"] {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
    font-weight: 500;
}
.status-select[data-status="Interview 2"] {
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--warning);
    font-weight: 500;
}
.status-select[data-status="Interview 3"] {
    background: var(--score-med-bg);
    border-color: var(--score-med-text);
    color: var(--score-med-text);
    font-weight: 500;
}
.status-select[data-status="Offer"] {
    background: var(--score-high-bg);
    border-color: var(--score-high-text);
    color: var(--score-high-text);
    font-weight: 600;
}
.status-select[data-status="Accepted"] {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}
.status-select[data-status="Not progressed"] {
    background: var(--error-light);
    border-color: var(--error);
    color: var(--error);
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--text-muted);
}
.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.3;
    filter: drop-shadow(0 2px 4px var(--shadow));
}
.empty-state p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}
.pagination .btn {
    border-radius: 10px;
}
#page-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   Inline Editing
   --------------------------------------------------------------------------- */

.cell-editable {
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s;
}
.cell-editable:hover {
    background-color: var(--accent-light);
}
.cell-editable:hover::after {
    content: '';
    position: absolute;
    inset: 0;
    outline: 1px dashed var(--accent);
    outline-offset: -2px;
    pointer-events: none;
    border-radius: 4px;
}
.cell-editable.editing {
    background-color: var(--input-bg);
}
.cell-editable.editing:hover::after {
    display: none;
}
.cell-editable.saving {
    opacity: 0.6;
    pointer-events: none;
}

.inline-edit-input {
    width: 100%;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    border: 2px solid var(--accent);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    box-shadow: 0 2px 8px var(--shadow-lg);
}
.inline-edit-input:focus {
    box-shadow: 0 0 0 3px var(--accent-light);
}

.inline-edit-textarea {
    width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    border: 2px solid var(--accent);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    line-height: 1.4;
    box-shadow: 0 2px 8px var(--shadow-lg);
}
.inline-edit-textarea:focus {
    box-shadow: 0 0 0 3px var(--accent-light);
}

.cell-comments {
    max-width: 200px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}
.cell-comments:not(:hover) {
    opacity: 0.85;
}

/* ---------------------------------------------------------------------------
   Settings Page
   --------------------------------------------------------------------------- */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.25rem;
}

.setting-group {
    margin-bottom: 1.25rem;
}
.setting-group:last-child {
    margin-bottom: 0;
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: normal;
    margin-bottom: 0;
}
.radio-label:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.radio-label input[type="radio"] {
    accent-color: var(--accent);
    margin-top: 0.15rem;
}
.radio-label input[type="radio"]:checked + .radio-custom + span {
    color: var(--accent);
}
.radio-custom { display: none; }
.radio-label strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.radio-label small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

/* Key input */
.key-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.key-input-wrapper {
    flex: 1;
    position: relative;
}
.key-input-wrapper input {
    padding-right: 2.5rem;
}
.btn-toggle-key {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}
.key-status {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
}
.key-status.set {
    color: var(--success);
}
.key-status.not-set {
    color: var(--text-muted);
}

/* Model list */
.model-list-wrapper {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.model-list {
    max-height: 300px;
    overflow-y: auto;
}
.model-list-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.model-item {
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.15s, padding-left 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.model-item:last-child {
    border-bottom: none;
}
.model-item:hover {
    background: var(--accent-light);
    padding-left: 1rem;
}
.model-item.selected {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    border-left: 3px solid var(--accent);
}
.model-item .model-check {
    width: 16px;
    flex-shrink: 0;
}

.selected-model {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--accent-light);
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Theme swatches */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
}
.theme-swatch {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.theme-swatch:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow);
}
.theme-swatch.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light), 0 4px 12px var(--accent-glow);
}

.swatch-preview {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 60px;
    height: 36px;
    border-radius: 6px;
    padding: 6px;
    overflow: hidden;
}
.swatch-bar {
    height: 4px;
    border-radius: 2px;
    width: 100%;
}
.swatch-bar.short {
    width: 60%;
}

/* Theme swatch color previews */
.theme-swatch-light .swatch-preview { background: #f8f9fa; }
.theme-swatch-light .swatch-bar { background: #4361ee; }
.theme-swatch-dark .swatch-preview { background: #0f1119; }
.theme-swatch-dark .swatch-bar { background: #4cc9f0; }
.theme-swatch-dark { color: var(--text-primary); }
.theme-swatch-orange .swatch-preview { background: #fef7f0; }
.theme-swatch-orange .swatch-bar { background: #e8590c; }
.theme-swatch-blue .swatch-preview { background: #f0f4ff; }
.theme-swatch-blue .swatch-bar { background: #2563eb; }
.theme-swatch-green .swatch-preview { background: #f0fdf4; }
.theme-swatch-green .swatch-bar { background: #16a34a; }
.theme-swatch-purple .swatch-preview { background: #faf5ff; }
.theme-swatch-purple .swatch-bar { background: #8b5cf6; }

/* Resume management */
.resume-list {
    margin-bottom: 1rem;
}
.resume-list-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.resume-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.resume-item:hover {
    border-color: var(--accent-light);
    box-shadow: var(--shadow-xs);
}
.resume-item-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}
.resume-item-name svg {
    color: var(--accent);
    flex-shrink: 0;
}
.resume-upload {
    margin-top: 0.5rem;
}
.resume-upload label {
    cursor: pointer;
    display: inline-flex;
    margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Toast Notifications
   --------------------------------------------------------------------------- */

#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
}
.toast.show {
    transform: translateX(0);
}

.toast-info {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
}
.toast-success {
    background: linear-gradient(135deg, var(--success), #27ae60);
}
.toast-error {
    background: linear-gradient(135deg, var(--error), #c0392b);
}
.toast-warning {
    background: linear-gradient(135deg, var(--warning), #e67e22);
    color: #1a1a2e;
}

.toast a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
    margin-left: 0.5rem;
}

.toast a:hover {
    text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Loading spinner
   --------------------------------------------------------------------------- */

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

/* ---------------------------------------------------------------------------
   Dashboard
   --------------------------------------------------------------------------- */

.dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 4rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Stat cards grid */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.4s ease-out both;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 16px 0 0 16px;
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--accent-light);
}

.stat-card-accent::before { background: var(--accent); }
.stat-card-blue::before { background: #4361ee; }
.stat-card-green::before { background: #2ecc71; }
.stat-card-muted::before { background: var(--text-muted); }
.stat-card-purple::before { background: #8b5cf6; }
.stat-card-orange::before { background: #e8590c; }
.stat-card-yellow::before { background: #f39c12; }

.stat-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
}
.stat-card-accent .stat-card-icon { background: var(--accent-light); color: var(--accent); }
.stat-card-blue .stat-card-icon { background: rgba(67, 97, 238, 0.1); color: #4361ee; }
.stat-card-green .stat-card-icon { background: rgba(46, 204, 113, 0.12); color: #2ecc71; }
.stat-card-muted .stat-card-icon { background: var(--bg-tertiary); color: var(--text-muted); }
.stat-card-purple .stat-card-icon { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.stat-card-orange .stat-card-icon { background: rgba(232, 89, 12, 0.1); color: #e8590c; }
.stat-card-yellow .stat-card-icon { background: rgba(243, 156, 18, 0.1); color: #f39c12; }

.stat-card-body {
    flex: 1;
    min-width: 0;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.15rem;
}

/* Dashboard grid for chart pairs */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.chart-card {
    min-height: 340px;
}

.chart-wrapper {
    position: relative;
    height: 260px;
}

.chart-wrapper-doughnut {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Recent applications list */
.recent-apps-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.recent-app-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.15s;
}
.recent-app-item:last-child {
    border-bottom: none;
}
.recent-app-item:hover {
    background: var(--accent-light);
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-radius: 10px;
}

.recent-app-main {
    flex: 1;
    min-width: 0;
}

.recent-app-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-app-company {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.recent-app-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.recent-app-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-applied { background: rgba(67, 97, 238, 0.12); color: #4361ee; }
.status-interview { background: rgba(76, 201, 240, 0.15); color: #0ea5e9; }
.status-offer { background: rgba(247, 127, 0, 0.12); color: #f77f00; }
.status-accepted { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.status-rejected { background: rgba(173, 181, 189, 0.2); color: #868e96; }

.recent-app-score {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    white-space: nowrap;
}
.score-high { background: rgba(46, 204, 113, 0.15); color: #16a34a; }
.score-medium { background: rgba(243, 156, 18, 0.15); color: #f39c12; }
.score-low { background: rgba(232, 89, 12, 0.12); color: #e8590c; }
.score-very-low { background: rgba(231, 76, 60, 0.12); color: #e74c3c; }

.recent-app-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Content Entrance Animations
   --------------------------------------------------------------------------- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > .card {
    animation: fadeInUp 0.4s ease-out both;
}
.main-content > .card:nth-child(1) { animation-delay: 0.05s; }
.main-content > .card:nth-child(2) { animation-delay: 0.12s; }
.main-content > .card:nth-child(3) { animation-delay: 0.19s; }
.main-content > .card:nth-child(4) { animation-delay: 0.26s; }

.settings-grid > .card {
    animation: fadeInUp 0.4s ease-out both;
}
.settings-grid > .card:nth-child(1) { animation-delay: 0.05s; }
.settings-grid > .card:nth-child(2) { animation-delay: 0.12s; }
.settings-grid > .card:nth-child(3) { animation-delay: 0.19s; }
.settings-grid > .card:nth-child(4) { animation-delay: 0.26s; }

.main-content > #results-section > .card {
    animation: fadeInUp 0.4s ease-out both;
}
.main-content > #results-section > .card:nth-child(1) { animation-delay: 0.05s; }
.main-content > #results-section > .card:nth-child(2) { animation-delay: 0.12s; }
.main-content > #results-section > .card:nth-child(3) { animation-delay: 0.19s; }

.hero-banner {
    animation: fadeInUp 0.35s ease-out both;
}

/* ---------------------------------------------------------------------------
   Hero Banner
   --------------------------------------------------------------------------- */

.hero-banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg-primary) 35%, var(--bg-secondary) 65%, var(--accent-light) 100%);
    border-bottom: 1px solid var(--border);
    padding: 2.5rem 1.5rem 2rem;
}
.hero-banner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: radial-gradient(ellipse at 70% 50%, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.hero-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.04;
}

.hero-shape-1 {
    width: 300px;
    height: 300px;
    top: -120px;
    right: -60px;
    animation: heroFloat 8s ease-in-out infinite;
}

.hero-shape-2 {
    width: 200px;
    height: 200px;
    bottom: -80px;
    left: -40px;
    animation: heroFloat 10s ease-in-out infinite reverse;
}

.hero-shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: heroFloat 12s ease-in-out infinite 2s;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1;
    min-width: 0;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.5;
    max-width: 480px;
}

.hero-illustration {
    flex-shrink: 0;
    width: 200px;
    height: 160px;
}

.hero-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 8px var(--shadow));
}

/* Hero SVG Animations */
.hero-checkmark {
    animation: heroCheckDraw 1.5s ease-out infinite;
    animation-delay: 1s;
}

@keyframes heroCheckDraw {
    0%, 70% { opacity: 1; }
    80% { opacity: 0.3; }
    100% { opacity: 1; }
}

.hero-sparkle {
    animation: heroSparkle 3s ease-in-out infinite;
}
.hero-sparkle-1 { animation-delay: 0s; }
.hero-sparkle-2 { animation-delay: 1s; }
.hero-sparkle-3 { animation-delay: 2s; }

@keyframes heroSparkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 0.8; transform: scale(1.3); }
}

.hero-chart-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: heroChartDraw 2s ease-out forwards;
}

@keyframes heroChartDraw {
    to { stroke-dashoffset: 0; }
}

/* Entrance animation — stagger for landing sections */
.landing-section {
    animation: fadeInUp 0.6s ease-out both;
}
.landing-problem  { animation-delay: 0.05s; }
.landing-how      { animation-delay: 0.1s; }
.landing-features { animation-delay: 0.15s; }
.landing-usecases { animation-delay: 0.2s; }
.landing-faq      { animation-delay: 0.25s; }

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.15rem;
    }
    .main-content {
        padding: 1rem;
    }
    .hero-banner {
        padding: 1.5rem 1rem 1.25rem;
    }
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .hero-title {
        font-size: 1.6rem;
    }
    .hero-subtitle {
        margin: 0 auto;
        font-size: 0.95rem;
    }
    .hero-illustration {
        width: 160px;
        height: 128px;
    }
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .stat-card-value {
        font-size: 1.3rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .recent-app-meta {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .url-input-row {
        flex-direction: column;
    }
    .cover-letter-actions {
        flex-direction: column;
    }
    .rewrite-group {
        min-width: unset;
    }
    .log-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .search-group {
        flex-direction: column;
    }
    .search-group select,
    .search-group input {
        min-width: unset;
        width: 100%;
    }
    .multiselect {
        width: 100%;
    }
    .multiselect-toggle {
        width: 100%;
        justify-content: space-between;
    }
    .multiselect-label {
        max-width: none;
    }
    .multiselect-dropdown {
        width: 100%;
    }
}

/* ---------------------------------------------------------------------------
   Landing Page — Shared
   --------------------------------------------------------------------------- */

/* Override body flex layout for landing page — allows natural scrolling through sections */
body.landing-body {
    display: block;
}

.landing-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.landing-section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 2.5rem;
    letter-spacing: -0.01em;
}

.section-title + .section-subtitle {
    margin-top: -2rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 3rem;
}

.landing-cta {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    border-radius: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
    box-shadow: 0 4px 16px var(--accent-glow);
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}
.landing-cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}
.landing-cta:hover::after {
    left: 100%;
}
.landing-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px var(--accent-glow);
    text-decoration: none;
}
.landing-cta:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* ---------------------------------------------------------------------------
   Section 1 — Hero
   --------------------------------------------------------------------------- */

.landing-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg-primary) 40%, var(--bg-secondary) 70%, var(--accent-light) 100%);
}
.landing-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, var(--accent-glow) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, var(--accent-glow) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, var(--accent-light) 0%, transparent 40%);
    animation: meshGradient 15s ease-in-out infinite alternate;
    pointer-events: none;
    opacity: 0.5;
}
@keyframes meshGradient {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, 2%) rotate(1deg); }
    100% { transform: translate(2%, -1%) rotate(-1deg); }
}

.landing-hero-inner {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 2rem 1.5rem;
    max-width: 600px;
}

.landing-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px var(--accent-glow);
    animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
    0%, 100% { box-shadow: 0 8px 32px var(--accent-glow); }
    50% { box-shadow: 0 8px 48px var(--accent-glow), 0 0 0 8px var(--accent-light); }
}

.landing-brand {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 0.35em;
    margin-bottom: 0.5rem;
    line-height: 1;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-tagline {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2rem;
    letter-spacing: 0.08em;
}

.landing-copy {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.landing-subtext {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.landing-login-link {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.landing-login-link a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.landing-login-link a:hover {
    text-decoration: underline;
}

/* Scroll indicator — bold, unmissable prompt at bottom of hero */
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent);
    text-decoration: none;
    z-index: 2;
    transition: color 0.2s, transform 0.2s;
}
.scroll-indicator:hover {
    color: var(--accent-hover);
    text-decoration: none;
    transform: translateX(-50%) translateY(4px);
}
.scroll-indicator-text {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.scroll-indicator-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: -2px;
}
.scroll-indicator-arrows svg:first-child {
    animation: scrollArrow1 1.8s ease-in-out infinite;
}
.scroll-indicator-arrows svg:last-child {
    margin-top: -14px;
    animation: scrollArrow2 1.8s ease-in-out infinite;
}
@keyframes scrollArrow1 {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}
@keyframes scrollArrow2 {
    0%, 100% { opacity: 0.2; transform: translateY(0); }
    50% { opacity: 0.7; transform: translateY(6px); }
}

/* ---------------------------------------------------------------------------
   Section 2 — Problem Statement
   --------------------------------------------------------------------------- */

.landing-problem {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.problem-lead {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.problem-lead strong {
    color: var(--accent);
}

.problem-body {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.problem-hook {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.6;
    font-style: italic;
}

/* ---------------------------------------------------------------------------
   Section 3 — How It Works
   --------------------------------------------------------------------------- */

.landing-how {
    background: var(--bg-primary);
}

.how-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 640px;
    margin: 0 auto;
}

.how-step {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.how-step:hover {
    box-shadow: 0 4px 20px var(--shadow);
    border-color: var(--accent);
}

.how-step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.how-step-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.how-step-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ---------------------------------------------------------------------------
   Section 4 — Features
   --------------------------------------------------------------------------- */

.landing-features {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.feature-card {
    padding: 1.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
    transition: box-shadow 0.3s cubic-bezier(0.4,0,0.2,1), border-color 0.3s, transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.feature-card:hover {
    box-shadow: 0 12px 32px var(--shadow), 0 0 0 1px var(--accent-light);
    border-color: var(--accent);
    transform: translateY(-4px);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-glow));
    color: var(--accent);
    margin-bottom: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover .feature-icon {
    transform: scale(1.08);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   Section 5 — Use Cases
   --------------------------------------------------------------------------- */

.landing-usecases {
    background: var(--bg-primary);
}

.usecases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    max-width: 760px;
    margin: 0 auto;
}

.usecase-card {
    padding: 1.5rem 1.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    border-left: 4px solid var(--accent);
    transition: box-shadow 0.2s;
}
.usecase-card:hover {
    box-shadow: 0 4px 20px var(--shadow);
}

.usecase-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.usecase-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   Section 6 — FAQ
   --------------------------------------------------------------------------- */

.landing-faq {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.faq-list {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.faq-item[open] {
    border-color: var(--accent);
}

.faq-item summary {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: color 0.15s;
}
.faq-item summary::-webkit-details-marker {
    display: none;
}
.faq-item summary::after {
    content: "+";
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}
.faq-item[open] summary::after {
    content: "\2212";
}
.faq-item summary:hover {
    color: var(--accent);
}

.faq-item p {
    padding: 0 1.25rem 1.15rem;
    font-size: 0.93rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ---------------------------------------------------------------------------
   Section 7 — Final CTA
   --------------------------------------------------------------------------- */

.landing-final-cta {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg-primary) 50%, var(--accent-light) 100%);
    text-align: center;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}
.landing-final-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.4;
    pointer-events: none;
}

.final-cta-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
}

.final-cta-body {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* ---------------------------------------------------------------------------
   Section 8 — Footer
   --------------------------------------------------------------------------- */

.landing-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    margin-bottom: 0.25rem;
}

.footer-brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.footer-brand-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-columns {
    display: flex;
    gap: 3rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
}

.footer-col a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-col a:hover {
    color: var(--accent);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* ---------------------------------------------------------------------------
   Landing Page — Responsive
   --------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .landing-section {
        padding: 3.5rem 0;
    }
    .landing-brand {
        font-size: 2.5rem;
        letter-spacing: 0.25em;
    }
    .landing-tagline {
        font-size: 1.1rem;
    }
    .landing-copy {
        font-size: 1rem;
    }
    .landing-logo {
        width: 56px;
        height: 56px;
        border-radius: 16px;
        margin-bottom: 1.5rem;
    }
    .landing-logo svg {
        width: 28px;
        height: 28px;
    }
    .section-title {
        font-size: 1.6rem;
    }
    .problem-lead {
        font-size: 1.3rem;
    }
    .problem-hook {
        font-size: 1.05rem;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .usecases-grid {
        grid-template-columns: 1fr;
    }
    .final-cta-title {
        font-size: 1.7rem;
    }
    .footer-top {
        flex-direction: column;
        gap: 2rem;
    }
    .footer-columns {
        flex-wrap: wrap;
        gap: 2rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------------------------------------------------------------------------
   Auth Pages (Login / Signup)
   --------------------------------------------------------------------------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg-primary) 50%, var(--accent-light) 100%);
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
}
.auth-brand:hover {
    text-decoration: none;
}

.auth-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
}

.auth-brand-text {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.auth-error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: left;
}

.auth-form {
    text-align: left;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.auth-field input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.auth-field input::placeholder {
    color: var(--text-muted);
}

.auth-btn {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.auth-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}
.auth-btn:hover::after {
    left: 100%;
}
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-oauth-buttons {
    display: flex;
    gap: 0.75rem;
}

.auth-oauth-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.auth-oauth-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
    text-decoration: none;
    box-shadow: 0 2px 8px var(--shadow);
}

.auth-switch {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.auth-switch a {
    color: var(--accent);
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Navbar User Section
   --------------------------------------------------------------------------- */

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
}

.nav-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-logout-btn {
    font-size: 0.82rem;
    padding: 0.35rem 0.6rem;
    color: var(--text-muted);
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.nav-logout-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
    text-decoration: none;
}

@media (max-width: 768px) {
    .nav-user {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        justify-content: center;
        width: 100%;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
    }
    .auth-card {
        padding: 2rem 1.5rem;
    }
    .auth-oauth-buttons {
        flex-direction: column;
    }
}
