@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    color-scheme: light;
    --bg: #eef3f9;
    --bg-soft: #f7f9fc;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --surface-muted: rgba(255, 255, 255, 0.68);
    --line: rgba(18, 28, 45, 0.08);
    --line-strong: rgba(18, 28, 45, 0.12);
    --text: #0f172a;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --blue: #1677ff;
    --blue-soft: rgba(22, 119, 255, 0.12);
    --button-primary-bg: #1677ff;
    --button-primary-bg-hover: #145ed0;
    --button-primary-border: #1677ff;
    --button-primary-shadow: 0 12px 22px rgba(22, 119, 255, 0.22);
    --amber: #f59e0b;
    --amber-soft: rgba(245, 158, 11, 0.14);
    --green: #10b981;
    --green-soft: rgba(16, 185, 129, 0.14);
    --rose: #ef4444;
    --rose-soft: rgba(239, 68, 68, 0.14);
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 10px 22px rgba(15, 23, 42, 0.05);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
    --control-radius: var(--radius-sm);
    --button-weight: 400;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html {
    min-height: 100%;
}

body.page {
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font);
    background:
        radial-gradient(circle at top left, rgba(22, 119, 255, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.06), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

body.landing-page,
body.cabinet-page,
body.engine-page {
    background:
        radial-gradient(circle at 0% 0%, rgba(225, 232, 241, 0.85), transparent 24%),
        radial-gradient(circle at 100% 0%, rgba(231, 236, 244, 0.78), transparent 20%),
        linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

body.auth-page {
    background:
        radial-gradient(circle at 10% 15%, rgba(224, 231, 240, 0.95), transparent 28%),
        radial-gradient(circle at 90% 20%, rgba(235, 240, 246, 0.9), transparent 24%),
        linear-gradient(180deg, #fafbfd 0%, #f2f5f9 100%);
}

body {
    overflow-x: hidden;
}

.container {
    max-width: 1180px;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.03em;
}

p {
    color: var(--muted);
}

.page-shell {
    position: relative;
    z-index: 1;
}

.page-shell::before,
.page-shell::after {
    content: "";
    position: fixed;
    inset: auto;
    width: 20rem;
    height: 20rem;
    border-radius: 999px;
    filter: blur(12px);
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

.page-shell::before {
    left: -10rem;
    top: 6rem;
    background: rgba(255, 255, 255, 0.65);
}

.page-shell::after {
    right: -8rem;
    bottom: 4rem;
    background: rgba(199, 214, 232, 0.55);
}

.surface,
.glass,
.card-float,
.auth-card,
.surface-card,
.landing-card,
.cabinet-panel,
.cabinet-hero,
.auth-side,
#sidebar,
#main,
#top-bar,
#file-title-panel,
#viewer,
#attachments-block,
#attachment-dropzone,
.login-shell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.glass,
.card-float,
.auth-card,
.surface-card,
.landing-card,
.cabinet-panel,
.cabinet-hero,
.auth-side {
    padding: 18px;
}

.cabinet-admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.cabinet-sidebar {
    position: sticky;
    top: 0.9rem;
    align-self: start;
}

.cabinet-sidebar .cabinet-panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.cabinet-header {
    display: grid;
    gap: 0.35rem;
    padding: 0.25rem 0 0;
}

.cabinet-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cabinet-header-meta .text-muted {
    font-size: 0.95rem;
}

.cabinet-nav {
    display: grid;
    gap: 4px;
}

.cabinet-nav-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    text-align: left;
    padding: 0.66rem 0.75rem;
    border-radius: 14px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-weight: 400;
    margin: 0;
    min-height: 2.7rem;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.cabinet-nav-item:hover,
.cabinet-nav-item:focus-visible {
    border-color: rgba(22, 119, 255, 0.22);
    background: rgba(255, 255, 255, 0.84);
    text-decoration: none;
}

.cabinet-nav-item.is-active {
    border-color: rgba(22, 119, 255, 0.18);
    background: rgba(22, 119, 255, 0.08);
    color: var(--text);
    transform: translateX(1px);
}

.cabinet-nav-item.is-disabled {
    opacity: 0.62;
}

.cabinet-nav-title {
    font-size: 0.94rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cabinet-section-stack {
    display: grid;
    gap: 14px;
}

.cabinet-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 4px;
}

.cabinet-page-head h1,
.cabinet-page-head .h3 {
    line-height: 1.08;
}

.cabinet-subgrid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cabinet-subsection {
    padding-top: 6px;
}

.cabinet-subsection + .cabinet-subsection {
    margin-top: 2px;
}

.cabinet-subsection.is-readonly {
    opacity: 0.9;
}

.cabinet-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cabinet-summary-card {
    padding: 14px;
    border-radius: var(--control-radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
}

.cabinet-summary-card .label {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.cabinet-summary-card .value {
    display: block;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--text);
}

.cabinet-panel-is-readonly {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.72);
}

.cabinet-permissions-grid {
    display: grid;
    gap: 10px;
}

.cabinet-permission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--control-radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 991.98px) {
    .cabinet-admin-layout,
    .cabinet-subgrid,
    .cabinet-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cabinet-sidebar {
        position: static;
    }

    .cabinet-nav-item {
        padding-left: 0.75rem;
    }
}

.section-kicker,
.hero-kicker,
.cabinet-chip,
.mini-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.section-title {
    font-size: clamp(1.55rem, 1.7vw, 2.2rem);
    line-height: 1.1;
    margin-bottom: 0.55rem;
}

.section-lead,
.hero-lead {
    max-width: 40rem;
    font-size: 0.98rem;
    line-height: 1.55;
}

.btn-main {
    background: var(--button-primary-bg);
    color: #ffffff;
    border: 1px solid var(--button-primary-border);
    border-radius: var(--control-radius);
    padding: 0.55rem 0.9rem;
    font-weight: var(--button-weight);
    margin-block: 0.12rem;
    box-shadow: var(--button-primary-shadow);
}

.btn-main:hover,
.btn-main:focus-visible {
    background: var(--button-primary-bg-hover);
    color: #ffffff;
    border-color: var(--button-primary-bg-hover);
}

.btn-main:disabled,
.btn-main.disabled,
.btn-main[aria-disabled="true"] {
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    border-color: var(--line);
    box-shadow: none;
}

.btn-primary,
.btn-success {
    background: var(--button-primary-bg);
    border-color: var(--button-primary-border);
    color: #ffffff;
    border-radius: var(--control-radius);
    padding: 0.55rem 0.9rem;
    font-weight: var(--button-weight);
    margin-block: 0.12rem;
    box-shadow: var(--button-primary-shadow);
}

.btn-primary:hover,
.btn-primary:focus-visible,
.btn-success:hover,
.btn-success:focus-visible {
    background: var(--button-primary-bg-hover);
    border-color: var(--button-primary-bg-hover);
    color: #ffffff;
}

.btn-primary:disabled,
.btn-primary.disabled,
.btn-success:disabled,
.btn-success.disabled {
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    border-color: var(--line);
    box-shadow: none;
}

.btn-soft,
.btn-outline-light,
.btn-outline-secondary {
    border-radius: var(--control-radius);
    border-color: var(--line-strong);
    color: var(--text);
    background: rgba(255, 255, 255, 0.7);
    font-weight: var(--button-weight);
    margin-block: 0.12rem;
}

.btn-secondary {
    border-radius: var(--control-radius);
    border-color: var(--line-strong);
    color: var(--text);
    background: rgba(255, 255, 255, 0.8);
    font-weight: var(--button-weight);
    margin-block: 0.12rem;
}

.btn-soft:hover,
.btn-outline-light:hover,
.btn-outline-secondary:hover {
    background: #ffffff;
    border-color: var(--blue);
    color: var(--blue);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: #ffffff;
    border-color: var(--blue);
    color: var(--blue);
}

.btn-check:focus-visible + .btn,
.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(17, 24, 39, 0.12);
}

.form-control,
.form-select,
.input-group-text {
    border-radius: var(--control-radius);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
}

.form-control,
.form-select {
    min-height: 36px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(22, 119, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

::placeholder {
    color: #90a0b3 !important;
}

.text-muted,
.text-secondary,
.opacity-75,
.opacity-50 {
    color: var(--muted) !important;
}

.dropdown-menu {
    border-radius: 18px;
    border-color: var(--line);
    box-shadow: var(--shadow-soft);
    padding: 0.45rem;
}

.dropdown-item {
    border-radius: 12px;
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--blue);
    color: #fff;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1677ff, #5990ff);
    box-shadow: 0 10px 24px rgba(22, 119, 255, 0.22);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
}

.brand-subtitle {
    font-size: 0.88rem;
    color: var(--muted);
}

.hero-shell {
    position: relative;
    overflow: hidden;
}

.hero-shell::before {
    content: "";
    position: absolute;
    width: 16rem;
    height: 16rem;
    right: -6rem;
    top: -7rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(22, 119, 255, 0.08), transparent 65%);
    pointer-events: none;
}

.hero-visual,
.preview-shell,
.preview-window {
    border-radius: 16px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
    box-shadow: var(--shadow);
}

.hero-visual {
    padding: 14px;
}

.preview-window {
    overflow: hidden;
}

.preview-grid {
    display: grid;
    gap: 10px;
}

.preview-card,
.metric-card,
.feature-card,
.cabinet-stat,
.cabinet-panel,
.auth-side,
.auth-card,
.cabinet-hero,
.panel-card,
.login-shell,
#sidebar,
#main,
#top-bar,
#file-title-panel,
#viewer,
#attachments-block,
#attachment-dropzone {
    position: relative;
}

.preview-card {
    min-height: 78px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
}

.preview-card.accent {
    background: linear-gradient(135deg, #1677ff, #1f3b72);
    color: #fff;
    border-color: transparent;
}

.preview-line {
    height: 10px;
    border-radius: 999px;
    background: #e9eef5;
    margin-bottom: 8px;
}

.preview-line.short {
    width: 45%;
}

.preview-line.mid {
    width: 68%;
}

.preview-line.long {
    width: 86%;
}

.preview-pip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(22, 119, 255, 0.08);
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
}

.metric-grid,
.feature-grid,
.cabinet-grid {
    display: grid;
    gap: 0.75rem;
}

.metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card,
.feature-card,
.cabinet-stat,
.cabinet-panel {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.metric-card {
    padding: 0.8rem 0.9rem;
}

.metric-value {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
}

.metric-label {
    color: var(--muted);
    font-size: 0.88rem;
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card {
    padding: 1rem;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(22, 119, 255, 0.12), rgba(22, 119, 255, 0.04));
    display: inline-grid;
    place-items: center;
    color: var(--blue);
    font-weight: 800;
    margin-bottom: 1rem;
}

.cabinet-shell,
.auth-layout {
    position: relative;
    z-index: 1;
}

.cabinet-hero {
    padding: 1rem;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(243, 247, 251, 0.9));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.cabinet-hero .section-title {
    font-size: clamp(1.25rem, 1.4vw, 1.8rem);
    line-height: 1.08;
    margin-bottom: 0.4rem;
}

.cabinet-hero .hero-lead {
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: 44rem;
}

.cabinet-subtitle {
    color: var(--muted);
}

.cabinet-stat {
    padding: 0.7rem 0.8rem;
}

.cabinet-stat .label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cabinet-stat .value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    margin-top: 0.25rem;
}

.cabinet-panel {
    padding: 0.85rem;
    border-radius: 14px;
}

.cabinet-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
}

.cabinet-table th,
.cabinet-table td {
    padding: 0.6rem 0.65rem;
    border-bottom: 1px solid rgba(219, 227, 238, 0.75);
    text-align: left;
    font-size: 0.92rem;
    vertical-align: middle;
}

.cabinet-table th {
    color: #536072;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    background: rgba(244, 247, 250, 0.95);
}

.cabinet-table tr:last-child td {
    border-bottom: 0;
}

.auth-layout {
    min-height: calc(100vh - 32px);
}

.auth-side {
    padding: 1rem;
    min-height: 100%;
    overflow: hidden;
}

.auth-side::before {
    content: "";
    position: absolute;
    inset: auto -4rem -5rem auto;
    width: 16rem;
    height: 16rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(22, 119, 255, 0.08), transparent 66%);
    pointer-events: none;
}

.auth-card {
    padding: 1.2rem;
}

.auth-list {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.auth-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    color: var(--text);
}

.auth-list li::before {
    content: "";
    width: 10px;
    height: 10px;
    margin-top: 0.45rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #1677ff, #485266);
    flex: 0 0 auto;
}

.auth-note {
    font-size: 0.92rem;
    color: var(--muted);
}

.auth-card .form-label,
.cabinet-panel .form-label {
    font-weight: 600;
    color: #243145;
}

.page-header {
    padding: 1rem 0 0.5rem;
}

.landing-grid {
    display: grid;
    gap: 1.2rem;
}

.landing-card {
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.landing-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(22, 119, 255, 0.08);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
}
#cabinet-alert,
.alert {
    border-radius: 18px;
}

.alert {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.alert-info {
    background: rgba(22, 119, 255, 0.08);
    color: #0f172a;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #7f1d1d;
}

.list-group,
.list-group-item {
    border-color: var(--line);
}

.list-group {
    border-radius: 14px;
    overflow: hidden;
}

.list-group-item {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
}

.list-group-item.active {
    background: rgba(22, 119, 255, 0.08);
    color: var(--text);
    border-color: rgba(22, 119, 255, 0.2);
}

.btn-link {
    color: var(--text);
}

.btn-link:hover {
    color: var(--blue);
}

#sidebar {
    min-height: calc(100vh - 48px);
}

#main {
    min-height: calc(100vh - 48px);
}

.engine-shell {
    min-height: 100vh;
    padding: 16px;
}

#top-bar,
#file-title-panel {
    border-color: rgba(219, 227, 238, 0.9) !important;
}

#top-bar {
    align-items: center;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

#top-bar .input-group,
#top-bar .topbar-search {
    height: 3em;
}

#top-bar .input-group > .form-control,
#top-bar .input-group > .form-select,
#top-bar .input-group > .btn,
#top-bar .input-group > .input-group-text,
#top-bar .topbar-search .form-control,
#top-bar .topbar-search .form-select,
#top-bar .topbar-search .btn {
    height: 100%;
}

#top-bar .form-control,
#top-bar .form-select {
    min-height: 3em;
}

#search-results {
    border-color: rgba(219, 227, 238, 0.9) !important;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 0 0 14px 14px;
}

#viewer {
    overflow: auto;
}

#tree.list-group {
    border-radius: 14px;
    overflow: hidden;
}

#attachment-dropzone {
    border-style: dashed !important;
    border-width: 1.5px !important;
    cursor: pointer;
    background: rgba(248, 250, 252, 0.95);
}

.issues-container {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.issue-card {
    border-radius: 14px;
    padding: 0.9rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.92rem;
    box-shadow: var(--shadow-soft);
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
}

.issue-title {
    font-size: 0.95rem;
    color: var(--text);
}

.issue-badge {
    font-size: 0.72rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.07);
    color: #334155;
    white-space: nowrap;
}

.issue-comment {
    font-size: 0.86rem;
    margin-bottom: 0.55rem;
    color: #334155;
}

.issue-snippet {
    font-size: 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: rgba(17, 24, 39, 0.05);
    color: #3f4b5b;
    padding: 0.6rem 0.7rem;
    border-radius: 14px;
}

.issue-original-flag {
    font-size: 0.72rem;
    margin-top: 0.6rem;
    color: var(--muted);
}

.issue-level-1 {
    border-left: 5px solid #14b8a6;
}

.issue-level-2 {
    border-left: 5px solid #22c55e;
}

.issue-level-3 {
    border-left: 5px solid #eab308;
}

.issue-level-4 {
    border-left: 5px solid #f97316;
}

.issue-level-5 {
    border-left: 5px solid #ef4444;
}

.element-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9) !important;
    color: #334155 !important;
}

.card-file-custom {
    min-height: 5rem;
    font-size: 1.5rem;
    color: #334155;
    border-radius: 18px 18px 0 0;
    position: relative;
}

.card-custom-btn {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
}

.dropstart .dropdown-toggle::before {
    content: none !important;
}

#full-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    padding: 20px;
    overflow-y: auto;
    color: var(--text);
}

#full-modal .close-btn {
    position: sticky;
    top: 16px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: var(--text);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    z-index: 100000;
    box-shadow: var(--shadow-soft);
}

.login-shell {
    padding: 0;
    overflow: hidden;
}

#bigdit-widget .bdt-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9990;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    box-shadow: 0 16px 34px rgba(17, 24, 39, 0.18);
}

#bigdit-widget .bdt-modal {
    position: fixed;
    inset: 0;
    z-index: 9991;
    display: none;
}

#bigdit-widget .bdt-modal.is-open {
    display: block;
}

#bigdit-widget .bdt-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.36);
}

#bigdit-widget .bdt-card {
    position: absolute;
    right: 24px;
    bottom: 80px;
    width: min(960px, calc(100vw - 48px));
    height: min(720px, calc(100vh - 120px));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#bigdit-widget .bdt-auth-card {
    padding: 18px;
    width: min(420px, calc(100vw - 48px));
    height: auto;
    bottom: 50%;
    transform: translateY(50%);
}

#bigdit-widget .bdt-close {
    align-self: flex-end;
    margin: 12px 16px 0 0;
    border: 1px solid var(--border);
    background: rgba(248, 250, 252, 0.96);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 999px;
}

#bigdit-widget .bdt-frame {
    border: none;
    width: 100%;
    height: 100%;
}

#bigdit-widget .bdt-auth {
    position: fixed;
    inset: 0;
    z-index: 9991;
    display: grid;
    place-items: center;
    background: rgba(244, 247, 251, 0.92);
}

#bigdit-widget .bdt-title {
    font-weight: 700;
    margin-bottom: 12px;
}

#bigdit-widget .bdt-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fff;
}

#bigdit-widget .bdt-btn {
    width: 100%;
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 10px 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

#bigdit-widget .bdt-error {
    color: #b42318;
    font-size: 14px;
    margin-bottom: 10px;
}

@media (max-width: 991.98px) {
    .feature-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .auth-card,
    .auth-side,
    .cabinet-panel,
    .cabinet-hero,
    .surface-card,
    .glass,
    .card-float {
        padding: 22px;
    }

    #sidebar,
    #main {
        min-height: auto;
    }
}
