:root {
  color-scheme: dark;
  --bg: #250003;
  --panel: #181a20;
  --panel-soft: #20232b;
  --text: #f7f8fb;
  --muted: #9aa1ad;
  --line: rgba(255, 255, 255, .09);
  --accent: #6ea8ff;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(99, 16, 16, 0.397), transparent 34%), var(--bg);
  color: var(--text);
}

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

button,
input {
  font: inherit;
}

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

.sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(15, 17, 23, .72);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  margin-bottom: 28px;
  line-height: 1;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6ea8ff, #9d7cff);
}

.logout-form {
  margin: -16px 0 22px;
}

.logout-form button {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.045);
  cursor: pointer;
}

.logout-form button:hover {
  color: var(--text);
  background: rgba(255,255,255,.08);
}

.primary-btn,
.upload-btn {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  text-align: center;
}

.primary-btn {
  background: var(--accent);
  margin-bottom: 10px;
}

.upload-btn {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  margin-bottom: 24px;
  position: relative;
}

.upload-btn input {
  display: none;
}

.upload-progress {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.54);
}

.upload-progress.show {
  display: grid;
}

.upload-progress-card {
  width: min(440px, 100%);
  padding: 22px;
  border-radius: 18px;
  background: rgba(24, 26, 32, .96);
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}

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

.upload-progress-head span {
  color: var(--accent);
  font-weight: 800;
}

.upload-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #9d7cff);
  transition: width .14s ease;
}

.upload-progress-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-drop-zone {
  position: fixed;
  inset: 0;
  z-index: 2147483500;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(8, 10, 16, .68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}

.page-drop-zone.show {
  display: grid;
}

.page-drop-zone > div {
  width: min(460px, 100%);
  min-height: 180px;
  border-radius: 24px;
  border: 2px dashed rgba(110, 168, 255, .72);
  background: rgba(110, 168, 255, .12);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.page-drop-zone strong {
  font-size: 22px;
}

.page-drop-zone span {
  color: var(--muted);
}

.storage-box {
  margin: 0 0 20px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
}

.storage-box div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
}

.storage-box strong {
  font-size: 13px;
}

.storage-box span {
  color: var(--muted);
}

.storage-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.storage-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #9d7cff);
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-link {
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.15;
}

.side-button {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.side-link span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-emoji {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
}

.side-link.active,
.side-link:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.side-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.root-icon {
  border-radius: 6px;
  background: linear-gradient(135deg, #6ea8ff, #9d7cff);
}

.recent-icon {
  border-radius: 999px;
  border: 2px solid #6ea8ff;
}

.star-icon {
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 35%);
  background: #ffd166;
}

.trash-icon {
  border-radius: 4px;
  background: #ff6b6b;
}

.type-icon {
  border-radius: 5px;
  background: rgba(255,255,255,.22);
}

.side-section-title {
  margin: 18px 0 6px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.side-empty {
  margin: 0;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
}

.folder-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.folder-tree-link {
  padding-left: calc(14px + (var(--level) * 16px));
}

.mini-folder-icon {
  position: relative;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--folder-color, #f6c85f), #ffdf8c);
  background: linear-gradient(135deg, var(--folder-color, #f6c85f), rgba(255,255,255,.3));
}

.mini-folder-icon::before {
  content: "";
  width: 10px;
  height: 4px;
  border-radius: 3px 3px 0 0;
  background: #eeb94c;
  background: color-mix(in srgb, var(--folder-color, #f6c85f) 76%, #000);
  position: absolute;
  top: 3px;
  left: 3px;
}

.drive-panel {
  min-width: 0;
  padding: 28px;
}

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

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.breadcrumbs a:hover {
  color: var(--text);
}

.folder-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.view-toggle {
  display: flex;
  padding: 4px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.view-toggle button {
  border: 0;
  color: var(--muted);
  background: transparent;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.view-toggle button.active {
  color: var(--text);
  background: var(--panel-soft);
}

.filterbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 140px 120px auto;
  gap: 10px;
  margin: -8px 0 22px;
}

.filterbar input,
.filterbar select,
.filterbar button {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  padding: 0 12px;
  outline: 0;
}

.filterbar button {
  cursor: pointer;
  background: var(--accent);
  border-color: var(--accent);
}

.result-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: -10px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.selection-bar {
  margin: -10px 0 18px;
  min-height: 52px;
  padding: 10px 12px 10px 16px;
  border-radius: 16px;
  background: rgba(110, 168, 255, .12);
  border: 1px solid rgba(110, 168, 255, .34);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selection-bar.show {
  display: flex;
}

.selection-bar strong {
  font-size: 14px;
}

.selection-actions {
  display: flex;
  gap: 8px;
}

.selection-actions button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.075);
  cursor: pointer;
}

.selection-actions button:hover {
  background: rgba(255,255,255,.12);
}

.drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.pagination {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pagination a,
.pagination span,
.pagination strong {
  min-height: 38px;
  min-width: 74px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(255,255,255,.055);
  font-size: 13px;
}

.pagination span {
  color: var(--muted);
  opacity: .58;
}

.pagination strong {
  min-width: 90px;
  color: var(--muted);
  background: transparent;
}

.drive-item {
  min-width: 0;
  min-height: 210px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  cursor: grab;
  position: relative;
  transition: background .16s ease, border-color .16s ease, opacity .16s ease, transform .16s ease;
  content-visibility: auto;
  contain-intrinsic-size: 210px;
  contain: layout paint style;
}

.drive-item:hover {
  background: rgba(255, 255, 255, .085);
  border-color: rgba(255, 255, 255, .16);
}

.drive-item:active {
  cursor: grabbing;
}

.drive-item.is-dragging {
  opacity: .45;
  transform: scale(.98);
}

.drive-item.is-selected {
  border-color: rgba(110, 168, 255, .8);
  background: rgba(110, 168, 255, .12);
}

.star-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 26px;
  height: 26px;
  border: 0;
  color: rgba(255,255,255,.38);
  background: transparent;
  cursor: pointer;
  opacity: 0;
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  transition: opacity .16s ease, color .16s ease, transform .16s ease;
}

.drive-item:hover .star-btn,
.star-btn.active {
  opacity: 1;
}

.star-btn:hover {
  color: rgba(255,255,255,.86);
  transform: scale(1.08);
}

.star-btn.active {
  color: #ffd166;
  opacity: 1;
}

.select-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(10, 12, 18, .72);
  border: 1px solid rgba(255,255,255,.18);
  opacity: .62;
  cursor: pointer;
  transition: opacity .16s ease, background .16s ease;
}

.drive-item:hover .select-check,
.drive-item.is-selected .select-check {
  opacity: 1;
}

.select-check input {
  display: none;
}

.select-check span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.72);
}

.select-check input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px #111217;
}

.selection-rect {
  position: fixed;
  display: none;
  z-index: 2147483000;
  border: 1px solid rgba(110, 168, 255, .9);
  background: rgba(110, 168, 255, .18);
  border-radius: 8px;
  pointer-events: none;
}

.selection-rect.show {
  display: block;
}

.drop-target.drag-over {
  outline: 2px solid rgba(110, 168, 255, .9);
  outline-offset: 3px;
  background: rgba(110, 168, 255, .14);
}

.item-open {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.item-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.item-open strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
  font-size: 13px;
}

.item-open small {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.thumb {
  width: 100%;
  height: 118px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.075);
  position: relative;
}

.thumb img,
.thumb video,
.thumb iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
  background: #111;
  pointer-events: none;
}

.thumb iframe {
  transform: scale(1.01);
}

.folder-thumb {
  background: linear-gradient(145deg, rgba(246, 200, 95, .14), rgba(255, 255, 255, .045));
  background: linear-gradient(145deg, color-mix(in srgb, var(--folder-color, #f6c85f) 22%, transparent), rgba(255, 255, 255, .045));
}

.play-mark {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(0,0,0,.56);
  position: absolute;
  display: grid;
  place-items: center;
}

.play-mark::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid white;
  margin-left: 3px;
}

.folder-icon,
.file-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
}

.folder-icon {
  position: relative;
  background: linear-gradient(135deg, var(--folder-color, #f6c85f), #ffdf8c);
  background: linear-gradient(135deg, var(--folder-color, #f6c85f), color-mix(in srgb, var(--folder-color, #f6c85f) 48%, white));
}

.folder-icon::before {
  content: "";
  width: 28px;
  height: 10px;
  border-radius: 7px 7px 0 0;
  background: #eeb94c;
  background: color-mix(in srgb, var(--folder-color, #f6c85f) 76%, #000);
  position: absolute;
  top: 9px;
  left: 9px;
}

.file-icon {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  background: #3a3f4b;
  color: white;
}

.file-icon.image { background: linear-gradient(135deg, #f0528d, #ff9fba); }
.file-icon.video { background: linear-gradient(135deg, #8b5cf6, #c084fc); }
.file-icon.audio { background: linear-gradient(135deg, #16a085, #68e6c1); }
.file-icon.pdf { background: linear-gradient(135deg, #ef4444, #ff8f8f); }
.file-icon.archive { background: linear-gradient(135deg, #f59e0b, #ffd166); }
.file-icon.word { background: linear-gradient(135deg, #2563eb, #7db5ff); }
.file-icon.sheet { background: linear-gradient(135deg, #16a34a, #7ee787); }
.file-icon.slide { background: linear-gradient(135deg, #f97316, #ffb36b); }
.file-icon.code { background: linear-gradient(135deg, #06b6d4, #7dd3fc); }

.item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.item-actions a:hover {
  color: var(--text);
}

.item-actions form {
  margin: 0;
}

.item-actions button,
.ghost-danger {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  padding: 0;
  font-size: 12px;
}

.drive-grid.list-view {
  display: flex;
  flex-direction: column;
}

.drive-grid.list-view .drive-item {
  min-height: 78px;
  padding: 12px 14px;
  flex-direction: row;
  align-items: center;
}

.drive-grid.list-view .item-open {
  flex: 1;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
}

.drive-grid.list-view .item-copy {
  grid-column: 2;
}

.drive-grid.list-view .thumb {
  width: 58px;
  height: 58px;
  border-radius: 15px;
}

.drive-grid.list-view .item-open strong {
  display: block;
  white-space: nowrap;
}

.empty-state {
  min-height: 300px;
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 22px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .58);
  z-index: 1000;
}

.modal-backdrop.show {
  display: grid;
}

.modal {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 18px;
  background: #1b1d24;
  border: 1px solid var(--line);
}

.modal h2 {
  margin: 0 0 16px;
}

.modal input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  outline: 0;
  color: var(--text);
  background: var(--panel-soft);
}

.modal-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.move-list {
  max-height: 340px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.move-list button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 calc(12px + (var(--level, 0) * 16px));
  cursor: pointer;
  text-align: left;
}

.move-list button:hover {
  background: rgba(255,255,255,.1);
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483400;
  display: none;
  padding: 22px;
  background: rgba(0,0,0,.72);
}

.preview-modal.show {
  display: grid;
}

.preview-shell {
  min-width: 0;
  min-height: 0;
  width: min(1180px, 100%);
  height: min(820px, calc(100vh - 44px));
  margin: auto;
  border-radius: 18px;
  overflow: hidden;
  background: #111217;
  border: 1px solid var(--line);
  box-shadow: 0 28px 100px rgba(0,0,0,.62);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.preview-head {
  min-width: 0;
  min-height: 58px;
  padding: 12px 14px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.035);
}

.preview-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-actions a,
.preview-actions button {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.075);
  padding: 0 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.preview-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #0b0c10;
}

.preview-body img,
.preview-body video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

.audio-preview,
.preview-fallback-large {
  width: min(420px, calc(100% - 32px));
  padding: 28px;
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
}

.audio-preview audio {
  width: 100%;
}

.preview-fallback-large p {
  margin: 0;
  color: var(--muted);
}

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

.modal-actions button {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-soft);
  padding: 0 14px;
  cursor: pointer;
}

.modal-actions button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
}

.hover-preview {
  position: fixed;
  width: 340px;
  height: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translate(14px, 14px) scale(.96);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(20, 18, 22, .98);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 30px 90px rgba(0,0,0,.75);
  z-index: 2147483647;
  pointer-events: none;
  transition: opacity .14s ease, visibility .14s ease, transform .14s ease;
}

.hover-preview.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(14px, 14px) scale(1);
}

.hover-preview img,
.hover-preview iframe,
.hover-preview video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
  background: #111;
}

.preview-fallback {
  width: 100%;
  height: 100%;
  padding: 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  color: white;
}

.preview-fallback strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.preview-fallback small {
  color: rgba(255,255,255,.58);
}

.context-menu {
  position: fixed;
  z-index: 2147483600;
  min-width: 170px;
  padding: 6px;
  border-radius: 14px;
  display: none;
  background: rgba(25, 27, 34, .98);
  border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(0,0,0,.48);
}

.context-menu.show {
  display: grid;
}

.context-menu button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 0 10px;
}

.context-menu button:hover {
  background: rgba(255,255,255,.08);
}

.detail-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 0;
  overflow: hidden;
  border-left: 1px solid transparent;
  background: rgba(15, 17, 23, .72);
  transition: width .18s ease, border-color .18s ease;
}

.detail-panel.show {
  width: 310px;
  border-color: var(--line);
}

.detail-empty,
.detail-content {
  width: 310px;
  min-height: 100%;
  padding: 24px;
}

.detail-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.detail-empty strong {
  color: var(--text);
}

.detail-content {
  display: none;
  gap: 16px;
  align-content: start;
}

.detail-content.show {
  display: grid;
}

.detail-close {
  justify-self: end;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.detail-icon {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 42px;
  background: var(--panel-soft);
}

.detail-content h2 {
  min-width: 0;
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.detail-content dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-content dl div {
  display: grid;
  gap: 4px;
}

.detail-content dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.detail-content dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: grid;
  gap: 8px;
}

.detail-actions button {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-soft);
  cursor: pointer;
}

.color-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.color-list button {
  height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.16);
  background: var(--swatch);
  cursor: pointer;
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.12);
}

.activity-modal {
  width: min(560px, 100%);
}

.shortcuts-modal {
  width: min(540px, 100%);
}

.activity-list {
  max-height: 430px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.activity-list article {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.activity-list span,
.activity-list small,
.activity-list time {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 13px;
}

.shortcut-list {
  display: grid;
  gap: 8px;
}

.shortcut-list div {
  min-height: 40px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
}

.shortcut-list div:first-child,
.shortcut-list div:nth-child(3),
.shortcut-list div:nth-child(4),
.shortcut-list div:nth-child(n+5) {
  grid-template-columns: auto minmax(0, 1fr);
}

.shortcut-list kbd {
  min-width: 34px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.1);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.shortcut-list span {
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.upload-queue {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.upload-queue div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.055);
}

.upload-queue span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-queue small {
  color: var(--muted);
}

.login-page {
  min-height: 100vh;
}

.pin-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.pin-card {
  width: min(380px, 100%);
  padding: 28px;
  border-radius: 22px;
  background: rgba(24, 26, 32, .92);
  border: 1px solid var(--line);
  box-shadow: 0 28px 90px rgba(0,0,0,.42);
  display: grid;
  gap: 14px;
  text-align: center;
}

.pin-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  justify-self: center;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, #6ea8ff, #9d7cff);
}

.pin-card h1 {
  font-size: 26px;
}

.pin-card p {
  margin: -6px 0 4px;
  color: var(--muted);
}

.pin-card input {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-soft);
  text-align: center;
  letter-spacing: .18em;
  outline: 0;
}

.pin-card button {
  height: 46px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--accent);
  cursor: pointer;
}

.pin-error {
  padding: 10px 12px;
  border-radius: 12px;
  color: #ffd7d7;
  background: rgba(255, 107, 107, .14);
  border: 1px solid rgba(255, 107, 107, .28);
  font-size: 14px;
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 900;
    height: 100vh;
    background: #111217;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .drive-panel {
    padding: 20px;
  }

  .topbar {
    flex-direction: column;
  }

  .view-toggle {
    width: 100%;
  }

  .view-toggle button {
    flex: 1;
  }

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

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

  .selection-actions {
    flex-wrap: wrap;
  }

  .preview-modal {
    padding: 10px;
  }

  .preview-shell {
    height: calc(100vh - 20px);
    border-radius: 14px;
  }

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

  .preview-actions {
    width: 100%;
  }

  .preview-actions a,
  .preview-actions button {
    flex: 1;
  }
}

.hamburger{
    display:none;
}

@media (max-width:900px){

    .hamburger{
        display:flex;
        align-items:center;
        justify-content:center;

        width:42px;
        height:42px;

        border:none;
        border-radius:12px;

        background:#1b1b1b;
        color:white;

        cursor:pointer;
        font-size:22px;
    }

    .sidebar{
        position:fixed;
        left:-300px;
        top:0;

        width:280px;
        height:100vh;

        transition:.3s;
        z-index:9999;
    }

    .sidebar.show{
        left:0;
    }
}
