:root { color-scheme: dark; --bg:#0f1115; --panel:#181b22; --line:#2a2f3a; --text:#e8eaf0; --dim:#9aa3b5; --accent:#5b9dff; --bad:#ff6b6b; --ok:#5fd18a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
button, .btn, input { font: inherit; }
button { cursor: pointer; }

.bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.bar h1 { margin: 0; font-size: 18px; font-weight: 600; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px; }

button.ghost, a.ghost.btn { background: none; border: 1px solid var(--line); color: var(--dim); padding: 4px 10px; border-radius: 6px; font-size: 13px; }
button.ghost:hover, a.ghost.btn:hover { color: var(--text); border-color: var(--dim); }
button.danger:hover { color: var(--bad); border-color: var(--bad); }

.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 34px 16px;
  border: 2px dashed var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; transition: .15s; }
.drop.over, .drop:hover { border-color: var(--accent); background: #1b2230; }
.drop .hint { color: var(--dim); font-size: 13px; }

.queue { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.queue li { display: grid; grid-template-columns: 1fr 140px 190px; gap: 10px; align-items: center; font-size: 13px; color: var(--dim); }
.queue li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.queue li progress { width: 100%; height: 6px; }
.queue li em { font-style: normal; }
.queue li.ok em { color: var(--ok); } .queue li.bad em { color: var(--bad); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.card a { position: relative; display: block; aspect-ratio: 2 / 1; background: #000; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.65); padding: 2px 8px; border-radius: 99px; font-size: 12px; }
.meta { padding: 10px 12px; display: grid; gap: 8px; }
.title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { color: var(--dim); grid-column: 1 / -1; text-align: center; padding: 40px 0; }

.login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login form { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 26px; display: grid; gap: 12px; width: min(340px, 100%); }
.login h1 { margin: 0 0 4px; font-size: 20px; }
.login input { background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 10px 12px; border-radius: 8px; }
.login button { background: var(--accent); color: #fff; border: 0; padding: 10px; border-radius: 8px; font-weight: 600; }
.err { color: var(--bad); margin: 0; font-size: 13px; }

/* viewer */
.viewer-page { position: fixed; inset: 0; background: #000; }
#stage, #pano, #flat { position: absolute; inset: 0; }
#flat { overflow: hidden; touch-action: none; cursor: grab; }
#flat:active { cursor: grabbing; }
#flatimg { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }
.overlay { position: absolute; left: 0; right: 0; display: flex; gap: 8px; padding: 12px; pointer-events: none; z-index: 5; }
.overlay.top { top: 0; } .overlay.bottom { bottom: 0; justify-content: flex-start; }
.pill { pointer-events: auto; background: rgba(15,17,21,.65); backdrop-filter: blur(6px); color: var(--text); border: 1px solid rgba(255,255,255,.12);
  padding: 6px 12px; border-radius: 99px; font-size: 13px; max-width: 70vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.pill.on { background: var(--accent); border-color: var(--accent); }
.pill.title { pointer-events: none; }
.msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--dim); z-index: 4; }
.msg[hidden] { display: none; }
.pnlm-container { background: #000 !important; }

/* albums */
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumbs a, .crumbs span { color: var(--dim); }
.crumbs h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.sect { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin: 22px 0 10px; }
.grid.albums { margin-top: 0; margin-bottom: 24px; }
a.album { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: .15s; }
a.album:hover { border-color: var(--accent); }
a.album .cover { aspect-ratio: 2 / 1; background: #0a0c10; display: grid; place-items: center; }
a.album .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.album .folder { font-size: 38px; color: var(--line); }
a.album .meta { grid-auto-flow: column; justify-content: space-between; align-items: center; }
.count { color: var(--dim); font-size: 13px; background: var(--bg); border-radius: 99px; padding: 1px 9px; }
select.mv { background: none; border: 1px solid var(--line); color: var(--dim); padding: 4px 6px; border-radius: 6px; font-size: 13px; max-width: 150px; }
select.mv:hover { color: var(--text); border-color: var(--dim); }
.bar { gap: 12px; }
