:root {
	--bg: #0b0d12; --panel: #151922; --panel-2: #1c212d; --line: #262c38;
	--text: #e8e6e3; --muted: #8b93a3; --accent: #e0563b; --accent-2: #f07a5f; --ok: #6cc070; --warn: #e3b341;
	--radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
button, .btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: #283043; }
button.primary, .btn.primary { background: var(--accent); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--accent-2); }
button:disabled { opacity: .45; cursor: default; }
input[type=text], input[type=password] { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: rgba(11, 13, 18, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 20px; flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }

/* library */
.library { padding: 28px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 220px)); gap: 22px; }
.tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--panel); aspect-ratio: 2 / 3; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.tile:hover, .tile:focus-visible { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); outline: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .info { position: absolute; inset: auto 0 0 0; padding: 30px 12px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); }
.tile .title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tile .badge { font-size: 12px; color: var(--muted); }
.tile.noart { background: linear-gradient(160deg, #3a3226, #15120e); }
.tile.noart .info { inset: 0; display: flex; flex-direction: column; justify-content: flex-end; background: none; }
.tile.noart .title { position: static; width: auto; height: auto; overflow: visible; clip: auto; flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 8px; font-size: 20px; font-weight: 600; color: #e8dcc0; }
.tile .badge.ok { color: var(--ok); }

/* dialogs */
dialog { width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
.dialog-body { padding: 22px; display: grid; gap: 14px; }
.dialog-body h2 { margin: 0; font-size: 18px; }
.tabs { display: flex; gap: 6px; }
.tabs button.active { background: var(--accent); }
.qr { display: grid; place-items: center; min-height: 240px; background: #fff; border-radius: 8px; }
.qr img { display: block; }
.row { display: flex; gap: 8px; justify-content: flex-end; }
.error { color: #ff8a7a; font-size: 14px; }

/* centered pages */
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(360px, 100%); padding: 26px; display: grid; gap: 14px; }
.login h1 { margin: 0; font-size: 22px; }
