:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #4f46e5;
  --accent: #0ea5e9;
  --success: #10b981;
  --success-light: #d1fae5;
  --error: #ef4444;
  --error-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #93c5fd;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.user-status-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.student-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
}

.level-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: #f1f5f9;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.badge-level {
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-facil { background: #dcfce7; color: #15803d; }
.badge-medio { background: #fef3c7; color: #b45309; }
.badge-dificil { background: #fee2e2; color: #b91c1c; }

/* Main layout */
main.app-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.screen-section {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.screen-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Common Card Styles */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

/* Welcome Screen */
.welcome-hero {
  text-align: center;
  max-width: 760px;
  margin: 1.5rem auto;
  padding: 2.5rem 2rem;
}

.hero-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.welcome-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.welcome-hero p.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.name-input-group {
  max-width: 480px;
  margin: 0 auto 2rem auto;
  text-align: left;
}

.name-input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #334155;
}

.input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.name-input-group input {
  flex: 1;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.name-input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
  text-align: left;
}

.feature-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.feature-box .feat-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.feature-box h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #1e293b;
}

.feature-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Level header & Progress bar */
.level-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.level-meta h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.level-meta p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.progress-tracker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.score-pills {
  display: flex;
  gap: 0.4rem;
}

.pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  background: #f8fafc;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill.completed {
  background: var(--success);
  border-color: var(--success);
  color: white;
  transform: scale(1.08);
}

/* Scenario Brief Box */
.scenario-box {
  background: #f8fafc;
  border-left: 5px solid var(--primary);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.scenario-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.25rem;
}

.scenario-box h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.scenario-box p {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Level 1: Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.option-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.option-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.option-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.option-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: #1e293b;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  z-index: 10;
}

.diagram-svg-container {
  width: 100%;
  aspect-ratio: 620 / 340;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.diagram-svg-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

.option-footer {
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
}

.btn-select-option {
  width: 100%;
  padding: 0.6rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background 0.2s;
}

.option-card:hover .btn-select-option {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Level 2: Drag & Drop Area */
.drag-drop-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .drag-drop-container {
    grid-template-columns: 1fr;
  }
}

.actors-bank {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.actors-bank h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.actors-bank p.bank-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.actors-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 160px;
}

.actor-chip {
  background: white;
  border: 1.5px solid #94a3b8;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: grab;
  user-select: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  touch-action: none;
}

.actor-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.actor-chip.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.actor-chip .actor-icon {
  font-size: 1.3rem;
}

.actor-chip .actor-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1e293b;
}

.actor-chip .actor-type-hint {
  font-size: 0.72rem;
  color: #64748b;
  display: block;
}

/* Diagram Board with Drop Slots */
.diagram-canvas-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.uml-board-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 380px;
  background: #f8fafc;
  padding: 1.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.actor-zone-outer {
  width: 155px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.actor-zone-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #e2e8f0;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.connector-line-wrapper {
  flex: 0 0 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.connector-line {
  width: 100%;
  height: 2px;
  background: #64748b;
  position: relative;
}

.uml-system-boundary-box {
  flex: 1;
  border: 2.5px solid #1e293b;
  border-radius: 8px;
  background: #ffffff;
  padding: 1rem;
  position: relative;
  min-height: 340px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.boundary-header {
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-boundary-tag {
  font-size: 0.7rem;
  font-weight: 800;
  color: #2563eb;
  text-transform: uppercase;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

.boundary-system-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1e293b;
}

@media (max-width: 768px) {
  .uml-board-container {
    flex-direction: column;
    gap: 1rem;
  }
  .connector-line-wrapper {
    transform: rotate(90deg);
    flex: 0 0 20px;
  }
  .actor-zone-outer {
    width: 100%;
    max-width: 220px;
  }
  .uml-system-boundary-box {
    width: 100%;
  }
}

.dropzone {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  min-height: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  text-align: center;
  transition: all 0.2s ease;
}

.dropzone.drag-over {
  background: #eff6ff;
  border-color: var(--primary);
  border-style: solid;
  transform: scale(1.02);
}

.dropzone.filled {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.dropzone-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.dropzone-hint {
  font-size: 0.7rem;
  color: #94a3b8;
}

.use-cases-center-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding: 2.5rem 1rem 1rem 1rem;
}

.use-case-bubble {
  background: #fefce8;
  border: 2px solid #ca8a04;
  border-radius: 50px;
  padding: 0.6rem 1.4rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
  color: #713f12;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  max-width: 240px;
  width: 100%;
}

.use-case-bubble.relation-include {
  background: #f0fdf4;
  border-color: #16a34a;
  color: #14532d;
  font-size: 0.8rem;
}

.use-case-bubble.relation-extend {
  background: #fdf2f8;
  border-color: #db2777;
  color: #831843;
  font-size: 0.8rem;
}

.actions-bar {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Level 3: Hard Builder */
.builder-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }
}

.builder-toolbox {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.toolbox-group h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toolbox-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.builder-item-choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.88rem;
  user-select: none;
}

.builder-item-choice:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.builder-item-choice.selected {
  background: #eff6ff;
  border-color: var(--primary);
  font-weight: 600;
  color: var(--primary);
}

.builder-canvas-area {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.builder-canvas-preview {
  min-height: 420px;
  background: #fafbfc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: auto;
}

/* Modal Feedback */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.feedback-modal {
  background: white;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  animation: modalScale 0.25s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.feedback-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.feedback-icon.error {
  background: var(--error-light);
  color: var(--error);
}

.feedback-icon.success {
  background: var(--success-light);
  color: var(--success);
}

.feedback-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e293b;
}

.feedback-body {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.6;
}

.feedback-body .highlight-explanation {
  background: #f8fafc;
  border-left: 4px solid var(--warning);
  padding: 0.85rem 1.1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0;
}

.feedback-body .solution-diagram-preview {
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
  padding: 0.75rem;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Certificate Screen */
.certificate-screen {
  max-width: 850px;
  margin: 0 auto;
}

.certificate-card {
  background: white;
  border: 8px double #1e3a8a;
  border-radius: var(--radius-md);
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  margin-bottom: 2rem;
  background-color: #fffdfa;
}

.certificate-seal {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 50%;
  margin: 0 auto 1.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.4);
}

.cert-title-small {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 700;
}

.cert-title-main {
  font-size: 2.2rem;
  font-weight: 900;
  color: #1e3a8a;
  margin: 0.5rem 0 1.25rem 0;
  font-family: Georgia, serif;
}

.cert-granted-to {
  font-size: 1rem;
  color: #475569;
  margin-bottom: 0.5rem;
}

.cert-student-name {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  border-bottom: 2px solid #cbd5e1;
  display: inline-block;
  padding: 0.2rem 2rem;
  margin-bottom: 1.5rem;
}

.cert-description {
  max-width: 650px;
  margin: 0 auto 2rem auto;
  color: #334155;
  line-height: 1.6;
  font-size: 1.05rem;
}

.cert-badges-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.cert-badge-item {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cert-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed #cbd5e1;
}

.cert-date, .cert-signature {
  font-size: 0.85rem;
  color: #64748b;
}

.cert-signature-line {
  width: 180px;
  border-bottom: 1px solid #475569;
  margin-bottom: 0.35rem;
}

.cert-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Printing styles */
@media print {
  header.app-header, .cert-actions, .app-footer, button, .theory-toggle-btn {
    display: none !important;
  }
  body {
    background: white;
    padding: 0;
  }
  .certificate-card {
    border: 6px double #1e3a8a;
    box-shadow: none;
    margin: 0;
    padding: 2rem;
    page-break-inside: avoid;
  }
}

/* SVG UML diagram styling */
.uml-actor-icon {
  stroke: #1e293b;
  stroke-width: 2.2;
  fill: #f1f5f9;
}

.uml-system-boundary {
  fill: #ffffff;
  stroke: #334155;
  stroke-width: 2;
  rx: 8;
}

.uml-system-title {
  font-family: 'Segoe UI', sans-serif;
  font-weight: bold;
  font-size: 13px;
  fill: #1e293b;
}

.uml-usecase-ellipse {
  fill: #fefce8;
  stroke: #b45309;
  stroke-width: 1.8;
}

.uml-usecase-text {
  font-family: 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 600;
  fill: #451a03;
  text-anchor: middle;
  dominant-baseline: central;
}

.uml-assoc-line {
  stroke: #334155;
  stroke-width: 1.6;
}

.uml-dependency-line {
  stroke: #2563eb;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.uml-stereotype-text {
  font-family: 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: bold;
  fill: #1d4ed8;
  text-anchor: middle;
}

.uml-error-highlight {
  stroke: #ef4444 !important;
  stroke-width: 3 !important;
  stroke-dasharray: 5 3;
}

.uml-error-badge {
  fill: #ef4444;
  font-family: 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: bold;
}

/* Help / Theory modal */
.theory-toggle-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #475569;
}

.theory-toggle-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.theory-guide {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: none;
}

.theory-guide.visible {
  display: block;
}

.theory-guide h4 {
  color: #1e40af;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.theory-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.rule-pill {
  background: white;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid #dbeafe;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #1e3a8a;
}

.rule-pill strong {
  color: #1d4ed8;
  display: block;
  margin-bottom: 0.2rem;
}
