* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f6fa;
  color: #17212b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
}

button,
input {
  font: inherit;
}

.top {
  padding: 18px 28px;
  background: #123e5f;
  color: #fff;
}

.topin,
.wrap {
  max-width: 1240px;
  margin: auto;
}

.topin {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 22px;
  font-weight: 750;
}

.connection {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9aa8b5;
}

.dot.connected {
  background: #35c46a;
}

.dot.connecting,
.dot.reconnecting {
  background: #ffbe45;
}

.dot.error {
  background: #ef5350;
}

.wrap {
  padding: 24px;
}

.notice {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #fff1d6;
  color: #714700;
}

.notice.ok {
  background: #e4f5e9;
  color: #176b35;
}

.card {
  padding: 20px;
  margin-bottom: 18px;
  border: 1px solid #e0e7ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(30, 55, 75, 0.04);
}

h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.roster-row {
  margin-bottom: 18px;
}

.field {
  flex: 1;
  min-width: 160px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #5c6d7d;
  font-size: 13px;
}

.field input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #ccd7e2;
  border-radius: 7px;
}

.btn {
  height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 7px;
  background: #e8eff5;
  color: #175f92;
  font-weight: 650;
  cursor: pointer;
}

.btn.primary {
  background: #1769aa;
  color: #fff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.step {
  padding: 14px;
  border: 1px solid #e2e9f0;
  border-radius: 9px;
  color: #657585;
}

.step.done {
  border-color: #7bc995;
  background: #f0faf3;
  color: #176b35;
}

.step strong {
  display: block;
  margin-bottom: 5px;
  color: inherit;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  padding: 9px 15px;
  border: 1px solid #cbd7e1;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.tab.active {
  border-color: #1769aa;
  background: #1769aa;
  color: #fff;
}

.code-action {
  margin-top: 16px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric {
  padding: 16px;
  border: 1px solid #e1e8ef;
  border-radius: 10px;
  background: #fff;
}

.metric span {
  color: #677889;
  font-size: 13px;
}

.metric b {
  display: block;
  margin-top: 7px;
  font-size: 27px;
}

.code {
  color: #123e5f;
  font-family: Consolas, monospace;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(250px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

.learning-import {
  margin-top: 18px;
}

.section-heading p {
  margin: -8px 0 16px;
}

.learning-result {
  padding: 14px;
  margin-top: 16px;
  border: 1px solid #dbe4ec;
  border-radius: 9px;
  background: #f8fafc;
}

.learning-result p {
  margin: 10px 0 0;
}

.status-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.status-chip {
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
}

.status-chip.deepgreen {
  background: #176b35;
}

.status-chip.green {
  background: #35a95f;
}

.status-chip.yellow {
  background: #e3a928;
  color: #3f3108;
}

.status-chip.red {
  background: #dc4c4c;
}

.status-chip.deepred {
  background: #8f1d1d;
}

.room {
  overflow: auto;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 15px;
  color: #627383;
  font-size: 13px;
}

.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: -1px;
}

.legend-gray {
  background: #a9b3bd;
}

.legend-deepgreen {
  background: #176b35;
}

.legend-green {
  background: #35a95f;
}

.legend-yellow {
  background: #e3a928;
}

.legend-red {
  background: #dc4c4c;
}

.legend-deepred {
  background: #8f1d1d;
}

.seat-grid {
  display: grid;
  min-width: 500px;
  gap: 10px;
}

.seat-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.group {
  padding: 12px;
  border: 1px dashed #b9c8d5;
  border-radius: 10px;
}

.group-title {
  margin-bottom: 9px;
  color: #607285;
  font-size: 13px;
  text-align: center;
}

.group-seats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.seat {
  display: flex;
  min-height: 68px;
  flex-direction: column;
  justify-content: center;
  padding: 7px;
  border: 2px solid transparent;
  border-radius: 9px;
  color: #fff;
  text-align: center;
  cursor: pointer;
}

.seat.gray {
  background: #a9b3bd;
  color: #2f3b46;
}

.seat.deepgreen {
  background: #176b35;
}

.seat.green {
  background: #35a95f;
}

.seat.yellow {
  background: #e3a928;
  color: #3f3108;
}

.seat.red {
  background: #dc4c4c;
}

.seat.deepred {
  background: #8f1d1d;
}

.seat.selected {
  border-color: #17212b;
  box-shadow: 0 0 0 3px rgba(23, 33, 43, 0.15);
}

.seat small {
  display: block;
  margin-top: 3px;
  opacity: 0.85;
}

.absent {
  max-height: 380px;
  overflow: auto;
}

.absent-row {
  padding: 9px 0;
  border-bottom: 1px solid #edf1f5;
}

.muted {
  color: #6d7c89;
  font-size: 13px;
}

.empty {
  padding: 38px 12px;
  color: #71808d;
  text-align: center;
}

.modal {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 28, 41, 0.45);
}

.dialog {
  width: min(430px, 100%);
  padding: 22px;
  border-radius: 12px;
  background: #fff;
}

.dialog h3 {
  margin-top: 0;
}

.detail {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  font-size: 14px;
}

.dialog-actions {
  margin-top: 20px;
  text-align: right;
}

@media (max-width: 850px) {
  .steps,
  .metrics,
  .workspace {
    grid-template-columns: 1fr;
  }

  .wrap {
    padding: 14px;
  }
}
