:root{
  --bg:#0b0f17;
  --panel:#111827;
  --panel2:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --brand:#38bdf8;
  --brand2:#22c55e;
  --danger:#ef4444;
  --border:rgba(255,255,255,.08);
  --shadow:0 18px 60px rgba(0,0,0,.45);
  --radius:16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 15% -10%, rgba(56,189,248,.25), transparent 60%),
              radial-gradient(900px 600px at 90% 0%, rgba(34,197,94,.18), transparent 55%),
              var(--bg);
  color:var(--text);
}
a{color:inherit; text-decoration:none}
a:hover{opacity:.92}
.container{max-width:1100px; margin:0 auto; padding:24px}
.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter:saturate(180%) blur(14px);
  background:rgba(11,15,23,.65);
  border-bottom:1px solid var(--border);
}
.topbar-inner{display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 24px; max-width:1100px; margin:0 auto;}
.brand{display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:.2px}
.badge{font-size:12px; padding:4px 10px; border:1px solid var(--border); border-radius:999px; color:var(--muted)}
.nav{display:flex; gap:10px; flex-wrap:wrap}
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 14px; border-radius:12px; border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{background:rgba(255,255,255,.06)}
.btn.primary{background:linear-gradient(135deg, rgba(56,189,248,.22), rgba(34,197,94,.18)); border-color:rgba(56,189,248,.25)}
.btn.danger{background:rgba(239,68,68,.12); border-color:rgba(239,68,68,.25)}
.btn.small{padding:8px 10px; border-radius:10px; font-size:13px}
.card{
  background:linear-gradient(180deg, rgba(17,24,39,.92), rgba(15,23,42,.92));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card .card-h{padding:16px 18px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:10px}
.card .card-b{padding:18px}
.h1{font-size:28px; margin:0}
.h2{font-size:18px; margin:0}
.p{color:var(--muted); line-height:1.5; margin:10px 0 0}
.grid{display:grid; gap:16px}
.grid.cols2{grid-template-columns: 1.2fr .8fr}
@media (max-width: 900px){ .grid.cols2{grid-template-columns:1fr} }

.table{width:100%; border-collapse:collapse}
.table th,.table td{padding:10px 8px; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle}
.table th{color:var(--muted); font-weight:600; font-size:13px}
.muted{color:var(--muted)}
.kbd{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
     font-size:12px; padding:2px 6px; border:1px solid var(--border); border-radius:8px; color:var(--muted)}
.input, select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
}
textarea{min-height:90px; resize:vertical}
.row{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width:700px){ .row{grid-template-columns:1fr} }
.help{font-size:13px; color:var(--muted); margin-top:8px}
.hr{height:1px; background:var(--border); margin:16px 0}

.drop{
  border:1.5px dashed rgba(255,255,255,.18);
  background:rgba(255,255,255,.02);
  border-radius:14px;
  padding:18px;
  display:flex; align-items:center; justify-content:center;
  text-align:center;
}
.drop.dragover{border-color:rgba(56,189,248,.6); background:rgba(56,189,248,.06)}
.progress{height:10px; border-radius:999px; background:rgba(255,255,255,.06); overflow:hidden}
.progress > div{height:100%; width:0%; background:linear-gradient(90deg, rgba(56,189,248,.95), rgba(34,197,94,.85))}
.toast{position:fixed; right:18px; bottom:18px; max-width:360px; padding:12px 14px; border-radius:14px;
       background:rgba(17,24,39,.92); border:1px solid var(--border); box-shadow:var(--shadow); display:none}
.toast.show{display:block}

.gallery-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap:14px;
}
.tile{
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--border);
  background:rgba(255,255,255,.02);
  position:relative;
}
.tile img{width:100%; height:170px; object-fit:cover; display:block; background:#0b1020}
.tile .meta{padding:10px 10px 12px}
.tile .meta .name{font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.tile .pick{
  position:absolute; top:10px; left:10px;
  display:flex; align-items:center; gap:8px;
  padding:7px 10px;
  background:rgba(11,15,23,.75);
  border:1px solid var(--border);
  border-radius:999px;
}
.tile input[type=checkbox]{width:16px; height:16px}
.tile .comment{
  display:none;
  padding:10px;
  border-top:1px solid var(--border);
}
.tile.selected .comment{display:block}
.tile.selected{outline:2px solid rgba(34,197,94,.45)}
.modal{
  position:fixed; inset:0; background:rgba(0,0,0,.72);
  display:none; align-items:center; justify-content:center; padding:22px; z-index:80;
}
.modal.show{display:flex}
.modal .box{max-width:min(1200px, 95vw); max-height:90vh; width:100%;
  background:rgba(15,23,42,.94);
  border:1px solid var(--border);
  border-radius:18px;
  overflow:hidden;
  box-shadow:var(--shadow);
}
.modal .box .mh{display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-bottom:1px solid var(--border)}
.modal .box .mb{padding:0; background:#050814}
.modal img{width:100%; height:auto; max-height: calc(90vh - 64px); object-fit:contain; display:block}

/* Selection control under the image */
.actions{margin-top:10px}
.pickline{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  cursor:pointer;
  user-select:none;
  font-size:13px;
}
.pickline:hover{background:rgba(255,255,255,.06)}
.pickline input{width:18px;height:18px}

/* pick button under image */
.pickbtn{width:100%}

/* Modal comment panel */
.modal-comment{
  padding:14px;
  border-top:1px solid var(--border);
  background:rgba(15,23,42,.92);
}
.modal-comment textarea{min-height:90px}

.btn.icon{padding:8px 10px}
