:root {
    color-scheme: light;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --bg-page: #eef3f8;
    --bg-soft: #f5f8fd;
    --surface: #ffffff;
    --surface-2: #f8fbff;
    --text-main: #1c2634;
    --text-soft: #667085;
    --line: #d9e3f0;
    --line-strong: #c6d4e8;
    --primary: #3a7de1;
    --primary-dark: #2f69be;
    --primary-soft: #dceaff;
    --shadow-sm: 0 6px 18px rgba(43, 83, 143, 0.08);
    --shadow-md: 0 18px 48px rgba(41, 73, 121, 0.12);
}

html {
    min-height: 100%;
    background: var(--bg-page);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: rgba(58, 125, 225, 0.18);
}

img,
iframe {
    max-width: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 10%, rgba(58, 125, 225, 0.08), transparent 26%),
        radial-gradient(circle at 88% 16%, rgba(75, 158, 239, 0.1), transparent 24%),
        linear-gradient(180deg, #edf3f9 0%, #eef3f8 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

@supports (-webkit-touch-callout: none) and (not (height: 100dvh)) {
    html,
    body {
        min-height: -webkit-fill-available;
    }
}

a {
    color: inherit;
}

[id] {
    scroll-margin-top: calc(5.8rem + var(--safe-area-top));
}

.container {
    max-width: 1230px;
}

.page-shell {
    padding-bottom: calc(2.4rem + var(--safe-area-bottom));
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding:
        calc(0.58rem + var(--safe-area-top))
        var(--safe-area-right)
        0.58rem
        var(--safe-area-left);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    background: rgba(238, 243, 248, 0.96);
    border-bottom: 1px solid rgba(198, 212, 232, 0.65);
}

.site-header .navbar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding-inline: 0.75rem;
    margin: 0;
    box-shadow: var(--shadow-sm);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #223247;
    text-decoration: none;
}

.brand-icon {
    color: var(--primary);
    font-size: 1.05rem;
    line-height: 1;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.brand-icon-footer {
    color: #8bb9ff;
}

.top-link {
    font-size: 0.84rem;
    font-weight: 600;
    color: #4b5f7a;
    padding: 0.32rem 0.75rem;
    border-radius: 8px;
}

.top-link:hover,
.top-link.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.auth-actions {
    align-items: center;
}

.user-quickbar {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    min-height: 2.18rem;
    max-width: 190px;
    border: 1px solid #cfe0f5;
    border-radius: 10px;
    background: #f8fbff;
    color: #263f5d;
    padding: 0.22rem 0.66rem 0.22rem 0.28rem;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.user-chip:hover,
.user-chip:focus,
.user-chip.active {
    border-color: #91b8ee;
    background: #edf5ff;
    color: #255cad;
    box-shadow: 0 8px 18px rgba(58, 125, 225, 0.12);
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.68rem;
    height: 1.68rem;
    border-radius: 50%;
    background: linear-gradient(180deg, #4f92f0 0%, #3478da 100%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}

.user-chip-copy {
    display: grid;
    min-width: 0;
    line-height: 1.05;
}

.user-chip-label {
    color: #708197;
    font-size: 0.62rem;
    font-weight: 800;
}

.user-chip-name {
    overflow: hidden;
    color: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.18rem;
    height: 2.18rem;
    border: 1px solid #cfe0f5;
    border-radius: 8px;
    background: #f8fbff;
    color: #416181;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.header-action-btn:hover,
.header-action-btn:focus,
.header-action-btn.active {
    border-color: #91b8ee;
    background: #edf5ff;
    color: #255cad;
    box-shadow: 0 8px 18px rgba(58, 125, 225, 0.12);
}

.header-action-danger {
    border-color: #f0c3ca;
    background: #fff7f8;
    color: #bc4155;
}

.header-action-danger:hover,
.header-action-danger:focus {
    border-color: #e79aa6;
    background: #fff0f2;
    color: #a72f42;
}

.mobile-quick-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.34rem;
    margin-left: auto;
}

.mobile-quick-actions .header-action-btn {
    width: 2.08rem;
    height: 2.08rem;
    border-radius: 8px;
    font-size: 0.84rem;
}

.btn {
    font-weight: 600;
}

.btn-primary {
    border-color: transparent;
    background: linear-gradient(180deg, #4f92f0 0%, #3478da 100%);
    box-shadow: 0 8px 18px rgba(58, 125, 225, 0.22);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: transparent;
    background: linear-gradient(180deg, #4b8bec 0%, #2f6fd2 100%);
}

.btn-outline-primary {
    border-color: #9ec1f3;
    color: #2f6dc8;
    background-color: #f5f9ff;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    border-color: #80abe9;
    color: #255cad;
    background-color: #edf4ff;
}

.hero-section {
    padding-top: 1.2rem;
}

.hero-content {
    text-align: center;
    margin-bottom: 1.1rem;
}

.eyebrow {
    display: inline-block;
    padding: 0.28rem 0.68rem;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid #cbe0ff;
    color: var(--primary-dark);
    background: #eef5ff;
}

.hero-content h1 {
    margin: 0.72rem auto 0.42rem;
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.2;
    max-width: 760px;
    color: #1d2a3d;
}

.hero-content p {
    margin: 0 auto;
    max-width: 760px;
    color: var(--text-soft);
}

.glass-panel {
    padding: 1.2rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #f0f6ff 0%, #e8f1ff 100%);
    box-shadow: var(--shadow-sm);
}

.panel-card,
.preview-shell {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel-card {
    padding: 1.2rem;
}

.section-block {
    margin-top: 1.15rem;
}

.section-title {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.08rem, 1.8vw, 1.42rem);
    color: #1f2d41;
}

.form-control,
.form-select {
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text-main);
}

.form-control::placeholder {
    color: #96a4b7;
}

.form-control:focus,
.form-select:focus {
    border-color: #8eb7f2;
    box-shadow: 0 0 0 0.2rem rgba(58, 125, 225, 0.18);
}

.form-label,
.form-check-label,
.text-secondary {
    color: var(--text-soft) !important;
}

.bg-soft-info {
    background: #e9f3ff !important;
}

.note-card {
    border: 1px solid var(--line) !important;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    height: 100%;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.note-card:hover {
    transform: translateY(-3px);
    border-color: #b6cef0;
    box-shadow: var(--shadow-md);
}

.note-card .card-body {
    display: flex;
    flex-direction: column;
}

.note-card-footer {
    margin-top: auto;
    min-height: 2.25rem;
}

.note-card-footer .small {
    min-width: 0;
}

.note-card-actions {
    flex: 0 0 auto;
    min-height: 2rem;
}

.note-card-actions .rating-summary {
    white-space: nowrap;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.36rem;
    margin-bottom: 0.8rem;
}

.note-tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d3def0;
    border-radius: 999px;
    padding: 0.14rem 0.54rem;
    background: #f8fbff;
    color: #425977;
    font-size: 0.74rem;
    font-weight: 600;
}

.meta-row {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.drop-zone {
    border: 1px dashed #b6d0f6;
    border-radius: 12px;
    text-align: center;
    background: var(--bg-soft);
    padding: 1.5rem 1.1rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.drop-zone.drag-over {
    border-color: #75aaf0;
    background: #ecf4ff;
}

.drop-title {
    font-weight: 700;
    color: #1f2e43;
}

.file-list {
    border-top: 1px solid #d7e3f3;
    text-align: left;
    padding-top: 0.72rem;
}

.file-item {
    border-bottom: 1px solid #e4ecf8;
    padding: 0.46rem 0;
    color: #4c5e77;
}

.tag-input-shell {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    padding: 0.66rem;
}

.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    margin-bottom: 0.58rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    border: 1px solid #c6dbfa;
    border-radius: 999px;
    background: #ecf4ff;
    padding: 0.18rem 0.58rem;
    font-size: 0.78rem;
    color: #2f5f9b;
}

.tag-chip button {
    border: 0;
    background: transparent;
    padding: 0;
    line-height: 1;
    color: inherit;
    cursor: pointer;
}

.registration-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.sticky-panel {
    position: sticky;
    top: 5.2rem;
}

.security-list {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--text-soft);
    display: grid;
    gap: 0.62rem;
}

.preview-toolbar {
    border-bottom: 1px solid #d8e3f2;
    padding: 0.86rem 1rem;
    background: #f8fbff;
    border-radius: 14px 14px 0 0;
}

.preview-canvas {
    min-height: 390px;
    margin: 0.8rem;
    border-radius: 10px;
    border: 1px solid #cfd9e8;
    background:
        linear-gradient(180deg, rgba(36, 52, 74, 0.88) 0%, rgba(43, 60, 84, 0.9) 100%);
    color: #e6edf9;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 1.8rem;
}

.document-preview {
    min-height: 500px;
    background: #f8f9fa;
}

.note-meta-grid {
    margin-top: 1.05rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.68rem;
}

.note-meta-grid span {
    display: block;
    font-size: 0.73rem;
    color: var(--text-soft);
}

.note-meta-grid strong {
    font-size: 0.9rem;
    color: #22344b;
}

.comment-list {
    display: grid;
    gap: 0.75rem;
}

.comment-item {
    border: 1px solid #dde7f5;
    border-radius: 12px;
    background: #f9fbff;
    padding: 0.72rem 0.85rem;
}

.comment-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.42rem;
    margin-top: 0.16rem;
}

.rating-summary,
.rating-stars-wrap,
.rating-stars {
    display: inline-flex;
    align-items: center;
}

.rating-summary {
    gap: 0.28rem;
    width: fit-content;
    border: 1px solid #f2d79b;
    border-radius: 999px;
    background: #fff8e7;
    color: #73531b;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.2rem 0.55rem;
}

.rating-summary i,
.rating-stars .fa-solid {
    color: #e7a822;
}

.rating-summary-empty {
    border-color: #d8e3f2;
    background: #f8fbff;
    color: #71849d;
    font-weight: 600;
}

.rating-count {
    color: #8a6f35;
    font-weight: 700;
}

.rating-stars-wrap {
    gap: 0.28rem;
    vertical-align: middle;
}

.rating-stars {
    gap: 0.1rem;
    color: #e7a822;
    line-height: 1;
}

.rating-stars .fa-regular {
    color: #c9d5e5;
}

.rating-value {
    color: #53657f;
    font-weight: 700;
}

.search-box-inline {
    max-width: 340px;
    width: 100%;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cfdef4;
    border-radius: 999px;
    background: #f6faff;
    color: #355377;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.18rem 0.65rem;
}

.filter-chip.active {
    border-color: #77a8eb;
    background: #e9f3ff;
    color: #2d6dca;
}

.search-results {
    display: grid;
    gap: 0.72rem;
}

.result-item {
    border: 1px solid #d9e4f3;
    border-radius: 12px;
    background: #fff;
    padding: 0.95rem;
}

.result-item h3 {
    font-size: 1.03rem;
    margin: 0 0 0.33rem;
    color: #1f2d43;
}

.result-item p {
    margin: 0;
    color: var(--text-soft);
}

.result-footer {
    margin-top: 0.64rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.56rem;
}

.result-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.42rem 0.65rem;
}

.my-note-item {
    flex-wrap: nowrap;
}

.my-note-main {
    min-width: 0;
    flex: 1 1 auto;
}

.my-note-side {
    flex: 0 0 auto;
}

.my-note-file {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pagination .page-link {
    color: #346ec6;
    background: #f7faff;
    border-color: #cfddf3;
}

.pagination .page-item.active .page-link {
    color: #fff;
    border-color: #417fdd;
    background: #417fdd;
}

.empty-state {
    border: 1px dashed #cbdbf2;
    border-radius: 12px;
    background: #f8fbff;
    color: #6a7d98;
    text-align: center;
    padding: 1rem;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
}

.admin-stat-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 0.9rem 1rem;
}

.admin-stat-card span {
    display: block;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-stat-card strong {
    display: block;
    margin-top: 0.28rem;
    color: #1f2d41;
    font-size: 1.35rem;
    line-height: 1.15;
}

.admin-table {
    min-width: 980px;
}

.admin-table th {
    color: #53657f;
    font-size: 0.76rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-table td {
    font-size: 0.86rem;
}

.admin-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.42rem;
}

.admin-role-select {
    width: auto;
    min-width: 118px;
}

.admin-settings-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.admin-notify-switch {
    margin: 0;
}

.admin-copy-line {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    vertical-align: middle;
}

.admin-copy-line > span,
.admin-copy-line > strong {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-copy-line-inline {
    display: inline-flex;
}

.admin-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.admin-copy-btn-icon {
    width: 1.9rem;
    height: 1.9rem;
    flex: 0 0 1.9rem;
    padding: 0;
}

.admin-copy-btn.is-copied {
    border-color: #198754;
    color: #198754;
}

.admin-meta-list {
    display: grid;
    gap: 0.55rem;
    margin: 0 0 1rem;
}

.admin-meta-list dt {
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 700;
}

.admin-meta-list dd {
    margin: -0.35rem 0 0;
    color: #26374f;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-hash {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.76rem;
}

.admin-comment-cell {
    min-width: 280px;
    max-width: 460px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.site-footer {
    background:
        radial-gradient(circle at 10% 10%, rgba(77, 132, 227, 0.22), transparent 30%),
        linear-gradient(150deg, #0b1c37 0%, #0f264a 52%, #102040 100%);
    border-top: 1px solid #16335e;
    color: #c9d9f0;
    padding-bottom: var(--safe-area-bottom);
}

.footer-title {
    margin: 0 0 0.5rem;
    font-family: 'Sora', sans-serif;
    font-size: 0.94rem;
    color: #eff5ff;
}

.footer-text {
    margin: 0;
    color: #b5c6df;
    font-size: 0.86rem;
    line-height: 1.55;
}

.footer-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.34rem;
}

.footer-list a {
    color: #b8cbe6;
    text-decoration: none;
    font-size: 0.86rem;
}

.footer-list a:hover {
    color: #e8f1ff;
}

.footer-bottom {
    border-top: 1px solid rgba(142, 177, 220, 0.28);
    color: #9fb4d4;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.footer-bottom-brand {
    color: #c8d9f4;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.footer-legal-notes {
    display: grid;
    gap: 0.32rem;
    width: min(100%, 760px);
    line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg-page: #10151f;
        --bg-soft: #151d2a;
        --surface: #151c27;
        --surface-2: #1a2431;
        --text-main: #edf3fb;
        --text-soft: #a5b2c4;
        --line: #2b394b;
        --line-strong: #3a4c62;
        --primary: #74a9ff;
        --primary-dark: #a9cbff;
        --primary-soft: #17375f;
        --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.24);
        --shadow-md: 0 24px 58px rgba(0, 0, 0, 0.34);
        --bs-body-bg: var(--bg-page);
        --bs-body-color: var(--text-main);
        --bs-border-color: var(--line);
        --bs-secondary-color: var(--text-soft);
        --bs-tertiary-bg: var(--surface-2);
    }

    body {
        background:
            radial-gradient(circle at 12% 10%, rgba(116, 169, 255, 0.14), transparent 26%),
            radial-gradient(circle at 88% 16%, rgba(93, 214, 196, 0.08), transparent 24%),
            linear-gradient(180deg, #0d131d 0%, var(--bg-page) 100%);
    }

    .site-header {
        background: rgba(16, 22, 33, 0.96);
        border-bottom-color: rgba(54, 72, 95, 0.72);
    }

    .brand-mark,
    .hero-content h1,
    .section-title,
    .drop-title,
    .result-item h3,
    .admin-stat-card strong,
    .note-meta-grid strong {
        color: #f3f7fd;
    }

    .top-link {
        color: #b9c5d6;
    }

    .top-link:hover,
    .top-link.active {
        background: rgba(116, 169, 255, 0.16);
        color: #cfe1ff;
    }

    .user-chip,
    .header-action-btn {
        border-color: #344861;
        background: #192332;
        color: #d7e3f4;
    }

    .user-chip:hover,
    .user-chip:focus,
    .user-chip.active,
    .header-action-btn:hover,
    .header-action-btn:focus,
    .header-action-btn.active {
        border-color: #5e8dcb;
        background: #203858;
        color: #e8f2ff;
        box-shadow: 0 10px 24px rgba(74, 134, 220, 0.16);
    }

    .user-chip-label {
        color: #9baabd;
    }

    .header-action-danger {
        border-color: #6e3944;
        background: #2d1820;
        color: #ff9dad;
    }

    .header-action-danger:hover,
    .header-action-danger:focus {
        border-color: #b25a69;
        background: #3a1e28;
        color: #ffc0ca;
    }

    .btn-outline-primary {
        border-color: #5278ad;
        color: #b7d3ff;
        background-color: #17283f;
    }

    .btn-outline-primary:hover,
    .btn-outline-primary:focus {
        border-color: #7eaaf0;
        color: #f2f7ff;
        background-color: #223c5e;
    }

    .eyebrow,
    .bg-soft-info {
        border-color: #30527e;
        background: #172b44 !important;
        color: #b8d6ff;
    }

    .glass-panel {
        background: linear-gradient(180deg, #162235 0%, #121c2a 100%);
    }

    .panel-card,
    .preview-shell,
    .admin-stat-card {
        background: var(--surface);
        border-color: var(--line);
    }

    .note-card {
        background: linear-gradient(180deg, #1b2635 0%, #172231 100%);
        border-color: #34475f !important;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
    }

    .note-card:hover {
        border-color: #5f8dc7 !important;
        box-shadow: 0 20px 46px rgba(0, 0, 0, 0.38);
    }

    .form-control,
    .form-select {
        border-color: var(--line-strong);
        background-color: #111923;
        color: var(--text-main);
    }

    .form-control::placeholder {
        color: #78879a;
    }

    .form-control:focus,
    .form-select:focus {
        border-color: #6da0e8;
        box-shadow: 0 0 0 0.2rem rgba(116, 169, 255, 0.2);
    }

    .note-tag,
    .filter-chip,
    .empty-state,
    .rating-summary-empty,
    .badge.bg-light,
    .badge.text-bg-light,
    .text-bg-light,
    .bg-light {
        border-color: #33455b !important;
        background-color: #1a2431 !important;
        color: #b9c9de !important;
    }

    .drop-zone,
    .tag-input-shell,
    .result-item {
        background: var(--surface-2);
        border-color: var(--line);
    }

    .drop-zone.drag-over,
    .filter-chip.active {
        border-color: #6798dc;
        background: #1b3556;
        color: #d7e8ff;
    }

    .file-list {
        border-top-color: var(--line);
    }

    .file-item,
    .preview-toolbar {
        border-color: var(--line);
        background: var(--surface-2);
        color: var(--text-main);
    }

    .tag-chip {
        border-color: #3f6699;
        background: #18345a;
        color: #c7ddff;
    }

    .document-preview {
        background: #0f1722;
    }

    .comment-item {
        border-color: var(--line);
        background: var(--surface-2);
    }

    .rating-summary {
        border-color: #755f2b;
        background: #2c2516;
        color: #f2d68a;
    }

    .rating-count {
        color: #c9a95a;
    }

    .rating-stars .fa-regular {
        color: #536174;
    }

    .rating-value,
    .admin-table th,
    .admin-meta-list dd {
        color: #b7c5d8;
    }

    .pagination .page-link {
        color: #b7d3ff;
        background: #17283f;
        border-color: #354a65;
    }

    .pagination .page-item.active .page-link {
        color: #07111f;
        border-color: #8bbcff;
        background: #8bbcff;
    }

    .table {
        --bs-table-bg: transparent;
        --bs-table-color: var(--text-main);
        --bs-table-border-color: var(--line);
        --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
        --bs-table-hover-bg: rgba(116, 169, 255, 0.08);
    }

    .text-dark {
        color: var(--text-main) !important;
    }

    .bg-warning.text-dark,
    .badge.bg-warning.text-dark {
        color: #111923 !important;
    }

    .text-muted {
        color: #7f8ea2 !important;
    }

    .border-danger-subtle {
        border-color: #70424a !important;
    }

    .footer-bottom {
        border-top-color: rgba(142, 177, 220, 0.2);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 991.98px) {
    .site-header .navbar {
        padding-inline: 0.5rem;
    }

    .auth-actions {
        margin-top: 0.6rem;
        width: 100%;
        align-items: stretch;
    }

    .user-quickbar {
        width: 100%;
        justify-content: flex-start;
        padding-top: 0.6rem;
        border-top: 1px solid #e0e9f6;
    }

    .user-chip {
        flex: 1 1 170px;
        max-width: none;
    }

    .sticky-panel {
        position: static;
    }

    .footer-bottom-brand,
    .footer-legal-notes {
        text-align: center;
    }
}

@media (prefers-color-scheme: dark) and (max-width: 991.98px) {
    .user-quickbar {
        border-top-color: var(--line);
    }
}

@media (min-width: 992px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: start;
        gap: 1.4rem;
    }

    .footer-bottom-brand {
        white-space: nowrap;
    }

    .footer-legal-notes {
        margin-left: auto;
        text-align: right;
        justify-items: end;
    }
}
