*{box-sizing:border-box}body{margin:0;font-family:sans-serif;background:#faf8f6;color:#1f2937} .container{max-width:900px;margin:20px auto;padding:0 16px} .card{background:#fff;border:1px solid #eee;border-radius:10px;padding:16px;margin:16px 0;box-shadow:0 4px 12px rgba(0,0,0,.06)} .section-title{margin:12px 0;font-size:18px} .panel{background:#fff7f2;border:1px solid #ffd9c9;padding:12px;border-radius:8px;margin:12px 0} .grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;row-gap:20px} .field{display:flex;flex-direction:column;margin-bottom:8px} label{font-weight:600} .muted{color:#777;font-weight:400} input,select,textarea{padding:8px;border:1px solid #ccc;border-radius:6px;font-family:sans-serif} textarea{resize:vertical;width:100%;margin-top:8px} .btn{background:#ff8a3d;color:#fff;border:none;border-radius:6px;padding:10px 16px;cursor:pointer;font-weight:600;transition:all 0.2s} .btn:disabled{background:#ccc;cursor:not-allowed;opacity:0.5} .btn--ghost{background:#f3f3f3;color:#333;border:1px solid #ccc} pre{white-space:pre-wrap}
.scope-advanced {
  display: none;
}

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(250, 248, 246, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-screen[hidden] {
  display: none !important;
}

.loading-content {
  text-align: center;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ff8a3d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-content h2 {
  color: #333;
  font-size: 24px;
  margin: 0 0 8px 0;
}

.loading-content p {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* 3-State Toggle Styles */
.subscope-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.subscope-label {
  font-weight: 700;
  font-size: 15px;
  color: #374151;
  margin-bottom: 4px;
  text-align: center;
}

.toggle-group {
  display: flex;
  flex-direction: column;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
  gap: 3px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  min-width: 0;
}

.toggle-option {
  padding: 8px 6px;
  border-radius: 8px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6b7280;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.toggle-option:hover {
  color: #374151;
  transform: translateX(2px);
}

.toggle-option.active-mastered {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.toggle-option.active-focus {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.toggle-option.active-notlearned {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}