:root {
    /* Matcha & Sage Palette */
    --primary: #2d3436;
    --primary-hover: #000000;

    /* New Green Theme */
    --accent: #4A5D50;
    /* Dark Grayish Green */
    --accent-light: #7B9C86;
    --accent-bg: #F2F8F4;

    --text: #2d3436;
    --text-light: #636e72;
    --text-lighter: #b2bec3;

    --bg-page: #ffffff;
    --bg-panel: #fdfdfd;

    --border: #dfe6e9;
    --border-focus: #7B9C86;

    --success: #00b894;
    --error: #d63031;

    --radius-s: 12px;
    --radius-m: 20px;
    --radius-l: 32px;

    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 60px rgba(74, 93, 80, 0.12);

    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
    /* Prevent body scroll, handle in panels */
}

/* Split Layout */
.split-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Expanded State for Steps 2 & 3 */
.split-layout.expanded .left-panel {
    width: 25%;
}

.split-layout.expanded .right-panel {
    width: 75%;
}

/* Left Panel - Decorative */
.left-panel {
    width: 45%;
    transition: width 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Match --transition curve */
    background-color: #A9D9BB;
    /* Matcha Green */
    background-image: linear-gradient(135deg, #A9D9BB 0%, #C3E6D0 100%);
    /* Subtle gradient */
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.5rem;
    z-index: 10;
}

.logo-icon {
    color: var(--accent);
    display: flex;
    align-items: center;
}

.decorative-content {
    position: relative;
    z-index: 10;
}

.decorative-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--primary);
    letter-spacing: -0.03em;
    transition: font-size 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.split-layout.expanded .decorative-content h1 {
    font-size: 3rem;
}

.decorative-content p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 400px;
}

.decorative-footer {
    font-size: 0.9rem;
    color: var(--text-light);
    /* Slightly darker for better contrast on green */
    z-index: 10;
}

.decorative-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.decorative-footer a:hover {
    border-bottom-color: var(--accent);
    opacity: 0.8;
}

/* Floating Shapes */
.floating-shape {
    position: absolute;
    color: var(--accent);
    z-index: 1;
    opacity: 0.6;
}

.floating-shape svg {
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    top: -80px;
    right: 20px;
    transform: scale(1.5);
}

.shape-1 svg {
    animation-delay: 0s;
}

.shape-2 {
    bottom: 100px;
    right: -40px;
    transform: scale(2);
}

.shape-2 svg {
    animation-delay: 2s;
}

.shape-3 {
    top: 40%;
    left: -20px;
    transform: scale(1.2);
}

.shape-3 svg {
    animation-delay: 4s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* Right Panel - App */
.right-panel {
    width: 55%;
    transition: width 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: white;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center vertically if content is short */
    position: relative;
}

.app-container {
    width: 100%;
    max-width: 600px;
    padding: 40px;
    margin: auto;
    /* Center horizontally */
    transition: max-width 0.3s ease, padding 0.3s ease;
}

.app-container.full-width {
    max-width: 100%;
    height: 100%;
    padding: 0;
}

.app-container.wide-width {
    max-width: 95%;
    /* Wider for selection step to use available space */
    padding: 20px;
}

/* Steps */
.step {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.step-content {
    background: white;
    /* No card background needed in split layout, just clean space */
}

.step-header-simple {
    margin-bottom: 40px;
}

.step-header-simple h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 28px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 0.95rem;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border);
    background: #F8F9FA;
    border-radius: var(--radius-s);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    color: var(--text);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="email"]:focus {
    outline: none;
    background: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-bg);
}

/* ... existing styles ... */

/* --- Authentication --- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 2rem;
}

.auth-box {
    background: transparent;
    /* Removed white background */
    padding: 0;
    /* Removed padding */
    border-radius: 0;
    /* Removed radius */
    box-shadow: none;
    /* Removed shadow */
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease-out;
}

.hint {
    font-size: 0.85rem;
    color: var(--text-lighter);
    margin-top: 8px;
}

/* Radio Cards */
.radio-group-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.radio-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card:hover {
    border-color: var(--accent-light);
    transform: translateY(-2px);
}

.radio-card:has(input:checked) {
    border-color: var(--accent);
    background-color: var(--accent-bg);
    color: var(--accent);
}

.radio-card .icon {
    margin-bottom: 8px;
    color: var(--text-light);
    transition: var(--transition);
}

.radio-card:has(input:checked) .icon {
    color: var(--accent);
}

.radio-card .label {
    font-weight: 500;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    height: 140px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-m);
    transition: var(--transition);
    background: var(--bg-panel);
    overflow: hidden;
}

.file-upload-wrapper:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    font-weight: 500;
    gap: 12px;
}

.file-upload-placeholder .icon {
    color: var(--accent-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 50px;
    /* Pill shape */
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 8px;
}

.btn.large {
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
}

.btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn.secondary {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

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

.btn.text {
    background: none;
    color: var(--accent);
    padding: 0;
    font-size: 0.9rem;
}

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

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-panel);
}

/* Selection Step */
.step-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Space between title and button */
    margin-bottom: 32px;
    margin-top: 24px;
    /* Add top margin as requested */
}

.nav-left {
    display: flex;
    align-items: center;
}

.step-nav h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: var(--text-light);
}

.gift-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
    max-height: 50vh;
    /* Adjust for split layout */
    overflow-y: auto;
    padding: 4px;
}

.gift-item {
    border: 1px solid transparent;
    border-radius: var(--radius-s);
    padding: 16px 20px;
    transition: var(--transition);
    background: var(--bg-panel);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.gift-item:hover {
    background: white;
    box-shadow: var(--shadow-soft);
    transform: translateX(4px);
}

.gift-item.selected {
    background: var(--accent-bg);
    border-color: var(--accent-light);
    color: var(--accent);
}

.gift-item {
    cursor: grab;
}

.gift-item:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--accent-bg);
    border: 2px dashed var(--accent);
}

.gift-row-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.gift-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--accent);
    border-radius: 6px;
    /* Note: standard checkbox styling is limited */
}

.gift-title {
    font-weight: 500;
    font-size: 1rem;
    flex: 1;
}

/* Processing & Result */
.centered-content {
    text-align: center;
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Joyful Loader */
/* Random Icon Loader */
.loading-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 64px;
    margin-bottom: 24px;
}

.loading-icon-container svg {
    width: 48px;
    height: 48px;
    color: var(--accent);
}

.pop-in {
    animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.pop-out {
    animation: pop-out 0.3s ease-in forwards;
}

@keyframes pop-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pop-out {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.progress-container {
    width: 100%;
    height: 8px;
    background: var(--bg-panel);
    border-radius: 4px;
    margin-top: 32px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #2C3436;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.success-animation {
    color: var(--success);
    margin-bottom: 24px;
    animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Result Step with Editor */
.result-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Full viewport height */
    width: 100%;
    max-width: none;
    /* Remove width restriction */
    padding: 20px;
    box-sizing: border-box;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
    /* Don't shrink header */
}

.success-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success);
    font-weight: 600;
    font-size: 1.1rem;
}

.result-actions-top {
    display: flex;
    gap: 12px;
}

/* View Switcher - Robust Implementation */
.view-switch {
    display: inline-flex;
    position: relative;
    background-color: #ebebeb;
    border-radius: 30px;
    padding: 3px;
    height: 34px;
    /* Fixed, slim height */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    user-select: none;
}

.view-switch input {
    display: none;
}

.switch-label {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    /* Fixed width per item for perfect symmetry */
    height: 100%;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 20px;
    line-height: 1;
    /* Reset line-height to avoid offset */
}

/* Active text style */
.view-switch input:checked+.switch-label {
    color: var(--primary);
    font-weight: 600;
}

/* The sliding white pill */
.switch-highlight {
    position: absolute;
    top: 3px;
    left: 3px;
    bottom: 3px;
    width: 72px;
    /* Must match label width exactly */
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    z-index: 1;
    transition: transform 0.25s cubic-bezier(0.2, 0.0, 0.2, 1);
    pointer-events: none;
}

/* Slide animation */
#view-article:checked~.switch-highlight {
    transform: translateX(100%);
}

/* Article Preview */
.article-preview {
    flex: 1;
    overflow-y: auto;
    padding: 60px;
    background: white;
    font-family: var(--font-family);
    line-height: 1.8;
    color: #4a4a4a;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.article-preview h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--primary);
}

.article-preview h2 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--primary);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent-bg);
}

.article-preview h3 {
    font-size: 1.4rem;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--accent);
}

.article-preview p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.article-preview ul,
.article-preview ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.article-preview li {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.article-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
    box-shadow: var(--shadow-soft);
}

.article-preview blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    margin: 24px 0;
    font-style: italic;
    color: var(--text-light);
}

.article-preview a {
    color: var(--accent);
    text-decoration: underline;
    font-weight: 500;
}

.editor-container {
    flex: 1;
    /* Take remaining space */
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Important for nested flex scrolling */
    background: white;
}

.CodeMirror {
    height: 100% !important;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Ensure cursor is a thin line (fix for block cursor issue) */
.CodeMirror-cursor {
    border-left: 2px solid var(--text) !important;
    border-right: none !important;
    width: 0 !important;
}

/* Ensure CodeMirror scrollbar is nice */
.CodeMirror-scroll {
    padding-bottom: 20px;
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Hide the bottom actions since we moved them top/integrated */
.result-actions {
    display: none;
}

/* Restart button at bottom right of editor or header? 
   Let's keep it in the header for cleaner UI or make it a small text link below if needed.
   The user said "I don't see buttons", so header is safest. 
   I'll move the restart button to the header as well.
*/
#btn-restart {
    margin-left: 12px;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 900px) {
    .split-layout {
        flex-direction: column;
        overflow-y: auto;
        /* Allow scroll on mobile */
    }

    .left-panel {
        width: 100%;
        height: 300px;
        /* Short header on mobile */
        padding: 40px 20px;
        flex-shrink: 0;
    }

    .decorative-content h1 {
        font-size: 2.5rem;
    }

    .floating-shape {
        display: none;
        /* Hide shapes on mobile to avoid clutter */
    }

    .right-panel {
        width: 100%;
        height: auto;
        overflow: visible;
    }

    .app-container {
        padding: 32px 20px;
    }
}

/* Selection Step Improvements */
.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Align to top */
    margin-bottom: 24px;
    color: var(--text-light);
}

.selection-title-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.count-badge {
    font-weight: 600;
    color: var(--accent);
    margin-left: 4px;
}

.selection-instruction {
    font-size: 0.9rem;
    color: var(--text-lighter);
    margin: 0;
}

.recommendation-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent-bg);
    color: var(--accent);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 8px;
    border: 1px solid var(--accent-light);
}

/* VIP Icon */
.vip-icon {
    width: 16px;
    height: 16px;
    color: #FFD700;
    /* Gold */
    margin-right: 6px;
    vertical-align: middle;
    display: inline-block;
}

.recommendation-box i {
    width: 16px;
    height: 16px;
}

/* Drag Handle */
.drag-handle {
    color: var(--text-lighter);
    cursor: grab;
    padding: 4px;
    margin-left: auto;
    /* Push to right */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.move-top-btn {
    padding: 4px;
    margin-right: 4px;
    color: var(--text-lighter);
    opacity: 0;
    transition: var(--transition);
}

.gift-item:hover .move-top-btn {
    opacity: 1;
}

.move-top-btn:hover {
    color: var(--accent);
    background: var(--accent-bg);
}

.drag-handle:hover {
    color: var(--text);
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

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

/* Update gift-row-content to accommodate drag handle */
.gift-row-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* Align header with gift cards */
.selection-header {
    /* Remove flex space-between since button is gone */
    display: block;
    /* Match padding of gift-grid (4px) to align content exactly with cards */
    padding: 0 4px;
}

.selection-title-group {
    width: 100%;
}

.recommendation-box {
    /* Ensure it takes full width */
    width: 100%;
    /* Box sizing is already border-box globally */
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.animate-twinkle {
    animation: twinkle 1.5s ease-in-out infinite;
}

.btn-subtle-action {
    background: none;
    border: none;
    color: var(--text-lighter);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 8px;
    transition: var(--transition);
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}


.btn-subtle-action:hover {
    color: var(--error);
    text-decoration: underline;
}

.btn-subtle-action.btn-enrich:hover {
    color: var(--primary);
}

.selection-actions-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 8px;
}

/* Two Column Selection Layout */
.selection-columns {
    display: flex;
    gap: 24px;
    height: 60vh;
    /* Fixed height for scrolling within columns */
    margin-bottom: 32px;
}

.selection-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Removed background, border, padding as requested */
    min-width: 0;
    /* Prevent flex overflow */
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    /* Slightly thicker divider */
}

.column-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.count-badge-simple {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.gift-list-connected {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    /* Space for scrollbar */
    min-height: 100px;
    /* Drop target area */
}

/* Adjust Gift Item for narrower columns */
.gift-item {
    padding: 10px 0;
    /* Reduced from 16px to 10px (~35% reduction to be safe/compact) */
    margin-bottom: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}

.gift-item:hover {
    transform: none;
    box-shadow: none;
    background: #fafafa;
    /* Subtle hover bg */
}

.gift-item.selected {
    background: transparent;
    /* Keep transparent, use icon color or text to indicate selection? */
    /* Or maybe a very subtle tint */
    background: var(--accent-bg);
    border-radius: var(--radius-s);
    /* Add radius back if selected for highlight */
    padding-left: 12px;
    padding-right: 12px;
    border-bottom: 1px solid transparent;
}

.gift-title {
    font-size: 1rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    /* Required for flex child truncation */
}

/* Scrollbar styling for lists */
.gift-list-connected::-webkit-scrollbar {
    width: 6px;
}

.gift-list-connected::-webkit-scrollbar-track {
    background: transparent;
}

.gift-list-connected::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 3px;
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .selection-columns {
        flex-direction: column;
        height: auto;
    }

    .selection-column {
        height: 400px;
    }
}

/* --- Authentication --- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 2rem;
}

.auth-box {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease-out;
}

.auth-box h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-box .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.error-text {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
    min-height: 1.2em;
}

.full-width {
    width: 100%;
}

.icon-large {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.icon-large i {
    width: 48px;
    height: 48px;
}

.info-text {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden-mobile {
    /* Helper to hide left panel on mobile if needed */
}

/* Google Button */
.google-btn {
    background: white;
    color: #757575;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    transition: var(--transition);
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #c1c1c1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.google-btn img {
    height: 18px;
}

.selection-actions-row {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

/* Image Selection Modal */
#image-selection-modal {
    z-index: 1100;
    /* Higher than enrichment modal (1000) */
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.candidate-image-wrapper {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
    aspect-ratio: 1;
}

.candidate-image-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.candidate-image-wrapper.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.candidate-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.enrichment-preview {
    cursor: pointer;
    transition: transform 0.2s;
}

.enrichment-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Enrichment Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.enrichment-actions {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.enrichment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.enrichment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    align-items: center;
}

.enrichment-item-content {
    flex: 1;
    min-width: 0;
}

.enrichment-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enrichment-item-link {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.enrichment-item-status {
    width: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
}

.status-searching {
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.status-success {
    color: #10b981;
    font-weight: 500;
}

.status-error {
    color: #ef4444;
}

.enrichment-preview {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    background: #eee;
    border: 1px solid var(--border);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    background: var(--bg-secondary);
}

.result-actions-secondary {
    margin-top: 1rem;
    width: 100%;
}

/* Separator */
.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-separator span {
    padding: 0 10px;
}

.btn-icon-subtle {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    margin-top: 8px;
    opacity: 0.5;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.btn-icon-subtle:hover {
    opacity: 1;
    color: var(--error);
}

.image-resolution-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    font-weight: 500;
    backdrop-filter: blur(2px);
}


.btn-icon-subtle svg {
    width: 18px;
    height: 18px;
}

/* Help Modal Styles */
.help-modal-content {
    max-width: 700px;
}

.help-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.help-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: var(--text);
}

.step-info p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

.inline-icon {
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    color: #FFD700;
}

/* --- Documentation Styles --- */
.large-doc {
    max-width: 900px;
    height: 90vh;
}

.doc-body {
    padding: 2rem 3rem;
    line-height: 1.7;
    color: var(--text);
}

.doc-section {
    margin-bottom: 2rem;
}

.doc-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-bg);
}

.doc-section h3 svg {
    color: var(--accent);
    width: 24px;
    height: 24px;
}

.doc-section h4 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem 0;
    color: var(--text);
}

.doc-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* Alerts */
.doc-alert {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.doc-alert.info {
    background-color: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #bbdefb;
}

.doc-alert svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Tables */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.doc-table th,
.doc-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.doc-table th {
    background-color: var(--bg-panel);
    font-weight: 600;
    color: var(--text);
}

.doc-table tr:hover td {
    background-color: #fafafa;
}

.badge.required {
    background-color: #ffebee;
    color: #c62828;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    color: #d63384;
}

/* Step List */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    display: flex;
    gap: 16px;
}

.step-badge {
    width: 32px;
    height: 32px;
    background-color: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 4px;
}

.step-content h4 {
    margin-top: 0;
    color: var(--accent);
    font-weight: 600;
}

.step-content ul {
    padding-left: 20px;
    margin-top: 8px;
    color: var(--text-light);
}

.step-content li {
    margin-bottom: 4px;
}

.tiny-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    color: #FFD700;
}

/* Article Count Label */
.article-count-label {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.25);
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 8px;
    margin-top: 8px;
    /* Align with buttons */
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    vertical-align: middle;
}

.article-count-label:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* Commission Display */
.gift-commission {
    font-size: 0.8rem;
    color: var(--text-light);
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 12px;
    font-weight: 500;
    white-space: nowrap;
}