/* ==========================================================================
   SplitQR - Modern Design System & CSS Variables
   ========================================================================== */

:root {
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Colors - Dark Theme (Default) */
    --bg-dark: #0b0f19;
    --bg-surface: #131b2e;
    --bg-card: rgba(19, 27, 46, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-focus: #6366f1;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);

    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.2);
    
    --accent-cyan: #06b6d4;

    --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --glass-backdrop: blur(16px);
}

.theme-light {
    --bg-dark: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-focus: #4f46e5;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.15);

    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
}

/* Animated Glow Background */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
}

.bg-glow-1 {
    top: -200px;
    left: -100px;
    background: radial-gradient(circle, var(--primary-color), transparent 70%);
}

.bg-glow-2 {
    bottom: -200px;
    right: -100px;
    background: radial-gradient(circle, var(--accent-emerald), transparent 70%);
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* App Container */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--primary-glow);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    font-weight: 600;
}

.brand-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 60px;
    height: 32px;
    border-radius: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
    cursor: pointer;
    position: relative;
}

.theme-toggle .icon {
    font-size: 14px;
    z-index: 1;
}

.toggle-ball {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    left: 3px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-light .toggle-ball {
    transform: translateX(28px);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--card-shadow);
}

.card-header {
    margin-bottom: 24px;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

/* Grid Layout for Single QR */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

@media (max-width: 960px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.required {
    color: #ef4444;
}

.optional-tag {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.vpa-status {
    font-size: 0.75rem;
    font-weight: 500;
}

.vpa-status.valid { color: var(--accent-emerald); }
.vpa-status.invalid { color: #ef4444; }

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.select-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.input-wrapper input:focus,
.select-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    display: none;
}

.input-wrapper input:not(:placeholder-shown) + .clear-btn {
    display: block;
}

.currency-input .currency-symbol {
    position: absolute;
    left: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.currency-input input {
    padding-left: 34px;
}

/* Auto Split Notice Banner */
.auto-split-notice {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 14px;
    padding: 14px 18px;
    margin-top: 14px;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
    animation: fadeIn 0.3s ease;
}

.auto-split-notice .notice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 6px;
}

.auto-split-notice .breakdown-preview {
    font-family: monospace;
    font-size: 0.78rem;
    background: rgba(15, 23, 42, 0.8);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    font-weight: 600;
}

.auto-split-notice p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.auto-split-notice .btn-sm {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
    transition: all 0.25s ease;
}

.auto-split-notice .btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.5);
}

.chip-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chip {
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.chip.active {
    background: var(--primary-glow);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.form-footer-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px var(--primary-glow);
}

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

.btn-secondary:hover {
    border-color: var(--primary-color);
    background: var(--primary-glow);
}

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

.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
}

.status-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

/* Printable Digital QR Card */
.qr-card-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.qr-display-card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.qr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.upi-logo-badge {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

.upi-logo-badge .upi-text { color: #002D62; }
.upi-logo-badge .upi-accent { color: #F26522; margin-left: 2px; }

.verified-merchant {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #059669;
    background: #ecfdf5;
    padding: 3px 8px;
    border-radius: 12px;
}

.payee-info-section {
    margin-bottom: 16px;
}

.card-payee-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

.card-vpa {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
}

/* Canvas Wrapper */
.qr-canvas-wrapper {
    position: relative;
    display: inline-block;
    padding: 14px;
    background: #ffffff;
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    margin-bottom: 16px;
}

#qrCanvas canvas, #qrCanvas img {
    display: block;
    max-width: 220px;
    height: auto;
    margin: 0 auto;
}

.qr-overlay-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    background: #4f46e5;
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.card-amount-badge {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 12px;
}

.card-amount-badge .label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.card-amount-badge .value {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: #4f46e5;
}

.card-note-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #475569;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.card-footer-branding {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 600;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

/* Raw URI Text Box */
.raw-uri-container label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.uri-code-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 10px;
    overflow-x: auto;
}

.uri-code-box code {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--accent-cyan);
    word-break: break-all;
}

/* Tab Switcher Display Logic */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Splitter Tab Styles */
.splitter-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.hidden { display: none !important; }

.batch-summary-bar {
    background: var(--primary-glow);
    border: 1px solid var(--primary-color);
    border-radius: 14px;
    padding: 16px 20px;
    margin-top: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.batch-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.mini-batch-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    transition: transform 0.2s ease;
}

.mini-batch-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.mini-qr-wrapper {
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    display: inline-block;
    margin: 12px 0;
}

/* Profiles Grid */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.profile-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-card .profile-info h4 {
    font-size: 1rem;
    font-weight: 700;
}

.profile-card .profile-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Theme Studio Styles */
.theme-section {
    margin-bottom: 28px;
}

.theme-section h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.theme-section .section-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.theme-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.theme-preset-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-preset-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.theme-preset-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.preset-preview {
    height: 48px;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.theme-preset-card span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.color-picker-item label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.picker-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 10px;
}

.picker-input-wrapper input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.picker-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.picker-input-wrapper input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.color-code {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

/* Floating Theme Customizer Button (FAB) */
.floating-theme-fab {
    display: none !important;
}

.fab-pulse {
    display: none !important;
}

@keyframes fabPulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Slide-Over Theme Customizer Drawer */
.theme-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.theme-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.theme-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.drawer-title h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.drawer-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s ease;
}

.drawer-close-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.drawer-section {
    margin-bottom: 28px;
}

.section-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.drawer-presets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.drawer-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.drawer-preset-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.drawer-preset-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-glow);
    color: var(--primary-color);
}

.drawer-preset-btn .swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Color Control Rows */
.color-control-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.color-control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 14px;
}

.color-label-info {
    display: flex;
    flex-direction: column;
}

.color-label-info .color-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.color-label-info .color-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.color-picker-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker-box input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-picker-box input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-box input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.hex-badge {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-surface);
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Mobile Responsive Bottom Navigation Bar & Mobile Ergonomics */
@media (max-width: 768px) {
    .app-container {
        padding-bottom: 95px; /* Ensures page content is never hidden behind bottom nav bar */
    }

    .app-header {
        padding: 12px 16px;
        margin-bottom: 16px;
    }

    .brand-text h1 {
        font-size: 1.25rem;
    }

    .brand-text p {
        font-size: 0.75rem;
    }

    /* Fixed Bottom Navigation Bar on Mobile */
    .nav-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        background: rgba(15, 23, 42, 0.94);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) 10px;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
        margin: 0;
        border-radius: 0;
    }

    .theme-light .nav-tabs {
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
    }

    .tab-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 4px;
        border-radius: 12px;
        border: none;
        background: transparent;
        color: var(--text-muted);
        font-size: 0.68rem;
        font-weight: 600;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        min-width: 0;
    }

    .tab-btn svg {
        width: 20px;
        height: 20px;
        transition: transform 0.25s ease;
    }

    .tab-btn.active {
        color: var(--primary-color);
        background: var(--primary-glow);
        transform: translateY(-2px);
    }

    .tab-btn.active svg {
        transform: scale(1.15);
    }

    .tab-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .floating-theme-fab {
        bottom: 85px;
        right: 18px;
        width: 48px;
        height: 48px;
    }

    .toast-container {
        bottom: 85px;
        right: 16px;
        left: 16px;
    }
}

/* Print Specific Rules */
@media print {
    body * {
        visibility: hidden;
    }
    #printableCard, #printableCard * {
        visibility: visible;
    }
    #printableCard {
        position: absolute;
        left: 50%;
        top: 20%;
        transform: translate(-50%, 0);
        box-shadow: none;
        border: 2px solid #000;
    }
}

/* ==========================================================================
   Premium Bill Splitter & Form Input System Upgrades
   ========================================================================== */

/* Universal Failsafe Form Input Styling */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Icon Input Wrapper */
.icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.icon-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--primary-color);
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-wrapper input {
    padding-left: 42px !important;
}

/* Splitter Mode Card Selector */
.split-mode-selector {
    margin-bottom: 24px;
}

.section-sublabel {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.mode-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 768px) {
    .mode-cards-grid {
        grid-template-columns: 1fr;
    }
}

.mode-card {
    position: relative;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.mode-card.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(16, 185, 129, 0.08));
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color), 0 12px 28px var(--primary-glow);
}

.mode-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mode-info h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.mode-info p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.recommended-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

.glow-badge {
    box-shadow: 0 0 15px var(--primary-glow);
    animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
}

.splitter-chips {
    margin-top: 10px;
}

/* Splitter Live Calculation Preview Banner */
.splitter-preview-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
    border: 1px dashed var(--primary-color);
    border-radius: 16px;
    padding: 16px 20px;
    margin: 20px 0 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.preview-status-badge {
    background: var(--primary-glow);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.preview-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.split-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--accent-emerald);
    font-weight: 700;
    font-family: var(--font-heading);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.split-pill-plus {
    color: var(--text-muted);
    font-weight: 700;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.generate-batch-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, var(--primary-color), #4338ca);
    box-shadow: 0 12px 30px var(--primary-glow);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-batch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px var(--primary-glow);
}

/* ==========================================================================
   Ultra-Premium Glass Footer Styling
   ========================================================================== */
.app-footer {
    margin-top: 48px;
    padding-bottom: 24px;
}

.footer-card {
    background: linear-gradient(135deg, rgba(19, 27, 46, 0.9), rgba(11, 15, 25, 0.95));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.footer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--accent-emerald), transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 28px;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.footer-brand-col .brand-text h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo {
    width: 40px;
    height: 40px;
}

.footer-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 14px 0 16px;
}

.compliance-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-emerald-glow, rgba(16, 185, 129, 0.15));
    border: 1px solid var(--accent-emerald, #10b981);
    color: var(--accent-emerald, #10b981);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.footer-heading {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.app-badges-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.app-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.app-badge:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.footer-features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.feat-icon {
    font-size: 1.1rem;
    margin-top: 2px;
}

.footer-features-list strong {
    font-size: 0.85rem;
    color: var(--text-primary);
    display: block;
}

.footer-features-list p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.footer-notice-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.notice-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.notice-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notice-text strong {
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

.engine-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-emerald, #10b981);
    font-weight: 600;
}

.status-dot-pulse {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald, #10b981);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-emerald, #10b981);
    animation: statusPulse 1.5s infinite ease-in-out;
}

/* ==========================================================================
   Hyper-Premium Theme Studio & Color Engine Styling
   ========================================================================== */
.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.section-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.theme-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .theme-presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .theme-presets-grid {
        grid-template-columns: 1fr;
    }
}

.theme-preset-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 18px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.theme-preset-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 12px 28px var(--primary-glow);
}

.theme-preset-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color), 0 14px 32px var(--primary-glow);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(16, 185, 129, 0.05));
}

.preset-preview-box {
    height: 70px;
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    margin-bottom: 12px;
}

.preview-mini-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 4px;
}

.mini-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.mini-bar {
    width: 28px;
    height: 4px;
    border-radius: 2px;
}

.preview-mini-card {
    border-radius: 6px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mini-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.mini-line {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

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

.preset-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.preset-tag {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Custom Studio Split Layout */
.custom-studio-split {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .custom-studio-split {
        grid-template-columns: 1fr;
    }
}

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (max-width: 500px) {
    .color-picker-grid {
        grid-template-columns: 1fr;
    }
}

/* Realtime Theme Live Preview Card */
.theme-live-preview-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.studio-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.live-pill {
    background: var(--accent-emerald-glow, rgba(16, 185, 129, 0.15));
    color: var(--accent-emerald, #10b981);
    border: 1px solid var(--accent-emerald, #10b981);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.studio-preview-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-app-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.mini-logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.mini-btn-active {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.mini-form-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mini-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.mini-input {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.75rem;
    color: var(--text-primary);
    font-family: monospace;
}

.mini-action-btn {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ==========================================================================
   SEO DIAGNOSTIC TOOLS & ARTICLE KNOWLEDGE BASE STYLES
   ========================================================================== */

.diagnostic-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}

.diagnostic-card {
    padding: 24px;
    border-radius: 20px;
}

.diagnostic-card .card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.diagnostic-card .card-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.diagnostic-card .card-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.header-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.icon-cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.icon-emerald {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.code-input {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

/* Inspector Table */
.inspector-results-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.badge-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-status.status-pass {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-status.status-warn {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.inspector-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 8px;
}

.inspector-table th, .inspector-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.inspector-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.inspector-table code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
}

/* Contrast Analyzer */
.contrast-picker-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px 12px;
}

.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.hex-value {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.contrast-result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 20px;
}

.contrast-score-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ratio-val {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.quality-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-pass {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-fail {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.contrast-msg {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Article Layout Grid */
.article-layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 992px) {
    .article-layout-grid {
        grid-template-columns: 1fr;
    }
    
    .article-toc-sidebar {
        position: static !important;
    }
}

/* TOC Sidebar */
.article-toc-sidebar {
    position: sticky;
    top: 24px;
    padding: 24px;
    border-radius: 20px;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.toc-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-link {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.toc-link:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
}

.toc-link.active {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(99, 102, 241, 0.12);
    border-left-color: var(--primary-color);
}

.toc-footer {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.mini-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

/* SEO Article Content Container */
.seo-article-content {
    padding: 40px;
    border-radius: 24px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.article-category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.article-main-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 14px;
}

.article-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.article-byline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin-bottom: 36px;
    flex-wrap: wrap;
    gap: 12px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.author-info strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.publish-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.reading-time {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Article Body Typography & Components */
.article-section {
    margin-bottom: 48px;
    scroll-margin-top: 30px;
}

.article-section h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.article-section h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 10px 0;
}

.article-section p {
    margin-bottom: 16px;
    font-size: 0.98rem;
}

.callout {
    padding: 18px 22px;
    border-radius: 14px;
    margin: 24px 0;
}

.callout-info {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-color);
}

.callout-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

/* Tech Spec Table */
.tech-spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.88rem;
}

.tech-spec-table th {
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 700;
    padding: 12px 16px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.tech-spec-table td {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    background: rgba(19, 27, 46, 0.4);
}

.tag-req {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.tag-opt {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Code Example Box */
.code-example-box {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    margin: 24px 0;
}

.code-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.copy-code-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.copy-code-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.code-example-box pre {
    padding: 16px;
    overflow-x: auto;
    margin: 0;
}

.code-example-box code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #38bdf8;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.comp-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.comp-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.static-header {
    background: rgba(6, 182, 212, 0.15);
}

.dynamic-header {
    background: rgba(99, 102, 241, 0.15);
}

.comp-card-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.comp-card-body {
    padding: 16px 18px;
}

.comp-card-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.88rem;
}

/* Formula Box */
.formula-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--primary-color);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Privacy Pillars */
.privacy-pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.pillar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
}

.pillar-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.pillar-card h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.pillar-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Guidelines List */
.guidelines-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
}

.guide-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.guide-item p {
    margin: 0;
    font-size: 0.85rem;
}

/* FAQ Accordion */
.faq-accordion-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item.active {
    border-color: var(--primary-color);
}

.faq-question {
    width: 100%;
    padding: 18px 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.faq-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-chevron {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
    padding: 0 20px;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    transition: max-height 0.4s ease-in-out;
    padding: 0 20px 18px 20px;
}

.faq-answer p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

