[hidden] { display: none !important; }
.boot-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 400px); }
.login-panel h1 { font-size: 24px; margin: 32px 0 24px; }
.login-panel form { display: grid; gap: 18px; }
.login-panel label { display: grid; gap: 8px; }
.login-panel input { width: 100%; min-width: 0; }
.login-panel .remember-option { display: flex; align-items: center; gap: 10px; line-height: 1.5; }
.login-panel .remember-option input { width: auto; flex: 0 0 auto; }
.access-dialog { width: min(92vw, 620px); max-height: 85vh; overflow: auto; color: var(--text, #e5e7eb); background: #111923; border: 1px solid #334155; border-radius: 14px; padding: 24px; }
.access-dialog::backdrop { background: rgb(0 0 0 / 65%); }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid #334155; }
#loginError { color: #ff9898; min-height: 24px; }
:root {
  color-scheme: dark;
  --bg: #07111c;
  --bg-2: #0a1522;
  --panel: #101c2c;
  --panel-2: #122033;
  --line: #1e3350;
  --muted: #8aa0b8;
  --text: #e8eef8;
  --blue: #4d8dff;
  --cyan: #42c6d7;
  --green: #4fd18b;
  --gold: #d8ad4a;
  --red: #f06d6d;
  --violet: #8b6cff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(220px, 17vw) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0b1420 0%, #101827 100%);
  transition: width 160ms ease;
}

.sidebar.is-collapsed {
  width: 86px;
}

.sidebar.is-collapsed .brand-copy,
.sidebar.is-collapsed .nav-item strong,
.sidebar.is-collapsed .sidebar-card,
.sidebar.is-collapsed .profile div:not(.avatar) {
  display: none;
}

.brand,
.profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  min-height: 44px;
}

.brand-mark,
.avatar,
.agent-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  flex: none;
}

.brand-copy,
.profile div:not(.avatar) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy span,
.profile span,
.subtle,
.agent-card p,
.task-card p,
.integration-card p,
small {
  color: var(--muted);
}

.icon-button,
.ghost-button,
.secondary-button,
.primary-button,
.placeholder-card,
.nav-item,
.tab {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
}

.icon-button {
  margin-left: auto;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border-color: var(--line);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  color: #c8d4e6;
  text-align: left;
}

.nav-item span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #152236;
  color: #86a5ff;
  font-size: 12px;
}

.nav-item.is-active {
  background: #17263c;
  border-color: #284466;
}

.sidebar-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1724;
}

.sidebar-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.profile {
  padding: 8px 0;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar,
.section-heading,
.detail-head,
.composer-actions,
.task-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #8cb2ff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.15;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 32vw);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b2b;
  color: var(--muted);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.status-pill,
.badge {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(79, 209, 139, 0.14);
  color: #84e6b0;
  border: 1px solid rgba(79, 209, 139, 0.25);
  font-size: 12px;
  font-weight: 700;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 30, 46, 0.96), rgba(11, 19, 30, 0.98));
  box-shadow: var(--shadow);
}

.ceo-composer {
  padding: 14px;
  margin-bottom: 16px;
}

.composer-input {
  min-height: 76px;
  padding: 8px;
  outline: none;
  color: var(--text);
}

.composer-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.composer-actions {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.tool-strip {
  display: flex;
  gap: 8px;
}

.ghost-button,
.secondary-button {
  min-height: 36px;
  padding: 0 12px;
  border-color: var(--line);
  background: #111d2d;
}

.primary-button {
  min-height: 38px;
  padding: 0 14px;
  background: linear-gradient(135deg, #3c73ff, #4fb9e8);
  font-weight: 800;
}

.notice {
  margin-bottom: 20px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 173, 74, 0.35);
  border-radius: 8px;
  background: rgba(216, 173, 74, 0.09);
  color: #f4d899;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.org-panel,
.detail-panel,
.compact-panel,
.form-panel {
  padding: 16px;
}

.org-chart {
  display: grid;
  gap: 18px;
}

.org-level {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 16px;
  align-items: start;
}

.level-label {
  color: var(--muted);
}

.level-label strong {
  display: block;
  color: #8cb2ff;
  font-size: 13px;
  text-transform: uppercase;
}

.agent-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.level-0 .agent-card,
.level-1 .agent-card {
  width: min(360px, 100%);
}

.agent-card {
  width: min(240px, 100%);
  min-height: 136px;
  padding: 14px;
  border: 1px solid #2c405c;
  border-radius: 8px;
  background: #0f1a28;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease;
}

.agent-card:hover,
.agent-card.is-selected {
  transform: translateY(-2px);
  border-color: var(--blue);
}

.agent-top {
  display: flex;
  gap: 12px;
}

.agent-card h3 {
  margin-bottom: 4px;
}

.agent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.agent-meta span {
  color: #c9d8ef;
  font-size: 12px;
}

.placeholders {
  justify-content: flex-start;
}

.placeholder-card {
  width: 180px;
  height: 74px;
  border-style: dashed;
  border-color: #334965;
  color: #aac2e8;
}

.definition-list {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  margin: 18px 0 0;
}

.definition-list dt {
  color: var(--muted);
}

.definition-list dd {
  margin: 0;
}

.bottom-grid,
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-top: 18px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 12px 0;
}

.tab {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
}

.tab.is-active {
  background: #182842;
  color: var(--text);
}

.tab-body {
  padding: 14px;
}

.message-list,
.list,
.task-list,
.table-list {
  display: grid;
  gap: 10px;
}

.message {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1724;
}

.message.user {
  border-color: rgba(91, 140, 255, 0.45);
}

.message p {
  margin-bottom: 0;
  color: #c9d8ea;
}

.stats {
  display: grid;
  gap: 10px;
}

.stats div,
.mini-row,
.table-row,
.task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1724;
}

.stats strong {
  display: block;
  font-size: 24px;
}

.stats span {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  padding: 16px;
}

.list-item {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1724;
  color: var(--text);
  text-align: left;
}

.list-item span {
  color: var(--muted);
}

.list-item.is-active {
  border-color: var(--blue);
}

.editor,
.agent-form,
.form-panel {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #cbd9ec;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #0b1420;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.work-grid {
  grid-template-columns: 340px minmax(0, 1fr);
}

.task-card {
  align-items: flex-start;
}

.task-card select {
  width: 150px;
}

.badge.high {
  color: #ffb5b5;
  background: rgba(240, 109, 109, 0.12);
  border-color: rgba(240, 109, 109, 0.3);
}

.badge.medium {
  color: #f4d899;
  background: rgba(216, 173, 74, 0.12);
  border-color: rgba(216, 173, 74, 0.3);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.integration-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1724;
}

.integration-card .badge {
  margin-bottom: 12px;
}

.empty {
  color: var(--muted);
  padding: 20px;
}

[hidden] { display: none !important; }
.engineering-list { display: grid; gap: 16px; align-content: start; min-width: 0; }
.engineering-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--panel); min-width: 0; }
.engineering-card h4 { margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
.engineering-card p, .message p { white-space: pre-wrap; overflow-wrap: anywhere; }
.engineering-card details { margin: 14px 0; }
.engineering-card summary { cursor: pointer; padding-bottom: 10px; }
.engineering-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.engineering-card form { display: grid; gap: 12px; }
#ceoFeedback { min-height: 20px; margin: 10px 0 0; }
.message.assistant { border-left: 3px solid var(--green); }
.message.system { border-left: 3px solid var(--gold); }

@media (max-width: 1100px) {
  .app-shell,
  .dashboard-grid,
  .bottom-grid,
  .work-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar,
  .section-heading,
  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 14px;
  }

  .org-level,
  .form-row {
    grid-template-columns: 1fr;
  }

  .agent-row,
  .placeholders {
    justify-content: stretch;
  }

  .agent-card,
  .placeholder-card {
    width: 100%;
  }

  .task-card,
  .table-row,
  .mini-row {
    align-items: stretch;
    flex-direction: column;
  }

  .task-card select {
    width: 100%;
  }
}



/* Redesigned dashboard shell */
body { font-size: 13.5px; letter-spacing: -0.01em; background:
  radial-gradient(1200px 480px at 80% -10%, rgba(77, 141, 255, 0.12), transparent 50%),
  var(--bg); }
.app-shell { grid-template-columns: 248px 1fr; }
.sidebar { gap: 16px; padding: 18px 12px 14px; background: linear-gradient(180deg, #08131f 0%, #0b1726 100%); }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; color: #d7e7ff; background: linear-gradient(135deg, #2f6dff, #4aa7ff); }
.brand-copy strong { font-size: 15px; letter-spacing: -0.03em; }
.nav { gap: 4px; flex: 1; align-content: start; overflow: auto; }
.nav-item { min-height: 38px; padding: 0 10px; border-radius: 10px; color: #b7c7db; font-size: 13px; }
.nav-item strong { font-weight: 600; }
.nav-icon, .nav-item span.nav-icon { width: 22px; height: 22px; background: transparent; color: #7fa3d9; }
.nav-icon svg { width: 18px; height: 18px; display: block; }
.nav-item.is-active { background: rgba(77, 141, 255, 0.14); border-color: rgba(77, 141, 255, 0.28); color: #fff; }
.nav-item.is-active .nav-icon { color: #8cb8ff; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.plan-card { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #0c1726; }
.plan-card .eyebrow { margin-bottom: 4px; }
.plan-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.plan-bar { height: 6px; border-radius: 99px; background: #17304a; overflow: hidden; margin-top: 8px; }
.plan-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.profile { padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #0c1726; }
.profile .avatar, .top-avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 11px; }
.sidebar.is-collapsed .plan-card, .sidebar.is-collapsed .ghost-button { display: none; }
.main { padding: 16px 22px 24px; }
.topbar { margin-bottom: 16px; align-items: flex-start; }
.title-row { display: flex; align-items: center; gap: 8px; }
.title-row h1 { margin: 0; }
.agent-switch select { width: auto; min-height: 28px; padding: 2px 8px; border-radius: 8px; font-size: 13px; }
.search { width: min(280px, 28vw); min-height: 36px; padding: 0 10px 0 12px; border-radius: 12px; }
.search kbd { margin-left: auto; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; color: var(--muted); }
.bell-button { margin-left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.notice:empty, #demoNotice:empty { display: none; }
.panel { border-radius: 16px; }
.ceo-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.9fr); gap: 16px; margin-bottom: 18px; }
.ceo-composer { margin-bottom: 0; padding: 16px; }
.composer-input { min-height: 92px; font-size: 14px; }
.composer-end { display: flex; align-items: center; gap: 8px; }
.icon-chip, .model-chip, .send-button { border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: #111d2d; }
.icon-chip { width: 32px; height: 32px; }
.model-chip { min-height: 32px; padding: 0 12px; font-size: 12px; font-weight: 650; }
.send-button { width: 36px; height: 36px; display: grid; place-items: center; background: linear-gradient(135deg, #2f6dff, #4aa7ff); border: 0; }
.ceo-summary { padding: 16px; display: grid; align-content: start; gap: 12px; }
.summary-head { display: flex; gap: 10px; align-items: center; }
.summary-head span { display: block; color: var(--muted); font-size: 12px; }
.summary-list { display: grid; gap: 8px; margin: 0; }
.summary-list div { display: grid; grid-template-columns: 72px 1fr; gap: 8px; font-size: 13px; }
.summary-list dt { color: var(--muted); font-weight: 600; }
.summary-list dd { margin: 0; }
.org-heading { margin: 4px 0 10px; }
.org-stage { padding: 18px 16px 12px; overflow: hidden; }
.org-wrap { position: relative; }
.org-connectors { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.org-chart { display: grid; gap: 28px; position: relative; z-index: 1; }
.org-level { display: grid; gap: 10px; grid-template-columns: 1fr; justify-items: center; }
.level-label { text-align: center; }
.level-label strong { letter-spacing: 0.08em; font-size: 11px; }
.level-label span { display: block; font-size: 12px; }
.agent-row { width: 100%; }
.agent-card { width: min(220px, 100%); min-height: 124px; border-radius: 16px; padding: 12px; position: relative; }
.agent-card.is-planned { opacity: 0.62; filter: saturate(0.75); }
.agent-card .you-badge, .agent-card .plan-badge { position: absolute; top: 10px; right: 36px; min-height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.you-badge { background: rgba(77,141,255,0.2); color: #b9d4ff; border: 1px solid rgba(77,141,255,0.35); }
.plan-badge { background: rgba(148,163,184,0.12); color: #c5d0df; border: 1px solid rgba(148,163,184,0.25); right: 36px; }
.card-menu { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; }
.card-menu-list { position: absolute; right: 8px; top: 34px; z-index: 3; display: grid; min-width: 140px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #0f1b2b; box-shadow: var(--shadow); }
.model-pill { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; background: #15253a; color: #c9d8ef; font-size: 11px; }
.placeholder-card { width: min(200px, 100%); height: 88px; border-radius: 16px; border-style: dashed; background: transparent; }
.add-agent-btn { min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #15253a; color: var(--text); }
.level-actions { display: flex; justify-content: center; margin-top: 8px; }
.bottom-panel { margin-top: 18px; }
.bottom-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 12px 0; }
.live-pill { min-height: 22px; padding: 0 8px; border-radius: 999px; background: rgba(79, 209, 139, 0.14); color: #84e6b0; border: 1px solid rgba(79, 209, 139, 0.25); font-size: 11px; font-weight: 700; }
.live-pill.is-off { background: rgba(148,163,184,0.1); color: #9aadc2; border-color: rgba(148,163,184,0.25); }
.coming-soon { padding: 48px 24px; text-align: center; }
.coming-soon p { font-size: 18px; color: var(--muted); }
.empty-ceo { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-ceo strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.model-modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgb(0 0 0 / 55%); }
.model-modal[hidden] { display: none !important; }
.model-modal-card { width: min(720px, 94vw); max-height: 86vh; overflow: auto; padding: 18px; }
.model-groups { display: grid; gap: 16px; margin-top: 12px; }
.model-section h3 { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: #8cb2ff; }
.model-subgroup h4 { margin: 8px 0 6px; font-size: 13px; color: var(--muted); }
.model-option { display: grid; grid-template-columns: 1fr auto; gap: 8px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #0d1724; color: var(--text); margin-bottom: 6px; }
.model-option.is-selected { border-color: var(--blue); }
.model-option small { display: block; }
.model-select-native { margin-top: 10px; }
.settings-links, .billing-panel { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px; }
.billing-panel { display: grid; }
.bottom-panel.is-expanded { min-height: 50vh; }
.ceo-attach-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
@media (max-width: 1100px) {
  .ceo-row { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
}

.agent-card h3, .agent-card .agent-top { padding-right: 4px; }
.agent-card .agent-top { padding-top: 18px; }
.agent-card .you-badge, .agent-card .plan-badge { right: 34px; top: 8px; max-width: calc(100% - 48px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; z-index: 1; }
.model-modal-card { background: #0c1726 !important; }
.status-pill.is-off { background: rgba(148,163,184,0.1); color: #9aadc2; border-color: rgba(148,163,184,0.25); }
.plan-card strong { display: block; margin: 2px 0 0; }
.icon-chip { font-size: 18px; font-weight: 700; line-height: 1; }

/* ===== Dashboard v2 (mockup pass) ===== */
:root {
  --bg: #0b1220;
  --bg-2: #0a101c;
  --panel: #111a2b;
  --panel-2: #141e30;
  --line: #1e2a40;
  --muted: #8b9bb3;
  --text: #f3f6fb;
  --blue: #3b82f6;
  --radius: 12px;
  --radius-sm: 10px;
}
body {
  background: var(--bg);
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 13px;
  letter-spacing: -0.011em;
}
.app-shell { grid-template-columns: 180px minmax(0, 1fr); }
.sidebar {
  width: 180px;
  gap: 10px;
  padding: 16px 10px 12px;
  background: #080e18;
  border-right: 1px solid var(--line);
}
.brand { gap: 8px; min-height: 32px; margin-bottom: 6px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(180deg, #4b8fff, #2563eb);
  color: #fff;
}
.brand-copy strong { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -0.03em; }
.nav { gap: 2px; }
.nav-item {
  min-height: 38px; padding: 0 8px; border-radius: 10px;
  color: #c5d0e0; font-size: 13px; border: 0; background: transparent;
}
.nav-item strong { font-weight: 500; }
.nav-item.is-active {
  background: #1c2a44; color: #fff; border-color: transparent;
}
.nav-icon, .nav-item span.nav-icon { width: 20px; height: 20px; color: #9aa9c0; background: transparent; }
.nav-item.is-active .nav-icon { color: #fff; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.plan-card {
  padding: 12px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #0e1624;
}
.plan-card strong { display: block; font-size: 13px; margin: 0 0 8px; }
.plan-card p { margin: 6px 0 10px; color: var(--muted); font-size: 12px; }
.plan-bar { height: 4px; border-radius: 99px; background: #1a2740; overflow: hidden; }
.plan-bar span { display: block; height: 100%; background: var(--blue); }
.add-credits {
  width: 100%; min-height: 32px; border: 0; border-radius: 8px;
  background: rgba(59,130,246,0.18); color: #dbeafe; font-weight: 600; font-size: 12px;
}
.add-credits:hover { background: rgba(59,130,246,0.28); }
.profile {
  padding: 8px 6px; border: 0; background: transparent; gap: 8px;
}
.profile .avatar, .top-avatar {
  width: 28px; height: 28px; border-radius: 50%; font-size: 10px; font-weight: 700;
  background: #2a3548; color: #e8eef8;
}
.profile strong { font-size: 13px; }
.profile span { font-size: 11px; color: var(--muted); }
.main { padding: 16px 22px 22px; }
.topbar { margin-bottom: 16px; align-items: flex-start; }
.title-row { gap: 2px; }
.title-row h1, .title-block h1 {
  margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.03em;
}
.agent-switch select {
  width: 22px; min-height: 22px; padding: 0; border: 0; background: transparent;
  color: var(--muted); font-size: 11px; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b9bb3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: center; text-indent: -999px; cursor: pointer;
}
#headerSubtitle { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.search {
  width: min(420px, 40vw); min-height: 36px; padding: 0 8px 0 10px;
  border-radius: 10px; background: #101827; border-color: var(--line); gap: 8px;
}
.search-icon { color: var(--muted); display: grid; place-items: center; }
.search kbd { font-size: 11px; padding: 2px 6px; border-radius: 6px; }
.bell-button { position: relative; margin-left: 0; width: 36px; height: 36px; border-color: transparent; background: transparent; }
.bell-dot {
  position: absolute; top: 8px; right: 8px; width: 7px; height: 7px;
  background: #ef4444; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg);
}
.account-menu { position: relative; }
.top-avatar { border: 0; cursor: pointer; display: grid; place-items: center; }
.account-menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  min-width: 200px; padding: 6px; border: 1px solid var(--line); border-radius: 12px;
  background: #111a2b; box-shadow: 0 16px 40px rgba(0,0,0,.4); display: grid;
}
.account-menu-list button {
  text-align: left; border: 0; background: transparent; color: var(--text);
  min-height: 36px; padding: 0 10px; border-radius: 8px;
}
.account-menu-list button:hover { background: #1c2a44; }
.notice { display: none; }
.notice.is-visible { display: block; margin-bottom: 12px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: none; }
.ceo-row { grid-template-columns: minmax(0, 1fr) 200px; gap: 14px; margin-bottom: 22px; align-items: stretch; }
.ceo-composer { padding: 14px 14px 10px; min-width: 0; }
.composer-input { min-height: 72px; padding: 4px 2px 10px; font-size: 14px; }
.composer-actions { border-top: 0; padding-top: 4px; align-items: center; }
.tool-strip { gap: 4px; align-items: center; }
.icon-chip {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: #151e30; color: var(--text); font-size: 16px; font-weight: 600;
}
.text-tool {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 0 8px; border: 0; background: transparent;
  color: #c5d0e0; font-size: 13px; border-radius: 8px;
}
.text-tool:hover { background: rgba(255,255,255,0.04); }
.text-tool:disabled { opacity: 0.55; }
.model-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 0 8px 0 8px; border-radius: 8px;
  border: 1px solid var(--line); background: #151e30; font-size: 12px; font-weight: 600;
}
.model-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; flex: none; }
.send-button {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--blue); border: 0;
}
.ceo-summary { width: 200px; padding: 14px; }
.summary-head { display: flex; justify-content: space-between; align-items: center; }
.summary-head strong { font-size: 16px; }
.edit-outline {
  min-height: 24px; padding: 0 8px; border-radius: 7px;
  border: 1px solid var(--line); background: transparent; color: #d5deeb; font-size: 12px;
}
.summary-copy { margin: 8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.summary-list { gap: 8px; }
.summary-list div { display: flex; justify-content: space-between; align-items: center; grid-template-columns: unset; font-size: 12px; }
.summary-list dt { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.summary-list dd { margin: 0; font-weight: 600; }
.value-blue { color: #60a5fa !important; }
.value-green { color: #34d399 !important; }
.summary-status { margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.org-heading { display: none; }
.org-stage { padding: 0; border: 0; background: transparent; box-shadow: none; overflow-x: auto; }
.org-wrap { position: relative; min-width: 980px; }
.org-chart { display: grid; gap: 34px; padding: 4px 4px 8px; }
.org-level {
  display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px;
  align-items: center; justify-items: stretch;
}
.level-label { text-align: left; padding-top: 2px; }
.level-label strong {
  display: block; color: var(--blue); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; font-weight: 700;
}
.level-label span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; text-transform: none; }
.agent-row { display: flex; flex-wrap: nowrap; justify-content: center; gap: 12px; width: 100%; }
.agent-row.level-1 { justify-content: center; }
.agent-row.level-2 { justify-content: space-between; }
.agent-row.level-3 { justify-content: space-between; }
.agent-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 10px 10px 8px; position: relative; text-align: left; min-height: 0;
}
.agent-card.level-ceo {
  width: 290px; min-height: 95px; box-shadow: 0 0 0 1px rgba(59,130,246,0.45), 0 0 22px rgba(59,130,246,0.16);
}
.agent-card.level-mgmt { width: 165px; min-height: 118px; flex: 1 1 0; max-width: 180px; }
.agent-card.level-spec { width: 120px; min-height: 118px; flex: 1 1 0; max-width: 150px; }
.agent-card.is-planned { opacity: 0.75; filter: none; }
.agent-card .you-badge {
  position: static; display: inline-flex; margin-left: 6px; vertical-align: middle;
  min-height: 18px; padding: 0 7px; background: rgba(59,130,246,0.18);
  color: #93c5fd; border: 0; font-size: 10px;
}
.agent-card .plan-badge {
  position: absolute; top: 8px; right: 28px; min-height: 16px; padding: 0 6px;
  font-size: 9px; background: rgba(148,163,184,0.12); color: #cbd5e1; border: 0;
}
.agent-card h3 { margin: 0; font-size: 13px; display: inline; }
.agent-card p { margin: 4px 0 0; font-size: 11px; line-height: 1.35; color: var(--muted); }
.agent-top { gap: 8px; padding: 0; align-items: flex-start; }
.agent-icon, .role-icon {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none;
  color: #fff;
}
.role-icon svg { width: 15px; height: 15px; }
.agent-meta {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
  gap: 6px; align-items: center;
}
.model-pill {
  min-height: 18px; padding: 0 7px; font-size: 10px; background: #172033; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: #64748b; }
.card-menu { top: 4px; right: 4px; width: 22px; height: 22px; }
.placeholders { justify-content: flex-start; gap: 12px; align-items: stretch; }
.placeholder-card {
  width: auto; flex: 1; height: auto; min-height: 86px; padding: 12px;
  border-radius: var(--radius); border: 1px dashed #334155; text-align: left;
  display: grid; align-content: start; gap: 4px; background: transparent;
}
.placeholder-card strong { display: block; font-size: 13px; color: #e2e8f0; }
.placeholder-card span { font-size: 11px; color: var(--muted); }
.add-agent-btn {
  flex: none; align-self: center; min-height: 36px; padding: 0 12px;
  border-radius: 10px; border: 0; background: #1a2436; color: #e5edf7; font-weight: 600;
}
.bottom-panel { margin-top: 22px; }
.bottom-head { padding: 8px 10px 0; }
.tabs { gap: 4px; padding: 0; }
.tab { min-height: 30px; padding: 0 10px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.tab.is-active { background: #1c2a44; color: #fff; }
.expand-button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 8px; border: 0; background: transparent; color: #c5d0e0;
}
.live-pill { display: inline-flex; align-items: center; gap: 6px; }
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.live-pill.is-off { background: rgba(148,163,184,0.1); color: #9aadc2; border-color: rgba(148,163,184,0.25); }
.live-pill.is-off::before { background: #64748b; }
.empty-ceo { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-ceo .sparkle { width: 28px; height: 28px; margin: 0 auto 8px; color: #93c5fd; }
.empty-ceo strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.org-connectors { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.model-modal { background: rgb(2 8 20 / 62%); }
.model-modal-card {
  width: min(680px, 94vw); max-height: 84vh; overflow: auto;
  padding: 0; background: #111a2b !important; border-radius: 16px;
}
.model-modal-card .section-heading { padding: 16px 18px 0; }
.picker-shell { display: grid; gap: 12px; padding: 12px 18px 18px; }
.picker-search { position: relative; }
.picker-search input { padding-left: 34px; border-radius: 10px; }
.picker-search .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 10px; background: #0d1522; border: 1px solid var(--line); }
.segmented button { flex: 1 1 auto; }
.segmented button {
  flex: 1; min-height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
}
.segmented button.is-active { background: #1c2a44; color: #fff; font-weight: 600; }
.category-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.category-chips button {
  min-height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line);
  background: #0d1522; color: #c5d0e0; font-size: 12px;
}
.category-chips button.is-active { border-color: var(--blue); background: rgba(59,130,246,0.14); color: #fff; }
.model-row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; width: 100%;
  text-align: left; padding: 10px 12px; border: 1px solid transparent;
  border-radius: 12px; background: transparent; color: var(--text); margin: 0;
}
.model-row:hover { background: #151e30; }
.model-row.is-selected { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.35); }
.model-row .maker { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.model-row .meta { color: var(--muted); font-size: 11px; }
.model-row .prices { text-align: right; color: #d5deeb; font-size: 12px; }
.gratis-badge {
  display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px;
  border-radius: 999px; background: rgba(16,185,129,0.14); color: #34d399; font-size: 11px; font-weight: 700;
}
.picker-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
.picker-status { color: var(--muted); font-size: 12px; min-height: 16px; }
.hidden-picker-controls { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media (max-width: 1279px) {
  .org-stage { overflow-x: auto; }
}
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 180px minmax(0, 1fr); }
  .ceo-row { grid-template-columns: 1fr; }
  .ceo-summary { width: auto; }
}
.main { padding: 12px 18px 16px; }
.topbar { margin-bottom: 10px; }
.ceo-row { margin-bottom: 14px; }
.composer-input { min-height: 56px; }
.org-chart { gap: 22px; }
.agent-card.level-mgmt { min-height: 108px; }
.agent-card.level-spec { min-height: 108px; }
.placeholder-card { min-height: 72px; padding: 10px; }
.bottom-panel { margin-top: 14px; }
.picker-search { font-size: 0; color: transparent; }
.picker-search input { font-size: 13px; color: var(--text); }
.model-modal-card { display: flex; flex-direction: column; overflow: hidden; }
.model-modal-card .section-heading { flex: none; padding: 16px 18px 8px; }
#modelModalBody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.picker-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 12px; }
.model-groups { flex: 1; min-height: 0; overflow: auto; }
.picker-footer {
  flex: none; position: sticky; bottom: 0; margin: 0 -18px -12px;
  padding: 12px 18px; background: linear-gradient(180deg, transparent, #111a2b 28%);
}
.model-modal-card .icon-button { margin-left: 0; width: 32px; height: 32px; border: 0; }
.empty-ceo { padding: 12px 16px 18px; }
.empty-ceo strong { font-size: 15px; margin-bottom: 4px; }
.ceo-composer { padding: 10px 14px 8px; }
.org-chart { gap: 18px; }

/* Org chart: few-agent centering, menus, add-per-level */
.agent-row.level-2, .agent-row.level-3, .agent-row.level-4 { justify-content: center; }
.agent-card.level-mgmt { flex: 0 0 165px; width: 165px; max-width: 180px; }
.agent-card.level-spec, .agent-card.level-task { flex: 0 0 120px; width: 120px; max-width: 150px; }
.agent-row.level-2:has(.agent-card:nth-of-type(n+5)) { justify-content: space-between; }
.agent-row.level-2:has(.agent-card:nth-of-type(n+5)) .agent-card.level-mgmt { flex: 1 1 0; }
.agent-row.level-3:has(.agent-card:nth-of-type(n+6)) { justify-content: space-between; }
.agent-row.level-3:has(.agent-card:nth-of-type(n+6)) .agent-card.level-spec { flex: 1 1 0; }
.add-level-btn {
  flex: 0 0 auto; align-self: center; min-height: 36px; padding: 8px 12px;
  border: 1px dashed #2a3b57; border-radius: 10px; background: transparent;
  color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.add-level-btn:hover { border-color: #3b82f6; background: #12203a; }
.placeholder-empty {
  min-width: 160px; min-height: 90px; display: grid; place-content: center; gap: 4px;
  border: 1px dashed #2a3b57; border-radius: 12px; background: transparent;
  color: var(--text); text-align: center; padding: 12px;
}
.placeholder-empty strong { font-size: 13px; }
.placeholder-empty span { color: var(--muted); font-size: 11px; }
.card-menu-list button {
  border: 0; background: transparent; color: var(--text); text-align: left;
  padding: 7px 8px; border-radius: 8px; font-size: 12px; width: 100%;
}
.card-menu-list button:hover { background: #1c2a44; }
.card-menu-list { min-width: 190px; }
.agent-create-form { display: grid; gap: 12px; margin-top: 8px; }
.agent-create-form label { display: grid; gap: 6px; }
.agent-create-form input, .agent-create-form select, .agent-create-form textarea {
  width: 100%; background: #0c1422; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px;
}

/* Compact Agentes list: short rows, sticky pane, no stretched cards */
#view-agents.is-active {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 96px);
  max-height: calc(100dvh - 96px);
  min-height: 0;
  overflow: hidden;
}
#view-agents .section-heading { flex: 0 0 auto; }
.agents-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.agent-list-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.agent-list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 10px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c1422;
  color: var(--muted);
}
.agent-list-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
}
.agent-list-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.agent-list-group {
  margin: 8px 6px 4px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.agent-list-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 8px;
  align-items: center;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  width: 100%;
}
.agent-list-row:hover { background: #141e30; }
.agent-list-row.is-active { background: #1c2a44; border-color: #3b82f6; }
.agent-list-row .row-icon {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center; color: #fff; flex: none;
}
.agent-list-row .row-icon svg { width: 13px; height: 13px; }
.agent-list-row .row-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 600;
}
.level-chip {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  color: #93c5fd; background: rgba(59,130,246,0.14);
  border-radius: 999px; padding: 2px 6px; white-space: nowrap;
}
.status-dot.planned, .status-dot.not_configured, .status-dot.offline { background: #8b9bb3; }
.status-dot.configured, .status-dot.ready, .status-dot.active { background: #4fd18b; }
.status-dot.paused { background: #d8ad4a; }
#view-agents #agentEditor {
  overflow: auto;
  min-height: 0;
  padding: 16px;
}
#view-agents #agentEditor .current-model-line { margin: 0 0 4px; color: var(--muted); }
#agentModelPicker { min-height: 280px; }
#agentModelPicker .picker-shell { flex: none; min-height: 0; display: grid; gap: 10px; padding: 0; }
#agentModelPicker .model-groups {
  flex: none;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
}
@media (max-width: 1100px) {
  .agents-workspace { grid-template-columns: 1fr; }
  #view-agents.is-active { height: auto; max-height: none; overflow: visible; }
  .agent-list-pane { max-height: 280px; }
}
#agentModelPicker .model-groups { max-height: 200px; }

/* QA polish: switch, attach icon, picker height, focus, mobile nav */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: #1e3350;
  border: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  flex: 0 0 36px;
}
.toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c5d4e8;
  transition: transform 140ms ease, background 140ms ease;
}
.toggle input[type="checkbox"]:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}
.toggle input[type="checkbox"]:checked::after {
  transform: translateX(16px);
  background: #fff;
}
.toggle input[type="checkbox"]:focus-visible {
  outline: 2px solid #4d8dff;
  outline-offset: 2px;
}

.icon-sq {
  width: 32px;
  height: 32px;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111d2d;
  color: var(--text);
  flex: 0 0 32px;
}
.icon-sq svg { display: block; width: 16px; height: 16px; }

#councilQuestion:focus,
#councilQuestion:focus-visible,
.composer-input:focus,
.composer-input:focus-visible,
textarea:focus,
textarea:focus-visible,
.assistant-composer textarea:focus,
.assistant-composer textarea:focus-visible {
  outline: 2px solid #4d8dff;
  outline-offset: 0;
  border-color: #4d8dff;
  box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.22);
}

#agentModelPicker {
  min-height: 380px;
  display: flex;
  flex-direction: column;
}
#agentModelPicker .picker-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}
#agentModelPicker .model-groups {
  flex: 1 1 auto;
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
}
#agentModelPicker .picker-footer {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: 10px 0 0;
  background: linear-gradient(180deg, transparent, var(--panel) 30%);
  z-index: 1;
}
#agentEditor .current-model-line {
  font-size: 13px;
  margin: 0 0 8px;
}

.sidebar-menu {
  display: none;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111d2d;
  color: var(--text);
  place-items: center;
  flex: 0 0 36px;
}
.sidebar-backdrop { display: none; }

@media (max-width: 720px) {
  .sidebar-menu { display: grid; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    width: min(280px, 86vw);
    height: 100dvh;
    transform: translateX(-110%);
    transition: transform 180ms ease;
    box-shadow: none;
  }
  body.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow); }
  body.sidebar-open .sidebar-backdrop,
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    border: 0;
    padding: 0;
    background: rgb(0 0 0 / 45%);
  }
  body:not(.sidebar-open) .sidebar-backdrop { display: none; }
  .topbar { flex-direction: row; align-items: flex-start; gap: 10px; }
  .search kbd { display: none; }
}

.coming-soon h2 { margin: 0 0 8px; font-size: 18px; }
.coming-soon p { margin: 0; }

#view-agents #agentEditor {
  overflow: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#view-agents #agentEditor .picker-shell,
#view-agents #agentModelPicker {
  min-height: 0;
}
#view-agents #agentModelPicker {
  flex: 1 0 auto;
  min-height: 360px;
}
#view-agents #agentModelPicker .model-groups {
  min-height: 300px !important;
  height: 300px;
  max-height: 300px !important;
  overflow: auto;
}
#view-agents #agentEditor .agent-memory {
  margin-top: 16px;
}

#view-agents #agentEditor {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#view-agents #agentEditor .agent-editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.15fr);
  gap: 16px;
  align-items: start;
  flex: 0 0 auto;
}
#view-agents #agentEditor .agent-editor-model {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
#view-agents #agentEditor .agent-editor-model .current-model-line { margin: 0 0 8px; }
#view-agents #agentModelPicker {
  min-height: 0;
  height: auto;
  overflow: hidden;
}
#view-agents #agentModelPicker .picker-shell { height: auto; }
#view-agents #agentModelPicker .model-groups {
  min-height: 280px !important;
  height: 280px !important;
  max-height: 280px !important;
  overflow: auto;
}
#view-agents #agentModelPicker .picker-footer {
  position: static;
  margin: 0;
  padding: 10px 0 0;
  background: transparent;
}
#view-agents #agentMemoryMount {
  position: relative;
  z-index: 0;
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
@media (max-width: 1100px) {
  #view-agents #agentEditor .agent-editor-grid { grid-template-columns: 1fr; }
}
