:root {
  --bg: #0e1116; --panel: #151a22; --line: #232b36;
  --fg: #e6edf3; --dim: #8b98a8; --accent: #f7931e; --accent-fg: #12161c; --danger: #ef4d5a;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "PingFang HK", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.topbar {
  position: sticky; top: 0; z-index: 20; height: 58px; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(14,17,22,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-fg);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.name { font-weight: 650; }
.name em { font-style: normal; color: var(--dim); font-weight: 500; }
.right { display: flex; align-items: center; gap: 10px; }
.pill { font-size: 12px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.pill.on { color: #5ad07a; border-color: #2a4a35; }

button, a.primary { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid transparent; padding: 8px 14px; }
.primary { background: var(--accent); color: var(--accent-fg); font-weight: 650; text-decoration: none; display: inline-block; }
.primary.big { padding: 12px 22px; font-size: 16px; }
.primary:hover { filter: brightness(1.07); }
.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.ghost:hover { background: var(--panel); }
.icon { background: transparent; border: 0; color: var(--dim); padding: 4px 6px; border-radius: 8px; }
.icon:hover { color: var(--fg); background: #1e2530; }

main { max-width: 1080px; margin: 0 auto; padding: 18px 18px 70px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card h3 { margin: 0 0 12px; font-size: 14px; color: var(--dim); font-weight: 600; letter-spacing: .3px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; }
.kv span { color: var(--dim); }
.kv b { font-weight: 550; text-align: right; word-break: break-all; }
.row { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.field { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 10px; }
.field input { display: block; width: 100%; margin-top: 6px; }
input[type=text], input[type=password] {
  background: #0e1116; color: var(--fg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; width: 100%;
}
input:focus { outline: none; border-color: var(--accent); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px;
  border: 1.5px dashed var(--line); border-radius: 12px; color: var(--dim); font-size: 12.5px; }
.drop.hot { border-color: var(--accent); color: var(--accent); }
.progress { height: 6px; background: #0e1116; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; width: 0%; background: var(--accent); transition: width .15s; }
.muted { color: var(--dim); font-size: 12.5px; }
.listbar { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 10px; }
.listbar h3 { margin: 0; font-size: 15px; }
.listbar .row { margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0b0f14; }
.tile img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #0b0f14; }
.tile .cap { padding: 7px 9px; font-size: 11.5px; color: var(--dim); display: flex; justify-content: space-between; gap: 6px; }
.tile .del { position: absolute; top: 6px; right: 6px; background: rgba(10,13,18,.78); border-radius: 8px; }
.tile .del:hover { color: var(--danger); }

.gate { max-width: 420px; margin: 16vh auto; text-align: center; padding: 0 20px; }
.gate h1 { font-size: 22px; margin: 0 0 8px; }
.gate p { color: var(--dim); font-size: 13px; margin: 0 0 16px; }
.gate input { margin-bottom: 14px; text-align: center; letter-spacing: 1px; }
.err { color: var(--danger); font-size: 12.5px; min-height: 18px; }
.empty { text-align: center; color: var(--dim); padding: 40px 0; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel);
  border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 60;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 86vw; }
.toast.bad { border-color: var(--danger); }
