:root {
  color-scheme: dark;
  --bg: #111214;
  --surface: #17191c;
  --surface-2: #1d2024;
  --surface-3: #25292e;
  --border: #2b2e33;
  --border-strong: #42484f;
  --text: #e2e5e9;
  --muted: #a2a8b0;
  --muted-2: #939ba5;
  --accent: #bdccc5;
  --accent-ink: #151c19;
  --ok: #9fbcaa;
  --warn: #c9b58a;
  --danger: #d29b9b;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 var(--sans); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; transition: background .12s, border-color .12s; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select { color: var(--text); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 15px; font-weight: 600; }
h2 { font-size: 14px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); font-size: 12px; }
.eyebrow { font-size: 10px; color: var(--muted-2); }
.app-shell { display: grid; grid-template-columns: 230px minmax(0,1fr); height: 100dvh; overflow: hidden; }
.sidebar { min-height: 0; display: flex; flex-direction: column; padding: 20px 12px 12px; background: #0e0f11; border-right: 1px solid var(--border); }
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 0 10px 24px; }
.brand-mark { display: flex; align-items: center; font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--border-strong); border-radius: 6px; padding: 5px; }
.brand-copy strong { font-size: 15px; font-weight: 600; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 7px; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--muted); }
.icon-button:hover { color: var(--text); background: var(--surface-2); }
.icon-button.tiny { width: 26px; height: 26px; padding: 5px; }
.sidebar-close, .menu-button { display: none; }
.new-chat-button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; color: var(--text); }
.new-chat-button:hover { background: var(--surface-2); }
.tabs { display: grid; gap: 3px; margin: 20px 0; }
.tab { display: flex; align-items: center; gap: 11px; padding: 8px 12px; background: transparent; border: 1px solid transparent; border-radius: 6px; text-align: left; color: var(--muted); font-size: 12px; }
.tab:hover { background: var(--surface); }
.tab.active { background: var(--surface-2); color: var(--text); }
.conversation-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sidebar-label-row { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 6px; }
.sidebar-label { color: var(--muted-2); font-size: 10px; letter-spacing: .035em; }
.conversation-list { overflow-y: auto; display: grid; align-content: start; gap: 2px; }
.conversation-item { display: grid; gap: 2px; padding: 8px 11px; background: transparent; border: 1px solid transparent; border-radius: 5px; text-align: left; color: var(--muted); }
.conversation-item.active { background: var(--surface); color: var(--text); }
.conversation-item:hover { background: var(--surface-2); }
.conversation-item strong { font-size: 11px; font-weight: 500; }
.conversation-item small { font-size: 10px; color: var(--muted-2); }
.sidebar-empty { padding: 10px; font-size: 12px; color: var(--muted); }
.sidebar-footer { padding-top: 16px; }
.runtime-card { padding: 12px 10px 0; border-top: 1px solid var(--border); }
.connection { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.dot, .run-status-dot { width: 5px; height: 5px; background: var(--muted); border-radius: 50%; }
.connection.online .dot { background: var(--ok); }
.connection.offline .dot { background: var(--danger); }
.runtime-line { display: none; }
.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 12px 26px; border-bottom: 1px solid var(--border); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.mind-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 26px; border-bottom: 1px solid var(--border); background: #0e1012; flex-shrink: 0; }
.mind-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 7px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); background: var(--surface); font: 9px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mind-model { max-width: 300px; }
.mind-chip strong { color: var(--text); font-weight: 500; }
.mind-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px #26312b; }
.run-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.run-status-dot { background: var(--ok); }
.run-status[data-state="error"] .run-status-dot { background: var(--danger); }
.content { flex: 1; min-height: 0; overflow: auto; }
#panel-chat, #panel-memory { height: 100%; }
.chat-workspace { height: 100%; display: flex; flex-direction: column; }
.chat-main { display: flex; flex: 1; flex-direction: column; min-height: 0; min-width: 0; padding: 0 28px 18px; }
.message-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 25px; padding: 28px max(0px,calc((100% - 760px)/2)); scrollbar-width: thin; }
.empty-state { margin: auto 0; padding: 25px 0; color: var(--muted); text-align: center; }
.empty-state h2 { font-size: 20px; font-weight: 500; color: var(--text); }
.message { flex-shrink: 0; min-width: 0; max-width: 92%; }
.message.user { align-self: flex-end; padding: 10px 14px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; }
.message.assistant { width: 100%; max-width: 100%; padding: 0; }
.message.system-event { align-self: center; color: var(--muted); font-size: 12px; }
.message-role { display: block; font: 500 10px var(--mono); color: var(--muted); margin-bottom: 6px; }
.message-body { overflow-wrap: anywhere; font-size: 14px; line-height: 1.8; }
.message-body a { color: #b3c9e8; text-decoration: underline; text-underline-offset: 3px; }
.message.user .message-body { white-space: pre-wrap; }
.message-body > * + * { margin-top: 9px; }
.message-body ul, .message-body ol { padding-left: 22px; }
.message-body h1, .message-body h2 { font-size: 17px; margin-top: 16px; }
.message-body code { font: 12px var(--mono); border-radius: 4px; background: var(--surface-3); padding: 2px 4px; }
.message-body pre { position: relative; background: #0e1012; border: 1px solid var(--border); border-radius: 7px; margin: 12px 0; overflow-x: auto; }
.message-body pre code { display: block; background: transparent; padding: 36px 14px 14px; white-space: pre; line-height: 1.65; }
.copy-code { position: absolute; right: 8px; top: 7px; font-size: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 2px 6px; border-radius: 4px; }
.message-meta { margin-top: 8px; font: 9px var(--mono); color: var(--muted-2); }
.message-cognition { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 5px; margin-top: 9px; }
.cognition-tag { background: var(--surface); font-size: 9px; letter-spacing: .01em; }
.cognition-tag.ok { border-color: #3b4d43; color: var(--ok); }
.cognition-tag.warn { border-color: #4d4636; color: var(--warn); }
.cognition-tag.bad { border-color: #4d3939; color: var(--danger); }
.cognition-memories { display: inline-block; }
.cognition-memories > summary { list-style: none; cursor: pointer; }
.cognition-memories > summary::-webkit-details-marker { display: none; }
.cognition-memories[open] { flex-basis: 100%; }
.cognition-memory-list, .cognition-plan-list { display: grid; gap: 5px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.cognition-plan-list { padding-left: 18px; list-style: decimal; }
.cognition-memory { border-left: 1px solid var(--border-strong); padding: 3px 0 3px 9px; }
.cognition-memory-meta { display: block; color: var(--muted-2); font: 9px var(--mono); }
.cognition-memory-text { display: block; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.composer { width: 100%; max-width: 760px; margin: 12px auto 0; padding: 10px 12px 8px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); flex-shrink: 0; }
.composer:focus-within { border-color: #7c8982; }
.composer-main { display: flex; align-items: flex-end; gap: 10px; }
.composer textarea { width: 100%; min-height: 38px; max-height: 180px; resize: none; background: transparent; border: 0; color: var(--text); padding: 7px 0; outline: none; line-height: 1.6; }
.composer textarea::placeholder { color: var(--muted-2); }
.send-button { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--accent); color: var(--accent-ink); margin-bottom: 3px; }
.composer-meta { margin-top: 7px; font-size: 9px; color: var(--muted-2); }
.button { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 10px; font-size: 12px; }
.button:hover { background: var(--surface-3); }
.button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.button.small { padding: 4px 8px; font-size: 11px; }
.link-button { background: transparent; border: 0; color: var(--muted); padding: 3px 0; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--text); }
.activity-column { flex-shrink: 0; max-height: 28%; overflow-y: auto; padding: 9px 28px; border-top: 1px solid var(--border); font-size: 11px; }
.activity-column > summary { cursor: pointer; color: var(--muted); }
.activity-column:has(.activity-region[hidden]):has(.recent-actions[hidden]) { display: none; }
.activity-region, .recent-actions { margin: 12px 0; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.rail-head h2 { font-size: 12px; }
.rail-head .eyebrow, .rail-note { display: none; }
.activity-list { padding-left: 20px; margin: 0; color: var(--muted); font-size: 11px; }
.activity-list li + li { margin-top: 4px; }
.pending-region { width: 100%; max-width: 760px; max-height: 45%; flex-shrink: 0; overflow-y: auto; margin: 12px auto 0; border: 1px solid #605744; border-radius: 8px; padding: 14px; background: var(--surface); }
.pending-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pending-head .eyebrow { display: none; }
.attention-mark { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.approval-card + .approval-card { border-top: 1px solid var(--border); margin-top: 15px; padding-top: 15px; }
.approval-title { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.risk { font: 10px var(--mono); color: var(--warn); }
.approval-grid { display: grid; grid-template-columns: 75px minmax(0,1fr); gap: 6px 12px; font-size: 12px; }
.approval-grid dt { color: var(--muted); }
.approval-grid dd { margin: 0; overflow-wrap: anywhere; }
.diff { background: #0e1012; border: 1px solid var(--border); border-radius: 5px; padding: 10px; max-height: 220px; overflow: auto; font: 11px/1.7 var(--mono); white-space: pre; }
.diff .added { color: var(--ok); }
.diff .removed { color: var(--danger); }
.approval-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.action-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.action-label { min-width: 0; overflow-wrap: anywhere; }
.action-meta { font-size: 10px; color: var(--muted); }
.action-result { margin-top: 6px; font-size: 11px; }
.action-result summary { cursor: pointer; }
.tag { display: inline-block; padding: 1px 5px; border: 1px solid var(--border-strong); border-radius: 4px; font: 9px/1.6 var(--mono); color: var(--muted); }
.tag.ok { color: var(--ok); }
.tag.warn { color: var(--warn); }
.tag.bad { color: var(--danger); }
.memory-space { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.memory-toolbar { display: flex; align-items: center; gap: 10px; padding: 20px 24px 14px; flex-wrap: wrap; }
.memory-search { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 8px; padding: 0 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.memory-search svg { width: 15px; height: 15px; color: var(--muted); }
.memory-search input { width: 100%; min-width: 0; border: 0; background: transparent; padding: 7px 0; font-size: 12px; }
.memory-search:focus-within { outline: 1px solid var(--accent); }
.memory-search input:focus-visible { outline: none; }
select { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 7px; font-size: 11px; max-width: 150px; }
.memory-viewbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px 14px; border-bottom: 1px solid var(--border); }
.view-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; }
.view-switch button { background: transparent; border: 0; border-radius: 4px; color: var(--muted); padding: 3px 12px; font-size: 11px; }
.view-switch button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.memory-count { color: var(--muted-2); font-size: 11px; }
.memory-layout { flex: 1; min-height: 0; display: flex; position: relative; }
.memory-results { flex: 1; min-width: 0; min-height: 0; }
.memory-list { height: 100%; overflow-y: auto; }
.memory-row { display: block; width: 100%; padding: 16px 24px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--border); border-left: 2px solid transparent; }
.memory-row:hover { background: var(--surface); }
.memory-row[aria-current="true"] { border-left-color: var(--accent); background: var(--surface); }
.memory-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 9px; }
.memory-type { font: 10px var(--mono); letter-spacing: .025em; color: var(--muted); }
.memory-type[data-type="SEMANTIC"] { color: #a7c2b3; }
.memory-type[data-type="EPISODIC"] { color: #b9b1ca; }
.memory-type[data-type="PROCEDURAL"] { color: #b4c0d0; }
.memory-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; margin-bottom: 7px; }
.memory-metrics, .memory-meta { display: block; color: var(--muted); font-size: 11px; }
.memory-meta { color: var(--muted-2); margin-top: 3px; }
.memory-empty { padding: 45px 24px; }
.memory-empty h2 { margin-bottom: 8px; }
.memory-empty p { font-size: 12px; color: var(--muted); }
.memory-inspector { flex-shrink: 0; width: 360px; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; outline: none; }
.inspector-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.inspector-head h2 { font-size: 12px; }
.inspector-body { flex: 1; overflow: auto; padding: 20px; }
.inspector-memory-title { font-size: 16px; line-height: 1.65; margin-bottom: 16px; overflow-wrap: anywhere; }
.detail-section { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 16px; }
.detail-section h3 { margin-bottom: 10px; }
.detail-grid { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 7px 10px; font-size: 11px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; }
.detail-content { white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.7 var(--mono); background: var(--bg); border: 1px solid var(--border); padding: 10px; border-radius: 5px; max-height: 240px; overflow: auto; }
.memory-procedure { padding-left: 18px; color: var(--muted); font-size: 12px; }
.relationship-link { display: block; background: transparent; border: 0; padding: 6px 0; font: 11px var(--mono); color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.evidence-card { padding: 10px 0; border-bottom: 1px solid var(--border); }
.evidence-card header { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; font-size: 11px; overflow-wrap: anywhere; }
.evidence-preview { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 140px; overflow: auto; margin-top: 8px; font: 10px/1.7 var(--mono); }
.chain { padding-left: 17px; font-size: 12px; color: var(--muted); }
.chain li + li { margin-top: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.graph-region { display: flex; flex-direction: column; height: 100%; }
.graph-controls { flex-wrap: wrap; display: flex; gap: 5px; padding: 10px 18px; }
.memory-viewport { flex: 1; min-height: 0; overflow: auto; background: var(--bg); cursor: grab; }
#memory-stage { position: relative; min-width: 100%; min-height: 100%; }
.memory-map { position: relative; transform-origin: 0 0; min-width: 100%; }
.memory-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.memory-wires path { fill: none; stroke: #4b535c; stroke-width: 1; }
.memory-wires text { font: 8px var(--mono); fill: var(--muted); stroke: var(--bg); stroke-width: 4; paint-order: stroke; text-anchor: middle; }
.graph-node { position: absolute; width: 210px; min-height: 108px; max-height: 130px; overflow: hidden; display: grid; align-content: start; gap: 6px; padding: 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); text-align: left; touch-action: none; cursor: grab; }
.graph-node.selected { border-color: var(--accent); }
.graph-node:hover { background: var(--surface-2); }
.graph-node strong { font-size: 12px; line-height: 1.7; font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.graph-empty { padding: 30px; font-size: 12px; color: var(--muted); }
.map-hint { padding: 8px 15px; color: var(--muted-2); font-size: 10px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 40; max-width: 90vw; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-3); color: var(--text); font-size: 12px; }
@media (max-width: 1050px) {
  .memory-inspector { position: fixed; top: 0; right: 0; bottom: 0; z-index: 25; width: min(420px,95vw); border-left: 1px solid var(--border-strong); }
  .inspector-scrim { position: fixed; inset: 0; background: #0008; z-index: 24; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px,85vw); z-index: 15; transform: translateX(-100%); visibility: hidden; transition: transform .15s; }
  .sidebar.open { transform: translateX(0); visibility: visible; }
  .sidebar-close, .menu-button { display: inline-flex; }
  .sidebar-close { margin-left: auto; }
  .sidebar-scrim { position: fixed; inset: 0; background: #0008; z-index: 14; }
  .topbar { min-height: 58px; padding: 10px 14px; }
  .chat-main { padding: 0 16px 14px; }
  .message-list { padding: 22px 0; gap: 22px; }
  .mind-strip { padding: 7px 16px; }
  .mind-chip { font-size: 8px; }
  .empty-state h2 { font-size: 17px; }
  .memory-toolbar { padding: 14px 16px 10px; gap: 7px; }
  .memory-search { flex-basis: 100%; }
  select { max-width: 108px; font-size: 10px; padding: 6px; }
  .memory-viewbar { padding: 0 16px 12px; }
  .memory-row { padding: 15px 16px; }
  .activity-column { padding: 8px 16px; }
  .approval-grid { grid-template-columns: 60px minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

.graph-meta { color: var(--muted); font-size: 9px; }
.graph-controls select { max-width: min(260px,45vw); }

/* Mind view: bounded heartbeat, inner voice, goals, and held-out safety. */
#panel-chat, #panel-memory, #panel-mind { height: 100%; }
.mind-space { height: 100%; overflow-y: auto; padding: 24px 28px 44px; }
.mind-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.mind-head h2 { font-size: 20px; font-weight: 500; margin-top: 4px; }
.mind-subtitle { max-width: 760px; color: var(--muted); font-size: 12px; margin-top: 6px; }
.mind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mind-card { min-width: 0; padding: 15px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.mind-card-wide { grid-column: 1 / -1; }
.mind-card h3 { margin: 4px 0 12px; }
.mind-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mind-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 18px; margin: 0; font-size: 12px; }
.mind-kv dt { color: var(--muted); }
.mind-kv dd { margin: 0; color: var(--text); font: 11px var(--mono); text-align: right; overflow-wrap: anywhere; }
.mind-note { color: var(--muted-2); font-size: 11px; margin: -4px 0 8px; }
.thought-list, .goal-list { display: grid; gap: 8px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.thought-item { padding: 9px 10px; background: var(--surface-2); border-left: 2px solid var(--border-strong); border-radius: 0 5px 5px 0; }
.thought-item.overt { border-left-color: var(--warn); }
.thought-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; color: var(--muted-2); font: 10px var(--mono); }
.thought-text { color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.thought-score { color: var(--muted); }
.goal-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.goal-item:last-child { border-bottom: 0; }
.goal-title { min-width: 0; }
.goal-title strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.goal-meta { color: var(--muted-2); font: 10px var(--mono); margin-top: 3px; }
.mind-empty { padding: 8px 0; color: var(--muted); font-size: 12px; }
.transfer-ok { color: var(--ok); }
.transfer-bad { color: var(--danger); }
.transfer-bar { height: 6px; margin: 10px 0; overflow: hidden; background: var(--surface-3); border-radius: 3px; }
.transfer-fill { height: 100%; background: var(--ok); }
@media (max-width: 760px) {
  .mind-space { padding: 16px; }
  .mind-grid { grid-template-columns: minmax(0, 1fr); }
  .mind-card-wide { grid-column: auto; }
  .mind-head { gap: 10px; }
  .mind-head h2 { font-size: 17px; }
}

/* Mind controls: live threshold and goal injection. */
.mind-controls { display: grid; gap: 7px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border); }
.mind-controls label { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.mind-controls output { color: var(--text); font: 11px var(--mono); }
.mind-controls input[type="range"] { width: 100%; accent-color: var(--accent); }
.mind-form { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.mind-form input { flex: 1; min-width: 0; padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; font-size: 12px; }
.mind-form input:focus-within { outline: 1px solid var(--accent); }
.mind-form select { max-width: 82px; padding: 6px; }

/* Covert dialogue controls. */
.mind-form input[type="range"] { flex: 0 0 88px; width: 88px; accent-color: var(--accent); }
.mind-form output { color: var(--text); font: 10px var(--mono); min-width: 34px; text-align: right; }

/* Mind probe helpers. */
.probe-check { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.probe-check input { accent-color: var(--accent); }
.probe-grid { display: grid; gap: 8px; margin-top: 10px; }
.probe-line { padding: 8px 10px; background: var(--surface-2); border-left: 2px solid var(--border-strong); border-radius: 0 5px 5px 0; font-size: 12px; }
.probe-line strong { color: var(--muted); font: 10px var(--mono); display: block; margin-bottom: 3px; }
.probe-bad { border-left-color: var(--danger); }
.probe-good { border-left-color: var(--ok); }

/* ===== Friendly UI: calm, minimal, for everyday people ===== */
:root {
  --bg: #0d0d0e;
  --surface: #161617;
  --surface-2: #1f1f21;
  --surface-3: #2a2a2d;
  --border: #242426;
  --border-strong: #34343a;
  --text: #ececee;
  --muted: #a1a1a8;
  --muted-2: #8a8a92;
  --accent: #f1f1f3;
  --accent-ink: #0d0d0e;
}
body { font-size: 15px; }
.sidebar { background: #0a0a0b; padding: 16px 10px 10px; }
.sidebar-head { padding: 4px 12px 14px; }
.brand-copy strong { font-size: 18px; letter-spacing: -.01em; }
.new-chat-button { background: var(--surface-2); border-color: transparent; font-size: 14px; padding: 10px 12px; border-radius: 10px; }
.new-chat-button:hover { background: var(--surface-3); }
.tabs { margin: 10px 0 14px; }
.tab { font-size: 14px; padding: 9px 12px; border-radius: 10px; }
.tab[aria-selected="true"] { background: var(--surface-2); }
.tab-quiet { order: 9; }
.sidebar-label { font-size: 12px; letter-spacing: 0; padding-top: 4px; }
#refresh-conversations, .runtime-card { display: none; }
.sidebar-footer { padding-top: 0; }
.conversation-item { padding: 9px 12px; border-radius: 10px; }
.conversation-item strong { font-size: 14px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar { border-bottom: 0; min-height: 56px; }
.topbar h1 { font-size: 15px; font-weight: 500; color: var(--muted); }
.run-status[data-state="idle"] { visibility: hidden; }
.run-status { font-size: 13px; }

/* Chat: plain answers, soft user bubbles, centered composer */
.chat-main { padding: 0 20px 22px; }
.message-list { gap: 22px; padding: 12px max(0px,calc((100% - 760px)/2)) 24px; }
.message.user { background: var(--surface-2); border: 0; border-radius: 20px; padding: 11px 18px; max-width: 78%; }
.message-body { font-size: 15.5px; line-height: 1.75; }
.composer { max-width: 760px; margin-top: 4px; padding: 8px 10px 8px 18px; border: 0; border-radius: 28px; background: var(--surface-2); }
.composer:focus-within { box-shadow: 0 0 0 1px var(--border-strong); }
.composer textarea { font-size: 16px; padding: 10px 0; }
.send-button { width: 38px; height: 38px; border: 0; border-radius: 50%; margin-bottom: 0; }
.composer-meta { display: none; }
.empty-state { margin: 0; padding: 0; }
.empty-state h2 { font-size: 30px; font-weight: 500; letter-spacing: -.02em; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.suggestion { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); border-radius: 999px; padding: 9px 16px; font-size: 14px; }
.suggestion:hover { background: var(--surface-2); color: var(--text); }
/* Empty chat: greeting and prompt sit together in the middle of the screen */
#panel-chat.is-empty .chat-main { justify-content: center; }
#panel-chat.is-empty .message-list { flex: 0 0 auto; padding-bottom: 28px; overflow: visible; }
#panel-chat.is-empty .composer { margin-top: 0; }

/* Thinking indicator */
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: pulse 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* Trust chips and reply actions */
.trust-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.trust-row:empty { display: none; }
.trust-chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.trust-chip.ok { color: #9ed3b0; background: #15251b; }
.trust-chip.warn { color: #e0c58d; background: #2a2314; }
.trust-chip.bad { color: #e5a1a1; background: #2c1a1a; }
.trust-chip.info { color: #a9c2ea; background: #17202f; }
.how-details { margin-top: 8px; font-size: 13px; }
.how-details > summary { cursor: pointer; color: var(--muted-2); list-style: none; width: fit-content; }
.how-details > summary:hover { color: var(--text); }
.how-details > summary::-webkit-details-marker { display: none; }
.how-details[open] > summary { margin-bottom: 8px; }
.reply-actions { display: flex; gap: 4px; margin-top: 6px; opacity: 0; transition: opacity .12s; }
.message.assistant:hover .reply-actions, .reply-actions:focus-within { opacity: 1; }
.reply-action { background: transparent; border: 0; color: var(--muted-2); font-size: 13px; padding: 4px 8px; border-radius: 6px; }
.reply-action:hover { background: var(--surface-2); color: var(--text); }
@media (hover: none) { .reply-actions { opacity: 1; } }
.cognition-tag { font-size: 11px; }

/* Behind the scenes stays out of sight until asked for */
body:not(.show-details) .activity-column { display: none; }
body.show-details .activity-column { max-height: 36%; padding: 12px 28px; font-size: 13px; }
#details-toggle[aria-pressed="true"] { color: var(--text); background: var(--surface-2); }

/* Permission requests in plain words */
.pending-region { border-color: #4a4230; border-radius: 16px; background: var(--surface); }
.pending-head h2 { font-size: 15px; font-weight: 500; }
.approval-title strong { font-weight: 500; font-size: 15px; }
.approval-reason { color: var(--muted); margin-top: 6px; font-size: 14px; }
.approval-actions .button { padding: 8px 16px; font-size: 14px; border-radius: 999px; }

/* Memory in plain language */
.friendly-head { padding: 28px 28px 6px; max-width: 760px; margin: 0 auto; }
.friendly-head h2 { font-size: 24px; font-weight: 500; }
.friendly-head p { color: var(--muted); margin-top: 6px; }
#memory-type, #memory-sort, #memory-active, label:has(#memory-type), label:has(#memory-sort), label:has(#memory-active), #refresh-memory, .view-switch { display: none; }
.memory-toolbar { max-width: 760px; margin: 0 auto; width: 100%; }
.memory-search { flex: 1; }
.memory-row { display: flex; align-items: center; gap: 12px; padding: 0 24px 0 0; max-width: 760px; margin: 0 auto; }
.memory-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; background: transparent; border: 0; padding: 14px 24px; }
.memory-row-main .memory-title { font-weight: 500; font-size: 15px; }
.memory-row-main .memory-meta { color: var(--muted-2); font-size: 13px; }
.forget-button { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); border-radius: 999px; padding: 5px 14px; font-size: 13px; }
.forget-button:hover { color: #e5a1a1; border-color: #5a3a3a; }
.inspector-body .forget-button { margin: 4px 0 12px; }
.memory-viewbar { max-width: 760px; margin: 0 auto; width: 100%; }
.memory-count { color: var(--muted-2); font-size: 13px; }
@media (max-width: 760px) {
  .empty-state h2 { font-size: 24px; }
  .message.user { max-width: 90%; }
  .friendly-head { padding: 18px 16px 4px; }
  .memory-row { padding-right: 12px; }
}

/* ===== Memory network ===== */
.view-switch { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 999px; }
.view-switch button { background: transparent; border: 0; color: var(--muted); padding: 5px 16px; border-radius: 999px; font-size: 13px; }
.view-switch button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.memory-viewbar .view-switch { display: inline-flex; }
.memory-viewbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 24px 12px; }
.net-region { position: relative; height: 100%; min-height: 360px; margin: 0 16px 16px; border-radius: 18px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #151518 0%, #0b0b0c 70%); border: 1px solid var(--border); }
.net-viewport { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none;
  background-image: radial-gradient(#26262b 1px, transparent 1px); background-size: 28px 28px; }
.net-viewport:active { cursor: grabbing; }
.net-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.net-wires { position: absolute; left: 0; top: 0; pointer-events: none; }
.net-wire { fill: none; stroke: #4a4a55; stroke-width: 1.6; transition: stroke .15s, opacity .15s; }
.net-wire.topic { stroke-dasharray: 5 6; stroke: #35353d; }
.net-wire.lit { stroke: #b9c7ff; stroke-width: 2.4; stroke-dasharray: none; }
.net-wire.faded { opacity: .18; }
.net-card { position: absolute; display: grid; gap: 3px; align-content: start; min-height: 74px; padding: 10px 14px 12px; text-align: left; color: var(--text);
  background: #1b1b1f; border: 1px solid #2f2f36; border-left: 3px solid #6b7280; border-radius: 14px; box-shadow: 0 6px 18px #0008; cursor: pointer; transition: transform .12s, box-shadow .12s, opacity .15s, border-color .12s; }
.net-card:hover, .net-card:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 26px #000a; border-color: #4b4b57; z-index: 2; }
.net-card.t-semantic { border-left-color: #7aa7ff; }
.net-card.t-episodic { border-left-color: #8fd3a8; }
.net-card.t-procedural { border-left-color: #e0b36a; }
.net-card.dim { opacity: .3 !important; }
.net-kind { font-size: 11px; color: var(--muted-2); letter-spacing: .02em; }
.net-title { font-size: 13.5px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.net-controls { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 4px; padding: 4px; background: #1b1b1fe6; border: 1px solid var(--border-strong); border-radius: 999px; backdrop-filter: blur(6px); }
.net-controls button { min-width: 34px; height: 34px; padding: 0 10px; background: transparent; border: 0; border-radius: 999px; color: var(--text); font-size: 16px; }
.net-controls button:hover { background: var(--surface-3); }
.net-controls #net-fit { font-size: 13px; }
.net-controls span { min-width: 44px; text-align: center; color: var(--muted); font-size: 12px; }
.net-legend { position: absolute; left: 16px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; color: var(--muted-2); font-size: 12px; pointer-events: none; }
.net-legend i { display: inline-block; width: 22px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2px solid #6a6a76; }
.net-legend i.dashed { border-top: 2px dashed #4a4a55; }
.net-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; color: var(--muted); }
@media (max-width: 760px) { .net-region { margin: 0 8px 8px; } .net-hint { display: none; } .memory-viewbar { padding: 6px 16px 10px; } }

@media (max-height: 760px) {
  .friendly-head { padding: 14px 28px 0; }
  .friendly-head h2 { font-size: 20px; }
  .friendly-head p { display: none; }
  .memory-toolbar { padding-top: 10px; padding-bottom: 6px; }
}

/* ===== What I'm up to (AI-managed, read-only) ===== */
.mind-space { padding: 0 0 48px; }
.mind-page { max-width: 720px; margin: 0 auto; padding: 8px 24px 0; display: grid; gap: 16px; }
.up-card { padding: 20px 22px; background: var(--surface); border-radius: 18px; }
.up-card h3 { font-size: 16px; font-weight: 500; margin: 0 0 12px; }
.up-status { display: flex; align-items: center; gap: 16px; }
.up-status h3 { margin: 0; }
.up-sub { color: var(--muted-2); font-size: 13px; }
.up-pulse { width: 14px; height: 14px; border-radius: 50%; background: #555; flex-shrink: 0; }
.up-pulse[data-state="awake"] { background: #7fd39b; box-shadow: 0 0 0 0 #7fd39b88; animation: ring 2.4s infinite; }
@keyframes ring { 70% { box-shadow: 0 0 0 12px #7fd39b00; } 100% { box-shadow: 0 0 0 0 #7fd39b00; } }
.up-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.up-tile { display: grid; gap: 2px; padding: 16px 18px; background: var(--surface); border-radius: 18px; }
.up-tile strong { font-size: 26px; font-weight: 500; }
.up-tile span { color: var(--muted); font-size: 13px; }
.up-list { display: grid; gap: 4px; }
.up-row { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--border); }
.up-row:first-child { border-top: 0; padding-top: 0; }
.up-row-text { font-size: 15px; overflow-wrap: anywhere; }
.up-goal { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.up-goal-main { display: grid; gap: 6px; min-width: 0; flex: 1; }
.up-empty { color: var(--muted-2); font-size: 14px; }
.up-bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.up-bar i { display: block; height: 100%; background: #7fd39b; border-radius: 3px; }
.up-good { color: #9ed3b0; margin-bottom: 10px; }
.up-warn { color: #e0c58d; margin-bottom: 10px; }
.up-add { display: flex; gap: 8px; margin-top: 14px; }
.up-add input { flex: 1; min-width: 0; padding: 10px 16px; background: var(--surface-2); border: 0; border-radius: 999px; font-size: 14px; }
.up-add input:focus-visible { outline: 1px solid var(--border-strong); }
.up-add .button { border-radius: 999px; padding: 8px 18px; font-size: 14px; }
.up-foot { color: var(--muted-2); font-size: 13px; text-align: center; padding: 4px 0 8px; }
@media (max-width: 760px) { .mind-page { padding: 8px 14px 0; } .up-tiles { gap: 8px; } .up-tile { padding: 12px; } .up-tile strong { font-size: 22px; } }

/* Follow-up suggestions under the latest answer */
.followups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.suggestion.small { padding: 6px 14px; font-size: 13px; text-align: left; }

/* Sandbox experiment under "How I got this" */
.sandbox-run { margin-top: 10px; display: grid; gap: 6px; }
.sandbox-code { margin: 0; padding: 10px 12px; background: #0b0b0c; border: 1px solid var(--border); border-radius: 10px; font: 12px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; color: var(--muted); }
/* Sidebar switch */
.switch-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--muted); font-size: 13px; cursor: pointer; border-radius: 10px; }
.switch-row:hover { background: var(--surface-2); color: var(--text); }
.switch-row input { accent-color: #7fd39b; width: 16px; height: 16px; }

/* ===== Memory page: just the network. Colour = emotion, faintness = fading ===== */
#panel-memory .net-region { height: 100%; margin: 0 12px 12px; }
.net-card { --emo: #8a8f98; --fade: 1; --blur: 0px;
  opacity: var(--fade); filter: blur(var(--blur));
  background: color-mix(in srgb, var(--emo) 9%, #19191d);
  border: 1px solid color-mix(in srgb, var(--emo) 35%, #2a2a31);
  border-left: 4px solid var(--emo);
  box-shadow: 0 6px 18px #0008, 0 0 calc(22px * var(--fade)) color-mix(in srgb, var(--emo) 28%, transparent);
  transition: opacity 1.4s ease, filter 1.4s ease, transform .12s, box-shadow .6s; }
.net-card[data-state="FRAGILE"] { border-style: dashed; border-left-style: solid; }
.net-card.born { opacity: 0; transform: scale(.9); }
.net-card.gone { opacity: 0 !important; filter: blur(6px); transform: scale(.92); pointer-events: none; transition: opacity 1.5s ease, filter 1.5s ease, transform 1.5s ease; }
.net-card:hover, .net-card:focus-visible { opacity: 1; filter: none; }
.net-card.dim { opacity: .18 !important; }
.net-kind { color: var(--emo); font-size: 11px; text-transform: capitalize; letter-spacing: .03em; }
.net-wire { transition: opacity 1.2s; }
.net-legend { position: absolute; left: 16px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; max-width: calc(100% - 220px); pointer-events: none; }
.net-legend-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.net-legend-chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.net-legend-note { font-size: 12px; color: var(--muted-2); opacity: .8; }
.net-detail { position: absolute; top: 14px; right: 14px; width: min(320px, calc(100% - 28px)); padding: 18px 18px 16px; background: #1b1b1fee; border: 1px solid var(--border-strong); border-radius: 16px; backdrop-filter: blur(8px); display: grid; gap: 8px; z-index: 5; }
.net-detail-close { position: absolute; top: 6px; right: 6px; }
.net-detail-emotion { --emo: #8a8f98; justify-self: start; padding: 2px 12px; border-radius: 999px; font-size: 12px; text-transform: capitalize; color: var(--emo); background: color-mix(in srgb, var(--emo) 16%, transparent); }
.net-detail-text { font-size: 15px; line-height: 1.55; max-height: 40vh; overflow: auto; overflow-wrap: anywhere; }
.net-detail .forget-button { justify-self: start; }
@media (max-width: 760px) { .net-legend { max-width: calc(100% - 32px); bottom: 62px; } }

/* ===================== Orlon polish ===================== */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --sidebar-w: 268px; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -.003em; }
::selection { background: #35457a; color: #fff; }
* { scrollbar-width: thin; scrollbar-color: #2e2e33 transparent; }
:focus-visible { outline: 2px solid #7f9cff !important; outline-offset: 2px; }
button { transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease), opacity .2s var(--ease), box-shadow .2s var(--ease); }
button:active:not(:disabled) { transform: scale(.97); }

/* Brand */
.logo { width: 26px; height: 26px; flex-shrink: 0; transition: transform .7s var(--ease); }
.sidebar-head:hover .logo { transform: rotate(80deg); }
.brand-copy { display: flex; align-items: center; gap: 10px; }
.brand-copy strong { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.sidebar-head { padding: 2px 8px 18px; }
.sidebar-collapse { margin-left: auto; }
.hero-logo { display: block; width: 60px; height: 60px; margin: 0 auto 20px; filter: drop-shadow(0 0 24px #a9c8ff44); animation: heroIn .8s var(--ease) both; }
.hero-logo .orbit-dot { transform-box: view-box; transform-origin: 16px 16px; animation: orbit 10s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }

/* Layout: collapsible sidebar (desktop) */
@media (min-width: 761px) {
  .app-shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); transition: grid-template-columns .3s var(--ease); }
  .app-shell.collapsed { grid-template-columns: 0 minmax(0, 1fr); }
  .sidebar { width: var(--sidebar-w); overflow: hidden; transition: opacity .22s var(--ease), transform .3s var(--ease); }
  .app-shell.collapsed .sidebar { opacity: 0; transform: translateX(-14px); pointer-events: none; }
  .sidebar-collapse { display: inline-flex; }
  .app-shell.collapsed .menu-button { display: inline-flex; }
}
@media (max-width: 760px) { .sidebar-collapse { display: none; } }

/* Sidebar */
.new-chat-button { border-radius: 12px; font-size: 14px; font-weight: 500; }
.tab { border-radius: 12px; }
.tab:hover { background: #17171a; }
.conversation-list { gap: 1px; padding: 0 2px; }
.conversation-item { position: relative; display: flex; align-items: center; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--muted); }
.conversation-item:hover, .conversation-item.active { background: #1a1a1d; color: var(--text); }
.conversation-open { flex: 1; min-width: 0; padding: 9px 12px; text-align: left; color: inherit; background: transparent; border: 0; border-radius: 12px; }
.conversation-item strong { display: block; font-size: 14px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-delete { position: absolute; right: 4px; width: 30px; height: 30px; padding: 7px; color: var(--muted-2); background: #1a1a1d; border: 0; border-radius: 9px; opacity: 0; }
.conversation-item:hover .conversation-delete, .conversation-delete:focus-visible { opacity: 1; }
.conversation-delete:hover { color: #e5a1a1; background: #2a2a2d; }

/* Messages and replies */
.message-list { gap: 28px; }
.message-body { font-size: 16px; line-height: 1.75; }
.message.user { border-radius: 22px; }
.message.enter { animation: msgIn .34s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rw { display: inline-block; animation: wordIn .5s var(--ease) both; }
@keyframes wordIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* Thinking indicator */
.thinking { display: flex; align-items: center; gap: 12px; }
.pulse-dot { width: 11px; height: 11px; border-radius: 50%; background: linear-gradient(135deg, #a9c8ff, #c7aaff); animation: breathe 1.5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.68); opacity: .55; } 50% { transform: scale(1.12); opacity: 1; } }
.thinking-text { background: linear-gradient(90deg, #7d7d86 25%, #ececf2 50%, #7d7d86 75%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.9s linear infinite; }
@keyframes shimmer { from { background-position: 220% 0; } to { background-position: -220% 0; } }

/* Composer */
.composer { background: #1d1d20; box-shadow: 0 0 0 1px #26262b, 0 10px 34px #0006; transition: box-shadow .22s var(--ease), background .22s var(--ease); }
.composer:focus-within { background: #212125; box-shadow: 0 0 0 1px #3b3b44, 0 14px 40px #0009; }
.send-button { transition: transform .16s var(--ease), opacity .2s var(--ease), background .2s var(--ease); }
.send-button:disabled { opacity: .22; transform: scale(.9); }
.send-button:not(:disabled):hover { transform: scale(1.07); }

/* Scroll to latest */
.chat-main { position: relative; }
.scroll-down { position: absolute; left: 50%; bottom: 112px; z-index: 3; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--text); background: #1f1f23; border: 1px solid #34343a; border-radius: 50%; box-shadow: 0 8px 22px #000a; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); }
.scroll-down.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.scroll-down:hover { background: #2a2a2f; }
.scroll-down:active:not(:disabled) { transform: translate(-50%, 0) scale(.94); }

/* Entrances */
.empty-state h2 { animation: heroIn .65s .06s var(--ease) both; }
.suggestion { animation: heroIn .6s var(--ease) both; }
.suggestions .suggestion:nth-child(1) { animation-delay: .14s; }
.suggestions .suggestion:nth-child(2) { animation-delay: .2s; }
.suggestions .suggestion:nth-child(3) { animation-delay: .26s; }
.suggestions .suggestion:nth-child(4) { animation-delay: .32s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.suggestion:hover { transform: translateY(-1px); border-color: #4a4a54; }
.panel:not([hidden]) { animation: viewIn .28s var(--ease) both; }
@keyframes viewIn { from { transform: translateY(4px); } to { transform: none; } }
.toast { animation: toastIn .26s var(--ease) both; border-radius: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.reply-action, .trust-chip { transition: background .16s var(--ease), color .16s var(--ease); }
.conversation-list { overflow-x: hidden; }
.conversation-item { min-width: 0; width: 100%; }
.topbar-title { overflow: hidden; }
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Hidden labels are absolutely positioned: anchor them inside the scrolling list so
   they are clipped with it and can never stretch the page below the composer. */
.message-list { position: relative; }
.chat-main { overflow: hidden; }

/* Orlon logo (white mark) */
.logo { object-fit: contain; }
.hero-logo { filter: drop-shadow(0 0 26px #b9c8ff55); }
.hero-logo .orbit-dot, .logo .orbit-dot { animation: none; }

/* =====================================================================
   Orlon app look: the website uses the mobile app's design system
   (pure black, soft grey surfaces, Inter, serif replies, round controls).
   ===================================================================== */
@font-face { font-family: Inter; src: url(/static/fonts/Inter-Regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Inter; src: url(/static/fonts/Inter-Medium.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Inter; src: url(/static/fonts/Inter-SemiBold.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #000; --s1: #000; --s2: #0b0b0b; --s3: #151515;
  --line: #1a1a1a; --line-strong: #292929;
  --t1: #f2f2f2; --t2: #a1a1a1; --t3: #8a8a8a;
  --on: #f2f2f2; --on-ink: #000;
  /* the older names used all over this stylesheet now follow the app's tokens */
  --surface: var(--s2); --surface-2: var(--s3); --surface-3: #1d1d1d;
  --border: var(--line); --border-strong: var(--line-strong);
  --text: var(--t1); --muted: var(--t2); --muted-2: var(--t3);
  --accent: var(--on); --accent-ink: var(--on-ink);
  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
html, body { background: var(--bg); }
body { font-family: var(--sans); font-size: 16px; font-feature-settings: "cv11", "ss01"; color: var(--t1); }
.app-shell { background: var(--bg); }

/* Drawer */
.sidebar { background: var(--bg); border-right: 1px solid var(--line); padding: 16px 14px 14px; }
.sidebar-head { gap: 10px; padding: 2px 6px 16px; }
.brand-copy strong { font-size: 24px; font-weight: 600; letter-spacing: -.025em; }
.brand-copy .logo { width: 30px; height: 30px; }
.sidebar-head .icon-button { border: 0; background: transparent; color: var(--t1); width: 38px; height: 38px; }
.sidebar-head .icon-button:hover { background: var(--s3); }
#chat-search-open { margin-left: auto; }
.sidebar-collapse { margin-left: 0 !important; }
.chat-search { display: block; margin: 0 4px 10px; }
.chat-search input { width: 100%; padding: 11px 16px; font: inherit; color: var(--t1); background: var(--s2); border: 1px solid var(--line); border-radius: 999px; outline: none; }
.chat-search input:focus { border-color: var(--line-strong); }
.tabs { margin: 4px 0 14px; gap: 2px; }
.tab { gap: 16px; padding: 12px 12px; font-size: 17px; font-weight: 500; color: var(--t1); border-radius: 14px; }
.tab svg { width: 22px; height: 22px; stroke-width: 1.5; }
.tab:hover { background: var(--s2); }
.tab[aria-selected="true"], .tab.active { background: var(--s3); }
.sidebar-label { color: var(--t3); font-size: 13px; letter-spacing: .01em; padding-top: 6px; }
.conversation-item { border-radius: 12px; color: var(--t2); }
.conversation-item:hover, .conversation-item.active { background: var(--s2); color: var(--t1); }
.conversation-item.active { background: var(--s3); }
.conversation-item strong { font-size: 15.5px; }
.conversation-delete { background: var(--s3); }
.sidebar-footer { padding-top: 12px; }
.new-chat-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; padding: 0 20px; font-size: 17px; font-weight: 500; letter-spacing: -.005em; color: var(--on-ink); background: var(--on); border: 0; border-radius: 999px; }
.new-chat-button:hover { background: #fff; }
.new-chat-button svg { width: 20px; height: 20px; stroke-width: 1.8; }
.runtime-card { display: none; }

/* Header: round outlined buttons */
.topbar { border: 0; background: transparent; min-height: 72px; padding: 14px 20px; }
.topbar .icon-button { width: 44px; height: 44px; border-radius: 50%; color: var(--t1); background: var(--s2); border: 1px solid var(--line); }
.topbar .icon-button:hover { background: var(--s3); border-color: var(--line-strong); }
.topbar h1 { font-size: 16px; font-weight: 500; color: var(--t2); letter-spacing: -.005em; }
.topbar-actions { gap: 10px; }

/* Welcome */
.empty-state h2 { font-family: var(--serif); font-weight: 500; font-size: 36px; letter-spacing: -.02em; line-height: 1.2; }
.hero-logo { width: 68px; height: 68px; margin-bottom: 26px; }
.suggestion { background: var(--s2); border: 1px solid var(--line); color: var(--t2); }
.suggestion:hover { background: var(--s3); color: var(--t1); border-color: var(--line-strong); }

/* Messages: a text-message bubble for you, plain serif for Orlon */
.message-list { padding: 18px max(16px, calc((100% - 720px) / 2)) 28px; gap: 26px; }
.message.user { position: relative; max-width: 78%; margin-right: 8px; padding: 10px 16px; background: var(--s3); color: var(--t1); border: 0; border-radius: 20px 20px 6px 20px; font-size: 16px; line-height: 1.55; }
.message.user::after { content: ""; position: absolute; right: -8px; bottom: 0; width: 18px; height: 20px; background: var(--s3); clip-path: path("M0 0 L10 0 C10 9 13 16 18 20 C9 20 3 19 0 16 Z"); }
.message.assistant .message-body { font-family: var(--serif); font-size: 17.5px; line-height: 1.7; color: var(--t1); }
.message-body strong { font-weight: 600; color: var(--t1); }
.message-body a { color: var(--t1); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.message-body li::marker { color: var(--t3); }
.message-body code { background: var(--s3); border-radius: 6px; padding: 1px 6px; font-family: var(--mono); font-size: .86em; }
.message-body pre { background: var(--s1); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; max-width: 100%; }
.message-body pre code, .message-body table { font-family: var(--mono); }
.message-body table { font-family: var(--sans); font-size: 14px; }
.reply-action { color: var(--t3); }
.reply-action:hover { background: var(--s3); color: var(--t1); }
.trust-chip, .how-details > summary, .cognition-tag { font-family: var(--sans); }

/* Composer: outlined, round buttons, white send */
.composer { max-width: 760px; margin: 8px auto 0; padding: 16px 14px 12px 20px; background: var(--s2); border: 0; border-radius: 26px; box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.composer:focus-within { background: var(--s2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.composer textarea { display: block; width: 100%; min-height: 28px; max-height: 180px; padding: 2px 0 10px; font-size: 17px; line-height: 1.5; color: var(--t1); background: transparent; border: 0; outline: none; resize: none; }
.composer textarea::placeholder { color: var(--t3); }
.composer-row { display: flex; align-items: center; gap: 10px; }
.composer-hint { flex: 1; font-size: 12px; color: var(--t3); }
.round-button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; color: var(--t1); background: var(--s3); border: 0; border-radius: 50%; }
.round-button:hover { background: #1f1f1f; }
.round-button svg { width: 20px; height: 20px; stroke-width: 1.8; transition: transform .25s var(--ease); }
.round-button.open svg { transform: rotate(45deg); }
.send-button { width: 42px; height: 42px; margin: 0 0 0 auto; color: var(--on-ink); background: var(--on); border: 0; border-radius: 50%; }
.send-button:disabled { background: var(--on); opacity: .2; }
.composer-meta { display: none; }

/* The + menu (the app's tools sheet) */
.tools-menu { position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 20; width: min(340px, 100%); padding: 8px; background: var(--s2); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: 0 18px 50px #000c; animation: toolsIn .2s var(--ease) both; }
@keyframes toolsIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.tools-label { margin: 8px 12px 4px; font-size: 12.5px; letter-spacing: .02em; color: var(--t3); }
.tools-item { display: block; width: 100%; padding: 12px 14px; font-size: 16px; text-align: left; color: var(--t1); background: transparent; border: 0; border-radius: 14px; }
.tools-item:hover, .tools-item:focus-visible { background: var(--s3); }
.tools-menu .switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-direction: row-reverse; padding: 12px 14px; font-size: 15px; color: var(--t1); border-radius: 14px; }
.tools-menu .switch-row:hover { background: var(--s3); }
.switch-row input { appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0; width: 44px; height: 26px; margin: 0; background: var(--s3); border: 1px solid var(--line-strong); border-radius: 999px; transition: background .2s var(--ease); cursor: pointer; }
.switch-row input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; background: var(--t2); border-radius: 50%; transition: transform .2s var(--ease), background .2s var(--ease); }
.switch-row input:checked { background: var(--on); border-color: var(--on); }
.switch-row input:checked::after { transform: translateX(18px); background: var(--on-ink); }

/* Other pages follow the same surfaces */
.pending-region, .up-card, .up-tile, .net-detail, .toast { background: var(--s2); border-color: var(--line); }
.up-card, .up-tile { border: 1px solid var(--line); }
.friendly-head h2, .mind-page h3 { font-weight: 600; letter-spacing: -.02em; }
.net-region { background: radial-gradient(circle at 50% 40%, #0c0c0c, #000 72%); border-color: var(--line); }
.net-viewport { background-image: radial-gradient(#1b1b1b 1px, transparent 1px); }
.net-card { background: color-mix(in srgb, var(--emo) 8%, #0b0b0b); }
.net-controls { background: #0b0b0be6; border-color: var(--line-strong); }
.scroll-down { background: var(--s2); border-color: var(--line-strong); }
.button.primary { background: var(--on); color: var(--on-ink); border: 0; }
.forget-button { border-color: var(--line-strong); }
* { scrollbar-color: #262626 transparent; }

@media (max-width: 760px) {
  .empty-state h2 { font-size: 30px; }
  .topbar { min-height: 64px; padding: 12px 16px; }
  .tools-menu { width: 100%; }
}

/* ===================== ChatGPT-style layout, Orlon style ===================== */
:root { --sidebar-w: 272px; }
.sidebar-head { padding: 4px 8px 12px; }
.side-rows { display: grid; gap: 2px; margin: 0 0 6px; }
.side-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; font-size: 15.5px; font-weight: 500; text-align: left; color: var(--t1); background: transparent; border: 0; border-radius: 12px; }
.side-row svg { width: 20px; height: 20px; stroke-width: 1.6; color: var(--t2); }
.side-row:hover { background: var(--s2); }
.side-row:hover svg { color: var(--t1); }
.tabs { margin: 0 0 10px; gap: 2px; }
.tab#tab-chat { display: none; }
.tab { padding: 10px 12px; font-size: 15.5px; gap: 14px; }
.tab svg { width: 20px; height: 20px; }
.sidebar-label { padding: 12px 12px 6px; font-size: 12.5px; font-weight: 500; color: var(--t3); }
.sidebar-footer { padding-top: 0; }
.new-chat-button { display: none; }

/* Composer: one rounded pill, + on the left, send on the right */
.composer { display: flex; align-items: flex-end; gap: 8px; max-width: 760px; padding: 8px 8px 8px 10px; border-radius: 30px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line); }
.composer textarea { flex: 1; min-width: 0; align-self: center; padding: 9px 4px; font-size: 16.5px; line-height: 1.5; max-height: 200px; }
.composer-hint:empty { display: none; }
.round-button { flex-shrink: 0; width: 40px; height: 40px; background: transparent; color: var(--t2); }
.round-button:hover { background: var(--s3); color: var(--t1); }
.send-button { flex-shrink: 0; width: 40px; height: 40px; margin: 0; }
.tools-menu { left: 8px; bottom: calc(100% + 12px); }
#panel-chat.is-empty .composer { margin-top: 4px; }

/* Replies read like a document: left aligned, a calm column, hover actions */
.message-list { padding-top: 8px; }
.message.assistant { width: 100%; }
.empty-state h2 { font-size: 34px; }
.topbar { min-height: 64px; }
.sidebar-collapse { margin-left: auto !important; }

/* The logo stays still. */
.logo, .sidebar-head:hover .logo, .hero-logo { transition: none !important; transform: none !important; }
.hero-logo { animation: heroIn .6s var(--ease) both; }

/* ===================== Profile row, dialogs, Community Images ===================== */
.sidebar-footer { padding-top: 10px; border-top: 1px solid var(--line); margin-top: 8px; }
.profile-bar { display: flex; align-items: center; gap: 6px; }
.profile-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 10px; text-align: left; color: var(--t1); background: transparent; border: 0; border-radius: 16px; }
.profile-row:hover { background: var(--s2); }
.avatar { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; font-size: 17px; font-weight: 600; color: var(--on-ink); background: var(--on); border: 2px solid var(--s3); border-radius: 50%; box-shadow: 0 0 0 1px var(--line-strong); }
.avatar.big { width: 56px; height: 56px; font-size: 24px; }
.who { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.who strong { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 15.5px; font-weight: 600; }
.who strong .name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { font: 12px var(--mono); color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 16px; height: 16px; color: var(--t3); stroke-width: 1.8; }
#profile-settings { width: 40px; height: 40px; border: 0; background: transparent; color: var(--t2); }
#profile-settings:hover { background: var(--s2); color: var(--t1); }

/* Sheets (dialogs) */
.sheet { width: min(460px, calc(100% - 28px)); max-height: calc(100% - 40px); padding: 26px 24px 22px; color: var(--t1); background: var(--s2); border: 1px solid var(--line-strong); border-radius: 26px; box-shadow: 0 30px 90px #000d; }
.sheet::backdrop { background: #000b; backdrop-filter: blur(3px); }
.sheet[open] { animation: sheetIn .24s var(--ease) both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.sheet-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; padding: 0; font-size: 24px; line-height: 1; color: var(--t2); background: transparent; border: 0; border-radius: 50%; }
.sheet-close:hover { background: var(--s3); color: var(--t1); }
.sheet h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.sheet h3 { font-size: 13px; font-weight: 500; color: var(--t3); margin: 22px 0 6px; }
.sheet-sub { color: var(--t2); font-size: 14.5px; margin: 6px 0 14px; }
.sheet-sub.small { font-size: 13px; }
.pills { display: inline-flex; padding: 3px; gap: 2px; background: var(--s1); border: 1px solid var(--line); border-radius: 999px; }
.pills button { padding: 7px 16px; font-size: 14px; color: var(--t2); background: transparent; border: 0; border-radius: 999px; }
.pills button[aria-pressed="true"] { color: var(--t1); background: var(--s3); }
#account-form { display: grid; gap: 6px; margin-top: 16px; }
#account-form label { font-size: 13px; color: var(--t3); margin-top: 8px; }
#account-form input { padding: 12px 16px; font: inherit; color: var(--t1); background: var(--s1); border: 1px solid var(--line-strong); border-radius: 14px; outline: none; }
#account-form input:focus { border-color: #4a4a4a; }
.form-error { margin: 8px 0 0; font-size: 14px; color: #e5a1a1; }
.primary-pill { margin-top: 16px; height: 50px; font-size: 16.5px; font-weight: 500; color: var(--on-ink); background: var(--on); border: 0; border-radius: 999px; }
.primary-pill:hover:not(:disabled) { background: #fff; }
.primary-pill:disabled { opacity: .5; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.profile-head .sheet-sub { margin: 2px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--t3); }
.sheet-actions { display: flex; gap: 10px; margin-top: 4px; }
.sheet-actions button { flex: 1; height: 46px; font-size: 15px; color: var(--t1); background: var(--s3); border: 1px solid var(--line-strong); border-radius: 999px; }
.sheet-actions button:hover { background: #1f1f1f; }
.settings-slot .switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-direction: row-reverse; padding: 12px 4px; font-size: 15px; color: var(--t1); border-radius: 12px; cursor: pointer; }

/* Community Images */
.gallery-space { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 28px 100px; }
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1180px; margin: 0 auto; padding: 14px 0 18px; }
.gallery-head h2 { font-size: 26px; font-weight: 600; letter-spacing: -.025em; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; max-width: 1180px; margin: 0 auto; }
.gallery-tile { display: grid; gap: 8px; align-content: start; padding: 0; text-align: left; color: var(--t1); background: transparent; border: 0; border-radius: 18px; }
.gallery-tile:hover .gallery-picture { border-color: var(--line-strong); transform: translateY(-2px); }
.gallery-picture { position: relative; aspect-ratio: 1; overflow: hidden; background: linear-gradient(110deg, var(--s2) 30%, var(--s3) 50%, var(--s2) 70%) 0 0 / 220% 100%; border: 1px solid var(--line); border-radius: 18px; animation: skeleton 1.6s linear infinite; transition: transform .2s var(--ease), border-color .2s; }
.gallery-picture.ready, .gallery-picture.missing { animation: none; background: var(--s2); }
.gallery-picture img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s var(--ease); }
.gallery-picture.ready img { opacity: 1; }
@keyframes skeleton { from { background-position: 220% 0; } to { background-position: -220% 0; } }
.gallery-title { padding: 0 4px; font-size: 14px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.gallery-meta { display: flex; align-items: center; gap: 7px; padding: 0 4px; min-width: 0; font-size: 12.5px; color: var(--t3); }
.gallery-avatar { flex: none; display: grid; place-items: center; width: 20px; height: 20px; font: 600 10px/1 var(--sans); color: var(--t2); background: var(--s3); border-radius: 50%; }
.gallery-author { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-time { margin-left: auto; flex: none; }
.gallery-hearts { flex: none; color: #e58a9a; }
.gallery-note { max-width: 1180px; margin: 28px auto; text-align: center; color: var(--t2); }
.gallery-more { display: block; margin: 28px auto 0; padding: 11px 26px; font-size: 15px; color: var(--t1); background: var(--s3); border: 1px solid var(--line-strong); border-radius: 999px; }
#gallery-viewer { width: min(720px, calc(100% - 24px)); padding: 14px 14px 18px; }
#gallery-viewer img { display: block; width: 100%; max-height: min(70vh, 720px); object-fit: contain; background: var(--s1); border-radius: 18px; }
.viewer-meta { display: grid; gap: 2px; padding: 12px 8px 0; }
.viewer-meta strong { font-size: 17px; font-weight: 600; }
.viewer-meta span { font-size: 14px; color: var(--t2); }
#panel-gallery { position: relative; display: flex; flex-direction: column; height: 100%; }
.gallery-prompt { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; background: rgba(5, 5, 5, .96); border: 1px solid #2b2b2b; border-radius: 999px; box-shadow: 0 12px 32px #000c; backdrop-filter: blur(14px); }
.gallery-prompt:focus-within { border-color: #4a4a4a; }
.gallery-prompt input { flex: 1; min-width: 0; height: 38px; color: var(--t1); background: transparent; border: 0; font-size: 15px; }
.gallery-prompt input:focus,
.gallery-prompt input:focus-visible { outline: none !important; }
.gallery-prompt .send-button { width: 38px; height: 38px; flex: none; color: #111; background: #f2f2f2; border: 0; }
.gallery-prompt .send-button:hover { background: #fff; }
.gallery-prompt .send-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gallery-prompt-bar { position: absolute; left: 50%; bottom: 18px; z-index: 2; width: min(1180px, calc(100% - 56px)); margin: 0; transform: translateX(-50%); }
@media (max-width: 760px) { .gallery-prompt-bar { bottom: 12px; width: calc(100% - 28px); } }
@media (max-width: 760px) { .gallery-space { padding: 4px 14px 86px; } .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* ===================== Model picker, header, banner, AGI area ===================== */
.model-chip { display: none; align-items: center; gap: 8px; height: 42px; padding: 0 12px 0 10px; font-size: 17px; font-weight: 500; letter-spacing: -.01em; color: var(--t1); background: transparent; border: 0; border-radius: 14px; }
body[data-view="chat"] .model-chip { display: inline-flex; }
body[data-view="chat"] .topbar-title { display: none; }
.model-chip:hover { background: var(--s2); }
.model-chip-logo { width: 20px; height: 20px; object-fit: contain; border-radius: 50%; }
.chev-down { width: 16px; height: 16px; stroke-width: 2; color: var(--t3); }
.topbar { gap: 8px; }
.topbar-title { flex: 1; min-width: 0; }
body[data-view="chat"] .topbar-actions { margin-left: auto; }

.auth-buttons { display: flex; gap: 8px; }
.pill-button { height: 40px; padding: 0 18px; font-size: 15px; font-weight: 500; color: var(--t1); background: var(--s3); border: 1px solid var(--line-strong); border-radius: 999px; }
.pill-button:hover { background: #1f1f1f; }
.pill-button.solid { color: var(--on-ink); background: var(--on); border: 0; }
.pill-button.solid:hover { background: #fff; }

.announcement { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 48px; font-size: 14px; line-height: 1.45; text-align: center; color: var(--t1); background: var(--s3); border-bottom: 1px solid var(--line); }
.announcement[data-level="warn"] { color: #f1d9a0; background: #241d0c; border-color: #43361a; }
.announcement-close { position: absolute; right: 10px; top: 50%; width: 30px; height: 30px; padding: 0; margin-top: -15px; font-size: 20px; line-height: 1; color: inherit; background: transparent; border: 0; border-radius: 50%; opacity: .7; }
.announcement-close:hover { opacity: 1; background: #ffffff14; }

/* The model sheet */
.model-sheet { width: min(520px, calc(100% - 24px)); max-height: min(92vh, 860px); padding: 18px 18px 22px; overflow-y: auto; }
.sheet-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; position: relative; }
.sheet-bar h2 { flex: 1; text-align: center; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.sheet-bar .sheet-back, .sheet-bar .sheet-close.inline { position: static; flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--t1); background: transparent; border: 1px solid var(--line); border-radius: 50%; }
.sheet-bar .sheet-back[hidden] { display: none; }
.sheet-bar .sheet-back svg { width: 20px; height: 20px; stroke-width: 1.8; }
.sheet-bar .sheet-close.inline { font-size: 24px; line-height: 1; }
.sheet-bar .sheet-back:hover, .sheet-bar .sheet-close.inline:hover { background: var(--s3); }
.sheet-bar:has(.sheet-back[hidden]) h2 { padding-left: 54px; }
.m-main { display: grid; gap: 10px; }
.m-auto, .m-tier, .m-row { color: var(--t1); background: var(--s2); border: 1px solid var(--line); text-align: left; transition: border-color .16s var(--ease), background .16s var(--ease), transform .12s var(--ease); }
.m-auto:hover, .m-tier:hover, .m-row:hover { background: var(--s3); border-color: var(--line-strong); }
.m-auto { display: grid; gap: 6px; padding: 16px 20px 18px; border-radius: 20px; }
.m-auto.on, .m-tier.on { border-color: var(--t2); }
.m-auto-top { display: flex; align-items: center; gap: 12px; font-size: 19px; }
.m-auto-top strong { font-weight: 500; }
.m-auto-desc { font-size: 15px; color: var(--t2); }
.m-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-tier { display: grid; gap: 8px; align-content: space-between; padding: 18px 18px 16px; border-radius: 26px; }
.m-tier strong.serif { font-family: var(--serif); font-size: 25px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.m-tier-desc { font-size: 15px; line-height: 1.45; color: var(--t2); }
.m-tier-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.mono { font-family: var(--mono); font-size: 13px; color: var(--t1); }
.m-stack { display: inline-flex; padding-left: 8px; }
.m-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 19px 20px; border-radius: 20px; }
.m-row-title { flex: 1; font-size: 17px; font-weight: 500; }
.m-row-value { max-width: 55%; font-size: 16px; color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row svg { flex: none; width: 18px; height: 18px; stroke-width: 1.8; color: var(--t3); }
.m-logo { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; overflow: hidden; background: #fff; border-radius: 50%; }
.m-logo img { width: 100%; height: 100%; object-fit: cover; }
.m-logo img.auto { object-fit: contain; padding: 2px; }
.m-logo:has(img.auto) { background: transparent; }
.m-logo.big { width: 30px; height: 30px; }
.m-logo.small { width: 28px; height: 28px; margin-left: -8px; border: 2px solid var(--s2); }
.m-logo.letter { color: var(--t1); background: var(--s3); font-size: 13px; }
.m-list { display: grid; gap: 4px; }
.m-note, .m-empty { margin: 4px 6px 10px; font-size: 14px; line-height: 1.5; color: var(--t2); }
.m-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; text-align: left; color: var(--t1); background: transparent; border: 0; border-radius: 16px; }
.m-item:hover, .m-item.on { background: var(--s3); }
.m-item.locked { opacity: .55; }
.m-item-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.m-item-text strong { font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-item-text small { font-size: 13px; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-item svg { flex: none; width: 20px; height: 20px; stroke-width: 1.8; color: var(--t2); }
@media (max-width: 520px) { .m-tiers { grid-template-columns: 1fr; } }

/* AGI: its own area, for now separate from the main product */
#panel-memory, #panel-mind { display: flex; flex-direction: column; }
#panel-memory[hidden], #panel-mind[hidden] { display: none; }
#panel-memory .net-region { flex: 1; height: auto; min-height: 0; }
#panel-mind .mind-space { flex: 1; height: auto; min-height: 0; }
.agi-nav { display: flex; align-items: center; gap: 14px; padding: 4px 28px 14px; }
.agi-tag { padding: 3px 9px; font: 600 11px var(--mono); letter-spacing: .14em; color: var(--t2); border: 1px solid var(--line-strong); border-radius: 7px; }
@media (max-width: 760px) { .agi-nav { padding: 2px 16px 10px; } .auth-buttons .pill-button { height: 36px; padding: 0 14px; font-size: 14px; } .model-chip { font-size: 16px; } }

/* Brand menu: Orlon / Orlon AGI */
.brand-wrap { position: relative; }
.brand-button { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px 0 6px; margin-left: -6px; color: var(--t1); background: transparent; border: 0; border-radius: 14px; }
.brand-button:hover, .brand-button[aria-expanded="true"] { background: var(--s2); }
.brand-button .chev-down { width: 15px; height: 15px; stroke-width: 2; }
.brand-menu { position: absolute; z-index: 40; top: 50px; left: -6px; width: 268px; padding: 8px; background: var(--s2); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: 0 18px 50px #000c; }
.brand-menu[hidden] { display: none; }
.brand-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; text-align: left; color: var(--t1); background: transparent; border: 0; border-radius: 14px; }
.brand-item:hover { background: var(--s3); }
.brand-item .logo { flex: none; width: 26px; height: 26px; }
.brand-item-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.brand-item-text strong { font-size: 16px; font-weight: 500; }
.brand-item-text small { font-size: 13px; color: var(--t3); }
.brand-check { flex: none; width: 18px; height: 18px; stroke-width: 2; opacity: 0; }
.brand-item.on .brand-check { opacity: 1; }
#tab-agi { display: none; }
.brand-button strong { white-space: nowrap; }
.brand-button { max-width: 100%; }
