:root {
    color-scheme: dark;
    --bg-color: #1a1e24;
    --panel-bg: #16181d;
    --text-main: #00E676;
    --text-muted: #00C853;
    --primary: #00E676;
    --primary-hover: #69F0AE;
    --accent: #00C853;
    --border: #2a2d36;
    --border-focus: #00E676;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.5), 0 10px 10px -5px rgba(0,0,0,0.3);
    --radius: 16px;
    --success: #10b981;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #2a3342 0%, #161b22 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column !important;
    align-items: center;
    justify-content: flex-start;
    padding: 0.85rem 1.5rem;
    position: relative;
    overflow-x: hidden;
}
/* Background Blobs for Modern Aesthetic */
.blob {
    position: fixed;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
    pointer-events: none;
}
.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0,230,118,0.08) 0%, rgba(0,230,118,0) 70%);
}
.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(0,200,83,0.05) 0%, rgba(0,200,83,0) 70%);
    animation-delay: -10s;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}
.app-container { width: 100%; max-width: 760px; z-index: 1; position: relative; margin: 0 auto; padding-top: 0.2rem; }

/* Top Navigation Bar & Clean Auth Header */
.hidden, #auth-signin-btn.hidden, #install-pwa-btn.hidden, #auth-profile-btn.hidden, #auth-user-menu.hidden, #exit-app-btn.hidden {
    display: none !important;
}

.web-nav-links {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.6rem !important;
    padding: 0.4rem 0 !important;
    margin: 0 0 0.85rem 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 10 !important;
    pointer-events: auto !important;
}

.web-nav-links > * {
    pointer-events: auto;
}

.nav-clean-btn,
#auth-signin-btn,
#install-pwa-btn,
#chrome-ext-btn,
#auth-profile-btn {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: #00E676 !important;
    font-family: inherit;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0.35rem 0.5rem !important;
    transition: color 0.2s ease !important;
    text-decoration: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.nav-clean-btn svg,
#auth-signin-btn svg,
#install-pwa-btn svg,
#chrome-ext-btn svg,
#auth-profile-btn svg {
    stroke: #00E676 !important;
    transition: stroke 0.2s ease !important;
}

.nav-clean-btn:hover,
#auth-signin-btn:hover,
#install-pwa-btn:hover,
#chrome-ext-btn:hover,
#auth-profile-btn:hover {
    color: #69F0AE !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
}

.nav-clean-btn:hover svg,
#auth-signin-btn:hover svg,
#install-pwa-btn:hover svg,
#chrome-ext-btn:hover svg,
#auth-profile-btn:hover svg {
    stroke: #69F0AE !important;
}

.nav-clean-btn.profile-pill {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #00E676 !important;
    border-radius: 0 !important;
    padding: 0.35rem 0.5rem !important;
}

.user-avatar-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #00E676;
    color: #121212;
    font-weight: 700;
    font-size: 0.75rem;
    line-height: 1;
}

.user-email-text {
    color: #00E676;
    font-size: 0.85rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hero {
    text-align: center;
    margin-bottom: 0.85rem;
}
.brand-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.3rem;
}
.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(0, 230, 118, 0.45));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
    user-select: none;
}
.brand-logo:hover {
    transform: scale(1.08) rotate(1deg);
    filter: drop-shadow(0 0 20px rgba(0, 230, 118, 0.75));
}
h1 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.15rem;
    line-height: 1.2;
    color: var(--text-main);
    text-shadow: 0 0 12px rgba(0, 230, 118, 0.35);
}
.highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.25;
}
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(15px) scale(0.98);
    display: none;
}
.panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}
.input-group {
    margin-bottom: 2rem;
}
label {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.2);
}
textarea, input[type="text"] {
    width: 100%;
    background: #1c1f26;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    resize: vertical;
    box-shadow: var(--shadow-sm);
}
textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 230, 118, 0.15);
}
textarea::placeholder {
    color: #555e70;
}
/* Layout additions for stacked OR UI */
.label-header {
    margin-bottom: 1.5rem;
}
.hint-text {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}
.sub-group {
    margin-bottom: 1rem;
}
.sub-label {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.2);
}
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.divider span {
    padding: 0 1rem;
}
.file-upload-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.file-btn {
    background: #1c1f26;
    border: 1px solid var(--border);
    color: var(--text-main);
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.file-btn:hover {
    background: #2a2d36;
    border-color: var(--primary-hover);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.1);
}
#file-chosen-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}
#reference-file-input, #cv-file-input {
    display: none;
}
/* Buttons */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.primary-btn {
    background: var(--primary);
    color: #16181d;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.3);
}
.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.5);
}
.primary-btn.outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-main);
}
.primary-btn.outline:hover {
    border-color: var(--text-main);
}
.secondary-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}
#btn-no-cv-action {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    min-width: 160px !important;
    font-weight: 700 !important;
}
.secondary-btn:hover {
    background: #1c1f26;
    color: var(--primary-hover);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.15);
}

/* PDF Action Bar & Frameless Action Buttons Alignment */
#pdf-action-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.85rem;
    margin: 0.5rem 0 1.25rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 230, 118, 0.2);
}

.frameless-action-btn,
#open-pdf-folder-btn,
#open-pdf-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--text-main);
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.frameless-action-btn:hover,
#open-pdf-folder-btn:hover,
#open-pdf-btn:hover {
    color: var(--primary-hover);
    transform: scale(1.15);
    filter: drop-shadow(0 0 10px rgba(0, 230, 118, 0.7));
}

.frameless-action-btn:active,
#open-pdf-folder-btn:active,
#open-pdf-btn:active {
    transform: scale(0.95);
}

.compile-btn {
    height: 42px;
    padding: 0 1.25rem;
    font-size: 0.92rem;
    font-weight: 700;
    min-width: 155px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 8px;
    box-sizing: border-box;
    white-space: nowrap;
}

/* Processing */
.processing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
}
.processing-header h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 0 12px rgba(0, 230, 118, 0.3);
}
.timer {
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    letter-spacing: 0.05em;
    line-height: 1.2;
    box-sizing: border-box;
}
.agent-track {
    position: relative;
    padding: 1rem 0;
}
.track-line {
    position: absolute;
    left: 1.25rem;
    top: 2rem;
    bottom: 2rem;
    width: 2px;
    background: var(--border);
    z-index: 1;
}
.track-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--primary);
    transition: height 0.5s ease;
}
.agent-node {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 1.15rem;
    row-gap: 0.2rem;
    align-items: center;
    position: relative;
    z-index: 2;
    margin-bottom: 1.35rem;
    opacity: 0.4;
    transition: all 0.3s ease;
}
.agent-node:last-child {
    margin-bottom: 0;
}
.agent-node.active {
    opacity: 1;
}
.agent-node.completed {
    opacity: 1;
}
.node-circle {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #1c1f26;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.3s ease;
    align-self: start;
    margin-top: 0.1rem;
}
.agent-node.active .node-circle {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 230, 118, 0.2);
    animation: radarPulse 1.8s infinite ease-out;
}
.agent-node.completed .node-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #16181d;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.4);
}
.node-label {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    font-weight: 600;
    font-size: 1.05rem;
    height: auto;
    line-height: 1.25;
    display: flex;
    align-items: center;
    white-space: normal;
}
.node-status {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    height: auto;
    line-height: 1.25;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    display: flex;
    align-items: center;
    transition: opacity 0.2s ease, max-height 0.3s ease;
    word-break: break-word;
    white-space: normal;
}
.agent-node.active .node-status {
    max-height: 3rem;
    opacity: 1;
    color: #00E676;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}
.agent-node.completed .node-status {
    max-height: 3rem;
    opacity: 0.8;
    color: rgba(0, 230, 118, 0.7);
}
.node-status.flipping {
    opacity: 0;
    transform: none;
}

/* Error Recovery Card */
.processing-error-container {
    margin-top: 1.5rem;
    padding: 1.15rem 1.35rem;
    background: rgba(28, 16, 20, 0.88);
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(239, 68, 68, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.processing-error-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ef4444;
    font-weight: 700;
    font-size: 0.95rem;
}

.processing-error-message {
    font-size: 0.84rem;
    color: #fca5a5;
    line-height: 1.45;
    word-break: break-word;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.55rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    margin: 0;
}

.processing-error-hint {
    font-size: 0.8rem;
    color: rgba(0, 230, 118, 0.85);
    margin: 0;
}

.processing-error-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.error-action-btn {
    font-size: 0.82rem;
    padding: 0.42rem 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Output Section */
#output-section,
#output-section .output-title-group h2,
#output-section .output-model-name,
#output-section .timer,
#output-section .output-action-btn,
#output-section .frameless-action-btn,
#output-section textarea,
#output-section button:not(.error-action-btn):not(.primary-btn):not(.compile-btn) {
    color: #00E676;
}

#output-section .primary-btn:not(.outline),
#output-section .compile-btn {
    color: #0B0F19 !important;
}

#output-section .primary-btn:not(.outline) svg,
#output-section .compile-btn svg {
    stroke: #0B0F19 !important;
}

.output-header {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.output-header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    height: auto;
    width: 100%;
}

.output-title-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
}

.output-title-group h2,
.output-header h2 {
    margin: 0;
    white-space: nowrap;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #00E676;
}

.output-model-name {
    font-size: 0.78rem;
    color: #00E676;
    margin-top: 0.25rem;
    font-weight: 500;
}

.output-controls-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

#output-stopwatch.timer {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    letter-spacing: 0.05em;
    line-height: 1.2;
    box-sizing: border-box;
}

.output-buttons-row {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: nowrap; /* strictly keep all buttons in 1 line */
}

.output-action-btn {
    white-space: nowrap;
    width: 145px; /* fixed length for all three buttons */
    min-width: 145px;
    max-width: 145px;
    height: 40px; /* increased, comfortable touch size */
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex-shrink: 0;
    box-sizing: border-box;
}
.code-wrapper {
    background: #1e293b;
    border: 1px solid #00E676;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 0 15px rgba(0, 230, 118, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.code-wrapper:focus-within {
    border-color: #00E676;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.3);
}
.code-wrapper textarea {
    width: 100%;
    min-height: 400px;
    background: transparent;
    border: none;
    outline: none;
    resize: vertical;
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: #00E676;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 14, 20, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: modalBackdropFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.modal.hidden, #auth-signin-btn.hidden, #install-pwa-btn.hidden, #auth-profile-btn.hidden, #auth-user-menu.hidden, #exit-app-btn.hidden {
    display: none !important;
}
.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    position: relative;
    box-shadow: var(--shadow-lg), 0 0 35px rgba(0, 230, 118, 0.08);
    background: var(--panel-bg);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: var(--radius);
    animation: modalPopIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.modal,
.modal p,
.modal label,
.modal-content,
.modal input:not([type="checkbox"]):not([type="color"]),
.modal textarea {
    color: #00E676;
}
.modal h2,
.modal h3 {
    color: #00E676;
}
.hidden, #auth-signin-btn.hidden, #install-pwa-btn.hidden, #auth-profile-btn.hidden, #auth-user-menu.hidden, #exit-app-btn.hidden {
    display: none !important;
}

/* Switch Model Button & Container */
.switch-model-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.switch-model-hint {
    font-size: 0.84rem;
    color: #00E676;
    letter-spacing: 0.02em;
    text-align: center;
    font-weight: 500;
}

.switch-model-btn {
    padding: 0.5rem 1.15rem;
    font-size: 0.84rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.45);
    background: rgba(250, 204, 21, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.switch-model-btn:hover {
    background: rgba(250, 204, 21, 0.18);
    border-color: #facc15;
    color: #fef08a;
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.25);
    transform: translateY(-1px);
}

.model-success-banner {
    animation: fadeIn 0.3s ease;
}

/* Compact API Manager Modal */
.settings-modal-content {
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    background: #14171d;
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.api-list-compact {
    flex: 1;
    overflow-y: auto;
    margin-top: 0.55rem;
    padding-right: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.settings-modal-footer {
    margin-top: 0.65rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    align-items: center;
}

.api-row {
    background: rgba(22, 27, 34, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.15s ease;
}

.api-row:hover {
    border-color: rgba(0, 230, 118, 0.35);
    background: rgba(25, 31, 39, 0.85);
}

.api-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.45rem;
}

.api-row-body {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
}

.api-badge {
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.08rem 0.4rem;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid rgba(148, 163, 184, 0.12);
    white-space: nowrap;
}

/* Version 1.2.10: Read-Only API Configuration Cards */
.api-display-card {
    background: rgba(18, 22, 28, 0.85);
    border: 1px solid rgba(0, 230, 118, 0.22);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.api-display-card:hover {
    border-color: rgba(0, 230, 118, 0.5);
    background: rgba(22, 28, 36, 0.95);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 10px rgba(0, 230, 118, 0.12);
}

.api-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.api-card-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.api-priority-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #00E676;
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.3);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-family: monospace;
}

.api-card-nickname {
    font-size: 0.92rem;
    font-weight: 600;
    color: #00E676;
}

.api-card-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(0, 230, 118, 0.1);
}

.api-detail-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
}

.api-detail-label {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 500;
}

.api-detail-value {
    color: #00E676;
    font-size: 0.76rem;
    font-family: 'Consolas', 'Courier New', monospace;
    background: rgba(0, 230, 118, 0.06);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 230, 118, 0.18);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.provider-badge {
    font-size: 0.67rem;
    font-weight: 600;
    padding: 0.08rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-block;
    white-space: nowrap;
}

.provider-badge.google {
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.provider-badge.openrouter {
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.provider-badge.logfare {
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.provider-badge.custom {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.logfare-model-box {
    animation: fadeIn 0.15s ease-out;
}

.logfare-model-box.hidden, #auth-signin-btn.hidden, #install-pwa-btn.hidden, #auth-profile-btn.hidden, #auth-user-menu.hidden, #exit-app-btn.hidden {
    display: none !important;
}

.api-input, .api-select {
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 5px;
    color: #00E676;
    font-family: inherit;
    padding: 0.22rem 0.45rem;
    font-size: 0.82rem;
    height: 28px;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.api-select {
    cursor: pointer;
}

.api-input:focus, .api-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.15);
}

/* Re-analyze Model Selector (Version 1.2.10) */
#reanalyze-model-select {
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    font-size: 0.86rem !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    padding: 0.45rem 0.75rem !important;
    background: #0d1117 !important;
    border: 1px solid rgba(0, 230, 118, 0.45) !important;
    color: #00E676 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

#reanalyze-model-select:focus {
    border-color: #00E676 !important;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.35) !important;
    outline: none !important;
}

#reanalyze-model-select option {
    background: #0d1117 !important;
    color: #00E676 !important;
    font-size: 0.85rem !important;
    padding: 0.4rem !important;
}

/* Unicolor Green Key Picker Button */
.btn-key-picker {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.35);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    color: var(--primary);
}

.btn-key-picker:hover {
    background: rgba(0, 230, 118, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.25);
}

.btn-key-picker:active {
    transform: scale(0.95);
}

/* Custom Unicolor Key Dropdown Menu (matches Cut/Copy/Paste context menu) */
.key-dropdown-menu {
    position: fixed;
    z-index: 100000;
    min-width: 220px;
    max-width: 320px;
    background: #181c22;
    border: 1px solid rgba(0, 230, 118, 0.35);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 14px rgba(0, 230, 118, 0.12);
    border-radius: 8px;
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    backdrop-filter: blur(12px);
    user-select: none;
    box-sizing: border-box;
    animation: fadeInScale 0.1s ease;
}

.key-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #a7f3d0;
    transition: background 0.15s ease, color 0.15s ease;
}

.key-dropdown-item:hover {
    background: rgba(0, 230, 118, 0.12);
    color: var(--primary);
}

.key-dropdown-item.active {
    color: var(--primary);
    font-weight: 600;
}

.key-dropdown-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.15);
    margin: 0.2rem 0.3rem;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.api-radio-label {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 230, 118, 0.22);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0, 230, 118, 0.03);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.api-radio-label:hover:not(.disabled) {
    border-color: #00E676;
    background: rgba(0, 230, 118, 0.08);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.12);
}

.api-radio-label.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.2);
}

.api-radio-label input[type="radio"],
.api-radio-label input[type="checkbox"] {
    accent-color: var(--primary);
    transform: scale(1.15);
    cursor: pointer;
}

.cv-action-fixed-btn {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    padding: 0 0.85rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    align-self: flex-start !important;
}

.cv-buttons-group {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    flex-shrink: 0;
    align-self: flex-start;
}

.selected-cv-badge {
    font-size: 0.74rem;
    font-family: 'JetBrains Mono', monospace;
    color: #00E676;
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.3);
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.recent-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #00E676;
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid #00E676;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
}

#exit-app-btn {
    color: #ef4444 !important;
    transition: all 0.2s ease;
}

#exit-app-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2) !important;
}

/* ==========================================================================
   Milestone 2 (R3): Application Footer & Branding Styles
   ========================================================================== */

/* 1. In-flow Footer Container */
.app-footer {
    margin-top: 2rem;
    padding: 1.25rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    text-align: center;
    position: relative;
    z-index: 1;
    width: 100%;
    font-size: 0.85rem;
    color: rgba(0, 230, 118, 0.65);
    user-select: none;
    box-sizing: border-box;
}

/* 2. Copyright Hyperlink Styling */
.app-footer a,
#copyright-link {
    color: rgba(0, 230, 118, 0.85);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 1px dotted rgba(0, 230, 118, 0.35);
    padding-bottom: 1px;
    transition: color 0.2s ease, border-color 0.2s ease, text-shadow 0.2s ease;
}

#copyright-link:hover,
.app-footer a:hover {
    color: var(--primary); /* Cyber Green: #00E676 */
    border-bottom: 1px solid var(--primary);
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

.app-footer a:focus-visible,
#copyright-link:focus-visible {
    color: var(--primary);
    border-bottom: 1px solid var(--primary);
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 2px;
}

/* 3. Decorative Separator */
.footer-separator {
    color: rgba(0, 230, 118, 0.35);
    font-size: 0.75rem;
    user-select: none;
}

/* 4. Version Badge Styling */
.version-badge {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #00E676;
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    user-select: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.version-badge:hover,
#app-version:hover {
    color: #69F0AE;
    background: rgba(0, 230, 118, 0.12);
    border-color: rgba(0, 230, 118, 0.4);
}

/* 5. Responsive Behavior Across Window Dimensions */
@media (max-width: 540px) {
    .app-footer {
        margin-top: 1.5rem;
        padding: 1rem 0;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.45rem;
    }
}

/* Inline Spinner for Active Compiling Feedback */
.inline-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 230, 118, 0.35);
    border-top-color: #00E676;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Custom Right-Click Context Menu */
.custom-context-menu {
    position: fixed;
    z-index: 10000;
    min-width: 175px;
    background: #181c22;
    border: 1px solid rgba(0, 230, 118, 0.35);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 14px rgba(0, 230, 118, 0.12);
    border-radius: 10px;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    backdrop-filter: blur(12px);
    user-select: none;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.1s ease, transform 0.1s ease;
}

.custom-context-menu.hidden, #auth-signin-btn.hidden, #install-pwa-btn.hidden, #auth-profile-btn.hidden, #auth-user-menu.hidden, #exit-app-btn.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: #a7f3d0;
    transition: background 0.15s ease, color 0.15s ease;
}

.context-menu-item:hover {
    background: rgba(0, 230, 118, 0.12);
    color: var(--primary);
}

.context-menu-item.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.context-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    color: var(--text-muted);
}

.context-menu-item:hover .context-menu-icon {
    color: var(--primary);
}

.context-menu-label {
    flex: 1;
}

.context-menu-shortcut {
    font-size: 0.7rem;
    color: rgba(0, 230, 118, 0.45);
    font-family: 'Courier New', Courier, monospace;
}

.context-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.25rem 0.2rem;
}

/* Provider Tabs in Selection Modal */
.provider-tabs-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.provider-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(0, 230, 118, 0.22);
    border-radius: 8px;
    color: rgba(0, 230, 118, 0.75);
    cursor: pointer;
    transition: all 0.2s ease;
}

.provider-tab-btn:hover {
    border-color: #00E676;
    color: #00E676;
    background: rgba(0, 230, 118, 0.06);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.1);
}

.provider-tab-btn.active {
    border-color: #00E676;
    background: rgba(0, 230, 118, 0.12);
    color: #00E676;
    box-shadow: 0 0 14px rgba(0, 230, 118, 0.2);
}

.provider-tab-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: inherit;
}

.provider-tab-count {
    font-size: 0.72rem;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    background: rgba(0, 230, 118, 0.1);
    color: #00E676;
    border: 1px solid rgba(0, 230, 118, 0.2);
    font-weight: 600;
}

.provider-tab-btn.active .provider-tab-count {
    background: rgba(0, 230, 118, 0.25);
    border-color: rgba(0, 230, 118, 0.4);
}

.subpanel-header-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #00E676;
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.selection-items-list {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-right: 0.25rem;
    width: 100%;
    box-sizing: border-box;
}

.empty-provider-state {
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px dashed rgba(0, 230, 118, 0.3);
    border-radius: 8px;
    background: rgba(0, 230, 118, 0.03);
}

/* ==========================================================================
   Global Cyber Green Scrollbars (Entire App)
   ========================================================================== */

/* Modern Standard Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 230, 118, 0.5) rgba(10, 15, 29, 0.85);
}

/* WebKit / Chromium (WebView2, Chrome, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 15, 29, 0.85);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 230, 118, 0.45);
    border-radius: 4px;
    border: 1px solid rgba(0, 230, 118, 0.2);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #00E676;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.7);
}

::-webkit-scrollbar-corner {
    background: rgba(10, 15, 29, 0.85);
}

/* ==========================================================================
   Version 1.2.0: Fluid Micro-Interactions, Modal Animations & Polish
   ========================================================================== */

/* Keyframes for Smooth Modal Pop-in & Backdrop Blur */
@keyframes modalBackdropFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(14px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Tactile Button Press Scaling & Micro-Interactions */
button, .primary-btn, .secondary-btn, .file-btn, .switch-model-btn, .quick-link-btn, .provider-tab-btn, .provider-chip {
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

button:active:not(:disabled), .primary-btn:active:not(:disabled), .secondary-btn:active:not(:disabled), .file-btn:active:not(:disabled), .provider-chip:active {
    transform: scale(0.97) translateY(1px);
}

/* Smooth Accordion Expansion for Override Default CV */
details.cv-source-details summary {
    cursor: pointer;
    transition: color 0.2s ease;
}

details.cv-source-details summary:hover {
    color: var(--primary-hover);
}

details.cv-source-details[open] summary ~ * {
    animation: accordionSweep 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes accordionSweep {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Breathing Radar Pulse Animation for Active Step in Generation Pipeline */
@keyframes radarPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.65), 0 0 10px rgba(0, 230, 118, 0.4);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(0, 230, 118, 0), 0 0 20px rgba(0, 230, 118, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0), 0 0 10px rgba(0, 230, 118, 0.1);
    }
}

/* Drag-and-Drop Priority Reordering Styles */
.drag-handle {
    cursor: grab;
    user-select: none;
    padding: 0.2rem 0.35rem;
    color: #00E676;
    font-size: 1.15rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.65;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.drag-handle:hover {
    opacity: 1;
    transform: scale(1.15);
}

.drag-handle:active {
    cursor: grabbing;
}

.api-row {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.api-row:hover {
    border-color: rgba(0, 230, 118, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 8px rgba(0, 230, 118, 0.1);
}

.api-row.dragging,
.api-display-card.dragging {
    opacity: 0.38;
    background: rgba(0, 230, 118, 0.04);
    border: 1px dashed #00E676 !important;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.25);
    transform: scale(0.99);
}

.api-row.drag-over-top,
.api-display-card.drag-over-top {
    border-top: 2px solid #00E676 !important;
    box-shadow: 0 -4px 12px rgba(0, 230, 118, 0.4);
}

.api-row.drag-over-bottom,
.api-display-card.drag-over-bottom {
    border-bottom: 2px solid #00E676 !important;
    box-shadow: 0 4px 12px rgba(0, 230, 118, 0.4);
}

/* Add API Modal Theme Styling (Zero White Colors, Pure Cyber-Green) */
.add-api-modal-content {
    background: #14171d !important;
    border: 1px solid rgba(0, 230, 118, 0.35) !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 230, 118, 0.15) !important;
}

.add-api-label {
    display: block;
    font-size: 0.82rem;
    color: #00E676;
    margin-bottom: 0.35rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.custom-input {
    background: #0f172a !important;
    border: 1px solid rgba(0, 230, 118, 0.35) !important;
    border-radius: 8px !important;
    color: #00E676 !important;
    font-family: inherit;
    font-size: 0.88rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.custom-input:focus {
    border-color: #00E676 !important;
    outline: none !important;
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.4), inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
    background: #111a30 !important;
}

.custom-input::placeholder {
    color: rgba(0, 230, 118, 0.35) !important;
}

/* Provider Choice Chips for Add API Modal */
.provider-choice-chips {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.provider-chip {
    padding: 0.38rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(0, 230, 118, 0.3);
    background: rgba(15, 23, 42, 0.85);
    color: rgba(0, 230, 118, 0.75);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.provider-chip:hover {
    border-color: #00E676;
    color: #00E676;
    background: rgba(0, 230, 118, 0.1);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
}

.provider-chip.active {
    background: rgba(0, 230, 118, 0.2);
    border-color: #00E676;
    color: #00E676;
    font-weight: 600;
    box-shadow: 0 0 14px rgba(0, 230, 118, 0.3);
}

/* Floating Cyber Toast Notification System */
.toast-container {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100000 !important;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    pointer-events: none;
    max-width: 380px;
}

.toast {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(0, 230, 118, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #00E676;
    padding: 0.75rem 1.1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 230, 118, 0.2);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-error {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 16px rgba(239, 68, 68, 0.2);
}

.toast.toast-warning {
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 16px rgba(245, 158, 11, 0.2);
}

.toast.toast-info {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.2);
}

.toast-fadeOut {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-35px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ==========================================================================
   Version 1.2.10: CV Theme Customizer, Dynamic Sections & Pipeline Polish
   ========================================================================== */

/* Universal Placeholder Color */
::placeholder {
    color: rgba(0, 230, 118, 0.35) !important;
    opacity: 1;
}

/* Exit App Button Unified Red Styling */
#exit-app-btn {
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    background: rgba(30, 10, 10, 0.6) !important;
    color: #ef4444 !important;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

#exit-app-btn:hover {
    border-color: rgba(239, 68, 68, 0.8) !important;
    background: rgba(239, 68, 68, 0.15) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35) !important;
    color: #f87171 !important;
}

/* API Config Link Cyber Transitions */
#config-link {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

#config-link:hover {
    color: #00E676;
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

/* Customize CV Modal & Tabs */
#customization-modal {
    align-items: flex-start !important;
    padding-top: max(2.5rem, 5vh) !important;
    padding-bottom: 2rem !important;
    overflow-y: auto;
}

.customization-modal-container {
    max-width: 780px !important;
    width: 92% !important;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden !important; /* Eliminate big outer scrollbar on modal */
    box-sizing: border-box !important;
}

.customization-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 230, 118, 0.2);
    flex-shrink: 0;
}

.custom-tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0, 230, 118, 0.2);
    margin-bottom: 1.25rem;
    padding-bottom: 0.25rem;
}

.custom-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.25rem;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-tab-btn:hover {
    color: var(--text-main);
    background: rgba(0, 230, 118, 0.05);
}

.custom-tab-btn.active {
    color: #00E676;
    background: rgba(0, 230, 118, 0.1);
}

.custom-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 0;
    right: 0;
    height: 2px;
    background: #00E676;
    box-shadow: 0 0 8px #00E676;
}

.custom-tab-pane {
    display: none;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.custom-tab-pane.active {
    display: block;
}

#tab-pane-colors {
    max-height: calc(85vh - 170px);
    overflow-y: auto;
    padding-right: 0.35rem;
}

#tab-pane-sections {
    display: none;
    flex-direction: column;
    overflow: hidden !important; /* No outer scrollbar for sections tab */
    max-height: calc(85vh - 170px);
}

#tab-pane-sections.active {
    display: flex;
}

/* Palette Preset Cards */
.palette-group-title {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 1rem 0 0.6rem 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.palette-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.4rem 0.45rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
    min-width: 0;
}

.palette-card:hover {
    border-color: rgba(0, 230, 118, 0.4);
    background: rgba(0, 230, 118, 0.05);
    transform: translateY(-2px);
}

.palette-card.active {
    border-color: #00E676;
    background: rgba(0, 230, 118, 0.1);
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.25);
}

.palette-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.palette-card-name {
    font-size: 0.62rem;
    font-weight: 400;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

.palette-card-check {
    width: 12px;
    height: 12px;
    color: #00E676;
    opacity: 0;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.palette-card.active .palette-card-check {
    opacity: 1;
}

.palette-swatches {
    display: flex;
    height: 14px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.palette-swatch {
    flex: 1;
    height: 100%;
}

/* Custom 3-Color Pickers & Live Preview */
.color-customizer-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.color-pickers-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.color-input-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 25, 18, 0.6);
    border: 1px solid rgba(0, 230, 118, 0.22);
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    min-height: 36px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.color-input-item:hover {
    border-color: rgba(0, 230, 118, 0.5);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.15);
}

.color-input-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #00E676;
}

.color-input-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.color-picker-box {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 1px solid rgba(0, 230, 118, 0.4);
    border-radius: 5px;
    cursor: pointer;
    background: transparent;
    padding: 0;
    color-scheme: dark;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.color-picker-box:hover {
    border-color: #00E676;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

.color-picker-box::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-box::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

input[type="text"].color-hex-text {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 2px 4px !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.82rem !important; /* equal to font size of Background label */
    line-height: 20px !important;
    text-align: center !important;
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(0, 230, 118, 0.3) !important;
    border-radius: 5px !important;
    color: #00E676 !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

input[type="text"].color-hex-text:focus {
    outline: none !important;
    border-color: #00E676 !important;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.35) !important;
}

/* Live Mini CV Preview */
.live-cv-preview-container {
    display: flex;
    flex-direction: column;
}

.mini-cv-preview {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.25s ease;
    position: relative;
    overflow: hidden;
}

.mini-preview-html-content {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
}

.mini-preview-pdf-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 220px;
}

.mini-preview-pdf-wrapper iframe {
    width: 100%;
    height: 220px;
    border: none;
    border-radius: 6px;
    background: #ffffff;
}

.mini-preview-pdf-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0.12;
    transition: background-color 0.2s ease;
}

.mini-preview-header {
    text-align: center;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    padding-bottom: 0.4em;
    margin-bottom: 0.4em;
}

.mini-preview-name {
    font-size: 1.3em;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.mini-preview-contact {
    font-size: 0.82em;
    margin-top: 0.2em;
    opacity: 0.85;
}

.mini-preview-section-title {
    font-size: 0.95em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    padding-bottom: 0.2em;
    margin-top: 0.35em;
}

.mini-preview-body {
    font-size: 0.82em;
    line-height: 1.35;
    opacity: 0.9;
}

/* Section Layout & Reordering Tab */
.section-reorder-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 230, 118, 0.15);
}

.sections-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 auto;
    max-height: 202px;
    overflow-y: auto;
    padding-right: 0.4rem;
}

.section-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 230, 118, 0.02);
    border: 1px solid rgba(0, 230, 118, 0.15);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
    gap: 0.75rem;
    user-select: none;
}

.section-item-row:hover {
    border-color: rgba(0, 230, 118, 0.3);
    background: rgba(0, 230, 118, 0.03);
}

.section-item-row.dragging {
    opacity: 0.38;
    background: rgba(0, 230, 118, 0.04);
    border: 1px dashed #00E676 !important;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.25);
    transform: scale(0.99);
}

.section-item-row.drag-over-top {
    border-top: 2px solid #00E676 !important;
    box-shadow: 0 -4px 12px rgba(0, 230, 118, 0.4);
}

.section-item-row.drag-over-bottom {
    border-bottom: 2px solid #00E676 !important;
    box-shadow: 0 4px 12px rgba(0, 230, 118, 0.4);
}

.section-item-row.disabled {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.2);
}

.section-item-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
}

.section-reorder-btns {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reorder-btn {
    background: transparent;
    border: 1px solid rgba(0, 230, 118, 0.2);
    color: var(--text-muted);
    border-radius: 3px;
    width: 20px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    line-height: 1;
    padding: 0;
    transition: all 0.15s ease;
}

.reorder-btn:hover {
    color: #00E676;
    border-color: #00E676;
    background: rgba(0, 230, 118, 0.1);
}

.section-checkbox {
    accent-color: #00E676;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.section-name-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-item-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-type-badge {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(0, 230, 118, 0.1);
    color: #00E676;
    border: 1px solid rgba(0, 230, 118, 0.25);
    font-family: 'JetBrains Mono', monospace;
}

.section-delete-btn {
    background: transparent;
    border: none;
    color: rgba(239, 68, 68, 0.6);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.section-delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.section-edit-btn {
    background: transparent;
    border: none;
    color: rgba(0, 230, 118, 0.7);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.section-edit-btn:hover {
    color: #00E676;
    background: rgba(0, 230, 118, 0.15);
}

.section-inline-edit-input {
    background: #0d1117 !important;
    border: 1px solid #00E676 !important;
    border-radius: 4px !important;
    color: #00E676 !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    padding: 2px 8px !important;
    outline: none !important;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.3) !important;
    min-width: 140px;
    box-sizing: border-box !important;
    line-height: 1.2 !important;
}

/* Add Custom Section Form */
.add-section-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(0, 230, 118, 0.15);
    flex-shrink: 0;
}

.add-section-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
}

.add-section-type-select {
    background: rgba(10, 25, 18, 0.9);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
}

/* Confirmation / Intermediate Modal */
.theme-summary-card {
    background: rgba(0, 230, 118, 0.04);
    border: 1px solid rgba(0, 230, 118, 0.2);
    border-radius: 8px;
    padding: 0.85rem 1rem;
}

/* Modal Stacking Hierarchy & No CV Modal */
#no-cv-modal {
    z-index: 20000 !important;
}

#reanalyze-choice-modal {
    z-index: 15000 !important;
}

/* ==========================================================================
   Version 1.3.02: Mobile Responsive Polish & PWA Layout Support
   ========================================================================== */


.user-avatar-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00E676;
    color: #0b0f19;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
}
.user-email-text {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-only-btn {
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0.3rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Uploaded Word Document CV Card (Issue 4) */
.word-cv-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.3);
    animation: fadeIn 0.25s ease-out;
}
.word-cv-content-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}
.word-cv-icon {
    flex-shrink: 0;
    color: #00E676;
}
.word-cv-meta {
    min-width: 0;
    flex: 1;
}
.word-cv-title-line {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.word-cv-filename {
    font-weight: 600;
    color: #fff;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.84rem;
}
.word-cv-filesize {
    font-size: 0.74rem;
    color: var(--text-muted);
}
.word-cv-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    background: rgba(0, 230, 118, 0.2);
    color: #00E676;
    font-weight: 600;
}
.word-cv-badge.inactive {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}
.word-cv-note {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 0.15rem;
}
.word-cv-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem 0.5rem !important;
    }

    /* Responsive Container & Spacing (clean static layout) */
    .app-container {
        padding: 0.85rem 0.85rem 2rem 0.85rem !important;
        max-width: 100%;
        width: 100%;
    }

    .web-nav-links {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.25rem 0 !important;
        margin: 0 0 0.65rem 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        z-index: 10 !important;
    }

    .hero {
        margin-bottom: 1.25rem;
        text-align: center;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
    }

    .hero h1 {
        font-size: 1.45rem !important;
        letter-spacing: -0.5px;
    }

    .hero p {
        font-size: 0.8rem !important;
        line-height: 1.4;
        padding: 0 0.5rem;
    }

    /* Panels & Input Groups */
    .panel {
        padding: 1.15rem 0.85rem !important;
        border-radius: 12px;
    }

    .input-group {
        margin-bottom: 1.25rem !important;
    }

    .input-group label,
    .form-group label {
        font-size: 0.88rem !important;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="url"],
    textarea,
    select,
    #job-details,
    #cv-paste {
        font-size: 0.84rem !important;
        padding: 0.75rem !important;
    }

    /* CV Section 2 Header Stacking */
    .cv-source-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.6rem !important;
    }

    .cv-buttons-group {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .cv-action-fixed-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.82rem;
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Bottom Action Bar Stack */
    .action-bar {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
    }

    .action-bar button,
    .action-bar .primary-btn,
    .action-bar .secondary-btn {
        width: 100% !important;
        min-height: 44px !important;
        justify-content: center !important;
        font-size: 0.92rem;
    }

    /* Output Section & Action Bars */
    .output-header { flex-direction: column !important; align-items: center !important; gap: 0.2rem !important;
    }

    .output-header-top-row { flex-direction: column !important; align-items: center !important; gap: 0.1rem !important;
        height: auto !important;
        min-height: auto !important;
    }

    .output-title-group {
        align-items: center !important;
        text-align: center !important;
    }

    .output-buttons-row { width: 100% !important; flex-direction: row !important; justify-content: space-between !important; gap: 0 !important; }

    .output-action-btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 44px !important;
    }

    .code-wrapper textarea {
        min-height: 250px !important;
    }
    .output-pdf-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 0.5rem !important;
    }

    .output-pdf-bar button {
        width: 100% !important;
        min-height: 44px !important;
        justify-content: center !important;
    }

    /* Processing Track: Stack agent nodes cleanly with status below label without increasing box height */
    .agent-track {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: stretch !important;
        padding: 0.5rem 0 !important;
    }

    .track-line {
        display: none !important;
    }

    .agent-node {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 2.25rem 1fr !important;
        grid-template-rows: auto auto !important;
        column-gap: 0.85rem !important;
        row-gap: 0.15rem !important;
        margin-bottom: 0.75rem !important;
        text-align: left !important;
    }

    .node-circle {
        grid-column: 1 !important;
        grid-row: 1 / span 2 !important;
        width: 2.25rem !important;
        height: 2.25rem !important;
        flex-shrink: 0 !important;
        align-self: start !important;
        margin-top: 0.1rem !important;
    }

    .node-label {
        grid-column: 2 !important;
        grid-row: 1 !important;
        margin: 0 !important;
        font-size: 0.92rem !important;
        line-height: 1.25 !important;
        white-space: normal !important;
    }

    .node-status {
        grid-column: 2 !important;
        grid-row: 2 !important;
        margin: 0 !important;
        font-size: 0.78rem !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    /* All Modals: Responsive Centered Overlay */
    .modal {
        height: 100dvh !important;
        padding: 0.5rem !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .modal:not(.hidden) {
        display: flex !important;
    }

    .modal.hidden, #auth-signin-btn.hidden, #install-pwa-btn.hidden, #auth-profile-btn.hidden, #auth-user-menu.hidden, #exit-app-btn.hidden {
        display: none !important;
    }

    .modal-content,
    .settings-modal-content,
    .customization-modal-container,
    .customization-modal-card {
        width: min(94vw, 440px) !important;
        max-width: min(94vw, 440px) !important;
        max-height: 85dvh !important;
        padding: 1.25rem 1rem !important;
        margin: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Provider Selector Tabs */
    .provider-tabs-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.4rem !important;
    }

    .provider-tab-btn {
        padding: 0.5rem 0.4rem !important;
        font-size: 0.8rem !important;
        justify-content: center !important;
    }

    /* Palette Grid on Mobile */
    .palette-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.4rem !important;
    }

    /* Customization Modal: Hide desktop paper preview panel to prevent overflow */
    .customization-tabs {
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 0.35rem !important;
    }

    .customization-body {
        flex-direction: column !important;
        max-height: none !important;
    }

    .customization-preview-panel,
    .live-cv-preview-container {
        display: none !important;
    }

    .color-customizer-split {
        grid-template-columns: 1fr !important;
        display: block !important;
    }

    .customization-controls-panel {
        width: 100% !important;
        padding-right: 0 !important;
    }

    /* Footer */
    .app-footer {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.45rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0.5rem 0.65rem 1.5rem 0.65rem;
    }

    .hero h1 {
        font-size: 1.45rem !important;
    }

    .hero p {
        font-size: 0.8rem !important;
    }

    .panel {
        padding: 1.15rem 0.85rem !important;
    }

    #job-details, #cv-paste {
        font-size: 0.84rem !important;
        padding: 0.75rem !important;
    }

    .modal-content,
    .settings-modal-content,
    .customization-modal-container {
        width: min(94vw, 440px) !important;
        max-height: 85dvh !important;
        padding: 1rem 0.75rem !important;
    }
}





.output-buttons-row .nav-clean-btn, #upload-word-cv-btn { transition: filter 0.2s ease, transform 0.15s ease !important; }
.output-buttons-row .nav-clean-btn:hover, #upload-word-cv-btn:hover { filter: drop-shadow(0 0 10px rgba(0, 230, 118, 0.8)) !important; transform: scale(1.08) !important; }
.output-buttons-row .nav-clean-btn:active, #upload-word-cv-btn:active { transform: scale(0.95) !important; }


/* In-App Notification Permission Prompt (Windows bottom-right style) */
.notif-reminder-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    width: min(340px, calc(100vw - 32px));
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 230, 118, 0.35);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 230, 118, 0.15);
    color: #E2E8F0;
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.notif-reminder-toast.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.notif-reminder-toast.fade-out {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 1s ease, transform 1s ease;
}

.notif-close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s;
}

.notif-close-btn:hover {
    color: #00E676;
}

.notif-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notif-icon {
    flex-shrink: 0;
    padding-top: 2px;
    color: #00E676;
}

.notif-text {
    flex: 1;
}

.notif-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #F8FAFC;
    margin-bottom: 3px;
}

.notif-desc {
    font-size: 0.8rem;
    color: #94A3B8;
    line-height: 1.35;
    margin-bottom: 10px;
}

.notif-enable-btn {
    background: #00E676;
    color: #0B0F19;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.notif-enable-btn:hover {
    background: #00C853;
}
