@font-face {
    font-family: Inter;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: Inter;
    src: url("../fonts/inter-latin-ext.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
    --bg: #0f172a;
    --bg-2: #111827;
    --panel: #1f2937;
    --line: #374151;
    --text: #f9fafb;
    --muted: #9ca3af;
    --primary: #6366f1;
    --primary-2: #818cf8;
    --primary-hover: #4f46e5;
    --violet: #8b5cf6;
    --danger: #ef4444;
    --ok: #10b981;
    --info: #38bdf8;
    --shadow: 0 24px 60px rgba(2, 6, 23, .45);
    --radius: 18px;
    font-family: Inter, "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    min-height: 100%;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv11", "ss01", "kern";
    background:
        radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.18), transparent 32%),
        radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.12), transparent 28%),
        linear-gradient(160deg, #0b1220 0%, #0f172a 45%, #111827 100%);
    color: var(--text);
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.brand-logo {
    display: block;
    width: 56px; height: 56px;
    border-radius: 16px;
    object-fit: cover;
    background: #0b1220;
    box-shadow: 0 8px 24px rgba(99, 102, 241, .35);
}
.brand-logo.sm { width: 40px; height: 40px; border-radius: 12px; }
.brand-logo.lg {
    width: min(280px, 72vw);
    height: auto;
    aspect-ratio: 1;
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(2, 6, 23, .45);
}

.auth-shell {
    min-height: 100vh; display: grid; place-items: center;
    grid-template-columns: minmax(240px, 380px) minmax(280px, 420px);
    gap: 48px; padding: 40px 24px;
}
.auth-brand p { color: var(--muted); line-height: 1.5; margin-top: 16px; }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.auth-card { padding: 28px; display: grid; gap: 14px; }
.auth-card h2 { margin: 0 0 4px; }
label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
textarea,
input[type=email], input[type=password], input[type=search], input[type=text], input[type=tel], select {
    width: 100%; padding: 12px 14px; border-radius: 12px;
    border: 1px solid var(--line); background: #0b1220; color: var(--text);
    font: inherit;
    font-size: 16px;
    color-scheme: dark;
}
select option {
    background: #0b1220;
    color: #f9fafb;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); border-color: var(--primary); }
.section-title { font-size: 1.05rem; margin: 8px 0 12px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid var(--line); background: #1e293b; color: var(--text);
    border-radius: 12px; padding: 11px 16px; font: inherit; cursor: pointer;
    text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 700;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { width: 100%; background: transparent; }
.btn-block { width: 100%; padding: 13px 16px; }
.btn-small { padding: 7px 10px; font-size: .82rem; border-radius: 10px; }
.btn-danger { color: #fecaca; border-color: #7f1d1d; background: rgba(239, 68, 68, .16); }

.alert { padding: 10px 12px; border-radius: 12px; margin: 0; }
.alert-error { background: rgba(239, 68, 68, .16); color: #fecaca; }
.alert-ok { background: rgba(16, 185, 129, .16); color: #a7f3d0; }
.muted { color: var(--muted); font-size: .92rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
    padding: 24px 18px; border-right: 1px solid var(--line);
    background: rgba(15, 23, 42, .88);
    display: flex; flex-direction: column; gap: 18px;
}
.mobile-bar, .nav-backdrop { display: none; }
.nav-close { display: none; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand span { display: block; color: var(--muted); font-size: .8rem; }
.user-chip { font-size: .85rem; color: var(--muted); word-break: break-all; display: grid; gap: 4px; }
.user-chip strong { color: var(--text); font-size: .95rem; }
.badge {
    display: inline-block; width: max-content; padding: 2px 8px; border-radius: 999px;
    background: rgba(99, 102, 241, .18); color: var(--primary-2); font-size: .72rem; letter-spacing: .04em;
}
.table-wrap { padding: 8px 0; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.data-table th { color: var(--muted); font-size: .8rem; font-weight: 600; }
.side-nav { display: grid; gap: 4px; }
.nav-link {
    display: block; padding: 9px 12px; border-radius: 10px; color: var(--text);
    text-decoration: none; font-size: .92rem; border: 1px solid transparent;
}
.nav-link:hover { background: #1e293b; text-decoration: none; }
.nav-link.active { background: rgba(99, 102, 241, .16); border-color: #4338ca; color: var(--primary-2); }
.account-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.quota-form { display: flex; gap: 6px; align-items: center; }
.quota-form select, .quota-input {
    background: #0b1220; color: var(--text); border: 1px solid var(--line);
    border-radius: 10px; padding: 7px 8px; font: inherit;
}
.quota-input { width: 88px; }
.db-tools-lead { margin: -4px 0 12px; }
.db-tools-lead strong { color: var(--text); }
.db-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.db-tool {
    padding: 16px;
    display: grid;
    gap: 8px;
    align-content: start;
}
.db-tool h3 { margin: 0; font-size: .98rem; }
.db-tool p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.db-file {
    width: 100%;
    font: inherit;
    font-size: .82rem;
    color: var(--text);
}
.db-tables { margin-bottom: 22px; }
.quota-bar { height: 8px; background: #0b1220; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.quota-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--violet)); }
.quota small { color: var(--muted); }

.main { padding: 28px; }
.topbar {
    display: flex; flex-direction: row; align-items: center;
    justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-bottom: 18px;
}
.topbar .finder-chips { flex: 1 1 auto; min-width: 0; }
.topbar .finder { margin-left: auto; }
.search { flex: 1; max-width: 420px; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; max-width: 420px; }
.finder {
    display: flex; gap: 8px; align-items: center;
    margin-left: auto; flex: 0 0 auto;
}
.finder-search {
    position: relative; display: block; width: 168px; flex: 0 0 168px; margin: 0; color: inherit;
}
.finder-search input {
    padding-left: 36px; padding-right: 32px; height: 40px;
    border-radius: 12px; background: var(--panel);
}
.finder-icon {
    position: absolute; left: 14px; top: 50%; width: 16px; height: 16px;
    transform: translateY(-50%);
    border: 2px solid var(--muted); border-radius: 50%;
    pointer-events: none;
}
.finder-icon::after {
    content: ""; position: absolute; width: 7px; height: 2px;
    background: var(--muted); right: -5px; bottom: -2px;
    transform: rotate(45deg); border-radius: 2px;
}
.finder-clear {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    background: #1e293b; color: var(--text); font-size: 1.1rem; line-height: 1;
    text-decoration: none;
}
.finder-clear:hover { text-decoration: none; filter: brightness(1.1); }
.finder-sort {
    position: relative;
    margin: 0;
    flex: 0 0 auto;
}
.sort-btn {
    position: relative;
    display: grid; place-items: center;
    width: 40px; height: 40px; min-width: 40px; padding: 0;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--panel); color: var(--text);
    cursor: pointer;
}
.sort-btn:hover { border-color: var(--primary-2); color: var(--primary-2); }
.sort-list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
    min-width: 188px; padding: 6px;
    background: #111827; color: #f9fafb;
    border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow);
    display: grid;
}
.sort-list.hidden { display: none; }
.sort-option {
    display: block; width: 100%; text-align: left;
    border: 0; background: transparent; color: #f9fafb;
    font: inherit; font-size: .92rem; padding: 10px 12px;
    border-radius: 10px; cursor: pointer;
}
.sort-option:hover, .sort-option.is-on { background: rgba(99, 102, 241, .22); color: #e0e7ff; }
.finder-chips {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.chip {
    display: inline-flex; align-items: center; padding: 8px 14px;
    border-radius: 999px; border: 1px solid var(--line);
    background: var(--panel); color: var(--text); font-size: .86rem;
    text-decoration: none;
}
.chip:hover { text-decoration: none; border-color: var(--primary-2); }
.chip.is-on {
    background: rgba(99, 102, 241, .2); border-color: var(--primary);
    color: var(--primary-2); font-weight: 600;
}

.dropzone {
    position: relative; border: 1px dashed #6366f1; border-radius: var(--radius);
    padding: 28px; margin-bottom: 22px; background: rgba(99, 102, 241, .06);
    text-align: center;
}
.dropzone.drag { background: rgba(99, 102, 241, .16); }
.dropzone input[type=file] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.dropzone-copy { display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.dropzone-copy .btn { pointer-events: auto; position: relative; z-index: 2; }
.progress {
    position: relative; height: 22px; background: #0b1220; border-radius: 99px;
    overflow: hidden; margin-top: 14px; border: 1px solid var(--line);
}
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--violet)); transition: width .15s linear; }
.progress span {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-size: .78rem; font-weight: 700; color: #fff; letter-spacing: .02em;
}
.hidden { display: none; }

.library-tools {
    display: flex; justify-content: flex-start; gap: 12px; align-items: center;
    margin: 0 0 16px; flex-wrap: wrap;
}
.library-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-right: auto; }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .9rem; flex: 1 1 100%; }
.crumbs a { color: var(--primary-2); }
.card.is-folder .file-icon { color: #fbbf24; }
.card.is-folder.is-drop { outline: 2px dashed var(--primary); }
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.card {
    position: relative;
    background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.card.is-selected { outline: 2px solid var(--primary); }
.pick {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    width: 22px; height: 22px; display: grid; place-items: center;
    background: rgba(11, 18, 32, .78); border-radius: 6px;
}
.pick input, .pick-all input { width: 16px; height: 16px; accent-color: var(--primary); }
.bulk-bar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: 14px; background: var(--panel);
}
.pick-all { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.bulk-count { color: var(--primary-2); font-size: .9rem; margin-right: auto; }
.inline-form { margin: 0; }
.nav-count {
    margin-left: 8px; background: rgba(239, 68, 68, .2); color: #fecaca;
    border-radius: 999px; padding: 0 7px; font-size: .75rem;
}
.thumb {
    display: block; aspect-ratio: 16/11; background: #0b1220;
    text-decoration: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-icon {
    width: 100%; height: 100%; display: grid; place-items: center;
    color: var(--primary-2); letter-spacing: .08em; font-weight: 800;
}
.card-body { padding: 12px 14px 14px; }
.card-body h3 {
    margin: 0 0 4px; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-body p { margin: 0 0 10px; color: var(--muted); font-size: .8rem; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-actions form { margin: 0; }
.file-context {
    position: fixed; z-index: 80; min-width: 168px; padding: 6px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow);
}
.file-context button {
    display: block; width: 100%; text-align: left; background: transparent;
    border: 0; color: var(--text); font: inherit; padding: 9px 12px;
    border-radius: 8px; cursor: pointer;
}
.file-context button:hover { background: rgba(99, 102, 241, .18); }
.share-overlay {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(2, 6, 23, .62);
    display: grid; place-items: center; padding: 20px;
}
.share-overlay.hidden { display: none; }
.share-dialog { width: min(420px, 100%); padding: 22px; display: grid; gap: 12px; }
.share-dialog h2 { margin: 0; }

.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); }

.preview-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.preview-head h1 { margin: 0 0 6px; font-size: 1.25rem; word-break: break-word; }
.preview-head p { margin: 0; color: var(--muted); }
.preview-stage {
    position: relative;
    background: #0b1220; border: 1px solid var(--line); border-radius: var(--radius);
    min-height: 420px; display: grid; place-items: center; overflow: hidden; padding: 12px;
    touch-action: pan-y;
}
.slide-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 2; width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(15, 23, 42, .72);
    color: #fff; font-size: 1.6rem; line-height: 1;
    text-decoration: none;
    border: 1px solid var(--line);
}
.slide-nav:hover { text-decoration: none; border-color: var(--primary-2); }
.slide-nav.is-prev { left: 10px; }
.slide-nav.is-next { right: 10px; }
.slide-hint { margin: 10px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.full-media { max-width: 100%; max-height: 72vh; }
video.full-media { width: min(100%, 1100px); }
.audio-wrap { width: min(100%, 640px); padding: 40px 16px; }
audio { width: 100%; }
.pdf-frame { width: 100%; height: 75vh; border: 0; background: #fff; }

@media (max-width: 960px) {
    .app-shell {
        display: block;
        padding-top: env(safe-area-inset-top);
    }
    .mobile-bar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 45;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
        background: rgba(15, 23, 42, .96);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(10px);
    }
    .mobile-bar strong { font-size: 1rem; }
    .nav-toggle {
        display: grid;
        gap: 5px;
        width: 42px;
        height: 42px;
        place-content: center;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #1e293b;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
    }
    .nav-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--text);
        border-radius: 2px;
    }
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 48;
        background: rgba(2, 6, 23, .55);
    }
    .nav-backdrop[hidden] { display: none; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(300px, 88vw);
        z-index: 50;
        transform: translateX(-105%);
        transition: transform .2s ease;
        border-right: 1px solid var(--line);
        overflow: auto;
        padding-top: max(18px, env(safe-area-inset-top));
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
    body.nav-open .sidebar { transform: none; }
    body.nav-open { overflow: hidden; }
    .nav-close {
        display: inline-flex;
        margin-left: auto;
        padding: 7px 10px;
        font-size: .8rem;
    }
    .brand { width: 100%; }
    .auth-shell {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 16px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        min-height: 100dvh;
        place-items: start center;
    }
    .brand-logo.lg {
        width: min(220px, 64vw);
        margin: 0 auto;
    }
    .auth-brand { text-align: center; width: min(420px, 100%); }
    .auth-card { width: min(420px, 100%); padding: 22px 18px; }
    .finder { margin-left: auto; }
    .main {
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    .dropzone { padding: 18px 12px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .btn-small { min-height: 40px; padding: 8px 12px; }
    .nav-link { padding: 12px; min-height: 44px; }
    .preview-head { flex-direction: column; }
    .preview-stage { min-height: 240px; }
    .pdf-frame { height: 62vh; }
    .full-media { max-height: 56vh; }
    .data-table { min-width: 0; }
    .admin-table-wrap { overflow: visible; padding: 8px; }
    .admin-table { min-width: 0; }
    .admin-table thead { display: none; }
    .admin-table, .admin-table tbody { display: block; width: 100%; }
    .admin-table tr {
        display: grid;
        gap: 0;
        margin: 0 0 12px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #0b1220;
    }
    .admin-table td {
        display: grid;
        grid-template-columns: 7.2rem minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px solid var(--line);
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .admin-table td:last-child { border-bottom: 0; }
    .admin-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: .75rem;
        font-weight: 600;
    }
    .admin-table .quota-form,
    .admin-table .account-actions {
        width: 100%;
        min-width: 0;
    }
    .admin-table .quota-input { width: 72px; flex: 0 0 auto; }
    .db-tools { grid-template-columns: 1fr; }
    .preview-head h1 { font-size: 1.15rem; }
    .main { overflow-x: clip; }
    .share-overlay { padding: 12px; place-items: end center; }
    .share-dialog {
        width: 100%;
        max-height: min(92dvh, 720px);
        overflow: auto;
        padding: 18px 16px;
        padding-bottom: max(18px, env(safe-area-inset-bottom));
        border-radius: 18px 18px 12px 12px;
    }
    .msg-bubble { max-width: 88%; }
    .msg-thread, .msg-layout { min-height: 48vh; }
    .quota-form { flex-wrap: wrap; }
    .empty { padding: 24px 16px; }
}

@media (max-width: 860px) {
    .msg-layout.is-admin { grid-template-columns: 1fr; }
    .msg-thread { min-height: 46vh; }
}

body.is-auth {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}
.reg-page {
    height: 100dvh;
    max-height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 10px 24px 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}
.reg-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-shrink: 0;
    color: var(--text);
    text-decoration: none;
}
.reg-brand:hover { text-decoration: none; }
.reg-brand small { display: block; color: var(--muted); font-size: .78rem; }
.reg-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(380px, 1.2fr);
    gap: 28px;
    align-items: stretch;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}
.reg-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}
.reg-kicker {
    margin: 0 0 6px;
    color: var(--primary-2);
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 700;
}
.reg-aside h1 {
    margin: 0 0 8px;
    font-size: clamp(1.45rem, 2.6vw, 2rem);
    line-height: 1.2;
}
.reg-lead { color: var(--muted); line-height: 1.45; margin: 0 0 14px; font-size: .92rem; }
.reg-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}
.reg-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
}
.reg-steps li span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #1e293b;
    color: var(--text);
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}
.reg-steps li.is-current {
    color: var(--text);
    background: rgba(99, 102, 241, .12);
    border-color: rgba(99, 102, 241, .35);
}
.reg-steps li.is-current span {
    background: var(--primary);
}
.reg-steps li.is-done {
    color: #a7f3d0;
}
.reg-steps li.is-done span {
    background: #0f766e;
}
.reg-card {
    padding: 14px 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
.reg-card-head,
.reg-card > .alert { flex-shrink: 0; }
.reg-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.reg-card-head h2 { margin: 0; font-size: 1.2rem; }
.reg-card-head p { margin: 0; color: var(--muted); font-size: .82rem; }
.reg-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 5px 10px 5px 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    width: fit-content;
    background: rgba(15, 23, 42, .35);
    flex-shrink: 0;
}
.reg-back:hover { text-decoration: none; border-color: #818cf8; color: #c4b5fd; }
.reg-back svg { width: 16px; height: 16px; }
.reg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    align-items: start;
    flex-shrink: 0;
}
.reg-span { grid-column: 1 / -1; }
.reg-field {
    display: grid;
    grid-template-rows: auto auto minmax(1em, auto);
    gap: 4px;
    font-size: .82rem;
    color: var(--muted);
    align-content: start;
}
.reg-card input[type=email],
.reg-card input[type=password],
.reg-card input[type=text],
.reg-card input[type=tel] {
    padding: 8px 12px;
}
.field-hint { color: var(--muted); font-size: .72rem; min-height: 1em; line-height: 1.2; }
.field-hint.is-ok { color: var(--ok); }
.field-hint.is-bad { color: #fecaca; }
.pass-wrap {
    position: relative;
    display: flex;
    align-items: center;
    height: 38px;
}
.pass-wrap input { height: 38px; width: 100%; padding-right: 76px; }
.pass-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--primary-2);
    font: inherit;
    font-size: .78rem;
    cursor: pointer;
    padding: 4px 8px;
}
.reg-notice-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    flex-shrink: 0;
}
.reg-notice-row > input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.reg-notice-link {
    border: 0;
    background: none;
    padding: 0;
    color: #a5b4fc;
    font: inherit;
    font-size: .9rem;
    font-weight: 650;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.reg-notice-link:hover { color: #c4b5fd; }
.reg-notice-status { color: var(--muted); font-size: .8rem; }
.reg-notice-status.is-ok { color: var(--ok); }
.reg-notice-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #e2e8f0;
    font-size: .9rem;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
    flex-shrink: 0;
}
.reg-notice-check input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    flex-shrink: 0;
    accent-color: #6366f1;
    cursor: pointer;
}
.aydinlatma-dialog {
    width: min(640px, 100%);
    max-height: min(88dvh, 760px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 22px 16px;
}
.aydinlatma-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 4px 2px 8px;
    color: #cbd5e1;
    font-size: .9rem;
    line-height: 1.55;
}
.verify-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 20px 16px;
    box-sizing: border-box;
}
.verify-wrap {
    width: min(360px, 100%);
    display: grid;
    gap: 14px;
    justify-items: center;
}
.verify-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: .92rem;
}
.verify-brand:hover { text-decoration: none; }
.verify-card {
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 18px 18px 14px;
    display: grid;
    gap: 12px;
    border-radius: 18px;
}
.verify-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.verify-head h1 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}
.verify-kicker {
    margin: 0 0 2px;
    color: var(--primary-2);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 700;
}
.verify-hint {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.4;
    text-align: center;
}
.verify-mail {
    margin: 0;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, .28);
    background: rgba(99, 102, 241, .1);
    color: #c7d2fe;
    font-size: .78rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.verify-card .alert { margin: 0; padding: 8px 10px; font-size: .8rem; }
.otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 10px;
}
.otp-digit {
    width: 100%;
    height: 42px;
    padding: 0;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0;
    border-radius: 10px;
    caret-color: #a5b4fc;
}
.verify-submit { padding: 9px 14px; font-size: .92rem; }
.verify-resend { margin: 0; }
.verify-resend .btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    filter: none;
}
.verify-login { text-decoration: none; }
.verify-foot {
    margin: 0;
    text-align: center;
    font-size: .78rem;
    color: var(--muted);
}
.aydinlatma-body h3,
.aydinlatma-body h4 {
    margin: 16px 0 8px;
    color: #f1f5f9;
    font-size: 1rem;
    line-height: 1.35;
}
.aydinlatma-body h3:first-child { margin-top: 0; }
.aydinlatma-body h4 { font-size: .92rem; }
.aydinlatma-body p { margin: 0 0 10px; }
.aydinlatma-body p:last-child { margin-bottom: 0; }
.aydinlatma-body ul {
    margin: 0 0 10px;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}
.reg-quota {
    border: 0;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
    flex-shrink: 0;
}
.reg-quota legend {
    padding: 0;
    color: var(--muted);
    font-size: .82rem;
    margin-bottom: 0;
}
.quota-picks {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
}
.quota-pick {
    display: flex;
    min-width: 0;
    height: 100%;
    cursor: pointer;
}
.quota-pick input { position: absolute; opacity: 0; pointer-events: none; }
.quota-pick-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 2px;
    width: 100%;
    height: 48px;
    padding: 4px 6px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #111827 0%, #0b1220 100%);
    box-sizing: border-box;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.quota-pick-card strong {
    color: var(--text);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}
.quota-pick-card strong b {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    font-style: normal;
}
.quota-pick-card small {
    color: var(--muted);
    line-height: 1.15;
    font-size: .62rem;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 12ch;
}
.quota-pick input:focus-visible + .quota-pick-card {
    outline: 2px solid var(--primary-2);
    outline-offset: 2px;
}
.quota-pick input:checked + .quota-pick-card {
    border-color: var(--primary);
    background: linear-gradient(180deg, rgba(99, 102, 241, .28), rgba(99, 102, 241, .1));
    box-shadow: 0 0 0 1px var(--primary), 0 10px 24px rgba(99, 102, 241, .18);
}
.quota-pick:hover .quota-pick-card {
    border-color: var(--primary-2);
    transform: translateY(-1px);
}
.reg-card .btn-block { flex-shrink: 0; padding: 10px 16px; }
.reg-foot { margin: 0; text-align: center; color: var(--muted); font-size: .82rem; flex-shrink: 0; }
body.login-splash { background: #050816; }
.login-hero {
    position: relative;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 28px 6vw;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    overflow: auto;
    background: #050816 url("../img/login-scene.jpg") center / cover no-repeat;
}
.login-intro,
.login-glass { position: relative; z-index: 1; }
.login-intro {
    max-width: 460px;
    flex: 1 1 360px;
}
.login-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}
.login-mark-icon { width: 42px; height: 42px; display: block; }
.login-mark-icon svg { width: 100%; height: 100%; display: block; }
.login-mark strong {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.03em;
}
.login-mark strong span { color: #818cf8; }
.login-intro h1 {
    margin: 0 0 14px;
    font-size: clamp(1.7rem, 2.8vw, 2.35rem);
    line-height: 1.22;
    font-weight: 650;
    letter-spacing: -.03em;
}
.login-intro h1 em {
    font-style: normal;
    color: #c4b5fd;
}
.login-intro > p {
    margin: 0 0 26px;
    color: #cbd5e1;
    line-height: 1.55;
    max-width: 40ch;
    font-size: 1rem;
    font-weight: 450;
}
.login-feats {
    list-style: none;
    margin: 0 0 26px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 18px 22px;
    width: max-content;
}
.login-feats li {
    display: grid;
    justify-items: start;
    gap: 8px;
    color: #e2e8f0;
    font-size: .8rem;
    font-weight: 550;
    line-height: 1.3;
    padding-right: 18px;
    border-right: 1px solid rgba(148, 163, 184, .2);
}
.login-feats li:last-child { border-right: 0; padding-right: 0; }
.login-feats svg { width: 22px; height: 22px; color: #a5b4fc; }
.login-discover {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, .35);
    background: rgba(15, 23, 42, .35);
    color: #f8fafc;
    font-size: .88rem;
    font-weight: 550;
    cursor: pointer;
    font: inherit;
}
.login-discover:hover { text-decoration: none; border-color: #818cf8; }
.login-discover svg { width: 18px; height: 18px; }
.login-discover span { color: #a5b4fc; }
.kesfet-show {
    position: fixed; inset: 0; z-index: 120;
    background: #030712; display: grid; place-items: center;
}
.kesfet-show.hidden { display: none; }
.kesfet-stage {
    position: relative; width: min(1100px, 100%); height: min(100dvh, 100%);
    overflow: hidden; background: #050816;
}
.kesfet-track { position: absolute; inset: 0; }
.kesfet-slide {
    position: absolute; inset: 0; margin: 0; opacity: 0;
    transition: opacity .7s ease;
}
.kesfet-slide.is-on { opacity: 1; z-index: 1; }
.kesfet-slide img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transform: scale(1.08); animation: kesfetKen 7s ease-out forwards;
}
.kesfet-slide.is-on img { animation: kesfetKen 7s ease-out forwards; }
@keyframes kesfetKen {
    from { transform: scale(1.12) translate3d(0, 8px, 0); }
    to { transform: scale(1) translate3d(0, 0, 0); }
}
.kesfet-slide figcaption {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 72px 28px 78px;
    background: linear-gradient(180deg, transparent, rgba(3, 7, 18, .92));
}
.kesfet-slide figcaption small {
    display: block; color: #a5b4fc; font-weight: 700; letter-spacing: .14em;
    font-size: .72rem; margin-bottom: 8px;
}
.kesfet-slide figcaption h3 {
    margin: 0 0 8px; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.03em;
}
.kesfet-slide figcaption p {
    margin: 0; max-width: 46ch; color: #cbd5e1; line-height: 1.5; font-size: .98rem;
}
.kesfet-bar {
    position: absolute; left: 0; right: 0; top: 0; z-index: 4; height: 3px;
    background: rgba(255,255,255,.12);
}
.kesfet-bar i {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
}
.kesfet-ui { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.kesfet-ui > * { pointer-events: auto; }
.kesfet-x {
    position: absolute; top: 14px; right: 14px; width: 42px; height: 42px;
    border: 0; border-radius: 99px; cursor: pointer; font-size: 1.6rem; line-height: 1;
    color: #fff; background: rgba(15, 23, 42, .55);
}
.kesfet-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 46px; height: 46px; border: 0; border-radius: 99px; cursor: pointer;
    font-size: 1.8rem; color: #fff; background: rgba(15, 23, 42, .45);
}
.kesfet-prev { left: 12px; }
.kesfet-next { right: 12px; }
.kesfet-foot {
    position: absolute; left: 16px; right: 16px; bottom: 16px;
    display: flex; align-items: center; gap: 12px;
}
.kesfet-play {
    width: 40px; height: 40px; border: 0; border-radius: 99px; cursor: pointer;
    color: #fff; background: rgba(99, 102, 241, .85); font-size: .8rem;
}
.kesfet-dots { display: flex; gap: 6px; flex: 1; }
.kesfet-dots button {
    width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px;
    background: rgba(255,255,255,.28); cursor: pointer;
}
.kesfet-dots button.is-on { background: #818cf8; width: 22px; }
.kesfet-cta { margin-left: auto; }
.login-glass {
    width: min(360px, 100%);
    flex-shrink: 0;
    padding: 26px 24px 20px;
    display: grid;
    gap: 12px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(30, 41, 90, .42), rgba(15, 23, 50, .55));
    border: 1px solid rgba(165, 180, 252, .28);
    box-shadow: 0 24px 60px rgba(2, 6, 23, .45);
    backdrop-filter: blur(18px);
}
.login-glass form { display: grid; gap: 12px; }
.login-glass h2 { margin: 0; font-size: 1.55rem; font-weight: 650; }
.login-glass-lead { margin: 0 0 4px; color: #94a3b8; font-size: .9rem; }
.login-field { display: grid; gap: 6px; font-size: .85rem; color: #cbd5e1; }
.login-input {
    position: relative;
    display: block;
}
.login-input > svg {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.login-input input {
    padding-left: 40px;
    padding-right: 42px;
    height: 44px;
    border-radius: 12px;
    background: rgba(8, 12, 28, .72);
    border-color: rgba(100, 116, 139, .45);
}
.login-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    display: grid;
    place-items: center;
}
.login-eye svg { width: 18px; height: 18px; }
.login-keep {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 2px 0 0;
    color: #cbd5e1;
    font-size: .88rem;
    cursor: pointer;
    user-select: none;
}
.login-glass-wide { width: min(420px, 100%); }
.totp-steps {
    margin: 0;
    padding-left: 18px;
    color: #cbd5e1;
    font-size: .88rem;
    display: grid;
    gap: 8px;
}
.totp-secret {
    display: block;
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(8, 12, 28, .72);
    color: #e0e7ff;
    letter-spacing: .12em;
    font-size: .95rem;
    word-break: break-all;
}
.totp-input {
    letter-spacing: .35em;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 650;
}
.login-keep input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #6366f1;
    cursor: pointer;
}
.login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    margin-top: 4px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    box-shadow: 0 10px 24px rgba(99, 102, 241, .35);
}
.login-submit:hover { filter: brightness(1.08); }
.login-submit span { font-size: 1.1rem; }
.login-glass-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
    font-size: .88rem;
}
.login-glass-foot button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .88rem;
    cursor: pointer;
    padding: 0;
}
.login-glass-foot button svg { width: 16px; height: 16px; }
.login-glass-foot button:hover, .login-glass-foot a:hover { color: #c4b5fd; }
.field-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.field-head a { font-size: .8rem; }

.msg-layout { display: grid; gap: 16px; min-height: 62vh; }
.msg-layout.is-admin { grid-template-columns: minmax(220px, 280px) 1fr; }
.msg-list { padding: 10px; display: grid; align-content: start; gap: 6px; overflow: auto; }
.msg-peer {
    display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px;
    color: var(--text); text-decoration: none; border: 1px solid transparent; position: relative;
}
.msg-peer:hover { background: #1e293b; text-decoration: none; }
.msg-peer.is-active { background: rgba(99, 102, 241, .16); border-color: #4338ca; }
.msg-peer span { color: var(--muted); font-size: .8rem; }
.msg-peer em {
    position: absolute; right: 10px; top: 12px;
    background: var(--primary); color: #fff; font-style: normal;
    font-size: .72rem; padding: 1px 7px; border-radius: 99px;
}
.msg-thread { padding: 16px; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; min-height: 62vh; }
.msg-thread-head { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.msg-thread-head span { color: var(--muted); font-size: .85rem; }
.msg-bubbles { display: grid; gap: 10px; align-content: start; overflow: auto; padding: 4px 2px; }
.msg-bubble {
    max-width: min(72%, 560px); padding: 10px 12px; border-radius: 14px;
    background: #0b1220; border: 1px solid var(--line);
}
.msg-bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.msg-bubble time { display: block; margin-top: 6px; color: var(--muted); font-size: .75rem; }
.msg-bubble.is-mine {
    justify-self: end;
    background: rgba(99, 102, 241, .18);
    border-color: rgba(99, 102, 241, .4);
}
.msg-compose { display: grid; gap: 10px; }
@media (max-width: 860px) {
    .msg-layout.is-admin { grid-template-columns: 1fr; }
    .msg-thread { min-height: 50vh; }
}

@media (max-width: 900px) {
    body.is-auth { overflow: auto; height: auto; max-height: none; }
    .reg-page {
        height: auto; max-height: none; overflow: visible;
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    .reg-layout { grid-template-columns: 1fr; }
    .reg-aside { display: none; }
    .login-hero {
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        padding: 20px 16px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    .login-intro { max-width: none; }
    .login-glass { align-self: center; }
    .login-feats { width: 100%; grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .login-feats li { border-right: 0; padding-right: 0; }
    .reg-grid, .quota-picks { grid-template-columns: 1fr 1fr; }
    .reg-card { height: auto; max-height: none; overflow: visible; padding: 16px; }
}

@media (max-width: 560px) {
    .otp-digit { height: 40px; font-size: 1.05rem; }
    .grid { grid-template-columns: 1fr; }
    .reg-grid { grid-template-columns: 1fr; }
    .brand-logo.lg { width: min(180px, 70vw); }
    .card-actions .btn { flex: 1 1 calc(50% - 6px); }
    .library-tools { flex-direction: column; align-items: stretch; }
    .library-actions { margin-right: 0; }
    .library-actions .btn { flex: 1; }
    .finder { width: 100%; margin-left: 0; }
    .finder-search { flex: 1 1 auto; width: auto; }
    .bulk-bar { gap: 8px; }
    .bulk-bar .btn { flex: 1 1 auto; }
    .kesfet-slide figcaption { padding: 48px 16px 92px; }
    .kesfet-nav { width: 40px; height: 40px; }
}
@media (max-height: 760px) and (min-width: 901px) {
    .reg-page { padding: 8px 20px 10px; }
    .reg-brand { margin-bottom: 4px; }
    .reg-aside h1 { font-size: 1.35rem; }
    .reg-lead { margin-bottom: 10px; font-size: .86rem; }
    .quota-pick-card { height: 44px; padding: 4px; }
    .quota-pick-card strong b { font-size: 1rem; }
}
}
