/* Caidrac One - quiet, dense, Linear-style. Brand: ink / bone / coral. */
:root {
  --ink: #141b2d; --bone: #ece7de;
  --bg: #141b2d; --side: #121828; --raise: #1c2438; --hover: rgba(236,231,222,.05); --active: rgba(236,231,222,.09);
  --line: rgba(236,231,222,.09); --line-2: rgba(236,231,222,.16);
  --text: #ece7de; --text-2: rgba(236,231,222,.74); --muted: rgba(236,231,222,.46); --accent: #f07c62; --on-accent: #1a1210;
  --code-bg: #0f1424; --ring: rgba(240,124,98,.28);
  --sans: "Geist", "Inter", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}
[data-theme="light"] {
  --bg: #f3f0ea; --side: #ebe7de; --raise: #fff; --hover: rgba(20,27,45,.05); --active: rgba(20,27,45,.08);
  --line: rgba(20,27,45,.09); --line-2: rgba(20,27,45,.16);
  --text: #141b2d; --text-2: rgba(20,27,45,.74); --muted: rgba(20,27,45,.5); --accent: #de5f45; --on-accent: #fff;
  --code-bg: #141b2d; --ring: rgba(222,95,69,.25);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 13px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; letter-spacing: -.003em; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
kbd { font: 500 10.5px var(--mono); padding: 0 5px; line-height: 18px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--muted); background: transparent; }
.muted { color: var(--muted); }
.wm-light, .sym-light { display: none !important; }
[data-theme="light"] .wm-light, [data-theme="light"] .sym-light { display: block !important; }
[data-theme="light"] .wm-dark, [data-theme="light"] .sym-dark { display: none !important; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 244px 1fr; height: 100vh; }
.app.collapsed { grid-template-columns: 0 1fr; }
.app.collapsed .sidebar { visibility: hidden; transform: translateX(-100%); }
.sidebar { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 8px; min-width: 0; overflow: hidden; }
.side-head { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 6px; margin-bottom: 6px; }
.ws { display: flex; align-items: center; gap: 8px; flex: 1; font-weight: 500; font-size: 13px; min-width: 0; }
.ws img { height: 24px; width: auto; }
.ws .logo { width: 20px; height: 20px; border-radius: 5px; background: var(--raise); border: 1px solid var(--line-2); display: grid; place-items: center; }
.ws .logo img { width: 10px; height: auto; display: block; }
.icon-btn { width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; color: var(--muted); transition: background .1s, color .1s; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 15px; height: 15px; }

.nav-row { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 8px; border-radius: 5px; color: var(--text-2); text-align: left; transition: background .1s; }
.nav-row:hover { background: var(--hover); color: var(--text); }
.nav-row svg { color: var(--muted); width: 15px; height: 15px; }
.nav-row kbd { margin-left: auto; }
.search { position: relative; }
.search svg { position: absolute; left: 8px; top: 7px; width: 15px; height: 15px; color: var(--muted); }
.search input { width: 100%; height: 28px; background: transparent; border: 0; border-radius: 5px; padding: 0 8px 0 31px; color: var(--text); font: inherit; outline: 0; }
.search input::placeholder { color: var(--text-2); }
.search input:hover { background: var(--hover); } .search input:focus { background: var(--active); }
.chat-list { flex: 1; overflow-y: auto; margin: 6px -4px 0; padding: 0 4px; }
.group-label { font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 12px 8px 4px; }
.chat-item { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 8px; border-radius: 5px; cursor: pointer; color: var(--text-2); }
.chat-item span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-item:hover { background: var(--hover); color: var(--text); }
.chat-item.active { background: var(--active); color: var(--text); }
.chat-item .del { opacity: 0; width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; color: var(--muted); }
.chat-item .del svg { width: 14px; height: 14px; }
.chat-item:hover .del { opacity: 1; } .chat-item .del:hover { background: var(--active); color: var(--text); }
.empty-list { color: var(--muted); padding: 10px 8px; }
.side-foot { display: flex; align-items: center; gap: 2px; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding-left: 4px; }
.me b { font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { display: none; }
.avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 600; display: grid; place-items: center; flex: none; }

/* ---------- main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; }
#openSide { display: none; } .app.collapsed #openSide { display: grid; }
.crumb { color: var(--muted); } .crumb-sep { color: var(--muted); opacity: .6; }
.topbar h2 { margin: 0; font-size: 13px; font-weight: 500; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 2px 6px; border-radius: 4px; cursor: text; min-width: 0; }
.topbar h2:hover { background: var(--hover); }
.topbar h2[contenteditable="true"] { outline: 1px solid var(--accent); background: var(--raise); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 5px; font-size: 11.5px; color: var(--text-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.scroll { flex: 1; overflow-y: auto; }
.thread { max-width: 704px; margin: 0 auto; padding: 8px 24px 28px; }

/* empty state */
.hero { padding-top: 14vh; }
.hero-sym { height: 28px; margin: 0 0 14px; }
.hero h1 { font-size: 18px; letter-spacing: -.015em; font-weight: 600; margin: 0 0 4px; }
.hero p { margin: 0; }
.suggest { margin-top: 22px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--raise); }
.suggest button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0 12px; height: 36px; text-align: left; border-top: 1px solid var(--line); color: var(--text-2); transition: background .1s; }
.suggest button:first-child { border-top: 0; }
.suggest button:hover { background: var(--hover); color: var(--text); }
.suggest svg { color: var(--muted); width: 15px; height: 15px; }
.suggest span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.suggest kbd { opacity: 0; } .suggest button:hover kbd { opacity: 1; }

/* messages */
.msg { margin: 20px 0; animation: rise .2s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .body { background: var(--bone); color: var(--ink); padding: 6px 12px; border-radius: 8px; max-width: 80%; white-space: pre-wrap; word-break: break-word; }
.msg.assistant { display: flex; gap: 10px; }
.msg.assistant .mark { flex: none; width: 20px; height: 20px; border-radius: 5px; background: var(--raise); border: 1px solid var(--line-2); display: grid; place-items: center; margin-top: 1px; }
.msg.assistant .mark img { width: 9px; height: auto; display: block; }
.msg.assistant .col { flex: 1; min-width: 0; }
.body { line-height: 1.6; }
.body p { margin: 0 0 10px; } .body p:last-child { margin: 0; }
.body h1, .body h2, .body h3 { margin: 16px 0 6px; letter-spacing: -.015em; line-height: 1.3; font-weight: 600; }
.body h1 { font-size: 16px; } .body h2 { font-size: 14.5px; } .body h3 { font-size: 13px; }
.body ul, .body ol { padding-left: 20px; margin: 0 0 10px; } .body li { margin: 2px 0; } .body li::marker { color: var(--muted); }
.body code { font: 12px var(--mono); background: var(--active); padding: 1px 5px; border-radius: 4px; }
.body pre { color: var(--bone); background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 0 0 10px; position: relative; }
.body pre code { background: none; padding: 0; font-size: 12px; line-height: 1.6; }
.body pre .lang { position: absolute; top: 6px; right: 10px; font: 10.5px var(--mono); color: rgba(236,231,222,.45); }
.body strong { font-weight: 600; }
.caret::after { content: ""; display: inline-block; width: 6px; height: 13px; background: var(--accent); margin-left: 2px; vertical-align: -2px; border-radius: 1px; animation: blink 1s steps(2) infinite; } @keyframes blink { 50% { opacity: 0; } }
.thinking { display: inline-flex; gap: 4px; height: 20px; align-items: center; }
.thinking i { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); animation: dot 1.1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 40% { background: var(--accent); transform: translateY(-2px); } }
.actions { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .12s; }
.msg:hover .actions { opacity: 1; }
.actions button { color: var(--muted); padding: 0 6px; height: 24px; border-radius: 4px; font-size: 12px; display: flex; gap: 5px; align-items: center; }
.actions button:hover { background: var(--hover); color: var(--text); } .actions svg { width: 13px; height: 13px; }

/* composer */
.composer-wrap { position: relative; max-width: 704px; width: 100%; margin: 0 auto; padding: 0 24px 12px; }
.composer { background: var(--raise); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 8px 6px 12px; transition: border-color .12s, box-shadow .12s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.composer textarea { width: 100%; resize: none; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.5; max-height: 200px; padding: 2px 0; display: block; }
.composer textarea::placeholder { color: var(--muted); }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.hint { flex: 1; color: var(--muted); font-size: 11.5px; }
.send { width: 24px; height: 24px; border-radius: 5px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; transition: filter .1s; }
.send svg { width: 14px; height: 14px; stroke-width: 2.2; } .send:hover:not(:disabled) { filter: brightness(1.08); }
.send:disabled { background: var(--active); color: var(--muted); cursor: default; }
.send.stop svg { fill: currentColor; } .send[hidden] { display: none; }
.disclaimer { text-align: center; font-size: 11px; color: var(--muted); margin: 8px 0 0; }
.to-bottom { position: absolute; top: -40px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--raise); border: 1px solid var(--line-2); display: none; place-items: center; }
.to-bottom.show { display: grid; }

@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); visibility: hidden; }
  .app.open .sidebar { transform: none; visibility: visible; }
  #openSide, .app.collapsed #openSide { display: grid; } .hint { display: none; }
}
::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
[data-theme="light"] .msg.user .body { background: var(--ink); color: var(--bone); }

/* subtle depth for better visibility */
:root { --sh: 0 1px 2px rgba(0,0,0,.28), 0 0 0 1px rgba(236,231,222,.05) inset; --sh-lg: 0 4px 14px -4px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.25); }
[data-theme="light"] { --sh: 0 1px 2px rgba(20,27,45,.1), 0 1px 1px rgba(20,27,45,.04); --sh-lg: 0 4px 14px -4px rgba(20,27,45,.16), 0 1px 2px rgba(20,27,45,.08); }
.search input { background: var(--raise); border: 1px solid var(--line-2); box-shadow: var(--sh); }
.search input:hover { background: var(--raise); border-color: var(--muted); }
.search input:focus { background: var(--raise); border-color: var(--accent); box-shadow: var(--sh), 0 0 0 3px var(--ring); }
.chat-item.active { background: var(--raise); border: 1px solid var(--line-2); box-shadow: var(--sh); }
.chat-item { border: 1px solid transparent; }
.icon-btn:hover { background: var(--raise); box-shadow: var(--sh); }
.pill { background: var(--raise); box-shadow: var(--sh); }
.suggest { box-shadow: var(--sh-lg); border-color: var(--line-2); }
.composer { box-shadow: var(--sh-lg); }
.composer:focus-within { box-shadow: var(--sh-lg), 0 0 0 3px var(--ring); }
.msg.user .body { box-shadow: var(--sh); }
.send:not(:disabled) { box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.avatar { box-shadow: var(--sh); }

/* projects */
.group-label.row { display: flex; align-items: center; justify-content: space-between; padding-right: 2px; }
.group-label.sub { padding-top: 8px; opacity: .8; font-weight: 400; }
.group-label.drop, .proj.drop { background: var(--active); outline: 1px dashed var(--accent); border-radius: 5px; }
.mini { width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center; color: var(--muted); }
.mini:hover { background: var(--raise); color: var(--text); box-shadow: var(--sh); } .mini svg { width: 13px; height: 13px; }
.proj { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 6px; border-radius: 5px; cursor: pointer; color: var(--text-2); border: 1px solid transparent; }
.proj:hover { background: var(--hover); color: var(--text); }
.proj > svg { width: 14px; height: 14px; color: var(--muted); }
.proj .chev { width: 12px; height: 12px; transition: transform .12s; } .proj.open .chev { transform: rotate(90deg); }
.proj.open > svg:nth-child(2) { color: var(--accent); }
.proj .pname { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.proj em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.proj .del, .chat-item .del { opacity: 0; width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; color: var(--muted); }
.proj .del svg { width: 13px; height: 13px; }
.proj:hover .del { opacity: 1; } .proj:hover em { display: none; }
.proj .del:hover { background: var(--active); color: var(--text); }
.proj-chats { margin-left: 13px; padding-left: 6px; border-left: 1px solid var(--line-2); margin-bottom: 4px; }
.proj-chats .empty-list { padding: 4px 8px; }
.proj-new { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px; color: var(--muted); }
.proj-new svg { width: 14px; height: 14px; }
.proj-new input { flex: 1; min-width: 0; height: 24px; background: var(--raise); border: 1px solid var(--accent); border-radius: 4px; color: var(--text); font: inherit; padding: 0 6px; outline: 0; box-shadow: 0 0 0 3px var(--ring); }
.chat-item .del svg { width: 14px; height: 14px; }
.menu { position: fixed; z-index: 80; min-width: 180px; background: var(--raise); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px; box-shadow: var(--sh-lg); }
.menu-h { font-size: 11.5px; color: var(--muted); padding: 5px 8px; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 8px; border-radius: 5px; color: var(--text-2); text-align: left; }
.menu button svg { width: 14px; height: 14px; color: var(--muted); } .menu button:hover { background: var(--hover); color: var(--text); } .menu button.on { color: var(--accent); }

/* ---------- modes + code pane ---------- */
.work { flex: 1; display: flex; min-height: 0; position: relative; }
.chatcol { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar h2 { flex: 1; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--side); border: 1px solid var(--line-2); border-radius: 7px; box-shadow: var(--sh); }
.seg button { display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
.seg button svg { width: 13px; height: 13px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raise); color: var(--text); box-shadow: var(--sh); }
.seg.sm button { height: 20px; padding: 0 8px; font-size: 11.5px; }


/* tool calls in the transcript */
.md + .toolwrap, .toolwrap + .md, .toolwrap + .toolwrap { margin-top: 8px; }
.md > :last-child { margin-bottom: 0; }
.tool { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; background: var(--raise); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: var(--sh); color: var(--text-2); width: fit-content; max-width: 100%; }
.tool[data-path] { cursor: pointer; } .tool[data-path]:hover { border-color: var(--muted); color: var(--text); }
.tool svg { width: 14px; height: 14px; color: var(--muted); }
.tool b { font-weight: 500; color: var(--text); }
.tool code { font: 12px var(--mono); background: none; padding: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool .stat { display: flex; gap: 6px; font: 11.5px var(--mono); } .stat i { font-style: normal; } .stat .add { color: #3fb27f; } .stat .del { color: #e5686b; }
.tool .tst { display: grid; place-items: center; margin-left: 2px; }
.tool .ok { color: #3fb27f; stroke-width: 2.2; } .st-stop { font-size: 11px; color: var(--muted); }
.spin { width: 12px; height: 12px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: sp .7s linear infinite; } @keyframes sp { to { transform: rotate(360deg); } }
.tout { margin: 4px 0 0 12px; padding: 8px 10px; background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; font: 12px/1.55 var(--mono); color: var(--bone); max-height: 150px; overflow: auto; white-space: pre-wrap; box-shadow: var(--sh); }
.msg.assistant .col .md p:last-child { margin-bottom: 0; }


@media (max-width: 640px) { .seg button { padding: 0 6px; } .seg button svg { display: none; } .pill { display: none; } }


/* mode switcher lives in the sidebar */
.modes { display: flex; flex-direction: column; gap: 1px; margin: 8px 0 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.modes .nav-row { border: 1px solid transparent; }
.modes .nav-row.on { background: var(--raise); color: var(--text); border-color: var(--line-2); box-shadow: var(--sh); font-weight: 500; }
.modes .nav-row.on svg { color: var(--accent); }
.chat-list { margin-top: 4px; }

/* segmented "bubble" switcher, vertical */
.modes { position: relative; gap: 2px; padding: 3px; margin: 8px 0 6px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; box-shadow: inset 0 1px 2px rgba(0,0,0,.12), var(--sh); }
.modes .bubble { position: absolute; left: 3px; right: 3px; top: 3px; height: 28px; border-radius: 6px; background: var(--raise); border: 1px solid var(--line-2); box-shadow: var(--sh-lg); transition: transform .28s cubic-bezier(.3,1.35,.5,1); transform: translateY(calc(var(--i, 0) * 30px)); pointer-events: none; }
.modes .nav-row { position: relative; z-index: 1; height: 28px; border-radius: 6px; transition: color .15s; }
.modes .nav-row.on { background: none; border-color: transparent; box-shadow: none; color: var(--text); font-weight: 500; }
.modes .nav-row:not(.on):hover { background: var(--hover); }
.modes .nav-row svg { transition: color .2s, transform .28s; }
.modes .nav-row.on svg { color: var(--accent); transform: scale(1.12); }

/* ---------- mode panes: generic chrome. The active mode's pane is shown by the shell (hidden attribute). ---------- */
.modepane { display: flex; flex: 1; min-width: 0; min-height: 0; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg); }
.modepane[hidden] { display: none; }
.app[data-has-pane] .chatcol { flex: 0 0 380px; }
.app[data-has-pane] .hero { padding-top: 6vh; }
.app[data-has-pane] .thread, .app[data-has-pane] .composer-wrap { padding-left: 16px; padding-right: 16px; }
.app.pane-off .modepane:not(.is-detached) { display: none !important; }
.app.pane-off .chatcol { flex: 1 !important; }
@media (max-width: 1100px) {
  .modepane { position: absolute; inset: 0 0 0 auto; width: min(820px, 100%); z-index: 30; box-shadow: var(--sh-lg); }
  .app[data-has-pane] .chatcol { flex: 1; }
}

/* sidebar bubble: position driven by --i set from JS (works for any number of modes) */
.modes .bubble { transform: translateY(calc(var(--i, 0) * 30px)); }

/* toolbar used by the sheet / document / slides panes */
.pane-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--side); flex: none; }
.pane-bar button { display: inline-flex; align-items: center; gap: 5px; height: 26px; min-width: 26px; padding: 0 7px; justify-content: center; border-radius: 6px; color: var(--text-2); font-size: 12px; border: 1px solid transparent; }
.pane-bar button:hover { background: var(--hover); color: var(--text); }
.pane-bar button.on { background: var(--raise); border-color: var(--line-2); box-shadow: var(--sh); color: var(--text); }
.pane-bar svg { width: 14px; height: 14px; }
.pane-bar i { width: 1px; height: 18px; background: var(--line-2); margin: 0 3px; }
.pane-bar select { height: 26px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--raise); color: var(--text-2); font: inherit; font-size: 12px; padding: 0 6px; box-shadow: var(--sh); }
.clr { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.clr input { width: 22px; height: 22px; padding: 0; border: 1px solid var(--line-2); border-radius: 5px; background: none; }
.grow { flex: 1; }

/* project folders: mixed items with their mode icon */
.chat-item svg.mi { width: 14px; height: 14px; color: var(--muted); flex: none; }
.chat-item.active svg.mi, .chat-item:hover svg.mi { color: var(--accent); }
.proj-chats .chat-item { gap: 7px; }
.proj-chats.drop { background: var(--active); outline: 1px dashed var(--accent); border-radius: 5px; }
.menu button svg { flex: none; }

.seg button { white-space: nowrap; }

/* tool-call rows open the side panel (workspace only, not the read-only share page) */
.app[data-has-pane]:not(.share) .tool { cursor: pointer; transition: border-color .12s, color .12s; }
.app[data-has-pane]:not(.share) .tool:hover { border-color: var(--accent); color: var(--text); }
.app[data-has-pane]:not(.share) .tool:hover::after { content: "Open \203A"; font-size: 11px; color: var(--accent); margin-left: 4px; white-space: nowrap; }
.modepane.flash { animation: paneflash .9s ease-out; }
@keyframes paneflash { 0% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 0 0 0 2px transparent; } }


/* minimize: the panel collapses into a tab on the right edge */
.app.pane-min .modepane:not(.is-detached) { display: none !important; }
.app.pane-min .chatcol { flex: 1 !important; }
.dock { position: fixed; right: 0; top: 96px; z-index: 55; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.dock[hidden] { display: none; }
.dock-tab { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 34px; padding: 10px 0 12px; border: 1px solid var(--line-2); border-right: 0; border-radius: 10px 0 0 10px; background: var(--raise); color: var(--text-2); box-shadow: var(--sh-lg); animation: dockin .25s cubic-bezier(.3,1.3,.5,1); transition: width .15s, color .15s, border-color .15s; }
.dock-tab:hover { width: 40px; color: var(--text); border-color: var(--accent); }
.dock-tab svg { width: 15px; height: 15px; color: var(--accent); } .dock-tab svg.mi { width: 16px; height: 16px; }
.dock-tab span { writing-mode: vertical-rl; font-size: 12px; font-weight: 500; letter-spacing: .01em; }
@keyframes dockin { from { transform: translateX(100%); opacity: 0; } }

/* ---------- window chrome for mode panels ---------- */
.pane-head { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--side); flex: none; user-select: none; }
.pane-title { font-size: 12px; color: var(--muted); }
.lights { display: flex; align-items: center; gap: 8px; }
.light { position: relative; width: 16px; height: 16px; padding: 0; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(0,0,0,.2); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); transition: filter .12s, transform .12s; }
.light.red { background: #ff5f57; } .light.yellow { background: #febc2e; } .light.green { background: #28c840; } .light.blue { background: #4d9cff; }
.light svg { width: 10px; height: 10px; stroke: rgba(45,15,15,.82); stroke-width: 3.2; opacity: .95; transition: opacity .12s, transform .12s; }
.light:hover svg { opacity: 1; transform: scale(1.12); }
.light:hover { filter: brightness(1.07); transform: scale(1.08); } .light:active { filter: brightness(.9); }
.pane-pop { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.pane-pop:hover { background: var(--hover); color: var(--text); } .pane-pop svg { width: 15px; height: 15px; }
.modepane { position: relative; }

/* small window */
.modepane.is-float { position: fixed; z-index: 45; flex: none; min-width: 0 !important; max-width: none !important; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--bg);
  box-shadow: 0 28px 64px -16px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.08); animation: popin .18s ease-out; }
.modepane.is-float .pane-head { cursor: grab; } .modepane.is-float.dragging .pane-head { cursor: grabbing; }
.modepane.is-float.dragging { transition: none; user-select: none; } .modepane.is-float.dragging iframe { pointer-events: none; }
.app.pane-float .chatcol { flex: 1 !important; }
@keyframes popin { from { transform: scale(.97); opacity: .6; } }
.rz { display: none; position: absolute; z-index: 8; }
.is-float .rz { display: block; }
.rz.n, .rz.s { left: 12px; right: 12px; height: 8px; cursor: ns-resize; } .rz.n { top: -3px; } .rz.s { bottom: -3px; }
.rz.e, .rz.w { top: 12px; bottom: 12px; width: 8px; cursor: ew-resize; } .rz.e { right: -3px; } .rz.w { left: -3px; }
.rz.ne, .rz.nw, .rz.se, .rz.sw { width: 16px; height: 16px; } .rz.ne { top: -3px; right: -3px; cursor: nesw-resize; } .rz.nw { top: -3px; left: -3px; cursor: nwse-resize; }
.rz.se { bottom: -3px; right: -3px; cursor: nwse-resize; } .rz.sw { bottom: -3px; left: -3px; cursor: nesw-resize; }
.rz.se::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); opacity: .55; }

/* maximized: fills the work area, chat stays underneath */
.modepane.is-max { position: absolute; inset: 0; z-index: 35; width: auto !important; min-width: 0 !important; max-width: none !important; flex: none; border-left: 0; box-shadow: none; }
@media (max-width: 1100px) { .modepane.is-max { inset: 0; } }

.avatar[data-n="2"] { background: #5b8def; color: #fff; }

/* Quick Access label + the "More apps" row */
.side-label { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 0; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.side-label a { color: var(--muted); text-decoration: none; opacity: 0; transition: opacity .12s; font-weight: 400; }
.side-label:hover a, .side-label a:focus-visible { opacity: 1; } .side-label a:hover { color: var(--accent); }
.modes .nav-row.more { color: var(--muted); text-decoration: none; margin-top: 2px; border-top: 1px dashed var(--line-2); border-radius: 0 0 6px 6px; padding-top: 2px; height: 30px; }
.modes .nav-row.more svg { color: var(--accent); stroke-width: 2.2; }
.modes .nav-row.more:hover { color: var(--text); background: var(--hover); border-radius: 6px; }
