/* =========================================================
   Hermod — Asgard Dashboard
   Dark Norse aesthetic, mobile-first
   ========================================================= */

/* ---------------------------------------------------------
   Reset & base
   --------------------------------------------------------- */

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

:root {
  --bg-base:      #0d0d12;
  --bg-surface:   #14141c;
  --bg-raised:    #1c1c28;
  --bg-border:    #2a2a38;
  --text-primary: #e8e6f0;
  --text-muted:   #8884a0;
  --text-dim:     #5a5870;
  --accent-def:   #8B6FBE;

  --status-active:  #2ec27e;
  --status-idle:    #e5a50a;
  --status-offline: #5a5870;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", Consolas, monospace;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

/* ---------------------------------------------------------
   Typography
   --------------------------------------------------------- */

.rune {
  font-size: 1.4em;
  opacity: 0.85;
  vertical-align: middle;
}

/* ---------------------------------------------------------
   Nav
   --------------------------------------------------------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 52px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--bg-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--text-primary);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-agent {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  white-space: nowrap;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.nav-agent:hover,
.nav-agent:active {
  color: var(--text-primary);
  background: var(--bg-raised);
}

.nav-logout {
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   Main
   --------------------------------------------------------- */

.main-content {
  padding: 20px 16px 80px;
  max-width: 900px;
  margin: 0 auto;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent-def);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:active { transform: scale(0.97); }
.btn-primary:hover  { filter: brightness(1.15); }

.btn-full { width: 100%; }

.btn-ghost {
  background: none;
  border: 1px solid var(--bg-border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

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

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent, var(--accent-def));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-accent:hover  { filter: brightness(1.2); }
.btn-accent:active { filter: brightness(0.9); }

.btn-sm { padding: 7px 12px; font-size: 0.82rem; }

/* ---------------------------------------------------------
   Forms / Inputs
   --------------------------------------------------------- */

.input-field {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  padding: 10px 12px;
  font-family: var(--font-body);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.input-field::placeholder { color: var(--text-dim); }
.input-field:focus {
  outline: none;
  border-color: var(--agent-accent, var(--accent-def));
}

.input-sm { font-size: 0.875rem; padding: 8px 10px; }

.textarea-field { resize: vertical; min-height: 96px; }

/* ---------------------------------------------------------
   Alerts
   --------------------------------------------------------- */

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.alert-error {
  background: #2a1418;
  border: 1px solid #6b2a34;
  color: #f28b8b;
}

/* ---------------------------------------------------------
   Login
   --------------------------------------------------------- */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.login-wrap {
  width: 100%;
  max-width: 360px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
}

.login-rune {
  font-size: 3.5rem;
  margin-bottom: 8px;
  display: block;
  opacity: 0.9;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.login-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------------------------------------------------------
   Home
   --------------------------------------------------------- */

.home-header {
  text-align: center;
  padding: 24px 0 28px;
}

.home-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.home-sub {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------
   Agent grid
   --------------------------------------------------------- */

.agent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 560px) {
  .agent-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 800px) {
  .agent-grid { grid-template-columns: repeat(3, 1fr); }
}

.agent-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  border-top: 3px solid var(--accent, var(--accent-def));
}

.agent-card:hover {
  border-color: var(--accent, var(--accent-def));
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.agent-card-link {
  display: block;
  padding: 16px 16px 12px;
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.agent-card-meta { flex: 1; min-width: 0; }

.agent-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent, var(--accent-def));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-role {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.agent-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------------------------------------------------
   Sigils
   --------------------------------------------------------- */

.sigil-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}

.sigil-lg {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.sigil-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.sigil-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent, var(--accent-def));
}

.sigil-initial {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent, var(--accent-def));
}

.sigil-placeholder-lg { border-width: 3px; }

.sigil-initial-lg {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent, var(--accent-def));
}

/* ---------------------------------------------------------
   Status indicators
   --------------------------------------------------------- */

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

.status-active  { background: var(--status-active); box-shadow: 0 0 6px var(--status-active); }
.status-idle    { background: var(--status-idle); }
.status-offline { background: var(--status-offline); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 6px;
}

.status-badge.status-active  { background: rgba(46,194,126,0.15); color: var(--status-active); }
.status-badge.status-idle    { background: rgba(229,165,10,0.15);  color: var(--status-idle); }
.status-badge.status-offline { background: rgba(90,88,112,0.15);   color: var(--status-offline); }

.status-dot-sm {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------------------------------------------------------
   Quick-send (home card)
   --------------------------------------------------------- */

.quick-send {
  padding: 0 12px 12px;
}

.quick-send-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.quick-send-row .input-field {
  flex: 1;
  min-width: 0;
}

.send-feedback {
  margin-top: 6px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
}

.send-feedback.hidden { display: none; }

.send-feedback.ok    { color: var(--status-active); background: rgba(46,194,126,0.1); }
.send-feedback.error { color: #f28b8b; background: rgba(242,139,139,0.1); }

/* ---------------------------------------------------------
   Agent page
   --------------------------------------------------------- */

.agent-page {
  max-width: 700px;
  margin: 0 auto;
  padding-top: 8px;
}

.agent-hero {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  border-top: 3px solid var(--agent-accent, var(--accent-def));
}

.agent-hero-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.agent-hero-meta { flex: 1; }

.agent-page-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.agent-page-role {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.last-active {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ---------------------------------------------------------
   Sections
   --------------------------------------------------------- */

.agent-section {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.agent-focus {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ---------------------------------------------------------
   Activity list
   --------------------------------------------------------- */

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--agent-accent, var(--accent-def));
}

.activity-ts {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.activity-desc {
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ---------------------------------------------------------
   Extra fields
   --------------------------------------------------------- */

.extra-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.extra-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.extra-key {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.extra-val {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.extra-pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-raised);
  padding: 10px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.extra-list {
  list-style: disc;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.extra-list li { margin-bottom: 3px; }

.extra-subcard {
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.extra-row {
  display: flex;
  gap: 8px;
  font-size: 0.88rem;
  margin-bottom: 3px;
}

.extra-sub-key {
  color: var(--text-dim);
  flex-shrink: 0;
}

.extra-sub-val {
  color: var(--text-primary);
  word-break: break-word;
}

/* ---------------------------------------------------------
   Send panel
   --------------------------------------------------------- */

.send-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-row {
  display: flex;
  align-items: center;
}

.file-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.file-input { display: none; }

.file-btn {
  padding: 7px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
}

.file-label:hover .file-btn {
  color: var(--text-primary);
  border-color: var(--agent-accent, var(--accent-def));
}

.file-name-display {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ---------------------------------------------------------
   Scrollbar (webkit)
   --------------------------------------------------------- */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ---------------------------------------------------------
   Chat thread
   --------------------------------------------------------- */

.chat-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chat-section-header .section-title {
  margin-bottom: 0;
}

.chat-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-active);
  box-shadow: 0 0 5px var(--status-active);
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.3s;
}

.chat-live-dot.active { opacity: 1; }

.btn-xs {
  padding: 3px 9px;
  font-size: 0.75rem;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-empty {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.88rem;
  text-align: center;
  padding: 24px 0;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 85%;
}

.chat-msg-user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg-agent {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-user .chat-bubble {
  background: var(--agent-accent, var(--accent-def));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-agent .chat-bubble {
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--bg-border);
  border-bottom-left-radius: 4px;
}

.chat-ts {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  padding: 0 2px;
}

/* ---------------------------------------------------------
   Offline / Wake
   --------------------------------------------------------- */

.offline-msg {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 0.6rem 0;
}

.btn-wake {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent, var(--accent-def));
  background: transparent;
  color: var(--accent, var(--accent-def));
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-wake:hover {
  background: var(--accent, var(--accent-def));
  color: #fff;
}

.btn-wake:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-shutdown {
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--text-dim);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.btn-shutdown:hover {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.btn-shutdown:disabled {
  opacity: 0.5;
  cursor: default;
}

.send-action-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ---------------------------------------------------------
   Utilities
   --------------------------------------------------------- */

.hidden { display: none !important; }

/* ---------------------------------------------------------
   Messenger layout (agent page)
   --------------------------------------------------------- */

body.messenger-page {
  overflow: hidden;
  overscroll-behavior: none;
}

/* Neutralize the base.html main-content wrapper */
body.messenger-page .main-content {
  padding: 0;
  max-width: none;
  margin: 0;
  overflow: hidden;
}

.messenger-layout {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* -- Header -- */

.messenger-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 56px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--bg-border);
}

.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: background 0.15s;
}

.hamburger-btn:hover span { background: var(--text-primary); }

.messenger-header-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sigil-wrap.sigil-sm {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.messenger-header-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.messenger-header-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.messenger-header-sub.status-active { color: var(--status-active); }
.messenger-header-sub.status-idle   { color: var(--status-idle); }

.messenger-header-spacer { width: 38px; flex-shrink: 0; }

/* -- Chat area -- */

.messenger-chat {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* override old fixed max-height */
  max-height: none !important;
}

/* -- Compose bar -- */

.messenger-compose {
  flex-shrink: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--bg-border);
}

.compose-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
}

.compose-plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--bg-border);
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, transform 0.22s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.compose-plus:hover { border-color: var(--text-dim); color: var(--text-primary); }
.compose-plus.open  {
  transform: rotate(45deg);
  border-color: var(--agent-accent, var(--accent-def));
  color: var(--agent-accent, var(--accent-def));
}

.plus-icon { display: block; margin-top: -2px; }

.compose-input {
  flex: 1;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: 18px;
  color: var(--text-primary);
  font-size: 16px;
  padding: 9px 14px;
  font-family: var(--font-body);
  line-height: 1.45;
  resize: none;
  overflow-y: auto;
  max-height: 120px;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}

.compose-input::placeholder { color: var(--text-dim); }
.compose-input:focus { outline: none; border-color: var(--agent-accent, var(--accent-def)); }

.compose-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: filter 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.compose-send:active { transform: scale(0.93); }
.compose-send:hover  { filter: brightness(1.15); }

/* -- Plus menu -- */

.plus-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-raised);
  border-top: 1px solid var(--bg-border);
}

.plus-menu.open { display: flex; }

.plus-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 1px solid var(--bg-border);
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.plus-menu-item:last-child { border-bottom: none; }
.plus-menu-item:hover { background: var(--bg-border); }

.plus-menu-icon {
  font-size: 1.15rem;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}

#file-name-display {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: auto;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messenger-offline {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

/* -- Side drawer -- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

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

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--bg-surface);
  border-right: 1px solid var(--bg-border);
  z-index: 210;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer.open { transform: translateX(0); }

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-border);
  flex-shrink: 0;
}

.drawer-back {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  transition: color 0.15s;
}

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

.drawer-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.drawer-close-btn:hover { color: var(--text-primary); }

.drawer-agent-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--bg-border);
}

.drawer-agent-name {
  font-size: 1.2rem;
  font-weight: 700;
}

.drawer-agent-role {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 6px;
}

.drawer-last-active {
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 8px 16px;
  border-bottom: 1px solid var(--bg-border);
}

.drawer-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-border);
}

.drawer-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.drawer-focus {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.drawer-actions {
  padding: 16px;
  margin-top: auto;
}
