:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel2: #202633;
  --panel3: #11161d;
  --text: #edf2f7;
  --muted: #9aa8ba;
  --line: #303847;
  --accent: #42d392;
  --accent2: #8ff0c1;
  --name-hover: #8ff0c1;
  --soft: rgba(66, 211, 146, 0.14);
  --good: #42d392;
  --goodsoft: rgba(66, 211, 146, 0.14);
  --bad: #ff5d5d;
  --warn: #ffd166;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.26);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  --mono:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}
body.light {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel2: #eef2f7;
  --panel3: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --line: #d7dee8;
  --soft: rgba(66, 211, 146, 0.16);
  --name-hover: #087a55;
  --shadow: 0 18px 45px rgba(31, 41, 55, 0.12);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  background: var(--bg);
}
body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  transition: color 0.18s ease;
}
body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  min-height: 100vh;
  z-index: 0;
  pointer-events: none;
  --wrap-width: min(1120px, calc(100vw - 32px));
  --wrap-left: calc((100vw - var(--wrap-width)) / 2);
  --glow-x: calc(var(--wrap-left) + clamp(118px, 13.5vw, 185px));
  --glow-y: clamp(92px, 5.6vw, 120px);
  --glow-size: clamp(34rem, 38vw, 44rem);
  background:
    radial-gradient(
      circle var(--glow-size) at var(--glow-x) var(--glow-y),
      rgba(66, 211, 146, 0.24) 0,
      rgba(66, 211, 146, 0.18) 18%,
      rgba(66, 211, 146, 0.11) 38%,
      rgba(66, 211, 146, 0.05) 58%,
      rgba(66, 211, 146, 0) 78%
    ),
    linear-gradient(180deg, #141821 0%, var(--bg) 54%, #090b0f 100%);
  transform: none;
}
body.light::before {
  background:
    radial-gradient(
      circle var(--glow-size) at var(--glow-x) var(--glow-y),
      rgba(66, 211, 146, 0.23) 0,
      rgba(66, 211, 146, 0.17) 18%,
      rgba(66, 211, 146, 0.1) 38%,
      rgba(66, 211, 146, 0.045) 58%,
      rgba(66, 211, 146, 0) 78%
    ),
    linear-gradient(180deg, #fff8f1 0%, var(--bg) 56%, #e9edf5 100%);
}
body > main {
  position: relative;
  z-index: 1;
}
a {
  color: inherit;
  text-decoration: none;
}
.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}
h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 3.15rem);
  line-height: 1;
  letter-spacing: -0.045em;
}
.subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.5;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.92rem;
}
body.light .badge {
  background: rgba(255, 255, 255, 0.7);
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 12px var(--good);
  flex: 0 0 auto;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.theme-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 1.15rem;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(66, 211, 146, 0.75);
  background: var(--goodsoft);
  box-shadow: 0 0 0 3px rgba(66, 211, 146, 0.16);
  outline: 0;
}
body.light .theme-toggle {
  background: rgba(255, 255, 255, 0.7);
}
.login-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.92rem;
}
.logout-form {
  display: contents;
}
body.light .login-pill {
  background: rgba(255, 255, 255, 0.7);
}
.logout-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
}
.logout-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}
.logout-icon:hover,
.logout-icon:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(66, 211, 146, 0.75);
  background: var(--goodsoft);
  box-shadow: 0 0 0 3px rgba(66, 211, 146, 0.16);
  outline: 0;
}
body.light .logout-icon {
  background: rgba(17, 24, 39, 0.045);
}
.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}
.copy-base-btn {
  white-space: nowrap;
}
.dropdown {
  position: relative;
  z-index: 1;
}
.dropdown.open {
  z-index: 120;
}
.dropdown > button {
  min-width: 96px;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 121;
  display: none;
  min-width: 170px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}
body.light .dropdown-menu {
  background: rgba(255, 255, 255, 0.96);
}
.dropdown.open .dropdown-menu {
  display: grid;
  gap: 4px;
  animation: toastIn 0.14s ease both;
}
.dropdown-menu button {
  width: 100%;
  text-align: left;
  border-radius: 9px;
  padding: 9px 10px;
  background: transparent;
}
.dropdown-menu {
  background: #121820;
  border-color: rgba(66, 211, 146, 0.45);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.045);
}
.dropdown-menu button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}
.dropdown-menu button:hover,
.dropdown-menu button:focus {
  color: #ffffff;
  background: rgba(66, 211, 146, 0.2);
  border-color: rgba(66, 211, 146, 0.75);
  box-shadow: none;
}
body.light .dropdown-menu {
  background: #ffffff;
  border-color: rgba(66, 211, 146, 0.55);
  box-shadow:
    0 18px 45px rgba(31, 41, 55, 0.16),
    0 0 0 1px rgba(17, 24, 39, 0.045);
}
body.light .dropdown-menu button {
  color: #111827;
  background: rgba(17, 24, 39, 0.035);
}
body.light .dropdown-menu button:hover,
body.light .dropdown-menu button:focus {
  color: #111827;
  background: rgba(66, 211, 146, 0.18);
}
.toolbar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.toolbar input[type="search"] {
  flex: 1 1 360px;
  min-width: 240px;
}
.toolbar-actions {
  position: relative;
  z-index: 41;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
.toolbar-actions > button,
.toolbar-actions > .action,
.toolbar-actions > .dropdown > button {
  width: 100px;
  min-width: 100px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
}
.toolbar-separator {
  width: 1px;
  height: 34px;
  margin: 0 4px 0 6px;
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  flex: 0 0 auto;
}
.logout-btn {
  white-space: nowrap;
}
.toolbar .action {
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 12px;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.toolbar-actions > .action {
  padding: 0 12px;
}
input,
select,
button,
textarea {
  font: inherit;
}
input,
select,
button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}
body.light input,
body.light select,
body.light button {
  background: rgba(255, 255, 255, 0.74);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--good);
  box-shadow: 0 0 0 3px rgba(66, 211, 146, 0.16);
}
button:hover,
button:focus-visible {
  border-color: var(--good);
  box-shadow: 0 0 0 3px rgba(66, 211, 146, 0.16);
}
button:focus:not(:focus-visible):not(:hover) {
  border-color: var(--line);
  box-shadow: none;
}
input,
select,
textarea {
  caret-color: var(--good);
}
select {
  color: var(--text);
  background-color: #151a22;
  color-scheme: dark;
}
select option {
  color: #edf2f7;
  background-color: #171a21;
}
select option:checked {
  color: #ffffff;
  background-color: #307857;
}
body.light select {
  color: #111827;
  background-color: #ffffff;
  color-scheme: light;
}
body.light select option {
  color: #111827;
  background-color: #ffffff;
}
body.light select option:checked {
  color: #111827;
  background-color: #baf3d6;
}
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  filter: invert(1) brightness(2.2);
  opacity: 1;
}
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.92;
  background:
    linear-gradient(
      45deg,
      transparent 42%,
      #ffffff 42%,
      #ffffff 58%,
      transparent 58%
    ),
    linear-gradient(
      -45deg,
      transparent 42%,
      #ffffff 42%,
      #ffffff 58%,
      transparent 58%
    );
}
input[type="search"]::-webkit-search-cancel-button:hover {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(66, 211, 146, 0.38));
}
body.light input[type="search"]::-webkit-search-cancel-button {
  background:
    linear-gradient(
      45deg,
      transparent 42%,
      #111827 42%,
      #111827 58%,
      transparent 58%
    ),
    linear-gradient(
      -45deg,
      transparent 42%,
      #111827 42%,
      #111827 58%,
      transparent 58%
    );
}
button {
  cursor: pointer;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
}
button:hover {
  transform: translateY(-1px);
  border-color: rgba(66, 211, 146, 0.75);
  background: var(--goodsoft);
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}
.panel,
.editor,
.login-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(23, 26, 33, 0.88);
  box-shadow: none;
  backdrop-filter: blur(12px);
}
.panel {
  overflow: visible;
}
.editor,
.login-card {
  overflow: hidden;
}
body.light .panel,
body.light .editor,
body.light .login-card {
  background: rgba(255, 255, 255, 0.88);
}
#browserPanel,
#content,
.file-table,
.file-table tbody,
.file-table tr {
  overflow: visible;
}

#browserPanel {
  position: relative;
  z-index: 20;
}
body.item-menu-open #browserPanel {
  z-index: 50;
}

#content {
  transform-origin: top center;
}
#content.folder-loading {
  opacity: 0.42;
  transform: translateY(2px);
  pointer-events: none;
  transition:
    opacity 90ms ease,
    transform 90ms ease;
}
#content.folder-enter {
  animation: folderContentIn 150ms ease-out both;
}
@keyframes folderContentIn {
  from {
    opacity: 0.42;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  #content.folder-loading {
    opacity: 0.7;
    transform: none;
    transition: none;
  }
  #content.folder-enter {
    animation: none;
  }
}

#browserPanel > .pathbar {
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}
#browserPanel #content > .message:first-child {
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}
#browserPanel .item-menu.open {
  z-index: 300;
}
#browserPanel .item-menu-list {
  z-index: 301;
}
.file-table td,
.file-table th {
  overflow: hidden;
}
.file-table td.actions-cell,
.file-table th.actions-cell {
  overflow: visible;
  white-space: nowrap;
  padding-right: 18px;
  text-align: right;
}
.file-table td.size-cell,
.file-table th.size-cell {
  padding-right: 18px;
  text-align: right;
  white-space: nowrap;
}
.size-value {
  display: inline-block;
  min-width: 3.25ch;
  text-align: right;
}
.file-table td.path-cell,
.file-table th.path-cell {
  padding-right: 18px;
}
.pathbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}
body.light .pathbar,
body.light .editor-head {
  background: rgba(255, 255, 255, 0.55);
}
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}
.breadcrumbs button {
  padding: 6px 9px;
  border-radius: 9px;
  background: transparent;
}
.sep {
  color: #5e6977;
}
.stats {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}
.selection-bar-host {
  margin-top: 12px;
}
.selection-bar-host:empty {
  display: none;
}
.bulkbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: rgba(23, 26, 33, 0.96);
}
.bulkbar.show {
  position: relative;
  z-index: 30;
  display: flex;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: none;
  backdrop-filter: blur(14px);
  isolation: isolate;
}
body.light .bulkbar {
  background: rgba(255, 255, 255, 0.96);
}
.bulkbar .action {
  border-radius: 10px;
}
.bulk-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bulk-actions .action {
  min-height: 32px;
}
.select-col {
  width: 44px;
  text-align: center;
}
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  border: 1px solid #46515f;
  border-radius: 4px;
  background: #2a313b;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  flex: 0 0 auto;
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease,
    box-shadow 0.12s ease;
}
input[type="checkbox"]:hover {
  border-color: #5a6778;
}
input[type="checkbox"]:focus-visible {
  border-color: var(--good);
  box-shadow: 0 0 0 3px rgba(66, 211, 146, 0.16);
}
input[type="checkbox"]:checked,
input[type="checkbox"]:indeterminate {
  background-color: var(--good);
  border-color: var(--good);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #5c6775;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:indeterminate::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: #5c6775;
}
body.light input[type="checkbox"] {
  border-color: #c6d0dc;
  background: #dde3eb;
}
body.light input[type="checkbox"]:hover {
  border-color: #a9b5c4;
}
body.light input[type="checkbox"]:checked,
body.light input[type="checkbox"]:indeterminate {
  border-color: var(--good);
  background-color: var(--good);
}
body.light input[type="checkbox"]:checked::after {
  border-color: #123b2e;
  background: transparent;
}
body.light input[type="checkbox"]:indeterminate::after {
  border-color: transparent;
  background: #123b2e;
}
tbody tr.selected {
  background: rgba(66, 211, 146, 0.115);
}
.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  padding: 26px;
  background: rgba(10, 12, 16, 0.58);
  backdrop-filter: blur(7px);
  pointer-events: none;
}
.upload-overlay.show {
  display: grid;
  place-items: center;
  animation: overlayIn 0.14s ease both;
}
.upload-overlay.hiding {
  display: grid;
  place-items: center;
  animation: overlayOut 0.18s ease both;
}
.upload-overlay-frame {
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(66, 211, 146, 0.78);
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.upload-overlay-card {
  position: relative;
  z-index: 1;
  max-width: min(560px, calc(100vw - 72px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(23, 26, 33, 0.86);
  box-shadow: var(--shadow);
  text-align: center;
}
body.light .upload-overlay {
  background: rgba(244, 246, 250, 0.58);
}
body.light .upload-overlay-card {
  background: rgba(255, 255, 255, 0.9);
}
.upload-overlay-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.2rem;
}
.upload-overlay-card span {
  color: var(--muted);
  line-height: 1.45;
}
@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes overlayOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
tr.dragging {
  opacity: 0.45;
}
tr.drop-target {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
  background: rgba(66, 211, 146, 0.14);
}
.breadcrumbs button.drop-target {
  border-color: var(--accent);
  background: rgba(66, 211, 146, 0.14);
  color: var(--text);
}
table {
  width: 100%;
  border-collapse: collapse;
}
.file-table {
  table-layout: fixed;
}
.file-table th:nth-child(1),
.file-table td:nth-child(1) {
  width: 44px;
}
.file-table th:nth-child(2),
.file-table td:nth-child(2) {
  width: 28%;
}
.file-table th:nth-child(3),
.file-table td:nth-child(3) {
  width: 40%;
}
.file-table th:nth-child(4),
.file-table td:nth-child(4) {
  width: 96px;
}
.file-table th:nth-child(5),
.file-table td:nth-child(5) {
  width: 104px;
}
th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(48, 56, 71, 0.66);
  text-align: left;
  vertical-align: middle;
  min-width: 0;
  overflow: hidden;
}
body.light th,
body.light td {
  border-bottom-color: rgba(215, 222, 232, 0.9);
}
th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.025);
  user-select: none;
}
body.light th {
  background: rgba(17, 24, 39, 0.035);
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr:hover {
  background: rgba(66, 211, 146, 0.075);
}
@media (min-width: 761px) {
  .file-table tbody tr:last-child:hover,
  .file-table tbody tr:last-child.selected {
    background: transparent;
  }
  .file-table tbody tr:last-child:hover > td {
    background: rgba(66, 211, 146, 0.075);
  }
  .file-table tbody tr:last-child.selected > td,
  .file-table tbody tr:last-child.selected:hover > td {
    background: rgba(66, 211, 146, 0.115);
  }
  .file-table tbody tr:last-child > td:first-child {
    border-bottom-left-radius: 13px;
  }
  .file-table tbody tr:last-child > td:last-child {
    border-bottom-right-radius: 13px;
  }
}
.name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
.name .truncate-text {
  flex: 1 1 auto;
  min-width: 0;
}
.path-cell .truncate-text {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}
.truncate-text {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}
.size-cell {
  white-space: normal;
  line-height: 1.2;
}
.name.file-name {
  cursor: pointer;
}
.name.file-name:hover span:last-child {
  color: var(--name-hover);
}
.icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--panel2);
}
.folder .icon {
  color: #8ff0c1;
}
.file .icon {
  color: #4ea1ff;
}
.muted {
  color: var(--muted);
}
.right {
  text-align: right;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.88rem;
}
body.light .action {
  background: rgba(255, 255, 255, 0.78);
}
.action:hover {
  border-color: var(--good);
  background: var(--goodsoft);
  color: var(--text);
}
.danger:hover {
  border-color: var(--good);
  background: var(--goodsoft);
  color: var(--text);
}
.item-menu {
  position: relative;
  display: flex;
  justify-content: flex-end;
  z-index: 2;
  width: 100%;
}
.item-menu.open {
  z-index: 40;
}
.item-menu-toggle {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 11px;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text);
}
.item-menu-toggle:hover {
  transform: none;
}
.item-menu.open .item-menu-toggle {
  border-color: rgba(66, 211, 146, 0.78);
  background: rgba(66, 211, 146, 0.16);
  box-shadow: 0 0 0 3px rgba(66, 211, 146, 0.16);
}
.item-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 18;
  display: none;
  min-width: 178px;
  padding: 6px;
  border: 1px solid rgba(66, 211, 146, 0.45);
  border-radius: 12px;
  background: #121820;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.045);
}
.item-menu.open .item-menu-list {
  display: grid;
  gap: 4px;
  animation: toastIn 0.14s ease both;
}
.item-menu-list .action,
.item-menu-list button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  min-height: 36px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}
.item-menu-list .danger {
  color: var(--text);
}
body.light .item-menu-list {
  background: #ffffff;
  border-color: rgba(66, 211, 146, 0.55);
  box-shadow:
    0 18px 45px rgba(31, 41, 55, 0.16),
    0 0 0 1px rgba(17, 24, 39, 0.045);
}
body.light .item-menu-list .action,
body.light .item-menu-list button {
  color: #111827;
  background: rgba(17, 24, 39, 0.035);
}
.message {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  line-height: 1.55;
}
.error {
  color: var(--bad);
}
.footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.footer code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
}
.login-wrap {
  width: min(460px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 32px 0;
}
.login-card {
  width: 100%;
  padding: 24px;
}
.login-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.login-card-head > div {
  min-width: 0;
}
.login-card-head .theme-toggle {
  margin-top: -2px;
}
.login-card h1 {
  font-size: 2rem;
}
.login-card form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.login-card .error {
  padding: 10px 12px;
  border: 1px solid rgba(255, 93, 93, 0.4);
  border-radius: 10px;
  background: rgba(255, 93, 93, 0.12);
}
.login-card .subtitle + .error {
  margin-top: 14px;
}
.upload-progress {
  box-sizing: border-box;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  margin: 0 14px;
  padding: 0 14px;
  border: 0 solid rgba(66, 211, 146, 0.34);
  border-radius: 12px;
  background: rgba(66, 211, 146, 0.08);
  color: var(--muted);
  font-size: 0.9rem;
  transition:
    max-height 280ms cubic-bezier(0.22, 1, 0.36, 1),
    margin 280ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 280ms cubic-bezier(0.22, 1, 0.36, 1),
    border-width 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 280ms;
}
.upload-progress.show {
  max-height: 480px;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  margin: 12px 14px 14px;
  padding: 12px 14px;
  border-width: 1px;
  transition:
    max-height 280ms cubic-bezier(0.22, 1, 0.36, 1),
    margin 280ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 280ms cubic-bezier(0.22, 1, 0.36, 1),
    border-width 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s;
}
#browserPanel.upload-progress-changing #content {
  pointer-events: none;
}
.upload-progress.error {
  border-color: rgba(255, 93, 93, 0.48);
  background: rgba(255, 93, 93, 0.1);
}
.upload-progress.partial {
  border-color: rgba(255, 209, 102, 0.48);
  background: rgba(255, 209, 102, 0.09);
}
.upload-progress.error .upload-progress-bar {
  background: var(--bad);
  box-shadow: 0 0 14px rgba(255, 93, 93, 0.32);
}
.upload-progress.partial .upload-progress-bar {
  background: var(--warn);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.28);
}
.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.upload-progress-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.upload-progress-percent {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--accent2);
  font-weight: 700;
}
.upload-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
}
.upload-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 14px rgba(66, 211, 146, 0.38);
  transition: width 0.16s ease;
}
.upload-progress-bar.indeterminate {
  width: 35%;
  animation: uploadIndeterminate 1.1s ease-in-out infinite;
}
.upload-progress-detail {
  margin-top: 8px;
  min-height: 1.35em;
  line-height: 1.35;
  white-space: pre-wrap;
}
.upload-progress-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.upload-progress-actions:not(:has(button:not([hidden]))) {
  display: none;
}
.upload-progress-actions .action {
  min-height: 34px;
  padding: 7px 10px;
}
@keyframes uploadIndeterminate {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(340%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .upload-progress,
  .upload-progress.show {
    transform: none;
    transition: none;
  }
}

body.editor-open {
  overflow: hidden;
}
.editor-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  width: 100%;
  max-width: 100vw;
  place-items: center;
  overflow: hidden;
  padding: 22px;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(9px);
}
.editor-modal.show {
  display: grid;
  animation: overlayIn 0.14s ease both;
}
body.light .editor-modal {
  background: rgba(45, 55, 72, 0.46);
}
.editor-shell {
  width: min(1100px, calc(100vw - 32px));
  min-width: 0;
  max-width: calc(100vw - 32px);
  height: min(820px, calc(100dvh - 44px));
  max-height: calc(100dvh - 44px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  margin: 0;
  overflow: hidden;
  border-color: rgba(66, 211, 146, 0.4);
  border-radius: 20px;
  background: rgba(23, 26, 33, 0.98);
}
body.light .editor-shell {
  background: rgba(255, 255, 255, 0.98);
}
.editor-head {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  justify-content: space-between;
  overflow: hidden;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}
.editor-title {
  width: 0;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 0%;
}
.editor-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-status {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}
.editor-status.dirty {
  color: var(--warn);
  font-weight: 700;
}
.editor-head-actions {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.editor-tools {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
}
body.light .editor-tools {
  background: rgba(17, 24, 39, 0.025);
}
.editor-tools button,
.editor-tools select {
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 0.9rem;
}
.editor-tools .spacer {
  flex: 1;
}
.editor-tools-menu-group,
.editor-tools-menu {
  display: contents;
}
.editor-tools-menu-toggle {
  display: none;
}
.editor-workspace {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--panel3);
}
.editor-body {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  min-height: 430px;
  background: var(--panel3);
}
.editor-shell .editor-body {
  min-height: 0;
  overflow: hidden;
}
.lines {
  padding: 14px 8px;
  text-align: right;
  color: var(--muted);
  border-right: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre;
  user-select: none;
  overflow: hidden;
}
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 430px;
  border: 0;
  resize: vertical;
  outline: none;
  color: var(--text);
  background: transparent;
  padding: 14px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
.editor-shell textarea,
.editor-shell .lines {
  min-height: 0;
  height: 100%;
}
.editor-shell textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  resize: none;
}
textarea:focus {
  border-color: transparent;
  box-shadow: none;
}
textarea.editor-word-wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}
.editor-body:focus-within {
  box-shadow:
    inset 0 0 0 1px var(--good),
    0 0 0 3px rgba(66, 211, 146, 0.14);
}
.editor-body:focus-within .lines {
  border-right-color: rgba(66, 211, 146, 0.5);
}
.editor-preview {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--panel3);
}
.editor-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.82rem;
}
.editor-preview-head strong {
  color: var(--text);
  font-size: 0.88rem;
}
body.light .editor-preview-head {
  background: rgba(17, 24, 39, 0.025);
}
.editor-preview-content {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 32px;
  background: var(--panel3);
  color: var(--text);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
}
.editor-preview-content > :first-child {
  margin-top: 0;
}
.editor-preview-content > :last-child {
  margin-bottom: 0;
}
.editor-preview-content h1,
.editor-preview-content h2,
.editor-preview-content h3,
.editor-preview-content h4,
.editor-preview-content h5,
.editor-preview-content h6 {
  margin: 1.5em 0 0.65em;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-transform: none;
}
.editor-preview-content h1 {
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--line);
  font-size: 2.15rem;
}
.editor-preview-content h2 {
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--line);
  font-size: 1.55rem;
}
.editor-preview-content h3 {
  font-size: 1.25rem;
}
.editor-preview-content p {
  margin: 0.8em 0;
}
.editor-preview-content .md-link,
.editor-preview-content .preview-link {
  color: var(--name-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.editor-preview-content code {
  padding: 0.16em 0.4em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: 85% var(--mono);
}
.editor-preview-content pre {
  position: relative;
  overflow: auto;
  margin: 1em 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.editor-preview-content pre code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.9rem;
}
.editor-preview-content .code-language {
  float: right;
  margin: -7px -5px 8px 12px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.editor-preview-content blockquote {
  margin: 1em 0;
  padding: 0.35em 1em;
  border-left: 4px solid var(--accent);
  background: var(--panel2);
  color: var(--muted);
}
.editor-preview-content ul,
.editor-preview-content ol {
  padding-left: 1.6em;
}
.editor-preview-content .task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  margin-left: -1.35em;
  list-style: none;
}
.editor-preview-content .task-item input {
  margin-top: 0.42em;
  pointer-events: none;
}
.editor-preview-content hr {
  height: 1px;
  margin: 1.75em 0;
  border: 0;
  background: var(--line);
}
.editor-preview-content table {
  display: block;
  width: 100%;
  margin: 1em 0;
  overflow: auto;
  border-collapse: collapse;
}
.editor-preview-content th,
.editor-preview-content td {
  width: auto;
  padding: 0.55em 0.75em;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
}
.editor-preview-content th {
  background: var(--panel2);
  color: var(--text);
  font-size: inherit;
}
.editor-preview-content tr:nth-child(even) td {
  background: var(--panel2);
}
.editor-preview-content .image-alt {
  display: inline-flex;
  padding: 0.2em 0.55em;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
}
.editor-preview-content .preview-empty {
  display: grid;
  min-height: 100%;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.editor-preview-content.preview-svg {
  display: grid;
  place-items: center;
}
.editor-preview-content.preview-svg svg {
  display: block;
  max-width: 100%;
  max-height: 100%;
  height: auto;
}
.editor-note {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.025);
}
body.light .editor-note {
  background: rgba(17, 24, 39, 0.025);
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 180;
  display: none;
  pointer-events: none;
  max-width: min(520px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  color: var(--text);
  line-height: 1.45;
}
.toast.show {
  display: block;
  animation: toastIn 0.18s ease both;
}
.toast.hiding {
  display: block;
  animation: toastOut 0.26s ease both;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

body.media-player-open {
  overflow: hidden;
}
.media-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(9px);
}
.media-modal.show {
  display: grid;
  animation: overlayIn 0.14s ease both;
}
.media-card {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100dvh - 44px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(66, 211, 146, 0.4);
  border-radius: 20px;
  background: rgba(23, 26, 33, 0.98);
}
body.light .media-modal {
  background: rgba(45, 55, 72, 0.46);
}
body.light .media-card {
  background: rgba(255, 255, 255, 0.98);
}
.media-head,
.media-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}
.media-head {
  border-bottom: 1px solid var(--line);
}
.media-foot {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
body.light .media-foot {
  background: rgba(17, 24, 39, 0.025);
}
.media-title {
  min-width: 0;
}
.media-title strong,
.media-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-title strong {
  font-size: 1.05rem;
}
.media-title span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}
.media-stage {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
  gap: 22px;
  overflow: auto;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 28%, rgba(66, 211, 146, 0.14), transparent 46%),
    #0b0e13;
}
.media-stage.audio {
  grid-template-rows: minmax(150px, 1fr) auto;
  min-height: 390px;
}
body.light .media-stage.audio {
  background:
    radial-gradient(circle at 50% 28%, rgba(66, 211, 146, 0.18), transparent 46%),
    #eef2f7;
}
.media-stage video {
  display: block;
  width: 100%;
  max-height: min(68dvh, 720px);
  border-radius: 13px;
  background: #000;
  outline: 1px solid rgba(255, 255, 255, 0.08);
}
.media-stage audio {
  display: block;
  width: min(620px, 100%);
  accent-color: var(--accent);
}
.audio-artwork {
  width: 210px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-self: end;
  border: 1px solid rgba(66, 211, 146, 0.48);
  border-radius: 32px;
  color: var(--accent2);
  background:
    radial-gradient(circle at 34% 28%, rgba(143, 240, 193, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(66, 211, 146, 0.18), rgba(17, 22, 29, 0.92));
}
body.light .audio-artwork {
  color: #087a55;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.78), transparent 34%),
    linear-gradient(145deg, rgba(66, 211, 146, 0.26), rgba(255, 255, 255, 0.86));
}
.audio-artwork span {
  font-size: 5.6rem;
  line-height: 1;
  transform: translateY(-3px);
}
.media-message {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  max-width: calc(100% - 44px);
  transform: translate(-50%, -50%);
  padding: 9px 12px;
  border: 1px solid rgba(66, 211, 146, 0.4);
  border-radius: 999px;
  background: rgba(10, 14, 19, 0.88);
  color: #edf2f7;
  text-align: center;
  line-height: 1.35;
}
.media-stage.audio .media-message {
  top: auto;
  bottom: 84px;
}
.media-message.error {
  border-color: rgba(255, 93, 93, 0.55);
  background: rgba(53, 18, 22, 0.94);
}
.media-format {
  color: var(--muted);
  font-size: 0.88rem;
  text-transform: capitalize;
}
.media-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.media-actions .action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
}

@media (max-width: 760px) {
  .media-modal {
    padding: 12px;
  }
  .media-card {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
  }
  .media-head,
  .media-foot {
    padding: 12px;
  }
  .media-stage {
    min-height: 210px;
    padding: 12px;
  }
  .media-stage.audio {
    min-height: 330px;
    gap: 16px;
  }
  .media-stage video {
    max-height: 58dvh;
    border-radius: 10px;
  }
  .audio-artwork {
    width: 160px;
    border-radius: 25px;
  }
  .audio-artwork span {
    font-size: 4.35rem;
  }
  .media-stage.audio .media-message {
    bottom: 74px;
  }
}

@media (max-width: 430px) {
  .media-foot {
    align-items: stretch;
    flex-direction: column;
  }
  .media-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .media-actions .action {
    width: 100%;
  }
}

.move-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(8, 10, 14, 0.64);
  backdrop-filter: blur(8px);
}
.move-modal.show {
  display: grid;
  animation: overlayIn 0.14s ease both;
}
.move-card {
  width: min(620px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  border: 1px solid rgba(66, 211, 146, 0.34);
  border-radius: 18px;
  background: rgba(23, 26, 33, 0.96);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.conflict-card {
  grid-template-rows: auto auto auto;
}
.conflict-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}
.conflict-options .action {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  text-align: left;
}
.conflict-options .action span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}
body.light .move-card {
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(17, 24, 39, 0.05);
}
.move-head,
.move-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.move-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  flex-wrap: wrap;
}
.move-title {
  display: grid;
  gap: 3px;
}
.move-title strong {
  font-size: 1.05rem;
}
.move-title span,
.move-hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}
.move-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.045);
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}
.move-close span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}
.move-browse {
  display: grid;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.028);
}
body.light .move-browse {
  background: rgba(17, 24, 39, 0.025);
}
.move-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 0.93rem;
}
.move-path button {
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}
.move-current {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.92rem;
}
.move-current code {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--accent2);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.move-list {
  min-height: 160px;
  max-height: 390px;
  overflow: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.08);
}
body.light .move-list {
  background: rgba(17, 24, 39, 0.025);
}
.move-folder {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 7px;
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
}
.move-folder:hover,
.move-folder:focus-visible {
  background: rgba(66, 211, 146, 0.14);
  border-color: rgba(66, 211, 146, 0.7);
  box-shadow: none;
  transform: none;
}
.move-folder:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: saturate(0.65);
}
.move-folder:disabled:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}
.move-folder .icon {
  width: 28px;
  height: 28px;
}
.move-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  line-height: 1.45;
}
.move-primary {
  background: var(--goodsoft);
  color: var(--text);
  border-color: rgba(66, 211, 146, 0.65);
}
.move-primary:disabled {
  opacity: 0.5;
}

.upload-dropdown .dropdown-menu {
  min-width: 150px;
}
@media (min-width: 1700px) {
  body::before {
    --glow-x: calc(var(--wrap-left) + 190px);
    --glow-y: 118px;
    --glow-size: 46rem;
  }
}
@media (max-width: 760px) {
  html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 92px;
    background: #0f1115;
  }
  body {
    overflow-x: hidden;
  }
  body::before {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    z-index: 0;
    pointer-events: none;
    transform: none;
    --wrap-width: calc(100vw - 20px);
    --wrap-left: calc((100vw - var(--wrap-width)) / 2);
    --glow-x: calc(var(--wrap-left) + clamp(112px, 30vw, 156px));
    --glow-y: 132px;
    --glow-size: 34rem;
  }
  main {
    position: relative;
    z-index: 1;
  }
  .wrap {
    width: calc(100% - 16px);
    padding: 72px 0 34px;
    scroll-margin-top: 92px;
  }
  @supports (padding-top: env(safe-area-inset-top)) {
    .wrap {
      padding-top: calc(72px + env(safe-area-inset-top));
      padding-bottom: calc(34px + env(safe-area-inset-bottom));
    }
  }
  header {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
    isolation: isolate;
  }
  .header-copy {
    width: 100%;
  }
  h1 {
    font-size: clamp(2rem, 10vw, 2.55rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
    overflow-wrap: anywhere;
    padding-top: 0;
  }
  .subtitle {
    font-size: 0.95rem;
    overflow-wrap: anywhere;
  }
  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }
  .badge {
    min-height: 42px;
  }
  input,
  select,
  button,
  .action {
    min-height: 44px;
    font-size: 16px;
  }
  input,
  select,
  button {
    padding: 11px 12px;
  }
  .toolbar {
    align-items: stretch;
    gap: 9px;
    margin: 14px 0;
  }
  .toolbar input[type="search"] {
    flex-basis: 100%;
    min-width: 0;
    width: 100%;
    height: 48px;
  }
  .toolbar-actions {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    align-items: start;
  }
  .toolbar-actions > * {
    min-width: 0;
    align-self: start;
  }
  .toolbar-actions button,
  .toolbar-actions .action {
    width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
    min-height: 48px;
  }
  .toolbar-actions > .action,
  .toolbar-actions > button,
  .toolbar-actions > .dropdown > button {
    height: 48px;
  }
  .toolbar-separator {
    display: none;
  }
  #refreshIndex {
    grid-column: 2;
  }
  .logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .dropdown {
    width: 100%;
    min-width: 0;
    align-self: start;
    z-index: 90;
  }
  .dropdown.open {
    z-index: 140;
  }
  .dropdown > button {
    width: 100%;
    min-height: 48px;
  }
  .dropdown-menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    right: auto;
    margin-top: 0;
    min-width: 0;
    width: 100%;
    padding: 8px;
    max-height: min(60dvh, 320px);
    overflow: auto;
  }
  .dropdown-menu button {
    min-height: 44px;
    text-align: center;
  }
  .toolbar-actions .dropdown.open + *,
  .toolbar-actions .dropdown.open ~ * {
    align-self: start;
  }
  .panel,
  .editor,
  .login-card {
    border-radius: 16px;
  }
  .pathbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
  }
  .editor-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }
  .breadcrumbs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    padding: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .move-path {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    padding: 4px 6px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .breadcrumbs::-webkit-scrollbar,
  .move-path::-webkit-scrollbar {
    display: none;
  }
  .breadcrumbs button,
  .move-path button {
    white-space: nowrap;
    min-height: 40px;
    position: relative;
  }
  .stats {
    white-space: normal;
    font-size: 0.86rem;
    line-height: 1.35;
  }
  .name,
  .editor-head h2,
  .editor-path,
  .subtitle,
  button,
  .action {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .upload-progress {
    margin-right: 12px;
    margin-left: 12px;
  }
  .upload-progress.show {
    margin-top: 10px;
    margin-bottom: 0;
  }
  .conflict-options {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .conflict-options .action {
    min-height: 72px;
  }
  .hide-sm {
    display: none !important;
  }
  .selection-bar-host {
    margin-top: 10px;
  }
  .bulkbar {
    width: 100%;
    align-items: stretch;
    padding: 12px;
  }
  body.light .bulkbar {
    background: rgba(255, 255, 255, 0.97);
  }
  .bulk-summary {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
  }
  .bulk-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .bulk-actions button,
  .bulk-actions .action {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 44px;
  }
  #content .file-table,
  #content .file-table thead,
  #content .file-table tbody,
  #content .file-table tr,
  #content .file-table td {
    display: block;
  }
  #content .file-table {
    border-collapse: separate;
    border-spacing: 0;
  }
  #content .file-table thead {
    display: none;
  }
  #content .file-table tbody {
    display: grid;
    gap: 8px;
    padding: 10px;
  }
  #content .file-table tbody tr {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 0 8px;
    padding: 10px;
    border: 1px solid rgba(48, 56, 71, 0.78);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.026);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    overflow: visible;
  }
  body.light #content .file-table tbody tr {
    border-color: rgba(215, 222, 232, 0.95);
    background: rgba(255, 255, 255, 0.72);
  }
  #content .file-table tbody tr.selected {
    background: rgba(66, 211, 146, 0.14);
  }
  #content .file-table th,
  #content .file-table td {
    padding: 0;
    border-bottom: 0 !important;
    text-align: left;
  }
  .select-col {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
  }
  .select-col input {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border-radius: 6px;
  }
  .select-col input:checked::after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
  }
  .select-col input:indeterminate::after {
    left: 5px;
    top: 9px;
    width: 12px;
  }
  #content .file-table td:nth-child(2),
  #content .file-table td.name-cell {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden !important;
  }
  #content .file-table td:nth-child(5),
  #content .file-table td.actions-cell {
    grid-column: 3;
    grid-row: 1;
    margin-top: 0;
    text-align: right;
    overflow: visible !important;
    display: flex;
    justify-content: flex-end;
  }
  .name {
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .name span:last-child,
  .name .truncate-text {
    min-width: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    word-break: normal;
    overflow-wrap: normal;
    font-size: 0.95rem;
  }
  .icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }
  .actions {
    display: flex;
    justify-content: flex-end;
    width: 42px;
  }
  .item-menu {
    width: 42px;
    display: flex;
    justify-content: flex-end;
  }
  .item-menu-toggle {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    border-radius: 12px;
    font-size: 1.35rem;
  }
  .item-menu-list {
    width: min(220px, calc(100vw - 56px));
  }
  .item-menu-list .action,
  .item-menu-list button {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 0.93rem;
    line-height: 1.15;
  }
  .action {
    min-height: 38px;
    padding: 8px;
    border-radius: 11px;
    justify-content: center;
    text-align: center;
    font-size: 0.93rem;
    line-height: 1.15;
  }
  @media (max-width: 430px) {
    #content .file-table tbody tr {
      grid-template-columns: 28px minmax(0, 1fr) 38px;
      gap: 0 7px;
      padding: 8px 9px;
    }
    td.select-col {
      width: 28px;
      min-width: 28px;
    }
    td.actions-cell,
    .actions,
    .item-menu {
      width: 38px;
      min-width: 38px;
    }
    .name {
      grid-template-columns: 26px minmax(0, 1fr);
      gap: 7px;
    }
    .icon,
    .name .icon {
      width: 26px;
      height: 26px;
      min-width: 26px;
      flex-basis: 26px;
    }
    .item-menu-toggle {
      width: 34px;
      min-width: 34px;
      height: 34px;
      min-height: 34px;
    }
    .name .truncate-text {
      font-size: 0.9rem;
    }
  }
  .editor-modal {
    padding: 10px;
  }
  .editor-modal .editor-shell {
    width: calc(100vw - 20px);
    min-width: 0;
    max-width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    margin: 0;
    border-radius: 16px;
  }
  .editor-shell .editor-head {
    align-items: flex-start;
    flex-direction: row;
  }
  .editor-shell .editor-title {
    width: 0;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 0%;
  }
  .editor-shell .editor-title strong,
  .editor-shell .editor-title span {
    width: 100%;
    max-width: 100%;
  }
  .editor-status {
    white-space: normal;
  }
  .editor-shell .editor-tools {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    overflow: visible;
    position: relative;
    z-index: 5;
  }
  .editor-shell .editor-tools .spacer {
    display: none;
  }
  .editor-shell .editor-tools button,
  .editor-shell .editor-tools select {
    width: 100%;
    min-height: 38px;
    padding: 7px 5px;
    border-radius: 10px;
    font-size: 0.8rem;
  }
  .editor-shell .editor-tools-menu-group {
    position: relative;
    display: block;
    grid-column: 1 / -1;
    min-width: 0;
  }
  .editor-shell .editor-tools-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .editor-shell .editor-tools-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 8;
    display: none;
    width: min(330px, calc(100vw - 36px));
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(66, 211, 146, 0.45);
    border-radius: 12px;
    background: rgba(23, 26, 33, 0.99);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
  }
  body.light .editor-shell .editor-tools-menu {
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 18px 45px rgba(31, 41, 55, 0.16);
  }
  .editor-shell .editor-tools-menu-group.open .editor-tools-menu {
    display: grid;
    animation: toastIn 0.14s ease both;
  }
  .editor-shell .editor-tools-menu select {
    grid-column: 1 / -1;
  }
  .editor-shell .editor-tools-menu button,
  .editor-shell .editor-tools-menu select {
    min-height: 40px;
    padding: 8px;
    font-size: 0.9rem;
  }
  .editor-shell .editor-body {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }
  .editor-shell .lines,
  .editor-shell textarea {
    min-height: 0;
    font-size: 13px;
    line-height: 1.55;
  }
  .editor-shell textarea {
    padding: 12px 10px;
    -webkit-overflow-scrolling: touch;
    resize: none;
  }
  .editor-shell .lines {
    padding: 12px 6px;
  }
  .editor-note {
    font-size: 0.84rem;
  }
  .editor-preview-head {
    padding: 8px 10px;
  }
  .editor-preview-content {
    padding: 20px 16px;
    font-size: 15px;
  }
  .editor-preview-content h1 {
    font-size: 1.75rem;
  }
  .editor-preview-content h2 {
    font-size: 1.4rem;
  }
  .toast {
    left: 10px;
    right: 10px;
    top: calc(10px + env(safe-area-inset-top));
    bottom: auto;
    max-width: none;
  }
  .upload-overlay {
    padding: 14px;
  }
  .upload-overlay-frame {
    inset: 10px;
    border-radius: 18px;
  }
  .upload-overlay-card {
    max-width: calc(100vw - 42px);
    padding: 18px;
  }
  .move-modal {
    padding: 10px;
  }
  .move-card {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
    grid-template-rows: auto auto minmax(160px, 1fr) auto;
  }
  .conflict-card {
    grid-template-rows: auto auto auto;
  }
  .move-head,
  .move-foot {
    padding: 12px;
  }
  .move-close {
    width: 44px;
    height: 44px;
    font-size: 26px;
  }
  .move-browse {
    padding: 10px 12px;
  }
  .move-current {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }
  .move-current code {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .move-list {
    max-height: none;
    min-height: 190px;
    padding: 10px;
  }
  .move-folder {
    min-height: 48px;
    padding: 11px;
    align-items: flex-start;
  }
  .move-folder .muted {
    margin-left: auto;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
  }
  .move-foot {
    align-items: stretch;
    flex-direction: column;
  }
  .move-foot .bulk-actions {
    grid-template-columns: 1fr 1fr;
  }
  .login-wrap {
    width: calc(100% - 20px);
    padding: 22px 0;
  }
  .login-card {
    padding: 20px;
  }
}
@media (max-width: 420px) {
  .toolbar-actions,
  .actions,
  .editor-tools,
  .move-foot .bulk-actions {
    grid-template-columns: 1fr;
  }
  .action {
    font-size: 0.95rem;
  }
  #content .file-table tbody tr {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 10px;
  }
  .select-col input {
    width: 21px;
    height: 21px;
    min-width: 21px;
    min-height: 21px;
  }
  .move-folder .muted {
    display: none;
  }
  .editor-shell .editor-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor-shell .editor-tools-menu-group {
    grid-column: 1 / -1;
  }
}
@media (max-width: 480px) {
  .editor-shell .editor-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor-shell .editor-tools > button,
  .editor-shell .editor-tools-menu-group {
    min-width: 0;
  }
}

@media (hover: none) {
  button:hover,
  .action:hover {
    transform: none;
  }
  #content .file-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.026);
  }
  body.light #content .file-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.72);
  }
  #content .file-table tbody tr.selected:hover {
    background: rgba(66, 211, 146, 0.14);
  }
}

/* Strong compact mobile file rows: checkbox | file name | actions */
@media (max-width: 760px) {
  #content .file-table tbody tr {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 0 8px;
    min-height: 58px;
    padding: 9px 10px;
    overflow: visible !important;
  }
  td.select-col {
    grid-column: 1;
    grid-row: 1;
    width: 30px;
    min-width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  td.name-cell {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden !important;
  }
  td.actions-cell {
    grid-column: 3;
    grid-row: 1;
    width: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow: visible !important;
    text-align: right;
  }
  .name {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .name .icon {
    grid-column: 1;
    width: 28px;
    height: 28px;
    min-width: 28px;
    flex: 0 0 28px;
  }
  .name .truncate-text {
    grid-column: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    word-break: normal;
    overflow-wrap: normal;
    font-size: 0.92rem;
    line-height: 1.2;
  }
  .actions,
  .item-menu {
    width: 40px;
    min-width: 40px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
  .item-menu-toggle {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }
  .item-menu-list {
    right: 0;
    max-width: calc(100vw - 28px);
  }
}

/* Final mobile row override: compact, aligned, no hidden text behind menu */
@media (max-width: 760px) {
  #content .file-table tbody {
    display: grid !important;
    gap: 8px !important;
    padding: 10px !important;
  }
  #content .file-table tbody tr {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) 36px !important;
    align-items: center !important;
    column-gap: 7px !important;
    min-height: 54px !important;
    padding: 8px 8px !important;
    overflow: visible !important;
  }
  #content .file-table tbody tr > td {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }
  #content .file-table tbody tr > td.select-col {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 28px !important;
    min-width: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
  }
  #content .file-table tbody tr > td.name-cell {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #content .file-table tbody tr > td.actions-cell {
    grid-column: 3 !important;
    grid-row: 1 !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    transform: none !important;
    position: relative !important;
    right: auto !important;
    top: auto !important;
  }
  #content .file-table .name {
    display: grid !important;
    grid-template-columns: 26px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 7px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #content .file-table .name .icon {
    grid-column: 1 !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    flex: 0 0 26px !important;
    border-radius: 8px !important;
  }
  #content .file-table .name .truncate-text {
    grid-column: 2 !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    font-size: 0.9rem !important;
    line-height: 1.15 !important;
  }
  #content .file-table .actions,
  #content .file-table .item-menu {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  #content .file-table .item-menu-toggle {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border-radius: 11px !important;
    font-size: 1.25rem !important;
    line-height: 1 !important;
  }
}

.pathbar {
  overflow: visible;
}

@media (hover: none) {
  .breadcrumbs button:active,
  .move-path button:active {
    box-shadow: 0 0 0 3px rgba(66, 211, 146, 0.16);
  }
}

/* Final mobile toolbar cleanup */
@media (max-width: 760px) {
  .header-actions {
    justify-content: flex-start !important;
    width: 100% !important;
  }
  .login-pill {
    align-self: flex-start;
    max-width: 100%;
  }
  .toolbar {
    gap: 10px !important;
  }
  .toolbar-actions {
    width: 100% !important;
    margin-left: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
  }
  .toolbar-actions > * {
    min-width: 0 !important;
  }
  .toolbar-actions > .dropdown,
  .toolbar-actions > button,
  .toolbar-actions > .action {
    width: 100% !important;
  }
  .toolbar-actions > .dropdown > button,
  #refreshIndex {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    height: 48px !important;
  }
  #refreshIndex {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 430px) {
  .toolbar-actions {
    grid-template-columns: 1fr !important;
  }
  #refreshIndex {
    grid-column: auto !important;
  }
}

/* Managed view refresh: closer to the public read-only listing, with editor actions kept */
.manager-table {
  table-layout: fixed;
  border-collapse: collapse;
}
.manager-table th:nth-child(1),
.manager-table td:nth-child(1) {
  width: 58px;
}
.manager-table th:nth-child(2),
.manager-table td:nth-child(2) {
  width: auto;
}
.manager-table th:nth-child(3),
.manager-table td:nth-child(3) {
  width: 180px;
}
.manager-table th:nth-child(4),
.manager-table td:nth-child(4) {
  width: 110px;
}
.manager-table th:nth-child(5),
.manager-table td:nth-child(5) {
  width: 72px;
}
.manager-table th,
.manager-table td {
  padding: 13px 16px;
}
.manager-table .name-cell {
  min-width: 0;
  overflow: hidden;
}
.manager-table .name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.manager-table .truncate-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
.manager-table .modified-cell {
  white-space: nowrap;
}
.manager-table .size-cell {
  white-space: nowrap;
  text-align: right;
}
.manager-table .actions-cell {
  text-align: right;
  overflow: visible;
}
.manager-table .row-meta {
  display: none;
}
.bulkbar.show {
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(66, 211, 146, 0.09);
}
.bulk-summary strong {
  font-size: 1.08rem;
  color: var(--text);
}

@media (max-width: 760px) {
  #browserPanel {
    overflow: visible;
  }
  .pathbar {
    border-bottom: 1px solid var(--line);
  }
  .bulkbar.show {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(66, 211, 146, 0.085);
  }
  .bulk-summary {
    justify-content: flex-start;
    font-size: 1rem;
  }
  .bulk-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .bulk-actions button,
  .bulk-actions .action {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    text-align: center;
  }
  .manager-table,
  .manager-table tbody,
  .manager-table tr,
  .manager-table td {
    display: block;
  }
  .manager-table thead {
    display: none !important;
  }
  .manager-table tbody {
    display: grid !important;
    gap: 8px !important;
    padding: 10px !important;
  }
  #content .manager-table tbody tr {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) 42px !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    column-gap: 8px !important;
    row-gap: 4px !important;
    min-height: 58px !important;
    padding: 10px !important;
    border: 1px solid rgba(48, 56, 71, 0.78) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.026) !important;
    overflow: visible !important;
  }
  body.light #content .manager-table tbody tr {
    border-color: rgba(215, 222, 232, 0.95) !important;
    background: rgba(255, 255, 255, 0.72) !important;
  }
  #content .manager-table tbody tr.selected {
    background: rgba(66, 211, 146, 0.14) !important;
  }
  #content .manager-table tbody tr > td {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: visible !important;
  }
  #content .manager-table .select-col {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 34px !important;
    min-width: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  #content .manager-table .name-cell {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    overflow: hidden !important;
    display: block !important;
  }
  #content .manager-table .modified-cell {
    display: none !important;
  }
  #content .manager-table .size-cell {
    display: none !important;
  }
  #content .manager-table .actions-cell {
    grid-column: 3 !important;
    grid-row: 1 / span 2 !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
  }
  #content .manager-table .name {
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    gap: 9px !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #content .manager-table .name .icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    border-radius: 9px !important;
  }
  #content .manager-table .name .truncate-text {
    font-size: 0.95rem !important;
    line-height: 1.25 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }
  #content .manager-table .row-meta {
    display: flex !important;
    gap: 8px;
    align-items: center;
    margin: 4px 0 0 39px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #content .manager-table .row-meta span + span::before {
    content: "·";
    margin-right: 8px;
    color: #5e6977;
  }
  #content .manager-table .actions,
  #content .manager-table .item-menu {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  #content .manager-table .item-menu-toggle {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border-radius: 12px !important;
  }
  #content .manager-table .item-menu-list {
    right: 0 !important;
    max-width: calc(100vw - 34px) !important;
  }
}

@media (max-width: 430px) {
  .bulk-actions {
    grid-template-columns: 1fr !important;
  }
  #content .manager-table tbody tr {
    grid-template-columns: 32px minmax(0, 1fr) 40px !important;
    padding: 9px !important;
  }
  #content .manager-table .row-meta {
    margin-left: 37px;
    font-size: 0.8rem;
  }
}

/* Keep mobile row menus inside the viewport, opening upward near the bottom. */
@media (max-width: 760px) {
  #content .file-table .item-menu {
    position: relative;
    overflow: visible !important;
    z-index: 60;
  }
  #content .file-table .item-menu.open {
    z-index: 240 !important;
  }
  #content .file-table .item-menu-list {
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    left: auto !important;
    right: 0 !important;
    width: min(220px, calc(100vw - 28px)) !important;
    max-height: min(55dvh, 320px, var(--item-menu-max-height, 320px)) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    z-index: 241 !important;
  }
  #content .file-table .item-menu.open-up .item-menu-list {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
  }
}

/* Keep the signed-in control compact on portrait mobile screens. */
@media (max-width: 760px) and (orientation: portrait) {
  .login-pill {
    min-height: 44px;
    padding: 5px 5px 5px 11px;
  }

  .login-pill .logout-icon {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    flex: 0 0 32px;
  }
}
