:root {
  --bg: #0b0f17;
  --surface: #121826;
  --surface2: #1a2235;
  --border: #243049;
  --text: #e8edf7;
  --muted: #8b9ab8;
  --accent: #3b82f6;
  --accent2: #6366f1;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
}

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

html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
}

.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-bottom: 2rem;
}
.brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 1.3rem;
}
.brand-icon.lg { width: 56px; height: 56px; font-size: 1.6rem; margin: 0 auto 1rem; }
.brand strong { display: block; font-size: 1rem; }
.brand span { color: var(--muted); font-size: .75rem; }

nav { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
nav a {
  color: var(--muted);
  text-decoration: none;
  padding: .65rem .85rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
}
nav a:hover, nav a.active {
  background: var(--surface2);
  color: var(--text);
}

.sidebar-footer { margin-top: auto; }

.content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 1.5rem 2rem 3rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid var(--bg);
}
.content::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.view-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 2rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 1.5rem; }
.topbar p { color: var(--muted); font-size: .875rem; margin-top: .25rem; }

.status-pill {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: .5rem 1rem;
  border-radius: 999px;
  font-size: .85rem;
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.status-pill.online .dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-pill.building .dot { background: var(--warn); animation: pulse 1s infinite; }
.status-pill.error .dot { background: var(--danger); }
.status-pill.standby .dot { background: var(--muted); }
.status-pill.offline .dot { background: var(--danger); }
.status-pill.connecting .dot { background: var(--warn); animation: pulse 1s infinite; }

.brain-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem;
}
.brain-banner.hidden { display: none; }

.ok-text { color: var(--success); }
.warn-text { color: var(--danger); }
.panel-note { margin-top: .5rem; }

.btn:disabled { opacity: .45; cursor: not-allowed; }

.connection-badge {
  display: inline-block;
  padding: .4rem .85rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .85rem;
}
.connection-badge.online { background: rgba(34,197,94,.15); color: #86efac; border: 1px solid rgba(34,197,94,.35); }
.connection-badge.standby { background: rgba(148,163,184,.12); color: #cbd5e1; border: 1px solid rgba(148,163,184,.3); }
.connection-badge.connecting { background: rgba(234,179,8,.12); color: #fde68a; border: 1px solid rgba(234,179,8,.35); }
.connection-badge.offline { background: rgba(239,68,68,.12); color: #fca5a5; border: 1px solid rgba(239,68,68,.35); }

@keyframes pulse { 50% { opacity: .4; } }

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card.wide { margin-bottom: 0; }
.card.wide + .card.wide { margin-top: 0; }
.card label { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.card .value { font-size: 1.25rem; font-weight: 600; margin-top: .35rem; }
.card .value.mono { font-family: monospace; font-size: 1rem; }
.card h3 { margin-bottom: 1rem; font-size: 1rem; }

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.server-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .85rem;
  cursor: pointer;
  transition: border-color .2s;
}
.server-chip:hover { border-color: var(--accent); }
.server-chip.active { border-color: var(--success); }
.server-chip strong { display: block; font-size: .9rem; }
.server-chip span { color: var(--muted); font-size: .75rem; }

.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: .75rem; }
.rename-row .input { flex: 1; min-width: 140px; max-width: 200px; }
.rename-row { margin-top: .5rem; }
.row.between { justify-content: space-between; }
.row.tight { margin-top: 0; }
.row.actions { margin-top: 1rem; }

.form-stack { display: flex; flex-direction: column; gap: .65rem; }
.form-row { display: flex; gap: .65rem; flex-wrap: wrap; align-items: stretch; }
.form-row .input { min-width: 0; }
.form-row .btn { flex-shrink: 0; white-space: nowrap; }
.form-row .btn.primary { align-items: center; }

.input[type="file"] {
  padding: .5rem .75rem;
  cursor: pointer;
}
.input[type="file"]::file-selector-button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: .35rem .65rem;
  margin-right: .65rem;
  cursor: pointer;
  font-size: .8rem;
}

select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% + 2px), calc(100% - 11px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .65rem .85rem;
  font-size: .9rem;
  flex: 1;
  min-width: 200px;
}
.textarea { width: 100%; resize: vertical; font-family: inherit; }

.btn {
  border: none;
  border-radius: 8px;
  padding: .65rem 1.1rem;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn.sm { padding: .4rem .75rem; font-size: .8rem; }
.btn.full { width: 100%; }

.hint { color: var(--muted); font-size: .8rem; margin-top: .75rem; }
.hint code { background: var(--surface2); padding: .1rem .35rem; border-radius: 4px; }

.view { display: none; }
.view.active { display: block; }

.log-box {
  background: #060a10;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  height: 420px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  line-height: 1.6;
}
.log-line { margin-bottom: .15rem; }
.log-line .ts { color: var(--muted); }
.log-line.INFO .lvl { color: var(--accent); }
.log-line.WARN .lvl { color: var(--warn); }
.log-line.ERROR .lvl { color: var(--danger); }

.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: .85rem 1.25rem;
  border-radius: 10px;
  transform: translateY(120%);
  transition: transform .3s;
  z-index: 99;
}
.toast.show { transform: translateY(0); }

.login-page {
  display: grid; place-items: center;
  background: radial-gradient(ellipse at top, #141c2e, var(--bg));
}
.login-card {
  width: min(400px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.login-card label { display: block; color: var(--muted); font-size: .8rem; margin: .75rem 0 .35rem; }
.brand-center { text-align: center; margin-bottom: 1.5rem; }
.brand-center h1 { font-size: 1.4rem; }
.brand-center p { color: var(--muted); font-size: .85rem; }
.error { color: var(--danger); font-size: .85rem; margin-top: .75rem; text-align: center; }

.operators-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.operators-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem .75rem; border: 1px solid var(--border); border-radius: 8px; margin-bottom: .5rem;
}
.operators-list .muted { color: var(--muted); border: none; padding: .25rem 0; }

.grid.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.build-section { margin: 1.25rem 0 0; }
.build-section:first-of-type { margin-top: .5rem; }
.field-label { display: block; color: var(--muted); font-size: .8rem; margin-bottom: .5rem; font-weight: 500; }
.coord { width: 100px; flex: 0 0 100px; min-width: 80px; }
.coord-group { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.coord-group .coord { flex: 1 1 80px; width: auto; }

.schem-library {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  min-height: 120px;
  max-height: min(420px, 50vh);
  overflow-y: auto;
  padding-right: .25rem;
}
.schem-library .muted { color: var(--muted); font-size: .85rem; padding: .5rem 0; }

.schem-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.schem-item > div:first-child { min-width: 0; flex: 1; }
.schem-item strong { display: block; word-break: break-word; }
.schem-item span { color: var(--muted); font-size: .78rem; display: block; margin-top: .2rem; }
.schem-item .actions { display: flex; gap: .35rem; flex-shrink: 0; flex-wrap: wrap; }

.design-preview {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .78rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(280px, 35vh);
  overflow: auto;
}
.design-preview.hidden { display: none; }
.vision-status { margin: .75rem 0; font-size: .85rem; line-height: 1.5; }
.vision-status.ok { color: var(--success); }
.vision-status.warn { color: var(--warn); }

.build-card h3 { margin-bottom: .35rem; }
.build-card > .hint:first-of-type { margin-top: 0; margin-bottom: .5rem; }

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
  border: none;
}

/* Guía y comandos */
.guide-hero {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(99, 102, 241, 0.08));
  border-color: rgba(59, 130, 246, 0.35);
}
.guide-formula {
  font-size: 1.05rem;
  font-weight: 600;
  margin: .5rem 0;
  color: var(--accent);
}
.guide-search {
  max-width: 320px;
  min-width: 200px;
}
.guide-categories {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.guide-category {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface2);
}
.guide-category h4 {
  font-size: 1rem;
  margin-bottom: .35rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.guide-category > p {
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: .75rem;
}
.guide-examples {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.guide-example {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .55rem .75rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.guide-example code {
  font-size: .8rem;
  color: #93c5fd;
  word-break: break-word;
}
.guide-example span {
  font-size: .75rem;
  color: var(--muted);
}
.guide-example .copy-btn {
  align-self: flex-start;
  margin-top: .25rem;
}
.guide-tip-card {
  padding: 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.guide-tip-card h4 {
  margin-bottom: .5rem;
  font-size: .95rem;
}
.guide-tip-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.guide-tip-card li {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.45;
}
.guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.guide-list li {
  padding: .5rem .65rem;
  background: var(--surface2);
  border-radius: 8px;
  font-size: .85rem;
  line-height: 1.4;
}
.guide-list.compact li {
  padding: .4rem .55rem;
  font-size: .8rem;
}
.guide-list strong {
  color: var(--text);
}
.guide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.guide-tag {
  font-size: .75rem;
  padding: .35rem .55rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
}
.guide-tag strong {
  color: var(--text);
  display: block;
  font-size: .8rem;
}
.guide-hidden { display: none !important; }

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.fleet-card {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
.fleet-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.fleet-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fleet-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.fleet-card-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.fleet-card-desc { font-size: .8rem; color: var(--muted); margin: 0; line-height: 1.4; }
.fleet-pill { font-size: .72rem; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; font-weight: 600; }
.fleet-pill.online { background: rgba(34,197,94,.15); color: #4ade80; }
.fleet-pill.building { background: rgba(251,146,60,.15); color: #fb923c; }
.fleet-pill.offline { background: rgba(148,163,184,.12); color: #94a3b8; }
.fleet-pill.standby { background: rgba(56,189,248,.12); color: #38bdf8; }
.fleet-pill.undeployed { background: rgba(148,163,184,.15); color: #94a3b8; }
.fleet-card.undeployed { opacity: .85; border-style: dashed; }
.deploy-note { color: #94a3b8; font-size: .75rem; display: block; margin-top: 4px; }

.asst-stats { margin-bottom: 0; }
.asst-panels { align-items: start; }
.assistants-table-wrap { overflow-x: auto; }
.assistants-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.assistants-table th { text-align: left; padding: 10px 8px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.assistants-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.assistants-table tr.selected { background: rgba(59,130,246,.08); }
.assistants-table .sm { font-size: .78rem; }
.rank-pill { background: rgba(59,130,246,.15); color: #60a5fa; padding: 2px 8px; border-radius: 6px; font-size: .75rem; text-transform: uppercase; }
.assistant-detail-panel { padding: 4px 0; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.detail-grid label { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; margin-bottom: 2px; }
.conv-preview { max-height: 220px; overflow-y: auto; background: var(--surface-2); border-radius: 8px; padding: 8px; }
.conv-line { font-size: .82rem; padding: 4px 0; border-bottom: 1px solid var(--border); }
.conv-line .ts { color: var(--muted); margin-right: 6px; }
.conv-line.in .dir { color: #60a5fa; }
.conv-line.out .dir { color: #4ade80; }
.error-text { color: #f87171; }
.fleet-queue { font-size: .75rem; color: var(--muted); }
.bot-select { max-width: 320px; }
.field-label { display: block; font-size: .8rem; color: var(--muted); margin: 8px 0 4px; }
.field-label.inline { display: inline; margin-right: 8px; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.tag-mature { font-size: .7rem; color: #fb923c; }
.flex-grow { flex: 1; min-width: 160px; }
.guide-fleet { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.guide-fleet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 10px 0; }
.guide-fleet-card { background: var(--surface-2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.guide-fleet-card em { color: var(--muted); font-style: normal; font-size: .78rem; }

.asst-system-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 12px 0 8px; }
.asst-sys-item label { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.asst-sys-item span { font-size: .92rem; font-weight: 600; }
.asst-sys-hint { margin-top: 0; }
.warn-text { color: #fb923c; }
.memory-box { background: var(--surface-2); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.lives-pill { color: #f87171; font-weight: 600; }
.memory-list { margin: 0; padding-left: 18px; font-size: .88rem; line-height: 1.6; }
.asst-help-details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.asst-row.selected { background: rgba(59,130,246,.1); }
.asst-row:hover { background: rgba(255,255,255,.03); }

.asst-guide-list { margin: 10px 0 8px 20px; line-height: 1.7; font-size: .9rem; }
.asst-guide-list code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }
.asst-actions { margin: 12px 0; gap: 8px; }
.asst-howto { margin-top: 0; }
.asst-progress-block { margin: 16px 0; padding: 12px; background: var(--surface-2); border-radius: 10px; }
.asst-progress-block h4 { margin: 0 0 10px; font-size: .9rem; }
.prog-bars { display: flex; flex-direction: column; gap: 8px; }
.prog-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; font-size: .82rem; }
.prog-bar { height: 8px; background: rgba(148,163,184,.15); border-radius: 4px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 4px; transition: width .3s ease; }
.prog-fill.bond { background: linear-gradient(90deg, #a78bfa, #c084fc); }
.prog-fill.skill { background: linear-gradient(90deg, #38bdf8, #60a5fa); }
.asst-settings-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }

/* Ayudantes — layout mejorado */
.asst-main-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr);
  gap: 1rem;
  align-items: start;
}
.asst-col-list, .asst-col-detail { min-width: 0; }
.card-head-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.asst-list-card { margin-bottom: 0; }
.asst-grant-details summary { cursor: pointer; font-weight: 600; padding: 4px 0 8px; }
.asst-grant-form { margin-top: 12px; }
.asst-detail-card { position: sticky; top: 0; max-height: calc(100vh - 120px); overflow-y: auto; }
.asst-detail-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.asst-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.asst-section h4, .asst-subhead { margin: 0 0 10px; font-size: .88rem; color: var(--text); }
.asst-subhead { margin-top: 14px; }
.asst-section.span-full { grid-column: 1 / -1; }
.detail-grid.compact { margin-bottom: 10px; gap: 10px; }
.detail-item { min-width: 0; }
.detail-item label { display: block; font-size: .68rem; color: var(--muted); text-transform: uppercase; margin-bottom: 3px; }
.break-all, .cell-code, .cell-name { word-break: break-word; overflow-wrap: anywhere; }
.assistants-table th, .assistants-table td { white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.assistants-table td.cell-name { white-space: normal; max-width: 120px; }
.assistants-table td:first-child { max-width: 110px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-field { min-width: 0; }
.form-field .input, .form-field select { width: 100%; }
.input-row { display: flex; gap: 8px; flex-wrap: wrap; }
.input-row .input { flex: 1; min-width: 120px; }
.asst-checks { display: flex; flex-direction: column; gap: 8px; }
.asst-action-grid, .asst-product-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.asst-product-btn { white-space: normal; text-align: left; max-width: 100%; line-height: 1.35; }
.asst-memory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}
.asst-alert {
  background: rgba(251, 146, 60, .12);
  border: 1px solid rgba(251, 146, 60, .35);
  color: #fdba74;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: .88rem;
  word-break: break-word;
}
.conv-preview { max-height: 200px; overflow-y: auto; overflow-x: hidden; word-break: break-word; }

@media (max-width: 1100px) {
  .asst-main-grid { grid-template-columns: 1fr; }
  .asst-detail-card { position: static; max-height: none; }
  .asst-detail-layout { grid-template-columns: 1fr; }
  .asst-memory-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .grid.two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }
  nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 1rem 1rem 2.5rem; }
  .coord { flex: 1 1 calc(33% - .5rem); width: auto; }
  .form-row .input { flex: 1 1 100%; }
  .form-row .btn { width: 100%; }
}

/* PlayNic Bridge */
.bridge-server-list { display: flex; flex-direction: column; gap: .75rem; }
.bridge-server-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface2);
}
.bridge-server-card.connected { border-color: var(--success); }
.bridge-server-card.offline { opacity: .85; }
.bridge-server-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  flex-wrap: wrap;
}
.bridge-badge {
  font-size: .75rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-weight: 600;
}
.bridge-badge.on { background: rgba(34,197,94,.15); color: var(--success); }
.bridge-badge.off { background: rgba(139,154,184,.15); color: var(--muted); }
.bridge-meta { font-size: .85rem; color: var(--muted); margin-top: .35rem; }
.bridge-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.bridge-token-box {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  padding: .75rem;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.bridge-token-box code { word-break: break-all; flex: 1; }
.bridge-snippet {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  font-size: .8rem;
  line-height: 1.5;
  max-height: 280px;
  white-space: pre-wrap;
}
