.draw-heading {
  padding-bottom: 10px;
}

.draw-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
}

.draw-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
}

.draw-panel h2, .draw-history h2 {
  margin: 0 0 14px;
}

.draw-panel label {
  display: block;
  font-weight: 600;
}

#roster-file {
  display: block;
  width: 100%;
  margin: 7px 0 12px;
  font-size: .92rem;
}

.draw-help, .draw-status, .draw-result-label {
  font-size: .92rem;
  color: var(--muted);
}

.draw-status { margin: 0; }
.draw-status[data-error] { color: #9c2c20; }

.draw-main {
  background: var(--pale);
}

.draw-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.draw-counts div {
  padding: 7px 8px;
  background: var(--white);
  text-align: center;
}

.draw-counts dt { font-size: .88rem; color: var(--muted); }
.draw-counts dd { margin: 0; color: var(--blue); font-size: 1.35rem; font-weight: 700; }

.draw-result {
  display: grid;
  place-content: center;
  min-height: 104px;
  padding: 12px 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.draw-result p { margin: 0; }
.draw-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; list-style: none; padding: 0; margin: 7px 0 0; }
.draw-people strong { font-size: 1.18rem; }
.draw-controls { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: end; }
.draw-controls label { font-weight: 400; }
#draw-student { min-height: 50px; font-size: 1.05rem; }
#show-projection { width: 100%; margin-top: 10px; }

.draw-layout button, .draw-history button, .draw-dialog button { cursor: pointer; font-family: inherit; }
.draw-layout button:disabled, .draw-history button:disabled, .draw-dialog button:disabled {
  background: #e5ebf3;
  border-color: #b6c6db;
  color: #526579;
  cursor: default;
}

.draw-history-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.draw-history-heading h2 { margin: 0; }
.draw-history td { overflow-wrap: anywhere; }
.draw-history th { white-space: nowrap; }
.draw-history td:nth-child(2) { min-width: 4rem; }
.draw-history .draw-edit { padding: 3px 12px; white-space: nowrap; }

.draw-dialog {
  width: min(430px, calc(100% - 36px));
  padding: 25px;
  border: 1px solid var(--line);
  color: var(--ink);
}

.draw-dialog::backdrop { background: rgb(24 48 71 / 45%); }
.draw-dialog .field { margin-bottom: 12px; }
.draw-dialog input { width: 100%; }
.draw-dialog .actions { margin-top: 12px; }

.draw-projection {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #10243f;
  color: #fff;
  overflow: auto;
}

.draw-projection-content { display: flex; flex-direction: column; min-height: 100%; padding: clamp(20px, 5vw, 70px); }
.draw-projection-content:fullscreen { background: #10243f; overflow: auto; }
.draw-projection header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-color: #557092; padding-bottom: 16px; }
.draw-projection h2 { margin: 0; color: #fff; font-size: clamp(1.45rem, 3vw, 2.4rem); }
.draw-projection button { font-family: inherit; cursor: pointer; }
.projection-people { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); place-content: center; gap: clamp(12px, 2vw, 28px); list-style: none; margin: 0; padding: 26px 0; }
.projection-people li { background: #1d375b; padding: clamp(16px, 3vw, 42px) 12px; text-align: center; overflow-wrap: anywhere; }
.projection-people strong, .projection-people span { display: block; }
.projection-people strong { font-size: clamp(2.3rem, 6.6vw, 7rem); line-height: 1.2; }
.projection-people span { margin-top: 12px; font-variant-numeric: tabular-nums; color: #cfdef1; font-size: clamp(1.1rem, 2.4vw, 2.5rem); }

@media (max-width: 740px) {
  .draw-layout { grid-template-columns: 1fr; gap: 16px; }
  .draw-panel { padding: 18px; }
  .draw-history td, .draw-history th { padding: 10px 8px; }
  .draw-history td:first-child { min-width: 64px; }
  .projection-people { grid-auto-flow: row; grid-auto-columns: auto; }
}
