:root {
  --bg: #15171c;
  --card: #1e2129;
  --border: #2e323c;
  --text: #e7e9ee;
  --muted: #8b919e;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px 16px 64px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.5;
}

main, .login { max-width: 760px; margin: 0 auto; }

h1 { font-size: 1.4rem; margin: 0 0 4px; }
header { margin-bottom: 16px; }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.error { color: var(--error); min-height: 1.2em; margin: 6px 0 0; }

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

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: center; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }

input, select, textarea {
  background: #14161b;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}
input[type="number"] { width: 110px; }
.search { width: 240px; }

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); font-weight: 500; }
.btn.ghost:hover { background: #262a33; }

/* メンバー一覧 */
.members { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }

.member {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.member .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.member .info { min-width: 0; }
.member .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .assign { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.member .assign .assigned { width: 48px; height: 48px; object-fit: contain; border-radius: 4px; background: #0c0d10; }
.member .actions { display: flex; align-items: center; gap: 6px; }
.member .actions input[type="number"] { width: 60px; padding: 6px; }

textarea {
  width: 100%;
  min-height: 260px;
  margin-bottom: 10px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  white-space: pre;
  resize: vertical;
}

.login { display: flex; min-height: 70vh; align-items: center; }
.login .card { width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.btn.discord { background: #5865f2; text-decoration: none; display: inline-block; }
.btn.discord:hover { background: #4752c4; }

/* ログイン中ユーザー表示 */
.userbox { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.me-avatar { width: 32px; height: 32px; border-radius: 50%; }
.me-name { font-size: 0.9rem; }

/* セクション見出し・タブ・チェック・ID入力 */
.sec { font-size: 1rem; margin: 0 0 12px; color: #cfd4de; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 6px 14px; cursor: pointer; font: inherit; }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chk { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
#idinput { width: 100%; min-height: 70px; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; margin-bottom: 8px; }
.member .add { white-space: nowrap; justify-self: end; }
