/* =========================================================
   StatLab Demo — Frontend-only stylesheet
   ========================================================= */

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

:root {
    --radius: 0.625rem;
    --bg: #f8fbff;
    --fg: #0d1a2e;
    --card: #ffffff;
    --card-fg: #0d1a2e;
    --popover: #ffffff;
    --primary: #2563eb;
    --primary-fg: #ffffff;
    --primary-soft: #eff6ff;
    --primary-ring: rgba(37, 99, 235, 0.35);
    --secondary: #f1f5fb;
    --secondary-fg: #1a2540;
    --muted: #f3f6fb;
    --muted-fg: #64748b;
    --accent: #dbeafe;
    --accent-fg: #1e40af;
    --destructive: #dc2626;
    --destructive-fg: #ffffff;
    --border: #e2e8f0;
    --input: #d8dfe8;
    --sidebar-bg: #f5f8ff;
    --sidebar-fg: #1a2540;
    --sidebar-accent: #dbeafe;
    --sidebar-border: #e2e8f0;
    --chart-1: #2563eb;
    --chart-2: #0ea5e9;
    --chart-3: #f59e0b;
    --chart-4: #a855f7;
    --chart-5: #3b82f6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 24px rgba(0,0,0,0.08);
}

html[data-theme="dark"] {
    --bg: #0b1218;
    --fg: #e7eef5;
    --card: #111c28;
    --card-fg: #e7eef5;
    --popover: #111c28;
    --primary: #60a5fa;
    --primary-fg: #0b1f3a;
    --primary-soft: rgba(96, 165, 250, 0.08);
    --secondary: #172430;
    --secondary-fg: #e7eef5;
    --muted: #172430;
    --muted-fg: #8b9ba8;
    --accent: #1c2d44;
    --accent-fg: #bfdbfe;
    --border: rgba(255,255,255,0.1);
    --input: rgba(255,255,255,0.12);
    --sidebar-bg: #0d1620;
    --sidebar-fg: #e7eef5;
    --sidebar-accent: #16273c;
    --sidebar-border: rgba(255,255,255,0.08);
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============ Layout ============ */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 264px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-inline-end: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: transform 0.25s ease;
    z-index: 30;
}

.main-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: 28px 32px;
    max-width: 1400px;
    width: 100%;
    margin-inline: auto;
}

/* ============ Sidebar ============ */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--sidebar-border);
}
.brand-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary); color: var(--primary-fg);
    border-radius: 10px;
}
.brand-title { font-size: 14px; font-weight: 700; }
.brand-sub { font-size: 11px; color: var(--muted-fg); }

.nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
}
.nav-section { margin-bottom: 14px; }
.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted-fg);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 10px 4px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    color: var(--sidebar-fg);
    font: inherit;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    text-align: start;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--sidebar-accent); }
.nav-item.active {
    background: var(--sidebar-accent);
    color: var(--primary);
    font-weight: 600;
}
.nav-item.disabled { opacity: 0.4; cursor: not-allowed; }
.nav-item svg { flex-shrink: 0; }
.nav-item .nav-label { flex: 1; }
.nav-item .badge-new {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary-ring);
    font-weight: 700;
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--sidebar-border);
    font-size: 11px;
}
.engine-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted-fg);
}
.engine-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--fg);
}
.engine-badge .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse 2s infinite;
}
.engine-note { margin-top: 4px; color: var(--muted-fg); font-size: 10px; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ============ Topbar ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(8px);
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.dataset-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    min-width: 0;
}
.dataset-chip strong { font-weight: 600; }
.dataset-chip .source-tag {
    font-size: 10px;
    text-transform: uppercase;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted-fg);
}
.topbar-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--muted-fg);
    font-size: 12px;
    margin-inline-start: 8px;
    padding-inline-start: 12px;
    border-inline-start: 1px solid var(--border);
}
.topbar-meta span { display: inline-flex; align-items: center; gap: 4px; }
.topbar-meta .warn { color: var(--destructive); }
.topbar-right { display: flex; align-items: center; gap: 4px; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--fg);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.icon-btn:hover { background: var(--muted); }
.icon-btn.text { width: auto; padding: 0 12px; gap: 6px; font-size: 13px; }

/* ============ Upgrade button in topbar ============ */
.upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    margin-inline-end: 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), #059669);
    color: var(--primary-fg);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(14, 159, 110, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.upgrade-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 4px 14px rgba(14, 159, 110, 0.35);
}
.upgrade-btn svg { flex-shrink: 0; }
html[data-theme="dark"] .upgrade-btn {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #062b20;
    box-shadow: 0 2px 8px rgba(52, 211, 153, 0.25);
}
@media (max-width: 640px) {
    .upgrade-btn span { display: none; }
    .upgrade-btn { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 8px; }
}

/* ============ Demo banner ============ */
.demo-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--primary-soft), color-mix(in srgb, var(--primary-soft) 40%, transparent));
    border: 1px solid var(--primary-ring);
    color: var(--fg);
    font-size: 13px;
    animation: bannerIn 0.3s ease;
}
.demo-banner.hiding {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.demo-banner-icon {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--primary);
    color: var(--primary-fg);
    flex-shrink: 0;
}
.demo-banner-text { flex: 1; font-weight: 500; }
.demo-banner-cta { text-decoration: none; }
.demo-banner-close {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0;
    background: transparent;
    color: var(--muted-fg);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}
.demo-banner-close:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--fg); }
@keyframes bannerIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
    .demo-banner { flex-wrap: wrap; }
    .demo-banner-text { flex-basis: calc(100% - 44px); }
    .demo-banner-cta { flex: 1; }
}

/* ============ Alert inline link ============ */
.alert-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    padding-inline-start: 8px;
    border-inline-start: 1px solid var(--border);
    margin-inline-start: 8px;
}
.alert-link:hover { text-decoration: underline; }

/* ============ Cards & buttons ============ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header { padding: 16px 20px 12px; }
.card-title { font-size: 14px; font-weight: 600; }
.card-desc { font-size: 12px; color: var(--muted-fg); margin-top: 4px; }
.card-body { padding: 0 20px 20px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { filter: brightness(0.95); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--fg); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--muted); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ Form controls ============ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 500; }
.form-label .opt { color: var(--muted-fg); font-weight: 400; }

.input, .select, .textarea {
    width: 100%;
    font: inherit;
    font-size: 13px;
    background: var(--card);
    color: var(--fg);
    border: 1px solid var(--input);
    border-radius: 8px;
    padding: 8px 12px;
    outline: none;
    transition: border 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}
.textarea { min-height: 180px; resize: vertical; font-family: 'Courier New', monospace; font-size: 12.5px; line-height: 1.6; }
.textarea[dir="rtl"] { direction: rtl; }

.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-row { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.radio-row input[type="radio"] { accent-color: var(--primary); }

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
    position: absolute;
    inset: 0;
    background: var(--input);
    border-radius: 20px;
    transition: 0.2s;
}
.switch-track::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::before { transform: translateX(16px); }
html[dir="rtl"] .switch input:checked + .switch-track::before { transform: translateX(-16px); }

/* ============ Tabs ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
    padding: 8px 14px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: var(--muted-fg);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.tab:hover { color: var(--fg); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ============ Panel header ============ */
.panel-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}
.panel-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 12px;
    flex-shrink: 0;
}
.panel-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.panel-desc { color: var(--muted-fg); font-size: 13px; margin-top: 4px; }

/* ============ Grids ============ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============ Stat cards ============ */
.stat-card {
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-fg);
}
.stat-value {
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
    font-family: 'Courier New', monospace;
}
.stat-sub { font-size: 11px; color: var(--muted-fg); margin-top: 2px; }

/* ============ Table ============ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
    background: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-fg);
    text-align: start;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}
table.data-table tr:last-child td { border-bottom: 0; }
table.data-table tr:hover td { background: var(--muted); }
.mono { font-family: 'Courier New', monospace; font-variant-numeric: tabular-nums; }
.type-tag {
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 999px;
    font-weight: 500;
}
.type-numeric { background: #dcfce7; color: #166534; }
.type-categorical { background: #ede9fe; color: #5b21b6; }
.type-text { background: #e2e8f0; color: #334155; }
.type-boolean { background: #cffafe; color: #155e75; }
.type-datetime { background: #fef3c7; color: #92400e; }
html[data-theme="dark"] .type-numeric { background: rgba(22,163,74,0.15); color: #4ade80; }
html[data-theme="dark"] .type-categorical { background: rgba(124,58,237,0.15); color: #c4b5fd; }
html[data-theme="dark"] .type-text { background: rgba(100,116,139,0.2); color: #cbd5e1; }
html[data-theme="dark"] .type-boolean { background: rgba(8,145,178,0.2); color: #67e8f9; }
html[data-theme="dark"] .type-datetime { background: rgba(217,119,6,0.2); color: #fcd34d; }

/* ============ Alerts ============ */
.alert {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    border-inline-start: 4px solid transparent;
}
.alert-info { background: #eff6ff; border-color: #3b82f6; color: #1e3a5f; }
.alert-success { background: #f0fdf4; border-color: #16a34a; color: #14532d; }
.alert-warning { background: #fffbeb; border-color: #d97706; color: #78350f; }
.alert-error { background: #fef2f2; border-color: #dc2626; color: #7f1d1d; }
html[data-theme="dark"] .alert-info { background: rgba(59,130,246,0.08); color: #bfdbfe; }
html[data-theme="dark"] .alert-success { background: rgba(22,163,74,0.08); color: #bbf7d0; }
html[data-theme="dark"] .alert-warning { background: rgba(217,119,6,0.08); color: #fde68a; }
html[data-theme="dark"] .alert-error { background: rgba(220,38,38,0.08); color: #fecaca; }

/* ============ Dropzone ============ */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.dropzone svg { color: var(--muted-fg); margin-bottom: 12px; }
.dropzone .dz-title { font-size: 14px; font-weight: 500; }
.dropzone .dz-hint { font-size: 12px; color: var(--muted-fg); margin-top: 4px; }

/* ============ Sample cards ============ */
.sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.sample-card {
    text-align: start;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    cursor: pointer;
    transition: all 0.15s ease;
    font: inherit;
    color: var(--fg);
}
.sample-card:hover { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--shadow); }
.sample-card .sc-name { font-size: 13px; font-weight: 600; }
.sample-card .sc-desc { font-size: 11px; color: var(--muted-fg); margin-top: 6px; line-height: 1.5; }

/* ============ Empty state ============ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted-fg);
}
.empty-state svg { opacity: 0.4; margin-bottom: 12px; }
.empty-state .es-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.empty-state .es-desc { font-size: 12px; margin-top: 4px; max-width: 420px; }

/* ============ Toast ============ */
.toast-container {
    position: fixed;
    bottom: 20px;
    inset-inline-end: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 260px;
    max-width: 380px;
    padding: 12px 14px;
    background: var(--popover);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.25s ease;
    font-size: 13px;
}
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-desc { color: var(--muted-fg); font-size: 12px; }
.toast.success { border-inline-start: 4px solid var(--primary); }
.toast.warn { border-inline-start: 4px solid #d97706; }
.toast.error { border-inline-start: 4px solid var(--destructive); }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ Mobile ============ */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 10px;
    inset-inline-start: 10px;
    z-index: 40;
    width: 36px;
    height: 36px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--fg);
}
@media (max-width: 820px) {
    .mobile-menu-btn { display: inline-flex; }
    .sidebar {
        position: fixed;
        inset-inline-start: 0;
        top: 0;
        transform: translateX(-100%);
    }
    html[dir="rtl"] .sidebar { transform: translateX(100%); inset-inline-start: auto; inset-inline-end: 0; }
    .sidebar.open { transform: translateX(0) !important; }
    .content { padding: 20px 16px; padding-top: 56px; }
    .topbar { padding: 0 16px; padding-inline-start: 56px; }
    .panel-title { font-size: 18px; }
}

/* ============ RTL tweaks ============ */
html[dir="rtl"] .mono, html[dir="rtl"] .stat-value { direction: ltr; unicode-bidi: embed; }

/* ============ Hide mobile menu on desktop ============ */
@media (min-width: 821px) {
    .sidebar { transform: none !important; }
}

/* ============ Preview data table ============ */
.preview-table-wrap {
    max-height: 460px;
    overflow: auto;
}
.preview-table-wrap table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Column list in cleaning panel */
.col-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.col-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 12.5px;
    transition: all 0.15s ease;
}
.col-list-item:hover { background: var(--muted); }
.col-list-item.selected { border-color: var(--primary); background: var(--primary-soft); }

/* ============ Demo / Upgrade Modal ============ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(6, 20, 16, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.modal-backdrop.show { opacity: 1; }

.modal {
    position: relative;
    width: 100%;
    max-width: 540px;
    background: var(--card);
    color: var(--card-fg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px 26px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s ease;
}
.modal-backdrop.show .modal { transform: translateY(0) scale(1); }

.modal-close {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--muted-fg);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.modal-close:hover { background: var(--muted); color: var(--fg); }

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 18px;
}
.modal-title {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}
.modal-body {
    font-size: 13.5px;
    color: var(--muted-fg);
    line-height: 1.7;
    margin-bottom: 18px;
    max-width: 420px;
    margin-inline: auto;
}
.modal-features {
    list-style: none;
    text-align: start;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 14px 16px;
    margin: 0 0 22px;
    background: var(--muted);
    border-radius: 10px;
    font-size: 13px;
}
.modal-features li {
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-features svg { color: var(--primary); flex-shrink: 0; }

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.btn-lg { height: 44px; font-size: 14px; padding: 0 20px; width: 100%; }
.btn-lg svg { flex-shrink: 0; }
.modal-actions a.btn { text-decoration: none; }

@media (max-width: 480px) {
    .modal { padding: 26px 18px 20px; }
    .modal-title { font-size: 18px; }
    .modal-body { font-size: 13px; }
}