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

:root {
    --p: #6366f1;
    --p2: #818cf8;
    --p3: #4f46e5;
    --acc: #f97316;
    --acc2: #fb923c;
    --bg: #f8f9fc;
    --bg2: #f0f2f7;
    --bg3: #e8ebf0;
    --card: #ffffff;
    --card-b: rgba(99,102,241,0.06);
    --glass: rgba(255,255,255,0.7);
    --glass-bg: rgba(255,255,255,0.75);
    --glass-border: rgba(255,255,255,0.3);
    --hero-h: 320px;
    --hero-h-sm: 220px;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --img-overlay: linear-gradient(135deg, rgba(99,102,241,0.85), rgba(79,70,229,0.7));
    --t1: #1a1a2e;
    --t2: #4a4a6a;
    --t3: #8888a4;
    --brd: rgba(0,0,0,0.07);
    --r: 20px;
    --rs: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--t1);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    top: -30%; left: -15%;
    width: 70vw; height: 70vw;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    bottom: -25%; right: -10%;
    width: 55vw; height: 55vw;
    background: radial-gradient(circle, rgba(249,115,22,0.06) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    animation: float 10s ease-in-out infinite reverse;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px; position: relative; z-index: 1; }

/* CARDS */
.card {
    background: var(--card);
    border: 1px solid var(--brd);
    border-radius: var(--r);
    padding: 28px;
    margin-bottom: 16px;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: rgba(99,102,241,0.15);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.card-ico {
    width: 44px; height: 44px;
    border-radius: 14px;
    display: grid; place-items: center;
    font-size: 1.25em;
    flex-shrink: 0;
}

.card-head h2 { font-size: 1.05em; font-weight: 600; letter-spacing: -0.02em; }

/* HEADER */
.hero { text-align: center; padding: 48px 20px 28px; }
.hero h1 {
    font-size: 2em;
    font-weight: 700;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--p3) 0%, var(--p2) 50%, var(--acc) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p { color: var(--t3); font-size: 0.88em; margin-top: 4px; }

/* FORMS */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
    font-size: 0.72em; font-weight: 600; color: var(--t3);
    text-transform: uppercase; letter-spacing: 0.06em;
}

input, select, textarea {
    padding: 11px 14px;
    background: var(--bg);
    border: 1.5px solid var(--brd);
    border-radius: var(--rs);
    color: var(--t1);
    font-family: inherit;
    font-size: 0.9em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--p);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    outline: none;
    background: #fff;
}

input.invalid, textarea.invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(248,113,113,0.15);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

textarea { min-height: 120px; resize: vertical; line-height: 1.6; font-size: 0.95em; }
select { cursor: pointer; }
select option { background: #fff; }

/* SLIDERS */
.sub-item {
    padding: 16px 18px;
    background: var(--bg);
    border-radius: var(--rs);
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: border-color 0.25s, background 0.25s;
}

.sub-item:hover { border-color: var(--brd); background: var(--bg2); }

.sub-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sub-top label { font-weight: 600; font-size: 0.88em; }

.pill {
    font-size: 0.68em; font-weight: 700;
    padding: 3px 10px; border-radius: 20px;
    letter-spacing: 0.02em;
    transition: all 0.3s;
}

.sub-desc { font-size: 0.78em; color: var(--t3); margin-bottom: 10px; }

input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 4px;
    border-radius: 2px; border: none; padding: 0;
    background: linear-gradient(90deg, var(--p) 0%, var(--brd) 0%);
    cursor: pointer;
}

input[type="range"]:focus { box-shadow: none; }

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--p);
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(99,102,241,0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 22px; height: 22px;
    border: 3px solid var(--p);
    border-radius: 50%; background: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
    cursor: pointer;
}

.scale-row {
    display: flex; justify-content: space-between; margin-top: 6px;
}

.scale-row span { font-size: 0.62em; color: var(--t3); text-align: center; flex: 1; transition: color 0.2s; }
.scale-row span.on { color: var(--p2); font-weight: 600; }

.notes-area { margin-top: 16px; }
.notes-area label { font-size: 0.75em; color: var(--t3); display: block; margin-bottom: 5px; font-weight: 500; }
.notes-area textarea { width: 100%; }

/* AI OUTPUT */
.ai-out {
    margin-top: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(249,115,22,0.02));
    border-radius: var(--rs);
    border: 1px solid rgba(99,102,241,0.1);
    font-size: 0.9em;
    line-height: 1.75;
    white-space: pre-wrap;
    display: none;
    max-height: 60vh;
    overflow-y: auto;
}

.ai-out.spin {
    display: flex; align-items: center; gap: 10px;
    color: var(--t3); font-style: italic;
}

.ai-out.done { display: block; }

.dot-pulse { display: flex; gap: 4px; align-items: center; }
.dot-pulse span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--p2);
    animation: pulse 1.2s ease-in-out infinite;
}
.dot-pulse span:nth-child(2) { animation-delay: 0.15s; }
.dot-pulse span:nth-child(3) { animation-delay: 0.3s; }

@keyframes pulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.1); }
}

/* BUTTONS */
.btn {
    padding: 10px 20px; border: none;
    border-radius: var(--rs);
    font-size: 0.85em; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 7px;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-p {
    background: var(--p);
    color: white;
    box-shadow: 0 2px 10px rgba(99,102,241,0.2);
}
.btn-p:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.3); background: var(--p3); }

.btn-a {
    background: var(--acc);
    color: white;
    box-shadow: 0 2px 10px rgba(249,115,22,0.2);
}
.btn-a:hover { box-shadow: 0 4px 16px rgba(249,115,22,0.3); background: #ea580c; }

.btn-g {
    background: #fff;
    color: var(--t2);
    border: 1.5px solid var(--brd);
}
.btn-g:hover { border-color: var(--p); color: var(--p); background: rgba(99,102,241,0.04); }

.btn-s { padding: 7px 14px; font-size: 0.78em; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 20px 0 10px; }

.btn:disabled, .btn[disabled] {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--t2);
    cursor: pointer;
    background: var(--glass);
    border: 1px solid var(--brd);
    border-radius: 8px;
    padding: 6px 14px;
    margin-bottom: 8px;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}
.btn-back:hover {
    color: var(--p);
    border-color: var(--p);
    background: rgba(99,102,241,0.06);
}

.btn-danger { color: #dc2626; border-color: rgba(220,38,38,0.3); }
.btn-danger:hover { background: rgba(220,38,38,0.1); border-color: #dc2626; }

/* AUTH SCREENS */
.auth-screen {
    min-height: 90vh;
    display: none; align-items: center; justify-content: center;
}

.auth-screen.active { display: flex; }

.auth-box { max-width: 400px; width: 100%; }

.field-lbl {
    font-size: 0.72em; font-weight: 600; color: var(--t3);
    text-transform: uppercase; letter-spacing: 0.06em;
    display: block; margin-bottom: 5px;
}

.auth-actions {
    display: flex; gap: 8px; margin-top: 16px;
}
.auth-actions .btn { flex: 1; justify-content: center; }

.auth-link {
    font-size: 0.82em; color: var(--p2); cursor: pointer;
    text-decoration: none; margin-top: 10px; display: inline-block;
}
.auth-link:hover { text-decoration: underline; }

.auth-msg {
    padding: 12px 16px;
    border-radius: var(--rs);
    font-size: 0.85em;
    margin-top: 12px;
    display: none;
}
.auth-msg.success { display: block; background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2); color: #16a34a; }
.auth-msg.error { display: block; background: rgba(220,38,38,0.06); border: 1px solid rgba(220,38,38,0.15); color: #dc2626; }

/* USER MENU */
.user-menu {
    position: absolute;
    top: 24px; right: 16px;
    z-index: 50;
}

.user-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: 1.5px solid var(--brd);
    border-radius: var(--rs);
    color: var(--t2);
    font-family: inherit;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.user-btn:hover { border-color: var(--p); color: var(--p); }

.user-ico { font-size: 1.1em; }
.chevron { font-size: 0.6em; transition: transform 0.2s; }
.user-menu.open .chevron { transform: rotate(180deg); }

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px); right: 0;
    width: 300px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    max-height: 80vh;
    overflow-y: auto;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.user-menu.open .user-dropdown { display: block; }

.ud-section {
    font-size: 0.68em; font-weight: 700; color: var(--t3);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 8px; margin-top: 4px;
}

.ud-item { margin-bottom: 8px; }
.ud-item label {
    font-size: 0.72em; font-weight: 500; color: var(--t3);
    display: block; margin-bottom: 3px;
}
.ud-item input { width: 100%; }

.ud-sep { border: none; border-top: 1px solid var(--brd); margin: 12px 0; }

.ud-actions { display: flex; flex-direction: column; gap: 6px; }
.ud-actions .btn { width: 100%; justify-content: center; }

.ud-pw-section { display: none; margin-top: 8px; }
.ud-pw-section.show { display: block; }

.ud-profile { padding: 8px 0; border-bottom: 1px solid var(--brd); margin-bottom: 6px; }
.ud-profile .ud-row { margin-bottom: 8px; }
.ud-profile .ud-lbl { font-size: 0.78em; color: var(--t2); margin-bottom: 2px; display: block; font-weight: 600; }
.ud-profile .ud-val { font-size: 0.82em; color: var(--t1); font-style: italic; margin-bottom: 8px; }
.ud-profile .k-input { font-size: 0.82em; padding: 5px 8px; margin-bottom: 4px; }
.ud-profile input[type=range] { width: 100%; margin: 4px 0 2px; accent-color: var(--p); cursor: pointer; }
.ud-profile .range-labels { display: flex; justify-content: space-between; font-size: 0.65em; color: var(--t3); margin-bottom: 6px; }
.ud-profile .range-cur { font-size: 0.72em; color: var(--p); font-weight: 600; text-align: center; margin-top: -2px; margin-bottom: 2px; }

/* TOPIC SELECTION */
.screen { display: none; }
.screen.active { display: block; }

#screen-topics {
    min-height: 90vh;
    display: none; align-items: center; justify-content: center;
}
#screen-topics.active { display: flex; }

.topics-box { max-width: 720px; width: 100%; }

.topic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin: 20px 0 10px;
}

.topic-card {
    padding: 28px 18px;
    background: #fff;
    border: 1.5px solid var(--brd);
    border-radius: var(--r);
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    box-shadow: var(--shadow-sm);
}

.topic-card:hover {
    border-color: rgba(99,102,241,0.2);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.topic-card.active {
    border-color: var(--p);
    background: rgba(99,102,241,0.04);
    box-shadow: 0 2px 16px rgba(99,102,241,0.1);
}

.topic-ico {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: grid; place-items: center;
    font-size: 1.6em;
}

.topic-name { font-weight: 700; font-size: 0.95em; }
.topic-desc { font-size: 0.75em; color: var(--t3); line-height: 1.4; }
.topic-badge {
    font-size: 0.62em; font-weight: 700;
    padding: 3px 10px; border-radius: 20px;
    background: rgba(99,102,241,0.15); color: var(--p2);
}

/* SUMMARY */
#sum { display: none; }

.sum-head { text-align: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--brd); }
.sum-head h2 {
    font-size: 1.2em;
    background: linear-gradient(135deg, var(--p3), var(--p2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sum-info {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4px 20px; margin-bottom: 20px; font-size: 0.88em;
}
.sum-info .si { display: flex; gap: 6px; }
.sum-info .sl { font-weight: 600; color: var(--t2); white-space: nowrap; }
.sum-info .full { grid-column: 1 / -1; }

.sum-d { margin-bottom: 20px; page-break-inside: avoid; }
.sum-d h3 {
    font-size: 0.95em; font-weight: 600;
    color: var(--p2); margin-bottom: 8px;
    padding-bottom: 6px; border-bottom: 1px solid var(--brd);
}

.sum-t {
    font-size: 0.9em; line-height: 1.8;
    padding: 14px 16px;
    background: rgba(99,102,241,0.03);
    border-radius: var(--rs);
    border-left: 3px solid var(--p2);
    max-height: 60vh;
    overflow-y: auto;
}
.sum-t p { margin: 0 0 10px; }
.sum-t p:last-child { margin-bottom: 0; }

footer {
    text-align: center; padding: 28px 20px;
    color: var(--t3); font-size: 0.75em;
}

.np {}

/* LOCK OVERLAY */
.lock-overlay {
    position: fixed; inset: 0;
    background: rgba(248,249,252,0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 16px;
}

.lock-box {
    background: #fff;
    border: 1px solid var(--brd);
    border-radius: var(--r);
    padding: 32px 40px;
    text-align: center;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.lock-box h3 { font-size: 1.05em; margin-bottom: 8px; }
.lock-box p { font-size: 0.85em; color: var(--t2); line-height: 1.6; }
.lock-count { color: var(--p2); font-weight: 600; font-size: 0.9em; margin-top: 12px; }

/* TOAST */
.toast {
    position: fixed;
    top: 28px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #fff;
    border: 1.5px solid rgba(34,197,94,0.3);
    box-shadow: var(--shadow-md);
    color: #16a34a;
    padding: 12px 28px;
    border-radius: var(--rs);
    font-size: 0.9em; font-weight: 600;
    z-index: 200;
    opacity: 0;
    animation: toastIn 0.3s ease forwards, toastOut 0.4s ease 1s forwards;
    pointer-events: none;
}

@keyframes toastIn {
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.95); }
}

.toast-warn {
    background: #fff;
    border-color: rgba(220,38,38,0.3);
    color: #dc2626;
}

/* BRAINSTORMING */
.ang-bs-card {
    padding: 16px;
    background: #fff;
    border: 1.5px solid var(--brd);
    border-radius: var(--r);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.ang-bs-card:hover {
    border-color: rgba(234,88,12,0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.ang-bs-card.selected {
    border-color: #ea580c;
    background: rgba(251,146,60,0.06);
    box-shadow: 0 2px 12px rgba(234,88,12,0.12);
}
.ang-bs-card .bs-title { font-weight: 700; font-size: 0.92em; margin-bottom: 4px; }
.ang-bs-card .bs-desc { font-size: 0.82em; color: var(--t2); line-height: 1.5; }
.ang-bs-grid { display: grid; gap: 10px; margin-top: 12px; }

/* BILLING SCREEN */
.billing-card {
    background: var(--card);
    border: 1px solid var(--brd);
    border-radius: var(--r);
    padding: 24px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}
.billing-card h3 { font-size: 1em; margin-bottom: 12px; }
.billing-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
}
.billing-badge.active { background: rgba(34,197,94,0.1); color: #16a34a; }
.billing-badge.inactive { background: rgba(220,38,38,0.08); color: #dc2626; }
.billing-badge.credits { background: rgba(99,102,241,0.1); color: var(--p); }

.credit-balance {
    font-size: 2em;
    font-weight: 700;
    color: var(--p);
    margin: 8px 0;
}

.billing-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 16px;
}

.billing-option {
    padding: 20px;
    background: var(--bg);
    border: 1.5px solid var(--brd);
    border-radius: var(--rs);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.billing-option:hover {
    border-color: var(--p);
    box-shadow: var(--shadow-sm);
}
.billing-option h4 { font-size: 0.95em; margin-bottom: 6px; }
.billing-option .price { font-size: 1.3em; font-weight: 700; color: var(--p); }
.billing-option .desc { font-size: 0.78em; color: var(--t3); margin-top: 4px; }

/* ADMIN PANEL */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    padding: 16px;
    background: var(--bg);
    border-radius: var(--rs);
    text-align: center;
}
.stat-card .stat-val {
    font-size: 1.6em; font-weight: 700;
    background: linear-gradient(135deg, var(--p3), var(--p2), var(--acc));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card .stat-lbl { font-size: 0.72em; color: var(--t3); text-transform: uppercase; letter-spacing: 0.05em; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}
.admin-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--t3);
    border-bottom: 2px solid var(--brd);
}
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--brd);
}
.admin-table tr:hover td { background: var(--bg); }

/* LEGAL PAGES */
.legal-content {
    max-width: 700px;
    margin: 0 auto;
}
.legal-content h2 { font-size: 1.15em; margin: 24px 0 12px; color: var(--p3); }
.legal-content h3 { font-size: 1em; margin: 18px 0 8px; }
.legal-content p { margin-bottom: 10px; font-size: 0.9em; line-height: 1.7; color: var(--t2); }
.legal-content ul { margin: 8px 0 12px 20px; font-size: 0.9em; color: var(--t2); }
.legal-content li { margin-bottom: 4px; }

/* DOCUMENT SELECTION MODAL */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: #fff;
    border-radius: var(--r);
    padding: 28px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin-bottom: 16px; }

/* HERO BANNER */
.hero-banner {
    position: relative;
    height: var(--hero-h);
    border-radius: var(--r);
    overflow: hidden;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-banner__img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s var(--transition-smooth);
}

.hero-banner:hover .hero-banner__img {
    transform: scale(1.03);
}

.hero-banner__overlay {
    position: absolute;
    inset: 0;
    background: var(--img-overlay);
    z-index: 1;
}

.hero-banner__content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 20px;
}

.hero-banner__content h1 {
    font-size: 2.2em;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #fff;
    background-clip: unset;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.hero-banner__content p {
    color: rgba(255,255,255,0.9);
    font-size: 1em;
    margin-top: 8px;
}

.hero-banner--small {
    height: 200px;
}

/* AUTH SPLIT LAYOUT */
.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.auth-split__image {
    background-size: cover;
    background-position: center;
    position: relative;
    min-height: 300px;
}

.auth-split__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.6), rgba(79,70,229,0.4));
}

.auth-split__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: var(--bg);
}

/* TOPIC CARD IMAGE */
.topic-card {
    position: relative;
    overflow: hidden;
}

.topic-card__img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    transition: opacity 0.4s var(--transition-smooth), transform 0.6s var(--transition-smooth);
}

.topic-card:hover .topic-card__img {
    opacity: 0.14;
    transform: scale(1.08);
}

/* SKELETON LOADING */
.skeleton {
    background: linear-gradient(90deg, var(--bg2) 25%, var(--bg) 50%, var(--bg2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--rs);
}

/* TOGGLE SWITCH */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch .slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.3s var(--transition-smooth);
}
.toggle-switch .slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.3s var(--transition-smooth);
}
.toggle-switch input:checked + .slider {
    background: var(--p);
}
.toggle-switch input:checked + .slider::before {
    transform: translateX(22px);
}

/* ADMIN SETTINGS */
.settings-section {
    margin-top: 16px;
}
.settings-section h3 {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--t1);
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--brd);
}
.settings-row:last-child {
    border-bottom: none;
}
.settings-label {
    flex: 1;
    min-width: 0;
}
.settings-label strong {
    display: block;
    font-size: 0.95em;
    color: var(--t1);
}
.settings-label span {
    font-size: 0.82em;
    color: var(--t3);
}
.smtp-fields {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s var(--transition-smooth), opacity 0.3s var(--transition-smooth), margin 0.3s;
    margin-top: 0;
}
.smtp-fields.visible {
    max-height: 600px;
    opacity: 1;
    margin-top: 16px;
}
.smtp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.smtp-grid .field-full {
    grid-column: 1 / -1;
}
.settings-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82em;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.settings-status.active {
    background: rgba(34,197,94,0.12);
    color: #16a34a;
}
.settings-status.inactive {
    background: rgba(251,146,60,0.12);
    color: #ea580c;
}

/* PRINT */
@media print {
    :root {
        --p: #000; --p2: #000; --p3: #000;
        --bg: #fff; --bg2: #fff; --bg3: #fff;
        --card: #fff; --glass: #fff;
        --t1: #000; --t2: #333; --t3: #555;
        --brd: #ccc;
    }
    body { background: white; color: #000; }
    body::before, body::after { display: none; }
    .np { display: none !important; }
    .wrap { max-width: 100%; padding: 0 16px; }
    .card { backdrop-filter: none; box-shadow: none; border: 1px solid #ccc; }
    .hero, .hero-banner { padding: 16px 0; height: auto; }
    .hero h1, .hero-banner__content h1 { background: none; -webkit-background-clip: unset; -webkit-text-fill-color: #000; background-clip: unset; color: #000; text-shadow: none; }
    .hero-banner__img, .hero-banner__overlay { display: none; }
    .hero-banner__content { color: #000; }
    .hero-banner__content p { color: #333; }
    .auth-split { display: block; width: auto; margin-left: 0; }
    .auth-split__image { display: none; }
    .sum-head h2 { background: none; -webkit-background-clip: unset; -webkit-text-fill-color: #000; background-clip: unset; color: #000; }
    .sum-d h3 { color: #000; border-bottom-color: #ccc; }
    .sum-t { background: none !important; border-left: 2px solid #999; max-height: none !important; overflow: visible !important; }
    .ai-out { max-height: none !important; overflow: visible !important; }
    .user-menu { display: none !important; }
    .lg-no-print { display: none !important; }
    .auth-screen, #screen-topics, .screen { display: none !important; }
    .screen.print-active { display: block !important; }
}

@media (max-width: 600px) {
    .grid { grid-template-columns: 1fr; }
    .sum-info { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.5em; }
    .actions { flex-direction: column; }
    .actions .btn { width: 100%; justify-content: center; }
    .card { padding: 20px 16px; }
    .user-dropdown { width: 260px; }
    .topic-grid { grid-template-columns: 1fr; }
    .billing-options { grid-template-columns: 1fr; }
    .auth-box { padding: 0 12px; }
    .hero-banner { height: var(--hero-h-sm); }
    .hero-banner--small { height: 160px; }
    .hero-banner__content h1 { font-size: 1.5em; }
    .auth-split { grid-template-columns: 1fr; width: 100vw; }
    .auth-split__image { min-height: 200px; }
    .auth-split__form { padding: 24px 16px; }
}
