html { font-size: 14px; }

@media (min-width: 768px) {
  html { font-size: 16px; }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 .1rem white, 0 0 0 .25rem #258cfb;
}

body {
  background: #f7f9fc;
  color: #172033;
  margin: 0;
}

.hero-section {
  background: linear-gradient(135deg, #0f5ea8 0%, #0a876f 100%);
  color: #fff;
  padding: 5rem 0;
}

.hero-panel,
.feature-box,
.app-panel {
  background: #fff;
  border: 1px solid rgba(16, 34, 64, .08);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(21, 35, 60, .08);
  padding: 1.5rem;
}

.hero-panel { color: #172033; }

.feature-box { height: 100%; }

.video-placeholder,
.video-tile {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: #142033;
  border-radius: 8px;
  color: #d8e4f2;
  display: flex;
  justify-content: center;
  min-height: 160px;
}

.simulation-media-dock {
  align-items: center;
  background: rgba(247, 249, 252, .96);
  border: 1px solid rgba(16, 34, 64, .08);
  border-radius: 8px;
  display: flex;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: .75rem;
  position: sticky;
  top: 65px;
  z-index: 20;
}

.video-tile-compact {
  aspect-ratio: 16 / 9;
  flex: 0 0 160px;
  min-height: 90px;
}

.video-tile video {
  border-radius: 8px;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.attachment-frame {
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  height: 520px;
  width: 100%;
}

.attachment-image {
  border: 1px solid #d9e2ef;
  border-radius: 8px;
}

.chat-log {
  background: #f2f6fb;
  border-radius: 8px;
  height: 280px;
  overflow-y: auto;
  padding: 1rem;
}

.chat-message {
  background: #fff;
  border-radius: 8px;
  margin-bottom: .75rem;
  padding: .75rem;
}

.score-summary {
  display: flex;
  gap: .5rem;
  position: sticky;
  top: 174px;
  z-index: 18;
}

.deliverable-released {
  border-color: #198754 !important;
  background: #f0fbf5;
}

.deliverable-alert {
  left: 50%;
  max-width: min(520px, calc(100vw - 2rem));
  position: fixed;
  top: 80px;
  transform: translateX(-50%);
  z-index: 1060;
}

.deliverable-highlight {
  animation: deliverablePulse 2s ease-in-out 2;
  border-color: #0dcaf0 !important;
}

@keyframes deliverablePulse {
  0%, 100% { background: #fff; }
  50% { background: #e8f8ff; }
}

.online-users-list {
  max-height: 520px;
  overflow-y: auto;
}

.private-chat-dock {
  align-items: flex-end;
  bottom: 0;
  display: flex;
  gap: .75rem;
  max-width: 100vw;
  overflow-x: auto;
  padding: .75rem;
  position: fixed;
  right: 0;
  z-index: 1050;
}

.private-chat-box {
  background: #fff;
  border: 1px solid rgba(16, 34, 64, .16);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 16px 40px rgba(21, 35, 60, .18);
  flex: 0 0 300px;
  max-width: calc(100vw - 1.5rem);
  overflow: hidden;
}

.private-chat-box.has-unread {
  border-color: #0d6efd;
}

.private-chat-header {
  align-items: center;
  background: #0f5ea8;
  border: 0;
  color: #fff;
  display: flex;
  font-weight: 600;
  justify-content: space-between;
  padding: .65rem .8rem;
  text-align: left;
  width: 100%;
}

.private-chat-badge {
  background: #dc3545;
  border-radius: 999px;
  color: #fff;
  font-size: .75rem;
  min-width: 1.35rem;
  padding: .1rem .35rem;
  text-align: center;
}

.private-chat-body {
  padding: .75rem;
}

.private-chat-box.is-minimized .private-chat-body {
  display: none;
}

.private-chat-log {
  background: #f2f6fb;
  border-radius: 8px;
  height: 220px;
  overflow-y: auto;
  padding: .75rem;
}

.simulation-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
}

.legacy-content {
  color: #263247;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.legacy-content p,
.legacy-content .MsoNormal {
  margin: 0 0 .85rem;
}

.legacy-content p:last-child,
.legacy-content .MsoNormal:last-child {
  margin-bottom: 0;
}

.legacy-content span {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.legacy-content strong,
.legacy-content b {
  color: #172033;
}

.legacy-content ul,
.legacy-content ol {
  padding-left: 1.25rem;
}

.legacy-content-preview {
  display: -webkit-box;
  margin-bottom: .75rem;
  max-height: 5rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

@media (max-width: 992px) {
  .simulation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
  .simulation-media-dock {
    align-items: stretch;
    gap: .5rem;
    overflow-x: auto;
    top: 56px;
  }

  .video-tile-compact {
    flex-basis: 118px;
    min-height: 66px;
  }

  .simulation-media-dock .btn {
    white-space: nowrap;
  }

  .score-summary {
    top: 150px;
  }

  .private-chat-dock {
    left: 0;
    right: 0;
  }

  .private-chat-box {
    flex-basis: min(92vw, 340px);
  }

  .private-chat-log {
    height: 180px;
  }
}
