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

:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0f1f3d;
  --bg-card: rgba(15, 31, 61, 0.6);
  --bg-card-hover: rgba(25, 50, 95, 0.7);
  --border-subtle: rgba(100, 160, 255, 0.1);
  --border-hover: rgba(100, 160, 255, 0.25);
  --text-primary: #e8edf5;
  --text-secondary: #8a9bbd;
  --text-muted: #546a8d;
  --accent: #ff5500;
  --accent-light: #ff8a00;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --success: #34d399;
  --font-main: 'Inter', -apple-system, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
}

.message {
  white-space: pre-line;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== Background Effects ===== */
.bg-effects {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}

.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #ff5a5f, transparent 70%);
  top: -200px; right: -100px;
  animation: float1 20s ease-in-out infinite;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #ff8a00, transparent 70%);
  bottom: -150px; left: -100px;
  animation: float2 25s ease-in-out infinite;
}

.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #ff5a5f, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-80px, 60px); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(60px, -80px); }
}
@keyframes float3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  background: rgba(10, 22, 40, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
}

.brand-icon { font-size: 22px; }

.brand-name {
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-version {
  color: var(--accent-light);
  font-weight: 800;
}

.nav-status {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 20px;
}

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

.status-text {
  font-size: 13px; font-weight: 500;
  color: var(--success);
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

/* ===== Hero ===== */
.hero {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 70vh;
  padding: 120px 40px 60px;
  text-align: center;
}

.hero-content {
  max-width: 700px;
  animation: fadeUp 0.8s ease-out;
}

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

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent-light);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 12px;
}

.title-accent {
  background: linear-gradient(135deg, var(--accent-light), #ff5a5f, #ff8a00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.hero-description {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-stats {
  display: inline-flex; align-items: center; gap: 28px;
  padding: 20px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-number { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.stat-number.status-active { color: var(--success); font-size: 16px; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-divider { width: 1px; height: 36px; background: var(--border-subtle); }

/* ===== Agents Section ===== */
.agents-section {
  position: relative; z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

.section-header { margin-bottom: 24px; }

.section-title {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.section-description {
  font-size: 15px;
  color: var(--text-muted);
}

/* ===== Filters Bar ===== */
.filters-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 32px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filters-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px; height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

#search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 40px 12px 42px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(255, 85, 0, 0.15);
}

#search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.search-clear:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* View Toggle */
.view-toggle-group {
  display: flex;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle-btn {
  background: rgba(255, 255, 255, 0.02);
  border: none;
  padding: 10px 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.view-toggle-btn + .view-toggle-btn {
  border-left: 1px solid var(--border-subtle);
}

.view-toggle-btn svg {
  width: 18px; height: 18px;
}

.view-toggle-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn.active {
  color: var(--accent-light);
  background: rgba(255, 85, 0, 0.1);
}

/* Filter Row */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.filter-pill.active {
  background: rgba(255, 85, 0, 0.12);
  border-color: rgba(255, 85, 0, 0.35);
  color: var(--accent-light);
}

/* Active Filters Row */
.active-filters-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.active-filters-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.active-filters-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.active-filter-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(255, 85, 0, 0.1);
  border: 1px solid rgba(255, 85, 0, 0.25);
  border-radius: 16px;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.remove-filter {
  background: none;
  border: none;
  color: var(--accent-light);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
  font-family: inherit;
}

.remove-filter:hover {
  opacity: 1;
}

.clear-all-filters {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 16px;
  color: #f87171;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-left: auto;
}

.clear-all-filters:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

/* ===== Category Block ===== */
.category-block {
  margin-bottom: 36px;
  animation: fadeUp 0.8s ease-out 0.2s both;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}

.category-header:hover {
  opacity: 0.85;
}

.category-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.category-icon { font-size: 28px; }

.category-name {
  font-size: 18px; font-weight: 600;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.category-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.category-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, color 0.2s;
}

.category-toggle svg {
  width: 20px; height: 20px;
}

.category-toggle.collapsed {
  transform: rotate(-90deg);
}

.category-toggle:hover {
  color: var(--text-primary);
}

/* ===== Agent Cards Grid ===== */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  overflow: hidden;
}

.agents-grid.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* ===== List View overrides ===== */
.view-list .agents-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ===== Agent Card ===== */
.agent-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.agent-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -15px rgba(59, 130, 246, 0.15);
}

.agent-card-glow {
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}

.agent-card:hover .agent-card-glow { opacity: 1; }

.agent-card-content { padding: 28px; }

.agent-icon-wrapper {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}

.agent-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
}

.agent-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.agent-status-badge {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--success);
  padding: 4px 10px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 12px;
}

.agent-name {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.agent-fullname {
  font-size: 13px;
  color: var(--accent-light);
  font-weight: 500;
  margin-bottom: 12px;
}

.agent-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.agent-footer {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}

.agent-tag {
  font-size: 11px; font-weight: 500;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 8px;
  color: var(--text-secondary);
}

.agent-tag-internal {
  font-size: 11px; font-weight: 500;
  padding: 4px 10px;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.12);
  border-radius: 8px;
  color: #c4b5fd;
}

.agent-tag-client {
  font-size: 11px; font-weight: 500;
  padding: 4px 10px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.12);
  border-radius: 8px;
  color: #6ee7b7;
}

.agent-tag-preventa {
  font-size: 11px; font-weight: 500;
  padding: 4px 10px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.12);
  border-radius: 8px;
  color: #fbbf24;
}

.agent-tag-dt {
  font-size: 11px; font-weight: 500;
  padding: 4px 10px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.12);
  border-radius: 8px;
  color: #22d3ee;
}

.agent-tag-ops {
  font-size: 11px; font-weight: 500;
  padding: 4px 10px;
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.12);
  border-radius: 8px;
  color: #fb7185;
}

.agent-arrow {
  margin-left: auto;
  font-size: 18px;
  color: var(--accent-light);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s;
}

.agent-card:hover .agent-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ===== Maturity Badge ===== */
.maturity-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

.maturity-production {
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.maturity-mvp {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.maturity-poc {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

/* ===== List View Items ===== */
.agent-list-item {
  display: grid;
  grid-template-columns: 48px 1fr 140px 90px 100px 32px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  color: inherit;
}

.agent-list-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.list-item-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 10px;
}

.list-item-main {
  min-width: 0;
}

.list-item-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-fullname {
  font-size: 12px;
  color: var(--accent-light);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-domain {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-maturity {
  display: flex;
  justify-content: center;
}

.list-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 4px 10px;
  border-radius: 12px;
}

.list-status-available {
  color: var(--success);
  background: rgba(52, 211, 153, 0.08);
}

.list-status-dev {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

.list-status-soon {
  color: var(--text-muted);
  background: rgba(84, 106, 141, 0.1);
}

.list-item-arrow {
  font-size: 16px;
  color: var(--accent-light);
  opacity: 0;
  transition: opacity 0.2s;
  text-align: center;
}

.agent-list-item:hover .list-item-arrow {
  opacity: 1;
}

/* ===== Empty State ===== */
.empty-state {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.5;
  margin-bottom: 8px;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-state-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  background: rgba(255, 85, 0, 0.1);
  border: 1px solid rgba(255, 85, 0, 0.25);
  border-radius: var(--radius-sm);
  color: var(--accent-light);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.empty-state-btn:hover {
  background: rgba(255, 85, 0, 0.18);
  border-color: rgba(255, 85, 0, 0.4);
}

/* ===== Changelog Section ===== */
.changelog-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border-subtle);
}

.changelog-header {
  margin-bottom: 28px;
}

.changelog-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.changelog-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.changelog-entries {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.changelog-entry {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  position: relative;
}

.changelog-entry + .changelog-entry {
  border-top: 1px solid rgba(100, 160, 255, 0.05);
}

.changelog-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 100px;
  padding-top: 2px;
  letter-spacing: 0.3px;
}

.changelog-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: 5px;
  box-shadow: 0 0 8px rgba(255, 85, 0, 0.3);
}

.changelog-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
}

.changelog-type-icon {
  font-size: 14px;
  line-height: 1.6;
}

.changelog-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ===== Footer ===== */
.footer {
  position: relative; z-index: 1;
  padding: 24px 40px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-content {
  font-size: 13px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

.footer-sep { opacity: 0.3; }

/* ===== Chat Modal ===== */
.chat-overlay {
  position: fixed; inset: 0;
  z-index: 1000;
  background: rgba(10, 22, 40, 0.8);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: all 0.3s ease;
  padding: 20px;
}

.chat-overlay.active {
  opacity: 1; pointer-events: all;
}

.chat-container {
  width: 100%; max-width: 600px; height: 80vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.chat-overlay.active .chat-container {
  transform: translateY(0);
}

.chat-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}

.chat-header-info { display: flex; align-items: center; gap: 14px; }

.chat-avatar {
  width: 40px; height: 40px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.chat-agent-name { font-size: 18px; font-weight: 700; }
.chat-agent-status { font-size: 12px; color: var(--success); }

.chat-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 28px; cursor: pointer;
  padding: 0 8px;
  transition: color 0.2s;
}

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

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}

.message {
  max-width: 85%; padding: 12px 18px;
  border-radius: 16px; font-size: 14px;
  line-height: 1.5;
}

.system-message {
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.user-message {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.ai-message {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-input-area {
  padding: 20px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex; gap: 12px;
}

#chat-input {
  flex: 1; background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#chat-input:focus { border-color: var(--accent); }

#chat-send {
  width: 48px; height: 48px;
  background: var(--accent);
  border: none; border-radius: var(--radius-sm);
  color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}

#chat-send:hover { background: var(--accent-light); }
#chat-send svg { width: 20px; height: 20px; }

/* Typing indicator */
.typing {
  font-style: italic; color: var(--text-muted);
  font-size: 12px; align-self: flex-start;
  margin-bottom: 4px;
}

/* ===== Details Modal ===== */
.details-overlay {
  position: fixed; inset: 0;
  z-index: 999;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: all 0.3s ease;
  padding: 20px;
}

.details-overlay.active {
  opacity: 1; pointer-events: all;
}

.details-container {
  width: 100%; max-width: 650px; max-height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.details-overlay.active .details-container {
  transform: translateY(0);
}

.details-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}

.details-header-info { display: flex; align-items: center; gap: 14px; }

.details-avatar {
  width: 44px; height: 44px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

.details-agent-name { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.details-agent-fullname { font-size: 13px; color: var(--accent-light); font-weight: 500; }

.details-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 28px; cursor: pointer;
  padding: 0 8px;
  transition: color 0.2s;
}
.details-close:hover { color: var(--text-primary); }

.details-body {
  flex: 1; overflow-y: auto;
  padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
  line-height: 1.6;
}

.details-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.details-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.details-section-title {
  font-size: 14px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

.details-description-text {
  font-size: 15px;
  color: var(--text-primary);
}

.details-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.details-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.details-list li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  color: var(--text-primary);
}

.details-list li::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: var(--accent-light);
  font-weight: bold;
}

.details-list li strong {
  color: var(--accent-light);
}

.details-meta-item {
  font-size: 14px;
  color: var(--text-primary);
}

.details-meta-item strong {
  color: var(--text-secondary);
}

.details-link {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 500;
  word-break: break-all;
  transition: color 0.2s;
}
.details-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.details-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.details-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.details-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.details-btn-primary {
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.details-btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-light), #6366f1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}
.details-btn-primary:active {
  transform: translateY(1px);
}

/* ===== Markdown Elements in Chat Messages ===== */
.message p {
  margin-bottom: 8px;
}
.message p:last-child {
  margin-bottom: 0;
}

.message ul, .message ol {
  margin-top: 6px;
  margin-bottom: 8px;
  padding-left: 20px;
}

.message ul {
  list-style-type: disc;
}

.message ol {
  list-style-type: decimal;
}

.message li {
  margin-bottom: 4px;
  line-height: 1.45;
}
.message li:last-child {
  margin-bottom: 0;
}

.message li p {
  margin: 0;
  display: inline;
}

.message strong {
  font-weight: 700;
  color: #ffffff;
}

.user-message strong {
  color: #ffffff;
}

.message code {
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #fca5a5;
}

.user-message code {
  background: rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.message pre {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.message pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
  color: inherit;
}

/* ===== Lock State & Login Screen ===== */
body.locked {
  overflow: hidden;
}

body.locked .navbar,
body.locked .hero,
body.locked .agents-section,
body.locked .footer {
  display: none !important;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  padding: 20px;
}

body.locked .login-overlay {
  opacity: 1;
  visibility: visible;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.5),
              0 0 50px 0 rgba(59, 130, 246, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  animation: loginFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
  margin-bottom: 32px;
}

.login-logo {
  font-size: 40px;
  display: inline-block;
  margin-bottom: 12px;
  animation: float_logo 6s ease-in-out infinite;
}

@keyframes float_logo {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--accent-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 44px 14px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.password-input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: var(--text-primary);
}

.toggle-password svg {
  width: 20px;
  height: 20px;
}

.login-error-message {
  font-size: 13px;
  color: #f87171;
  margin-top: 4px;
  display: none;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Checkbox Custom Styling */
.remember-group {
  display: flex;
  align-items: center;
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 18px;
  width: 18px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.08);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--accent);
  border-color: var(--accent);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Submit Button */
.login-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.login-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
  background: linear-gradient(135deg, var(--accent-light), #6366f1);
}

.login-submit-btn:active {
  transform: translateY(1px);
}

.btn-arrow {
  transition: transform 0.2s ease;
}

.login-submit-btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Logout Button */
.logout-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.logout-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar { padding: 14px 20px; }
  .hero { padding: 100px 20px 40px; }
  .agents-section { padding: 30px 20px 60px; }
  .hero-stats { flex-direction: column; gap: 14px; padding: 20px; }
  .stat-divider { width: 40px; height: 1px; }
  .agents-grid { grid-template-columns: 1fr; }

  .filters-bar { padding: 16px; }
  .filters-row { flex-direction: column; gap: 12px; }
  .filter-group { flex-wrap: wrap; }

  .filters-top-row {
    flex-direction: column;
    gap: 10px;
  }

  .view-toggle-group {
    align-self: flex-end;
  }

  /* List view responsive */
  .agent-list-item {
    grid-template-columns: 40px 1fr 80px 28px;
    gap: 10px;
    padding: 12px 14px;
  }

  .list-item-domain,
  .list-item-maturity {
    display: none;
  }

  .changelog-entry {
    flex-direction: column;
    gap: 8px;
  }

  .changelog-dot {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 36px;
    letter-spacing: -1px;
  }

  .agent-card-content {
    padding: 20px;
  }

  .filter-pill {
    font-size: 11px;
    padding: 4px 10px;
  }
}
