:root {
  --app-scale: 0.8;
  --bg: #f4f6f9;
  --bg-accent: #f4f6f9;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --border: rgba(31, 41, 55, 0.08);
  --border-strong: rgba(37, 99, 235, 0.18);
  --text: #172033;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --shadow: none;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --motion-fast: 140ms;
  --motion-base: 220ms;
  --motion-slow: 360ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: calc(100vh / var(--app-scale));
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  width: 100%;
  margin: 0;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  color: var(--text);
  zoom: var(--app-scale);
  background: var(--bg);
}

@keyframes fade-slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes grid-card-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.965);
    filter: saturate(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

@keyframes grid-thumb-reveal {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes grid-title-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-scale-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fade-only-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes gallery-overlay-reveal {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes fade-out-soft {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes preview-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes selection-pulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.012);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pane-refresh-wave {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(26px);
  }
}

@keyframes pane-navigate-wave {
  0% {
    opacity: 0;
    transform: translateX(-12px);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(18px);
  }
}

.boot-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 50;
}

.boot-card {
  min-width: 180px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.transfer-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.render-debug-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 90;
  max-width: 420px;
  max-height: 60vh;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font: 700 14px/1.45 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.24);
  pointer-events: none;
}

.transfer-item {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  pointer-events: auto;
  transition:
    opacity var(--motion-base) ease,
    transform var(--motion-base) ease,
    border-color var(--motion-base) ease,
    background-color var(--motion-base) ease;
  transform-origin: bottom right;
}

.transfer-item.entering {
  animation: fade-slide-up var(--motion-slow) cubic-bezier(0.22, 1, 0.36, 1);
}

.transfer-item.leaving {
  animation: fade-out-soft 180ms ease forwards;
}

.transfer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.transfer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.transfer-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.transfer-status {
  color: var(--muted);
  font-size: 13px;
}

.transfer-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.transfer-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: #6ea8ff;
  transition: none;
}

.transfer-item.complete .transfer-fill {
  background: #4fbe79;
}

.transfer-item.error .transfer-fill {
  background: #ef6b87;
}

.transfer-item.indeterminate .transfer-fill {
  width: 40% !important;
  animation: transfer-slide 1s linear infinite;
}

.context-menu {
  position: fixed;
  z-index: 80;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
  transform-origin: top left;
  animation: fade-scale-in 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.context-menu-list {
  display: grid;
  gap: 2px;
}

.context-menu-item,
.context-menu-submenu-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.context-menu-item:hover,
.context-menu-submenu:hover > .context-menu-submenu-trigger {
  background: #f3f6fb;
}

.context-menu-item.danger {
  color: #be123c;
}

.context-menu-item.disabled,
.context-menu-submenu-trigger.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.context-menu-separator {
  height: 1px;
  margin: 4px 6px;
  background: #e5e7eb;
}

.context-menu-submenu {
  position: relative;
}

.context-menu-arrow {
  color: var(--muted);
  font-size: 12px;
}

.context-submenu-panel {
  position: absolute;
  top: -6px;
  left: calc(100% - 4px);
  display: none;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.context-menu-submenu:hover > .context-submenu-panel {
  display: block;
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.18);
  opacity: 0;
  transition: opacity 180ms ease;
}

.dialog-window {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
  transform: translateY(12px) scale(0.985);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dialog-overlay.is-opening,
.dialog-overlay:not(.hidden):not(.is-closing) {
  opacity: 1;
}

.dialog-overlay.is-opening .dialog-window,
.dialog-overlay:not(.hidden):not(.is-closing) .dialog-window {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.dialog-overlay.is-closing {
  opacity: 0;
}

.dialog-overlay.is-closing .dialog-window {
  transform: translateY(10px) scale(0.988);
  opacity: 0;
}

.mobile-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 115;
}

.mobile-preview-overlay.is-opening .mobile-preview-backdrop,
.mobile-preview-overlay.is-opening .mobile-preview-sheet {
  opacity: 0;
}

.mobile-preview-overlay.is-opening.is-opening-active .mobile-preview-backdrop,
.mobile-preview-overlay.is-opening.is-opening-active .mobile-preview-sheet {
  opacity: 1;
}

.mobile-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.78);
  transition: opacity 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-preview-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  transition: opacity 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-preview-head {
  display: flex;
  justify-content: flex-end;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 10px;
}

.mobile-preview-body {
  min-height: 0;
  padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px));
}

.mobile-preview-body .preview-empty,
.mobile-preview-body .preview-content {
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.mobile-preview-body .preview-content {
  padding-right: 0;
}

.mobile-preview-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.mobile-preview-carousel-track {
  display: flex;
  width: 300%;
  height: 100%;
  transform: translateX(-33.3333%);
  transition: transform 220ms ease;
  will-change: transform;
}

.mobile-preview-slide {
  flex: 0 0 33.3333%;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
}

.mobile-preview-slide-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mobile-preview-open-ghost {
  position: fixed;
  z-index: 116;
  display: block;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 248, 238, 0.96) 0%, rgba(240, 226, 207, 0.92) 100%);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  object-fit: cover;
  transition:
    left 300ms cubic-bezier(0.22, 1, 0.36, 1),
    top 300ms cubic-bezier(0.22, 1, 0.36, 1),
    width 300ms cubic-bezier(0.22, 1, 0.36, 1),
    height 300ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 300ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-preview-body .preview-image,
.mobile-preview-body .preview-video,
.mobile-preview-body .preview-pdf,
.mobile-preview-body .preview-markdown {
  border: none;
  border-radius: 0;
  background: transparent;
}

.mobile-preview-body .preview-pdf {
  width: calc(100% + 18px);
  max-width: none;
  margin-right: -18px;
}

.dialog-head {
  padding: 18px 20px 0;
}

.dialog-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 14px 20px 20px;
}

.dialog-message {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.dialog-details {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #edf1f7;
  border-radius: 14px;
  background: #f8fafc;
}

.dialog-properties {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.dialog-properties dt {
  color: var(--muted);
  font-weight: 600;
}

.dialog-properties dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
  color: var(--text);
}

.dialog-input-wrap {
  display: grid;
  gap: 6px;
}

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

.dialog-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d8e0ec;
  border-radius: 10px;
  background: #ffffff;
  outline: none;
  color: var(--text);
}

.dialog-input:focus {
  border-color: #93c5fd;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
}

.dialog-confirm-danger {
  background: #fff1f2;
  color: #be123c;
  border-color: rgba(190, 24, 93, 0.14);
}

.dialog-button-active {
  border-color: #2563eb !important;
  box-shadow: inset 0 0 0 1px #2563eb;
}

@keyframes transfer-slide {
  from {
    transform: translateX(-110%);
  }

  to {
    transform: translateX(260%);
  }
}

body.app-booting #loginScreen,
body.app-booting #appShell {
  display: none !important;
}

body:not(.app-booting) .boot-screen {
  display: none;
}

button,
input {
  font: inherit;
}

.login-screen {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
}

.login-window {
  display: grid;
  grid-template-columns: minmax(320px, 1.3fr) minmax(320px, 0.7fr);
  width: min(1080px, 100%);
  min-height: 720px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: none;
}

.login-art {
  position: relative;
  overflow: hidden;
  background: #f08da2;
}

.login-brand {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.94);
  font-weight: 600;
}

.login-sun {
  position: absolute;
  top: 88px;
  left: 50%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  transform: translateX(-20%);
  background: rgba(255, 214, 200, 0.55);
}

.login-hill {
  position: absolute;
  left: -10%;
  right: -10%;
  border-radius: 50% 50% 0 0;
}

.hill-one {
  bottom: 160px;
  height: 220px;
  background: #ef5d88;
}

.hill-two {
  bottom: 70px;
  height: 220px;
  background: #c91f5d;
}

.hill-three {
  bottom: -10px;
  height: 140px;
  background: #5f0626;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 38px;
  background: #edf4fb;
}

.login-header {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-server-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: white;
  color: #5a5fc6;
  font-size: 28px;
  border: 1px solid var(--border);
}

.login-header h2 {
  margin: 0;
  font-size: 24px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
}

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

.field span {
  font-size: 14px;
  color: #334155;
}

.field input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d4dbe5;
  border-radius: 6px;
  background: white;
  outline: none;
}

.field input:focus {
  border-color: #7c78cf;
  box-shadow: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.checkbox-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease;
}

.checkbox-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg) scale(0.7);
  opacity: 0;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.checkbox-row input[type="checkbox"]:hover {
  border-color: #93c5fd;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 0 3px rgba(59, 130, 246, 0.08);
}

.checkbox-row input[type="checkbox"]:focus-visible {
  outline: none;
  border-color: #60a5fa;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 0 3px rgba(59, 130, 246, 0.16);
}

.checkbox-row input[type="checkbox"]:active {
  transform: scale(0.96);
}

.checkbox-row input[type="checkbox"]:checked {
  border-color: #3b82f6;
  background: linear-gradient(180deg, #4f8df7 0%, #2563eb 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 6px 16px rgba(37, 99, 235, 0.18);
}

.checkbox-row input[type="checkbox"]:checked::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.login-error {
  margin: 0;
  color: #be123c;
  font-size: 14px;
}

.login-submit {
  height: 40px;
  border: none;
  border-radius: 7px;
  background: #6f689e;
  color: white;
  cursor: pointer;
}

.login-submit:hover {
  background: #62598f;
}

.window-shell {
  display: grid;
  grid-template-columns: 240px 10px minmax(0, 1fr);
  height: 100%;
  padding: 18px;
  gap: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 18px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 18px 0 0 18px;
  box-shadow: none;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.sidebar-admin-button,
.sidebar-logout-button {
  width: 100%;
  justify-content: center;
}

.sidebar-resizer {
  position: relative;
  cursor: col-resize;
  background: transparent;
}

.sidebar-resizer::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: 0 auto;
  width: 1px;
  background: var(--border);
}

.sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 48px;
  border-radius: 999px;
  background: #cbd5e1;
  transform: translate(-50%, -50%);
}

.sidebar-resizer:hover::after,
.sidebar-resizer.is-dragging::after {
  background: var(--primary);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-strong);
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.sidebar-head h1,
.nav-group h2 {
  margin: 0;
}

.sidebar-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: #eef4ff;
  color: #315ea8;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-status-badge.is-error {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.storage-group,
.browse-list,
.admin-storage-list {
  display: grid;
  gap: 8px;
}

.tree-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.storage-select-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.storage-select-icon {
  font-size: 15px;
  line-height: 1;
  color: #315ea8;
}

.storage-select-button {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  text-align: left;
}

.storage-select-button:disabled {
  cursor: default;
  color: var(--muted);
}

.storage-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.storage-select-caret {
  flex: 0 0 auto;
  width: 0.62rem;
  height: 0.62rem;
  border-right: 2px solid rgba(71, 85, 105, 0.9);
  border-bottom: 2px solid rgba(71, 85, 105, 0.9);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 180ms ease;
}

.storage-select-wrap.is-open .storage-select-caret {
  transform: rotate(-135deg) translateY(-1px);
}

.storage-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 18px 36px rgba(15, 23, 42, 0.14);
}

.storage-select-option {
  width: 100%;
  display: grid;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.storage-select-option:hover,
.storage-select-option:focus-visible,
.storage-select-option.active {
  border-color: rgba(139, 94, 60, 0.22);
  background: linear-gradient(180deg, rgba(255, 249, 241, 0.98) 0%, rgba(244, 234, 220, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(109, 69, 38, 0.10);
}

.storage-select-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.nav-group h2 {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.primary-button,
.ghost-button,
.danger-button,
.upload-button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 80ms linear, border-color 80ms linear;
}

.upload-button {
  background: #e8f0ff;
  color: #315ea8;
  border-color: rgba(49, 94, 168, 0.12);
}

.download-link {
  background: #eef4ff;
  color: #315ea8;
  border-color: rgba(49, 94, 168, 0.12);
}

.upload-button:hover,
.ghost-button:hover,
.download-link:hover {
  transform: none;
}

.upload-button:hover {
  background: #dce8ff;
}

.download-link:hover {
  background: #e3edff;
}

.ghost-button,
.download-link {
  background: var(--panel-strong);
  color: var(--text);
  border-color: var(--border);
}

.danger-button {
  background: #fff1f2;
  color: #be123c;
  border-color: rgba(190, 24, 93, 0.14);
}

.command-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.command-button:hover {
  background: #f8fafc;
}

.icon-button {
  min-width: 34px;
  padding: 0;
}

.icon {
  font-size: 14px;
  line-height: 1;
}

.action-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.action-icon::before,
.action-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.upload-glyph::before,
.download-glyph::before {
  width: 2px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.upload-glyph::after,
.download-glyph::after {
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.upload-glyph::before {
  top: 4px;
}

.upload-glyph::after {
  top: 1px;
  transform: translateX(-50%) rotate(135deg);
}

.download-glyph::before {
  top: 1px;
}

.download-glyph::after {
  top: 6px;
  transform: translateX(-50%) rotate(-45deg);
}

.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.view-button {
  min-height: 30px;
  min-width: 34px;
  padding: 0 8px;
  border: none;
  background: transparent;
}

.view-button.active {
  background: white;
  border: 1px solid var(--border);
}

.mobile-grid-columns-toggle {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.mobile-grid-columns-button {
  min-height: 30px;
  min-width: 34px;
  padding: 0 10px;
  border: none;
  background: transparent;
  font-weight: 700;
}

.mobile-grid-columns-button.active {
  background: white;
  border: 1px solid var(--border);
}

.view-icon {
  display: grid;
  gap: 3px;
}

.view-icon span {
  display: block;
  background: #5b6475;
  border-radius: 999px;
}

.list-icon span {
  width: 14px;
  height: 2px;
}

.grid-icon {
  grid-template-columns: repeat(2, 5px);
}

.grid-icon span {
  width: 5px;
  height: 5px;
  border-radius: 2px;
}

.upload-button input {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    transform var(--motion-fast) ease;
}

.nav-icon {
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1;
}

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

.nav-item:hover,
.nav-item.active {
  background: white;
  border-color: var(--border);
}

.folder-tree {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 10px;
  padding-right: 6px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.52)),
    #f8fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tree-group {
  display: grid;
  gap: 2px;
}

.tree-row {
  display: grid;
  grid-template-columns: 18px 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  content-visibility: auto;
  contain: layout paint style;
  transition:
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    transform var(--motion-fast) ease,
    opacity var(--motion-fast) ease;
}

.tree-row.animate-in {
  opacity: 0;
  animation: fade-slide-up 280ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--enter-index, 0) * 16ms);
}

.tree-row:hover {
  background: rgba(255, 252, 247, 0.96);
  border-color: rgba(139, 94, 60, 0.16);
}

.tree-row.active {
  background: linear-gradient(180deg, rgba(255, 249, 241, 0.98) 0%, rgba(244, 234, 220, 0.96) 100%);
  border-color: rgba(139, 94, 60, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 18px rgba(109, 69, 38, 0.08);
}

.tree-row.active .tree-label {
  color: #5a3820;
  font-weight: 800;
}

.tree-row[data-storage-root="true"],
.tree-row[data-storage-root="true"]:hover,
.tree-row[data-storage-root="true"].active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.tree-row[data-storage-root="true"].active .tree-label {
  color: #6d4526;
}

.tree-row:hover {
  transform: translateX(1px);
}

.tree-row.clipboard-cut {
  opacity: 0.5;
}

.tree-row.clipboard-cut .tree-label {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.tree-row.drag-over {
  background: #eff6ff;
  border-color: var(--primary);
}

.tree-expander {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.tree-expander::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg);
  transition: none;
}

.tree-expander.expanded::before {
  transform: rotate(45deg);
}

.tree-expander.placeholder {
  cursor: default;
}

.tree-expander.placeholder::before {
  display: none;
}

.tree-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.tree-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.tree-folder-shape {
  position: relative;
  width: 16px;
  height: 12px;
}

.tree-drive-shape {
  position: relative;
  width: 16px;
  height: 12px;
}

.tree-drive-top {
  position: absolute;
  top: 1px;
  left: 2px;
  width: 12px;
  height: 3px;
  border-radius: 3px 3px 1px 1px;
  background: #94a3b8;
}

.tree-drive-body {
  position: absolute;
  inset: 3px 0 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #dfe7f2 0%, #c2cedd 100%);
  border: 1px solid #9fb0c5;
}

.tree-folder-tab {
  position: absolute;
  top: 0;
  left: 1px;
  width: 7px;
  height: 4px;
  border-radius: 3px 3px 0 0;
  background: #ffd67a;
}

.tree-folder-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  border-radius: 3px;
  background: #ffcd61;
}

.tree-gallery-folder-tab {
  background: #e7b88f;
}

.tree-gallery-folder-body {
  background: #f2c59d;
}

.tree-kind-badge {
  margin-left: auto;
  flex: 0 0 auto;
  justify-self: end;
  padding: 2px 7px;
  border: 1px solid rgba(154, 95, 69, 0.16);
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.96);
  color: #9a5f45;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.tree-file-shape {
  position: relative;
  width: 11px;
  height: 14px;
  border-radius: 3px;
  background: #f5f7fb;
  border: 1px solid #cfd7e4;
}

.tree-file-fold {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 5px;
  height: 5px;
  background: linear-gradient(135deg, #ffffff 0 50%, #e3e8ef 50% 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

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

.tree-children {
  display: grid;
  gap: 2px;
}

.workspace {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
  min-height: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0 18px 18px 0;
  box-shadow: none;
}

.workspace > .toolbar {
  display: none;
}

.toolbar {
  display: grid;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.file-toolbar {
  margin: -16px -16px 16px;
}

.commandbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}

.commandbar {
  min-height: 50px;
}

.commandbar-left,
.commandbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.commandbar-left {
  min-width: 0;
}

.nav-arrow-button {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.nav-arrow-button:hover {
  background: #f3f4f6;
  color: var(--text);
}

.mobile-sidebar-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

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

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  max-width: 220px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.crumb:hover {
  background: #eef2f7;
}

.crumb-root {
  color: #4f46e5;
}

.crumb-icon {
  flex: 0 0 auto;
  line-height: 1;
}

.crumb-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb-separator {
  color: #9ca3af;
  padding: 0 2px;
}

.root-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  white-space: nowrap;
}

.workspace-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(280px, 320px);
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.admin-panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  min-height: 0;
  overflow: hidden;
  background: rgba(244, 246, 249, 0.96);
  backdrop-filter: blur(10px);
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-title {
  margin: 4px 0 0;
}

.admin-tabbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-tab-button {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab-button.active {
  border-color: rgba(59, 130, 246, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  color: #1e3a8a;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.admin-panel-body {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.admin-tab-pane {
  display: none;
  height: 100%;
  min-height: 0;
}

.admin-tab-pane.active {
  display: block;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.admin-users-card,
.admin-form-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-user-list {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.admin-user-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    transform var(--motion-fast) ease;
}

.admin-user-row::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 999px;
  background: transparent;
  transition: background-color var(--motion-fast) ease;
}

.admin-user-row:hover {
  background: #ffffff;
  border-color: #bfd2ee;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.admin-user-row.active {
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  border-color: #7aa2ef;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 28px rgba(37, 99, 235, 0.16);
}

.admin-user-row.active::before {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.admin-user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
  padding-left: 8px;
}

.admin-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #315ea8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-user-row.active strong {
  color: #163b82;
}

.admin-user-row.active .count-text {
  color: #36558c;
}

.admin-user-form {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.admin-storage-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: center;
}

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

.admin-storage-meta {
  align-items: flex-start;
}

@media (max-width: 1180px) {
  .admin-split {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
  }

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

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.file-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 16px 18px;
  overflow: hidden;
}

.file-pane::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.42), rgba(37, 99, 235, 0));
  opacity: 0;
  pointer-events: none;
}

.file-pane.is-refreshing::after {
  animation: pane-refresh-wave 720ms ease;
}

.file-pane[data-effect="navigate"].is-refreshing::after {
  animation-name: pane-navigate-wave;
}

.selection-marquee {
  position: fixed;
  z-index: 70;
  border: 1px solid rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.14);
  border-radius: 10px;
  pointer-events: none;
}

body.marquee-selecting,
body.marquee-selecting * {
  user-select: none !important;
}

.drag-ghost {
  position: fixed;
  top: -9999px;
  left: -9999px;
  z-index: 999;
  pointer-events: none;
}

.drag-ghost-stack {
  position: relative;
  width: 156px;
  height: 156px;
}

.drag-ghost-card {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: stretch;
  padding: 0;
  border: none;
  border-radius: 16px;
  background: transparent;
  box-shadow:
    0 18px 34px rgba(15, 23, 42, 0.18),
    0 2px 6px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.drag-ghost-card-1 {
  transform: translate(8px, 6px);
  opacity: 0.9;
}

.drag-ghost-card-2 {
  transform: translate(16px, 12px);
  opacity: 0.8;
}

.drag-ghost-icon {
  flex: 0 0 auto;
  font-size: 18px;
}

.drag-ghost-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #eef2f7;
}

.drag-ghost-media {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
}

.drag-ghost-media .thumb-media,
.drag-ghost-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drag-ghost-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.drag-ghost-count {
  position: absolute;
  right: -8px;
  bottom: -10px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.28);
}


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

.list-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-text {
  color: var(--muted);
  font-size: 13px;
}

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

#fileInput,
#fileInputInline,
#toolbarDownloadLink,
#toolbarDownloadLinkInline,
#refreshButton,
#refreshButtonInline,
#newFolderButton,
#deleteButton,
.commandbar-actions > .upload-button,
.commandbar-actions > .icon-button[aria-label="Settings"] {
  display: none !important;
}

.selection-actions:empty {
  display: none;
}

.mobile-selection-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 108;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(139, 94, 60, 0.18);
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.96);
  box-shadow: 0 18px 38px rgba(88, 59, 33, 0.16);
  backdrop-filter: blur(14px);
}

.mobile-selection-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-strong);
}

.mobile-selection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.small-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.drop-banner {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: #eff6ff;
  color: var(--primary-strong);
  font-weight: 600;
  animation: fade-slide-up 180ms ease;
}

.list-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 160px;
  gap: 14px;
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}


.file-list {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  overflow: auto;
}

.file-list .animate-in {
  opacity: 0;
  animation: fade-slide-up var(--motion-slow) cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--enter-index, 0) * 22ms);
}

.file-list .pre-animate-in {
  opacity: 0;
}

.file-list.grid-view .animate-in {
  animation-name: grid-card-enter;
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.2, 0.9, 0.2, 1);
  animation-delay: calc(var(--enter-index, 0) * 34ms);
}

.file-list.grid-view .file-row.grid-card.pre-animate-in {
  opacity: 0;
  transform: translateY(18px) scale(0.965);
  filter: saturate(0.88);
}

.file-list.grid-view .file-row.grid-card.animate-in {
  transform-origin: center bottom;
  will-change: transform, opacity, filter;
}

.file-list.grid-view .file-row.grid-card.pre-animate-in .grid-thumb {
  opacity: 0;
  transform: scale(0.94);
}

.file-list.grid-view .file-row.grid-card.animate-in .grid-thumb {
  opacity: 0;
  transform: scale(0.94);
  animation: grid-thumb-reveal 360ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--enter-index, 0) * 34ms + 45ms);
}

.file-list.grid-view .file-row.grid-card.pre-animate-in .grid-title {
  opacity: 0;
  transform: translateY(10px);
}

.file-list.grid-view .file-row.grid-card.animate-in .grid-title {
  opacity: 0;
  transform: translateY(10px);
  animation: grid-title-reveal 300ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--enter-index, 0) * 34ms + 110ms);
}

.mobile-scroll-date-badge {
  position: fixed;
  left: 12px;
  top: 96px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(246, 225, 196, 0.9);
  border-radius: 999px;
  background: rgba(77, 52, 31, 0.92);
  color: #fff8ef;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(88, 59, 33, 0.28);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 160ms ease;
}

.mobile-scroll-date-badge.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.mobile-scroll-handle {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9998;
  display: block;
  opacity: 0;
  visibility: hidden;
  touch-action: none;
  pointer-events: none;
  border-radius: 999px;
  background: transparent;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.mobile-scroll-handle.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-scroll-handle.is-dragging {
  background: transparent;
}

.mobile-scroll-handle-thumb {
  width: 14px;
  min-height: 44px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(240, 226, 207, 0.94);
  border: none;
  box-shadow: 0 6px 16px rgba(88, 59, 33, 0.12);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.mobile-scroll-handle.is-dragging .mobile-scroll-handle-thumb {
  background: rgba(229, 210, 186, 0.96);
  box-shadow: 0 10px 20px rgba(88, 59, 33, 0.16);
}

.file-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 14px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto;
}

.statusbar-text {
  min-width: 0;
  white-space: nowrap;
}

.file-list.grid-view {
  grid-template-columns: repeat(auto-fill, 180px);
  grid-auto-rows: 206px;
  justify-content: start;
  align-content: start;
  gap: 14px;
  padding-top: 12px;
}

.file-list.gallery-mode {
  align-content: start;
}

.file-list.grid-view.gallery-mode {
  display: block;
  padding-top: 12px;
  touch-action: pan-y;
}

.file-list.grid-view.gallery-mode.mobile-selection-active,
.file-list.grid-view.gallery-mode.mobile-selection-active .gallery-section-items,
.file-list.grid-view.gallery-mode.mobile-selection-active .file-row.grid-card,
.file-list.grid-view.gallery-mode.mobile-selection-active .file-row.grid-card .grid-thumb {
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.gallery-section {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}

.gallery-section-items {
  display: grid;
  gap: 14px;
  touch-action: pan-y;
}

.file-list.grid-view.gallery-mode .gallery-section-items {
  grid-template-columns: repeat(auto-fill, 180px);
  grid-auto-rows: 180px;
  justify-content: start;
  align-content: start;
}

.gallery-divider {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  overflow: hidden;
  margin: 30px 0 -6px;
  padding: 0;
  background: rgba(255, 255, 255, 0.92);
  color: #6f7b8d;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
}

.gallery-divider-label {
  display: inline-block;
  padding: 1px 2px 0 0;
  background: transparent;
  line-height: 1;
  transform: none;
}

.gallery-divider::after {
  content: "";
  height: 1px;
  background: #e5e7eb;
}

.file-list.grid-view.gallery-mode .file-row.grid-card {
  grid-template-rows: 1fr;
  min-height: 180px;
  height: 180px;
  padding: 0;
}

.file-list.grid-view.gallery-mode .grid-title {
  display: none;
}

.file-list.grid-view.gallery-mode .file-row.grid-card.gallery-parent-card {
  grid-template-rows: 1fr auto;
}

.file-list.grid-view.gallery-mode .file-row.grid-card .grid-thumb {
  height: 100%;
}

.file-list.grid-view.gallery-mode .file-row.grid-card.gallery-parent-card .grid-title {
  display: block;
  padding: 8px 10px 10px;
}

.file-list.grid-view.gallery-mode .file-row.grid-card.gallery-parent-card .file-name {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.file-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 160px;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 0;
  background: white;
  border: none;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
  text-align: left;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    transform var(--motion-fast) ease,
    opacity var(--motion-fast) ease;
}

.file-select-indicator {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 4;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1.5px solid rgba(139, 94, 60, 0.28);
  background: rgba(255, 251, 245, 0.94);
  box-shadow: 0 4px 10px rgba(88, 59, 33, 0.12);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease, border-color 140ms ease;
  pointer-events: none;
}

.file-select-indicator::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0.8);
  opacity: 0;
  transition: opacity 140ms ease, transform 140ms ease;
}

.file-row.selection-ui-visible .file-select-indicator {
  opacity: 1;
  transform: scale(1);
}

.file-row.selection-ui-visible .file-select-indicator {
  pointer-events: auto;
}

.file-row.selection-ui-visible.selection-checked .file-select-indicator {
  background: linear-gradient(180deg, #8b5e3c 0%, #744826 100%);
  border-color: #744826;
}

.file-row.selection-ui-visible.selection-checked .file-select-indicator::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.file-row.grid-card.selection-checked {
  border-color: rgba(37, 99, 235, 0.5);
  background: #eef4ff;
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.28),
    0 14px 30px rgba(37, 99, 235, 0.12);
}

.file-row:focus,
.file-row:focus-visible {
  outline: none;
}

.file-row.grid-card.selection-checked .grid-thumb::after {
  background: rgba(37, 99, 235, 0.18);
  border-radius: var(--mobile-gallery-tile-radius, 16px) !important;
}

@media (min-width: 721px) {
  .file-row.grid-card.selection-checked .grid-thumb {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.72) inset;
  }

  .file-row.grid-card.selection-checked .grid-thumb::after {
    background: rgba(37, 99, 235, 0.28);
  }

  .file-row.grid-card.selection-checked .file-name {
    color: #1d4ed8;
  }
}

.file-row.selection-checked:not(.active) .file-name {
  color: inherit;
}

.file-row.grid-card {
  position: relative;
  grid-template-columns: 1fr;
  gap: 0;
  width: 180px;
  min-height: 206px;
  padding: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  overflow: hidden;
}

.file-row:hover,
.file-row.active {
  background: #f8fbff;
}

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

.file-row.active {
  background: #e8f0ff;
}

.file-row:not(.grid-card).active {
  box-shadow: inset 4px 0 0 #2563eb;
}

.file-row.grid-card.active {
  border-color: #2563eb;
  background: #e8f0ff;
}

.file-row.selection-pulse {
  animation: selection-pulse 220ms ease;
}

.file-row.drag-over {
  background: #eff6ff;
  outline: 1px solid var(--primary);
}

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

.file-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rename-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: white;
  outline: none;
  font: inherit;
  font-weight: 700;
  color: inherit;
}

.rename-input:focus {
  border-color: #60a5fa;
  box-shadow: none;
}

.file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.grid-thumb {
  position: relative;
  display: grid;
  place-items: center;
  height: 150px;
  border-radius: 0;
  background: #f8fafc;
  overflow: hidden;
}

.file-row.has-image-thumb .grid-thumb::before,
.file-row.has-image-thumb .list-thumb::before {
  content: "IMG";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 248, 238, 0.96) 0%, rgba(240, 226, 207, 0.92) 100%);
  color: rgba(109, 69, 38, 0.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.file-row.has-image-thumb .grid-thumb,
.file-row.has-image-thumb .list-thumb {
  background:
    linear-gradient(180deg, rgba(255, 248, 238, 0.96) 0%, rgba(240, 226, 207, 0.92) 100%);
}

.thumb-debug {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  z-index: 3;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  word-break: break-all;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

.grid-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
  pointer-events: none;
}

.file-row.grid-card.active .grid-thumb::after {
  background: rgba(37, 99, 235, 0.18);
}

.grid-thumb img,
.grid-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-media {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 140ms ease;
}

.thumb-image {
  width: 100%;
  height: 100%;
  display: block;
  background-color: transparent;
  object-fit: cover;
}

.thumb-media.is-ready {
  opacity: 1;
}

.thumb-media.thumb-fallback,
.thumb-media.thumb-fallback.is-ready {
  opacity: 0;
}

.thumb-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0;
  width: 100%;
  height: 100%;
  padding: 16px;
  color: #172033;
}

.folder-thumb {
  background: #edf3ff;
}

.gallery-folder-thumb {
  background: linear-gradient(180deg, #fffaf6 0%, #fff4ea 100%);
}

.video-thumb {
  background: #f1f3f6;
}

.file-thumb {
  background: #f6f3ff;
}

.thumb-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 32, 51, 0.08);
  font-weight: 700;
}

.folder-icon {
  position: relative;
  width: 72px;
  height: 52px;
}

.folder-kind-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 4px 8px;
  border: 1px solid rgba(154, 95, 69, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #9a5f45;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
}

.folder-tab {
  position: absolute;
  top: 2px;
  left: 8px;
  width: 28px;
  height: 12px;
  border-radius: 10px 10px 4px 4px;
  background: #f4c968;
}

.folder-body {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  bottom: 0;
  border-radius: 12px;
  background: #ffcf63;
}

.gallery-folder-tab {
  background: #e7b88f;
}

.gallery-folder-body {
  background: linear-gradient(180deg, #f7d4af 0%, #f1c18f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.grid-title {
  display: grid;
  gap: 4px;
  padding: 12px 12px 0;
}

.grid-card .file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  overflow: hidden;
  flex: 0 0 40px;
}

.list-thumb .thumb-debug {
  left: 2px;
  right: 2px;
  bottom: 2px;
  font-size: 10px;
  padding: 4px 5px;
}

.list-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.file-row.active .list-thumb {
  border-color: rgba(37, 99, 235, 0.3);
  background: #eef4ff;
}

.file-row.active .list-thumb::after {
  background: rgba(37, 99, 235, 0.1);
}

.list-thumb img,
.list-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-thumb .thumb-card {
  gap: 0;
  padding: 0;
  justify-items: stretch;
  align-content: stretch;
  background: transparent;
}

.list-thumb .thumb-kind,
.list-thumb .thumb-ext {
  display: none;
}

.list-thumb .thumb-glyph {
  width: 100%;
  height: 100%;
  border-radius: 0;
  font-size: 12px;
  background: transparent;
  border: none;
}

.file-meta {
  color: var(--muted);
  font-size: 13px;
}

.file-row.active .file-name {
  color: #1d4ed8;
}

.file-row.clipboard-cut {
  opacity: 0.5;
}

.file-row.clipboard-cut .file-name {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.file-row.clipboard-cut .list-thumb,
.file-row.clipboard-cut .grid-thumb {
  filter: grayscale(0.08);
}

.preview-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: #fbfcfe;
  padding: 16px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  scrollbar-width: none;
}

.preview-pane::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.pane-resizer {
  position: relative;
  cursor: col-resize;
  background: transparent;
}

.pane-resizer::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: 0 auto;
  width: 1px;
  background: var(--border);
}

.pane-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 48px;
  border-radius: 999px;
  background: #cbd5e1;
  transform: translate(-50%, -50%);
}

.pane-resizer:hover::after,
.pane-resizer.is-dragging::after {
  background: var(--primary);
}

.preview-empty,
.preview-content {
  flex: 1;
  height: 100%;
  min-height: 0;
}

.preview-empty {
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: white;
  border: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

.preview-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  overflow: hidden;
  scrollbar-width: none;
  padding-right: 4px;
  min-height: 0;
}

.preview-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.preview-image,
.preview-video,
.preview-pdf {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  border-radius: 16px;
  background: #f3f4f6;
  object-fit: contain;
}

.preview-enter {
  animation: preview-enter 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.preview-pdf {
  min-height: 0;
  border: 1px solid var(--border);
  background: white;
  width: calc(100% + 18px);
  max-width: none;
  margin-right: -18px;
}

body.is-resizing-panels .preview-pdf {
  pointer-events: none;
}

.preview-markdown {
  display: block;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  overflow: auto;
  scrollbar-width: none;
  padding: 18px 20px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--border);
  line-height: 1.65;
  color: var(--text);
  overflow-wrap: anywhere;
}

.preview-markdown::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.mobile-preview-body,
.mobile-preview-body .preview-content,
.mobile-preview-body .preview-markdown {
  scrollbar-width: none;
}

.mobile-preview-body::-webkit-scrollbar,
.mobile-preview-body .preview-content::-webkit-scrollbar,
.mobile-preview-body .preview-markdown::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.preview-pane,
.preview-pane *,
.mobile-preview-body,
.mobile-preview-body * {
  scrollbar-width: none !important;
  -ms-overflow-style: none;
}

.preview-pane::-webkit-scrollbar,
.preview-pane *::-webkit-scrollbar,
.mobile-preview-body::-webkit-scrollbar,
.mobile-preview-body *::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.preview-markdown > :first-child {
  margin-top: 0;
}

.preview-markdown > :last-child {
  margin-bottom: 0;
}

.preview-markdown h1,
.preview-markdown h2,
.preview-markdown h3,
.preview-markdown h4 {
  margin: 1.2em 0 0.5em;
  line-height: 1.3;
}

.preview-markdown p,
.preview-markdown ul,
.preview-markdown ol,
.preview-markdown pre,
.preview-markdown blockquote {
  margin: 0.7em 0;
}

.preview-markdown ul,
.preview-markdown ol {
  padding-left: 1.4em;
}

.preview-markdown code {
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: #f3f4f6;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.preview-markdown pre {
  padding: 14px 16px;
  border-radius: 12px;
  background: #111827;
  color: #f8fafc;
  overflow: auto;
}

.preview-markdown pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.preview-markdown blockquote {
  padding-left: 14px;
  border-left: 3px solid #cbd5e1;
  color: #475569;
}

.preview-markdown a {
  color: var(--primary-strong);
  text-decoration: none;
}

.preview-markdown a:hover {
  text-decoration: underline;
}

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

.meta-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: white;
  border: 1px solid var(--border);
}

.meta-item span {
  color: var(--muted);
  font-size: 11px;
}

.hidden {
  display: none !important;
}

.screen-enter {
  animation: fade-scale-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

  .commandbar,
  .list-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .commandbar-actions,
  .selection-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .workspace-body {
    grid-template-columns: 1fr;
  }

  .login-window {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-art {
    min-height: 240px;
  }

  .sidebar {
    border-right: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
  }

  .sidebar-resizer {
    display: none;
  }

  .workspace {
    border-radius: 0 0 18px 18px;
  }

  .preview-pane {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-top: 16px;
  }

  .pane-resizer {
    display: none;
  }
}

@media (max-width: 720px) {
  html,
  body {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
    overscroll-behavior: auto;
  }

  body {
    position: static;
    inset: auto;
    zoom: 1;
  }

  .window-shell {
    display: block;
    height: auto;
    min-height: 100dvh;
    padding: 0;
  }

  .login-screen {
    height: auto;
    min-height: 100dvh;
    align-content: start;
    padding: 12px;
  }

  .transfer-stack {
    right: 12px;
    bottom: 12px;
  }

  .login-panel {
    padding: 24px 18px;
  }

  .login-art {
    display: none;
  }

  .login-window {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .sidebar,
  .workspace,
  .workspace-body,
  .file-pane,
  .preview-pane,
  .admin-panel,
  .admin-panel-body,
  .admin-split,
  .admin-users-card,
  .admin-form-card,
  .admin-tab-pane {
    min-height: auto;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 80;
    width: min(84vw, 340px);
    margin-bottom: 0;
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
    border-right: 1px solid var(--border);
    border-radius: 0 22px 22px 0;
    box-shadow: 0 24px 40px rgba(15, 23, 42, 0.22);
    transform: translateX(calc(-100% - 18px));
    transition:
      transform var(--motion-base) ease,
      box-shadow var(--motion-base) ease;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .window-shell.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    border: 0;
    background: rgba(43, 31, 20, 0.28);
    backdrop-filter: blur(2px);
  }

  .tree-panel {
    min-height: 0;
    overflow: visible;
  }

  .folder-tree {
    height: auto;
    max-height: 40dvh;
  }

  .workspace-body {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .workspace {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .workspace > .toolbar,
  .workspace-body,
  .file-pane {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .list-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .list-title,
  .selection-actions {
    width: auto;
  }

  .file-pane,
  .preview-pane,
  .admin-panel {
    padding-bottom: 0;
  }

  .file-pane {
    order: 1;
    padding: 0;
  }

  .preview-pane {
    display: none;
  }

  .file-list,
  .admin-user-list,
  .admin-storage-list,
  .storage-browser-list,
  .browse-list {
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .file-list.grid-view {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 10px;
  }

  .file-list.grid-view.gallery-mode .gallery-section-items {
    grid-template-columns: repeat(var(--mobile-gallery-columns, 3), minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 6px;
  }

  .file-row.grid-card,
  .file-list.grid-view.gallery-mode .file-row.grid-card {
    width: auto;
    max-width: none;
    min-width: 0;
    min-height: 0;
    height: auto;
  }

  .file-row.grid-card {
    padding-bottom: 10px;
    grid-template-rows: auto auto;
  }

  .grid-thumb {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .file-list.grid-view.gallery-mode .file-row.grid-card .grid-thumb {
    height: auto;
  }

  .grid-title {
    padding: 10px 8px 0;
  }

  .grid-card .file-name {
    font-size: 12px;
    line-height: 1.35;
  }

  .file-statusbar,
  .commandbar-actions,
  .selection-actions {
    flex-wrap: wrap;
  }

  .mobile-sidebar-toggle {
    display: inline-flex;
    position: static;
    z-index: auto;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid rgba(139, 94, 60, 0.18);
    border-radius: 12px;
    background: rgba(255, 251, 245, 0.94);
    box-shadow: 0 12px 24px rgba(88, 59, 33, 0.14);
    backdrop-filter: blur(10px);
  }

  .commandbar-left {
    width: 100%;
    flex-wrap: nowrap;
  }

  .toolbar {
    border-bottom: 1px solid var(--border);
  }

  .file-toolbar {
    margin: 0 0 12px;
  }

  .commandbar,
  .inline-toolbar-shell {
    padding-inline: 12px;
  }

  .list-header,
  .drop-banner,
  .list-columns,
  .file-statusbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .file-list {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    max-height: calc(100dvh - 168px);
    scrollbar-width: none;
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .file-list.mobile-selection-active {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .file-list::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .file-list::-webkit-scrollbar-track {
    background: transparent;
  }

  .file-list::-webkit-scrollbar-thumb {
    background: transparent;
    border: none;
  }

  .breadcrumb-trail {
    flex: 1 1 220px;
    min-width: 0;
    margin-left: 0;
  }

  .file-toolbar {
    margin-top: 0;
  }

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

  .list-columns,
  .file-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-meta {
    text-align: left;
  }
}

/* Dotori brand overrides */
:root {
  --bg: #f7f0e6;
  --bg-accent: #efe4d4;
  --panel: rgba(255, 251, 245, 0.96);
  --panel-strong: #fffdf8;
  --border: rgba(94, 67, 40, 0.14);
  --border-strong: rgba(139, 94, 60, 0.28);
  --text: #4b311e;
  --muted: #8b7766;
  --primary: #8b5e3c;
  --primary-strong: #6d4526;
  --shadow: 0 18px 40px rgba(88, 59, 33, 0.1);
}

body {
  font-family: "SUIT Variable", "Pretendard Variable", "Noto Sans KR", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(233, 196, 106, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(58, 90, 64, 0.1), transparent 24%),
    linear-gradient(180deg, #fcf7f0 0%, #f5ebdf 100%);
}

.boot-card,
.dialog-card,
.context-menu,
.transfer-item {
  background: rgba(255, 251, 245, 0.96);
  border-color: rgba(94, 67, 40, 0.14);
  box-shadow: 0 18px 40px rgba(88, 59, 33, 0.1);
}

.login-window {
  width: min(1180px, 100%);
  min-height: 760px;
  background: rgba(255, 251, 245, 0.96);
  border-color: rgba(94, 67, 40, 0.16);
  box-shadow: 0 28px 70px rgba(88, 59, 33, 0.16);
}

.login-art {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "brand ."
    ". hero";
  gap: 24px;
  padding: 38px 34px 34px;
  background:
    radial-gradient(circle at 20% 12%, rgba(233, 196, 106, 0.22), transparent 24%),
    linear-gradient(180deg, #fff8ef 0%, #f5e8d7 100%);
}

.login-sun,
.login-hill {
  display: none;
}

.login-brand-lockup {
  grid-area: brand;
  position: static;
  display: grid;
  gap: 0;
  max-width: 560px;
  align-self: start;
  padding-left: 2px;
}

.login-brand-wordmark {
  width: min(520px, 100%);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(109, 69, 38, 0.08));
}

.login-brand-copy {
  max-width: 420px;
  margin: 22px 0 0 14px;
  color: #8a755f;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.86;
}

.login-hero-logo-wrap {
  grid-area: hero;
  display: inline-flex;
  justify-self: end;
  align-self: end;
  width: fit-content;
  align-items: flex-end;
  margin-right: 6px;
  margin-bottom: 2px;
}

.login-hero-logo {
  width: 188px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 34px rgba(109, 69, 38, 0.12));
}

.login-panel {
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.98) 0%, rgba(248, 240, 229, 0.96) 100%);
}

.login-header {
  justify-items: start;
  grid-template-columns: auto 1fr;
  gap: 18px;
  margin-bottom: 32px;
}

.login-header-copy {
  display: grid;
  gap: 6px;
}

.login-header-copy .eyebrow {
  margin: 0;
}

.login-server-icon {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffdfa 0%, #f8ecde 100%);
  border: 1px solid rgba(139, 94, 60, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 16px 32px rgba(88, 59, 33, 0.08);
}

.login-server-icon img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.login-header h2 {
  font-size: 34px;
  letter-spacing: -0.04em;
  color: #5a3820;
}

.field > span,
.dialog-input-label {
  color: #7c6551;
  font-weight: 700;
}

.field input,
.dialog-input,
.admin-user-form input,
.admin-user-form select {
  border: 1px solid rgba(139, 94, 60, 0.16);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.field input:focus,
.dialog-input:focus,
.admin-user-form input:focus,
.admin-user-form select:focus {
  border-color: rgba(139, 94, 60, 0.42);
  outline: none;
  box-shadow: 0 0 0 4px rgba(233, 196, 106, 0.18);
}

.path-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.path-picker-row input[readonly] {
  cursor: default;
}

.login-submit,
.primary-button,
.upload-button {
  background: linear-gradient(180deg, #8b5e3c 0%, #744826 100%);
  border-color: transparent;
  color: #fff8ee;
  box-shadow: 0 14px 24px rgba(109, 69, 38, 0.18);
}

.login-submit:hover,
.primary-button:hover,
.upload-button:hover {
  background: linear-gradient(180deg, #976848 0%, #7d4f2c 100%);
}

.ghost-button,
.download-link {
  background: rgba(255, 251, 245, 0.94);
  border-color: rgba(139, 94, 60, 0.14);
  color: #5b3d28;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.ghost-button:hover,
.download-link:hover {
  background: #fff8ef;
  border-color: rgba(139, 94, 60, 0.24);
}

.window-shell {
  padding: 20px;
}

.sidebar {
  gap: 18px;
  padding: 24px 20px;
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.98) 0%, rgba(247, 238, 226, 0.96) 100%);
  border-color: rgba(139, 94, 60, 0.14);
  box-shadow: 18px 0 32px rgba(88, 59, 33, 0.06);
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.sidebar-brand-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffdf8 0%, #f6eadc 100%);
  border: 1px solid rgba(139, 94, 60, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sidebar-brand-mark img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.sidebar-brand-copy {
  min-width: 0;
}

.sidebar-head h1 {
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.05em;
  color: #5a3820;
}

.sidebar-brand-subcopy {
  margin: 8px 0 0;
  color: #86715d;
  line-height: 1.55;
}

.eyebrow {
  color: #5f714d;
}

.sidebar-status-badge {
  border-color: rgba(58, 90, 64, 0.18);
  background: rgba(90, 117, 77, 0.1);
  color: #506443;
}

.storage-select-wrap {
  min-height: 52px;
  padding: 0 14px;
  border-color: rgba(139, 94, 60, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98) 0%, rgba(246, 237, 224, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(88, 59, 33, 0.06);
}

.storage-select-wrap.is-open {
  border-color: rgba(139, 94, 60, 0.28);
}

.storage-select-icon {
  color: #5f714d;
}

.drive-icon {
  position: relative;
  display: inline-flex;
  width: 22px;
  height: 16px;
}

.drive-icon-top {
  position: absolute;
  left: 1px;
  right: 1px;
  top: 0;
  height: 5px;
  border-radius: 999px;
  background: #c69354;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.drive-icon-base {
  position: absolute;
  inset: 4px 0 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #5f714d 0%, #3a5a40 100%);
}

.storage-select-menu {
  border-color: rgba(139, 94, 60, 0.14);
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 18px 36px rgba(88, 59, 33, 0.14);
}

.storage-select-option {
  border-radius: 14px;
}

.storage-select-option.active,
.storage-select-option:hover {
  background: linear-gradient(180deg, rgba(240, 227, 206, 0.92) 0%, rgba(250, 244, 234, 0.98) 100%);
  color: #5a3820;
}

.nav-item {
  border-radius: 16px;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(180deg, #fffdfa 0%, #f4eadc 100%);
  border-color: rgba(139, 94, 60, 0.14);
}

.storage-group .nav-item {
  min-height: 52px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98) 0%, rgba(246, 237, 224, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(88, 59, 33, 0.06);
}

.storage-group .nav-item:hover,
.storage-group .nav-item.active {
  background: linear-gradient(180deg, #fff8ee 0%, #f0e2cf 100%);
  border-color: rgba(139, 94, 60, 0.24);
}

.nav-drive-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}

.folder-tree {
  padding-right: 6px;
}

.sidebar-admin-button,
.sidebar-logout-button {
  min-height: 44px;
  border-radius: 16px;
}

.workspace,
.file-pane,
.preview-pane,
.toolbar,
.admin-panel {
  background: rgba(255, 251, 245, 0.9);
}

.workspace {
  border: 1px solid rgba(139, 94, 60, 0.14);
  border-radius: 0 22px 22px 0;
  box-shadow: 0 22px 48px rgba(88, 59, 33, 0.08);
}

.toolbar {
  border-bottom-color: rgba(139, 94, 60, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96) 0%, rgba(248, 239, 228, 0.94) 100%);
}

.commandbar,
.inline-toolbar-shell {
  padding-inline: 18px;
}

.nav-arrow-button,
.view-button {
  border-color: rgba(139, 94, 60, 0.14);
  background: rgba(255, 251, 245, 0.94);
}

.view-button.active,
.nav-arrow-button:hover {
  background: linear-gradient(180deg, #fff8ee 0%, #f0e2cf 100%);
  border-color: rgba(139, 94, 60, 0.24);
  color: #6d4526;
}

.breadcrumb-trail {
  color: #765f4b;
}

.file-pane,
.preview-pane {
  border-color: rgba(139, 94, 60, 0.12);
}

.file-list {
  gap: 14px;
  padding: 16px 18px 20px;
}

.file-row {
  border-color: rgba(139, 94, 60, 0.12);
  background: rgba(255, 253, 249, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 20px rgba(88, 59, 33, 0.06);
}

.file-row:hover {
  border-color: rgba(139, 94, 60, 0.22);
  background: #fff9f1;
}

.file-row.active {
  border-color: rgba(95, 113, 77, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 24px rgba(58, 90, 64, 0.12);
}

.file-list.grid-view {
  grid-template-columns: repeat(auto-fill, 188px);
  grid-auto-rows: 188px;
}

.file-list.grid-view.gallery-mode .gallery-section-items {
  grid-template-columns: repeat(auto-fill, 188px);
  grid-auto-rows: 188px;
}

.file-list.grid-view.gallery-mode .file-row.grid-card {
  min-height: 188px;
  height: 188px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

.grid-thumb {
  height: 156px;
  border-radius: 20px;
  background: linear-gradient(180deg, #f7ecdf 0%, #efdfc7 100%);
}

.file-list.grid-view.gallery-mode .file-row.grid-card .grid-thumb {
  border-radius: 20px;
}

.gallery-divider {
  color: #6a5a45;
  background: transparent;
}

.gallery-divider::after {
  background: rgba(139, 94, 60, 0.18);
}

.statusbar-text,
.count-text {
  color: #8b7766;
}

.admin-panel {
  background:
    linear-gradient(180deg, rgba(252, 247, 239, 0.98) 0%, rgba(245, 236, 224, 0.96) 100%);
}

.admin-tabbar {
  border-color: rgba(139, 94, 60, 0.14);
  background: rgba(255, 251, 245, 0.84);
}

.admin-tab-button.active {
  border-color: rgba(139, 94, 60, 0.2);
  background: linear-gradient(180deg, #fff9f1 0%, #f1e2cf 100%);
  color: #6b4528;
  box-shadow: 0 8px 18px rgba(109, 69, 38, 0.08);
}

.admin-users-card,
.admin-form-card {
  border-color: rgba(139, 94, 60, 0.12);
  background: rgba(255, 252, 247, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 34px rgba(88, 59, 33, 0.08);
}

.admin-user-row {
  border-color: rgba(139, 94, 60, 0.1);
  background: rgba(255, 252, 247, 0.92);
}

.admin-user-row:hover {
  background: #fffaf2;
  border-color: rgba(139, 94, 60, 0.18);
}

.admin-user-row.active {
  background: linear-gradient(180deg, rgba(255, 249, 241, 0.98) 0%, rgba(240, 227, 206, 0.96) 100%);
  border-color: rgba(139, 94, 60, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 28px rgba(109, 69, 38, 0.12);
}

.admin-user-row.active::before {
  background: linear-gradient(180deg, #c69354 0%, #8b5e3c 100%);
}

.admin-role-badge {
  background: rgba(95, 113, 77, 0.12);
  color: #556649;
}

.checkbox-row input[type="checkbox"] {
  border-color: rgba(139, 94, 60, 0.2);
  background: rgba(255, 252, 247, 0.96);
}

.checkbox-row input[type="checkbox"]:checked {
  background: linear-gradient(180deg, #8b5e3c 0%, #744826 100%);
  border-color: #744826;
}

@media (max-width: 1180px) {
  .login-art {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "brand"
      "hero";
  }

  .login-hero-logo-wrap {
    justify-self: start;
    margin-right: 0;
  }

  .login-hero-logo {
    width: min(240px, 100%);
  }
}

@media (max-width: 720px) {
  #appShell {
    padding: 0 !important;
  }

  .login-art {
    display: none !important;
  }

  .login-window {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }

  .file-list.grid-view {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 10px;
  }

  .file-list.grid-view.gallery-mode .gallery-section-items {
    grid-template-columns: repeat(var(--mobile-gallery-columns, 3), minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 2px;
  }

  .gallery-section {
    content-visibility: visible;
    contain-intrinsic-size: auto;
  }

  .file-list.grid-view.gallery-mode .file-row.grid-card.selection-pulse {
    animation: none;
  }

  .file-row.grid-card,
  .file-list.grid-view.gallery-mode .file-row.grid-card {
    width: auto;
    min-width: 0;
    min-height: 0;
    height: auto;
  }

  .file-row.grid-card {
    grid-template-rows: auto auto;
    padding-bottom: 10px;
  }

  .grid-thumb,
  .file-list.grid-view.gallery-mode .file-row.grid-card .grid-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: var(--mobile-gallery-tile-radius, 16px);
  }

  .file-list.grid-view.gallery-mode .file-row.grid-card {
    position: relative;
    aspect-ratio: 1 / 1;
    grid-template-rows: 1fr;
    padding-bottom: 0;
    overflow: hidden;
    border-radius: var(--mobile-gallery-tile-radius, 16px);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
  }

  .file-list.grid-view.gallery-mode .file-row.grid-card .grid-thumb {
    height: 100%;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
  }

  .grid-title {
    padding: 10px 8px 0;
  }

  .grid-card .file-name {
    font-size: 12px;
    line-height: 1.35;
  }

}
