:root {
  --bg: #102429;
  --card: #163036;
  --ink: #f5f7f7;
  --muted: #9aabaf;
  --line: #4b5a5d;
  --blue: #8c141e;
  --blue-soft: #3a1a1e;
  --green: #fcd64d;
  --green-soft: #3a3420;
  --red: #e85a5a;
  --red-soft: #3a1a1e;
  --amber: #fcd64d;
  --amber-soft: #3a3420;
  --accent: #8c141e;
  --accent-text: #ffffff;
  --highlight: #fcd64d;
  --surface: #4b5a5d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 60px; }
header.app {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px;
}
header.app h1 { font-size: 1.35rem; margin: 0; display: flex; align-items: center; gap: 10px; }
header.app .brand { color: var(--highlight); font-weight: 700; }
.logo-img {
  height: 52px; width: auto; display: block;
  object-fit: contain;
}
.logo-img.lg { height: 72px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px; margin: 14px 0;
}
.card h2 { margin: 0 0 10px; font-size: 1.15rem; color: var(--ink); }
label { display: block; font-weight: 600; margin: 10px 0 4px; font-size: 0.92rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
}
input:focus, textarea:focus {
  outline: 2px solid var(--highlight); outline-offset: 1px; border-color: var(--highlight);
}
textarea { min-height: 120px; font-family: ui-monospace, monospace; font-size: 0.88rem; }
.btn {
  font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 10px;
  border: 0; background: var(--accent); color: var(--accent-text); cursor: pointer;
}
.btn:hover { filter: brightness(1.12); }
.btn.ghost {
  background: transparent; color: var(--highlight); border: 2px solid var(--surface);
}
.btn.ghost:hover { border-color: var(--highlight); }
.btn.danger { background: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 0.88rem; }
.btn.linkish {
  background: none; border: 0; color: var(--muted); font-size: 0.82rem;
  font-weight: 600; padding: 4px 0; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.linkish:hover { color: var(--highlight); }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.msg { margin-top: 10px; font-size: 0.92rem; }
.msg.err { color: #ff8a8a; }
.msg.ok { color: var(--highlight); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button {
  font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 99px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer;
}
.tabs button.on {
  border-color: var(--accent); background: var(--accent); color: #fff;
}
.hidden { display: none !important; }
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; background: var(--bg);
}
.list li a { font-weight: 600; color: var(--highlight); text-decoration: none; flex: 1; }
.badge {
  font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: var(--surface); color: var(--ink);
}
.badge.teacher { background: var(--amber-soft); color: var(--highlight); }
.tip {
  border-left: 4px solid var(--highlight); background: rgba(252, 214, 77, 0.08);
  padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 0.93rem;
}
.warn {
  border-left: 4px solid var(--accent); background: rgba(140, 20, 30, 0.15);
  padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 0.93rem;
}
.prompt-box {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; max-height: 280px; overflow: auto; font-size: 0.82rem;
  white-space: pre-wrap; font-family: ui-monospace, monospace; line-height: 1.45;
  color: var(--muted);
}
.muted { color: var(--muted); font-size: 0.9rem; }
.userbar { font-size: 0.9rem; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.userbar strong { color: var(--ink); }
code { background: var(--bg); padding: 1px 6px; border-radius: 4px; color: var(--highlight); }
.invite-wrap { margin-top: 6px; }

.btn.logout {
  background: #8C141E !important;
  color: #fff !important;
  border: 0 !important;
}
.btn.logout:hover { filter: brightness(1.15); }
