/* Light mode only — projector-friendly */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #1a1d26;
  --muted: #5c6370;
  --border: #d8dce6;
  --blue: #1e5a96;
  --green: #2d7a3e;
  --yellow: #b8860b;
  --red: #c42b2b;
  --red-soft: rgba(196, 43, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
}

a {
  color: var(--blue);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
}

h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Alert banner */
.alert-banner {
  display: none;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.alert-banner.visible {
  display: block;
}
.alert-banner.warn {
  background: #fff8e6;
  border-color: #e8c96a;
  color: #5c4a00;
}
.alert-banner.danger {
  background: #fdecec;
  border-color: #e89a9a;
  color: #6b1a1a;
}
.alert-banner.info {
  background: #e8f2fb;
  border-color: #9ec5eb;
  color: #0f3d66;
}
.alert-banner.ok {
  background: #e8f5eb;
  border-color: #8ecf9e;
  color: #1a4d26;
}

/* State badge */
.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--surface);
}
.state-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.state-badge.suspicious .dot {
  background: var(--yellow);
}
.state-badge.under_attack .dot,
.state-badge.quarantined .dot {
  background: var(--red);
}
.state-badge.detected .dot {
  background: var(--blue);
}
.state-badge.recovering .dot {
  background: var(--yellow);
}
.state-badge.recovered .dot {
  background: var(--green);
}

/* Red flash overlay */
.flash-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: rgba(196, 43, 43, 0.35);
  opacity: 0;
  transition: opacity 0.12s ease-out;
  z-index: 9999;
}
.flash-overlay.on {
  opacity: 1;
}

/* Diagram */
.diagram-wrap {
  width: 100%;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
}
.diagram-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 280px;
  max-height: 520px;
}
.diagram-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

/* Chat stub */
.chat-area {
  min-height: 140px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.chat-area strong {
  color: var(--text);
}

/* Instructor buttons */
.btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.45rem 0.75rem;
  background: var(--surface);
  color: var(--text);
}
button:hover {
  background: #f0f2f7;
}
button.primary {
  background: var(--blue);
  color: #fff;
  border-color: #174a78;
}
button.primary:hover {
  background: #174a78;
}
button.danger {
  background: var(--red);
  color: #fff;
  border-color: #9e2222;
}
button.danger:hover {
  background: #9e2222;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.detection-panel {
  font-size: 0.9rem;
}
.detection-panel ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}
.detection-panel .verdict-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
}
.tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}
.tag.high {
  background: var(--red-soft);
  color: var(--red);
}
.tag.medium {
  background: #fff8e6;
  color: #8a6d00;
}
.tag.low {
  background: #eef5ee;
  color: var(--green);
}

.conn-status {
  font-size: 0.85rem;
  color: var(--muted);
}
.conn-status.connected {
  color: var(--green);
}
.conn-status.error {
  color: var(--red);
}
