:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #101010;
  --panel-2: #1a1a1a;
  --line: #343434;
  --text: #f7f7f7;
  --muted: #b6b6b6;
  --soft: #828282;
  --accent: #ffffff;
  --accent-strong: #d8d8d8;
  --danger: #dcdcdc;
  --warning: #a8a8a8;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  text-decoration: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  min-height: 100vh;
}

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

.loader {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.login-panel {
  width: min(100%, 380px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080808;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.login-panel label + label,
.modal label + label {
  margin-top: 16px;
}

.primary-button,
.secondary-button,
.ghost-button,
.small-button,
.file-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  color: var(--text);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #050505;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.secondary-button,
.file-button {
  background: var(--panel-2);
  border-color: var(--line);
}

.secondary-button:hover,
.file-button:hover,
.ghost-button:hover,
.small-button:hover {
  border-color: var(--accent);
}

.ghost-button,
.small-button {
  border-color: var(--line);
  color: var(--muted);
}

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

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

.full {
  width: 100%;
  margin-top: 22px;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.94);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  color: var(--muted);
  font-size: 14px;
}

.workspace {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.tab {
  min-width: 112px;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.is-active {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--accent);
}

.tool-panel,
.list-panel,
.empty-panel,
.move-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-panel {
  min-height: 116px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

h2 {
  margin: 0;
  font-size: 18px;
}

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

.upload-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.progress-block {
  grid-column: 1 / -1;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #070707;
  border: 1px solid #303030;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.12s ease;
}

.list-panel,
.empty-panel,
.move-panel {
  padding: 20px;
}

.move-panel {
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.move-panel strong {
  display: block;
  font-size: 13px;
  color: var(--soft);
  text-transform: uppercase;
}

.move-panel span {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

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

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  color: var(--soft);
  font-size: 13px;
}

.crumb,
.item-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.crumb {
  color: var(--muted);
}

.crumb:hover,
.item-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.search-wrap {
  width: min(100%, 300px);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 13px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--soft);
  font-size: 12px;
  text-transform: uppercase;
}

.actions-col {
  width: 260px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.file-name {
  color: var(--text);
  font-weight: 800;
  max-width: 420px;
  overflow-wrap: anywhere;
}

.file-type {
  color: var(--soft);
  font-size: 12px;
  margin-top: 4px;
}

.empty-state {
  border-top: 1px solid var(--line);
  padding: 30px 10px 12px;
  color: var(--muted);
}

.empty-panel {
  min-height: 140px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.is-on {
  background: #262626;
  color: #f4f4f4;
}

.status-pill.is-off {
  background: #151515;
  color: #9d9d9d;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
}

.modal {
  width: min(100%, 440px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}

.modal-subtitle {
  overflow-wrap: anywhere;
  margin-bottom: 18px;
}

.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: var(--line);
  color: var(--muted);
  font-size: 22px;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--text);
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast[data-tone="danger"] {
  border-color: #8a8a8a;
  color: #ffffff;
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    padding: 14px 16px;
    align-items: flex-start;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .workspace {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .upload-panel,
  .list-toolbar,
  .move-panel {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .upload-actions {
    width: 100%;
  }

  .upload-actions > * {
    flex: 1;
  }

  .search-wrap {
    width: 100%;
  }
}
