:root {
  --bg: #0b0d0f;
  --panel: #121519;
  --text: #e7ebef;
  --muted: #9aa4af;
  --accent: #5da9ff;
  --border: #1e242b;
  --focus: #8bc1ff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 10% 0%, #0f1318 0%, var(--bg) 50%), var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px;
}

.container {
  width: min(100%, 960px);
  max-width: 960px;
  margin: 48px auto;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

h1 {
  font-size: clamp(24px, 3.2vw, 32px);
  margin: 0 0 16px;
  letter-spacing: 0.2px;
}

.subhead {
  margin: -12px 0 12px;
  font-size: 14px;
  color: var(--muted);
}

.instruction-section {
  margin: 16px 0 20px;
  /* Safari spacing fix */
  padding-top: 8px;
}

.instruction-main {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  /* Safari font weight fix */
  -webkit-font-weight: 500;
  font-weight: 500 !important;
}

.instruction-items {
  margin: 0 0 16px;
}

.instruction-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
}

.instruction-item .arrow {
  color: var(--accent);
  font-weight: bold;
  margin-right: 8px;
  flex-shrink: 0;
  /* Force Safari to use the correct color */
  -webkit-text-fill-color: var(--accent) !important;
  color: var(--accent) !important;
}

.instruction-item .text {
  flex: 1;
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted) !important;
}

.instruction-tip {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  font-weight: 400;
}

/* Group grade + teacher with a subtle panel feel */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
}

.control label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1318;
  color: var(--text);
  outline: none;
  appearance: none;
  position: relative;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 16px, calc(100% - 12px) 16px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.message {
  margin-top: 22px;
  padding: 16px 14px;
  border-radius: 12px;
  border: 1px solid #24303b;
  background: radial-gradient(800px 300px at 0% 0%, rgba(93,169,255,0.08), rgba(255,255,255,0.02));
  font-size: 18px;
  line-height: 1.35;
}

.message:empty {
  display: none;
}

.muted { color: var(--muted); }
.accent { color: var(--accent); font-weight: 600; }

.actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .06s ease;
}

.btn:hover {
  color: var(--text);
  border-color: #2a333d;
}

.btn:active { transform: translateY(1px); }

.btn.secondary {
  background: rgba(255,255,255,0.02);
}

@media (max-width: 640px) {
  .controls { grid-template-columns: 1fr; }
  .container { margin: 24px auto; }
}

.footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  width: min(100%, 960px);
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted);
}

.footer a { color: var(--muted); text-decoration: underline; }

/* Visibility utility */
.hidden { display: none !important; }

/* Make the primary action much more prominent */
.btn.primary {
  background: linear-gradient(180deg, #5da9ff, #4b90e2);
  color: #0b0d0f;
  border-color: #5da9ff;
  padding: 12px 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 18px rgba(93, 169, 255, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn.primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 22px rgba(93, 169, 255, 0.45);
}

.actions { gap: 10px; }

/* Focus ring for accessibility */
:where(button, select):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Icon sizing for inline SVGs */
.icon { display: inline-block; }
.external-icon { width: 16px; height: 16px; }


