* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f4f5f7;
  color: #1c2430;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.2rem;
  background: #1c2430;
  color: #fff;
}

.brand { font-weight: 700; font-size: 1.1rem; }
.tag {
  font-size: 0.7rem;
  font-weight: 500;
  background: #3d4b61;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  vertical-align: middle;
  margin-left: 0.4rem;
}

.header-right { display: flex; gap: 0.8rem; align-items: center; font-size: 0.85rem; }
.header-right label { display: flex; gap: 0.4rem; align-items: center; }

.banner {
  background: #fff5d6;
  border-bottom: 1px solid #e8d48a;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
}
.banner code { background: #f0e4b8; padding: 0 0.3rem; border-radius: 3px; }

.layout { display: flex; min-height: calc(100vh - 52px); }

nav {
  width: 210px;
  padding: 1rem 0.6rem;
  border-right: 1px solid #dde1e7;
  background: #fff;
}
nav a {
  display: block;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
nav a:hover { background: #eef1f5; }
nav a.active { background: #e3ebfa; font-weight: 600; color: #1a4fa0; }

main { flex: 1; padding: 1.2rem 2rem 3rem; max-width: 1000px; }

.class-head { display: flex; justify-content: space-between; align-items: center; }
h1 { font-size: 1.5rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.8rem 0 0.6rem; }
section { margin-bottom: 1rem; }

button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}
button:hover { background: #1d4fc4; }
button.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  opacity: 0.75;
}
button.ghost:hover { opacity: 1; background: transparent; }
button.small { font-size: 0.7rem; padding: 0.2rem 0.5rem; vertical-align: middle; }

.muted { color: #6b7686; }
.small { font-size: 0.78rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.9rem; }
.card {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 10px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.card-type { font-size: 0.75rem; color: #6b7686; }
.card-title { font-weight: 600; }
.card-meta { font-size: 0.72rem; color: #9aa3b0; }
.card button { align-self: flex-start; margin-top: 0.3rem; }

table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  font-size: 0.85rem;
}
th, td { text-align: left; padding: 0.5rem 0.8rem; border-bottom: 1px solid #eef0f3; }
th { background: #f8f9fb; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: #6b7686; }

.events { display: flex; flex-direction: column; gap: 0.3rem; }
.event {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 6px;
  font-size: 0.82rem;
}
.event summary {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  list-style: none;
}
.event summary::-webkit-details-marker { display: none; }
.event pre {
  margin: 0;
  padding: 0.7rem;
  background: #f8f9fb;
  border-top: 1px solid #eef0f3;
  overflow-x: auto;
  font-size: 0.75rem;
}
.event .muted { margin-left: auto; }

.badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 99px;
  white-space: nowrap;
}
.badge.out { background: #e3ebfa; color: #1a4fa0; }
.badge.in { background: #e2f5e8; color: #187a3c; }
.badge.err { background: #fde5e5; color: #b32222; }
.badge.ok { background: #e2f5e8; color: #187a3c; }
.badge.warn { background: #fff1d6; color: #a86a00; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 33, 0.55);
  display: grid;
  place-items: center;
  z-index: 10;
}
.modal.hidden, .hidden { display: none; }

.modal-box {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: #1c2430;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

.launch-box {
  width: min(1100px, 94vw);
  height: min(760px, 92vh);
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 420px;
  min-height: 320px;
  max-width: 98vw;
  max-height: 96vh;
}
.launch-box iframe { flex: 1; border: none; width: 100%; }
.resize-grip {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  cursor: nwse-resize;
  z-index: 2;
  background: linear-gradient(135deg, transparent 50%, #9aa3b0 50%);
  border-bottom-right-radius: 12px;
  touch-action: none;
}

.settings-box { width: min(480px, 94vw); }
.settings-box form { padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.settings-box label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; font-weight: 600; }
.settings-box input, .settings-box select {
  font: inherit;
  font-weight: 400;
  padding: 0.45rem 0.6rem;
  border: 1px solid #c9cfd8;
  border-radius: 6px;
}
.settings-box small { font-weight: 400; color: #6b7686; }
.row-end { display: flex; justify-content: flex-end; gap: 0.6rem; }
#class-list button { margin: 0.4rem 0.8rem; }
