:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  background: #11151b;
  color: #e9eef5;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 32px; background: #171d25; border-bottom: 1px solid #2c3541; }
h1, h2, p { margin-top: 0; }
header p { margin-bottom: 0; color: #9ba9b8; }
main { max-width: 1500px; margin: auto; padding: 24px; }
.panel { background: #181f28; border: 1px solid #2c3541; border-radius: 12px; padding: 18px; box-shadow: 0 8px 24px rgb(0 0 0 / 18%); }
.controls { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 2fr) auto; gap: 14px; align-items: end; margin-bottom: 18px; }
label { display: grid; gap: 7px; color: #abb7c4; font-size: .92rem; }
input, select, button { font: inherit; }
input[type="search"], select { width: 100%; border: 1px solid #3a4654; border-radius: 8px; padding: 11px 12px; background: #10151b; color: #fff; }
button { border: 0; border-radius: 8px; padding: 11px 15px; background: #5aa2ff; color: #07111d; font-weight: 700; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary { padding: 8px 10px; background: #313c49; color: #e9eef5; }
button.danger { color: #ffb4b4; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-title h2 { margin: 0; font-size: 1.15rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 13px; max-height: 65vh; overflow: auto; padding-right: 4px; }
.media-card { position: relative; min-width: 0; background: #11171e; border: 1px solid #2d3845; border-radius: 10px; overflow: hidden; }
.media-card.selected { outline: 2px solid #5aa2ff; }
.media-card img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; background: #202934; }
.media-info { padding: 10px; }
.media-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-info span { color: #94a3b2; font-size: .83rem; }
.media-card input { position: absolute; top: 9px; right: 9px; width: 21px; height: 21px; accent-color: #5aa2ff; }
.queue { display: grid; gap: 8px; max-height: 52vh; overflow: auto; }
.queue-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px; background: #11171e; border-radius: 8px; }
.queue-item small { color: #94a3b2; }
.queue-item button { padding: 5px 8px; background: transparent; color: #ff9f9f; }
.checkbox-line { display: flex; grid-template-columns: auto 1fr; align-items: center; margin: 16px 0; }
.checkbox-line input { width: 18px; height: 18px; }
.download-button { width: 100%; }
.status-panel { margin-top: 18px; }
.badge { display: inline-block; padding: 6px 9px; border-radius: 999px; background: #293442; color: #bdd7f7; font-size: .85rem; }
.progress { height: 14px; background: #0d1217; border-radius: 999px; overflow: hidden; border: 1px solid #303b47; }
.progress > div { height: 100%; width: 0; background: #5aa2ff; transition: width .25s; }
.muted { color: #94a3b2; margin-top: 8px; }
.path { margin-top: 8px; font-family: ui-monospace, monospace; color: #b8c5d1; overflow-wrap: anywhere; }
.errors { margin-top: 12px; color: #ffabab; white-space: pre-wrap; }
.empty { color: #8f9dab; padding: 26px; text-align: center; }
@media (max-width: 900px) {
  header { align-items: flex-start; padding: 20px; }
  main { padding: 14px; }
  .controls, .layout { grid-template-columns: 1fr; }
  .media-grid { max-height: none; }
}
.queue-main { min-width: 0; display: grid; gap: 3px; }
.destination-label { margin-top: 8px; font-size: .78rem; }
.destination-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.destination-row select { min-width: 0; padding: 8px 9px; }
.folder-button { padding: 7px 10px !important; }
