:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #151515;
  --panel-2: #1f1f1f;
  --line: rgba(255, 255, 255, 0.1);
  --muted: rgba(255, 255, 255, 0.58);
  --text: #f7f2ea;
  --yellow: #ffc928;
  --yellow-soft: #ffe7a3;
  --danger: #ff5f5f;
  --ok: #22c55e;
}

* {
  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,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.shell {
  min-height: 100vh;
  padding: 28px;
}

.center-panel {
  width: min(440px, calc(100vw - 32px));
  margin: 12vh auto 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.brand-row,
.topbar,
.toolbar,
.album-head,
.split,
.actions,
.stat-row {
  display: flex;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 201, 40, 0.16);
  color: var(--yellow);
  font-weight: 900;
  border: 1px solid rgba(255, 201, 40, 0.36);
}

.brand-row {
  gap: 12px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.05;
  font-weight: 950;
}

h2 {
  font-size: 23px;
  line-height: 1.1;
  font-weight: 950;
}

h3 {
  font-size: 17px;
  font-weight: 900;
}

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

.form {
  display: grid;
  gap: 12px;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d0d0d;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255, 201, 40, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 201, 40, 0.12);
}

.btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 900;
}

.btn.primary {
  background: var(--yellow);
  color: #050505;
  border-color: var(--yellow);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: #ffb4b4;
  border-color: rgba(255, 95, 95, 0.35);
}

.status {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status.error {
  color: #ffb4b4;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.chip.yellow {
  color: var(--yellow-soft);
  background: rgba(255, 201, 40, 0.12);
  border: 1px solid rgba(255, 201, 40, 0.22);
}

.server-chip {
  border: 1px solid var(--line);
}

.server-chip.ok {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
}

.server-chip.error {
  color: #fecaca;
  background: rgba(255, 95, 95, 0.12);
  border-color: rgba(255, 95, 95, 0.30);
}

.server-chip.checking {
  color: var(--yellow-soft);
  background: rgba(255, 201, 40, 0.10);
  border-color: rgba(255, 201, 40, 0.24);
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 18px;
  min-height: calc(100vh - 112px);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
}

.panel-pad {
  padding: 16px;
}

.toolbar {
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.toolbar input {
  min-width: 0;
}

.album-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  max-height: calc(100vh - 194px);
  overflow: auto;
}

.album-row {
  width: 100%;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  padding: 10px;
  text-align: left;
  border-radius: 13px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
}

.album-row:hover,
.album-row.active {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line);
}

.cover,
.thumb {
  background: #262626;
  border: 1px solid var(--line);
  overflow: hidden;
}

.cover {
  width: 62px;
  height: 62px;
  border-radius: 12px;
}

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

.album-row h3 {
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.main-panel {
  min-width: 0;
}

.empty {
  min-height: 340px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px;
}

.album-head {
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.details {
  color: var(--muted);
  margin-top: 7px;
  max-width: 760px;
}

.dropzone {
  margin: 16px 18px 0;
  padding: 18px;
  border: 1px dashed rgba(255, 201, 40, 0.45);
  border-radius: 14px;
  background: rgba(255, 201, 40, 0.06);
}

.dropzone.dragging {
  border-color: var(--yellow);
  background: rgba(255, 201, 40, 0.12);
}

.dropzone strong {
  color: var(--yellow-soft);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.crumb {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
}

.crumb::after {
  content: " /";
  color: var(--muted);
}

.file-list {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.file-row {
  width: 100%;
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111;
  color: var(--text);
  text-align: left;
}

.file-row:hover {
  border-color: rgba(255, 201, 40, 0.34);
  background: #161616;
}

.file-row strong,
.file-row small {
  display: block;
}

.file-row small {
  margin-top: 4px;
  color: var(--muted);
}

.file-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 201, 40, 0.12);
  border: 1px solid rgba(255, 201, 40, 0.24);
  color: var(--yellow-soft);
  font-size: 11px;
  font-weight: 950;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
  padding: 18px;
}

.media-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: #111;
}

.thumb {
  aspect-ratio: 4 / 3;
}

.file-info {
  display: grid;
  gap: 7px;
  padding: 10px;
}

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

.file-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.small-btn {
  min-height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
}

.small-btn.danger {
  color: #ffb4b4;
  border-color: rgba(255, 95, 95, 0.35);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.66);
  z-index: 20;
}

.dialog {
  width: min(520px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #161616;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.dialog .actions {
  margin-top: 16px;
}

.loader {
  width: 28px;
  height: 28px;
  margin: 0 auto 14px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--yellow);
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none !important;
}

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

@media (max-width: 900px) {
  .shell {
    padding: 16px;
  }

  .topbar,
  .album-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .userbar,
  .actions {
    justify-content: flex-start;
  }

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

  .album-list {
    max-height: 360px;
  }
}
