:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --panel: #161a20;
  --border: #262c35;
  --text: #e8ecf1;
  --muted: #8b95a3;
  --accent: #3d8bfd;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.link {
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.badge {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge-online {
  background: #16351f;
  color: #6fd48b;
}

.badge-offline {
  background: #37191b;
  color: #ea7b7b;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr);
  gap: 20px;
  padding: 24px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.panel:last-child {
  grid-column: 1 / -1;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.hover {
  border-color: var(--accent);
  background: rgba(61, 139, 253, 0.07);
  outline: none;
}

.dropzone.busy {
  opacity: 0.6;
  pointer-events: none;
}

.dropzone-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.dropzone-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

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

.status.ok {
  color: #6fd48b;
}

.status.error {
  color: #ea7b7b;
}

.current img {
  width: 100%;
  border-radius: 8px;
  background: #000;
}

.caption {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #1e242c;
  color: var(--text);
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  border-color: var(--accent);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.thumb {
  position: relative;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.thumb img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  cursor: pointer;
}

.thumb figcaption {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
}

.thumb-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.thumb-delete:hover {
  background: #c0392b;
}
