@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
    --ink: #161927;
    --muted: #72778b;
    --line: #e7e8ef;
    --surface: #ffffff;
    --canvas: #f5f6fa;
    --sidebar: #121522;
    --accent: #6577ff;
    --accent-dark: #5364e8;
    --shadow: 0 18px 60px rgba(29, 32, 52, .09);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    color: var(--ink);
    background: var(--canvas);
    font-family: "DM Sans", sans-serif;
}

body {
    margin: 0;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.eyebrow {
    margin: 0 0 7px;
    color: #8b90a1;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    cursor: pointer;
}

.icon-button:hover {
    background: #f0f1f6;
}

/* Login */
.login-page {
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 16%, rgba(101, 119, 255, .13), transparent 28%),
        #f1f2f7;
}

.login-shell {
    display: grid;
    width: min(1100px, 100%);
    min-height: calc(100vh - 48px);
    margin: 0 auto;
    grid-template-columns: minmax(360px, .82fr) 1.18fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: 0 30px 100px rgba(34, 37, 58, .15);
}

.login-panel {
    display: flex;
    max-width: 460px;
    padding: 72px 64px;
    align-self: center;
    flex-direction: column;
    justify-self: center;
}

.brand-mark {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    border-radius: 11px;
    background: linear-gradient(145deg, #7988ff, #5265ee);
    box-shadow: 0 8px 18px rgba(101, 119, 255, .3);
    font-family: "Manrope", sans-serif;
    font-weight: 800;
}

.brand-mark-large {
    width: 52px;
    height: 52px;
    margin-bottom: 38px;
    border-radius: 17px;
    font-size: 21px;
}

.login-panel h1 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1.05;
    letter-spacing: -.05em;
}

.login-copy {
    margin: 16px 0 30px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.login-error {
    margin-bottom: 18px;
    padding: 11px 13px;
    color: #ae3e55;
    border: 1px solid #f0ccd5;
    border-radius: 12px;
    background: #fff3f6;
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 11px;
}

.login-form label {
    color: #4e5262;
    font-size: 13px;
    font-weight: 700;
}

.password-field {
    position: relative;
}

.password-field input {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 16px;
    color: var(--ink);
    outline: none;
    border: 1px solid #dfe1e9;
    border-radius: 14px;
    background: #fafafe;
    transition: .2s ease;
}

.password-field input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(101, 119, 255, .12);
}

.show-password {
    position: absolute;
    top: 5px;
    right: 5px;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    color: #9195a5;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.show-password.active {
    color: var(--accent);
}

.primary-button {
    height: 52px;
    margin-top: 8px;
    color: #fff;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    box-shadow: 0 12px 24px rgba(101, 119, 255, .25);
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}

.primary-button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.login-art {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .08), transparent 45%),
        #151827;
}

.login-art::before {
    position: absolute;
    inset: 12%;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
    content: "";
}

.art-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
}

.art-orb-one {
    top: 8%;
    right: -8%;
    width: 330px;
    height: 330px;
    background: rgba(101, 119, 255, .55);
}

.art-orb-two {
    bottom: 5%;
    left: -8%;
    width: 260px;
    height: 260px;
    background: rgba(65, 185, 149, .3);
}

.floating-card {
    position: absolute;
    display: grid;
    width: 210px;
    padding: 18px;
    gap: 13px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 20px;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 28px 60px rgba(0, 0, 0, .2);
    backdrop-filter: blur(15px);
}

.floating-card span {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, .13);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
}

.floating-card strong {
    font-size: 14px;
}

.floating-card-one {
    top: 20%;
    left: 12%;
    transform: rotate(-5deg);
}

.floating-card-two {
    top: 42%;
    right: 10%;
    transform: rotate(5deg);
}

.floating-card-three {
    bottom: 13%;
    left: 22%;
    transform: rotate(-2deg);
}

/* Application shell */
.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    display: flex;
    width: 244px;
    padding: 24px 18px;
    color: #c3c6d2;
    background:
        radial-gradient(circle at 20% 3%, rgba(101, 119, 255, .18), transparent 28%),
        var(--sidebar);
    flex-direction: column;
}

.sidebar-top {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    font-weight: 800;
}

.sidebar-close {
    display: none;
}

.location-nav {
    margin-top: 48px;
}

.utility-nav {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.utility-icon {
    color: #a5aabc;
    background: rgba(255, 255, 255, .06);
}

.nav-label {
    margin: 0 11px 10px;
    color: #74798d;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.location-link {
    display: flex;
    min-height: 47px;
    padding: 6px 10px;
    align-items: center;
    gap: 11px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 600;
    transition: .18s ease;
}

.location-link:hover,
.location-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.location-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--location-accent);
    border-radius: 9px;
    background: color-mix(in srgb, var(--location-accent) 14%, transparent);
}

.location-icon svg {
    width: 16px;
    height: 16px;
}

.sidebar-note {
    display: flex;
    margin-top: auto;
    padding: 14px;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 15px;
    background: rgba(255, 255, 255, .035);
}

.sidebar-note svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: #929fff;
}

.sidebar-note p {
    display: grid;
    margin: 0;
    gap: 4px;
    font-size: 11px;
}

.sidebar-note strong {
    color: #fff;
}

.sidebar-note span {
    color: #777c8e;
    line-height: 1.4;
}

.logout-link {
    display: flex;
    margin-top: 10px;
    padding: 12px 11px;
    align-items: center;
    gap: 11px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.logout-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.logout-link svg {
    width: 17px;
    height: 17px;
}

.main-content {
    min-height: 100vh;
    margin-left: 244px;
}

.topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    height: 78px;
    padding: 0 34px;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid rgba(231, 232, 239, .8);
    background: rgba(245, 246, 250, .88);
    backdrop-filter: blur(18px);
}

.menu-button {
    display: none;
}

.search-box {
    display: flex;
    width: min(430px, 50vw);
    height: 43px;
    padding: 0 12px;
    align-items: center;
    gap: 9px;
    color: #8d92a4;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
}

.search-box svg {
    width: 17px;
    height: 17px;
}

.search-box input {
    width: 100%;
    min-width: 80px;
    outline: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
}

.search-box kbd {
    padding: 3px 6px;
    color: #999ead;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f6f6f9;
    font-family: inherit;
    font-size: 9px;
    white-space: nowrap;
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #53586b;
    font-size: 12px;
    font-weight: 700;
}

.topbar-title svg {
    width: 17px;
    height: 17px;
    color: #7e8497;
}

.topbar-actions {
    display: flex;
    margin-left: auto;
    align-items: center;
    gap: 12px;
}

.privacy-pill {
    display: flex;
    padding: 7px 10px;
    align-items: center;
    gap: 6px;
    color: #626779;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
}

.privacy-pill svg {
    width: 13px;
    height: 13px;
    color: #41a988;
}

.avatar {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #292e44;
    box-shadow: 0 4px 12px rgba(24, 28, 45, .15);
    font-size: 12px;
    font-weight: 800;
}

.content {
    width: min(1460px, 100%);
    padding: 26px 34px 60px;
    margin: 0 auto;
}

.breadcrumbs {
    display: flex;
    min-height: 24px;
    align-items: center;
    gap: 5px;
    color: #858a9b;
    font-size: 12px;
    font-weight: 600;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumbs a:last-child {
    color: var(--ink);
}

.breadcrumbs svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.folder-heading {
    display: flex;
    margin-top: 28px;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.folder-heading h1 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(28px, 4vw, 39px);
    line-height: 1.15;
    letter-spacing: -.045em;
}

.folder-summary {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.folder-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.upload-button {
    display: inline-flex;
    height: 41px;
    padding: 0 14px;
    align-items: center;
    gap: 7px;
    color: #fff;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    box-shadow: 0 9px 20px rgba(101, 119, 255, .2);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.upload-button:hover {
    background: var(--accent-dark);
}

.upload-button:disabled {
    color: #9a9eac;
    background: #e6e7ed;
    box-shadow: none;
    cursor: not-allowed;
}

.upload-button svg {
    width: 15px;
    height: 15px;
}

.view-switcher {
    display: flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.view-switcher button {
    display: grid;
    width: 35px;
    height: 33px;
    padding: 0;
    place-items: center;
    color: #969baa;
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
}

.view-switcher button.active {
    color: var(--ink);
    background: #eff0f5;
}

.view-switcher svg {
    width: 16px;
    height: 16px;
}

.toolbar {
    display: flex;
    margin: 30px 0 22px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.upload-flash {
    display: flex;
    margin-top: 20px;
    padding: 12px 14px;
    align-items: start;
    gap: 10px;
    border: 1px solid;
    border-radius: 13px;
    font-size: 10px;
}

.upload-flash svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.upload-flash div {
    display: grid;
    gap: 3px;
}

.upload-flash strong {
    font-size: 11px;
}

.upload-flash span {
    line-height: 1.5;
}

.upload-flash.success {
    color: #287b62;
    border-color: #cce8df;
    background: #effaf6;
}

.upload-flash.error {
    color: #a84055;
    border-color: #efd0d7;
    background: #fff3f6;
}

.upload-flash.readonly {
    color: #777c8e;
    border-color: #e1e3ea;
    background: #f8f8fb;
}

.filter-chips {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chips button {
    display: flex;
    height: 34px;
    padding: 0 11px;
    align-items: center;
    gap: 7px;
    color: #74798b;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.filter-chips button span {
    color: #a1a5b3;
    font-size: 9px;
}

.filter-chips button.active {
    color: #fff;
    border-color: var(--ink);
    background: var(--ink);
}

.filter-chips button.active span {
    color: #b9bdc9;
}

.sort-control {
    position: relative;
    display: flex;
    height: 34px;
    padding: 0 9px 0 11px;
    align-items: center;
    gap: 5px;
    color: #8c91a0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 11px;
    white-space: nowrap;
}

.sort-control select {
    padding: 0 16px 0 0;
    color: var(--ink);
    outline: 0;
    border: 0;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    appearance: none;
}

.sort-control svg {
    position: absolute;
    right: 7px;
    width: 13px;
    height: 13px;
    pointer-events: none;
}

/* Files: grid */
.file-collection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.file-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.file-card:hover {
    border-color: #d7d9e4;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.file-open {
    display: block;
    min-width: 0;
    padding: 7px 7px 13px;
}

.file-visual {
    position: relative;
    display: grid;
    height: 132px;
    place-items: center;
    overflow: hidden;
    color: #8e96ae;
    border-radius: 13px;
    background: #f3f4f8;
}

.file-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.file-card:hover .file-visual img {
    transform: scale(1.035);
}

.file-visual svg {
    width: 46px;
    height: 46px;
    stroke-width: 1.35;
}

.file-visual.folder {
    color: #8b96ff;
    background: #f0f1ff;
}

.file-visual.document {
    color: #7182e4;
    background: #eff2ff;
}

.file-visual.video {
    color: #d87489;
    background: #fff0f3;
}

.file-visual.audio {
    color: #9a70ce;
    background: #f6efff;
}

.file-visual.archive {
    color: #ca9260;
    background: #fff5eb;
}

.file-visual small {
    position: absolute;
    right: 9px;
    bottom: 8px;
    padding: 3px 5px;
    color: currentColor;
    border-radius: 5px;
    background: rgba(255, 255, 255, .72);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .08em;
}

.file-meta {
    display: grid;
    min-width: 0;
    padding: 11px 4px 0;
    gap: 4px;
}

.file-meta strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta span {
    overflow: hidden;
    color: #9095a5;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    opacity: 0;
    transition: opacity .2s ease;
}

.file-card:hover .file-actions,
.file-actions:focus-within {
    opacity: 1;
}

.file-actions a {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--ink);
    border: 1px solid rgba(225, 227, 235, .9);
    border-radius: 9px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 5px 15px rgba(28, 31, 48, .1);
}

.file-actions svg {
    width: 14px;
    height: 14px;
}

.list-head,
.list-type,
.list-size,
.list-date {
    display: none;
}

/* Files: list */
body[data-view="list"] .list-head {
    display: grid;
    padding: 0 18px 9px;
    grid-template-columns: minmax(220px, 1fr) 120px 100px 125px 34px;
    gap: 14px;
    color: #989dab;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

body[data-view="list"] .file-collection {
    display: grid;
    gap: 5px;
}

body[data-view="list"] .file-card {
    display: grid;
    min-height: 62px;
    padding: 5px 12px 5px 6px;
    align-items: center;
    grid-template-columns: minmax(220px, 1fr) 120px 100px 125px 34px;
    gap: 14px;
    border-radius: 13px;
}

body[data-view="list"] .file-card:hover {
    transform: none;
}

body[data-view="list"] .file-open {
    display: flex;
    min-width: 0;
    padding: 0;
    align-items: center;
    gap: 11px;
}

body[data-view="list"] .file-visual {
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    border-radius: 10px;
}

body[data-view="list"] .file-visual svg {
    width: 25px;
    height: 25px;
}

body[data-view="list"] .file-visual small {
    display: none;
}

body[data-view="list"] .file-meta {
    padding: 0;
}

body[data-view="list"] .list-type,
body[data-view="list"] .list-size,
body[data-view="list"] .list-date {
    display: block;
    overflow: hidden;
    color: #777c8e;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body[data-view="list"] .file-actions {
    position: static;
    opacity: 1;
}

body[data-view="list"] .file-actions a {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.file-card[hidden] {
    display: none !important;
}

.empty-state {
    display: none;
    padding: 80px 20px;
    color: var(--muted);
    text-align: center;
}

.empty-state.visible {
    display: block;
}

.empty-state > span {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto 15px;
    place-items: center;
    color: #8c96f7;
    border-radius: 20px;
    background: #eceeff;
}

.empty-state h2 {
    margin: 0;
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 18px;
}

.empty-state p {
    margin: 7px 0 0;
    font-size: 12px;
}

/* Settings */
.settings-content {
    width: min(1120px, 100%);
}

.settings-heading {
    margin: 14px 0 28px;
}

.settings-heading h1 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(30px, 4vw, 42px);
    letter-spacing: -.05em;
}

.settings-heading > div > p:last-child {
    max-width: 600px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.settings-alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 13px;
    font-size: 12px;
    font-weight: 600;
}

.settings-alert.error {
    color: #a84055;
    border-color: #efd0d7;
    background: #fff3f6;
}

.settings-alert.success {
    color: #287b62;
    border-color: #cce8df;
    background: #effaf6;
}

.settings-panel {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.settings-panel-heading {
    display: flex;
    margin-bottom: 20px;
    align-items: center;
    gap: 12px;
}

.settings-panel-icon {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    place-items: center;
    color: #6475ef;
    border-radius: 12px;
    background: #eef0ff;
}

.settings-panel-icon svg {
    width: 18px;
    height: 18px;
}

.settings-panel-heading h2 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    letter-spacing: -.02em;
}

.settings-panel-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.location-form {
    display: grid;
    grid-template-columns: minmax(150px, .65fr) minmax(250px, 1.35fr) auto auto;
    gap: 13px;
    align-items: end;
}

.settings-field {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.settings-field label,
.color-field legend {
    color: #666b7d;
    font-size: 10px;
    font-weight: 700;
}

.settings-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    min-width: 0;
    color: var(--ink);
    outline: 0;
    border: 1px solid #dfe1e9;
    border-radius: 11px;
    background: #fafafe;
    font-size: 12px;
    transition: .2s ease;
}

.settings-field input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(101, 119, 255, .1);
}

.settings-field small {
    color: #989dab;
    font-size: 9px;
    line-height: 1.45;
}

.color-field {
    min-width: 0;
    padding: 0;
    border: 0;
}

.color-field legend {
    margin-bottom: 8px;
}

.color-options {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 5px;
}

.color-options label {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    cursor: pointer;
}

.color-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.color-options span {
    display: block;
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
    border-radius: 50%;
    outline: 1px solid #d9dbe4;
    background: var(--swatch);
    transition: .15s ease;
}

.color-options input:checked + span {
    outline: 2px solid var(--swatch);
    outline-offset: 2px;
    transform: scale(.9);
}

.settings-primary-button,
.settings-secondary-button,
.settings-danger-button {
    display: inline-flex;
    min-height: 42px;
    padding: 0 14px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.settings-primary-button {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 9px 18px rgba(101, 119, 255, .2);
}

.settings-primary-button:hover {
    background: var(--accent-dark);
}

.settings-primary-button svg,
.settings-danger-button svg {
    width: 14px;
    height: 14px;
}

.managed-locations {
    display: grid;
    gap: 9px;
}

.managed-location {
    display: flex;
    min-width: 0;
    padding: 13px;
    align-items: center;
    gap: 12px;
    border: 1px solid #ececf2;
    border-radius: 14px;
    background: #fafafe;
}

.managed-location-icon {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--location-accent);
    border-radius: 11px;
    background: color-mix(in srgb, var(--location-accent) 12%, transparent);
}

.managed-location-icon svg {
    width: 18px;
    height: 18px;
}

.managed-location-info {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.managed-location-info > div {
    display: flex;
    align-items: center;
    gap: 7px;
}

.managed-location-info strong {
    font-size: 12px;
}

.managed-location-info code {
    display: block;
    overflow: hidden;
    color: #888d9e;
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-hint {
    display: block;
    color: #a15362;
    font-size: 9px;
    line-height: 1.4;
}

.location-badge,
.location-status {
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
    white-space: nowrap;
}

.location-badge {
    color: #777c8f;
    background: #eceef3;
}

.location-status.ready {
    color: #308064;
    background: #e5f5ef;
}

.location-status.missing {
    color: #a15362;
    background: #fae9ed;
}

.editable-location {
    align-items: start;
    background: #fff;
}

.edit-location-form {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(140px, .7fr) minmax(240px, 1.3fr) auto;
    gap: 11px;
    align-items: end;
}

.edit-location-heading {
    display: none;
}

.color-field.compact {
    align-self: end;
}

.managed-location-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 7px;
}

.settings-secondary-button {
    color: #4d5366;
    border: 1px solid var(--line);
    background: #fff;
}

.settings-secondary-button:hover {
    background: #f2f3f7;
}

.settings-danger-button {
    min-height: 36px;
    color: #a7475a;
    background: #fff0f3;
}

.settings-danger-button:hover {
    background: #fbe2e8;
}

.settings-help {
    display: flex;
    padding: 16px 18px;
    gap: 11px;
    color: #767b8e;
    border: 1px solid #e5e6ed;
    border-radius: 15px;
    background: rgba(255, 255, 255, .55);
}

.settings-help svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: #6878e8;
}

.settings-help p {
    display: grid;
    margin: 0;
    gap: 4px;
    font-size: 10px;
    line-height: 1.5;
}

.settings-help strong {
    color: #4e5365;
}

/* Preview */
.preview-dialog {
    width: calc(100vw - 34px);
    max-width: 1500px;
    height: calc(100vh - 34px);
    max-height: 1000px;
    padding: 0;
    overflow: hidden;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 22px;
    background: #12141d;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .4);
}

.preview-dialog::backdrop {
    background: rgba(13, 15, 23, .68);
    backdrop-filter: blur(7px);
}

.preview-topbar {
    display: flex;
    min-height: 72px;
    padding: 12px 16px 12px 22px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.preview-topbar > div:first-child {
    min-width: 0;
}

.preview-topbar .eyebrow {
    margin-bottom: 3px;
    color: #777d91;
}

.preview-topbar strong {
    display: block;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-topbar > div:last-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-topbar .icon-button {
    color: #fff;
    border-color: rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .05);
}

.preview-download {
    display: flex;
    height: 42px;
    padding: 0 13px;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 13px;
    background: rgba(255, 255, 255, .05);
    font-size: 11px;
    font-weight: 700;
}

.preview-download svg {
    width: 15px;
    height: 15px;
}

.preview-stage {
    display: grid;
    height: calc(100% - 72px);
    padding: 24px;
    place-items: center;
    background:
        radial-gradient(circle at 50% 50%, rgba(101, 119, 255, .08), transparent 50%),
        #0d0f17;
}

.preview-stage img,
.preview-stage video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .25);
}

.preview-stage audio {
    width: min(520px, 90%);
}

.preview-stage iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
    background: #fff;
}

/* Upload */
.upload-dialog {
    width: min(540px, calc(100vw - 28px));
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 100px rgba(26, 29, 46, .25);
}

.upload-dialog::backdrop {
    background: rgba(20, 23, 35, .55);
    backdrop-filter: blur(5px);
}

.upload-dialog form {
    padding: 20px;
}

.upload-dialog-topbar {
    display: flex;
    margin-bottom: 17px;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.upload-dialog-topbar strong {
    display: block;
    max-width: 390px;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-dropzone {
    display: grid;
    min-height: 220px;
    padding: 28px;
    place-items: center;
    align-content: center;
    color: #777c8f;
    border: 1px dashed #cfd2df;
    border-radius: 17px;
    background: #fafafe;
    text-align: center;
    cursor: pointer;
    transition: .2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.dragging {
    border-color: var(--accent);
    background: #f3f4ff;
}

.upload-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-dropzone-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 13px;
    place-items: center;
    color: #6677ee;
    border-radius: 17px;
    background: #e9ebff;
}

.upload-dropzone-icon svg {
    width: 23px;
    height: 23px;
}

.upload-dropzone strong {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 14px;
}

.upload-dropzone > span:not(.upload-dropzone-icon) {
    margin-top: 4px;
    font-size: 11px;
}

.upload-dropzone small {
    margin-top: 13px;
    color: #a0a4b2;
    font-size: 9px;
}

.upload-selection {
    margin-top: 12px;
    color: #777c8d;
    font-size: 10px;
}

.upload-progress {
    height: 6px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8e9f0;
}

.upload-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width .15s ease;
}

.upload-dialog-message {
    margin-top: 12px;
    padding: 10px 12px;
    color: #a84055;
    border: 1px solid #efd0d7;
    border-radius: 10px;
    background: #fff3f6;
    font-size: 10px;
    line-height: 1.5;
}

.upload-dialog-actions {
    display: flex;
    margin-top: 17px;
    justify-content: flex-end;
    gap: 8px;
}

.upload-dialog-actions .settings-primary-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.sidebar-scrim {
    display: none;
}

@media (max-width: 1000px) {
    .sidebar {
        width: 220px;
    }

    .main-content {
        margin-left: 220px;
    }

    .content,
    .topbar {
        padding-right: 24px;
        padding-left: 24px;
    }

    body[data-view="list"] .list-head,
    body[data-view="list"] .file-card {
        grid-template-columns: minmax(210px, 1fr) 95px 100px 34px;
    }

    body[data-view="list"] .list-type,
    body[data-view="list"] .list-head span:nth-child(2) {
        display: none;
    }

    .location-form {
        grid-template-columns: 1fr 1.5fr;
    }

    .location-form .color-field,
    .location-form .settings-primary-button {
        justify-self: start;
    }

    .edit-location-form {
        grid-template-columns: 1fr 1.5fr;
    }
}

@media (max-width: 760px) {
    .login-page {
        padding: 0;
        background: #fff;
    }

    .login-shell {
        min-height: 100vh;
        grid-template-columns: 1fr;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-panel {
        width: 100%;
        padding: 42px 27px;
    }

    .login-art {
        display: none;
    }

    .sidebar {
        width: min(290px, 84vw);
        transform: translateX(-102%);
        transition: transform .25s ease;
    }

    .sidebar-close {
        display: grid;
        color: #fff;
        border-color: rgba(255, 255, 255, .08);
        background: rgba(255, 255, 255, .04);
    }

    .sidebar-scrim {
        position: fixed;
        z-index: 15;
        inset: 0;
        background: rgba(15, 17, 27, .42);
        backdrop-filter: blur(2px);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-scrim {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        height: 68px;
        padding: 0 16px;
        gap: 9px;
    }

    .menu-button {
        display: grid;
        flex: 0 0 auto;
    }

    .search-box {
        width: 100%;
    }

    .search-box kbd,
    .privacy-pill {
        display: none;
    }

    .topbar-actions {
        margin-left: 0;
    }

    .content {
        padding: 20px 16px 40px;
    }

    .settings-content {
        padding-top: 25px;
    }

    .settings-panel {
        padding: 17px;
        border-radius: 17px;
    }

    .location-form,
    .edit-location-form {
        grid-template-columns: 1fr;
    }

    .location-form .settings-primary-button {
        width: 100%;
    }

    .managed-location {
        align-items: start;
    }

    .managed-location-info > div {
        align-items: start;
        flex-wrap: wrap;
    }

    .editable-location .managed-location-icon {
        display: none;
    }

    .edit-location-heading {
        display: flex;
    }

    .managed-location-actions {
        grid-column: auto;
        justify-content: stretch;
    }

    .managed-location-actions button {
        flex: 1;
    }

    .folder-heading {
        margin-top: 23px;
        align-items: start;
    }

    .folder-actions {
        flex-direction: column;
        align-items: end;
    }

    .upload-button span {
        display: none;
    }

    .upload-button {
        width: 41px;
        padding: 0;
        justify-content: center;
    }

    .toolbar {
        margin: 23px -16px 17px;
        padding: 0 16px;
        align-items: start;
        flex-direction: column;
        gap: 11px;
    }

    .filter-chips {
        width: calc(100vw - 16px);
        padding-right: 16px;
    }

    .file-collection {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .file-visual {
        height: 112px;
    }

    .file-actions {
        opacity: 1;
    }

    body[data-view="list"] .list-head {
        display: none;
    }

    body[data-view="list"] .file-card {
        grid-template-columns: minmax(0, 1fr) 34px;
    }

    body[data-view="list"] .list-type,
    body[data-view="list"] .list-size,
    body[data-view="list"] .list-date {
        display: none;
    }

    .preview-dialog {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .preview-download span {
        display: none;
    }

    .upload-dialog {
        width: calc(100vw - 18px);
        border-radius: 18px;
    }

    .upload-dialog form {
        padding: 16px;
    }

    .upload-dropzone {
        min-height: 190px;
    }
}

@media (max-width: 390px) {
    .file-collection {
        grid-template-columns: 1fr;
    }

    .file-visual {
        height: 155px;
    }
}
