:root{
  --bg:#f5f6f8;
  --card:#ffffff;
  --border:#e2e4e9;
  --text:#1b1e24;
  --muted:#6b7280;
  --accent:#4f46e5;
  --accent-light:#eef0ff;
  --danger:#e5484d;
  --danger-light:#fdecec;
  --success:#16a34a;
  --success-light:#eafaf0;
  --shadow:0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.06);
  --radius:12px;
}
*{box-sizing:border-box;}
body{
  margin:0;
  padding:32px 16px;
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
.wrap{
  max-width:640px;
  margin:0 auto;
}
.wrap.wide{
  max-width:860px;
}
h1{
  font-size:22px;
  font-weight:600;
  margin:0 0 4px;
}
h2{
  font-size:17px;
  font-weight:600;
  margin:0 0 12px;
}
p.sub{
  color:var(--muted);
  margin:0 0 24px;
  font-size:14px;
}
a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:20px;
  margin-bottom:16px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:24px;
  gap:12px;
  flex-wrap:wrap;
}
.topbar .brand{
  font-weight:700;
  font-size:16px;
}
.user-chip{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:var(--muted);
}
.user-chip img{
  width:26px;
  height:26px;
  border-radius:50%;
}
.badge{
  display:inline-block;
  font-size:11px;
  font-weight:700;
  padding:2px 8px;
  border-radius:999px;
  background:var(--accent-light);
  color:var(--accent);
  margin-left:6px;
}

.btn{
  border:none;
  border-radius:8px;
  padding:10px 16px;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:background .15s, opacity .15s;
  text-align:center;
  display:inline-block;
}
.btn-primary{ background:var(--accent); color:#fff; }
.btn-primary:hover{ background:#4338ca; text-decoration:none; }
.btn-ghost{ background:transparent; color:var(--muted); border:1px solid var(--border); }
.btn-ghost:hover{ background:#f2f3f5; text-decoration:none; }
.btn-danger{ background:var(--danger-light); color:var(--danger); border:1px solid #f6c9ca; }
.btn-danger:hover{ background:#fbdada; text-decoration:none; }
.btn-sm{ padding:6px 12px; font-size:13px; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; }

.btn-discord{
  background:#5865F2;
  color:#fff;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:12px 20px;
  border-radius:8px;
  font-weight:600;
  font-size:15px;
}
.btn-discord:hover{ background:#4752c4; text-decoration:none; }

input[type=text]{
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:8px;
  font-size:14px;
  outline:none;
  transition:border-color .15s;
  width:100%;
  font-family:inherit;
}
input[type=text]:focus{ border-color:var(--accent); }

.add-row{ display:flex; gap:8px; margin-bottom:16px; }
.add-row input{ flex:1; }

ul.plain-list{ list-style:none; margin:0; padding:0; }

ul#list, ul.sortable{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
li.item{
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  touch-action:none;
  user-select:none;
}
li.item.dragging{ opacity:.4; }
li.item .num{
  width:22px; height:22px; min-width:22px;
  border-radius:50%;
  background:var(--accent-light);
  color:var(--accent);
  font-size:12px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
li.item .label{ flex:1; font-size:14px; word-break:break-word; }
li.item .handle{
  cursor:grab; color:var(--muted); padding:4px; line-height:0; touch-action:none;
}
li.item .handle:active{ cursor:grabbing; }
li.item .remove{
  background:none; border:none; color:var(--muted);
  cursor:pointer; font-size:16px; line-height:1; padding:4px 6px; border-radius:6px;
}
li.item .remove:hover{ background:var(--danger-light); color:var(--danger); }

.placeholder{
  border:2px dashed var(--accent);
  background:var(--accent-light);
  border-radius:10px;
  height:44px;
}
.empty{ text-align:center; color:var(--muted); font-size:14px; padding:24px 0; }

.footer-row{
  display:flex; justify-content:space-between; align-items:center; margin-top:16px; gap:12px; flex-wrap:wrap;
}
.footer-row span{ font-size:13px; color:var(--muted); }

.list-row{
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 4px; border-bottom:1px solid var(--border); gap:12px; flex-wrap:wrap;
}
.list-row:last-child{ border-bottom:none; }
.list-row .title{ font-weight:600; font-size:15px; }
.list-row .meta{ font-size:12px; color:var(--muted); margin-top:2px; }
.list-row .actions{ display:flex; gap:8px; flex-wrap:wrap; }

.status-open{ color:var(--success); background:var(--success-light); padding:2px 8px; border-radius:999px; font-size:11px; font-weight:700; }
.status-closed{ color:var(--danger); background:var(--danger-light); padding:2px 8px; border-radius:999px; font-size:11px; font-weight:700; }

.flash-error{
  background:var(--danger-light); color:var(--danger); border:1px solid #f6c9ca;
  border-radius:8px; padding:10px 14px; font-size:14px; margin-bottom:16px;
}
.flash-success{
  background:var(--success-light); color:var(--success); border:1px solid #b7ebc6;
  border-radius:8px; padding:10px 14px; font-size:14px; margin-bottom:16px;
}

table.submissions{ width:100%; border-collapse:collapse; font-size:13px; }
table.submissions th, table.submissions td{
  text-align:left; padding:8px 10px; border-bottom:1px solid var(--border); vertical-align:top;
}
table.submissions th{ color:var(--muted); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.03em; }
table.submissions ol{ margin:0; padding-left:18px; }

.center-page{
  min-height:70vh; display:flex; align-items:center; justify-content:center;
}
.login-card{ text-align:center; max-width:380px; }
.login-card .icon{ font-size:40px; margin-bottom:8px; }
