:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --text: #171725;
    --muted: #73758a;
    --line: #e7e8ef;
    --primary: #6d3df5;
    --primary-dark: #5423e0;
    --primary-soft: #eee8ff;
    --danger: #d44343;
    --danger-soft: #fff0f0;
    --success: #138a56;
    --success-soft: #eaf8f1;
    --shadow: 0 18px 50px rgba(31, 27, 49, 0.09);
    --radius: 18px;
    --radius-small: 12px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

body,
button,
input {
    font: inherit;
}

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

button,
input {
    outline: none;
}

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

button {
    cursor: pointer;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand strong {
    display: block;
    max-width: 175px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.brand small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.brand-centered {
    justify-content: center;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #8c63ff, var(--primary));
    box-shadow: 0 10px 24px rgba(109, 61, 245, 0.25);
    font-weight: 800;
}

.brand-mark-small {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-weight: 700;
    transition: 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 10px 24px rgba(109, 61, 245, 0.2);
}

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

.button-secondary {
    color: #3e4052;
    border-color: var(--line);
    background: #fff;
}

.button-secondary:hover {
    border-color: #cfc8ef;
    background: #faf9ff;
}

.button-danger {
    color: #fff;
    background: var(--danger);
}

.button-wide {
    width: 100%;
}

.button-small {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 13px;
}

.icon-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: #56586d;
    background: transparent;
    font-size: 18px;
    transition: 150ms ease;
}

.icon-button:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

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

.alert {
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 14px;
}

.alert-success {
    color: var(--success);
    border-color: #b9e7d0;
    background: var(--success-soft);
}

.alert-error {
    color: #a42e2e;
    border-color: #f0c6c6;
    background: var(--danger-soft);
}

.field {
    display: grid;
    gap: 8px;
}

.field > span {
    font-size: 13px;
    font-weight: 700;
}

.field input {
    width: 100%;
    min-height: 45px;
    padding: 0 13px;
    border: 1px solid #dfe0e9;
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    transition: 150ms ease;
}

.field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(109, 61, 245, 0.1);
}

.field small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 62px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    color: var(--primary);
    background: transparent;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 800;
}

/* Setup */
.setup-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 0 0, #eee8ff 0, transparent 32%),
        radial-gradient(circle at 100% 100%, #e8f5ff 0, transparent 30%),
        var(--bg);
}

.setup-card {
    width: min(760px, 100%);
    padding: 34px;
    border: 1px solid rgba(221, 220, 233, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.setup-heading {
    margin: 28px 0 22px;
    text-align: center;
}

.setup-heading h1,
.setup-complete h1 {
    margin-bottom: 8px;
    font-size: clamp(24px, 4vw, 34px);
}

.setup-heading p,
.setup-complete p {
    color: var(--muted);
    line-height: 1.6;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.field-full {
    grid-column: 1 / -1;
}

.setup-complete {
    padding-top: 28px;
    text-align: center;
}

.success-icon {
    display: grid;
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--success);
    font-size: 30px;
}

/* Login */
.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 10% 10%, #efe9ff 0, transparent 32%),
        radial-gradient(circle at 90% 90%, #e9f6ff 0, transparent 30%),
        var(--bg);
}

.login-card {
    display: grid;
    width: min(1000px, 100%);
    min-height: 620px;
    grid-template-columns: 1.05fr 0.95fr;
    overflow: hidden;
    border: 1px solid rgba(221, 220, 233, 0.9);
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--shadow);
}

.login-visual {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 56px;
    color: #fff;
    background:
        radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.18), transparent 26%),
        linear-gradient(145deg, #8057ff 0%, #6030e8 55%, #3f1ca4 100%);
}

.login-visual::after {
    position: absolute;
    right: -90px;
    bottom: -120px;
    width: 360px;
    height: 360px;
    border: 55px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    content: "";
}

.login-visual-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.privacy-pill {
    display: inline-flex;
    margin-bottom: 26px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
    font-size: 12px;
    font-weight: 700;
}

.login-visual h1 {
    margin-bottom: 18px;
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.login-visual p {
    max-width: 430px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
}

.visual-folder {
    position: relative;
    width: min(330px, 90%);
    margin-top: 54px;
}

.folder-tab {
    width: 120px;
    height: 30px;
    border-radius: 16px 16px 0 0;
    background: rgba(255, 255, 255, 0.38);
}

.folder-body {
    display: flex;
    min-height: 125px;
    align-items: center;
    justify-content: space-around;
    padding: 24px;
    border-radius: 0 24px 24px 24px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
}

.folder-body span {
    display: grid;
    width: 62px;
    height: 76px;
    place-items: center;
    border-radius: 13px;
    color: #6a3bea;
    background: rgba(255, 255, 255, 0.94);
    font-size: 12px;
    font-weight: 900;
}

.login-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(36px, 6vw, 70px);
}

.login-heading {
    margin: 54px 0 26px;
}

.login-heading h2 {
    margin-bottom: 7px;
    font-size: 32px;
}

.login-heading p,
.login-note {
    color: var(--muted);
}

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

.login-note {
    margin: 22px 0 0;
    font-size: 12px;
    text-align: center;
}

/* App shell */
.app-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 276px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 24px 18px;
    border-right: 1px solid var(--line);
    background: #fff;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 7px 22px;
}

.sidebar-close {
    display: none;
}

.main-nav {
    display: grid;
    gap: 5px;
}

.nav-link,
.tree-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 11px;
    border-radius: 11px;
    color: #55576a;
    font-size: 14px;
    font-weight: 650;
}

.nav-link {
    padding: 0 12px;
}

.nav-link:hover,
.tree-link:hover,
.nav-link.is-active,
.tree-link.is-active {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-link small {
    margin-left: auto;
    color: #8a86a0;
    font-size: 10px;
}

.nav-icon {
    width: 20px;
    flex: 0 0 auto;
    text-align: center;
}

.sidebar-section {
    min-height: 0;
    flex: 1;
    margin-top: 25px;
    overflow: auto;
}

.sidebar-label {
    margin: 0 10px 10px;
    color: #9a9bab;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.folder-tree {
    margin: 0;
    padding: 0;
    list-style: none;
}

.folder-tree .folder-tree {
    margin-left: 16px;
}

.tree-link {
    min-height: 38px;
    padding: 0 10px;
    overflow: hidden;
}

.tree-link span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-empty {
    margin: 10px;
    color: var(--muted);
    font-size: 13px;
}

.storage-card {
    margin-top: 16px;
    padding: 14px;
    border-radius: 13px;
    background: #f7f5ff;
}

.storage-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.storage-row strong {
    color: var(--primary);
}

.storage-bar {
    height: 6px;
    margin: 10px 0;
    overflow: hidden;
    border-radius: 999px;
    background: #ddd6fa;
}

.storage-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.storage-card small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

.sidebar-user {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.sidebar-user strong,
.sidebar-user small {
    display: block;
}

.sidebar-user strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.sidebar-user small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

.main-panel {
    min-width: 0;
}

.topbar {
    display: flex;
    min-height: 104px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 34px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
}

.topbar h1 {
    margin-bottom: 4px;
    font-size: 25px;
    letter-spacing: -0.02em;
}

.topbar p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.search-form {
    display: flex;
    width: min(390px, 42vw);
    min-height: 46px;
    align-items: center;
    gap: 9px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8f8fb;
}

.search-form:focus-within {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(109, 61, 245, 0.08);
}

.search-form span {
    color: #8b8d9f;
    font-size: 20px;
}

.search-form input {
    width: 100%;
    border: 0;
    background: transparent;
}

.content {
    padding: 28px 34px 44px;
}

.drive-toolbar,
.search-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.toolbar-actions,
.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumbs a {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumbs a:last-child {
    color: var(--text);
    font-weight: 700;
}

.drop-zone {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 28px;
    border: 1.5px dashed #cfc5f5;
    border-radius: 16px;
    background: #faf9ff;
    color: #5f6180;
    cursor: pointer;
    transition: 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.drop-zone strong,
.drop-zone span {
    display: block;
}

.drop-zone span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.drop-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    color: var(--primary);
    background: #fff;
    box-shadow: 0 8px 18px rgba(109, 61, 245, 0.12);
    font-size: 21px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 26px 0 14px;
}

.section-heading h2 {
    margin: 0;
    font-size: 16px;
}

.section-heading span {
    display: grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    color: var(--muted);
    background: #e9eaf0;
    font-size: 11px;
    font-weight: 800;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.folder-card {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 15px 12px 15px 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    transition: 160ms ease;
}

.folder-card:hover {
    border-color: #cec4f4;
    box-shadow: 0 12px 28px rgba(32, 24, 65, 0.07);
    transform: translateY(-2px);
}

.folder-card-main {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.folder-card-main > div:last-child {
    min-width: 0;
}

.folder-card strong,
.folder-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.folder-card small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.folder-shape {
    position: relative;
    width: 40px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 7px;
    background: #d9cbff;
}

.folder-shape::before {
    position: absolute;
    top: -5px;
    left: 2px;
    width: 18px;
    height: 8px;
    border-radius: 5px 5px 0 0;
    background: #c4b0ff;
    content: "";
}

.folder-shape span {
    position: absolute;
    inset: 8px 6px 6px;
    border-radius: 4px;
    background: #fff;
    opacity: 0.55;
}

.file-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.file-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.file-table th,
.file-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #efeff3;
    text-align: left;
    vertical-align: middle;
}

.file-table th {
    color: #8b8d9d;
    background: #fafafd;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

.file-table td {
    color: #5d5f70;
    font-size: 12px;
}

.file-table td:first-child {
    width: 46%;
}

.file-name {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.file-name > span:last-child {
    min-width: 0;
}

.file-name strong,
.file-name small {
    display: block;
}

.file-name strong {
    max-width: 380px;
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.file-name small {
    max-width: 380px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
}

.file-badge {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 9px;
    font-weight: 900;
}

.folder-badge {
    color: #9b6d00;
    background: #fff4d3;
}

.empty-state {
    display: grid;
    min-height: 360px;
    place-items: center;
    align-content: center;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    text-align: center;
}

.empty-state h2 {
    margin: 22px 0 7px;
    font-size: 21px;
}

.empty-state p {
    max-width: 430px;
    color: var(--muted);
    line-height: 1.6;
}

.empty-illustration {
    position: relative;
    width: 116px;
}

.empty-folder-tab {
    width: 45px;
    height: 18px;
    margin-left: 6px;
    border-radius: 8px 8px 0 0;
    background: #c7b5ff;
}

.empty-folder-body {
    display: grid;
    height: 76px;
    place-items: center;
    border-radius: 8px 18px 18px 18px;
    color: #fff;
    background: linear-gradient(135deg, #9a78ff, #6d3df5);
    box-shadow: 0 14px 30px rgba(109, 61, 245, 0.22);
    font-size: 28px;
}

.trash-illustration {
    color: var(--primary);
    font-size: 70px;
}

.trash-note {
    display: grid;
    gap: 3px;
}

.trash-note strong {
    font-size: 14px;
}

.trash-note span,
.search-summary span {
    color: var(--muted);
    font-size: 12px;
}

/* Modal */
.modal {
    width: min(520px, calc(100% - 28px));
    padding: 0;
    border: 0;
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(21, 17, 39, 0.24);
}

.modal::backdrop {
    background: rgba(19, 17, 31, 0.46);
    backdrop-filter: blur(4px);
}

.modal form {
    padding: 24px;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.modal-header h2 {
    margin-bottom: 5px;
    font-size: 21px;
}

.modal-header p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.upload-picker {
    display: grid;
    min-height: 180px;
    place-items: center;
    align-content: center;
    gap: 6px;
    padding: 20px;
    border: 1.5px dashed #cfc5f5;
    border-radius: 15px;
    background: #faf9ff;
    cursor: pointer;
}

.upload-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.upload-picker-icon {
    display: grid;
    width: 50px;
    height: 50px;
    margin-bottom: 5px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: var(--primary);
    font-size: 24px;
}

.upload-picker small,
.selected-files {
    color: var(--muted);
    font-size: 12px;
}

.selected-files {
    max-height: 100px;
    margin-top: 12px;
    overflow: auto;
    line-height: 1.7;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.settings-card-header {
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
}

.settings-card-header h2 {
    margin-bottom: 5px;
    font-size: 18px;
}

.settings-card-header p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.settings-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

.settings-form {
    display: grid;
    gap: 16px;
}

.security-list {
    display: grid;
    gap: 12px;
}

.security-list > div {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 12px;
    border-radius: 12px;
    background: #f8f9fb;
}

.security-list > div > span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: var(--success);
    background: var(--success-soft);
    font-weight: 900;
}

.security-list strong {
    font-size: 13px;
}

.security-list small {
    color: var(--muted);
    font-size: 10px;
}

.mobile-header,
.sidebar-backdrop {
    display: none;
}

@media (max-width: 1180px) {
    .folder-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .app-layout {
        display: block;
    }

    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 15;
        display: flex;
        min-height: 64px;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(14px);
    }

    .mobile-brand {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 9px;
    }

    .mobile-brand strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 14px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(315px, 88vw);
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }

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

    .sidebar-close {
        display: inline-grid;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 19;
        background: rgba(20, 17, 35, 0.38);
    }

    .sidebar.is-open + .sidebar-backdrop {
        display: block;
    }

    .topbar {
        min-height: auto;
        padding: 22px;
    }

    .content {
        padding: 22px;
    }

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

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        grid-template-columns: 1fr;
    }

    .login-visual {
        display: none;
    }
}

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

    .setup-card,
    .login-card {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .setup-card {
        padding: 28px 20px;
    }

    .login-form-panel {
        padding: 30px 22px;
    }

    .login-heading {
        margin-top: 60px;
    }

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

    .field-full {
        grid-column: auto;
    }

    .topbar {
        display: grid;
        gap: 16px;
        padding: 18px 16px;
    }

    .search-form {
        width: 100%;
    }

    .content {
        padding: 18px 16px 34px;
    }

    .drive-toolbar,
    .search-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .toolbar-actions {
        width: 100%;
    }

    .toolbar-actions .button {
        flex: 1;
    }

    .drop-zone {
        padding: 16px;
    }

    .folder-grid {
        grid-template-columns: 1fr;
    }

    .file-table-wrap {
        margin-right: -16px;
        border-right: 0;
        border-radius: 14px 0 0 14px;
    }

    .security-list > div {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .security-list small {
        grid-column: 2;
    }
}
