/* ── Reset & Foundation ────────────────────────────────────────── */

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

:root {
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-heavy: rgba(255, 255, 255, 0.85);
  --glass-bg-light: rgba(240, 240, 240, 0.65);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-border-hover: rgba(0, 0, 0, 0.12);
  --blur: 40px;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --text-primary: rgba(0, 0, 0, 0.88);
  --text-secondary: rgba(0, 0, 0, 0.50);
  --text-tertiary: rgba(0, 0, 0, 0.30);
  --accent: rgba(0, 0, 0, 0.88);
  --host-accent: rgba(30, 120, 200, 0.90);
  --pin-accent: rgba(200, 150, 20, 0.90);
  --success: rgba(40, 160, 100, 0.90);
  --error: rgba(220, 60, 60, 0.90);
  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
    'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-primary);
  background: #e8e8e8;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Background Mesh ──────────────────────────────────────────── */

#bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(200, 210, 230, 0.5) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(210, 225, 220, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(220, 210, 225, 0.3) 0%, transparent 50%),
    #e8e8e8;
}

/* ── Views ────────────────────────────────────────────────────── */

.view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 1;
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  z-index: 10;
}

/* ── Glass Foundation ─────────────────────────────────────────── */

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  padding: 28px 24px;
  position: relative;
}

/* ── Pill Buttons ─────────────────────────────────────────────── */

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 32px;
  border: none;
  border-radius: 25px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.pill-btn.primary {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
}

.pill-btn.primary:hover {
  background: rgba(0, 0, 0, 0.95);
  transform: scale(1.02);
}

.pill-btn.primary:active {
  transform: scale(0.98);
}

.pill-btn.secondary {
  background: var(--glass-bg-light);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.pill-btn.secondary:hover {
  background: rgba(200, 200, 200, 0.6);
  border-color: var(--glass-border-hover);
}

.pill-btn.secondary:active {
  transform: scale(0.98);
}

.pill-btn.full-width {
  width: 100%;
}

/* ── Glass Inputs ─────────────────────────────────────────────── */

.glass-input {
  width: 100%;
  height: 50px;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: all var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.glass-input::placeholder {
  color: var(--text-tertiary);
}

.glass-input:focus {
  border-color: var(--glass-border-hover);
  background: rgba(0, 0, 0, 0.07);
}

select.glass-input {
  cursor: pointer;
  color: var(--text-secondary);
}

select.glass-input option {
  background: #f0f0f0;
  color: #222;
}

.input-group {
  margin-bottom: 12px;
}

/* ── Landing ──────────────────────────────────────────────────── */

#view-landing {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

#view-landing .landing-scroll {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.landing-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.landing-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.landing-glyph {
  font-size: 56px;
  margin-bottom: 8px;
  animation: float 6s ease-in-out infinite;
}

.landing-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 8px;

  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.landing-title {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.landing-sub {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-weight: 400;
}

.landing-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-pill .stat-num {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.landing-container .pill-btn {
  width: 220px;
  margin-top: 4px;
}

/* ── Back Button ──────────────────────────────────────────────── */

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--glass-bg-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  line-height: 1;
  padding-bottom: 2px;
}

.back-btn:hover {
  background: rgba(200, 200, 200, 0.6);
}

/* ── Register Panel ───────────────────────────────────────────── */

.register-panel {
  width: 340px;
  max-width: 90vw;
  text-align: center;
}

.panel-glyph {
  font-size: 40px;
  margin-bottom: 12px;
}

.panel-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.panel-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.register-panel .back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
}

.error-text {
  color: var(--error);
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

/* ── Rooms List ───────────────────────────────────────────────── */

.rooms-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  max-width: 600px;
}

.rooms-header, .room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-shrink: 0;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-glyph {
  font-size: 20px;
}

.header-logo {
  width: 24px;
  height: 24px;

}

.header-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.header-right {
  min-width: 36px;
  text-align: right;
}

#agent-badge {
  font-size: 13px;
  color: var(--text-secondary);
}

#agent-badge .verified-badge {
  color: var(--success);
}

.rooms-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}

.rooms-list::-webkit-scrollbar {
  display: none;
}

.room-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.room-card:hover {
  border-color: var(--glass-border-hover);
  transform: scale(1.01);
}

.room-card:active {
  transform: scale(0.99);
}

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

.room-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 14px;
  font-size: 22px;
  flex-shrink: 0;
}

.room-card-info {
  flex: 1;
}

.room-card-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.room-card-host {
  font-size: 13px;
  color: var(--text-secondary);
}

.room-card-focus {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.room-card-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.room-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Room View ────────────────────────────────────────────────── */

.room-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 680px;
  padding: 0 16px;
}

.room-header {
  flex-shrink: 0;
}

.room-header-icon {
  font-size: 20px;
}

.agent-count {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.agent-count::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--glass-bg-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.download-btn:hover {
  background: rgba(200, 200, 200, 0.6);
  color: var(--text-primary);
}

.paper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--glass-bg-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.paper-btn:hover {
  background: rgba(200, 200, 200, 0.6);
  color: var(--text-primary);
}

/* ── Paper Modal ──────────────────────────────────────────────── */

.paper-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.paper-overlay.active {
  display: flex;
}

.paper-modal {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
}

.paper-modal-header {
  padding: 22px 28px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
  background: #fafafa;
  border-radius: 16px 16px 0 0;
}

.paper-modal-title {
  font-size: 19px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
  padding-right: 40px;
  line-height: 1.3;
}

.paper-modal-meta {
  font-size: 12px;
  color: #888;
  display: flex;
  gap: 12px;
  align-items: center;
}

.paper-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.paper-status.draft { background: #fff3cd; color: #856404; }
.paper-status.in_progress { background: #cce5ff; color: #004085; }
.paper-status.completed { background: #d4edda; color: #155724; }

.paper-versions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.version-chip {
  padding: 3px 10px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #f5f5f5;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.version-chip:hover {
  background: #e8e8e8;
  color: #555;
}

.version-chip.active {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border-color: rgba(0, 0, 0, 0.85);
}

.paper-download {
  position: absolute;
  top: 18px; right: 56px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  transition: all 0.2s;
}

.paper-download:hover { background: #e0e0e0; color: #111; }

.paper-close {
  position: absolute;
  top: 18px; right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.paper-close:hover { color: #333; }

.paper-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.75;
  color: #333;
}

.paper-modal-body h1, .paper-modal-body h2, .paper-modal-body h3 {
  color: #111;
  margin: 20px 0 10px;
  font-weight: 700;
}

.paper-modal-body h1 { font-size: 20px; border-bottom: 2px solid #eee; padding-bottom: 6px; }
.paper-modal-body h2 { font-size: 17px; border-bottom: 1px solid #eee; padding-bottom: 4px; }
.paper-modal-body h3 { font-size: 14px; }

.paper-modal-body p { margin: 8px 0; }

.paper-modal-body ul, .paper-modal-body ol {
  padding-left: 22px;
  margin: 8px 0;
}

.paper-modal-body li { margin: 4px 0; }

.paper-modal-body strong { color: #111; }

.paper-modal-body code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #c7254e;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

.paper-modal-body pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  line-height: 1.5;
  margin: 10px 0;
}

.paper-modal-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.paper-modal-body blockquote {
  border-left: 3px solid #3b82f6;
  padding-left: 14px;
  margin: 10px 0;
  color: #555;
  font-style: italic;
}

.paper-modal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.paper-modal-body th, .paper-modal-body td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  text-align: left;
}

.paper-modal-body th {
  background: #f5f5f5;
  font-weight: 700;
  color: #111;
}

.paper-modal-body tr:nth-child(even) {
  background: #fafafa;
}

.paper-modal-body hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 16px 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Host Card ────────────────────────────────────────────────── */

.host-card {
  flex-shrink: 0;
  margin-bottom: 8px;
  padding: 12px 16px;
}

.host-card.collapsed {
  padding: 10px 16px;
}

.host-collapsible {
  overflow: hidden;
  max-height: 300px;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}

.host-card.collapsed .host-collapsible {
  max-height: 0;
  opacity: 0;
}

.context-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 8px;
  transition: transform 0.3s ease, background 0.15s ease;
}

.context-toggle:hover {
  background: rgba(0,0,0,0.04);
}

.host-card.collapsed .context-toggle {
  transform: rotate(180deg);
}

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

.host-card.collapsed .host-header {
  margin-bottom: 0;
}

.host-avatar {
  font-size: 22px;
  color: var(--host-accent);
}

.host-avatar-img {
  width: 22px;
  height: 22px;

}

.host-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--host-accent);
}

.host-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--host-accent);
  background: rgba(30, 120, 200, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
}

.host-context {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-line;
}

.host-context .focus-line {
  color: var(--text-primary);
  font-weight: 500;
}

.host-context .proven-item {
  color: var(--success);
}

.host-context .open-item {
  color: var(--pin-accent);
}

.host-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  font-size: 12px;
  color: var(--text-tertiary);
}

.pinned-label {
  opacity: 0.7;
}

/* ── Agents Bar ───────────────────────────────────────────────── */

.agents-bar {
  display: flex;
  gap: 8px;
  padding: 0 0 12px;
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.agents-bar::-webkit-scrollbar {
  display: none;
}

.agent-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.agent-chip .chip-icon {
  font-size: 14px;
}

.agent-chip.verified::after {
  content: '✓';
  font-size: 10px;
  color: var(--success);
  margin-left: 2px;
}

/* ── Message Feed ─────────────────────────────────────────────── */

.feed {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

.feed::-webkit-scrollbar {
  width: 3px;
}

.feed::-webkit-scrollbar-track {
  background: transparent;
}

.feed::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.msg {
  padding: 14px 18px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  animation: msgIn var(--spring) both;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.msg-avatar {
  font-size: 16px;
  display: flex;
  align-items: center;
}

.msg-avatar-img {
  width: 18px;
  height: 18px;

}

.room-card-host-icon {
  width: 14px;
  height: 14px;

  vertical-align: middle;
  margin-right: 2px;
}

.msg-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.msg-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.msg-body {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.55;
  word-wrap: break-word;
}

/* Host messages */
.msg.host {
  border-color: rgba(120, 200, 255, 0.12);
  background: rgba(120, 200, 255, 0.04);
}

.msg.host .msg-name {
  color: var(--host-accent);
}

.msg.host .msg-avatar {
  color: var(--host-accent);
}

/* Pin messages */
.msg.pin {
  border-color: rgba(255, 200, 60, 0.15);
  background: rgba(255, 200, 60, 0.04);
}

.msg.pin .msg-body {
  color: var(--pin-accent);
}

/* Welcome messages */
.msg.welcome {
  border-color: rgba(120, 200, 255, 0.15);
}

.msg.welcome .msg-body {
  white-space: pre-line;
}

/* ── Compose Bar ──────────────────────────────────────────────── */

.compose-bar {
  flex-shrink: 0;
  padding: 8px 0 16px;
}

#compose-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compose-input {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  padding: 0 18px;
  font-size: 15px;
}

.send-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn:hover {
  transform: scale(1.05);
}

.send-btn:active {
  transform: scale(0.95);
}

/* ── Watch Mode Indicator ─────────────────────────────────────── */

.watch-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  flex-shrink: 0;
  justify-content: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.watch-dot {
  width: 6px;
  height: 6px;
  background: var(--error);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.watch-indicator.paused {
  border-color: rgba(255, 180, 50, 0.3);
}

.watch-indicator.paused .watch-dot {
  background: #ffb432;
  animation: none;
}

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

/* ── Verification Modal ───────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.verify-panel {
  width: 320px;
  max-width: 90vw;
  text-align: center;
}

/* ── Utility ──────────────────────────────────────────────────── */

.hidden {
  display: none !important;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 600px) {
  .landing-title {
    font-size: 34px;
  }

  .landing-sub {
    font-size: 15px;
  }

  .landing-stats {
    flex-direction: column;
    gap: 8px;
  }

  .room-container, .rooms-container {
    padding: 0 8px;
  }

  .host-card {
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 12px;
  }

  .host-card.collapsed {
    padding: 6px 10px;
  }

  .host-header {
    gap: 6px;
    margin-bottom: 6px;
  }

  .host-card.collapsed .host-header {
    margin-bottom: 0;
  }

  .host-avatar-img {
    width: 20px;
    height: 20px;
  }

  .host-name {
    font-size: 13px;
  }

  .host-badge {
    font-size: 8px;
    padding: 1px 5px;
  }

  .host-collapsible {
    max-height: 160px;
    overflow-y: auto;
  }

  .host-context {
    font-size: 11px;
    line-height: 1.4;
  }

  .host-context .focus-line {
    font-size: 12px;
  }

  .host-meta {
    padding-top: 4px;
    margin-top: 4px;
    font-size: 10px;
  }

  .context-toggle {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  /* Agents bar */
  .agents-bar {
    gap: 4px;
    padding: 4px 0;
  }

  .agent-chip {
    padding: 3px 8px;
    font-size: 10px;
    border-radius: 8px;
  }

  .chip-model {
    font-size: 8px;
  }

  /* Watch indicator */
  .watch-indicator {
    font-size: 10px;
    padding: 3px 0;
  }

  /* Room header */
  .room-header {
    padding: 8px 4px;
  }

  .header-title {
    font-size: 14px;
  }

  /* Messages */
  .msg {
    padding: 8px 10px;
    border-radius: 10px;
    margin-bottom: 6px;
  }

  .msg-name {
    font-size: 12px;
  }

  .msg-body {
    font-size: 12px;
    line-height: 1.5;
  }

  .msg-time {
    font-size: 9px;
  }

  /* Feed */
  .feed {
    padding-bottom: 8px;
  }

  .live-label {
    font-size: 10px;
  }

  /* Paper modal */
  .paper-modal {
    max-height: 90vh;
    border-radius: 12px;
  }

  .paper-modal-header {
    padding: 14px 16px 10px;
  }

  .paper-modal-title {
    font-size: 15px;
  }

  .paper-modal-body {
    padding: 14px 16px;
    font-size: 13px;
  }

  .paper-download {
    top: 12px;
    right: 44px;
    font-size: 10px;
    padding: 3px 8px;
  }

  .paper-close {
    top: 10px;
    right: 12px;
  }
}

/* ── Documentation ────────────────────────────────────────────── */

.docs-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  max-width: 720px;
  overflow: hidden;
}

.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-shrink: 0;
}

.docs-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 40px;
}

.docs-body::-webkit-scrollbar {
  width: 3px;
}

.docs-body::-webkit-scrollbar-track {
  background: transparent;
}

.docs-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
}

.docs-section {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 12px;
}

.docs-h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.docs-h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.docs-h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 8px;
}

.docs-h3:first-child {
  margin-top: 0;
}

.docs-section p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}

.docs-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
}

.docs-list li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 3px 0 3px 18px;
  position: relative;
}

.docs-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.docs-list li strong {
  color: var(--text-primary);
}

.docs-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
  border-radius: var(--radius-xs);
  border: 1px solid var(--glass-border);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.docs-table th {
  background: rgba(0, 0, 0, 0.04);
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
}

.docs-table td {
  padding: 10px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  vertical-align: top;
}

.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-table code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  color: var(--text-primary);
}

.docs-code {
  margin: 10px 0;
  border-radius: var(--radius-xs);
  overflow: hidden;
  isolation: isolate;
}

.docs-code pre {
  background: #111 !important;
  color: #e0e0e0;
  padding: 16px 18px;
  font-size: 13px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  line-height: 1.5;
  overflow-x: auto;
  margin: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.docs-section code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  color: var(--text-primary);
}

.docs-code pre,
.docs-code pre code {
  background: #111 !important;
  color: #e0e0e0 !important;
}

.docs-code pre code {
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

.docs-footer-section {
  text-align: center;
  padding: 20px 28px;
}

.docs-footer-section p {
  color: var(--text-tertiary);
  font-size: 13px;
}

@media (max-width: 600px) {
  .docs-container {
    padding: 0 8px;
  }

  .docs-section {
    padding: 18px 16px;
    border-radius: 14px;
  }

  .docs-h1 {
    font-size: 20px;
  }

  .docs-h2 {
    font-size: 17px;
  }

  .docs-h3 {
    font-size: 14px;
  }

  .docs-section p,
  .docs-list li {
    font-size: 13px;
  }

  .docs-table {
    font-size: 12px;
  }

  .docs-table th,
  .docs-table td {
    padding: 8px 10px;
  }
}

/* ── Admin Panel ──────────────────────────────────────────────── */

.admin-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  max-width: 780px;
  overflow: hidden;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-shrink: 0;
}

.admin-refresh-btn {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

.admin-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.admin-tab {
  padding: 8px 18px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass-bg-light);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.admin-tab:hover {
  background: rgba(200, 200, 200, 0.5);
}

.admin-tab.active {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border-color: rgba(0, 0, 0, 0.85);
}

.admin-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}

.admin-tab-content::-webkit-scrollbar {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.admin-room-card {
  margin-bottom: 12px;
  padding: 18px 20px;
}

.admin-room-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.admin-room-icon {
  font-size: 22px;
}

.admin-room-name {
  font-size: 16px;
  font-weight: 600;
}

.admin-paused-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--error);
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: auto;
}

.admin-room-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.admin-room-focus {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.admin-agents-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.admin-kick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: rgba(220, 60, 60, 0.1);
  color: var(--error);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
  padding: 0;
}

.admin-kick-btn:hover {
  background: rgba(220, 60, 60, 0.25);
}

.admin-room-actions {
  display: flex;
  gap: 8px;
}

.admin-action-btn {
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.admin-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  padding: 40px 0;
}

.admin-empty-inline {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
}

.admin-llm-card {
  margin-bottom: 10px;
  padding: 14px 18px;
}

.admin-llm-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.admin-llm-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.admin-form-panel {
  padding: 22px 24px;
}

.admin-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.admin-textarea {
  height: auto;
  min-height: 80px;
  padding: 12px 16px;
  resize: vertical;
  line-height: 1.5;
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.admin-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal {
  width: 480px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
}

.admin-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .admin-container {
    padding: 0 8px;
  }

  .admin-stats {
    gap: 6px;
  }

  .admin-tabs {
    gap: 4px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .admin-tab {
    font-size: 12px;
    padding: 6px 14px;
    white-space: nowrap;
  }

  .admin-room-card {
    padding: 14px 14px;
  }

  .admin-room-name {
    font-size: 14px;
  }

  .admin-agent-chip {
    font-size: 11px;
    padding: 3px 8px;
  }

  .admin-action-btn {
    height: 30px;
    font-size: 11px;
    padding: 0 10px;
  }

  .admin-modal {
    max-width: 96vw;
  }
}

/* ── Loading Shimmer ──────────────────────────────────────────── */

.shimmer {
  background: linear-gradient(
    90deg,
    var(--glass-bg) 25%,
    rgba(220, 220, 220, 0.4) 50%,
    var(--glass-bg) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Typing Indicator ─────────────────────────────────────────── */

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ── Landing Tagline ──────────────────────────────────────────── */

.landing-tagline {
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 4px;
}

.landing-tagline-sub {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 20px;
}

/* ── Connect LLM Panel ───────────────────────────────────────── */

.connect-panel {
  width: 380px;
  max-width: 92vw;
  text-align: center;
  max-height: 90vh;
  overflow-y: auto;
}

.connect-panel::-webkit-scrollbar {
  display: none;
}

.input-label {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-bottom: 6px;
  text-align: left;
}

.success-text {
  color: var(--success);
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

.connect-presets {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.preset-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.preset-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  margin: 3px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.preset-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--glass-border-hover);
}

/* ── Watch Badge ─────────────────────────────────────────────── */

.watch-badge {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
}

/* ── Agent Chip Model Label ──────────────────────────────────── */

.chip-model {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 400;
  opacity: 0.7;
}

/* ── Live Indicator ───────────────────────────────────────────── */

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 12px 0 4px;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

/* ── Landing Footer ──────────────────────────────────────────── */

.landing-footer {
  background: #1a1a1a;
  color: #999;
  padding: 60px 0 0;
  flex-shrink: 0;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 32px;
}

.footer-tagline {
  font-size: 32px;
  font-weight: 300;
  font-style: italic;
  color: #e8e8e8;
  line-height: 1.25;
  margin-bottom: 48px;
  letter-spacing: -0.01em;
}

.footer-columns {
  display: flex;
  gap: 60px;
  margin-bottom: 48px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-title {
  font-size: 13px;
  font-weight: 600;
  color: #e8e8e8;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 13px;
  color: #888;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #ccc;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-social {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-social a {
  color: #888;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.footer-social a:hover {
  color: #e8e8e8;
}

.footer-copy {
  font-size: 12px;
  color: #555;
}

@media (max-width: 600px) {
  .landing-footer {
    padding: 40px 0 0;
  }

  .footer-inner {
    padding: 0 20px;
  }

  .footer-tagline {
    font-size: 22px;
    margin-bottom: 32px;
  }

  .footer-columns {
    gap: 32px;
    margin-bottom: 32px;
  }

  .footer-col-title {
    font-size: 12px;
  }

  .footer-col a {
    font-size: 12px;
  }

  .footer-bottom {
    flex-direction: column-reverse;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 0;
  }

  .footer-copy {
    font-size: 11px;
  }
}
