:root {
  color-scheme: dark;
  --bg: #0e0f12;
  --panel: #16181d;
  --panel-2: #1c1f25;
  --border: #262931;
  --text: #e8eaed;
  --muted: #8a92a3;
  --accent: #6aa9ff;
  --self: #1f2a3d;
  --other: #1a1d24;
  --hover: #20242c;
  --add: #214a2a;
  --del: #4a2121;
  --add-text: #98e0a8;
  --del-text: #ff8a8a;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, "Segoe UI", system-ui, sans-serif; }

.screen { display: flex; height: 100vh; }
.hidden { display: none !important; }

#login {
  flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px;
}
#login h1 { margin: 0; font-size: 22px; letter-spacing: 0.5px; }
#login p { color: var(--muted); margin: 0; }
#login input {
  width: min(420px, 100%); padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px;
}
#login button { padding: 8px 18px; background: var(--accent); color: #0e0f12; border: 0; border-radius: 8px; font-weight: 600; cursor: pointer; }
#login-error { color: #ff6b6b; min-height: 20px; }

#chat { flex-direction: row; }

#left {
  width: 240px; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0;
}
#me-row { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); }
#me-info { flex: 1; min-width: 0; }
#me-name { font-weight: 600; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#me-info button {
  margin-top: 2px; padding: 2px 8px; font-size: 11px; background: transparent;
  color: var(--muted); border: 1px solid var(--border); border-radius: 4px; cursor: pointer;
}
.section { border-bottom: 1px solid var(--border); padding: 8px 0; max-height: 40%; overflow-y: auto; }
.section:nth-of-type(2) { flex: 1; }
.section-head {
  padding: 4px 12px; font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; justify-content: space-between;
}
.section-head button {
  background: transparent; color: var(--accent); border: 0; cursor: pointer; font-size: 16px; padding: 0 4px; line-height: 1;
}
#chats-list, #sisters-list { list-style: none; margin: 0; padding: 0; }
#chats-list li, #sisters-list li {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer;
  font-size: 13px;
}
#chats-list li:hover, #sisters-list li:hover { background: var(--hover); }
#chats-list li.active { background: var(--panel-2); border-left: 3px solid var(--accent); padding-left: 9px; }
#chats-list li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sisters-list li .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
#sisters-list li.online .dot { background: #4caf50; }
#sisters-list li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sisters-list li .sister-edit { background: transparent; color: var(--muted); border: 0; cursor: pointer; padding: 0 4px; opacity: 0; font-size: 14px; }
#sisters-list li:hover .sister-edit { opacity: 1; }
#sisters-list li .sister-edit:hover { color: var(--accent); }
#left #leave { margin: 8px 12px; padding: 6px; background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; cursor: pointer; font-size: 12px; }

#messages-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#messages-pane > header {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
#messages-pane > header strong { color: var(--accent); }
#messages-pane > header #chat-meta { color: var(--muted); font-size: 13px; flex: 1; }
#search-wrap { position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
#search-input { padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; width: 240px; outline: none; transition: border-color 0.15s ease; }
#search-input:focus { border-color: var(--accent); }
.search-scope { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 8px; border-radius: 6px; user-select: none; }
.search-scope:hover { background: var(--hover); color: var(--text); }
#chat-view > header { padding: 12px 18px; box-shadow: 0 4px 12px rgba(0,0,0,0.25); position: relative; z-index: 2; }
#search-results {
  position: absolute; top: calc(100% + 6px); right: 0; width: 380px; max-height: 60vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; z-index: 50;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
#search-results .sr-empty, #search-results .sr-loading { padding: 12px; color: var(--muted); font-size: 12px; }
#search-results .sr-item { padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
#search-results .sr-item:last-child { border-bottom: 0; }
#search-results .sr-item:hover { background: var(--hover); }
#search-results .sr-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
#search-results .sr-author { color: var(--accent); font-weight: 600; }
#search-results .sr-body { font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
#search-results mark { background: rgba(106,169,255,0.3); color: var(--text); padding: 0 2px; border-radius: 2px; }
#messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
#messages-pane { position: relative; }
#jump-bottom {
  position: absolute; right: 24px; bottom: 64px; z-index: 10;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #0e0f12; border: 0; font-size: 18px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
#jump-bottom:hover { transform: translateY(-2px); }
#jump-bottom #jump-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  border-radius: 9px; background: #ff5252; color: white; font-size: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
#typing { min-height: 22px; padding: 0 16px 6px; font-size: 12px; color: var(--muted); font-style: italic; display: flex; align-items: center; gap: 8px; }
#typing .dots { display: inline-flex; gap: 3px; align-items: flex-end; height: 14px; }
#typing .dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
#typing .dots span:nth-child(2) { animation-delay: 0.15s; }
#typing .dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}
#staged-attachments { padding: 8px 12px 0; display: flex; flex-wrap: wrap; gap: 8px; max-height: 130px; overflow-y: auto; }
#staged-attachments:empty { padding: 0; }
#staged-attachments .stage-att { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; display: flex; align-items: center; position: relative; overflow: hidden; }
#staged-attachments .stage-att.thumb { width: 80px; height: 80px; cursor: pointer; padding: 0; }
#staged-attachments .stage-att.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#staged-attachments .stage-att.thumb:hover { border-color: var(--accent); }
#staged-attachments .stage-att.file { padding: 8px 12px 8px 10px; gap: 8px; max-width: 240px; }
#staged-attachments .stage-att.file .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
#staged-attachments .stage-att .x {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; background: rgba(0,0,0,0.7); color: white;
  border: 0; border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
#staged-attachments .stage-att.file .x { position: static; background: transparent; color: var(--muted); width: auto; height: auto; }
#staged-attachments .stage-att .x:hover { background: var(--del-text); color: white; }

#preview-modal { background: rgba(0,0,0,0.92); }
#preview-modal #pv-content { max-width: 96vw; max-height: 92vh; display: flex; align-items: center; justify-content: center; }
#preview-modal #pv-content img { max-width: 96vw; max-height: 92vh; object-fit: contain; }
#preview-modal #pv-close {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
  border-radius: 50%; background: rgba(255,255,255,0.15); color: white; border: 0;
  font-size: 20px; cursor: pointer; line-height: 1;
}
#preview-modal #pv-close:hover { background: rgba(255,255,255,0.3); }

#side {
  width: 340px; border-left: 1px solid var(--border); background: var(--panel);
  display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0;
}
#side h3 {
  margin: 0; padding: 10px 14px; font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--border);
}
#tasks { padding: 10px 14px; border-bottom: 1px solid var(--border); max-height: 40%; overflow-y: auto; }
#tasks .user-tasks { margin-bottom: 12px; }
#tasks .user-tasks .who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent); margin-bottom: 4px; cursor: pointer; user-select: none; padding: 2px 4px; border-radius: 4px; }
#tasks .user-tasks .who:hover { background: var(--hover); }
#tasks .user-tasks .who::before { content: '▾'; color: var(--muted); font-size: 10px; margin-right: 2px; }
#tasks .user-tasks.collapsed .who::before { content: '▸'; }
#tasks .user-tasks.collapsed ul { display: none; }
#tasks .user-tasks .who-counts { color: var(--muted); font-weight: 400; font-size: 10px; margin-left: auto; }
#tasks ul { list-style: none; padding: 0; margin: 0; }
#tasks li { font-size: 13px; padding: 2px 0; display: flex; gap: 6px; align-items: flex-start; }
#tasks .status { font-size: 11px; opacity: 0.75; min-width: 14px; }
#tasks .status.completed { color: #82d8a0; }
#tasks .status.in_progress { color: var(--accent); }
#tasks .status.pending { color: var(--muted); }
#tasks li.completed .subj { text-decoration: line-through; color: var(--muted); }
#tasks .tasks-empty { font-size: 12px; color: var(--muted); font-style: italic; line-height: 1.5; }

#activity { flex: 1; overflow-y: auto; padding: 8px 14px; font: 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace; }
.act-group { margin-bottom: 8px; }
.act-group .group-head {
  position: sticky; top: 0; z-index: 5;
  background: var(--panel); padding: 6px 4px;
  display: flex; gap: 8px; align-items: center;
  border-bottom: 1px solid var(--border);
  font-family: -apple-system, system-ui, sans-serif;
}
.act-group .group-head { cursor: pointer; user-select: none; }
.act-group .group-head:hover { background: var(--hover); }
.act-group .group-head::before { content: '▾'; color: var(--muted); font-size: 10px; margin-right: 2px; }
.act-group.collapsed .group-head::before { content: '▸'; }
.act-group .group-name { color: var(--accent); font-weight: 600; font-size: 12px; }
.act-group .group-count { color: var(--muted); font-size: 10px; margin-left: auto; }
.act-group .group-body { padding-left: 4px; }
.act-group.collapsed .group-body { display: none; }
.act { padding: 6px 0 6px 12px; border-bottom: 1px dashed var(--border); border-left: 2px solid var(--border); margin-left: 12px; }
.act.collapsed pre { display: none; }
.act.collapsed .head { cursor: pointer; }
.act.collapsed .head::before { content: '▸'; color: var(--muted); margin-right: 4px; font-size: 10px; }
.act:not(.collapsed) .head::before { content: '▾'; color: var(--muted); margin-right: 4px; font-size: 10px; }
.act:last-child { border-bottom: 0; }
.act .head { display: flex; gap: 6px; align-items: center; color: var(--muted); margin-bottom: 4px; font-family: -apple-system, system-ui, sans-serif; }
.act .head .who { color: var(--accent); font-weight: 600; font-size: 11px; }
.act .head .tool { color: var(--text); font-size: 11px; padding: 1px 6px; background: var(--bg); border-radius: 4px; }
.act .head .target { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.act .head .act-time { color: var(--muted); font-size: 10px; flex-shrink: 0; }
.act .head .expand { background: transparent; border: 0; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 14px; }
.act .head .expand:hover { color: var(--text); }
.act pre { margin: 0; padding: 4px 6px; background: var(--bg); border-radius: 4px; max-height: 240px; overflow: auto; white-space: pre; word-break: normal; }
.act .diff-line { display: block; padding: 0 4px; }
.act .diff-line.add { background: var(--add); color: var(--add-text); }
.act .diff-line.del { background: var(--del); color: var(--del-text); }
.act .diff-line.ctx { color: var(--text); opacity: 0.85; }
.act .diff-line.hunk { color: var(--accent); background: rgba(106,169,255,0.08); font-weight: 600; }

.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 720px; }
.msg.self { align-self: flex-end; flex-direction: row-reverse; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; background: var(--other);
  display: flex; align-items: center; justify-content: center; color: var(--text);
  font-weight: 600; font-size: 13px; overflow: hidden; text-transform: uppercase;
}
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg .bubble { background: var(--other); padding: 6px 10px; border-radius: 10px; word-wrap: break-word; white-space: pre-wrap; }
.msg.self .bubble { background: var(--self); }
.msg .meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; display: flex; gap: 8px; }
.msg .author { color: var(--accent); font-weight: 600; }
.msg.flash .bubble { animation: flash-msg 1.6s ease-out; }
@keyframes flash-msg {
  0% { box-shadow: 0 0 0 3px rgba(106,169,255,0.6); background: rgba(106,169,255,0.18); }
  100% { box-shadow: none; }
}
.msg.self .author { color: #82d8a0; }
.msg .attachments { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.msg .attachments .att-img { max-width: 280px; border-radius: 6px; }
.msg .attachments a { color: var(--accent); text-decoration: none; font-size: 13px; padding: 4px 8px; background: var(--bg); border-radius: 6px; display: inline-block; }

.system { align-self: center; font-size: 11px; color: var(--muted); font-style: italic; }

footer { display: flex; gap: 8px; padding: 10px 12px; background: var(--panel); border-top: 1px solid var(--border); align-items: flex-start; }
footer textarea { flex: 1; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; resize: none; font: 14px/1.4 system-ui; min-height: 40px; }
footer button { padding: 0 14px; height: 40px; background: var(--accent); color: #0e0f12; border: 0; border-radius: 8px; font-weight: 600; cursor: pointer; }
footer #mic, footer #attach { background: var(--panel); color: var(--text); border: 1px solid var(--border); font-size: 16px; padding: 0 10px; }
footer #mic.recording { background: #c33; color: white; border-color: #c33; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; min-width: 320px; max-width: 480px; max-height: 80vh; overflow: auto; }
.modal-card.big { width: 92vw; max-width: 1100px; height: 86vh; max-height: 86vh; display: flex; flex-direction: column; padding: 0; }
.modal-card.big .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-card.big h3 { margin: 0; }
.modal-card.big #am-close { background: transparent; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-card.big #am-body { flex: 1; overflow: auto; padding: 14px 18px; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
.modal-card.big #am-body pre { margin: 0; white-space: pre; }
.modal-card.big #am-body .diff-line { display: block; padding: 0 6px; }
.modal-card.big #am-body .diff-line.add { background: var(--add); color: var(--add-text); }
.modal-card.big #am-body .diff-line.del { background: var(--del); color: var(--del-text); }
.modal-card.big #am-body .diff-line.ctx { color: var(--text); opacity: 0.85; }
.modal-card.big #am-body .diff-line.hunk { color: var(--accent); background: rgba(106,169,255,0.08); font-weight: 600; padding: 2px 6px; }

#me-info .me-buttons { display: flex; gap: 4px; margin-top: 2px; }

#sm-body { padding: 14px 18px; }
#sm-body .sm-add { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; }
#sm-body .sm-add input { flex: 1; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
#sm-body .sm-add button { padding: 8px 14px; background: var(--accent); color: #0e0f12; border: 0; border-radius: 6px; font-weight: 600; cursor: pointer; }
#sm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#sm-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
#sm-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
#sm-table .tok { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: var(--muted); cursor: pointer; user-select: all; }
#sm-table .tok:hover { color: var(--text); }
#sm-table .actions { display: flex; gap: 4px; }
#sm-table .actions button { padding: 4px 8px; font-size: 11px; background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
#sm-table .actions button:hover { color: var(--text); border-color: var(--text); }
#sm-table .actions button.danger:hover { color: var(--del-text); border-color: var(--del-text); }

#gm-body { padding: 14px 18px; display: flex; flex-direction: column; flex: 1; gap: 12px; min-height: 0; }
#gm-body .gm-help { color: var(--muted); font-size: 12px; margin: 0; }
#gm-body #gm-content { flex: 1; min-height: 320px; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); resize: vertical; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
#gm-body #gm-content[readonly] { opacity: 0.85; }
#gm-body .gm-actions { display: flex; align-items: center; justify-content: space-between; }
#gm-body #gm-status { font-size: 12px; color: var(--muted); }
#gm-body #gm-save { padding: 8px 16px; background: var(--accent); color: #0e0f12; border: 0; border-radius: 6px; font-weight: 600; cursor: pointer; }
#gm-body #gm-save[disabled] { opacity: 0.5; cursor: not-allowed; }
#gm-meta { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 8px; }
#gm-tabs { display: flex; overflow-x: auto; background: var(--bg); border-bottom: 1px solid var(--border); flex-shrink: 0; }
#gm-tabs .gm-tab { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-right: 1px solid var(--border); cursor: pointer; font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
#gm-tabs .gm-tab:hover { color: var(--text); background: var(--hover); }
#gm-tabs .gm-tab.active { color: var(--text); background: var(--panel); border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
#gm-tabs .gm-tab .gm-lock { font-size: 10px; opacity: 0.6; }

#center-tabs { display: flex; overflow-x: auto; background: var(--bg); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ct-tab { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-right: 1px solid var(--border); cursor: pointer; font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.ct-tab:hover { color: var(--text); background: var(--hover); }
.ct-tab.active { color: var(--text); background: var(--panel); border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.ct-tab .ct-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.ct-tab .ct-close { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 14px; }
.ct-tab .ct-close:hover { color: var(--del-text); }
.ct-tab.dirty .ct-name::after { content: ' •'; color: var(--accent); }

#chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
#drop-overlay {
  position: absolute; inset: 0; z-index: 60; pointer-events: none;
  background: rgba(106,169,255,0.18); border: 3px dashed var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 22px; font-weight: 600; letter-spacing: 0.5px;
}
#editor-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#editor-view.hidden, #chat-view.hidden { display: none !important; }
#editor-view #ed-header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--border); }
#editor-view #ed-header strong { color: var(--accent); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#editor-view #ed-header #ed-status { color: var(--muted); font-size: 11px; }
#editor-view #ed-header button { padding: 6px 12px; border-radius: 6px; cursor: pointer; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12px; }
#editor-view #ed-header #ed-save { background: var(--accent); color: #0e0f12; border-color: var(--accent); font-weight: 600; }
#editor-view #ed-header button[disabled] { opacity: 0.5; cursor: not-allowed; }
#editor-view #ed-textarea { flex: 1; resize: none; padding: 16px; background: var(--bg); color: var(--text); border: 0; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre; tab-size: 2; outline: none; }
#editor-view .CodeMirror { flex: 1; height: auto; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
#editor-view .CodeMirror-scroll { min-height: 100% !important; }

.act .head .edit-btn { background: transparent; border: 0; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 12px; }
.act .head .edit-btn:hover { color: var(--accent); }

.msg .bubble pre.code-snippet {
  margin: 6px 0 0; padding: 8px 10px; background: var(--bg); border-left: 3px solid var(--accent);
  border-radius: 4px; font: 12px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  overflow-x: auto; white-space: pre;
}
.msg .bubble pre.code-snippet .code-meta { color: var(--muted); font-size: 10px; margin-bottom: 4px; display: block; }
.modal-card h3 { margin: 0 0 12px; }
.modal-card label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.modal-card input[type="text"] { padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.modal-card .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.modal-card .row button { padding: 6px 14px; border-radius: 6px; cursor: pointer; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.modal-card .row button#pf-save, .modal-card .row button#nc-create { background: var(--accent); color: #0e0f12; border-color: var(--accent); font-weight: 600; }
#nc-members { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; padding: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }
#nc-members label { flex-direction: row; align-items: center; gap: 8px; margin: 0; color: var(--text); cursor: pointer; }

@media (max-width: 720px) {
  #side { display: none; }
  #left { width: 180px; }
}
