/* Kairo Studio: sidebar of agents, chat in the middle, workspace on the right. */
body.studio { height: 100vh; height: 100dvh; overflow: hidden; }
.app {
  position: relative; z-index: 1; display: grid; height: 100vh; height: 100dvh;
  grid-template-columns: 272px minmax(0, 1fr) 348px;
}
.av {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 11px;
  color: #0b0a14; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 18px -8px rgba(0, 0, 0, 0.7);
}
.av .i { width: 18px; height: 18px; stroke-width: 2; }
.big-av { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 20px; color: #0b0a14; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 18px 40px -18px rgba(0, 0, 0, 0.8); }
.big-av .i { width: 30px; height: 30px; stroke-width: 1.9; }
.up { color: var(--up); }
.down { color: var(--down); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 12px; }
.link-btn { border: 0; background: none; padding: 4px 2px; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 181, 71, 0.4); }
.link-btn:hover { text-decoration-color: var(--accent); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; min-width: 36px; padding: 0 10px;
  border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); color: var(--muted);
  font-size: 13px; font-weight: 500; white-space: nowrap; transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); border-color: var(--line-2); }
.icon-btn.on { color: var(--accent); border-color: rgba(255, 181, 71, 0.4); background: rgba(255, 181, 71, 0.08); }

input:not([type=checkbox]):not([type=file]), textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.28); color: var(--text); font-size: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
input:not([type=checkbox]):not([type=file]):focus, textarea:focus, select:focus { border-color: rgba(255, 181, 71, 0.6); box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.14); }
input::placeholder, textarea::placeholder { color: var(--dim); }
select option { background: var(--panel-solid); }
input[type=checkbox] { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; flex: none; }

/* ---------- Sidebar ---------- */
.side {
  display: flex; flex-direction: column; min-height: 0; padding: 16px 12px 14px; gap: 4px;
  background: rgba(9, 9, 17, 0.78); border-right: 1px solid var(--line); backdrop-filter: blur(18px);
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 14px; }
.side-close { display: none; }
.side-label { padding: 6px 10px 4px; font: 600 11px var(--font); letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.side-label.mine { margin-top: 12px; }
.agent-nav { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 2px 8px; scrollbar-width: thin; }
.agent-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border-radius: 13px;
  border: 1px solid transparent; background: transparent; text-align: left; transition: background 0.2s, border-color 0.2s;
}
.agent-item:hover { background: rgba(255, 255, 255, 0.045); }
.agent-item.active { background: linear-gradient(120deg, rgba(255, 181, 71, 0.12), rgba(143, 124, 255, 0.1)); border-color: rgba(255, 255, 255, 0.1); }
.agent-item.active::before { content: ""; position: absolute; left: -3px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.agent-item .meta { flex: 1; min-width: 0; display: grid; }
.agent-item .nm { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; }
.agent-item .tg { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(75, 227, 160, 0.12); flex: none; }
.dot.paused { background: var(--warn); box-shadow: 0 0 0 3px rgba(255, 207, 92, 0.14); }
.custom-tag { padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 600; color: var(--accent-2); background: rgba(143, 124, 255, 0.14); letter-spacing: 0.02em; }
.agent-item .edit { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--dim); opacity: 0; transition: opacity 0.2s, color 0.2s, background 0.2s; }
.agent-item:hover .edit, .agent-item.active .edit, .agent-item .edit:focus-visible { opacity: 1; }
.agent-item .edit:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.new-agent {
  display: flex; align-items: center; gap: 11px; margin-top: 6px; width: 100%; padding: 9px 10px; border-radius: 13px;
  border: 1px dashed var(--line-2); background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.new-agent:hover { color: var(--accent); border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.05); }
.new-agent .plus { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: rgba(255, 255, 255, 0.05); }
.side-foot { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-btn {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px;
  border: 0; background: transparent; color: var(--muted); font-size: 13.5px; text-decoration: none; text-align: left; transition: color 0.2s, background 0.2s;
}
.side-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.side-btn > span:not(.acc-dot) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-btn kbd { margin-left: auto; }
.acc-dot { display: none; position: absolute; left: 23px; top: 7px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid #0b0a14; background: var(--dim); }
.acc-dot.synced, .acc-dot.syncing, .acc-dot.error, .acc-dot.off { display: block; }
.acc-dot.synced { background: var(--ok); }
.acc-dot.syncing { background: var(--warn); animation: pulse 1.1s ease-in-out infinite; }
.acc-dot.error { background: var(--danger); }
.side-social { padding: 8px 6px 0; }

.scrim { display: none; }

/* ---------- Main and header ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; min-height: 64px; border-bottom: 1px solid var(--line); background: rgba(7, 7, 13, 0.55); backdrop-filter: blur(16px); position: relative; z-index: 3; }
.side-toggle { display: none; }
.bar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; }
.bar-title .av { width: 38px; height: 38px; border-radius: 12px; }
.bt-text { min-width: 0; }
.bt-text h1 { margin: 0; font: 600 16px/1.25 var(--display); letter-spacing: -0.01em; }
.bt-text p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--dim); }
.st-dot.on { background: var(--ok); box-shadow: 0 0 10px rgba(75, 227, 160, 0.7); }
.st-dot.paused { background: var(--warn); }
.bar-mini { height: 32px; font-size: 12.5px; }
.bar-actions { display: flex; gap: 6px; flex: none; }

/* ---------- Chat ---------- */
.chat-view { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }
.thread { max-width: 820px; margin: 0 auto; padding: 28px 24px 12px; }
.thread:not(.settled) .msg, .msg.fresh { animation: msgIn 0.35s ease both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6vh 0 24px; }
.empty .big-av { margin-bottom: 16px; animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-5px); } }
.empty h2 { margin: 0 0 6px; font: 600 clamp(22px, 3vw, 28px)/1.2 var(--display); letter-spacing: -0.02em; }
.empty > p { margin: 0 0 24px; max-width: 520px; color: var(--muted); }
.suggest { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sug {
  display: grid; gap: 2px; padding: 13px 15px; text-align: left; border-radius: 15px; border: 1px solid var(--line);
  background: var(--panel); transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.sug:hover { border-color: rgba(255, 181, 71, 0.45); background: rgba(255, 181, 71, 0.05); transform: translateY(-2px); }
.sug b { font-size: 14px; font-weight: 600; }
.sug span { font-size: 12.5px; color: var(--muted); }
.task-ideas { width: 100%; display: grid; gap: 10px; margin-top: 14px; }
.task-idea {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; border-radius: 15px;
  border: 1px solid rgba(255, 181, 71, 0.25); background: linear-gradient(120deg, rgba(255, 181, 71, 0.09), rgba(255, 181, 71, 0.02)); transition: border-color 0.2s, transform 0.2s;
}
.task-idea.deep { border-color: rgba(143, 124, 255, 0.3); background: linear-gradient(120deg, rgba(143, 124, 255, 0.11), rgba(143, 124, 255, 0.02)); }
.task-idea:hover { transform: translateY(-2px); border-color: rgba(255, 181, 71, 0.55); }
.task-idea.deep:hover { border-color: rgba(143, 124, 255, 0.6); }
.task-idea > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 2px; }
.task-idea b { font-size: 14px; }
.task-idea small { font-size: 12.5px; color: var(--muted); }
.ti-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: rgba(255, 181, 71, 0.16); color: var(--accent); }
.task-idea.deep .ti-ic { background: rgba(143, 124, 255, 0.18); color: var(--accent-2); }
.offline-note { display: inline-flex; align-items: center; gap: 7px; margin: 18px 0 0; padding: 7px 13px; border-radius: 999px; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }

.msg { display: flex; gap: 12px; margin: 0 0 24px; min-width: 0; }
.msg.user { justify-content: flex-end; align-items: flex-start; gap: 6px; }
.bubble {
  max-width: min(78%, 620px); padding: 10px 15px; border-radius: 18px 18px 6px 18px; white-space: pre-wrap; overflow-wrap: anywhere;
  background: linear-gradient(135deg, rgba(255, 181, 71, 0.2), rgba(255, 138, 92, 0.14)); border: 1px solid rgba(255, 181, 71, 0.25);
}
.bubble.file { display: flex; align-items: center; gap: 10px; white-space: normal; }
.bubble.file span:last-child, .att-file > span:last-child { display: grid; min-width: 0; }
.bubble.file b, .att-file b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble.file small, .att-file small { font-size: 12px; color: var(--muted); }
.fi { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(0, 0, 0, 0.25); color: var(--accent); }
.att-file { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; white-space: normal; }
.att-img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex: none; }
.bubble.task-goal { background: linear-gradient(135deg, rgba(143, 124, 255, 0.2), rgba(255, 181, 71, 0.12)); border-color: rgba(143, 124, 255, 0.32); }
.bubble.task-goal .tg { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-2); white-space: normal; }
.bubble.task-goal .tg .i { width: 14px; height: 14px; }
.u-edit { width: 30px; height: 30px; margin-top: 4px; display: grid; place-items: center; flex: none; border-radius: 9px; border: 0; background: transparent; color: var(--dim); opacity: 0; transition: opacity 0.2s, color 0.2s, background 0.2s; }
.msg.user:hover .u-edit, .u-edit:focus-visible { opacity: 1; }
.u-edit:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.u-edit .i { width: 15px; height: 15px; }
@media (hover: none) { .u-edit { opacity: 0.7; } }

.msg.bot .body { flex: 1; min-width: 0; }
.who { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 6px 0 6px; font-size: 13.5px; font-weight: 600; }
.who span { font-weight: 400; color: var(--dim); display: inline-flex; align-items: center; gap: 4px; }
.who .i { width: 12px; height: 12px; }

.steps { margin: 2px 0 10px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); overflow: hidden; }
.steps-head { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 12px; border: 0; background: transparent; color: var(--muted); font-size: 13px; text-align: left; }
.steps-head:hover { color: var(--text); }
.steps-head .chev { margin-left: auto; display: grid; transition: transform 0.2s; }
.steps-head .chev .i { width: 15px; height: 15px; }
.steps:not(.collapsed) .chev { transform: rotate(180deg); }
.steps-list { list-style: none; margin: 0; padding: 2px 12px 10px; display: grid; gap: 6px; }
.steps.collapsed .steps-list { display: none; }
.steps-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--muted); animation: msgIn 0.25s ease both; overflow-wrap: anywhere; }
.steps-list li.done { color: var(--text); opacity: 0.85; }
.st-d { color: var(--muted); }
.ic { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 50%; margin-top: 1px; }
.ic .i { width: 11px; height: 11px; stroke-width: 2.6; }
.ic.ok { background: rgba(75, 227, 160, 0.16); color: var(--ok); }
.ic.bad { background: rgba(255, 107, 129, 0.16); color: var(--danger); }
.ic.spin { border: 2px solid rgba(255, 255, 255, 0.12); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.task-sum .steps-head { flex-wrap: wrap; }
.tb-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 181, 71, 0.14); color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tb-badge .i { width: 13px; height: 13px; }
.task-sum.deep .tb-badge, .tboard.deep .tb-badge { background: rgba(143, 124, 255, 0.16); color: var(--accent-2); }
.plan-li { font-weight: 500; }

/* Rendered Markdown */
.md { font-size: 15px; line-height: 1.68; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 11px; }
.md h4 { margin: 18px 0 8px; font: 600 15.5px/1.35 var(--display); letter-spacing: -0.01em; color: #fff; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md li::marker { color: var(--accent); }
.md li.sub { margin-left: 18px; list-style-type: circle; }
.md strong { color: #fff; font-weight: 600; }
.md em { color: #e8e4ff; }
.md del { color: var(--dim); }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 181, 71, 0.35); }
.md a:hover { text-decoration-color: var(--accent); }
.md code { font: 13px var(--mono); padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); }
.md pre { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); overflow-x: auto; }
.md pre code { padding: 0; border: 0; background: none; font-size: 12.5px; white-space: pre; }
.md blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: rgba(255, 181, 71, 0.06); color: #e9e6f7; }
.md blockquote p:last-child { margin-bottom: 0; }
.md hr { border: 0; height: 1px; background: var(--line-2); margin: 16px 0; }
.md .tbl, .tbl { margin: 0 0 12px; overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.tbl table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 8px 11px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl th { background: rgba(255, 255, 255, 0.05); font-weight: 600; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.md.cursor > :last-child::after { content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 3px; vertical-align: -2px; background: var(--accent); border-radius: 2px; animation: blink 0.9s steps(2) infinite; }
.md.cursor > ul:last-child::after, .md.cursor > ol:last-child::after, .md.cursor > .tbl:last-child::after, .md.cursor > pre:last-child::after { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.thinking { display: inline-flex; gap: 5px; padding: 6px 0; }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s ease-in-out infinite; }
.thinking i:nth-child(2) { animation-delay: 0.15s; }
.thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.45; } 40% { transform: translateY(-5px); opacity: 1; } }

/* Reply actions */
.actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.act {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--dim); font-size: 12.5px; text-decoration: none; transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.act .i { width: 15px; height: 15px; }
.act:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.act.on { color: var(--accent); }
.act.speaking { color: var(--accent); background: rgba(255, 181, 71, 0.1); border-color: rgba(255, 181, 71, 0.3); }
.follow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.follow button {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--muted);
  font-size: 13px; text-align: left; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.follow button:hover { color: var(--text); border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.06); }
.mem-chip {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid rgba(143, 124, 255, 0.3); background: rgba(143, 124, 255, 0.08); font-size: 13px; transition: opacity 0.25s, transform 0.25s;
}
.mem-chip.out { opacity: 0; transform: translateY(-4px); }
.mc-ic { color: var(--accent-2); display: grid; }
.mc-t { flex: 1; min-width: 0; color: var(--muted); }
.mc-t b { color: var(--text); font-weight: 600; }
.mc-save { padding: 5px 12px; border-radius: 999px; border: 0; background: var(--accent-2); color: #0b0a14; font-weight: 600; font-size: 12.5px; }
.mc-x { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--dim); }
.mc-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* Chart */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; margin: 14px 0 4px; padding: 14px 12px 0; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.chart .col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px; }
.bar-v { width: 100%; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--accent-2), rgba(143, 124, 255, 0.35)); transform-origin: bottom; }
.msg.anim .bar-v, .msg.fresh .bar-v, .thread:not(.settled) .bar-v, .pv-bubble .bar-v { animation: grow 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.bar-v.top { background: linear-gradient(180deg, var(--accent), rgba(255, 181, 71, 0.4)); }
@keyframes grow { from { transform: scaleY(0); } }
.chart .lb { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-bottom: 8px; }

/* Documents and sources */
.doc-refs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; }
.dr-l { display: inline-flex; align-items: center; gap: 5px; color: var(--dim); }
.dr { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srcs { margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.srcs-h { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.srcs-h small { color: var(--dim); font-weight: 400; }
.srcs ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; }
.srcs li::marker { color: var(--dim); }
.srcs a { display: grid; text-decoration: none; min-width: 0; }
.srcs a b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srcs a small { color: var(--dim); font-size: 12px; }
.srcs a:hover b { color: var(--accent); }
.toc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 12px; }
.toc-l { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dim); margin-right: 2px; }
.toc button { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12.5px; }
.toc button:hover { color: var(--text); border-color: rgba(143, 124, 255, 0.5); }

/* Live board for tasks and deep research */
.tboard { position: relative; margin: 2px 0 12px; padding: 14px; border-radius: 16px; border: 1px solid rgba(255, 181, 71, 0.22); background: linear-gradient(160deg, rgba(255, 181, 71, 0.06), rgba(255, 255, 255, 0.02)); overflow: hidden; }
.tboard.deep { border-color: rgba(143, 124, 255, 0.28); background: linear-gradient(160deg, rgba(143, 124, 255, 0.08), rgba(255, 255, 255, 0.02)); }
.tb-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.tb-status { font-size: 13px; color: var(--text); font-weight: 500; }
.tb-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.tb-count.bump { animation: bump 0.4s ease; }
@keyframes bump { 40% { transform: scale(1.15); color: var(--accent); } }
.tb-scan { position: relative; height: 2px; margin: 12px 0; border-radius: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.tb-scan i { position: absolute; top: 0; bottom: 0; width: 30%; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: scan 1.5s ease-in-out infinite; }
.tboard.deep .tb-scan i { background: linear-gradient(90deg, transparent, var(--accent-2), transparent); }
.tboard.done .tb-scan { opacity: 0; }
@keyframes scan { from { left: -30%; } to { left: 100%; } }
.tb-plan { margin: 0 0 10px; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 6px; }
.tb-plan li { counter-increment: step; display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.tb-plan li::before { content: counter(step); width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); font-size: 11px; font-weight: 600; }
.tb-plan li.now { color: var(--text); }
.tb-plan li.now::before { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.14); }
.tb-plan li.done { color: var(--text); opacity: 0.8; }
.tb-plan li.done::before { content: "✓"; background: rgba(75, 227, 160, 0.16); border-color: transparent; color: var(--ok); }
.tb-plan li.ghost { height: 20px; border-radius: 8px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.tb-plan li.ghost::before { display: none; }
.tb-plan li.ghost:nth-child(2) { width: 80%; }
.tb-plan li.ghost:nth-child(3) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.tb-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; max-height: 340px; overflow-y: auto; scrollbar-width: thin; }
.tboard.done .tb-log { max-height: 200px; }
.tl { display: flex; gap: 10px; padding: 8px 10px; border-radius: 11px; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line); animation: msgIn 0.25s ease both; font-size: 13px; }
.ti { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.ti .i { width: 14px; height: 14px; }
.tl.run .ti { color: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.tl.done .ti { color: var(--ok); background: rgba(75, 227, 160, 0.1); }
.tl.fail .ti { color: var(--danger); background: rgba(255, 107, 129, 0.1); }
.tl-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tl-body b { font-weight: 600; }
.td { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-body small { color: var(--dim); font-size: 12px; }
.tl-body .chips { margin-top: 3px; }
.tl-body .chips span { font-size: 11px; padding: 1px 7px; }
.tboard.writing .tl.write .ti { color: var(--accent-2); }
@keyframes pulse { 50% { opacity: 0.45; } }

/* Market data (always US dollars) */
.mk-cards { display: grid; gap: 10px; margin: 2px 0 12px; }
.mk-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mk { padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(75, 227, 160, 0.07), rgba(255, 255, 255, 0.02)); min-width: 0; }
.msg.fresh .mk, .msg.fresh .cmp, .msg.fresh .br, .msg.fresh .gen-img, .msg.anim .mk, .msg.anim .cmp, .msg.anim .br, .msg.anim .gen-img { animation: msgIn 0.4s ease both; }
.mk.down { background: linear-gradient(160deg, rgba(255, 107, 129, 0.07), rgba(255, 255, 255, 0.02)); }
.mk-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mk-sym { font: 700 15px var(--display); }
.mk-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--ok); text-transform: uppercase; letter-spacing: 0.05em; }
.mk-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse 1.4s ease-in-out infinite; }
.mk-chain { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(143, 124, 255, 0.14); color: var(--accent-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.mk-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 8px 0 10px; }
.mk-price b { font: 700 26px/1.1 var(--display); letter-spacing: -0.02em; }
.mk-chg { font-weight: 600; font-size: 14px; }
.mk.up .mk-chg { color: var(--up); }
.mk.down .mk-chg { color: var(--down); }
.mk-chg small { color: var(--dim); font-weight: 400; }
.mk-sub { font-size: 12.5px; color: var(--muted); }
.mk-range { margin-bottom: 10px; }
.mk-l { font-size: 11.5px; color: var(--dim); }
.mk-bar { position: relative; height: 5px; margin: 6px 0 4px; border-radius: 5px; background: linear-gradient(90deg, rgba(255, 107, 129, 0.5), rgba(255, 207, 92, 0.5), rgba(75, 227, 160, 0.5)); }
.mk-bar i { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid #0b0a14; transform: translate(-50%, -50%); }
.mk-range small { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.mk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mk-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mk-stats span { display: grid; gap: 1px; padding: 7px 9px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); font-size: 13px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.mk-stats small { font-size: 11px; font-weight: 400; color: var(--dim); }
.mk-addr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.mk-addr code { font: 12px var(--mono); padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); color: var(--text); }
.mk-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.mk-acts .act { border-color: var(--line); color: var(--muted); }
.mk-foot { margin-top: 10px; font-size: 11.5px; color: var(--dim); }
.cmp { margin: 2px 0 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.cmp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font: 600 15px var(--display); }
.cmp-vs { color: var(--dim); font: 400 12px var(--font); }
.cmp .tbl { margin: 0; }
.cmp td:first-child { color: var(--muted); white-space: nowrap; }
.brief-rows { display: grid; gap: 6px; margin: 2px 0 12px; }
.br { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); font-size: 13.5px; min-width: 0; }
.br b { font-family: var(--display); }
.br-n { flex: 1; min-width: 0; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-p { font-weight: 600; }
.br-c { min-width: 62px; text-align: right; font-weight: 600; }
.br.up .br-c { color: var(--up); }
.br.down .br-c { color: var(--down); }
.mk-mini { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: 3px; font-size: 12.5px; }
.mk-mini.up span { color: var(--up); }
.mk-mini.down span { color: var(--down); }
.mk-mini small { color: var(--dim); }

/* Images made by Muse */
.gen-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 2px 0 12px; }
.gen-img { margin: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); }
.gen-img img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.gen-img figcaption { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.gi-p { flex: 1; min-width: 0; font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Read aloud */
.speak-strip { margin-top: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255, 181, 71, 0.3); background: rgba(255, 181, 71, 0.06); animation: msgIn 0.25s ease both; }
.speak-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; color: var(--muted); }
.speak-top .lang { padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); font-size: 11.5px; }
.speak-top button { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: 12px; color: var(--text); }
.speak-top button:first-of-type { margin-left: auto; }
.speak-top button:hover { border-color: rgba(255, 181, 71, 0.5); }
.wave { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.wave i { width: 3px; height: 100%; border-radius: 2px; background: var(--accent); animation: wave 0.9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: 0.15s; }
.wave i:nth-child(3) { animation-delay: 0.3s; }
.wave i:nth-child(4) { animation-delay: 0.45s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
.speak-now { margin: 6px 0 8px; font-size: 14px; color: var(--text); }
.speak-bar { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.speak-bar i { display: block; height: 100%; background: var(--accent); transition: width 0.3s ease; }

/* ---------- Composer ---------- */
.dock { position: relative; z-index: 4; padding: 0 20px 14px; background: linear-gradient(180deg, transparent, rgba(7, 7, 13, 0.85) 30%); }
.dock-inner { position: relative; max-width: 820px; margin: 0 auto; }
.composer {
  position: relative; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "chip chip chip chip" "input input input input" "attach mode gap send";
  align-items: center; gap: 4px 6px; padding: 10px 10px 10px 12px; border-radius: 22px; border: 1px solid var(--line-2);
  background: rgba(18, 17, 31, 0.92); box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.9); backdrop-filter: blur(16px); transition: border-color 0.2s, box-shadow 0.2s;
}
.composer:focus-within { border-color: rgba(255, 181, 71, 0.45); box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.1), 0 20px 50px -24px rgba(0, 0, 0, 0.9); }
.composer.task-on { border-color: rgba(255, 181, 71, 0.5); background: linear-gradient(160deg, rgba(40, 30, 18, 0.95), rgba(18, 17, 31, 0.95)); }
.composer.deep-on { border-color: rgba(143, 124, 255, 0.55); background: linear-gradient(160deg, rgba(30, 24, 52, 0.95), rgba(18, 17, 31, 0.95)); }
.composer.off { opacity: 0.55; }
.composer textarea {
  grid-area: input; width: 100%; min-height: 26px; max-height: 200px; padding: 6px 4px; border: 0; background: transparent;
  resize: none; font-size: 15px; line-height: 1.5; box-shadow: none; overflow-y: auto;
}
.composer textarea:focus { border: 0; box-shadow: none; }
.c-btn { grid-area: attach; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; border: 0; background: transparent; color: var(--muted); transition: color 0.2s, background 0.2s; }
.c-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.c-mode {
  grid-area: mode; justify-self: start; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 11px;
  border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--muted); font-size: 13px; font-weight: 600; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.c-mode .i { width: 15px; height: 15px; }
.c-mode .cv { width: 13px; height: 13px; opacity: 0.7; }
.c-mode:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.24); }
.c-mode[data-mode="task"] { color: var(--accent); border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.1); }
.c-mode[data-mode="deep"] { color: var(--accent-2); border-color: rgba(143, 124, 255, 0.55); background: rgba(143, 124, 255, 0.12); }
.send {
  grid-area: send; position: relative; overflow: hidden; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; border: 0;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -10px rgba(255, 181, 71, 0.8); transition: transform 0.15s, background 0.2s, opacity 0.2s;
}
.send .i { stroke-width: 2.4; }
.send:hover:not(:disabled) { background: #ffc46b; transform: translateY(-1px); }
.send:disabled { opacity: 0.35; box-shadow: none; }
.send.stop { background: #2a2740; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.send.stop .i { width: 16px; height: 16px; fill: currentColor; }
.ripple { position: absolute; inset: 0; margin: auto; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); animation: ripple 0.6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(7); opacity: 0; } }
.att-chip { grid-area: chip; display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin-bottom: 4px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); min-width: 0; }
.att-chip.in { animation: msgIn 0.25s ease both; }
.att-chip img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: none; }
.ac-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 181, 71, 0.14); color: var(--accent); }
.ac-meta { flex: 1; min-width: 0; display: grid; }
.ac-meta b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-meta small { font-size: 12px; color: var(--muted); }
.ac-x { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--muted); }
.ac-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.hint { margin-top: 7px; text-align: center; font-size: 12px; color: var(--dim); }
.hint b { color: var(--muted); font-weight: 600; }
.mode-menu {
  position: absolute; left: 8px; bottom: calc(100% + 8px); z-index: 20; width: min(330px, calc(100% - 16px)); padding: 6px;
  border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel-solid); box-shadow: var(--shadow); animation: pop 0.16s ease both;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.mode-menu button { display: flex; align-items: flex-start; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 11px; border: 1px solid transparent; background: transparent; text-align: left; }
.mode-menu button:hover, .mode-menu button:focus-visible { background: rgba(255, 255, 255, 0.05); outline: none; }
.mode-menu button.sel { border-color: rgba(255, 181, 71, 0.35); background: rgba(255, 181, 71, 0.06); }
.mode-menu .mm-deep.sel { border-color: rgba(143, 124, 255, 0.4); background: rgba(143, 124, 255, 0.08); }
.mode-menu button > span:last-child { display: grid; gap: 1px; }
.mode-menu b { font-size: 14px; }
.mode-menu small { font-size: 12.5px; color: var(--muted); }
.mi { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.mm-task .mi { color: var(--accent); background: rgba(255, 181, 71, 0.12); }
.mm-deep .mi { color: var(--accent-2); background: rgba(143, 124, 255, 0.14); }
.slash {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 20; max-height: 300px; overflow-y: auto; padding: 6px;
  border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel-solid); box-shadow: var(--shadow); animation: pop 0.14s ease both;
}
.slash-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; text-align: left; font-size: 13.5px; color: var(--muted); }
.slash-item code { font: 600 13px var(--mono); color: var(--accent); min-width: 92px; }
.slash-item.sel, .slash-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.paused-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; padding: 9px 12px; border-radius: 14px; border: 1px solid rgba(255, 207, 92, 0.35); background: rgba(255, 207, 92, 0.08); font-size: 13.5px; color: #ffe3a3; }
.paused-bar span { display: inline-flex; align-items: center; gap: 8px; }
.dropzone { position: absolute; inset: 10px; z-index: 30; display: grid; place-items: center; border-radius: 22px; border: 2px dashed rgba(255, 181, 71, 0.6); background: rgba(7, 7, 13, 0.85); backdrop-filter: blur(4px); pointer-events: none; animation: pop 0.15s ease both; }
.dz-box { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 20px; color: var(--muted); font-size: 13.5px; }
.dz-box b { color: var(--text); font: 600 18px var(--display); }
.dz-ico { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: rgba(255, 181, 71, 0.14); color: var(--accent); }

/* ---------- Workspace ---------- */
.ws { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: rgba(9, 9, 17, 0.78); border-left: 1px solid var(--line); backdrop-filter: blur(18px); }
.app.ws-closed .ws { display: none; }
.app.ws-closed { grid-template-columns: 272px minmax(0, 1fr); }
.ws-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.ws-head h3 { margin: 0; font: 600 16px var(--display); }
.ws-tabs { display: flex; gap: 2px; padding: 4px 10px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tab { position: relative; flex: none; padding: 6px 8px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.ws-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.ws-tab.active { color: var(--text); background: rgba(255, 255, 255, 0.08); border-color: var(--line-2); }
.pip { display: none; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pip.show { display: block; animation: pulse 1.2s ease-in-out 3; }
.ws-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.ws-empty { display: grid; justify-items: center; gap: 10px; padding: 28px 12px; text-align: center; font-size: 13.5px; color: var(--muted); }
.ws-empty .e { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, 0.05); color: var(--dim); }
.ws-intro { margin: 0; font-size: 13px; color: var(--muted); }
.ws-intro b { color: var(--text); font-weight: 600; }
.ws-note { margin: 0; font-size: 11.5px; color: var(--dim); text-align: center; }
.ws-add { display: flex; gap: 6px; }
.ws-add input { flex: 1; min-width: 0; padding: 8px 12px !important; }
.saved { border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); overflow: hidden; flex: none; }
.saved-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; text-align: left; }
.saved-head .av { width: 28px; height: 28px; border-radius: 9px; }
.saved-head .av .i { width: 14px; height: 14px; }
.saved-head b { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-head small { flex: none; font-size: 11.5px; color: var(--dim); }
.saved-body { display: none; padding: 0 12px 12px; }
.saved.open .saved-body { display: block; }
.saved-body .md { font-size: 13.5px; max-height: 320px; overflow-y: auto; }
.saved-body .chart { height: 120px; }
.saved-acts { display: flex; gap: 4px; margin-top: 8px; }
.progress { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); overflow: hidden; flex: none; }
.progress i { display: block; height: 100%; border-radius: 6px; background: var(--grad); transition: width 0.4s ease; }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); cursor: pointer; flex: none; transition: border-color 0.2s; }
.task:hover { border-color: var(--line-2); }
.task input { margin-top: 2px; }
.tk-t { flex: 1; min-width: 0; display: grid; gap: 1px; font-size: 13.5px; overflow-wrap: anywhere; }
.tk-t small { font-size: 11.5px; color: var(--dim); }
.task.done .tk-t { color: var(--dim); text-decoration: line-through; }
.x { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--dim); }
.x .i { width: 14px; height: 14px; }
.x:hover { color: var(--danger); background: rgba(255, 107, 129, 0.1); }
.task-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); flex: none; }
.watch-list { display: flex; flex-wrap: wrap; gap: 6px; }
.watch-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); font-size: 13px; max-width: 100%; }
.watch-chip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-chip button { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--dim); }
.watch-chip button:hover { color: var(--danger); background: rgba(255, 107, 129, 0.12); }
.watch-go { width: 100%; }
.topic { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); flex: none; }
.tp-head { display: flex; gap: 10px; }
.tp-head .av { width: 30px; height: 30px; border-radius: 9px; }
.tp-meta { min-width: 0; display: grid; gap: 2px; }
.tp-meta b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.tp-meta small { font-size: 12px; color: var(--dim); }
.tp-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hist-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.28); color: var(--dim); flex: none; }
.hist-search:focus-within { border-color: rgba(255, 181, 71, 0.6); }
.hist-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 9px 0 !important; }
#histList { display: flex; flex-direction: column; gap: 4px; }
.hist-group { margin: 8px 2px 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.hist { display: flex; align-items: center; gap: 4px; border-radius: 12px; transition: background 0.2s; }
.hist:hover { background: rgba(255, 255, 255, 0.04); }
.hist-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.hist-open .av { width: 30px; height: 30px; border-radius: 9px; }
.hist-open .av .i { width: 15px; height: 15px; }
.hist-open > span:last-child { min-width: 0; display: grid; }
.hist-open b { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-open small { font-size: 12px; color: var(--dim); }

/* ---------- Command palette ---------- */
.overlay { position: fixed; inset: 0; z-index: 140; background: rgba(4, 4, 10, 0.6); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.palette {
  position: fixed; left: 50%; top: 12vh; z-index: 141; width: min(620px, calc(100vw - 32px)); display: none; flex-direction: column;
  border-radius: 20px; border: 1px solid var(--line-2); background: var(--panel-solid); box-shadow: var(--shadow); transform: translateX(-50%); overflow: hidden;
}
.palette.show { display: flex; animation: palIn 0.18s ease both; }
@keyframes palIn { from { opacity: 0; transform: translate(-50%, -8px) scale(0.98); } to { opacity: 1; transform: translateX(-50%); } }
.pal-search { display: flex; align-items: center; gap: 10px; padding: 4px 16px; border-bottom: 1px solid var(--line); color: var(--dim); }
.pal-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 13px 0 !important; font-size: 16px !important; }
.pal-list { max-height: min(60vh, 480px); overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.pal-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.pal-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border-radius: 11px; border: 0; background: transparent; text-align: left; }
.pal-item .av { width: 30px; height: 30px; border-radius: 9px; }
.pal-item .av .i { width: 15px; height: 15px; }
.pal-item .pl { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item small { margin-left: auto; padding-left: 10px; font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pal-item.sel, .pal-item:hover { background: rgba(255, 255, 255, 0.07); }
.pal-item.sel small { color: var(--muted); }

/* ---------- Agent Builder ---------- */
.builder { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(4, 4, 10, 0.7); backdrop-filter: blur(6px); animation: fade 0.18s ease both; }
@keyframes fade { from { opacity: 0; } }
.b-sheet { width: min(1180px, 100%); height: min(860px, calc(100dvh - 40px)); display: flex; flex-direction: column; border-radius: 24px; border: 1px solid var(--line-2); background: #0e0d19; box-shadow: var(--shadow); overflow: hidden; animation: pop 0.2s ease both; }
.b-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.b-head h2 { margin: 0; font: 600 20px var(--display); letter-spacing: -0.02em; }
.b-head p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.b-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.b-form { min-height: 0; overflow-y: auto; padding: 18px 22px 0; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; }
.b-templates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.b-templates:empty { display: none; }
.b-templates .lbl { font-size: 12.5px; color: var(--dim); margin-right: 2px; }
.b-templates button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); font-size: 13px; color: var(--muted); }
.b-templates button:hover { color: var(--text); border-color: rgba(255, 181, 71, 0.5); }
.b-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.b-field { display: grid; gap: 7px; min-width: 0; }
.b-field > span { font-size: 13px; font-weight: 600; color: var(--text); }
.b-field em { font-style: normal; font-weight: 400; color: var(--dim); margin-left: 4px; }
.b-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.b-icons button { height: 40px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); color: var(--muted); }
.b-icons button:hover { color: var(--text); border-color: var(--line-2); }
.b-icons button.sel { color: var(--accent); border-color: var(--accent); background: rgba(255, 181, 71, 0.1); }
.b-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.b-colors button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); transition: transform 0.15s; }
.b-colors button:hover { transform: scale(1.08); }
.b-colors button.sel { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15); }
.b-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.b-skill { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); text-align: left; }
.b-skill .av { width: 30px; height: 30px; border-radius: 9px; }
.b-skill .av .i { width: 15px; height: 15px; }
.b-skill > span:last-child { min-width: 0; display: grid; }
.b-skill b { font-size: 13.5px; }
.b-skill small { font-size: 12px; color: var(--muted); }
.b-skill:hover { border-color: var(--line-2); }
.b-skill.sel { border-color: rgba(255, 181, 71, 0.6); background: rgba(255, 181, 71, 0.07); }
.b-tones { display: flex; flex-wrap: wrap; gap: 6px; }
.b-tones button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.b-tones button.sel { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.b-docs-zone { padding: 12px; border-radius: 14px; border: 1px dashed var(--line-2); transition: border-color 0.2s, background 0.2s; }
.b-docs-zone.drag { border-color: var(--accent); background: rgba(255, 181, 71, 0.06); }
.b-docs { display: grid; gap: 6px; }
.doc-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.doc-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: rgba(143, 124, 255, 0.14); color: var(--accent-2); }
.doc-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.doc-meta b { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta small { font-size: 12px; color: var(--dim); }
.doc-bar { display: block; position: relative; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.doc-bar i { position: absolute; top: 0; bottom: 0; width: 35%; background: var(--accent-2); border-radius: 4px; animation: scan 1.2s ease-in-out infinite; }
.doc-cap { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin-top: 2px; }
.doc-cap i { display: block; height: 100%; background: var(--accent-2); }
.b-empty { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.025); font-size: 13px; color: var(--dim); }
.b-add { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; border: 1px dashed var(--line-2); background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.b-add:hover { color: var(--accent); border-color: rgba(255, 181, 71, 0.55); }
.b-knowledge { display: grid; gap: 8px; }
.k-item { position: relative; display: grid; gap: 6px; padding: 10px 44px 10px 10px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.k-item textarea { resize: vertical; }
.k-del { position: absolute; top: 10px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--dim); }
.doc-item .k-del { position: static; }
.k-del:hover { color: var(--danger); background: rgba(255, 107, 129, 0.1); }
.b-foot { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px -22px 0; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(14, 13, 25, 0.96); backdrop-filter: blur(10px); }
.b-spacer { flex: 1; }
.b-preview { min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-left: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.pv-label { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.pv-card { display: grid; justify-items: center; gap: 4px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); text-align: center; }
.pv-card .big-av { width: 54px; height: 54px; border-radius: 17px; margin-bottom: 6px; }
.pv-card h3 { margin: 0; font: 600 17px var(--display); overflow-wrap: anywhere; }
.pv-card p { margin: 0; font-size: 13px; color: var(--muted); }
.pv-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 8px; }
.pv-meta span { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); font-size: 11.5px; color: var(--muted); }
.pv-chat { flex: 1; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.pv-bubble { align-self: flex-start; max-width: 92%; padding: 9px 12px; border-radius: 14px 14px 14px 5px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font-size: 13.5px; overflow-wrap: anywhere; }
.pv-bubble.me { align-self: flex-end; border-radius: 14px 14px 5px 14px; background: rgba(255, 181, 71, 0.14); border-color: rgba(255, 181, 71, 0.25); }
.pv-bubble .md { font-size: 13.5px; }
.pv-bubble .chart { height: 110px; }
.pv-starters { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-starters button { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 12.5px; }
.pv-starters button:hover { color: var(--text); border-color: rgba(255, 181, 71, 0.5); }
.pv-try { display: flex; gap: 6px; }
.pv-try input { flex: 1; min-width: 0; }

/* ---------- Small dialogs ---------- */
.lite { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: rgba(4, 4, 10, 0.66); backdrop-filter: blur(6px); animation: fade 0.16s ease both; }
.lite-box { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--panel-solid); box-shadow: var(--shadow); animation: pop 0.2s ease both; scrollbar-width: thin; }
.lite-box.wide { width: min(660px, 100%); }
.lite-box > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.lite-box h3 { margin: 0; font: 600 18px var(--display); letter-spacing: -0.01em; }
.lite-sub { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.lite-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.share-card { display: flex; gap: 14px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); margin-bottom: 14px; }
.share-card .big-av { width: 52px; height: 52px; border-radius: 16px; }
.share-card .big-av .i { width: 24px; height: 24px; }
.sc-text { min-width: 0; display: grid; gap: 4px; }
.sc-text h4 { margin: 0; font: 600 16px var(--display); overflow-wrap: anywhere; }
.sc-text p { margin: 0; font-size: 13px; color: var(--muted); }
.sc-text .greet { margin-top: 4px; font-size: 13px; color: #e2def5; font-style: italic; overflow-wrap: anywhere; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; font: 13px var(--mono) !important; }
.about-text { resize: vertical; min-height: 130px; }
.about-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--dim); }
.about-ex button { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 12.5px; }
.about-ex button:hover { color: var(--text); border-color: rgba(255, 181, 71, 0.5); }
.about-count { margin-right: auto; font-size: 12px; color: var(--dim); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.25); }
.seg button { padding: 6px 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button.sel { background: rgba(255, 255, 255, 0.1); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.v-field { display: grid; gap: 6px; margin-bottom: 12px; }
.v-field > span { font-size: 13px; font-weight: 600; }
.v-auto { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); cursor: pointer; }
.v-auto input { margin-top: 3px; }
.v-auto span { display: grid; gap: 1px; }
.v-auto b { font-size: 13.5px; font-weight: 600; }
.v-auto small { font-size: 12.5px; color: var(--muted); }
.card-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.card-stage { display: grid; place-items: center; padding: 12px; border-radius: 16px; background: repeating-conic-gradient(rgba(255, 255, 255, 0.03) 0 25%, transparent 0 50%) 0 0 / 18px 18px; border: 1px solid var(--line); }
.card-stage canvas { display: block; max-width: 100%; max-height: min(56vh, 520px); width: auto; height: auto; border-radius: 12px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9); }

/* Account */
.acc-body { display: grid; gap: 12px; }
.acc-body > .lite-sub { margin: 0; }
.acc-tabs { display: flex; }
.acc-tabs button { flex: 1; }
.acc-form { display: grid; gap: 12px; }
.acc-form label, .acc-form-l { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.acc-form em, .acc-form-l em { font-style: normal; font-weight: 400; color: var(--dim); }
.acc-form .btn.solid { width: 100%; padding: 12px; }
.acc-form .link-btn { justify-self: center; }
.acc-msg { padding: 10px 12px; border-radius: 12px; font-size: 13.5px; }
.acc-msg.ok { background: rgba(75, 227, 160, 0.1); border: 1px solid rgba(75, 227, 160, 0.3); color: #b9f5d9; }
.acc-msg.err { background: rgba(255, 107, 129, 0.1); border: 1px solid rgba(255, 107, 129, 0.35); color: #ffc2cc; }
.acc-or { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--dim); }
.acc-or::before, .acc-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acc-wallet { width: 100%; padding: 12px; }
.acc-fine { margin: -4px 0 0; font-size: 12px; color: var(--dim); text-align: center; }
.acc-legal { margin: 2px 0 0; font-size: 12px; color: var(--dim); text-align: center; }
.acc-legal a { color: var(--muted); }
.acc-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.acc-av { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--grad); color: #0b0a14; font: 700 18px var(--display); }
.acc-who { min-width: 0; display: grid; gap: 2px; }
.acc-who b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-who small { font-size: 12.5px; color: var(--muted); }
.acc-st { display: inline-flex; align-items: center; gap: 5px; }
.acc-st.synced { color: var(--ok) !important; }
.acc-st.error { color: var(--danger) !important; }
.acc-st.syncing { color: var(--warn) !important; }
.acc-points { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.acc-points b { color: var(--text); }
.acc-body .lite-actions { margin-top: 0; }
.acc-sec { border-radius: 13px; border: 1px solid var(--line); padding: 0 12px; }
.acc-sec summary { padding: 10px 0; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.acc-sec[open] { padding-bottom: 12px; }
.acc-sec p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.acc-sec.danger summary { color: var(--danger); }
.acc-sec.danger > * + * { margin-top: 10px; }
.acc-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

/* ---------- Tour ---------- */
.tour { position: fixed; inset: 0; z-index: 180; }
.tour-hole { position: absolute; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(4, 4, 10, 0.72), 0 0 0 2px var(--accent); transition: all 0.3s ease; pointer-events: none; }
.tour-card { position: absolute; width: min(320px, calc(100vw - 32px)); padding: 16px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--panel-solid); box-shadow: var(--shadow); transition: top 0.3s ease, left 0.3s ease; }
.tour-card .step { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.tour-card h4 { margin: 4px 0 4px; font: 600 16px var(--display); }
.tour-card p { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.tour-card .row { display: flex; align-items: center; gap: 8px; }
.tour-card .dots { display: flex; gap: 5px; margin-right: auto; }
.tour-card .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.tour-card .dots i.on { background: var(--accent); width: 16px; border-radius: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .app, .app.ws-closed { grid-template-columns: 260px minmax(0, 1fr); }
  .app.ws-closed .ws { display: flex; }
  .ws { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(380px, 92vw); transform: translateX(104%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); background: #0b0b15; box-shadow: var(--shadow); visibility: hidden; }
  .app:not(.ws-closed) .ws { transform: none; visibility: visible; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(4, 4, 10, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .app:not(.ws-closed) .scrim, .app.side-open .scrim { opacity: 1; pointer-events: auto; }
}
@media (max-width: 820px) {
  .app, .app.ws-closed { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: min(300px, 86vw); transform: translateX(-104%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); background: #0b0b15; box-shadow: var(--shadow); visibility: hidden; }
  .app.side-open .side { transform: none; visibility: visible; }
  .side-close, .side-toggle { display: inline-flex; }
  .bar { padding: 10px 12px; gap: 8px; min-height: 58px; }
  .bar-actions .icon-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bar-actions .icon-btn { padding: 0; width: 36px; }
  .thread { padding: 20px 14px 8px; }
  .dock { padding: 0 10px 10px; }
  .b-grid { display: block; overflow-y: auto; }
  .b-form { overflow: visible; min-height: auto; }
  .b-preview { min-height: auto; }
  .b-preview { border-left: 0; border-top: 1px solid var(--line); }
  .pv-chat { max-height: 260px; }
}
@media (max-width: 640px) {
  .suggest { grid-template-columns: minmax(0, 1fr); }
  .empty { padding-top: 3vh; }
  .empty .big-av { width: 54px; height: 54px; border-radius: 17px; }
  .bar-mini span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bar-mini { padding: 0; width: 32px; min-width: 32px; }
  .msg { gap: 9px; }
  .msg.bot > .av { width: 28px; height: 28px; border-radius: 9px; }
  .msg.bot > .av .i { width: 15px; height: 15px; }
  .bubble { max-width: 88%; }
  .mk-cards.two { grid-template-columns: minmax(0, 1fr); }
  .mk-stats, .mk-stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp { padding: 10px; }
  .cmp .tbl table { font-size: 12px; }
  .cmp .tbl th, .cmp .tbl td { padding: 6px 6px; white-space: normal; }
  .cmp td:first-child { white-space: normal; }
  .act span { font-size: 12px; }
  .act { padding: 0 8px; }
  .hint { font-size: 11px; }
  .builder { padding: 0; }
  .b-sheet { height: 100dvh; border-radius: 0; border: 0; }
  .b-head { padding: 14px 16px; }
  .b-form { padding: 14px 16px 0; }
  .b-foot { margin: 4px -16px 0; padding: 12px 16px; }
  .b-row { grid-template-columns: minmax(0, 1fr); }
  .b-skills { grid-template-columns: minmax(0, 1fr); }
  .b-preview { padding: 14px 16px 20px; }
  .lite { padding: 10px; align-items: end; }
  .lite-box { padding: 16px; border-radius: 20px; max-height: calc(100dvh - 20px); }
  .lite-actions .btn { flex: 1 1 auto; }
  .share-card { flex-direction: column; }
  .palette { top: 10px; width: calc(100vw - 20px); }
  .pal-item small { display: none; }
  .tb-count { margin-left: 0; }
  .slash-item code { min-width: 78px; }
}
@media (max-width: 380px) {
  .bt-text p { font-size: 11.5px; }
  .c-mode span { display: none; }
  .c-mode { padding: 0 8px; }
  .composer { padding: 8px 8px 8px 10px; }
  .chart { gap: 3px; padding: 10px 6px 0; }
  .chart .lb { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .ic.spin { animation: none; border-top-color: var(--accent); }
}
