*,
*::before,
*::after { box-sizing: border-box; }

:root {
  color-scheme: light;
  --bg: #edf5fc;
  --surface: #fff;
  --surface-2: #f6fbff;
  --text: #0f1f33;
  --muted: #5b6b7f;
  --line: #dce8f3;
  --line-strong: #c6d9ea;
  --accent: #0284c7;
  --accent-600: #0369a1;
  --accent-soft: #e0f2fe;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 46, 77, 0.04), 0 2px 8px rgba(15, 46, 77, 0.05);
  --shadow-md: 0 18px 34px -22px rgba(15, 46, 77, 0.32);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 520px at 100% -10%, #dff4ff 0%, transparent 58%),
    radial-gradient(900px 480px at 8% 105%, #e4edff 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
body.booting .login-view { visibility: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font-family: inherit; }

.icon { width: 20px; height: 20px; flex: none; }

/* Login */
.login-view {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 560px at 18% -8%, #cffafe 0%, transparent 58%),
    radial-gradient(800px 480px at 92% 108%, #dbeafe 0%, transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 390px; background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 28px; padding: 34px;
  box-shadow: 0 34px 70px -34px rgba(9, 48, 82, 0.4);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(140deg, #22d3ee, #0284c7);
  color: #fff; display: grid; place-items: center; flex: none;
  box-shadow: 0 12px 22px -12px rgba(2, 132, 199, 0.85);
}
.brand-mark svg { width: 23px; height: 23px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-text { font-size: 12px; color: var(--muted); margin-top: 1px; }
.login-card h1 { font-size: 26px; letter-spacing: -0.025em; margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 16px; }
.login-submit { width: 100%; justify-content: center; padding: 11px 16px; margin-top: 6px; }

/* Fields / buttons */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: #374151; }
.hint { color: var(--muted); font-weight: 400; }
.field input, .field textarea, .field select, .search input, .sort-select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--text); font: inherit; font-size: 14px; padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 74px; }
.field input:focus, .field textarea:focus, .field select:focus, .search input:focus, .sort-select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input::placeholder, .field textarea::placeholder, .search input::placeholder { color: #9ca3af; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; cursor: pointer; }
.check-line input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-error { background: var(--danger-soft); border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 14px;
  font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff; box-shadow: 0 10px 20px -12px rgba(2, 132, 199, .85); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, #0284c7, #0369a1); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-strong); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover:not(:disabled) { background: #b91c1c; }
.btn.small { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn .icon { width: 17px; height: 17px; }
.btn > svg { width: 17px; height: 17px; flex: none; }
.icon-btn {
  width: 36px; height: 36px; border: 1px solid transparent; background: transparent;
  color: var(--muted); border-radius: 9px; display: inline-grid; place-items: center;
  cursor: pointer; transition: background-color .15s, color .15s; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.light { color: #7189a0; }
.icon-btn.light:hover { background: #eaf5fd; color: #0369a1; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* App shell */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 12px auto 12px 12px; width: 250px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(215, 232, 245, 0.95);
  border-radius: 24px;
  color: #0f1f33; display: flex; flex-direction: column; padding: 16px 12px 12px;
  z-index: 60; overflow: hidden;
  box-shadow: 0 24px 50px -34px rgba(9, 48, 82, 0.4);
  backdrop-filter: blur(16px);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 11px; background: none; border: 0;
  color: inherit; padding: 5px 7px 16px; cursor: pointer; text-align: left; width: 100%;
}
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.nav { flex: none; }
.admin-section { flex: none; margin-top: 18px; }
.nav-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase;
  color: #8fa8bf; padding: 0 10px; margin-bottom: 7px;
}
.nav-label-spaced { margin-top: 18px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 12px; background: transparent; color: #47647c;
  font-size: 13.5px; font-weight: 650; cursor: pointer; text-align: left;
  transition: background-color .15s, color .15s;
}
.nav-item .icon { width: 19px; height: 19px; opacity: 1; }
.nav-item:hover { background: #f0f9ff; color: #0f1f33; }
.nav-item.active { background: linear-gradient(135deg, #e0f2fe, #e8f7ff); color: #0369a1; }

.storage-widget { margin-top: auto; padding: 14px 8px 12px; border-top: 1px solid #e3edf6; }
.storage-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #7890a7; margin-bottom: 7px; }
.storage-bar { height: 6px; border-radius: 99px; background: #e4eef7; overflow: hidden; }
.storage-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #22d3ee, #0284c7); transition: width .25s; }
.storage-hint { margin-top: 6px; font-size: 10.5px; color: #8fa8bf; }

.userbox {
  display: flex; align-items: center; gap: 8px; padding: 12px 4px 0;
  border-top: 1px solid #e3edf6;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(140deg, #67e8f9, #0284c7);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none;
  border: 0; padding: 0; cursor: pointer; overflow: hidden; position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.has-photo { background: var(--surface-2); }
.avatar-wrap { position: relative; flex: none; }
.avatar-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 95; min-width: 236px;
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 46px -20px rgba(15, 23, 42, .45);
}
.avatar-menu[hidden] { display: none; }
.avatar-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 8px; background: none; color: var(--text);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.avatar-menu button:hover { background: var(--surface-2); }
.avatar-menu button.danger { color: var(--danger); }
.avatar-menu svg { width: 17px; height: 17px; flex: none; }
.avatar-menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }

.avatar-crop { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0; }
.avatar-crop-stage {
  width: min(280px, 72vw); aspect-ratio: 1; position: relative; overflow: hidden;
  border-radius: 50%; background: #0f172a; cursor: grab; touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.avatar-crop-stage.dragging { cursor: grabbing; }
.avatar-crop-stage img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; pointer-events: none; }
.avatar-crop-zoom { display: flex; align-items: center; gap: 10px; width: min(280px, 72vw); font-size: 12px; color: var(--muted); }
.avatar-crop-zoom input { flex: 1; accent-color: var(--accent); }
.avatar-cloud-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; padding: 2px; }
.avatar-cloud-item {
  aspect-ratio: 1; width: 100%; border-radius: 50%; overflow: hidden; padding: 0;
  border: 2px solid transparent; background: var(--surface-2); cursor: pointer;
}
.avatar-cloud-item:hover { border-color: var(--accent); }
.avatar-cloud-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 700; color: #10263c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-sub { font-size: 11px; color: #8fa8bf; }
.userbox .icon-btn { width: 30px; height: 30px; }
.userbox .icon-btn .icon { width: 17px; height: 17px; }
.topbar-userbox { padding: 0; border-top: 0; gap: 6px; flex: none; margin-left: 2px; }
.topbar-userbox .user-meta { max-width: 150px; }
.topbar-userbox .user-name { font-size: 12.5px; }
.topbar-userbox .user-sub { font-size: 10.5px; }

.main { margin-left: 274px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  min-height: 62px; padding: 10px 28px; background: rgba(237,245,252,.82);
  backdrop-filter: blur(14px); border-bottom: 1px solid rgba(210,229,243,.75);
}
.menu-btn { display: none; }
.topbar-spacer { flex: 1; }
.sync-note { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.crumbs { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 13.5px; color: var(--muted); flex-wrap: nowrap; overflow: hidden; }
.crumb { color: var(--muted); text-decoration: none; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; border: 0; background: none; cursor: pointer; font: inherit; }
.crumb:hover { background: rgba(17,24,39,.05); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 600; }
.crumb.sep { color: #c0c5d0; cursor: default; }
.crumb.drop-target { background: var(--accent-soft); color: var(--accent); }

.content { padding: 24px 26px 70px; width: 100%; max-width: 1500px; margin: 0 auto; flex: 1; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; letter-spacing: -.025em; line-height: 1.15; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.title-wrap { display: flex; align-items: center; gap: 13px; min-width: 0; }
.page-mark {
  width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #e0f2fe, #f0faff); color: #0284c7; border: 1px solid #c9e9fa;
}
.page-mark .icon { width: 25px; height: 25px; }
.head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 1 auto; flex-wrap: wrap; max-width: 100%; }
.head-actions > .btn { flex: 0 0 auto; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search { position: relative; flex: 1; max-width: 440px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #9ca3af; pointer-events: none; }
.search input { padding-left: 36px; }
.sort-select {
  width: auto; min-width: 150px; cursor: pointer; padding-right: 32px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.view-toggle button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.view-toggle button:hover { background: var(--surface-2); color: var(--text); }
.view-toggle button.active { background: var(--accent-soft); color: var(--accent); }
.view-toggle .icon { width: 17px; height: 17px; }
.bulk-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 9px 12px;
  border: 1px solid #bae6fd; background: #e0f2fe; border-radius: 12px; color: #075985;
  font-size: 13px; flex-wrap: wrap;
  box-shadow: 0 8px 20px -16px rgba(15, 23, 42, .25);
}
.bulk-bar strong { margin-right: 4px; }
.bulk-bar .btn { margin-left: auto; }
.bulk-bar .btn + .btn { margin-left: 0; }
.bulk-bar-entering {
  overflow: hidden;
  animation: bulk-bar-in .22s cubic-bezier(.2, .8, .2, 1);
}
.bulk-bar-closing {
  overflow: hidden; pointer-events: none;
  animation: bulk-bar-out .18s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes bulk-bar-in {
  0% { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; transform: translateY(6px); }
  100% { opacity: 1; max-height: 160px; padding-top: 9px; padding-bottom: 9px; transform: none; }
}
@keyframes bulk-bar-out {
  0% { opacity: 1; max-height: 160px; padding-top: 9px; padding-bottom: 9px; transform: none; }
  100% { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; transform: translateY(6px); }
}

/* File grids */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
#file-area { min-height: 42vh; }
.selection-layer {
  position: fixed; inset: 0; z-index: 20; overflow: hidden; pointer-events: none;
}
.selection-marquee {
  position: absolute; z-index: 1; pointer-events: none;
  border: 1px solid var(--accent); border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
body.selection-active { user-select: none; }
.file-grid.list-view { grid-template-columns: 1fr; gap: 8px; }
.file-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s, background-color .15s;
}
.file-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.file-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent), var(--shadow-sm);
}
.file-card.selected .file-name { color: var(--accent-600); }
.file-card.drop-target { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.file-thumb {
  position: relative; height: 124px; display: grid; place-items: center; overflow: hidden;
  border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-2);
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-type-icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, #2563eb) 11%, #fff);
  color: color-mix(in srgb, var(--c, #2563eb) 55%, #111827);
  border: 1px solid color-mix(in srgb, var(--c, #2563eb) 20%, #fff);
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
}
.folder-icon { color: #f59e0b; }
.folder-icon .icon { width: 58px; height: 58px; fill: #fef3c7; }
.file-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.file-name { font-size: 13.5px; font-weight: 650; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.file-meta { color: var(--muted); font-size: 11.5px; display: flex; flex-wrap: wrap; gap: 3px 8px; }
.file-path { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-check {
  position: absolute; top: 8px; left: 8px; z-index: 3; width: 24px; height: 24px;
  border-radius: 6px; border: 1.5px solid #cbd5e1; background: #fff; accent-color: var(--accent);
  cursor: pointer; padding: 0; appearance: none; -webkit-appearance: none;
  display: grid; place-items: center;
  transition: background-color .15s, border-color .15s;
}
.file-check::after {
  content: ''; width: 11px; height: 6px; margin-top: -2px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0); transition: transform .12s;
}
.file-check:hover { border-color: #94a3b8; }
.file-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-check:checked { background: var(--accent); border-color: var(--accent); }
.file-check:checked::after { transform: rotate(-45deg) scale(1); }
.file-card.selected .file-check { border-color: var(--accent); }
.file-more {
  position: absolute; top: 7px; right: 7px; z-index: 3; width: 30px; height: 30px;
  border: 0; border-radius: 8px; background: rgba(255,255,255,.92); color: #4b5563;
  display: grid; place-items: center; cursor: pointer; opacity: 0; transform: scale(.94);
  transition: opacity .15s, transform .15s, background-color .15s;
  box-shadow: 0 2px 8px rgba(15,23,42,.13);
}
.file-card:hover .file-more, .file-card:focus-within .file-more { opacity: 1; transform: none; }
.file-more:hover { background: #f1f5f9; }
.file-more .icon { width: 16px; height: 16px; }
.file-open { position: absolute; inset: 0; z-index: 1; border: 0; background: transparent; border-radius: inherit; cursor: pointer; }
.file-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

.file-grid.list-view .file-card { flex-direction: row; align-items: center; }
.file-grid.list-view .file-thumb { width: 64px; height: 64px; aspect-ratio: auto; border: 0; border-radius: 0; background: transparent; margin-left: 42px; flex: none; }
.file-grid.list-view .file-thumb:has(img) { width: 42px; height: 42px; margin-left: 48px; }
.file-grid.list-view .file-thumb img { border-radius: 7px; }
.file-grid.list-view .file-type-icon { width: 46px; height: 46px; border-radius: 10px; font-size: 9.5px; }
.file-grid.list-view .folder-icon .icon { width: 42px; height: 42px; }
.file-grid.list-view .file-body { padding: 11px 14px; flex: 1; }
.file-grid.list-view .file-check { top: 50%; left: 12px; transform: translateY(-50%); }
.file-grid.list-view .file-more { right: 10px; top: 50%; transform: translateY(-50%); }
.file-grid.list-view .audio-card-play-row {
  position: relative; inset: auto; right: auto; bottom: auto;
  width: 32px; height: 32px; flex: none; align-self: center; margin: 0 14px 0 4px;
}
.file-grid.list-view .file-card.has-more .audio-card-play-row { margin-right: 52px; }
.file-grid.list-view .audio-card-play-row .icon { width: 14px; height: 14px; }

/* Empty / loading */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 54px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty.compact { padding: 36px 18px; }
.empty-icon { width: 62px; height: 62px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.empty-icon .icon { width: 30px; height: 30px; }
.empty h2 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 13.5px; max-width: 440px; margin-bottom: 16px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 14px; }
.skeleton { height: 210px; border-radius: var(--radius); background: linear-gradient(100deg,#eceef4 20%,#f6f7fa 40%,#eceef4 60%); background-size: 220% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* Drop overlay / uploads */
.drop-overlay { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: rgba(15,23,42,.45); backdrop-filter: blur(3px); }
.drop-overlay.show { display: grid; }
.drop-card { background: #fff; border-radius: 20px; padding: 32px 38px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 30px 80px -24px rgba(15,23,42,.5); }
.drop-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.drop-card strong { font-size: 18px; }
.drop-card span { color: var(--muted); font-size: 13px; }
.upload-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 80; width: min(380px, calc(100vw - 28px));
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 46px -20px rgba(15,23,42,.45); overflow: hidden;
}
.upload-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 700; }
.upload-list { max-height: 340px; overflow-y: auto; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 9px; }
.upload-item { display: flex; flex-direction: column; gap: 4px; }
.upload-line { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.upload-line strong { color: var(--text); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress { height: 5px; border-radius: 99px; background: #e8edf5; overflow: hidden; }
.upload-progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .15s; }
.upload-item.done .upload-progress span { background: #10b981; }
.upload-item.error .upload-progress span { background: var(--danger); }
.upload-item .upload-actions { display: flex; gap: 6px; }
.upload-item .upload-actions button { border: 0; background: none; color: var(--accent); font-size: 11px; cursor: pointer; padding: 0; }
.upload-section { display: flex; flex-direction: column; gap: 9px; }
.upload-section + .upload-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.upload-section-title { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.upload-meta { font-size: 11px; color: var(--muted); }
.upload-item.pending .upload-actions { margin-top: 2px; }
.upload-item.pending .upload-actions button[data-upload-delete] { color: var(--danger); }
.upload-item.pending .upload-actions button:disabled { opacity: .5; cursor: default; }

/* Audio player */
.audio-player {
  position: fixed; left: 274px; right: 0; bottom: 0; z-index: 55;
  padding: 0 18px 14px; pointer-events: none;
}
.audio-player-inner {
  pointer-events: auto; max-width: 1500px; margin: 0 auto;
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: 0 26px 54px -20px rgba(9, 48, 82, .45);
  backdrop-filter: blur(18px); overflow: hidden;
  transform-origin: bottom center;
  animation: audio-player-rise .42s cubic-bezier(.2, .75, .25, 1);
}
@keyframes audio-player-rise {
  from { opacity: 0; transform: translateY(26px) scale(.975); }
  to { opacity: 1; transform: none; }
}
.audio-player.audio-player-closing .audio-player-inner {
  animation: audio-player-fall .3s cubic-bezier(.4, 0, .2, 1) forwards;
  pointer-events: none;
}
@keyframes audio-player-fall {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(30px) scale(.975); }
}
.audio-player.buffering .audio-cover { animation: audio-pulse 1.2s ease-in-out infinite; }
@keyframes audio-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.audio-progress-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px 0;
  color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums;
}
.audio-progress-row > span { min-width: 34px; text-align: center; }
.audio-seek, .audio-volume {
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; margin: 0;
}
.audio-seek { flex: 1; height: 16px; min-width: 60px; }
.audio-seek::-webkit-slider-runnable-track {
  height: 5px; border-radius: 99px;
  background: linear-gradient(to right, var(--accent) var(--progress, 0%), var(--line-strong) var(--progress, 0%));
}
.audio-seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4px;
  border-radius: 50%; background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .25);
}
.audio-seek::-moz-range-track { height: 5px; border-radius: 99px; background: var(--line-strong); }
.audio-seek::-moz-range-progress { height: 5px; border-radius: 99px; background: var(--accent); }
.audio-seek::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
.audio-main {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 13px; padding: 6px 16px 12px;
}
.audio-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.audio-cover {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #fff; padding: 0; border: 0; cursor: pointer;
  background-image: var(--audio-cover, none), linear-gradient(140deg, #f9a8d4, #db2777);
  background-size: cover, auto; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 6px 14px -10px rgba(15, 23, 42, .45);
  transition: transform .15s, box-shadow .15s;
}
.audio-cover:hover { transform: scale(1.04); }
.audio-cover .icon { width: 23px; height: 23px; transition: opacity .15s; }
.audio-player.has-cover .audio-cover .icon { opacity: 0; }
.audio-track { min-width: 0; flex: 1; }
.audio-title { font-size: 13.5px; font-weight: 750; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-artist { margin-top: 1px; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-controls { display: flex; align-items: center; gap: 2px; flex: none; justify-self: center; }
.audio-icon-btn {
  width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); display: grid; place-items: center; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.audio-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.audio-icon-btn.active { color: var(--accent); background: var(--accent-soft); }
.audio-icon-btn .icon { width: 17px; height: 17px; }
.audio-play {
  width: 42px; height: 42px; margin: 0 3px; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 10px 20px -10px rgba(2, 132, 199, .9);
  transition: transform .15s;
}
.audio-play:hover { transform: scale(1.05); }
.audio-play .icon { width: 19px; height: 19px; }
.audio-extra { display: flex; align-items: center; gap: 4px; flex: none; justify-self: end; }
@media (max-width: 1080px) {
  .audio-extra .audio-volume { display: none; }
}
.audio-volume { width: 86px; height: 16px; }
.audio-volume::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right, var(--accent) var(--progress, 100%), var(--line-strong) var(--progress, 100%));
}
.audio-volume::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; margin-top: -3.5px;
  border-radius: 50%; background: #fff; border: 2.5px solid var(--accent);
}
.audio-volume::-moz-range-track { height: 4px; border-radius: 99px; background: var(--line-strong); }
.audio-volume::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--accent); }
.audio-volume::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2.5px solid var(--accent); }
.audio-close { color: var(--muted); }
.audio-queue { border-top: 1px solid var(--line); max-height: min(42vh, 340px); overflow-y: auto; padding: 4px 8px 9px; }
.audio-queue:not([hidden]) { animation: audio-queue-in .38s cubic-bezier(.2, .8, .2, 1); transform-origin: bottom center; }
@keyframes audio-queue-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.audio-queue-head {
  display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px 6px;
  color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
}
.audio-queue-list { display: flex; flex-direction: column; gap: 1px; }
.audio-queue-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px;
  border: 0; border-radius: 9px; background: none; color: var(--text);
  text-align: left; cursor: pointer;
}
.audio-queue-row:hover { background: var(--surface-2); }
.audio-queue-row.current { background: var(--accent-soft); color: var(--accent); }
.audio-queue-index {
  width: 26px; flex: none; display: grid; place-items: center;
  color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums;
}
.audio-queue-row.current .audio-queue-index { color: var(--accent); }
.audio-queue-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.audio-queue-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-queue-row.current .audio-queue-name { font-weight: 700; }
.audio-queue-artist { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.audio-bars i { width: 2.5px; height: 4px; border-radius: 2px; background: currentColor; animation: audio-bar .9s ease-in-out infinite; }
.audio-bars i:nth-child(2) { animation-delay: .15s; }
.audio-bars i:nth-child(3) { animation-delay: .3s; }
@keyframes audio-bar { 0%, 100% { height: 4px; } 50% { height: 12px; } }
.audio-player.audio-player-expanded { z-index: 140; }
@property --c1 {
  syntax: '<color>';
  inherits: true;
  initial-value: #2563eb;
}
@property --c2 {
  syntax: '<color>';
  inherits: true;
  initial-value: #7c3aed;
}
@property --c3 {
  syntax: '<color>';
  inherits: true;
  initial-value: #db2777;
}
.audio-expanded {
  position: fixed; inset: 0; z-index: 140; overflow: hidden;
  color: #fff; background: #070b14; pointer-events: auto;
  animation: audio-expand-in .28s cubic-bezier(.2, .7, .2, 1);
  transition: --c1 1.1s ease, --c2 1.1s ease, --c3 1.1s ease;
}
.audio-expanded.audio-expanded-closing {
  animation: audio-collapse-out .3s cubic-bezier(.4, 0, .2, 1) forwards;
  pointer-events: none;
}
@keyframes audio-expand-in {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes audio-collapse-out {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.955) translateY(20px); }
}
.audio-expanded-bg {
  position: absolute; inset: -30%;
  background:
    radial-gradient(circle at 20% 20%, var(--c1, #2563eb), transparent 55%),
    radial-gradient(circle at 80% 30%, var(--c2, #7c3aed), transparent 55%),
    radial-gradient(circle at 50% 90%, var(--c3, #db2777), transparent 60%),
    linear-gradient(140deg, var(--c1, #1d4ed8), var(--c3, #db2777));
  filter: blur(65px) saturate(1.25);
  animation: audio-aurora 26s ease-in-out infinite alternate;
}
.audio-expanded-blob {
  position: absolute; width: 58vmax; height: 58vmax; border-radius: 50%;
  filter: blur(70px); opacity: .62; mix-blend-mode: screen;
  animation: audio-blob 19s ease-in-out infinite alternate;
}
.audio-expanded-blob.b1 { background: var(--c1, #2563eb); left: -15%; top: -20%; }
.audio-expanded-blob.b2 { background: var(--c2, #7c3aed); right: -18%; top: 2%; animation-delay: -6s; }
.audio-expanded-blob.b3 { background: var(--c3, #db2777); left: 18%; bottom: -32%; animation-delay: -12s; }
@keyframes audio-aurora {
  0% { transform: scale(1.08) translate3d(-1%, -1%, 0) rotate(0deg); }
  50% { transform: scale(1.18) translate3d(2%, 2%, 0) rotate(3deg); }
  100% { transform: scale(1.1) translate3d(-2%, 3%, 0) rotate(-3deg); }
}
@keyframes audio-blob {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6%, 8%, 0) scale(1.18); }
  100% { transform: translate3d(-7%, 4%, 0) scale(.95); }
}
.audio-expanded-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4, 8, 15, .24), rgba(4, 8, 15, .5) 52%, rgba(4, 8, 15, .84));
}
.audio-expanded-content {
  position: relative; z-index: 2; height: 100%; max-width: 1180px; margin: 0 auto;
  padding: 20px clamp(18px, 4vw, 46px) 26px;
  display: flex; flex-direction: column; overflow-y: auto;
}
.audio-expanded-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; }
.audio-expanded-label { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; opacity: .66; }
.audio-expanded-head .audio-icon-btn { color: rgba(255, 255, 255, .78); }
.audio-expanded-head .audio-icon-btn:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.audio-expanded-body {
  flex: 1; display: grid; grid-template-columns: minmax(260px, 400px) minmax(0, 1fr);
  align-items: center; gap: clamp(26px, 5vw, 72px);
  padding: clamp(12px, 3vh, 34px) 0; min-height: 0;
}
.audio-expanded-art { min-width: 0; position: relative; }
.audio-expanded-art::before {
  content: ''; position: absolute; inset: 12% 6% 4% 6%; z-index: 0;
  border-radius: 34px;
  background: linear-gradient(135deg, var(--c1, #2563eb), var(--c3, #db2777));
  filter: blur(52px); opacity: .38;
  transform: translateY(12px) scale(.96);
}
.audio-expanded-cover {
  position: relative; z-index: 1;
  aspect-ratio: 1; width: 100%; max-height: 56vh; border-radius: 26px;
  display: grid; place-items: center; overflow: hidden;
  background-image: var(--audio-cover, none), linear-gradient(140deg, var(--c1, #2563eb), var(--c2, #7c3aed));
  background-size: cover, auto; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 24px 54px -30px rgba(0, 0, 0, .55);
}
.audio-expanded-cover-icon { display: grid; place-items: center; opacity: .8; transition: opacity .2s; }
.audio-expanded-cover-icon .icon { width: clamp(68px, 11vw, 128px); height: clamp(68px, 11vw, 128px); }
.audio-player.has-cover .audio-expanded-cover-icon { opacity: 0; }
.audio-expanded-info { min-width: 0; transform: translateY(-8px); }
.audio-expanded-title {
  font-size: clamp(27px, 3.5vw, 48px); font-weight: 800; line-height: 1.34; letter-spacing: -.03em;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.audio-expanded-artist { margin-top: 12px; font-size: clamp(15px, 1.6vw, 20px); font-weight: 600; opacity: .88; }
.audio-expanded-album { margin-top: 4px; min-height: 1.2em; font-size: 13px; opacity: .6; }
.audio-big-progress { margin-top: clamp(24px, 4vh, 46px); }
.audio-big-progress .audio-seek { width: 100%; }
.audio-big-times { display: flex; justify-content: space-between; gap: 10px; margin-top: 1px; font-size: 11px; opacity: .62; font-variant-numeric: tabular-nums; }
.audio-big-controls { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.8vw, 20px); margin-top: 12px; }
.audio-big-controls .audio-icon-btn { width: 48px; height: 48px; color: rgba(255, 255, 255, .75); }
.audio-big-controls .audio-icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.audio-big-controls .audio-icon-btn.active { background: rgba(255, 255, 255, .17); color: #fff; }
.audio-big-controls .audio-icon-btn .icon { width: 21px; height: 21px; }
.audio-big-play {
  width: 68px; height: 68px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #0b1020; background: #fff;
  box-shadow: 0 16px 38px -14px rgba(0, 0, 0, .7);
  transition: transform .15s;
}
.audio-big-play:hover { transform: scale(1.05); }
.audio-big-play .icon { width: 27px; height: 27px; }
.audio-big-extra { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.audio-big-extra .audio-icon-btn { color: rgba(255, 255, 255, .72); }
.audio-big-extra .audio-icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.audio-big-extra .audio-icon-btn.active { background: rgba(255, 255, 255, .17); color: #fff; }
.audio-big-extra .audio-volume { width: 150px; }
.audio-expanded-queue {
  margin-top: 14px; max-height: 24vh;
  background: rgba(5, 9, 16, .38); border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 14px; color: #fff;
}
.audio-expanded-queue .audio-queue-head { color: rgba(255, 255, 255, .62); }
.audio-expanded-queue .audio-queue-row:hover { background: rgba(255, 255, 255, .09); }
.audio-expanded-queue .audio-queue-row.current { background: rgba(255, 255, 255, .16); color: #fff; }
.audio-expanded-queue .audio-queue-index,
.audio-expanded-queue .audio-queue-artist { color: rgba(255, 255, 255, .55); }
.audio-expanded-queue .audio-queue-row.current .audio-queue-index { color: #fff; }
body.audio-expanded-open { overflow: hidden; }
.audio-thumb { background: linear-gradient(150deg, #fce7f3, #fff7fb); }
.audio-cover-img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.audio-cover-img[hidden] { display: none; }
.music-count { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.music-search { flex: 1 1 220px; max-width: 330px; }
.music-folder-select { min-width: 220px; max-width: 360px; }
.music-mode-toggle {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; flex: none;
}
.music-mode-toggle button {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 650; cursor: pointer;
}
.music-mode-toggle button:hover { background: var(--surface-2); color: var(--text); }
.music-mode-toggle button.active { background: var(--accent-soft); color: var(--accent); }
.music-mode-toggle .icon { width: 16px; height: 16px; }
.music-album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; }
.music-album-card {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
  padding: 0; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer;
}
.music-album-cover {
  position: relative; width: 100%; aspect-ratio: 1; overflow: hidden;
  display: grid; place-items: center; border-radius: 16px;
  background: linear-gradient(145deg, #fce7f3, #e0f2fe);
  box-shadow: 0 8px 22px -16px rgba(15, 23, 42, .6);
  transition: transform .18s, box-shadow .18s;
}
.music-album-card:hover .music-album-cover { transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgba(15, 23, 42, .5); }
.music-album-cover-icon { display: grid; place-items: center; color: rgba(15, 23, 42, .28); }
.music-album-cover-icon .icon { width: 46px; height: 46px; }
.music-album-cover-img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.music-album-cover-img[hidden] { display: none; }
.music-album-name { margin-top: 8px; font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-album-artist { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-album-meta { color: var(--muted); font-size: 11px; }
.music-album-hero {
  display: flex; align-items: center; gap: clamp(18px, 3vw, 34px);
  margin: 6px 0 26px; padding: 18px; border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
}
.music-album-hero-cover {
  position: relative; width: clamp(130px, 18vw, 210px); aspect-ratio: 1; flex: none;
  border-radius: 18px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(145deg, #fce7f3, #e0f2fe);
  box-shadow: 0 18px 34px -24px rgba(15, 23, 42, .55);
}
.music-album-hero-icon { display: grid; place-items: center; }
.music-album-hero-icon .icon { width: 48px; height: 48px; color: rgba(15, 23, 42, .25); }
.music-album-hero-info { min-width: 0; }
.music-album-kicker { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.music-album-hero-info h2 { margin: 4px 0 6px; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.025em; overflow-wrap: anywhere; }
.music-album-hero-info p { margin-bottom: 14px; color: var(--muted); font-size: 13px; }
[data-theme="dark"] .music-mode-toggle { background: var(--surface); }
[data-theme="dark"] .music-album-cover,
[data-theme="dark"] .music-album-hero-cover { background: linear-gradient(145deg, #2a1524, #13243a); }
[data-theme="dark"] .music-album-cover-icon,
[data-theme="dark"] .music-album-hero-icon { color: rgba(255, 255, 255, .3); }
.photos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 58px; gap: 16px; align-items: start; }
.photos-content { min-width: 0; }
.photos-scrubber {
  position: sticky; top: 86px; height: calc(100vh - 128px);
  display: flex; justify-content: center; padding: 8px 0;
}
.photos-scrubber-track {
  position: relative; width: 30px; height: 100%;
  cursor: pointer; touch-action: none;
}
.photos-scrubber-track::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px;
  transform: translateX(-50%); border-radius: 99px; background: var(--line-strong);
}
.photos-scrubber-tick {
  position: absolute; left: 50%; width: 7px; height: 3px;
  transform: translate(-50%, -50%); border-radius: 99px; background: var(--line-strong);
  transition: width .15s, background-color .15s;
}
.photos-scrubber-tick.active { width: 13px; background: var(--accent); }
.photos-scrubber-thumb {
  position: absolute; left: 50%; z-index: 3; width: 14px; height: 26px;
  transform: translate(-50%, -50%); border-radius: 8px;
  background: var(--surface); border: 2px solid var(--accent);
  box-shadow: 0 4px 10px -3px rgba(15, 23, 42, .45);
}
.photos-scrubber-active-label {
  position: absolute; right: 26px; z-index: 2; transform: translateY(-50%);
  padding: 2px 6px; border-radius: 5px; background: var(--surface);
  color: var(--muted); font-size: 10.5px; font-weight: 700; white-space: nowrap;
  pointer-events: none;
}
.photos-scrubber-bubble {
  position: absolute; right: 28px; z-index: 5; transform: translateY(-50%);
  display: flex; align-items: center; gap: 8px; min-width: 132px;
  padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); box-shadow: 0 12px 26px -14px rgba(15, 23, 42, .5);
  pointer-events: none;
}
.photos-scrubber-bubble img {
  width: 38px; height: 38px; object-fit: cover; border-radius: 7px; flex: none;
}
.photos-scrubber-bubble strong { display: block; font-size: 12px; color: var(--text); }
.photos-scrubber-bubble small { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; }
.photo-month { scroll-margin-top: 82px; margin-bottom: 28px; }
.photo-month-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.photo-month-head h2 { font-size: 17px; letter-spacing: -.015em; }
.photo-month-head span { color: var(--muted); font-size: 11.5px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.photo-card {
  position: relative; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0;
  border-radius: 11px; background: var(--surface-2); cursor: pointer;
}
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photo-card:hover img { transform: scale(1.035); }
.photo-remove {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(10, 16, 26, .68); cursor: pointer;
}
.photo-remove .icon { width: 13px; height: 13px; }
.photo-album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; }
.photo-album-card {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
  padding: 0; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer;
}
.photo-album-cover {
  position: relative; width: 100%; aspect-ratio: 1; overflow: hidden;
  display: grid; place-items: center; border-radius: 16px;
  background: linear-gradient(145deg, #e0f2fe, #fce7f3);
  box-shadow: 0 8px 22px -16px rgba(15, 23, 42, .6);
  transition: transform .18s, box-shadow .18s;
}
.photo-album-card:hover .photo-album-cover { transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgba(15, 23, 42, .5); }
.photo-album-cover img,
.photo-album-hero-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-album-fallback { display: grid; place-items: center; color: rgba(15, 23, 42, .25); }
.photo-album-fallback .icon { width: 44px; height: 44px; }
.photo-album-name { margin-top: 8px; font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-album-meta { color: var(--muted); font-size: 11px; }
.photo-album-hero {
  display: flex; align-items: center; gap: clamp(18px, 3vw, 30px);
  margin: 6px 0 24px; padding: 18px; border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
}
.photo-album-hero-cover {
  position: relative; width: clamp(130px, 17vw, 200px); aspect-ratio: 1; flex: none;
  border-radius: 18px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(145deg, #e0f2fe, #fce7f3);
  box-shadow: 0 18px 34px -24px rgba(15, 23, 42, .55);
}
.photo-album-hero-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.photo-album-kicker { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.photo-album-detail-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin: 4px 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.photo-album-detail-head h2 { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.025em; overflow-wrap: anywhere; }
.photo-album-detail-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.photo-album-hero-info h2 { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.025em; overflow-wrap: anywhere; }
.photo-album-hero-info p { color: var(--muted); font-size: 13px; }
.photo-picker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.photo-picker-head > span:first-child { font-size: 13px; font-weight: 700; }
.photo-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 7px;
  max-height: 52vh; overflow-y: auto; padding: 2px;
}
.photo-pick {
  position: relative; aspect-ratio: 1; overflow: hidden; padding: 0;
  border: 2px solid transparent; border-radius: 10px; background: var(--surface-2); cursor: pointer;
}
.photo-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-pick.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.photo-pick-check {
  position: absolute; top: 5px; right: 5px; width: 21px; height: 21px;
  border-radius: 50%; display: grid; place-items: center;
  background: rgba(15, 23, 42, .55); color: #fff; opacity: 0;
}
.photo-pick-check .icon { width: 13px; height: 13px; }
.photo-pick.selected .photo-pick-check { opacity: 1; background: var(--accent); }
[data-theme="dark"] .photo-album-cover,
[data-theme="dark"] .photo-album-hero-cover { background: linear-gradient(145deg, #13243a, #2a1524); }
[data-theme="dark"] .photo-album-fallback { color: rgba(255, 255, 255, .3); }
@media (max-width: 960px) {
  .photos-layout { grid-template-columns: 1fr; gap: 12px; }
  .photos-scrubber {
    position: fixed; right: 4px; top: 50%; height: 46vh; z-index: 20;
    transform: translateY(-50%); padding: 0;
  }
  .photos-scrubber-active-label { right: 24px; font-size: 10px; }
  .photos-scrubber-bubble { right: 26px; min-width: 118px; padding: 5px 8px 5px 5px; }
  .photos-scrubber-bubble img { width: 32px; height: 32px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
  .photo-album-hero { flex-direction: column; align-items: flex-start; padding: 14px; gap: 12px; }
  .photo-album-hero-cover { width: min(58vw, 210px); }
}

.audio-card-play {
  position: absolute; right: 9px; bottom: 9px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(15, 23, 42, .68); color: #fff;
  box-shadow: 0 6px 14px -6px rgba(15, 23, 42, .55);
  transition: background-color .15s, transform .15s;
}
.audio-card-play .icon { width: 16px; height: 16px; }
.file-card:hover .audio-card-play { transform: scale(1.07); }
.file-card.audio-current .audio-card-play { background: #db2777; }
.audio-seek-tip {
  position: fixed; z-index: 170; transform: translate(-50%, -100%);
  padding: 5px 9px; border-radius: 7px;
  background: rgba(8, 16, 29, .94); color: #fff;
  font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .6);
}
.audio-seek-tip::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: rgba(8, 16, 29, .94); border-bottom: 0;
}
.file-card.audio-current .audio-thumb { box-shadow: inset 0 0 0 2px rgba(219, 39, 119, .45); }
body.has-audio-player .content { padding-bottom: 150px; }
body.has-audio-player .upload-panel { bottom: 120px; }
body.has-audio-player .toast-root { bottom: 120px; }

/* Context menu */
.context-menu {
  position: fixed; z-index: 95; min-width: 210px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 6px; box-shadow: 0 20px 44px -20px rgba(15,23,42,.4);
  animation: context-menu-in .15s cubic-bezier(.2, .8, .2, 1);
  transform-origin: top left;
}
.context-menu.context-menu-closing {
  animation: context-menu-out .13s ease forwards;
  pointer-events: none;
}
@keyframes context-menu-in {
  from { opacity: 0; transform: translateY(-5px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes context-menu-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-4px) scale(.98); }
}
.context-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.context-menu button:hover { background: var(--surface-2); }
.context-menu button.danger { color: var(--danger); }
.context-menu .menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.context-menu .icon { width: 16px; height: 16px; color: var(--muted); }
.context-menu button.danger .icon { color: var(--danger); }

/* Modals */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px 24px; background: rgba(15,23,42,.48); backdrop-filter: blur(3px); overflow-y: auto; animation: modal-overlay-in .2s ease; }
.modal { width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: 0 32px 80px -24px rgba(15,23,42,.55); overflow: hidden; animation: modal-window-in .26s cubic-bezier(.2, .8, .2, 1); transform-origin: 50% 55%; }
.modal-overlay.modal-closing { animation: modal-overlay-out .19s ease forwards; }
.modal-overlay.modal-closing .modal { animation: modal-window-out .19s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes modal-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-overlay-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-window-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes modal-window-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(12px) scale(.975); }
}
.modal.wide { max-width: 680px; }
.modal.preview { max-width: 980px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-head h2 { font-size: 18px; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 16px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-form { display: contents; }
.modal-error { margin: 0 20px 10px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row strong { text-align: right; overflow-wrap: anywhere; }
.folder-select { display: flex; flex-direction: column; gap: 6px; }
.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1; font-size: 12px; }
.preview-stage { min-height: 200px; display: flex; flex-direction: column; gap: 10px; }
.preview-stage img { max-width: 100%; max-height: 65vh; object-fit: contain; border-radius: 10px; margin: 0 auto; display: block; }
.preview-image-shell { position: relative; }
.preview-image-box {
  height: 65vh;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: #0b1424;
  cursor: zoom-in;
  touch-action: none;
}
.preview-image-box.zoomed { cursor: grab; }
.preview-image-box.dragging { cursor: grabbing; }
.preview-image-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transform-origin: center;
  transition: transform 0.06s linear;
  user-select: none;
  -webkit-user-drag: none;
}
.preview-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  padding: 0 0 3px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(11, 20, 36, 0.62);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
  transition: opacity 0.18s, background-color 0.15s, transform 0.15s;
}
.preview-image-shell:hover .preview-nav,
.preview-image-shell.nav-visible .preview-nav { opacity: 1; pointer-events: auto; }
.preview-nav:hover { background: rgba(11, 20, 36, 0.88); transform: scale(1.04); }
.preview-nav.prev { left: 12px; }
.preview-nav.next { right: 12px; }
.preview-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 9px;
  border-radius: 99px;
  background: rgba(11, 20, 36, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.preview-stage video { width: 100%; max-height: 66vh; border-radius: 10px; background: #000; }
.preview-stage audio { width: 100%; }
.preview-stage iframe { width: 100%; height: 65vh; border: 1px solid var(--line); border-radius: 10px; }
.preview-text { margin: 0; max-height: 60vh; overflow: auto; padding: 14px; border-radius: 10px; background: #0f172a; color: #e2e8f0; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-note { color: var(--muted); font-size: 12px; text-align: center; }
.preview-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Shares / stats */
.share-list, .audit-list { display: flex; flex-direction: column; gap: 9px; }
.share-row, .audit-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.share-row .share-copy, .audit-row .share-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.share-row strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row small { color: var(--muted); font-size: 11.5px; }
.share-kind { flex: none; display: grid; place-items: center; }
.share-kind .file-type-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 9.5px; }
.share-kind.folder-kind { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: #f59e0b; }
.share-kind.folder-kind .icon { width: 24px; height: 24px; fill: #fef3c7; }
.share-path { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-actions { display: flex; gap: 6px; flex: none; }
.status-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 700; }
.status-pill.active { background: #ecfdf5; color: #047857; }
.status-pill.off { background: #f3f4f6; color: #6b7280; }
.status-pill.warn { background: #fff7ed; color: #c2410c; }
.status-pill.view-only { padding: 7px 14px; font-size: 13px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.share-head .btn { flex: none; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; }
.stat-card span { color: var(--muted); font-size: 11.5px; }
.stat-card strong { font-size: 22px; letter-spacing: -.02em; }
.stat-card small { color: var(--muted); font-size: 11px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.panel-head h2 { font-size: 14px; }
.panel-body { padding: 14px 16px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { text-align: left; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; }
.type-bars { display: flex; flex-direction: column; gap: 7px; }
.type-bar { display: grid; grid-template-columns: 95px 1fr 90px; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.type-bar .bar { height: 7px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.type-bar .bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid #dbeafe; background: #eff6ff; border-radius: 11px; color: #1e3a8a; font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; }
.notice .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* Toasts */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 9px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; max-width: 380px; padding: 10px 14px; border-radius: 11px; background: #111827; color: #f9fafb; font-size: 13px; box-shadow: 0 18px 36px -18px rgba(15,23,42,.6); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
.toast .icon { width: 17px; height: 17px; }
.toast.success .icon { color: #34d399; }
.toast.error .icon { color: #f87171; }

/* Share public page */
.share-page { min-height: 100vh; padding: 28px 16px; background: radial-gradient(1000px 600px at 20% 0%, #dbeafe 0%, transparent 60%), var(--bg); }
.share-shell { max-width: 920px; margin: 0 auto; }
.share-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; color: var(--text); }
.share-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
.share-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px -32px rgba(15,23,42,.35); overflow: hidden; }
.share-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.share-head h1 { font-size: 19px; overflow-wrap: anywhere; }
.share-head small { color: var(--muted); font-size: 12px; }
.share-content { padding: 18px 22px 22px; }
.share-preview img, .share-preview video { max-width: 100%; max-height: 65vh; display: block; margin: 0 auto; border-radius: 10px; }
.share-preview video { width: 100%; background: #000; }
.share-preview audio { width: 100%; }
.share-preview iframe { width: 100%; height: 65vh; border: 1px solid var(--line); border-radius: 10px; }
.share-preview pre { max-height: 60vh; overflow: auto; margin: 0; padding: 14px; border-radius: 10px; background: #0f172a; color: #e2e8f0; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.share-footer { display: flex; gap: 9px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.share-meta { color: var(--muted); font-size: 12px; margin-right: auto; }
.share-password { max-width: 360px; margin: 24px auto; padding: 22px; }
.share-password h2 { font-size: 17px; margin-bottom: 5px; }
.share-password p { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.share-password .field { margin-bottom: 12px; }
.share-message { padding: 30px 16px; text-align: center; color: var(--muted); }
.share-message strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 5px; }
.share-error { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px 30px; }
.share-error-art { width: min(200px, 60vw); height: auto; color: var(--muted); }
.share-error-art img, .share-error-art svg { width: 100%; height: auto; display: block; }
.share-error strong { margin-bottom: 0; font-size: 20px; }
.preview-unavailable { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.preview-unavailable-art { width: min(190px, 55vw); height: auto; display: block; }
.preview-unavailable strong { margin-bottom: 0; }

/* Folder shares */
.share-folder-bar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 10px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.share-crumb {
  border: 0; background: none; color: var(--accent); font: inherit; font-size: 12.5px;
  padding: 3px 7px; border-radius: 6px; cursor: pointer; max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share-crumb:hover { background: var(--accent-soft); }
.share-crumb.current { color: var(--text); font-weight: 650; cursor: default; }
.share-crumb-sep { color: var(--muted); font-size: 12px; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.share-item {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.share-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.share-item.folder-item { padding: 11px 12px 12px; border: 1px solid var(--line); cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.share-item.folder-item:hover { border-color: var(--accent); }
.share-item-main {
  display: flex; flex-direction: column; gap: 5px; width: 100%; border: 0;
  background: none; padding: 10px 12px 12px; cursor: pointer; text-align: left; color: inherit; font: inherit;
}
.share-item-thumb {
  display: grid; place-items: center; height: 92px; margin-bottom: 3px;
  border-radius: 8px; background: var(--surface-2); overflow: hidden;
}
.share-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.share-item.video-item .share-item-thumb { position: relative; }
.share-item.video-item .share-item-thumb::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 0; height: 0; border-left: 13px solid rgba(255, 255, 255, .96);
  border-top: 8px solid transparent; border-bottom: 8px solid transparent;
  filter: drop-shadow(0 1px 4px rgba(15, 23, 42, .6));
}
.folder-thumb { background: var(--accent-soft); color: #f59e0b; height: 70px; margin: 0 0 7px; }
.folder-thumb .share-icon { width: 42px; height: 42px; fill: #fef3c7; }
.share-item-ext { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; color: var(--muted); }
.share-item-name { font-size: 12.8px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.share-item-meta { color: var(--muted); font-size: 11px; }
.share-item-download {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 7px;
  background: rgba(255, 255, 255, 0.92); color: #334155;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}
.share-item-download:hover { color: var(--accent); }
.share-item-download svg { width: 15px; height: 15px; }
[data-theme="dark"] .share-item-download { background: rgba(14, 27, 44, 0.94); color: var(--muted); }
[data-theme="dark"] .share-item-download:hover { color: var(--accent); }
[data-theme="dark"] .folder-thumb { background: #2a2210; }
[data-theme="dark"] .share-crumb.current { color: var(--text); }


/* Calendar */
.calendar-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 14px; align-items: start; }
.calendar-side { display: flex; flex-direction: column; gap: 5px; padding: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); position: sticky; top: 12px; }
.calendar-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.calendar-side-head h2 { font-size: 14px; }
.calendar-filter-row { display: flex; align-items: center; gap: 2px; }
.calendar-filter { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 12.8px; text-align: left; cursor: pointer; }
.calendar-filter:hover { background: var(--surface-2); }
.calendar-filter.active { background: var(--accent-soft); color: var(--accent-600); font-weight: 650; }
.calendar-filter span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.calendar-dot.all { background: conic-gradient(#0ea5e9, #8b5cf6, #ec4899, #f59e0b, #0ea5e9); }
.calendar-edit { width: 28px; height: 28px; opacity: .55; }
.calendar-edit:hover { opacity: 1; }
.caldav-card { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2); }
.caldav-card strong { font-size: 12px; }
.caldav-card code { color: var(--accent-600); font-size: 11px; overflow-wrap: anywhere; }
.caldav-card small { color: var(--muted); font-size: 11px; }
.caldav-card p { color: var(--muted); font-size: 10.5px; }
.calendar-main { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.calendar-nav { display: flex; align-items: center; gap: 5px; }
.calendar-nav h2 { margin-left: 5px; font-size: 16px; text-transform: capitalize; }
.calendar-actions { display: flex; align-items: center; gap: 8px; }
.calendar-view-toggle { flex: none; }
.calendar-view-toggle button {
  width: auto; min-width: 64px; padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.calendar-weekdays span { padding: 8px 6px; color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: .04em; text-align: center; text-transform: uppercase; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(96px, auto); }
.calendar-day { min-width: 0; padding: 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:hover { background: var(--surface-2); }
.calendar-day.other-month { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); color: var(--muted); }
.calendar-day.today { background: var(--accent-soft); }
.calendar-day-head { display: flex; justify-content: flex-end; padding: 1px 2px 4px; color: var(--muted); font-size: 11.5px; font-weight: 750; }
.calendar-day.today .calendar-day-head span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; }
.calendar-day-events { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.calendar-chip { display: flex; align-items: baseline; gap: 4px; width: 100%; padding: 3px 5px; overflow: hidden; border: 0; border-left: 3px solid var(--c); border-radius: 5px; background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: var(--text); font: inherit; font-size: 10.5px; text-align: left; cursor: pointer; }
.calendar-chip:hover { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.calendar-chip-time { flex: none; color: var(--muted); font-size: 9.5px; }
.calendar-chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-more { padding-left: 4px; color: var(--muted); font-size: 10px; }
.calendar-list { display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.calendar-list-day h3 { margin-bottom: 5px; color: var(--muted); font-size: 12.5px; text-transform: capitalize; }
.calendar-list-event { display: flex; gap: 9px; width: 100%; margin-bottom: 5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.calendar-list-event:hover { border-color: var(--accent); }
.calendar-list-bar { width: 4px; flex: none; border-radius: 3px; }
.calendar-list-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.calendar-list-main strong { font-size: 13px; }
.calendar-list-main small { color: var(--muted); font-size: 11px; }
.calendar-empty { margin: 24px; }
[data-theme="dark"] .calendar-side,
[data-theme="dark"] .calendar-main { background: var(--surface); }
[data-theme="dark"] .calendar-day.other-month { background: #152235; }

/* Notes */
.notes-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
.notes-side { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); position: sticky; top: 12px; }
.notes-side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 3px 6px; }
.notes-side-head h2 { font-size: 14px; }
.notes-side-head span { color: var(--muted); font-size: 11.5px; }
.notes-list { display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow: auto; }
.notes-list-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 9px; border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.notes-list-item:hover { background: var(--surface-2); }
.notes-list-item.active { background: var(--accent-soft); }
.notes-list-item strong { overflow: hidden; font-size: 12.8px; text-overflow: ellipsis; white-space: nowrap; }
.notes-list-item span { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 11px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notes-list-item small { color: var(--muted); font-size: 10px; }
.notes-main { min-height: 400px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.note-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.note-title-input { flex: 1; min-width: 180px; padding: 4px 2px; border: 0; border-bottom: 1px solid transparent; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 19px; font-weight: 700; }
.note-title-input:focus { border-bottom-color: var(--accent); }
.note-editor-actions { display: flex; gap: 6px; flex: none; }
.note-toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 5px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface-2); }
.note-toolbar button { min-width: 28px; height: 28px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.note-toolbar button:hover { background: var(--surface); color: var(--text); }
.note-toolbar-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--line); }
.note-editor { min-height: 320px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 0 0 10px 10px; background: var(--surface); color: var(--text); font-size: 14px; line-height: 1.6; outline: none; overflow-wrap: anywhere; }
.note-editor:focus { border-color: var(--accent); }
.note-editor h1, .note-editor h2, .note-editor h3, .note-editor h4 { margin: 8px 0 5px; }
.note-editor p { margin: 0 0 8px; }
.note-editor ul, .note-editor ol { margin: 6px 0; padding-left: 24px; }
.note-editor blockquote { margin: 8px 0; padding: 5px 10px; border-left: 3px solid var(--accent); color: var(--muted); }
.note-editor pre { padding: 9px 11px; overflow: auto; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.note-editor a { color: var(--accent); }
.note-attach-block { margin-top: 14px; }
.note-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.note-section-head strong { font-size: 12.5px; }
.note-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.note-chip { display: inline-flex; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.note-chip.disabled { opacity: .55; }
.note-chip-main { display: inline-flex; align-items: center; gap: 5px; max-width: 260px; padding: 5px 7px; border: 0; background: none; color: var(--text); font: inherit; font-size: 11.5px; cursor: pointer; }
.note-chip-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-chip-main small { color: var(--muted); font-size: 10px; }
.note-chip-main .icon { width: 15px; height: 15px; }
.note-chip-remove { width: 25px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.note-chip-remove:hover { background: var(--danger-soft); color: var(--danger); }
.note-empty-line { color: var(--muted); font-size: 11.5px; padding: 3px 0; }
.picker-crumbs { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.picker-crumb { padding: 3px 6px; border: 0; border-radius: 6px; background: none; color: var(--accent); font: inherit; font-size: 11.5px; cursor: pointer; }
.picker-crumb:hover { background: var(--accent-soft); }
.picker-crumb.current { color: var(--text); font-weight: 650; }
.picker-crumbs span { color: var(--muted); font-size: 11px; }
.picker-list { display: flex; flex-direction: column; gap: 3px; max-height: 52vh; overflow: auto; }
.picker-folder, .picker-file { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.picker-folder:hover, .picker-file:hover { background: var(--surface-2); }
.picker-file input { flex: none; accent-color: var(--accent); }
.picker-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-file small { margin-left: auto; color: var(--muted); font-size: 10.5px; }
.picker-file .icon, .picker-folder .icon { width: 17px; height: 17px; flex: none; }

/* Contacts */
.contacts-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; align-items: start; }
.contacts-main { min-height: 260px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.contacts-toolbar { margin-bottom: 12px; }
.contacts-toolbar input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; outline: none; }
.contacts-toolbar input:focus { border-color: var(--accent); }
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 9px; }
.contact-card { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.contact-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.contact-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent-600); font-size: 15px; font-weight: 750; }
.contact-avatar.has-photo { overflow: hidden; padding: 0; background: var(--surface-2); }
.contact-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.contact-photo-field { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.contact-photo-preview { display: grid; place-items: center; width: 72px; height: 72px; flex: none; overflow: hidden; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.contact-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.contact-photo-preview .icon { width: 30px; height: 30px; }
.contact-photo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.contact-photo-actions small { color: var(--muted); font-size: 10.5px; }
.contact-photo-actions label.btn { cursor: pointer; }
.contact-photo-large { display: flex; justify-content: center; margin-bottom: 12px; }
.contact-photo-large img { width: 120px; height: 120px; border: 1px solid var(--line); border-radius: 50%; object-fit: cover; }
.contact-card-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.contact-card-main strong, .contact-card-main span, .contact-card-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-card-main strong { font-size: 13px; }
.contact-card-main small { color: var(--accent-600); font-size: 10.5px; }
.contact-card-main span { color: var(--muted); font-size: 10.5px; }
.contacts-dav { margin-top: 0; }
.contact-details p { margin: 0 0 8px; font-size: 13px; }
.contact-details a { color: var(--accent); }
[data-theme="dark"] .notes-side,
[data-theme="dark"] .notes-main,
[data-theme="dark"] .contacts-main { background: var(--surface); }
[data-theme="dark"] .note-editor { background: var(--surface); }

.sidebar-overlay { display: none; }

/* Responsive */
@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(calc(-100% - 28px)); transition: transform .22s ease; box-shadow: 0 24px 70px rgba(9,48,82,.3); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .audio-player { opacity: 0; pointer-events: none; }
  .audio-player { left: 0; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(15,23,42,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 10px 18px; }
  .content { padding: 20px 18px 64px; }
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-side { position: static; }
  .notes-layout, .contacts-layout { grid-template-columns: 1fr; }
  .notes-side { position: static; }
  .notes-list { max-height: 260px; }
}
@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .head-actions { justify-content: flex-start; }
  .page-head h1 { font-size: 22px; }
  .toolbar { gap: 7px; }
  .search { max-width: none; flex-basis: 100%; }
  .sort-select { flex: 1; min-width: 0; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .file-thumb { height: 106px; }
  .file-grid:not(.list-view) .file-type-icon { width: 46px; height: 46px; font-size: 9.5px; }
  .file-grid:not(.list-view) .folder-icon .icon { width: 46px; height: 46px; }
  .file-body { padding: 9px 10px 11px; }
  .file-name { font-size: 12.5px; }
  .file-meta { font-size: 10.5px; }
  .stats-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 11.5px; }
  .data-table th:nth-child(2), .data-table td:nth-child(2) { display: none; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 18px; }
  .calendar-toolbar { padding: 10px; }
  .calendar-nav h2 { font-size: 14px; }
  .calendar-grid { grid-auto-rows: minmax(74px, auto); }
  .calendar-weekdays span { padding: 7px 2px; font-size: 9.5px; }
  .calendar-day { padding: 3px; }
  .calendar-day-head { font-size: 10px; }
  .calendar-day.today .calendar-day-head span { width: 17px; height: 17px; }
  .calendar-chip { padding: 2px 3px; font-size: 9px; }
  .calendar-chip-time { display: none; }
  .calendar-more { font-size: 9px; }
  .calendar-list { padding: 10px; }
  .note-editor { min-height: 240px; padding: 10px; }
  .note-title-input { font-size: 17px; }
  .note-toolbar button { min-width: 26px; height: 26px; padding: 0 5px; }
  .note-chip-main { max-width: 190px; }
  .contacts-grid { grid-template-columns: 1fr; }
  .share-head { padding: 16px; }
  .share-row { flex-wrap: wrap; }
  .share-row .share-actions { width: 100%; justify-content: flex-end; }
  .share-content { padding: 14px 16px 18px; }
  .share-footer { padding: 12px 16px; }
  .share-folder-bar { padding: 9px 16px; }
  .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .share-item-thumb { height: 76px; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: none; }
  .sync-note { display: none; }
  .music-count { display: none; }
  .music-folder-select { max-width: none; }
  .music-mode-toggle { flex: 1; }
  .music-mode-toggle button { flex: 1; justify-content: center; }
  .music-album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .music-album-hero { flex-direction: column; align-items: flex-start; padding: 14px; gap: 14px; }
  .music-album-hero-cover { width: min(58vw, 220px); }
  .audio-player { padding: 0 8px calc(8px + env(safe-area-inset-bottom)); }
  .audio-player-inner { border-radius: 16px; }
  .audio-progress-row { padding: 7px 12px 0; gap: 8px; }
  .audio-main { display: flex; flex-wrap: wrap; gap: 9px; padding: 4px 10px 10px; }
  .audio-identity { flex: 1 1 120px; gap: 9px; }
  .audio-cover { width: 40px; height: 40px; border-radius: 11px; }
  .audio-cover .icon { width: 20px; height: 20px; }
  .audio-track { flex: 1 1 100px; }
  .audio-title { font-size: 12.5px; }
  .audio-artist { font-size: 10.5px; }
  .audio-controls { order: 3; width: 100%; justify-content: center; }
  .audio-extra { order: 2; gap: 0; margin-left: auto; }
  .audio-volume { display: none; }
  .audio-big-extra .audio-volume { display: block; }
  .audio-icon-btn { width: 32px; height: 32px; }
  .audio-play { width: 40px; height: 40px; }
  .audio-queue { max-height: 42vh; }
  body.has-audio-player .content { padding-bottom: 210px; }
  body.has-audio-player .upload-panel { bottom: 178px; }
  body.has-audio-player .toast-root { bottom: 178px; }
}
@media (max-width: 760px) {
  .topbar-userbox .user-meta { display: none; }
  .audio-expanded-content { padding: 14px 16px calc(22px + env(safe-area-inset-bottom)); }
  .audio-expanded-body { grid-template-columns: 1fr; align-items: start; gap: 20px; padding: 14px 0 8px; }
  .audio-expanded-art { display: flex; justify-content: center; }
  .audio-expanded-cover { width: min(66vw, 300px); border-radius: 20px; max-height: none; }
  .audio-expanded-title { font-size: clamp(23px, 7vw, 30px); text-align: center; }
  .audio-expanded-info { transform: none; }
  .audio-expanded-artist, .audio-expanded-album { text-align: center; }
  .audio-expanded-artist { margin-top: 8px; }
  .audio-big-progress { margin-top: 20px; }
  .audio-big-controls { gap: 6px; margin-top: 8px; }
  .audio-big-controls .audio-icon-btn { width: 40px; height: 40px; }
  .audio-big-play { width: 60px; height: 60px; }
  .audio-big-play .icon { width: 24px; height: 24px; }
  .audio-big-extra { margin-top: 6px; }
  .audio-big-extra .audio-volume { width: 110px; }
  .audio-expanded-queue { max-height: 32vh; }
}
@media (hover: none) {
  .file-more { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Video thumbnails and seek feedback */
.file-thumb.video-thumb { background: #0b1424; }
.file-thumb.video-thumb img { position: absolute; inset: 0; }
.file-thumb.video-thumb .file-type-icon { position: relative; z-index: 0; }
.video-play {
  position: absolute;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(8, 16, 29, 0.58);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(5px);
  pointer-events: none;
}
.video-play .icon { width: 15px; height: 15px; margin-left: 1px; }
.file-grid.list-view .video-play { width: 18px; height: 18px; }
.file-grid.list-view .video-play .icon { width: 9px; height: 9px; }
.preview-video-shell { position: relative; }
.preview-seek-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  padding: 5px 11px;
  border-radius: 99px;
  background: rgba(8, 16, 29, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, -6px);
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
  backdrop-filter: blur(6px);
}
.preview-seek-hint.show { opacity: 1; transform: translate(-50%, 0); }

.theme-btn { margin-left: 2px; }

/* Dark theme */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0e1b2c;
  --surface-2: #13243a;
  --text: #e8f1fb;
  --muted: #94a9c0;
  --line: #1e3552;
  --line-strong: #2d4a6e;
  --accent: #38bdf8;
  --accent-600: #7dd3fc;
  --accent-soft: #0b2f47;
  --danger: #f87171;
  --danger-soft: #3a1218;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 18px 34px -22px rgba(0, 0, 0, 0.78);
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 520px at 100% -10%, #0b2a42 0%, transparent 58%),
    radial-gradient(900px 480px at 8% 105%, #0a1f38 0%, transparent 55%),
    var(--bg);
}
[data-theme="dark"] .login-view {
  background:
    radial-gradient(900px 560px at 18% -8%, #0b3045 0%, transparent 58%),
    radial-gradient(800px 480px at 92% 108%, #0a2540 0%, transparent 55%),
    var(--bg);
}
[data-theme="dark"] .login-card {
  background: rgba(14, 27, 44, 0.95);
  border-color: rgba(45, 74, 110, 0.72);
  box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.8);
}
[data-theme="dark"] .field label,
[data-theme="dark"] .check-line { color: var(--muted); }
[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .field select,
[data-theme="dark"] .search input,
[data-theme="dark"] .sort-select {
  background: var(--surface-2);
  color: var(--text);
}
[data-theme="dark"] .field input::placeholder,
[data-theme="dark"] .field textarea::placeholder,
[data-theme="dark"] .search input::placeholder { color: #64748b; }
[data-theme="dark"] .form-error { border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .btn.ghost { background: var(--surface); }
[data-theme="dark"] .icon-btn.light { color: var(--muted); }
[data-theme="dark"] .icon-btn.light:hover { background: var(--surface-2); color: var(--accent); }
[data-theme="dark"] .sidebar {
  background: rgba(14, 27, 44, 0.92);
  border-color: rgba(45, 74, 110, 0.72);
  color: var(--text);
  box-shadow: 0 24px 50px -34px rgba(0, 0, 0, 0.85);
}
[data-theme="dark"] .nav-item { color: var(--muted); }
[data-theme="dark"] .nav-item:hover { background: var(--surface-2); color: var(--text); }
[data-theme="dark"] .nav-item.active { background: linear-gradient(135deg, #0b2f47, #0e334f); color: var(--accent); }
[data-theme="dark"] .storage-widget,
[data-theme="dark"] .userbox { border-color: var(--line); }
[data-theme="dark"] .storage-head,
[data-theme="dark"] .storage-hint { color: var(--muted); }
[data-theme="dark"] .storage-bar { background: var(--surface-2); }
[data-theme="dark"] .user-name { color: var(--text); }
[data-theme="dark"] .topbar {
  background: rgba(7, 17, 31, 0.84);
  border-bottom-color: rgba(45, 74, 110, 0.48);
}
[data-theme="dark"] .crumb:hover { background: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .crumb.sep { color: var(--line-strong); }
[data-theme="dark"] .page-mark {
  background: linear-gradient(140deg, #0b2f47, #0e334f);
  border-color: var(--line);
  color: var(--accent);
}
[data-theme="dark"] .view-toggle { background: var(--surface); }
[data-theme="dark"] .bulk-bar {
  background: #0b2f47;
  border-color: #155e75;
  color: #bae6fd;
}
[data-theme="dark"] .file-type-icon {
  background: color-mix(in srgb, var(--c, #2563eb) 24%, #0e1b2c);
  color: color-mix(in srgb, var(--c, #2563eb) 66%, #ffffff);
  border-color: color-mix(in srgb, var(--c, #2563eb) 38%, #0e1b2c);
}
[data-theme="dark"] .audio-thumb { background: linear-gradient(150deg, #2a1524, #171222); }
[data-theme="dark"] .audio-player-inner { box-shadow: 0 26px 54px -18px rgba(0, 0, 0, .8); }
[data-theme="dark"] .file-check {
  background: var(--surface-2);
  border-color: var(--line-strong);
}
[data-theme="dark"] .file-check:hover { border-color: #64748b; }
[data-theme="dark"] .file-check:checked { background: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .file-check::after { border-color: #062033; }
[data-theme="dark"] .file-more {
  background: rgba(14, 27, 44, 0.94);
  color: var(--muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.36);
}
[data-theme="dark"] .file-more:hover { background: var(--surface-2); }
[data-theme="dark"] .skeleton {
  background: linear-gradient(100deg, #102036 20%, #152942 40%, #102036 60%);
}
[data-theme="dark"] .drop-card,
[data-theme="dark"] .upload-panel,
[data-theme="dark"] .context-menu,
[data-theme="dark"] .modal,
[data-theme="dark"] .share-row,
[data-theme="dark"] .audit-row,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .share-card { background: var(--surface); }
[data-theme="dark"] .upload-progress { background: var(--surface-2); }
[data-theme="dark"] .status-pill.active { background: #052e24; color: #6ee7b7; }
[data-theme="dark"] .status-pill.off { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .status-pill.warn { background: #3b1d0b; color: #fdba74; }
[data-theme="dark"] .share-kind.folder-kind { background: #2a2210; }
[data-theme="dark"] .type-bar .bar { background: var(--surface-2); }
[data-theme="dark"] .notice {
  background: #0b2f47;
  border-color: #155e75;
  color: #bae6fd;
}
[data-theme="dark"] .share-page {
  background:
    radial-gradient(1000px 600px at 20% 0%, #0b2a42 0%, transparent 60%),
    var(--bg);
}
[data-theme="dark"] .sidebar-overlay { background: rgba(0, 0, 0, 0.55); }

/* ---------- Техническое обслуживание ---------- */
.maintenance-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.maintenance-card {
  width: 100%;
  max-width: 560px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 26px 34px 30px;
  box-shadow: var(--shadow-md);
}
.maintenance-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  text-align: left;
}
.maintenance-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.maintenance-brand .brand-mark svg { width: 21px; height: 21px; }
.maintenance-art {
  width: min(340px, 78vw);
  height: auto;
  display: block;
  margin: 12px auto 2px;
  filter: drop-shadow(0 18px 26px rgba(15, 46, 77, 0.14));
}
.maintenance-card h1 { margin-top: 8px; font-size: 26px; letter-spacing: -0.025em; }
.maintenance-text { margin: 10px auto 0; max-width: 390px; color: var(--muted); font-size: 15px; }
.maintenance-admin {
  display: inline-block;
  margin-top: 22px;
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.maintenance-admin:hover { color: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .maintenance-art { filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.5)); }
@media (max-width: 520px) {
  .maintenance-card { padding: 22px 20px 26px; border-radius: 22px; }
  .maintenance-card h1 { font-size: 22px; }
}

.maintenance-panel-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.maintenance-panel-body .page-sub { flex: 1 1 280px; max-width: 560px; }

/* Admin categories */
.admin-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  overflow-x: auto; scrollbar-width: thin;
}
.admin-tab {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 8px 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 650;
  white-space: nowrap; cursor: pointer; transition: background .15s, color .15s;
}
.admin-tab:hover { background: var(--surface); color: var(--text); }
.admin-tab.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.admin-tab .icon { width: 15px; height: 15px; }
.admin-tab-count,
.admin-tab-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent);
}
.admin-tab-badge { background: rgba(245, 158, 11, .18); color: #b45309; }
.admin-columns { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: 16px; }
.admin-columns .panel { margin-bottom: 0; }
.admin-narrow { max-width: 720px; }
.admin-table-scroll { overflow-x: auto; }
.admin-audit { max-height: 560px; overflow-y: auto; padding-right: 4px; }
[data-theme="dark"] .admin-tabs { background: var(--surface); }
[data-theme="dark"] .admin-tab.active { background: var(--surface-2); }
[data-theme="dark"] .admin-tab-badge { background: rgba(245, 158, 11, .22); color: #fbbf24; }
@media (max-width: 980px) {
  .admin-columns { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .admin-tabs { margin-bottom: 14px; }
  .admin-tab { padding: 7px 10px; font-size: 12px; }
}
