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

:root {
  --bg: #0f1117;
  --surface: #181b24;
  --surface-hover: #1e2130;
  --border: #252a38;
  --border-light: #2d3348;
  --text: #e0e4ec;
  /* Contrast tiers vs --bg #0f1117 — both pass WCAG AA normal text (4.5:1).
     Previous --text-muted #555d70 was ~2.7:1 and failed. */
  --text-dim: #9098ad;   /* ~5.9:1 */
  --text-muted: #7a8194; /* ~4.5:1 */
  --green: #5bd65b;
  --green-dim: rgba(91, 214, 91, 0.12);
  --blue: #60a5fa;
  --blue-dim: rgba(96, 165, 250, 0.1);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.1);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
  --max-width: 720px;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 2rem;
}

/* ---- Top bar ---- */

.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

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

.dash-logo-icon {
  color: var(--green);
  flex-shrink: 0;
}

.dash-company {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.dash-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.dash-date {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.dash-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  /* Solid dark surface so the chip retains its background even under
     dark-mode inverters or contexts that force light backgrounds. */
  background: var(--surface);
  border: 1px solid var(--border-light);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.dash-status:hover {
  border-color: var(--text-dim);
  background: var(--surface-hover);
}

.dash-status:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.dash-status-seg {
  white-space: nowrap;
}

/* Only the first segment ("All systems running") gets the green emphasis;
   downstream segments read as contextual data in the dim tone. */
.dash-status-seg:first-of-type {
  color: var(--green);
  font-weight: 500;
}

.dash-status-sep {
  color: var(--text-muted);
}

.dash-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(91, 214, 91, 0.5);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

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

/* ---- Hero / greeting ---- */

.dash-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
}

.dash-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.dash-while-slept {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.dash-summary {
  display: flex;
  gap: 2rem;
}

.dash-stat {
  display: flex;
  flex-direction: column;
}

.dash-stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}

.dash-stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ---- Panels ---- */

.dash-panel {
  max-width: var(--max-width);
  margin: 0 auto 1.25rem;
  padding: 0 1.5rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.panel-header h2 svg {
  color: var(--text-dim);
}

.panel-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: var(--green-dim);
  color: var(--green);
  font-weight: 500;
}

.panel-badge.badge-urgent {
  background: var(--amber-dim);
  color: var(--amber);
}

/* ---- Messages list ---- */

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  /* Button reset — msg-row is a <button> so keyboard users can Tab to it */
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  width: 100%;
}

.msg-row:hover {
  background: var(--surface-hover);
}

.msg-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.msg-row::after {
  content: '\203A';
  color: var(--text-muted);
  font-size: 1.2rem;
  padding-left: 0.5rem;
  flex-shrink: 0;
}

.msg-row:active {
  background: var(--border);
}

.msg-channel {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  border-radius: 50%;
  color: var(--text-dim);
}

.msg-channel svg {
  width: 16px;
  height: 16px;
}

.msg-content {
  flex: 1;
  min-width: 0;
}

.msg-from {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-subtext {
  font-weight: 400;
  color: var(--amber);
  font-size: 0.78rem;
}

.msg-preview {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.msg-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.msg-status {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
}

.msg-status.msg-sent {
  color: var(--green);
}

.msg-status.msg-flagged {
  color: var(--amber);
}

.msg-status.msg-urgent {
  color: var(--red);
}

.msg-row.msg-urgent {
  border-left: 3px solid var(--red);
  background: var(--red-dim);
}

.msg-row.msg-flagged {
  border-left: 3px solid var(--amber);
  background: var(--amber-dim);
}

/* ---- Message detail overlay ---- */

.msg-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.msg-detail-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.msg-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
}

.msg-detail-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.msg-detail-close:hover {
  color: var(--text);
}

.msg-detail-header {
  margin-bottom: 1.25rem;
}

.msg-detail-from {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.msg-detail-from svg {
  color: var(--text-dim);
}

.msg-detail-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  padding-left: 1.6rem;
}

.msg-detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.msg-detail-original {
  margin-bottom: 1.25rem;
}

.msg-detail-text {
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  line-height: 1.6;
}

.msg-detail-textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  line-height: 1.6;
  resize: vertical;
}

.msg-detail-textarea:focus {
  outline: none;
  border-color: var(--blue);
}

/* Channel picker for flagged messages */
.msg-detail-channels {
  margin-bottom: 0.75rem;
}

.channel-picker {
  display: flex;
  gap: 0.4rem;
}

.channel-btn {
  padding: 0.4rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font);
  font-size: 0.8rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.channel-btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.channel-btn.channel-active {
  background: var(--blue-dim);
  border-color: rgba(96, 165, 250, 0.35);
  color: var(--blue);
}

.msg-detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-approve {
  padding: 0.55rem 1.25rem;
  background: var(--green);
  color: #111;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-approve:hover {
  filter: brightness(1.1);
}

.btn-approve.approved {
  background: var(--green);
}

.btn-edit {
  padding: 0.55rem 1.25rem;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

/* ---- Lead card ---- */

.lead-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

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

.lead-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-dim);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.lead-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.lead-source {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lead-message {
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-style: italic;
  line-height: 1.6;
}

/* Timeline */

.lead-timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline-step {
  position: relative;
  padding-bottom: 1.25rem;
  padding-left: 1rem;
}

.timeline-step:last-child {
  padding-bottom: 0;
}

.timeline-step::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.6rem;
  bottom: -0.6rem;
  width: 1px;
  background: var(--border);
}

.timeline-step:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
}

.timeline-step.done .timeline-dot {
  background: var(--green);
  box-shadow: 0 0 6px rgba(91, 214, 91, 0.4);
}

.timeline-step.waiting .timeline-dot {
  background: var(--amber);
  animation: pulse 1.5s ease-in-out infinite;
}

.timeline-content strong {
  font-size: 0.82rem;
  display: block;
}

.timeline-content span {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Slot buttons */

.lead-slots {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.slot-btn {
  padding: 0.5rem 1rem;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.slot-btn:hover {
  background: var(--blue);
  color: #111;
  border-color: var(--blue);
}

/* Confirmed state */

.lead-confirmed {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--green-dim);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

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

/* Panel highlight when scrolled to from message click */
.panel-highlight {
  animation: panelPulse 1.5s ease;
}

@keyframes panelPulse {
  0% { background: transparent; }
  20% { background: rgba(96, 165, 250, 0.08); border-radius: 10px; }
  100% { background: transparent; }
}

/* Hint for clickable urgent/flagged rows */
.msg-row.msg-urgent .msg-preview::after,
.msg-row.msg-flagged .msg-preview::after {
  content: ' \2014 tap for details';
  color: var(--text-muted);
  font-size: 0.72rem;
  font-style: italic;
}

/* ---- Knowledge base ---- */

.kb-search-wrap {
  margin-bottom: 0.75rem;
}

.kb-search {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text);
  transition: border-color 0.2s;
}

.kb-search:focus {
  outline: none;
  border-color: var(--blue);
}

.kb-search::placeholder {
  color: var(--text-muted);
}

.kb-suggestions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.kb-suggestion {
  padding: 0.3rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font);
  font-size: 0.75rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.kb-suggestion:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.kb-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.kb-result-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.kb-result-header svg {
  color: var(--text-muted);
}

#kb-result-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
}

/* ---- Automation log ---- */

.auto-log {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auto-entry {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  animation: slideIn 0.3s ease both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.auto-time {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 55px;
  font-variant-numeric: tabular-nums;
}

.auto-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.auto-text {
  color: var(--text-dim);
}

/* ---- Uptime / behind-the-scenes panel ---- */

#panel-uptime .panel-header {
  border-bottom-color: var(--border-light);
}

.uptime-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.uptime-toggle:hover {
  color: var(--text);
  border-color: var(--text-dim);
  background: var(--surface);
}

.uptime-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.uptime-toggle-chevron {
  transition: transform 0.2s ease;
}

.uptime-toggle[aria-expanded="true"] .uptime-toggle-chevron {
  transform: rotate(180deg);
}

.uptime-framing {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.uptime-framing::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 4px rgba(91, 214, 91, 0.5);
  flex-shrink: 0;
}

.uptime-content[hidden] {
  display: none;
}

.uptime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.uptime-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}

.uptime-item-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.uptime-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 4px rgba(91, 214, 91, 0.5);
  flex-shrink: 0;
}

.uptime-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.uptime-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.uptime-value-big {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  line-height: 1.05;
  text-shadow: 0 0 24px rgba(91, 214, 91, 0.25);
}

.uptime-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.uptime-item-summary {
  grid-column: 1 / -1;
  background:
    radial-gradient(circle at 85% 0%, rgba(91, 214, 91, 0.15), transparent 55%),
    var(--surface);
  border-color: rgba(91, 214, 91, 0.3);
  padding: 1.25rem 1.3rem;
}

.uptime-item-summary .uptime-item-head {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.4rem;
}

/* ---- CTA section ---- */

.dash-cta {
  max-width: var(--max-width);
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
}

.dash-cta-inner {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dash-cta p {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.dash-cta em {
  color: var(--text);
  font-style: italic;
}

.btn-cta {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--green);
  color: #111;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius);
  transition: filter 0.2s;
}

.btn-cta:hover {
  filter: brightness(1.1);
}

.btn-back {
  display: block;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.btn-back:hover {
  color: var(--text);
}

/* ---- Toast notifications ---- */

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--green);
  color: #111;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  white-space: nowrap;
  max-width: 90vw;
}

.toast svg {
  flex-shrink: 0;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- KB searching state ---- */

.kb-searching {
  border-left-color: var(--blue);
}

.kb-searching #kb-result-text {
  color: var(--text-muted);
  animation: pulse 1s ease-in-out infinite;
}

/* ---- Accessibility: reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .dash-status-dot {
    animation: none;
    opacity: 1;
  }
  .uptime-toggle-chevron {
    transition: none;
  }
}

/* Body scroll lock while modal dialog is open */
html.scroll-lock {
  overflow: hidden;
}

/* Screen-reader-only utility (WebAIM pattern) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Mobile ---- */

@media (max-width: 600px) {
  .dash-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem;
  }

  .dash-meta {
    align-items: flex-start;
  }

  .dash-hero {
    padding: 1.75rem 1rem 1.5rem;
  }

  .dash-hero h1 {
    font-size: 1.4rem;
  }

  .dash-summary {
    gap: 1.25rem;
  }

  .dash-stat-num {
    font-size: 1.5rem;
  }

  .dash-panel {
    padding: 0 1rem;
    margin-bottom: 1rem;
  }

  .msg-row {
    padding: 0.6rem 0.65rem;
    gap: 0.5rem;
  }

  .msg-channel {
    width: 28px;
    height: 28px;
  }

  .msg-from {
    font-size: 0.8rem;
  }

  .msg-preview {
    font-size: 0.75rem;
  }

  .msg-meta {
    display: none;
  }

  .msg-row.msg-urgent .msg-from::after {
    content: ' \2022 Urgent';
    color: var(--red);
    font-weight: 500;
    font-size: 0.72rem;
  }

  .msg-row.msg-flagged .msg-from::after {
    content: ' \2022 Needs you';
    color: var(--amber);
    font-weight: 500;
    font-size: 0.72rem;
  }

  .msg-row.msg-sent .msg-from::after {
    content: ' \2713';
    color: var(--green);
  }

  .msg-detail {
    width: 95%;
    padding: 1.25rem;
  }

  .lead-slots {
    flex-direction: column;
  }

  .slot-btn {
    text-align: center;
  }

  .kb-suggestions {
    gap: 0.3rem;
  }

  .kb-suggestion {
    font-size: 0.7rem;
  }

  .auto-entry {
    font-size: 0.75rem;
    gap: 0.4rem;
  }

  .auto-time {
    min-width: 48px;
    font-size: 0.68rem;
  }

  .uptime-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .uptime-framing {
    font-size: 0.8rem;
  }

  .uptime-value-big {
    font-size: 1.5rem;
  }

  .dash-cta {
    padding: 0 1rem;
  }

  .dash-cta-inner {
    padding: 2rem 1rem;
  }
}
