:root {
    --background: #172121;
    --surface: #1d2828;
    --surface-raised: #233030;
    --surface-hover: #2a3838;
    --border: #344142;
    --border-strong: #444554;
    --foreground: #e5d0cc;
    --foreground-soft: #cdbcb9;
    --muted: #a59ea6;
    --primary: #bfacb5;
    --primary-hover: #d2c2c9;
    --primary-foreground: #172121;
    --success: #8fc5a5;
    --warning: #d9b47a;
    --danger: #e0868a;
    --radius: 6px;
    --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    color-scheme: dark;
}

html {
    background: var(--background);
}

body,
body.bg-light {
    background: var(--background) !important;
    color: var(--foreground-soft);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--foreground);
    font-weight: 600;
    letter-spacing: 0;
}

a {
    color: var(--primary);
    transition: color 120ms ease-out;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

code, pre, kbd, .text-monospace {
    font-family: var(--font-mono) !important;
}

pre {
    color: var(--foreground-soft);
    margin: 0;
}

code {
    color: var(--foreground-soft);
    font-size: 13px;
}

hr {
    border-color: var(--border);
}

::selection {
    background: var(--primary);
    color: var(--primary-foreground);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

h1[tabindex="-1"]:focus {
    outline: none;
}

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

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

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

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

.bg-light {
    background: var(--surface-raised) !important;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-main {
    flex: 1 0 auto;
    padding: 24px 0 48px;
}

.app-main > .container,
.app-header > .container,
.app-footer > .container {
    max-width: 1180px;
}

.app-main > .container.narrow {
    max-width: 760px;
}

.app-header {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-header .container {
    align-items: center;
    display: flex;
    gap: 24px;
    height: 56px;
}

.app-brand {
    color: var(--foreground);
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
}

.app-brand:hover {
    color: var(--foreground);
}

.app-nav {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-nav a {
    border-radius: var(--radius);
    color: var(--muted);
    display: block;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    transition: background-color 120ms ease-out, color 120ms ease-out;
}

.app-nav a:hover {
    background: var(--surface-hover);
    color: var(--foreground);
}

.app-nav a.active {
    background: var(--surface-raised);
    color: var(--foreground);
}

.app-account {
    margin-left: auto;
}

.app-account .btn {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.app-header .app-menu-toggle {
    display: none;
    margin-left: auto;
}

.app-quota {
    color: var(--muted);
    font-size: 13px;
    padding: 6px 16px 8px;
}

.app-quota .progress {
    margin-top: 6px;
}

@media (max-width: 767.98px) {
    .app-header .container {
        flex-wrap: wrap;
        gap: 0;
        height: auto;
        min-height: 56px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .app-header .app-menu-toggle {
        display: inline-flex;
    }

    .app-header .app-collapse {
        display: none;
        flex-basis: 100%;
        padding-top: 8px;
    }

    .app-header.is-open .app-collapse {
        display: block;
    }

    .app-nav {
        flex-direction: column;
    }

    .app-nav a {
        padding: 10px 12px;
    }

    .app-account {
        border-top: 1px solid var(--border);
        margin-top: 8px;
        padding-top: 8px;
    }
}

@media (min-width: 768px) {
    .app-collapse {
        align-items: center;
        display: flex;
        flex: 1;
        gap: 24px;
    }
}

.app-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    padding: 16px 0;
}

.app-footer a {
    color: var(--muted);
}

.app-footer a:hover {
    color: var(--foreground);
}

.page-header {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title {
    font-size: 26px;
    margin: 0;
}

.page-subtitle {
    color: var(--muted);
    font-size: 14px;
    margin: 4px 0 0;
}

.section-title {
    font-size: 17px;
    margin: 0 0 16px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.panel + .panel {
    margin-top: 24px;
}

.panel-body {
    padding: 20px;
}

.panel-header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 14px 20px;
}

.panel-header h2 {
    font-size: 16px;
    margin: 0;
}

.panel-danger {
    border-color: rgba(224, 134, 138, 0.4);
}

.stat-row {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
    overflow: hidden;
}

.stat-row > div {
    padding: 16px 20px;
}

.stat-row > div + div {
    border-left: 1px solid var(--border);
}

.stat-row dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.stat-row dd {
    color: var(--foreground);
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    margin: 4px 0 0;
}

.split {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 340px;
}

.stack {
    display: grid;
    gap: 24px;
}

.stack > .panel + .panel {
    margin-top: 0;
}

.field-control .form-control,
.field-control .custom-select {
    min-width: 220px;
}

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

@media (max-width: 767.98px) {
    .stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-row > div:nth-child(3) {
        border-left: 0;
    }

    .stat-row > div:nth-child(n+3) {
        border-top: 1px solid var(--border);
    }

    .field-control,
    .field-control .form-control,
    .field-control .custom-select {
        min-width: 0;
        width: 100%;
    }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground-soft);
}

.card-header,
.card-footer {
    background: transparent;
    border-color: var(--border);
}

.shadow, .shadow-sm, .shadow-lg {
    box-shadow: none !important;
}

.btn {
    align-items: center;
    border-radius: var(--radius);
    display: inline-flex;
    font-size: 14px;
    font-weight: 500;
    gap: 6px;
    justify-content: center;
    min-height: 38px;
    padding: 6px 14px;
    transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}

.btn-sm {
    font-size: 13px;
    min-height: 32px;
    padding: 4px 10px;
}

.btn-lg {
    font-size: 15px;
    min-height: 44px;
    padding: 8px 18px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:focus,
.btn.focus {
    box-shadow: none !important;
}

.btn-primary,
.btn-primary:not(:disabled):not(.disabled):active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--primary-foreground);
}

.btn-secondary,
.btn-light,
.btn-dark,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-info,
.btn-outline-success,
.btn-outline-warning,
.btn-info,
.btn-success,
.btn-warning {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--foreground-soft);
}

.btn-secondary:hover,
.btn-light:hover,
.btn-dark:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-dark:hover,
.btn-outline-info:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-info:hover,
.btn-success:hover,
.btn-warning:hover,
.btn-secondary:not(:disabled):not(.disabled):active,
.btn-outline-secondary:not(:disabled):not(.disabled):active,
.show > .btn-outline-secondary.dropdown-toggle,
.show > .btn-secondary.dropdown-toggle {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--foreground);
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
}

.btn-ghost:hover,
.btn-ghost:focus {
    background: var(--surface-hover);
    color: var(--foreground);
}

.btn-danger,
.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(224, 134, 138, 0.45);
    color: var(--danger);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--primary-foreground);
}

.btn-danger:hover,
.btn-outline-danger:hover,
.btn-outline-danger:not(:disabled):not(.disabled):active {
    background: #e99a9d;
    border-color: #e99a9d;
    color: var(--primary-foreground);
}

.btn.disabled,
.btn:disabled {
    opacity: 0.45;
}

.btn-icon {
    min-width: 32px;
    padding: 4px 0;
    width: 32px;
}

.btn-group > .btn {
    flex: 0 0 auto;
}

.action-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-end;
}

.action-row .btn {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    height: 32px;
    min-height: 32px;
    padding: 0;
    width: 32px;
}

.action-row .btn:hover {
    background: var(--surface-hover);
    border-color: transparent;
    color: var(--foreground);
}

.action-row .btn.media-delete:hover,
.action-row .btn.user-delete:hover {
    color: var(--danger);
}

.action-row .btn-outline-warning,
.action-row .btn-warning {
    color: var(--foreground-soft);
}

.form-control,
.custom-select {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 14px;
    min-height: 40px;
    transition: border-color 120ms ease-out;
}

.form-control:focus,
.custom-select:focus {
    background: var(--background);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(191, 172, 181, 0.25);
    color: var(--foreground);
}

.form-control::placeholder {
    color: #7f7b82;
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--surface-raised);
    color: var(--muted);
}

textarea.form-control {
    min-height: 120px;
}

.form-label,
label {
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-hint {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-top: 6px;
}

.field {
    margin-bottom: 20px;
}

.field:last-child {
    margin-bottom: 0;
}

.field-row {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    justify-content: space-between;
    padding: 16px 0;
}

.field-row:first-child {
    padding-top: 0;
}

.field-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.field-row .field-text {
    flex: 1 1 280px;
    min-width: 0;
}

.field-row .field-text label {
    margin: 0;
}

.field-row .field-control {
    flex: 0 1 auto;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.input-group > .form-control:not(:last-child) {
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
}

.input-group-append .btn {
    border-radius: 0;
    margin-left: -1px;
}

.input-group-append .btn:last-child {
    border-bottom-right-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.privacy-blur {
    filter: blur(4px);
    transition: filter 120ms ease-out;
}

.privacy-blur:hover,
.privacy-blur:focus {
    filter: none;
}

.custom-control-label::before {
    background: var(--background);
    border-color: var(--border-strong);
}

.custom-control-input:checked ~ .custom-control-label::before {
    background: var(--primary);
    border-color: var(--primary);
}

.form-check-input {
    accent-color: var(--primary);
}

.toggle.btn {
    border-radius: var(--radius);
    min-height: 38px;
}

.toggle-on.btn,
.toggle-on.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}

.toggle-off.btn {
    background: var(--surface-raised);
    border-color: var(--border);
    color: var(--muted);
}

.toggle-handle.btn {
    background: var(--foreground);
    border-color: var(--foreground);
}

.table {
    color: var(--foreground-soft);
    font-size: 14px;
    margin: 0;
}

.table th {
    border-bottom: 1px solid var(--border) !important;
    border-top: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 10px 12px;
    white-space: nowrap;
}

.table td {
    border-top: 1px solid var(--border);
    padding: 10px 12px;
    vertical-align: middle;
}

.table tbody tr:first-child td {
    border-top: 0;
}

.table-hover tbody tr {
    transition: background-color 120ms ease-out;
}

.table-hover tbody tr:hover {
    background: var(--surface-raised);
    color: var(--foreground);
}

.table .num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.media-thumb {
    align-items: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    display: flex;
    height: 44px;
    justify-content: center;
    overflow: hidden;
    width: 72px;
}

.media-thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.media-name {
    color: var(--foreground);
    display: block;
    font-weight: 500;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.bulk-selected,
.bulk-selected:hover {
    background: rgba(224, 134, 138, 0.12) !important;
}

.bulk-selected .media-name {
    color: var(--danger);
}

.badge {
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
}

.badge-pill {
    border-radius: 999px;
}

.badge-light,
.badge-dark,
.badge-secondary {
    background: var(--surface-hover);
    color: var(--foreground-soft);
}

a.badge-light:hover {
    background: var(--border-strong);
    color: var(--foreground);
}

.badge-success,
a.badge-success {
    background: rgba(143, 197, 165, 0.15);
    color: var(--success);
}

a.badge-success:hover {
    background: rgba(143, 197, 165, 0.28);
    color: var(--success);
}

.badge-danger {
    background: rgba(224, 134, 138, 0.15);
    color: var(--danger);
}

.tag-add {
    background: transparent;
    border: 1px dashed var(--border-strong);
    color: var(--muted);
}

.tag-add:hover {
    border-color: var(--primary);
    color: var(--foreground);
}

.tag-input {
    height: 22px;
    min-height: 22px;
    padding: 0 6px;
}

.status {
    align-items: center;
    display: inline-flex;
    font-size: 13px;
    gap: 6px;
    white-space: nowrap;
}

.status::before {
    background: var(--muted);
    border-radius: 50%;
    content: "";
    height: 7px;
    width: 7px;
}

.status-on {
    color: var(--success);
}

.status-on::before {
    background: var(--success);
}

.status-off {
    color: var(--muted);
}

.toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.toolbar .search {
    flex: 1 1 260px;
    max-width: 360px;
    position: relative;
}

.toolbar .search .fa-search {
    color: var(--muted);
    left: 12px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.toolbar .search .form-control {
    padding-left: 34px;
}

.toolbar-end {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.dropdown-menu {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    font-size: 14px;
    padding: 4px;
}

.dropdown-item {
    align-items: center;
    border-radius: 4px;
    color: var(--foreground-soft);
    display: flex;
    gap: 8px;
    padding: 7px 12px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--surface-hover);
    color: var(--foreground);
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.dropdown-item.disabled {
    color: var(--muted);
}

.dropdown-header {
    color: var(--muted);
    font-size: 12px;
}

.dropdown-divider {
    border-color: var(--border);
    margin: 4px 0;
}

.dropdown-toggle::after {
    margin-left: 2px;
    opacity: 0.6;
}

.modal-backdrop.show {
    opacity: 0.7;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--foreground-soft);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}

.modal-title {
    font-size: 17px;
}

.close {
    color: var(--foreground);
    opacity: 0.6;
    text-shadow: none;
}

.close:hover {
    color: var(--foreground);
    opacity: 1;
}

.modal.fade .modal-dialog {
    transition: transform 180ms ease-out;
}

.modal-backdrop.fade,
.fade {
    transition: opacity 180ms ease-out;
}

.tooltip-inner {
    background: var(--foreground);
    border-radius: 4px;
    color: var(--primary-foreground);
    font-size: 12px;
    font-weight: 500;
}

.bs-tooltip-top .arrow::before,
.bs-tooltip-auto[x-placement^="top"] .arrow::before {
    border-top-color: var(--foreground);
}

.bs-tooltip-bottom .arrow::before,
.bs-tooltip-auto[x-placement^="bottom"] .arrow::before {
    border-bottom-color: var(--foreground);
}

.alert {
    align-items: flex-start;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground-soft);
    display: flex;
    font-size: 14px;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 16px;
}

.alert-dismissible {
    padding-right: 16px;
}

.alert-dismissible .close {
    padding: 0 4px;
    position: static;
}

.alert-success {
    border-color: rgba(143, 197, 165, 0.45);
}

.alert-danger {
    border-color: rgba(224, 134, 138, 0.5);
    color: var(--foreground);
}

.alert-warning {
    border-color: rgba(217, 180, 122, 0.5);
}

.alert-info,
.alert-primary {
    border-color: rgba(191, 172, 181, 0.45);
}

.pagination {
    gap: 4px;
    margin: 0;
}

.page-link {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius) !important;
    color: var(--foreground-soft);
    font-size: 14px;
    padding: 6px 12px;
}

.page-link:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--foreground);
}

.page-item.disabled .page-link {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
    opacity: 0.5;
}

.progress {
    background: var(--background);
    border-radius: 999px;
    height: 6px;
}

.progress-bar {
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 0;
    transition: width 180ms ease-out;
}

.empty-state {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 48px 16px;
    text-align: center;
}

.empty-state h3 {
    font-size: 17px;
    margin: 0;
}

.empty-state p {
    margin: 0;
    max-width: 360px;
}

.gallery {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.gallery-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 120ms ease-out;
}

.gallery-item:hover {
    border-color: var(--border-strong);
}

.gallery-preview {
    align-items: center;
    aspect-ratio: 16 / 10;
    background: var(--background);
    color: var(--muted);
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.gallery-preview img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.gallery-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
}

.gallery-meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    justify-content: space-between;
}

.gallery-body .action-row {
    border-top: 1px solid var(--border);
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
}

.dropzone {
    background: var(--background);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--muted);
    min-height: 240px;
    transition: border-color 120ms ease-out, background-color 120ms ease-out;
}

.dropzone:hover,
.dropzone.dz-drag-hover {
    background: var(--surface-raised);
    border-color: var(--primary);
}

.dropzone .dz-message {
    color: var(--foreground-soft);
    font-size: 15px;
    margin: 88px 0;
}

.dropzone .dz-preview .dz-image {
    border-radius: var(--radius);
}

.dropzone .dz-preview .dz-details {
    color: var(--primary-foreground);
}

.dropzone .dz-preview .dz-filename a {
    color: var(--primary-foreground);
}

.upload-progress {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.upload-progress .progress {
    flex: 1;
}

.auth-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.auth-card {
    max-width: 380px;
    width: 100%;
}

.auth-card h1 {
    font-size: 24px;
    margin: 0 0 4px;
}

.auth-card .page-subtitle {
    margin-bottom: 24px;
}

.auth-row {
    align-items: center;
    display: flex;
    font-size: 14px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.auth-row .form-check-label {
    font-weight: 400;
    margin: 0;
}

.error-page {
    padding: 64px 0;
}

.error-page h1 {
    font-size: 26px;
    margin-bottom: 8px;
}

.error-page p {
    color: var(--muted);
    margin-bottom: 24px;
    max-width: 480px;
}

.viewer {
    align-items: stretch;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 300px;
}

.viewer-stage {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    min-height: 320px;
    overflow: hidden;
    padding: 16px;
}

.viewer-stage img,
.viewer-stage video {
    border-radius: 4px;
    max-height: 78vh;
    max-width: 100%;
}

.viewer-stage pre {
    align-self: stretch;
    max-height: 78vh;
    overflow: auto;
    width: 100%;
}

.viewer-side .panel-body > * + * {
    margin-top: 16px;
}

.viewer-title {
    font-size: 17px;
    margin: 0;
    overflow-wrap: anywhere;
}

.meta-list {
    display: grid;
    gap: 8px 16px;
    grid-template-columns: auto 1fr;
    font-size: 14px;
    margin: 0;
}

.meta-list dt {
    color: var(--muted);
    font-weight: 400;
}

.meta-list dd {
    color: var(--foreground);
    font-variant-numeric: tabular-nums;
    margin: 0;
    text-align: right;
}

.viewer-actions {
    display: grid;
    gap: 8px;
}

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

.changelog > h1:first-child {
    display: none;
}

.changelog h2 {
    font-size: 19px;
    margin-top: 28px;
}

.changelog h2:first-of-type {
    margin-top: 0;
}

.changelog h3 {
    color: var(--muted);
    font-size: 15px;
    margin-top: 16px;
}

.hljs {
    background: transparent;
}

.plyr {
    border-radius: 4px;
}

.plyr--video .plyr__control.plyr__tab-focus,
.plyr--video .plyr__control:hover,
.plyr__control--overlaid {
    background: var(--primary);
}

.plyr--full-ui input[type=range] {
    color: var(--primary);
}

.app-loading {
    background: var(--primary);
    height: 2px;
    left: 0;
    opacity: 0;
    position: fixed;
    top: 0;
    transition: opacity 120ms ease-out, width 300ms ease-out;
    width: 0;
    z-index: 2000;
}

.is-navigating .app-loading {
    opacity: 1;
    width: 70%;
}

.is-navigating .app-main {
    opacity: 0.6;
    transition: opacity 120ms ease-out;
}

@media (max-width: 767.98px) {
    .app-main {
        padding-top: 16px;
    }

    .page-title {
        font-size: 22px;
    }

    .panel-body {
        padding: 16px;
    }

    .toolbar .search {
        max-width: none;
    }

    .toolbar-end {
        margin-left: 0;
    }

    .table-stack thead {
        display: none;
    }

    .table-stack tbody tr {
        align-items: center;
        border-top: 1px solid var(--border);
        display: grid;
        gap: 4px 12px;
        grid-template-columns: 72px minmax(0, 1fr);
        padding: 12px;
    }

    .table-stack tbody tr:first-child {
        border-top: 0;
    }

    .table-stack td {
        border: 0;
        grid-column: 2;
        padding: 0;
    }

    .table-stack td.stack-thumb {
        align-self: start;
        grid-column: 1;
        grid-row: 1 / span 5;
    }

    .table-stack td.stack-hide {
        display: none;
    }

    .table-stack td.stack-meta {
        color: var(--muted);
        font-size: 13px;
    }

    .table-stack .action-row {
        justify-content: flex-start;
        margin-left: -6px;
    }

    .media-name {
        max-width: 100%;
    }

    .btn,
    .action-row .btn {
        min-height: 44px;
    }

    .action-row .btn {
        height: 44px;
        width: 44px;
    }
}

@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;
    }
}