:root {
    --primary: #1c4d89;
    --secondary: #0f2748;
    --light-secondary: #1e3f72;
    --accent-cyan: #00b9ff;
    --accent-gold: #ffd166;
    --accent-rose: #ff6b9d;
    --accent-mint: #22d6a9;
    --grey: #4c4c4c;
    --dark-grey: #333333;
    --dark: #1b1e24;
    --light-blue: #6bc2ff;
    --light-light-blue: #9ed7ff;
    --light: #f3f7fd;
    --dark-light: #c6cfda;
    --danger: #b72934;
    --danger-dark: #8a1c26;
    --surface: #f8fbff;
    --ink: #0d1626;
    --radius: 14px;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

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

html,
body {
    min-height: 100%;
}

body {
    font-family: "Open Sans", "Segoe UI", Tahoma, Geneva, sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #edf2f8 0%, #f9fbff 55%, #f7f9fd 100%);
    overflow-x: hidden;
}

html[data-theme="dark"] body {
    color: #e8f0ff;
    /* Softer, layered dark background with a hint of warm purple to reduce monotony */
    background: linear-gradient(180deg, #071427 0%, #0f2540 30%, #12283a 60%, #1b1830 100%) fixed;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
    filter: blur(10px);
}

body::before {
    width: 36vw;
    height: 36vw;
    max-width: 420px;
    max-height: 420px;
    top: -140px;
    left: -100px;
    background: radial-gradient(circle, #62b9ff40 0%, #62b9ff00 70%);
    animation: none;
}

body::after {
    width: 32vw;
    height: 32vw;
    max-width: 380px;
    max-height: 380px;
    right: -100px;
    bottom: -140px;
    background: radial-gradient(circle, #ff8f8f30 0%, #ff8f8f00 70%);
    animation: none;
}

html[data-theme="dark"] body::before {
    background: radial-gradient(circle, #49a2ff30 0%, #49a2ff00 70%);
}

html[data-theme="dark"] body::after {
    background: radial-gradient(circle, #d57dff24 0%, #d57dff00 70%);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #e6edf7;
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #9db6d5;
}

main.page {
    width: 100%;
    min-height: 100vh;
    padding: 28px 16px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    padding: 10px 14px;
}

.topbar-inner {
    width: min(1140px, 98vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 16px;
    border: 1px solid #b7d1ed;
    background: linear-gradient(145deg, #ffffffab 0%, #eef6ffab 100%);
    box-shadow: 0 14px 24px #13335226;
    backdrop-filter: blur(10px);
    padding: 10px 12px;
}

.topbar-brand {
    color: #14385f;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-switch {
    display: inline-flex;
    gap: 6px;
    border: 1px solid #b8d2ed;
    border-radius: 999px;
    padding: 4px;
    background: #f3f8ff;
}

.theme-switch button {
    min-height: 30px;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 4px 10px;
    font-size: 0.87rem;
    font-weight: 700;
    background: transparent;
    color: #24466b;
    cursor: pointer;
}

.theme-switch button[aria-pressed="true"] {
    background: linear-gradient(120deg, #2a6aaa, #1c7ac1);
    color: #fff;
    border-color: #2e7ec5;
    box-shadow: 0 4px 12px #2a6aaa33;
}

.profile-menu {
    position: relative;
}

.profile-button {
    min-height: 34px;
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid #9fc0e2;
    background: linear-gradient(120deg, #f1f8ff, #deefff);
    color: #123e6f;
    font-weight: 700;
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(280px, 86vw);
    border-radius: 14px;
    border: 1px solid #b9d1ea;
    background:
        radial-gradient(circle at 90% 12%, #99d2ff30, transparent 45%),
        linear-gradient(165deg, #fbfdffef, #eef6ffef);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 36px #0f2b4a40;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-dropdown[hidden] {
    display: none;
}

.menu-label {
    font-size: 0.82rem;
    color: #4d6483;
}

.menu-user {
    font-weight: 800;
    color: #163b63;
}

main.page::before {
    content: "";
    position: absolute;
    inset: 10px 0 auto;
    margin: 0 auto;
    width: min(960px, 95vw);
    height: 100px;
    border-radius: 999px;
    background: linear-gradient(90deg, #cbe6ff30, #ffe8cf30, #d5f4d730);
    filter: blur(22px);
    animation: none;
    pointer-events: none;
}

.shell {
    width: min(980px, 96vw);
    margin: 0 auto;
}

.shell.narrow {
    width: min(620px, 94vw);
}

.panel {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(220, 232, 246, 0.85);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(17, 37, 65, 0.14);
    padding: 24px;
    transform: translateY(4px);
    opacity: 0;
    animation: panelIn 420ms cubic-bezier(0.22, 0.7, 0.28, 0.95) forwards;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 40%);
}

.panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.45);
    opacity: 0.6;
}

.panel.dark {
    color: #f3f7ff;
    /* layer subtle cool and warm tones for depth */
    background:
        radial-gradient(circle at 18% 14%, rgba(79,183,255,0.12), transparent 36%),
        radial-gradient(circle at 82% 88%, rgba(255,141,185,0.06), transparent 44%),
        linear-gradient(165deg, #0d2438 0%, #16314a 50%, #1a2b3f 100%);
    border-color: rgba(93,120,150,0.6);
    box-shadow: 0 18px 38px rgba(3,18,34,0.6);
}

html[data-theme="dark"] .topbar-inner {
    border-color: #37608a;
    background: linear-gradient(145deg, #0f243a88, #132f4b88);
}

html[data-theme="dark"] .topbar-brand {
    color: #dcecff;
}

html[data-theme="dark"] .theme-switch {
    border-color: #3f668f;
    background: #0d2a46;
}

html[data-theme="dark"] .theme-switch button {
    color: #c5dbf7;
}

html[data-theme="dark"] .profile-button {
    border-color: #4c78a4;
    background: linear-gradient(120deg, #163556, #22517f);
    color: #e5f2ff;
}

html[data-theme="dark"] .profile-dropdown {
    border-color: #3f6387;
    background:
        radial-gradient(circle at 90% 12%, #74bfff24, transparent 45%),
        linear-gradient(165deg, #0f243ade, #12304cde);
    box-shadow: 0 24px 46px #0516258a;
}

html[data-theme="dark"] .menu-label {
    color: #98b4d7;
}

html[data-theme="dark"] .menu-user {
    color: #e3f0ff;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stack-lg {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.row.space {
    justify-content: space-between;
}

.subtle {
    color: #3f4f68;
}

.subtle.light {
    color: #dbe9ff;
}

h1.intro {
    text-align: center;
    font-size: clamp(1.7rem, 3.1vw, 2.3rem);
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.panel.dark .intro {
    background: linear-gradient(90deg, #d7ecff, #f3f8ff, #ffd8ea, #e4ffe4);
    background-size: 240% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: titleShimmer 5s linear infinite;
}

h2.section {
    font-size: 1.24rem;
    font-weight: 700;
}

hr.linebreaker {
    border: 0;
    border-top: 1px solid #d0e0f2;
    width: 100%;
}

button {
    font: inherit;
}

button.redirect,
button.select,
.button-link {
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 10px 16px;
    min-height: 42px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.16s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

button.redirect::before,
button.select::before,
.button-link::before {
    content: "";
    position: absolute;
    inset: -40% auto auto -120%;
    width: 70%;
    height: 180%;
    background: linear-gradient(90deg, #ffffff00, #ffffff66, #ffffff00);
    transform: rotate(24deg);
    transition: left 0.45s ease;
}

button.redirect:hover::before,
button.select:hover::before,
.button-link:hover::before {
    left: 150%;
}

button.redirect {
    background: linear-gradient(120deg, #1a4e8f, #0c6cb1);
    color: #fff;
    border-color: #1f5fa7;
}

button.redirect:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px #1d4c884f;
    background: linear-gradient(120deg, #2964a7, #1680c8);
}

button.select {
    color: var(--secondary);
    background: linear-gradient(120deg, #eef6ff, #def0ff);
    border-color: #aec8e8;
}

button.select:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px #19467524;
    background-color: #d7e8fb;
}

.button-link {
    color: #114073;
    background: linear-gradient(120deg, #ecf4ff, #d9ecff);
    border-color: #b8d1ec;
}

.panel.dark .button-link {
    color: #e8f2ff;
    background: linear-gradient(120deg, #2a4e79, #1c628e);
    border-color: #7da9d6;
}

.danger {
    background: linear-gradient(120deg, #cd3744, #b72934) !important;
    color: #fff !important;
    border-color: var(--danger-dark) !important;
}

.danger:hover {
    background-color: var(--danger-dark);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid var(--light-blue);
    outline-offset: 2px;
}

button.small,
.button-link.small {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 0.95rem;
}

input.details {
    width: 100%;
    border: 1px solid #b9cce6;
    background: #fff;
    border-radius: 10px;
    color: var(--ink);
    min-height: 44px;
    padding: 10px 12px;
    font-size: 1rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

input.details:hover {
    border-color: #8eb6e5;
}

input.details:focus {
    border-color: #4f95d7;
    box-shadow: 0 0 0 4px #6bc2ff2e;
    transform: translateY(-1px);
}

label.field-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #24324a;
}

small.helper {
    color: #4f6581;
    font-size: 0.9rem;
}

ul.clean-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    justify-items: stretch;
}

.repo-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #c1d4e8;
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 6px 14px rgba(12, 47, 80, 0.12);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
    animation: fadeUp 420ms ease both;
    position: relative;
    overflow: visible;
    cursor: pointer;
}

.repo-card:hover {
    transform: translateY(-1px);
    border-color: #9dc1e5;
    box-shadow: 0 8px 18px rgba(12, 47, 80, 0.14);
}

.repo-card.selected {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 1px;
    background: linear-gradient(145deg, #e7f5ff, #d8edff);
}

.repo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.repo-card::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: linear-gradient(130deg, #4a90d6, #1c66b2);
    box-shadow: 0 0 0 2px #ffffff6f;
    flex: 0 0 auto;
}
.repo-card.folder::before {
    background: linear-gradient(130deg, #ffc95e, #f2a719);
}
.repo-card.parent::before {
    background: linear-gradient(130deg, #78d6ba, #1eaa82);
}
.repo-card.file::before {
    background: linear-gradient(130deg, #9cb3cf, #6585ac);
}

.clean-list li:nth-child(1) {
    animation-delay: 40ms;
}
.clean-list li:nth-child(2) {
    animation-delay: 90ms;
}
.clean-list li:nth-child(3) {
    animation-delay: 140ms;
}
.clean-list li:nth-child(4) {
    animation-delay: 190ms;
}
.clean-list li:nth-child(5) {
    animation-delay: 240ms;
}
.clean-list li:nth-child(6) {
    animation-delay: 290ms;
}

.repo-name {
    font-weight: 700;
    color: #183356;
    word-break: break-word;
    text-align: left;
}

.context-menu {
    position: fixed;
    z-index: 120;
    min-width: 210px;
    border-radius: 12px;
    border: 1px solid #b8d2e7;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 16px 30px rgba(22, 52, 86, 0.18);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.context-menu[hidden] {
    display: none !important;
}

.menu-item {
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: #1a4777;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.menu-item:hover {
    background: #e2effe;
    border-color: #a6c7ea;
}

.menu-item:disabled {
    color: #879db8;
    cursor: not-allowed;
    background: transparent;
    border-color: transparent;
}

.danger-item {
    color: #a31f2d;
}

.menu-item.danger-item:hover {
    background: #ffe5e8;
    border-color: #e3a8b0;
}

.browser-list {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    justify-items: center;
    gap: 20px;
}

.browser-list .repo-card {
    width: 110px;
    min-height: 108px;
    padding: 10px 8px 8px;
    border: 1px solid #d0e2f4;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 16px rgba(22, 53, 87, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.browser-list .repo-card::before {
    width: auto;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    font-size: 2rem;
    line-height: 1;
    background: none;
}

.browser-list .repo-card.folder::before {
    content: "\1F4C1";
}

.browser-list .repo-card.file::before {
    content: "\1F4C4";
}

.browser-list .repo-card.parent::before {
    content: "\21A9";
}

.browser-list .repo-name {
    max-width: 100%;
    font-size: 0.9rem;
    text-align: center;
    overflow-wrap: anywhere;
}

.browser-list .repo-card.selected {
    background: linear-gradient(170deg, #def2ff, #cce7ff);
    box-shadow: 0 12px 22px #1f507e33;
}

.file-preview-panel {
    border-radius: 18px;
    border: 1px solid rgba(178, 202, 226, 0.95);
    background: rgba(255, 255, 255, 0.90);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.preview-header {
    align-items: flex-start;
}

.preview-note {
    margin-top: 4px;
    color: #4c5f7d;
    max-width: 75ch;
}

.preview-content {
    min-height: 220px;
    border: 1px solid rgba(169, 192, 212, 0.7);
    border-radius: 14px;
    padding: 16px;
    background: rgba(248, 252, 255, 0.9);
    overflow: auto;
}

.preview-placeholder,
.preview-text {
    color: #42506a;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    text-align: center;
}

.preview-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Menlo, Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.5;
}

.preview-image,
.preview-video,
.preview-audio,
.preview-pdf {
    width: 100%;
    max-height: 420px;
    border-radius: 14px;
    background: #f7fbff;
}

.preview-video,
.preview-audio {
    min-height: 52px;
}

.preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-badge {
    background: #eff6ff;
    border: 1px solid #c6daf0;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #1a3a5c;
}

.alert {
    width: 100%;
    border: 1px solid #d84e5a;
    background: #fff1f2;
    color: #6a0f17;
    border-radius: 12px;
    padding: 10px 12px;
}

.empty-state {
    border: 1px dashed #b8cce8;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    background: linear-gradient(180deg, #fcfdff, #f2f8ff), #f8fbff;
    color: #314866;
}

.auth-card {
    width: min(520px, 96vw);
    height: max-content;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-link {
    color: #1b4f8c;
    font-weight: 700;
    text-decoration: underline;
}

.settings-trigger {
    border-color: #8fc1ef;
    background:
        linear-gradient(120deg, #edf7ff, #dcf0ff),
        linear-gradient(120deg, #ffffff20, #ffffff00);
}

dialog.settings-modal {
    width: min(560px, 92vw);
    border: 1px solid #9ec5e9;
    border-radius: 18px;
    padding: 40px;
    background:
        radial-gradient(circle at 92% 8%, #ffd16638, #ffd16600 40%),
        radial-gradient(circle at 8% 95%, #72cbff38, #72cbff00 42%),
        linear-gradient(165deg, #0d2b46dd, #1c4d89dd);
    backdrop-filter: blur(12px);
    box-shadow: 0 30px 80px #0f2c4d66;
    color: #cde4ff;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    animation: modalIn 260ms ease forwards;
}

.always-dark {
    color: #cde4ff;
}

.popup {
    padding: 40px;
}

dialog.settings-modal::backdrop {
    background:
        radial-gradient(circle at 50% 20%, #89c9ff33, #0d1f3600 50%), #071625a8;
    backdrop-filter: blur(4px);
}

dialog.settings-modal.popup form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 8px;
}

dialog.settings-modal.popup form input[type="text"] {
    padding: 8px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100%;
}

dialog.settings-modal.popup form div {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-card {
    padding: 18px;
}

.danger-zone {
    margin-top: 8px;
    border-radius: 14px;
    border: 1px solid #ee9aa3;
    background: linear-gradient(145deg, #fff6f7, #ffedef), #fff;
    padding: 14px;
}

.danger-zone h4 {
    color: #8a1c26;
    letter-spacing: 0.02em;
}
    .owners-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 6px;
    }
    .owner-token {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
        border-radius: 999px;
        background: #eff6ff;
        border: 1px solid #c6daf0;
        color: #114073;
        font-weight: 700;
    }
    .owner-token .remove-owner {
        border: none;
        background: transparent;
        color: #a31f2d;
        font-weight: 700;
        border-radius: 6px;
        padding: 2px 6px;
        cursor: pointer;
    }
    .owner-token .remove-owner:hover {
        background: #ffecec;
    }

    html[data-theme="dark"] .owner-token {
        background: linear-gradient(120deg, #163556, #1c4060);
        border-color: #3f668f;
        color: #e8f2ff;
    }

.danger-zone p {
    color: #5f2330;
}

html[data-theme="dark"] .panel {
    background: linear-gradient(160deg, #122740c9 0%, #163251c7 100%);
    border-color: #335578bf;
    box-shadow: 0 16px 34px #04182a6b;
}

html[data-theme="dark"] .panel::before {
    background:
        linear-gradient(135deg, #ffffff17, #ffffff00 35%),
        linear-gradient(315deg, #8fd0ff12, #ffffff00 45%);
}

html[data-theme="dark"] .subtle {
    color: #b5cce8;
}

html[data-theme="dark"] .subtle.light {
    color: #cde4ff;
}

html[data-theme="dark"] .repo-card {
    border-color: #456a90;
    background: linear-gradient(150deg, #143150d6, #193a5dd6);
    box-shadow: 0 10px 20px #06172855;
}

html[data-theme="dark"] .repo-name {
    color: #ebf4ff;
}

html[data-theme="dark"] .repo-card.selected {
    background: linear-gradient(150deg, #1f4b76, #245783);
}

html[data-theme="dark"] .browser-list .repo-card {
    border-color: #4f769f;
    background: linear-gradient(165deg, #173556e3, #1c4066e3);
    box-shadow: 0 12px 20px #04172773;
}

html[data-theme="dark"] .browser-list .repo-card.selected {
    background: linear-gradient(165deg, #28557f, #2f6698);
}

html[data-theme="dark"] .empty-state {
    border-color: #40668e;
    background: linear-gradient(180deg, #132b44, #10273f), #13273e;
    color: #cfe5ff;
}

html[data-theme="dark"] input.details {
    border-color: #4f7095;
    background: #0f2741;
    color: #e4efff;
}

html[data-theme="dark"] input.details:hover {
    border-color: #6c90ba;
}

html[data-theme="dark"] label.field-label {
    color: #d4e6ff;
}

html[data-theme="dark"] .button-link {
    color: #dbeeff;
    background: linear-gradient(120deg, #1a446d, #20527f);
    border-color: #4a79a8;
}

html[data-theme="dark"] .settings-trigger {
    border-color: #5f8fbc;
    background:
        linear-gradient(120deg, #1e446d, #295b89),
        linear-gradient(120deg, #ffffff15, #ffffff00);
}

html[data-theme="dark"] .context-menu {
    border-color: #466b92;
    background: linear-gradient(170deg, #112a44ee, #163350ee);
    box-shadow: 0 18px 34px #0413208a;
}

html[data-theme="dark"] .menu-item {
    color: #d7eaff;
}

html[data-theme="dark"] .menu-item:hover {
    background: #224b73;
    border-color: #5d89b7;
}

html[data-theme="dark"] .menu-item:disabled {
    color: #7fa1c3;
}

html[data-theme="dark"] .menu-item.danger-item {
    color: #ffb3bb;
}

html[data-theme="dark"] .menu-item.danger-item:hover {
    background: #61313c;
    border-color: #98616b;
}

html[data-theme="dark"] .danger-zone {
    border-color: #b96d77;
    background: linear-gradient(145deg, #4a1f2a, #3c1822), #3a1721;
}

html[data-theme="dark"] .danger-zone h4 {
    color: #ffb9c3;
}

html[data-theme="dark"] .danger-zone p {
    color: #ffd8dd;
}

html[data-theme="dark"] .file-preview-panel {
    background: rgba(18, 36, 62, 0.92);
    border-color: rgba(111, 153, 200, 0.6);
}

html[data-theme="dark"] .preview-content {
    background: rgba(12, 26, 44, 0.88);
    border-color: rgba(87, 132, 173, 0.45);
}

html[data-theme="dark"] .preview-placeholder,
html[data-theme="dark"] .preview-text {
    color: #c8daf0;
}

html[data-theme="dark"] .preview-badge {
    background: rgba(25, 56, 88, 0.86);
    border-color: rgba(85, 125, 170, 0.55);
    color: #d3e4ff;
}

.preview-content pre {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 4px;
    overflow-x: auto;
}

html[data-theme="dark"] .preview-content pre {
    background: #1e293b;
    color: #e2e8f0;
}

.preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.preview-content video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.preview-meta {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

html[data-theme="dark"] .preview-meta {
    color: #94a3b8;
}

.center {
    position: fixed;
    inset: 0;
    margin: auto;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes titleShimmer {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 240% 50%;
    }
}

@keyframes huePulse {
    0% {
        filter: blur(30px) hue-rotate(0deg);
    }
    50% {
        filter: blur(34px) hue-rotate(35deg);
    }
    100% {
        filter: blur(30px) hue-rotate(0deg);
    }
}

@keyframes driftA {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(40px, 30px);
    }
}

@keyframes driftB {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-30px, -35px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 640px) {
    .topbar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .topbar-right {
        justify-content: space-between;
    }

    .panel {
        padding: 18px;
    }

    .repo-card {
        flex-direction: column;
        align-items: stretch;
    }

    .row {
        flex-direction: column;
        align-items: stretch;
    }
}
