/* ── The Omniscient Tutor v3 — Design System ───────────────────────────── */

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  margin: 0;
}

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:         #0f1419;
  --surface:    #1a1f2e;
  --surface-2:  #242b3d;
  --surface-3:  #2d3548;
  --border:     rgba(255, 255, 255, 0.08);
  --border-focus: rgba(32, 128, 141, 0.5);

  /* Text */
  --text:       #e8eaed;
  --text-muted: #9aa0b0;
  --text-faint: #5f6578;

  /* Accent */
  --accent:     #20808D;
  --accent-dim: rgba(32, 128, 141, 0.15);
  --accent-hover: #279aa8;

  /* Semantic: Traffic Lights */
  --green:      #22c55e;
  --green-bg:   rgba(34, 197, 94, 0.10);
  --green-border: rgba(34, 197, 94, 0.25);
  --yellow:     #f59e0b;
  --yellow-bg:  rgba(245, 158, 11, 0.10);
  --yellow-border: rgba(245, 158, 11, 0.25);
  --red:        #ef4444;
  --red-bg:     rgba(239, 68, 68, 0.10);
  --red-border: rgba(239, 68, 68, 0.30);

  /* Typography */
  --font-ui:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Type scale */
  --text-xs:  0.6875rem;   /* 11px */
  --text-sm:  0.75rem;     /* 12px */
  --text-base: 0.8125rem;  /* 13px */
  --text-md:  0.875rem;    /* 14px */
  --text-lg:  1rem;        /* 16px */
  --text-xl:  1.25rem;     /* 20px */

  /* Spacing (4px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h: auto;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* ── Global ────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  background: var(--accent);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: top var(--duration-fast) var(--ease-out);
}
.skip-link:focus {
  top: var(--sp-4);
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Tabular numbers */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

/* ── Dashboard Grid ────────────────────────────────────────────────────── */
.dashboard {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  height: 100dvh;
  width: 100%;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  grid-row: 1 / -1;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.logo svg {
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-title {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.logo-subtitle {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
}

.sidebar-section {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-3) 0;
}

.sidebar-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 0 var(--sp-4) var(--sp-2);
}

.stream-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stream-item {
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all var(--duration-fast) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.stream-item:hover {
  background: var(--surface-2);
}

.stream-item.active {
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.stream-item-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-item-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.stream-item-meta .badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

/* ── Content Area ──────────────────────────────────────────────────────── */
.content-area {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-width: 0;
}

/* ── Top Bar ───────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-3) var(--sp-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.topbar-left {
  flex-shrink: 0;
  min-width: 0;
  max-width: 220px;
}

.stream-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-meta {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.topbar-center {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sentiment-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.sentiment-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  display: flex;
  overflow: hidden;
}

.sentiment-segment {
  height: 100%;
  transition: width var(--duration-slow) var(--ease-out);
}

.sentiment-segment.green { background: var(--green); }
.sentiment-segment.yellow { background: var(--yellow); }
.sentiment-segment.red { background: var(--red); }

.sentiment-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
}

.green-text { color: var(--green); }
.yellow-text { color: var(--yellow); }
.red-text { color: var(--red); }

/* ── Sparkline ─────────────────────────────────────────────────────────── */
.sparkline-container {
  height: 28px;
  width: 100%;
  margin-top: 1px;
}

.sparkline-container[hidden] {
  display: none !important;
}

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-shrink: 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 56px;
}

.stat-value {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.refresh-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background var(--duration-fast);
}

.refresh-dot.active {
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Main Panel ────────────────────────────────────────────────────────── */
.main-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  flex: 1;
  color: var(--text-faint);
  font-size: var(--text-md);
  padding: var(--sp-12);
  text-align: center;
}

.empty-state[hidden] {
  display: none !important;
}

.empty-hint {
  font-size: var(--text-sm);
  color: var(--text-faint);
  opacity: 0.6;
}

/* ── Active Content (visible when stream selected) ─────────────────────── */
.active-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.active-content[hidden] {
  display: none !important;
}

/* ── AI Summary Panel ──────────────────────────────────────────────────── */
.summary-panel {
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.summary-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.summary-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
}

.summary-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.summary-updated {
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-left: auto;
}

.summary-text {
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.5;
  transition: color var(--duration-normal);
}

.summary-text.has-data {
  color: var(--text);
}

.summary-issues {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.summary-issues[hidden] {
  display: none !important;
}

.issue-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid var(--yellow-border);
}

.issue-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}

/* ── Toolbar (Filter Bar + Participation) ──────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-5);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Filter Bar ────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn[data-filter="critical"].active {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}

.filter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-dot.green { background: var(--green); }
.filter-dot.yellow { background: var(--yellow); }
.filter-dot.red { background: var(--red); }

.filter-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ── Participation Tracker ─────────────────────────────────────────────── */
.participation-tracker {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
  flex-shrink: 0;
}

.participation-bar {
  width: 64px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}

.participation-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width var(--duration-slow) var(--ease-out);
}

.participation-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.participation-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.participation-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.participation-toggle[aria-expanded="true"] {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.participation-toggle[aria-expanded="true"] svg {
  transform: rotate(45deg);
}

/* ── Silent Students Dropdown ──────────────────────────────────────────── */
.silent-dropdown {
  padding: var(--sp-2) var(--sp-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  max-height: 120px;
  overflow-y: auto;
  flex-shrink: 0;
}

.silent-dropdown[hidden] {
  display: none !important;
}

.silent-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.silent-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.silent-count {
  font-size: var(--text-xs);
  color: var(--yellow);
}

.silent-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.silent-student {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: 1px 8px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.silent-student::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

/* ── Live Feed Container ──────────────────────────────────────────────── */
.feed-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.feed-container[hidden] {
  display: none !important;
}

.message-feed {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Message Items ─────────────────────────────────────────────────────── */

/* Base message row */
.msg-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  transition: opacity var(--duration-fast), background var(--duration-fast);
  animation: msg-enter var(--duration-normal) var(--ease-out);
}

.msg-row.filtered-out {
  display: none !important;
}

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

/* Sentiment dot */
.msg-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 6px;
}

.msg-dot.green { background: var(--green); }
.msg-dot.yellow { background: var(--yellow); }
.msg-dot.red { background: var(--red); }

/* Message content */
.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-sender {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  margin-right: var(--sp-2);
}

.msg-text {
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.msg-time {
  flex-shrink: 0;
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.msg-row:hover .msg-time {
  opacity: 1;
}

/* ── Display Levels ────────────────────────────────────────────────────── */

/* CRITICAL — red alert card, prominent */
.msg-row.level-critical {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-2) 0;
}

.msg-row.level-critical .msg-text {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text);
}

.msg-row.level-critical .msg-dot {
  width: 9px;
  height: 9px;
  box-shadow: 0 0 8px var(--red);
}

.msg-row.level-critical .msg-time {
  opacity: 1;
}

/* Badge for critical/important */
.msg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}

.msg-badge.critical {
  background: var(--red-bg);
  color: var(--red);
}

.msg-badge.important {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.msg-badge.notable {
  background: var(--green-bg);
  color: var(--green);
}

/* IMPORTANT — orange/yellow accent */
.msg-row.level-important {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-1) 0;
}

.msg-row.level-important .msg-text {
  font-size: var(--text-md);
  color: var(--text);
}

.msg-row.level-important .msg-time {
  opacity: 1;
}

/* NOTABLE — subtle green highlight */
.msg-row.level-notable {
  background: var(--green-bg);
  border-left: 2px solid var(--green-border);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  margin: 1px 0;
}

/* DIM — social chat, reduced prominence */
.msg-row.level-dim {
  opacity: 0.55;
}

.msg-row.level-dim .msg-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* NOISE — collapsed, very faint */
.msg-row.level-noise {
  opacity: 0.3;
  padding: 1px var(--sp-3);
}

.msg-row.level-noise .msg-text {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.msg-row.level-noise .msg-dot {
  width: 5px;
  height: 5px;
}

/* ── Category indicator (inline) ───────────────────────────────────────── */
.msg-category {
  font-size: var(--text-xs);
  color: var(--text-faint);
  margin-left: var(--sp-2);
  font-style: italic;
}

/* ── Scroll to Latest Button ───────────────────────────────────────────── */
.scroll-to-latest {
  position: absolute;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all var(--duration-fast) var(--ease-out);
  z-index: 10;
}

.scroll-to-latest:hover {
  background: var(--accent-hover);
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.scroll-to-latest[hidden] {
  display: none !important;
}

/* ── Loading / Skeleton ────────────────────────────────────────────────── */
.loading-placeholder {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.skeleton-line {
  height: 12px;
  background: var(--surface-2);
  border-radius: 2px;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-line.short {
  width: 60%;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.2; }
}

/* ── Feed loading skeleton ─────────────────────────────────────────────── */
.feed-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
}

.feed-skeleton-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
}

.feed-skeleton-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface-3);
  animation: shimmer 1.5s ease-in-out infinite;
}

.feed-skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.feed-skeleton-lines .skeleton-line {
  height: 10px;
}

.feed-skeleton-lines .skeleton-line:last-child {
  width: 40%;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: var(--sp-1) var(--sp-4);
  font-size: var(--text-xs);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  z-index: 50;
  background: var(--bg);
  opacity: 0.7;
}

.footer a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.footer a:hover {
  color: var(--accent);
}

.footer-sep {
  opacity: 0.4;
}

/* ── Reduced Motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 100%;
  }

  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    grid-row: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 180px;
  }

  .content-area {
    grid-template-rows: auto 1fr;
  }

  .topbar {
    flex-wrap: wrap;
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-3);
  }

  .topbar-left {
    max-width: 100%;
    width: 100%;
  }

  .topbar-center {
    order: 3;
    width: 100%;
  }

  .topbar-right {
    gap: var(--sp-3);
  }

  .toolbar {
    flex-wrap: wrap;
    padding: var(--sp-2) var(--sp-3);
    gap: var(--sp-2);
  }

  .participation-tracker {
    margin-left: 0;
  }

  .message-feed {
    padding: var(--sp-2) var(--sp-3);
  }
}
