:root {
  color-scheme: dark;
  --bg: #101010;
  --bg-elevated: #171717;
  --panel: rgba(34, 34, 34, 0.86);
  --panel-solid: #222;
  --panel-soft: rgba(255, 255, 255, 0.07);
  --panel-hover: rgba(255, 255, 255, 0.105);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f8fafc;
  --muted: #a7adb7;
  --accent: #2dd4bf;
  --accent-2: #5b9dff;
  --danger: #e18989;
  --radius: 20px;
  --shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 16px 34px rgba(0, 0, 0, 0.18);
  --focus-ring: 0 0 0 3px rgba(91, 157, 255, 0.34);
  --navbar-height: 76px;
  --storage-sidebar-width: 236px;
}

body.light-theme {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg-elevated: #ffffff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --panel-soft: rgba(15, 23, 42, 0.055);
  --panel-hover: rgba(15, 23, 42, 0.085);
  --line: rgba(15, 23, 42, 0.13);
  --line-strong: rgba(15, 23, 42, 0.22);
  --text: #0f172a;
  --muted: #4b5563;
  --shadow-soft: 0 18px 48px rgba(42, 64, 94, 0.13);
  --shadow-card: 0 16px 34px rgba(42, 64, 94, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% -10%, rgba(45, 212, 191, 0.12), transparent 30%),
    radial-gradient(circle at 86% 4%, rgba(91, 157, 255, 0.14), transparent 34%),
    linear-gradient(180deg, #151515 0%, var(--bg) 46%, #0d0d0d 100%);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  text-rendering: geometricPrecision;
}

body.light-theme {
  background:
    radial-gradient(circle at 18% -10%, rgba(45, 212, 191, 0.16), transparent 30%),
    radial-gradient(circle at 86% 4%, rgba(91, 157, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 52%, #eef2f7 100%);
}

.svg-filters {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button,
select,
label,
.file-row,
.category-item {
  -webkit-tap-highlight-color: transparent;
}

button,
.category-item,
.file-row,
.avatar-button,
.plain-action,
.avatar-upload {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.file-row:focus-visible,
.category-item:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

.hidden {
  display: none !important;
}

.storage-shell {
  width: 100%;
  height: calc(100vh - var(--navbar-height));
  min-height: calc(100vh - var(--navbar-height));
  margin: 0;
  padding: 0;
  display: grid;
  background: transparent;
}

.storage-shell:has(.login-panel:not(.hidden)) {
  min-height: calc(100vh - var(--navbar-height));
  place-items: center;
}

.connect-panel,
.login-panel,
.file-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.storage-navbar {
  position: relative;
  z-index: 70;
  min-height: var(--navbar-height);
  border-bottom: 1px solid var(--line);
  background: rgba(27, 27, 27, 0.86);
  backdrop-filter: blur(18px) saturate(1.08);
  display: grid;
  grid-template-columns: var(--storage-sidebar-width) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.light-theme .storage-navbar {
  background: rgba(255, 255, 255, 0.88);
}

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

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(45, 212, 191, 0.12);
}

.brand strong {
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.server-state {
  max-width: 280px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-state.online {
  color: var(--text);
}

.topbar-actions {
  position: relative;
  z-index: 72;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  width: min(340px, 34vw);
  height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.42);
  color: var(--muted);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

body.light-theme .search-box {
  background: rgba(255, 255, 255, 0.74);
}

.search-box span {
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box:focus-within {
  border-color: rgba(91, 157, 255, 0.58);
  background: rgba(16, 16, 16, 0.72);
  box-shadow: var(--focus-ring);
}

body.light-theme .search-box:focus-within {
  background: rgba(255, 255, 255, 0.96);
}

.file-size-control {
  height: 42px;
  display: grid;
  grid-template-columns: repeat(3, 34px);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.42);
}

.file-size-control button {
  width: 34px;
  height: 32px;
  padding: 0;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.file-size-control button:hover,
.file-size-control button.active {
  background: var(--panel-soft);
  color: var(--text);
}

body.light-theme .file-size-control {
  background: rgba(255, 255, 255, 0.74);
}

.navbar-language {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.42);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.navbar-language select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

body.light-theme .navbar-language {
  background: rgba(255, 255, 255, 0.74);
}

.user-menu {
  position: relative;
  z-index: 90;
}

.avatar-button {
  width: 44px;
  height: 44px;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.avatar-button:hover {
  border-color: rgba(45, 212, 191, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.avatar-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 120;
  width: 230px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(31, 31, 31, 0.96);
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
}

body.light-theme .user-dropdown {
  border-color: var(--line);
  background: #ffffff;
}

.dropdown-email {
  overflow: hidden;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown button {
  width: 100%;
  height: 38px;
  justify-content: start;
  margin-top: 6px;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  pointer-events: auto;
}

.user-dropdown button:hover {
  background: var(--panel-hover);
}

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

.logout-button {
  height: 40px;
  padding: 0 16px;
  border-color: rgba(255, 255, 255, 0.12);
  background: #282828;
  color: var(--muted);
}

.logout-button:hover {
  border-color: rgba(225, 137, 137, 0.45);
  color: var(--danger);
}

.storage-area {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--storage-sidebar-width) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.storage-sidebar {
  min-height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(23, 23, 23, 0.74);
  backdrop-filter: blur(18px) saturate(1.05);
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px 14px;
  scrollbar-width: thin;
  scrollbar-color: #646464 #1b1b1b;
}

body.light-theme .storage-sidebar {
  background: rgba(255, 255, 255, 0.72);
}

body.light-theme .login-panel input,
body.light-theme .register-panel input {
  background: #f8f8f8;
}

.quota-card,
.file-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.quota-card {
  display: grid;
  gap: 12px;
  padding: 16px 14px;
  border-color: var(--line);
  background:
    radial-gradient(circle at top right, rgba(91, 157, 255, 0.16), transparent 42%),
    rgba(34, 34, 34, 0.82);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px) saturate(1.1);
}

body.light-theme .quota-card {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(246, 249, 252, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 16px 34px rgba(42, 64, 94, 0.12);
}

.quota-label {
  color: var(--muted);
  font-size: 13px;
}

.quota-lines {
  display: grid;
  gap: 10px;
}

.quota-lines > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.quota-lines span,
.quota-percent {
  color: var(--muted);
  font-size: 12px;
}

.quota-lines strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
}

.quota-meter,
.quota-card {
  width: 100%;
}

.quota-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

body.light-theme .quota-track {
  background: #e3eaf2;
}

.quota-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease;
}

.quota-fill.warning {
  background: linear-gradient(90deg, #e6bd63, var(--danger));
}

.quota-percent {
  text-align: right;
}

.category-list {
  display: grid;
  gap: 6px;
  padding-top: 4px;
}

.category-item {
  width: 100%;
  height: 44px;
  justify-content: start;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  border-radius: 20px;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.custom-category {
  position: relative;
  grid-template-columns: 28px minmax(0, 1fr) 24px;
}

.category-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-category {
  width: 24px;
  height: 24px;
  border-radius: 20px;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  opacity: 0.72;
}

.delete-category:hover {
  background: rgba(225, 137, 137, 0.12);
  color: var(--danger);
}

.folder-hidden-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.folder-hidden-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.locked-category .category-name::after {
  content: " · locked";
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

html[lang="zh-CN"] .locked-category .category-name::after {
  content: " · 已隐藏";
}

.category-item:hover,
.category-item.active {
  border-color: var(--line);
  background: var(--panel-hover);
  color: var(--text);
}

.category-item.active .category-icon {
  color: var(--accent);
}

body.light-theme .category-item {
  border-color: transparent;
  background: transparent;
}

body.light-theme .category-item:hover,
body.light-theme .category-item.active {
  border-color: var(--line);
  background: var(--panel-hover);
}

.category-divider {
  height: 1px;
  margin: 8px 4px;
  background: var(--line);
}

#customCategoryList {
  display: grid;
  gap: 6px;
}

#shareCategoryList {
  display: grid;
  gap: 6px;
}

.sidebar-section-title {
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-empty {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.share-category {
  grid-template-columns: 28px minmax(0, 1fr) 24px 24px;
}

.share-setting {
  width: 24px;
  height: 24px;
  border-radius: 20px;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  opacity: 0.78;
}

.share-setting:hover {
  background: rgba(88, 145, 239, 0.14);
  color: var(--accent-2);
}

.share-setting-name {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.add-category {
  border-style: dashed;
  border-color: var(--line);
}

.add-category .category-icon {
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}

.category-icon {
  width: 28px;
  height: 28px;
  border-radius: 20px;
  background: transparent;
  color: var(--accent-2);
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

body.light-theme .category-icon {
  background: transparent;
  color: #4f8ee8;
  box-shadow: none;
}

body.light-theme .category-item.active .category-icon,
body.light-theme .add-category .category-icon {
  background: transparent;
  color: #18aa8c;
}

.folder-icon {
  width: 58px;
  height: 48px;
  display: block;
}

.storage-main {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 28px 28px 128px;
  scrollbar-width: thin;
  scrollbar-color: #747474 #1b1b1b;
}

.storage-main::-webkit-scrollbar,
.storage-sidebar::-webkit-scrollbar {
  width: 10px;
}

.storage-main::-webkit-scrollbar-thumb,
.storage-sidebar::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  background-clip: content-box;
}

.connect-panel,
.login-panel {
  padding: 16px;
}

.login-panel {
  display: grid;
  width: min(520px, calc(100vw - 36px));
  min-height: 700px;
  align-content: start;
  gap: 20px;
  padding-top: 54px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.08);
}

.register-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.register-overlay.hidden {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.register-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.38);
  backdrop-filter: blur(12px) saturate(1.18);
  transition: opacity 180ms ease;
}

.register-panel {
  position: relative;
  width: min(430px, calc(100vw - 36px));
  min-height: 560px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(34, 34, 34, 0.62);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(24px) saturate(1.28) contrast(1.04);
  padding: 42px 16px 16px;
  display: grid;
  align-content: start;
  gap: 18px;
  opacity: 1;
  transform: scale(1);
  transition: opacity 200ms ease, transform 200ms ease;
}

.register-overlay.hidden .register-backdrop {
  opacity: 0;
}

.register-overlay.hidden .register-panel {
  opacity: 0;
  transform: scale(0.96) translateY(8px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.modal-overlay.hidden {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.38);
  backdrop-filter: blur(12px) saturate(1.18);
}

.account-modal {
  position: relative;
  width: min(430px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(34, 34, 34, 0.92);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(1.1);
  padding: 28px;
  display: grid;
  gap: 18px;
  transform: translateY(0) scale(1);
  transition: transform 180ms ease;
}

.modal-overlay.hidden .account-modal {
  transform: translateY(10px) scale(0.96);
}

.account-modal h2 {
  margin: 0;
  font-size: 24px;
}

.account-modal label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.account-modal input,
.account-modal select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 12, 12, 0.42);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.account-modal input:focus,
.account-modal select:focus,
.login-panel input:focus,
.register-panel input:focus {
  border-color: rgba(91, 157, 255, 0.58);
  box-shadow: var(--focus-ring);
}

.account-modal select {
  appearance: none;
  cursor: pointer;
}

body.light-theme .account-modal input,
body.light-theme .account-modal select {
  background: #f8f8f8;
}

body.light-theme .register-backdrop,
body.light-theme .modal-backdrop {
  background: rgba(235, 240, 248, 0.34);
}

body.light-theme .register-panel,
body.light-theme .account-modal,
body.light-theme .media-modal {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 28px 90px rgba(42, 64, 94, 0.18);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
}

.profile-avatar-wrap {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.profile-avatar-wrap img {
  width: 128px;
  height: 128px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.avatar-upload {
  height: 38px;
  border: 1px solid rgba(36, 200, 164, 0.45);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06110f !important;
  cursor: pointer;
  display: inline-grid !important;
  place-items: center;
  padding: 0 14px;
  font-weight: 700;
}

.avatar-upload input {
  display: none;
}

.modal-message {
  color: var(--muted);
  font-size: 13px;
}

.modal-message {
  min-height: 20px;
  margin: 0;
}

.modal-message.error {
  color: var(--danger);
}

.media-modal {
  position: relative;
  width: min(920px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(24, 24, 24, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(1.1);
  padding: 22px;
  display: grid;
  gap: 16px;
}

.media-modal h2 {
  max-width: calc(100% - 46px);
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0b0b0b;
}

.upgrade-modal {
  width: min(920px, calc(100vw - 36px));
  gap: 20px;
}

.upgrade-heading {
  display: grid;
  gap: 8px;
  padding-right: 42px;
}

.upgrade-heading p,
.upgrade-heading span {
  margin: 0;
  color: var(--muted);
}

.upgrade-heading p {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.upgrade-heading h2 {
  margin: 0;
  font-size: 30px;
}

.upgrade-layout {
  display: grid;
  grid-template-columns: minmax(360px, 560px) minmax(260px, 340px);
  gap: 18px;
  align-items: stretch;
}

.upgrade-panel,
.upgrade-preview-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(31, 31, 31, 0.78);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.upgrade-panel {
  display: grid;
  gap: 20px;
}

.upgrade-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.segmented-control,
.capacity-grid {
  display: grid;
  gap: 10px;
}

.segmented-control {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.segmented-control button,
.capacity-grid button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.segmented-control button:hover,
.capacity-grid button:hover,
.segmented-control button.active,
.capacity-grid button.active {
  border-color: rgba(36, 200, 164, 0.45);
  background: rgba(36, 200, 164, 0.12);
  color: var(--text);
}

.upgrade-preview-card {
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 14px;
  background:
    radial-gradient(circle at top right, rgba(75, 141, 255, 0.18), transparent 38%),
    radial-gradient(circle at bottom left, rgba(36, 200, 164, 0.16), transparent 42%),
    #1f1f1f;
}

.upgrade-preview-card span,
.upgrade-preview-card small {
  color: var(--muted);
}

.upgrade-preview-card strong {
  font-size: 68px;
  line-height: 1;
}

.upgrade-preview-card p {
  margin: 0;
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.upgrade-preview-card small {
  line-height: 1.55;
}

.promo-redeem {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.12);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px;
  align-items: end;
}

.promo-redeem label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.promo-redeem input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(12, 12, 12, 0.42);
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

.promo-redeem .modal-message {
  grid-column: 1 / -1;
}

body.light-theme .promo-redeem {
  background: rgba(0, 0, 0, 0.035);
}

body.light-theme .promo-redeem input {
  background: #f8f8f8;
}

body.light-theme .upgrade-panel,
body.light-theme .upgrade-preview-card {
  background: #ffffff;
}

body.light-theme .upgrade-preview-card {
  background:
    radial-gradient(circle at top right, rgba(75, 141, 255, 0.14), transparent 38%),
    radial-gradient(circle at bottom left, rgba(36, 200, 164, 0.12), transparent 42%),
    #ffffff;
}

body.light-theme .segmented-control button,
body.light-theme .capacity-grid button {
  border-color: rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.035);
  color: var(--muted);
}

body.light-theme .segmented-control button:hover,
body.light-theme .capacity-grid button:hover,
body.light-theme .segmented-control button.active,
body.light-theme .capacity-grid button.active {
  border-color: rgba(22, 166, 139, 0.3);
  background: rgba(22, 166, 139, 0.08);
  color: var(--text);
}

.plan-column {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.featured-plan {
  border-color: rgba(44, 218, 184, 0.34);
  background: linear-gradient(180deg, rgba(44, 218, 184, 0.12), rgba(255, 255, 255, 0.045));
}

.plan-column h3 {
  margin: 0;
  font-size: 18px;
}

.plan-options {
  display: grid;
  gap: 8px;
}

.plan-option {
  min-height: 58px;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--text);
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
}

.plan-option:hover {
  border-color: rgba(44, 218, 184, 0.38);
  background: rgba(44, 218, 184, 0.1);
}

.plan-option strong {
  font-size: 17px;
}

.plan-option span {
  color: var(--muted);
  font-size: 12px;
}

body.light-theme .plan-column {
  background: rgba(0, 0, 0, 0.035);
}

body.light-theme .featured-plan {
  border-color: rgba(22, 166, 139, 0.26);
  background: linear-gradient(180deg, rgba(22, 166, 139, 0.12), rgba(0, 0, 0, 0.025));
}

body.light-theme .plan-option {
  border-color: rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
}

body.light-theme .plan-option:hover {
  border-color: rgba(22, 166, 139, 0.3);
  background: rgba(22, 166, 139, 0.08);
}

.media-preview img,
.media-preview video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
}

.media-preview video {
  width: 100%;
}

.register-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.register-panel input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #181818;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.register-logo {
  width: 112px;
  height: 112px;
  border-radius: 20px;
  object-fit: cover;
  justify-self: center;
  margin-bottom: 4px;
}

.login-logo {
  width: 140px;
  height: 140px;
  border-radius: 20px;
  object-fit: cover;
  justify-self: center;
  margin-bottom: 10px;
}

.login-panel h1 {
  margin: 0;
  font-size: 24px;
}

.login-panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.login-heading {
  width: 100%;
  justify-self: center;
  text-align: center;
}

.login-heading h1,
.login-heading p {
  text-align: center;
}

.login-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.login-panel input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 12, 12, 0.42);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.login-button {
  width: fit-content;
  min-width: 120px;
  justify-self: center;
}

.plain-action {
  width: fit-content;
  height: auto;
  border: 0;
  background: transparent;
  color: var(--accent);
  justify-self: center;
  padding: 0;
}

.plain-action:hover {
  text-decoration: underline;
}

.login-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.login-message.error {
  color: var(--danger);
}

.connect-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.connect-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.connect-panel input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #181818;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.path-strip {
  padding-bottom: 8px;
}

.path-strip h1 {
  margin: 0;
  font-size: 24px;
}

.path-strip p {
  margin: 6px 0 0;
  color: var(--muted);
}

.file-toolbar,
.selection-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
}

.file-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.file-toolbar select,
.file-toolbar button,
.selection-bar button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 12, 12, 0.34);
  color: var(--text);
  padding: 0 12px;
}

.file-toolbar select {
  min-width: 116px;
}

.selection-bar {
  justify-content: flex-start;
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.24);
}

.selection-bar strong {
  margin-right: auto;
}

body.light-theme .file-toolbar,
body.light-theme .selection-bar {
  background: rgba(255, 255, 255, 0.74);
}

body.light-theme .file-toolbar select,
body.light-theme .file-toolbar button,
body.light-theme .selection-bar button {
  background: rgba(255, 255, 255, 0.86);
}

button,
.dock-action,
.upload-menu button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  padding: 0 14px;
  display: inline-grid;
  place-items: center;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

button:hover,
.upload-menu button:hover {
  background: var(--panel-hover);
}

#connectButton,
.login-button {
  border-color: rgba(36, 200, 164, 0.45);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06110f;
  font-weight: 700;
}

#connectButton:hover,
.login-button:hover,
.avatar-upload:hover {
  border-color: rgba(45, 212, 191, 0.6);
  background: linear-gradient(135deg, #35ddc7, #67a6ff);
  color: #06110f;
  box-shadow: 0 12px 28px rgba(45, 212, 191, 0.18);
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 220px));
  gap: 26px 20px;
  align-items: start;
}

body[data-file-card-size="small"] .file-list {
  grid-template-columns: repeat(auto-fill, minmax(140px, 168px));
  gap: 18px 14px;
}

body[data-file-card-size="large"] .file-list {
  grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
  gap: 34px 28px;
}

.dock-bar {
  position: fixed;
  left: calc(50vw + (var(--storage-sidebar-width) / 2));
  bottom: 24px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, 92px);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(34, 34, 34, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.08);
  transform: translateX(-50%);
}

body.light-theme .dock-bar {
  border-color: var(--line);
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(42, 64, 94, 0.14);
}

.dock-action {
  height: 52px;
  border-color: transparent;
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.dock-action:hover {
  border-color: transparent;
  background: var(--panel-hover);
}

.dock-action span {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

body.light-theme .dock-action {
  border-color: transparent;
  background: transparent;
  color: #293443;
}

body.light-theme .dock-action:hover {
  border-color: transparent;
  background: rgba(0, 0, 0, 0.045);
}

body.light-theme .dock-action span {
  color: #18aa8c;
}

.upload-menu {
  position: absolute;
  left: 10px;
  bottom: calc(100% + 10px);
  display: grid;
  width: 154px;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(34, 34, 34, 0.96);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px) saturate(1.08);
}

.upload-menu button {
  width: 100%;
  height: 40px;
  justify-content: start;
  border-radius: 20px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(48, 48, 48, 0.76);
  color: var(--text);
  font-size: 13px;
  box-shadow: none;
}

.upload-menu button:hover {
  border-color: rgba(36, 200, 164, 0.36);
  background: rgba(54, 54, 54, 0.9);
}

.upload-queue {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 19;
  width: min(320px, calc(100vw - 48px));
  max-height: min(360px, calc(100vh - 140px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(34, 34, 34, 0.92);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.08);
  padding: 14px;
  transition: max-height 220ms ease, padding 220ms ease, transform 220ms ease;
}

.upload-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.upload-queue-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.upload-queue-toggle:hover {
  background: var(--panel-hover);
}

.upload-queue.collapsed {
  max-height: 58px;
  overflow: hidden;
}

.upload-queue.collapsed .upload-queue-head {
  margin-bottom: 0;
}

.upload-queue.collapsed #uploadQueueList {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
}

.upload-queue-head span,
.upload-task span {
  color: var(--muted);
  font-size: 12px;
}

#uploadQueueList {
  display: grid;
  gap: 10px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 220ms ease;
}

.upload-task {
  display: grid;
  gap: 8px;
}

.upload-task > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.upload-task strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.upload-task-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.upload-task-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.upload-task.failed .upload-task-track span {
  background: var(--danger);
}

.context-menu {
  position: fixed;
  z-index: 80;
  width: 180px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(31, 31, 31, 0.98);
  box-shadow: var(--shadow-soft);
}

.context-menu button {
  width: 100%;
  height: 36px;
  justify-content: start;
  border-color: transparent;
  background: transparent;
}

.context-menu button:hover {
  background: var(--panel-hover);
}

.generated-link input {
  user-select: all;
}

body.light-theme .upload-queue,
body.light-theme .context-menu {
  background: rgba(255, 255, 255, 0.96);
}

body.light-theme .upload-menu {
  border-color: var(--line);
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(42, 64, 94, 0.14);
}

body.light-theme .upload-menu button {
  border-color: #dce5ef;
  background: #f3f7fb;
  color: #293443;
}

body.light-theme .upload-menu button:hover {
  border-color: rgba(36, 200, 164, 0.28);
  background: #e9f5f5;
}

.file-row {
  position: relative;
  min-height: 246px;
  padding: 14px 12px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 168px auto auto;
  justify-items: center;
  align-items: start;
  gap: 8px;
  border-color: transparent;
  background: transparent;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.file-row.selected {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.08);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.18), var(--shadow-card);
}

.file-select {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.file-select input {
  position: absolute;
  opacity: 0;
}

.file-select span {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(12, 12, 12, 0.66);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.file-select input:checked + span {
  border-color: rgba(45, 212, 191, 0.74);
  background: radial-gradient(circle at center, var(--accent) 0 38%, rgba(12, 12, 12, 0.82) 42%);
}

body[data-file-card-size="small"] .file-row {
  min-height: 194px;
  grid-template-rows: 122px auto auto;
  padding: 10px 8px;
}

body[data-file-card-size="large"] .file-row {
  min-height: 320px;
  grid-template-rows: 224px auto auto;
  padding: 18px 14px;
  gap: 10px;
}

.file-row:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.file-thumb {
  width: 168px;
  height: 168px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(18, 18, 18, 0.78);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

body.light-theme .file-thumb {
  background: rgba(255, 255, 255, 0.84);
}

body[data-file-card-size="small"] .file-thumb {
  width: 122px;
  height: 122px;
}

body[data-file-card-size="large"] .file-thumb {
  width: 224px;
  height: 224px;
}

.image-thumb {
  object-fit: cover;
}

.image-thumb,
.video-thumb {
  transition: transform 220ms ease, filter 220ms ease;
}

.file-row:hover .image-thumb,
.file-row:hover .video-thumb {
  filter: saturate(1.04);
}

.video-thumb {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(36, 200, 164, 0.18), rgba(75, 141, 255, 0.18)),
    #202020;
  background-position: center;
  background-size: cover;
}

.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.34));
}

.video-play-mark {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  display: grid;
  place-items: center;
  padding-left: 3px;
  font-size: 20px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.video-thumb.has-cover {
  border-color: rgba(255, 255, 255, 0.12);
}

.folder-thumb {
  border: 0;
  background: transparent;
}

.folder-thumb .folder-icon {
  width: 156px;
  height: 126px;
}

.file-thumb-generic {
  background:
    radial-gradient(circle at top right, rgba(91, 157, 255, 0.16), transparent 42%),
    rgba(42, 42, 42, 0.9);
  font-weight: 700;
}

.file-row.uploading {
  border-color: rgba(36, 200, 164, 0.2);
  background: rgba(36, 36, 36, 0.72);
}

.file-row.uploading:hover {
  transform: none;
}

.file-row.upload-failed {
  border-color: rgba(225, 137, 137, 0.36);
}

.file-row.upload-failed .upload-progress {
  background:
    radial-gradient(circle at center, #202020 0 56%, transparent 57%),
    conic-gradient(var(--danger) 360deg, #3a3a3a 0deg);
}

.file-row.upload-failed .file-name span,
.file-row.upload-failed .upload-progress span {
  color: var(--danger);
}

.upload-thumb {
  background: #202020;
}

.upload-progress {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #202020 0 56%, transparent 57%),
    conic-gradient(var(--accent) var(--progress, 0deg), #3a3a3a 0deg);
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(36, 200, 164, 0.18);
}

.upload-progress span {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

body.light-theme .upload-progress {
  background:
    radial-gradient(circle at center, #f2f2f2 0 56%, transparent 57%),
    conic-gradient(var(--accent) var(--progress, 0deg), #d8d8d8 0deg);
}

.file-name {
  min-width: 0;
  width: 100%;
  text-align: center;
}

.file-name strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0;
}

.file-name span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.file-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.file-row:hover .file-actions {
  opacity: 1;
}

.file-actions button {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.08);
}

.file-actions button:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.1);
}

.danger {
  color: var(--danger);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 32px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.035);
}

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

@media (max-width: 720px) {
  :root {
    --navbar-height: 86px;
  }

  body {
    height: auto;
    min-height: 100svh;
    overflow: auto;
    overflow-x: hidden;
  }

  .storage-navbar {
    position: sticky;
    top: 0;
    z-index: 30;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 18px;
    min-height: auto;
  }

  .brand {
    gap: 12px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand strong {
    font-size: 25px;
  }

  .topbar-actions {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .server-state {
    display: none;
  }

  .file-size-control {
    justify-self: start;
  }

  .search-box {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    height: 44px;
  }

  .navbar-language {
    grid-column: 1 / -1;
    justify-self: end;
    width: auto;
    min-width: 128px;
  }

  .user-menu {
    grid-column: 2;
    justify-self: end;
    align-self: center;
  }

  .user-dropdown {
    left: auto;
    right: 0;
    width: min(240px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
  }

  .logout-button {
    width: 100%;
  }

  .storage-shell,
  .storage-shell:has(.login-panel:not(.hidden)) {
    height: auto;
    min-height: auto;
  }

  .storage-shell:has(.login-panel:not(.hidden)) {
    align-items: start;
    padding: 18px 0 34px;
  }

  .login-panel {
    width: calc(100vw - 28px);
    min-height: auto;
    margin: 0 auto;
    padding: 28px 16px 26px;
    gap: 16px;
  }

  .login-logo {
    width: 106px;
    height: 106px;
    margin-bottom: 14px;
  }

  .login-copy {
    margin-bottom: 4px;
  }

  .login-panel h1 {
    font-size: 24px;
  }

  .login-panel p {
    font-size: 14px;
    line-height: 1.45;
  }

  .login-panel input,
  .register-panel input,
  .account-modal input,
  .account-modal select {
    height: 46px;
  }

  .login-panel .primary-button {
    width: min(164px, 100%);
    height: 44px;
  }

  .storage-area {
    grid-template-columns: 1fr;
  }

  .storage-sidebar {
    min-height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px;
    gap: 12px;
  }

  .quota-card {
    padding: 18px;
    gap: 10px;
  }

  .quota-row strong {
    font-size: 22px;
  }

  .category-list {
    gap: 8px;
  }

  .category-item {
    height: 44px;
    padding: 0 14px;
  }

  .category-icon {
    width: 30px;
    height: 30px;
  }

  .category-separator {
    margin: 4px 0;
  }

  .storage-main {
    overflow: visible;
    padding: 20px 14px 132px;
  }

  .path-strip {
    padding-bottom: 12px;
  }

  .path-strip h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  .path-strip p {
    font-size: 14px;
    line-height: 1.45;
  }

  .file-toolbar,
  .selection-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .file-toolbar label,
  .file-toolbar select,
  .file-toolbar button,
  .selection-bar button {
    width: 100%;
  }

  .selection-bar strong {
    margin-right: 0;
  }

  .connect-panel,
  .file-row {
    grid-template-columns: 1fr;
  }

  .file-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
    justify-content: stretch;
  }

  body[data-file-card-size="small"] .file-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 8px;
  }

  body[data-file-card-size="large"] .file-list {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .file-row {
    min-height: auto;
    padding: 10px 8px;
    grid-template-rows: auto auto auto;
  }

  .file-actions {
    grid-column: auto;
    opacity: 1;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .file-thumb {
    width: min(40vw, 156px);
    height: min(40vw, 156px);
  }

  body[data-file-card-size="small"] .file-thumb {
    width: min(28vw, 108px);
    height: min(28vw, 108px);
  }

  body[data-file-card-size="large"] .file-thumb {
    width: min(78vw, 280px);
    height: min(78vw, 280px);
  }

  .folder-thumb .folder-icon {
    width: 88%;
    height: 74%;
  }

  body[data-file-card-size="small"] .folder-thumb .folder-icon {
    width: 86%;
    height: 70%;
  }

  .file-name strong {
    font-size: 13px;
  }

  body[data-file-card-size="small"] .file-name strong {
    font-size: 12px;
  }

  body[data-file-card-size="large"] .file-name strong {
    font-size: 16px;
  }

  .file-name span {
    font-size: 10px;
  }

  body[data-file-card-size="large"] .file-name span {
    font-size: 12px;
  }

  .dock-bar {
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    grid-template-columns: repeat(2, minmax(92px, 1fr));
    width: min(258px, calc(100vw - 28px));
    padding: 10px;
  }

  .upload-queue {
    left: 14px;
    right: 14px;
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 88px);
    width: auto;
    max-height: 220px;
  }

  .context-menu {
    width: min(220px, calc(100vw - 28px));
  }

  .dock-action {
    min-height: 52px;
    border-radius: 18px;
  }

  .upload-menu {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(250px, calc(100vw - 28px));
  }

  .upgrade-modal {
    max-height: calc(100svh - 28px);
    overflow: auto;
  }

  .upgrade-layout,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .upgrade-preview-card {
    min-height: 260px;
  }

  .upgrade-preview-card strong {
    font-size: 54px;
  }

  .promo-redeem {
    grid-template-columns: 1fr;
  }

  .modal-overlay,
  .register-overlay {
    padding: 14px;
    align-items: center;
  }

  .account-modal,
  .register-panel,
  .media-modal {
    width: calc(100vw - 28px);
    max-height: calc(100svh - 28px);
    overflow: auto;
    padding: 22px 16px;
  }

  .media-body {
    min-height: 220px;
  }

  .media-body img,
  .media-body video {
    max-height: 62svh;
  }

  .empty {
    padding: 24px 16px;
  }
}

@media (max-width: 480px) {
  .storage-navbar {
    padding: 14px 14px 12px;
  }

  .brand strong {
    font-size: 24px;
  }

  .topbar-actions {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .file-size-control {
    grid-column: 1;
  }

  .user-menu {
    grid-column: 3;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .navbar-language {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .storage-sidebar {
    padding: 14px;
  }

  .storage-main {
    padding-inline: 14px;
  }

  .file-row {
    padding-inline: 6px;
  }

  .account-modal h2,
  .register-panel h2 {
    font-size: 22px;
  }
}
