:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #697586;
  --line: #d8dee8;
  --accent: #176b87;
  --accent-dark: #0f5065;
  --good: #127a49;
  --bad: #b42318;
  --warn: #9a6700;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.topbar {
  align-items: center;
  background: #101820;
  color: #fff;
  display: flex;
  gap: 28px;
  min-height: 58px;
  padding: 0 28px;
}

.brand {
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 18px;
}

nav a {
  color: #dce6ee;
  font-size: 14px;
  text-decoration: none;
}

.version-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #dce6ee;
  font-size: 12px;
  font-weight: 650;
  margin-left: auto;
  padding: 4px 9px;
  white-space: nowrap;
}

.page {
  margin: 0 auto;
  max-width: 1280px;
  padding: 28px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 20px;
}

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

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
  margin: 18px 0 8px;
}

.count,
.status {
  background: #eef3f6;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  padding: 4px 10px;
  white-space: nowrap;
}

.status.busy {
  background: #fff3cd;
  color: var(--warn);
}

.status.ok {
  background: #e7f6ed;
  color: var(--good);
}

.status.bad {
  background: #fde7e4;
  color: var(--bad);
}

.dropzone {
  border: 1px dashed #93a4b7;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 22px;
}

.dropzone.is-dragging {
  background: #eef7f8;
  border-color: var(--accent);
}

.dropzone input {
  width: 100%;
}

.dropzone label {
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.dropzone strong {
  color: var(--text);
  font-size: 18px;
}

.upload-summary {
  display: grid;
  gap: 8px;
}

.upload-summary span {
  color: var(--muted);
  font-size: 13px;
}

progress {
  accent-color: var(--accent);
  height: 10px;
  width: 100%;
}

.upload-queue {
  display: grid;
  gap: 8px;
  max-height: 310px;
  overflow: auto;
}

.upload-item {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(96px, auto);
  padding: 10px;
}

.upload-item strong,
.upload-item small {
  display: block;
  overflow-wrap: anywhere;
}

.upload-item strong {
  font-size: 14px;
}

.upload-item small,
.upload-status {
  color: var(--muted);
  font-size: 12px;
}

.upload-item progress {
  grid-column: 1 / -1;
}

.upload-item[data-status="ok"] .upload-status {
  color: var(--good);
}

.upload-item[data-status="bad"] .upload-status {
  color: var(--bad);
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  min-height: 40px;
  padding: 8px 14px;
}

button:hover {
  background: var(--accent-dark);
}

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

.actions,
.schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.schedule label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.schedule input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 7px 8px;
  width: 86px;
}

.toggle input {
  height: 18px;
  width: 18px;
}

.meta {
  display: grid;
  gap: 8px;
  grid-template-columns: 90px minmax(0, 1fr);
  margin: 0;
}

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

.meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.empty {
  color: var(--muted);
  margin: 0;
}

.log {
  background: #0d1117;
  border-radius: 8px;
  color: #dbe7f3;
  font-size: 12px;
  max-height: 460px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.log.error {
  color: #ffd8d3;
}

.breadcrumb {
  color: var(--muted);
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.breadcrumb a,
.up {
  color: var(--accent);
}

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

.file-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  text-decoration: none;
}

.file-card strong,
.file-card small {
  overflow-wrap: anywhere;
}

.file-card small {
  color: var(--muted);
}

.thumb {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #eef3f6;
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  overflow: hidden;
}

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

.folder .thumb {
  background: #e8f2f7;
  color: var(--accent);
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px;
  }

  .version-badge {
    margin-left: 0;
  }

  .page {
    padding: 18px;
  }

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

  .upload-item {
    grid-template-columns: 1fr;
  }
}
