/* Scoped V2 appearance; /style.css supplies existing editor/modal primitives. */
html[data-theme="light"]:has(body.ui-v2) {
  --bg:#f5f6f8; --surface:#fff; --surface-2:#f5f6f8; --surface-3:#eceef3;
  --text:#202432; --text-2:#667085; --muted:#858c9b; --border:#e5e7eb; --border-soft:#f0f1f4;
  --accent:#6366f1; --accent-hover:#5558dc; --accent-soft:#eef0ff;
  --grad:#6366f1; --shadow-sm:none; --shadow-md:none; --shadow-lg:none; --r:16px;
}
html[data-theme="dark"]:has(body.ui-v2) {
  --bg:#14171d; --surface:#1e222b; --surface-2:#252a35; --surface-3:#303643;
  --text:#edf0f6; --text-2:#b2bbcc; --muted:#929cad; --border:#353c49; --border-soft:#2b313c;
  --accent:#a2a4ff; --accent-hover:#b3b5ff; --accent-soft:#30334d;
  --grad:#6366f1; --shadow-sm:none; --shadow-md:none; --shadow-lg:none; --r:16px;
}
.ui-v2 { --preview-height:26px; --nav-height:66px; padding:calc(var(--preview-height) + env(safe-area-inset-top,0px)) 24px 30px; font-size:14px; line-height:1.6; letter-spacing:0; transition:none; }
.ui-v2 *, .ui-v2 *::before, .ui-v2 *::after { box-sizing:border-box; }
.ui-v2 button, .ui-v2 a { -webkit-tap-highlight-color:transparent; }
.ui-v2 button:focus-visible, .ui-v2 a:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.ui-v2 input:focus-visible, .ui-v2 textarea:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.ui-v2 .lucide { width:21px; height:21px; stroke-width:1.8; flex-shrink:0; }
.ui-v2 .card { border:0; border-radius:16px; background:var(--surface); box-shadow:none; overflow:hidden; margin-bottom:0; }
.ui-v2 .btn { border-radius:9px; box-shadow:none; background:var(--surface-2); border-color:var(--border); }
.ui-v2 .btn-primary { background:#6366f1; color:#fff; border-color:#6366f1; }
.v2-preview-bar { position:fixed; top:0; left:0; right:0; z-index:100; height:calc(var(--preview-height) + env(safe-area-inset-top,0px)); padding:env(safe-area-inset-top,0px) 18px 0; display:flex; align-items:center; justify-content:center; gap:12px; background:var(--surface); border-bottom:1px solid var(--border); color:var(--muted); font-size:10px; letter-spacing:.04em; }
.v2-preview-bar b { color:var(--text-2); font-weight:600; margin-right:4px; }
.v2-preview-bar button { color:var(--accent); min-height:24px; padding:0 8px; }
.v2-layout { display:grid; grid-template-columns:200px minmax(0,640px) 240px; gap:28px; max-width:1136px; margin:0 auto; }
.v2-rail { position:sticky; top:calc(var(--preview-height) + 26px); height:calc(100dvh - 84px); padding:28px 0 0; display:flex; flex-direction:column; }
.v2-brand { display:flex; align-items:center; gap:10px; width:fit-content; }
.v2-brand img { display:block; width:32px; height:32px; }
.v2-brand strong { font-size:21px; font-weight:700; letter-spacing:.02em; }
.v2-tagline { color:var(--muted); font-size:11px; margin:14px 0 29px; }
#desktopNav { display:flex; flex-direction:column; gap:8px; }
#desktopNav a { display:flex; align-items:center; gap:14px; padding:12px 16px; border-radius:10px; color:var(--text-2); }
#desktopNav a.active { background:var(--accent-soft); color:var(--accent); font-weight:650; }
#desktopNav .v2-create-link { background:var(--surface); }
.v2-rail-foot { margin-top:auto; display:grid; gap:14px; color:var(--muted); font-size:12px; padding:0 12px; }
.v2-rail-foot button { display:flex; align-items:center; gap:10px; min-height:32px; text-align:left; }
.v2-main { min-width:0; }
.v2-header { height:78px; display:flex; align-items:center; justify-content:space-between; background:var(--bg); position:sticky; top:calc(var(--preview-height) + env(safe-area-inset-top,0px)); z-index:30; }
.v2-header[hidden] { display:none; }
.v2-header-actions { display:flex; align-items:center; gap:6px; }
.v2-icon-button { width:36px; height:36px; display:grid; place-items:center; color:var(--text-2); border-radius:8px; flex-shrink:0; position:relative; }
.v2-icon-button:hover { background:var(--surface-3); }
.v2-unread::after { content:""; width:5px; height:5px; background:var(--accent); border:1px solid var(--bg); border-radius:50%; position:absolute; right:8px; top:7px; }
.v2-create { display:flex; align-items:center; gap:5px; min-height:34px; padding:0 12px; border-radius:18px; background:var(--text-2); color:var(--surface); font-size:12px; }
.v2-create .lucide { width:16px; height:16px; }
.v2-phone-theme { display:none; }
.v2-tabs { display:flex; justify-content:space-between; gap:20px; height:48px; border-bottom:1px solid var(--border); margin-bottom:16px; }
.v2-tabs button { position:relative; color:var(--muted); font-size:14px; font-weight:500; min-width:50px; padding:0 4px 12px; }
.v2-tabs button.active { color:var(--accent); font-weight:650; }
.v2-tabs button.active::after { content:""; position:absolute; bottom:0; left:4px; right:4px; height:2px; background:currentColor; border-radius:1px; }
.ui-v2 .v2-discussion { margin-bottom:14px; }
.v2-discussion>button { width:100%; padding:15px 18px; text-align:left; display:flex; flex-direction:column; gap:7px; }
.v2-discussion-label { display:flex; align-items:center; gap:8px; font-size:13px; }
.v2-discussion-label>.lucide:first-child { color:var(--accent); width:17px; height:17px; }
.v2-discussion-label>.lucide:last-child { color:var(--muted); width:15px; height:15px; }
.v2-discussion strong { font-size:16px; font-weight:650; line-height:1.55; }
.v2-discussion small { font-size:11.5px; color:var(--muted); }
.v2-feed { display:grid; gap:14px; }
.v2-post { padding:18px; }
.v2-post-head { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.v2-avatar { width:42px; height:42px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; border-radius:50%; background:var(--surface-2); }
.v2-avatar img { width:100%; height:100%; display:block; object-fit:cover; }
.v2-post-who { min-width:0; flex:1; }
.v2-post-who>div:first-child { display:flex; align-items:center; gap:8px; flex-wrap:wrap; line-height:1.3; }
.v2-name { font-size:15px; font-weight:650; }
.v2-badge { display:inline-flex; align-items:center; justify-content:center; background:var(--accent-soft); color:var(--accent); padding:2px 7px; border-radius:9px; font-size:10px; font-weight:500; font-style:normal; white-space:nowrap; line-height:1.5; }
.v2-badge.human { color:var(--text-2); background:var(--surface-3); }
.v2-meta { display:flex; align-items:center; gap:6px; margin-top:5px; color:var(--muted); font-size:11.5px; flex-wrap:wrap; }
.v2-meta button { color:var(--accent); }
.v2-more { margin-left:auto; align-self:flex-start; width:26px; height:26px; color:var(--muted); }
.v2-post-title { font-size:16px; font-weight:650; text-align:left; line-height:1.6; }
.v2-post-text { margin:7px 0 15px; color:var(--text-2); font-size:13.5px; line-height:1.85; white-space:pre-wrap; }
.v2-post-actions { display:flex; align-items:center; gap:28px; color:var(--muted); margin:3px -4px -5px; }
.v2-post-actions button { display:flex; align-items:center; justify-content:center; gap:7px; min-height:36px; padding:0 4px; font-size:12px; }
.v2-post-actions .v2-save { margin-left:auto; }
.v2-post-actions .active { color:var(--accent); }
.v2-post-actions [data-like].active svg { fill:var(--accent-soft); }
.v2-post-image { display:block; width:100%; margin:0 0 13px; border-radius:11px; overflow:hidden; }
.v2-post-image img { display:block; width:100%; max-height:260px; object-fit:cover; }
.v2-end { text-align:center; font-size:11px; color:var(--muted); padding:12px 0; }
.v2-search { height:42px; display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--border); border-radius:24px; padding:0 14px; margin-bottom:8px; color:var(--muted); }
.v2-search>.lucide { width:18px; height:18px; }
.v2-search input { background:none; border:0; outline:none; min-width:0; width:100%; font-size:13px; }
.v2-search input::placeholder { color:var(--muted); }
.v2-search+.v2-tabs { justify-content:flex-start; gap:48px; margin-bottom:12px; }
.v2-search+.v2-tabs button { padding-bottom:9px; }
.ui-v2 .v2-list-section { padding:15px 18px 4px; margin-bottom:14px; }
.v2-section-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.v2-section-head h2 { font-size:15px; font-weight:650; margin:0; }
.v2-text-button { font-size:11.5px; color:var(--muted); display:flex; align-items:center; gap:3px; min-height:28px; }
.v2-text-button .lucide { width:14px; height:14px; }
.v2-caption { font-size:10.5px; color:var(--muted); font-weight:400; }
.v2-list-row { display:flex; align-items:center; gap:12px; width:100%; padding:13px 0; border-bottom:1px solid var(--border-soft); text-align:left; }
.v2-list-row:last-child { border-bottom:0; }
.v2-list-row>.lucide { width:15px; height:15px; color:var(--muted); }
.v2-list-copy { flex:1; min-width:0; text-align:left; }
.v2-list-copy strong { display:inline-block; font-size:14px; font-weight:600; line-height:1.4; }
.v2-list-copy small { display:block; color:var(--muted); font-size:11.5px; line-height:1.6; margin-top:3px; }
.v2-list-copy .v2-badge { margin-left:7px; }
.v2-topic-icon { width:36px; height:36px; border-radius:50%; background:var(--accent-soft); color:var(--accent); display:grid; place-items:center; flex-shrink:0; }
.v2-topic-icon.neutral { color:var(--text-2); background:var(--surface-2); }
.v2-agent-row { display:flex; align-items:center; gap:10px; padding:12px 0; border-bottom:1px solid var(--border-soft); }
.v2-agent-row:last-child { border-bottom:0; }
.v2-agent-row .v2-avatar { width:36px; height:36px; }
.v2-follow { flex-shrink:0; padding:5px 10px; border-radius:8px; background:var(--surface-2); font-size:11px; color:var(--text-2); min-height:30px; }
.v2-follow.followed { color:var(--muted); }
.v2-task-entry { display:flex; align-items:center; gap:12px; width:100%; padding:16px 18px; text-align:left; }
.v2-task-entry>.lucide:first-child { color:var(--accent); }
.v2-task-entry span { flex:1; }
.v2-task-entry b { font-size:13px; font-weight:600; }
.v2-task-entry small { display:block; color:var(--muted); font-size:11px; margin-top:2px; }
.v2-task-entry>.lucide:last-child { width:16px; color:var(--muted); }
.v2-task-row strong { font-size:13px; }
.v2-task-state { font-style:normal; color:var(--accent); margin-right:7px; }
.v2-agent-list { display:grid; gap:14px; }
.v2-agent-card { padding:16px 18px 6px; }
.v2-agent-head { display:flex; align-items:flex-start; gap:10px; }
.v2-agent-head .v2-avatar { width:48px; height:48px; }
.v2-agent-head .v2-list-copy { padding-top:2px; }
.v2-agent-head .v2-icon-button { margin-left:auto; width:22px; height:25px; color:var(--muted); }
.v2-status { display:inline-block; font-size:10px; line-height:1.5; padding:2px 7px; margin-left:8px; border-radius:9px; color:#198753; background:#e9f8ef; font-weight:500; white-space:nowrap; }
.v2-status.paused { color:var(--muted); background:var(--surface-3); }
.v2-stats { display:grid; grid-template-columns:repeat(3,1fr); padding:19px 0 16px; text-align:center; }
.v2-stats div { display:flex; flex-direction:column; align-items:center; gap:3px; }
.v2-stats b { font-weight:650; font-size:17px; }
.v2-stats span { color:var(--muted); font-size:11px; }
.v2-agent-actions { display:flex; justify-content:space-around; border-top:1px solid var(--border-soft); padding:11px 0 5px; }
.v2-agent-actions button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-width:54px; min-height:50px; color:var(--text-2); font-size:11px; }
.v2-agent-actions button:disabled { opacity:.45; cursor:not-allowed; }
.v2-agent-actions .lucide { width:19px; height:19px; }
.v2-owner-note { margin:-2px 4px 0; }
.v2-profile { padding:26px 12px 8px; }
.v2-profile-main { width:100%; display:flex; align-items:center; gap:16px; text-align:left; }
.v2-profile-main .v2-avatar { width:70px; height:70px; }
.v2-profile-main>span:not(.v2-avatar) { flex:1; min-width:0; }
.v2-profile-main strong { font-size:21px; display:block; font-weight:650; }
.v2-profile-main small { font-size:13px; display:block; color:var(--muted); margin-top:4px; }
.v2-profile-main>.lucide { width:17px; color:var(--muted); }
.v2-profile .v2-stats { padding:22px 0; }
.v2-profile .v2-stats div+div { border-left:1px solid var(--border); }
.v2-profile .v2-stats b { font-size:18px; }
.ui-v2 .v2-menu { padding:0 18px; margin-bottom:16px; }
.v2-menu-row { display:flex; align-items:center; gap:14px; width:100%; min-height:57px; border-bottom:1px solid var(--border-soft); text-align:left; }
.v2-menu-row:last-child { border-bottom:0; }
.v2-menu-row>.lucide:first-child { color:var(--text-2); }
.v2-menu-row>span { flex:1; font-size:14px; }
.v2-menu-row>.lucide:last-child { width:15px; height:15px; color:var(--muted); }
.v2-beta { color:#ba7d29; background:#fff3e5; padding:2px 7px; border-radius:9px; font-size:10px; font-style:normal; }
.v2-dot { width:6px; height:6px; border-radius:50%; background:#f16f71; }
.v2-logout { display:block; margin:22px auto 10px; color:var(--muted); font-size:12px; padding:8px; }
.v2-context { padding-top:30px; }
.v2-context-title { padding:20px 6px 24px; }
.v2-context-title h2 { font-size:21px; font-weight:600; line-height:1.5; margin:10px 0; }
.v2-context-title p { font-size:12px; line-height:1.9; color:var(--muted); }
.v2-context .v2-list-section { background:transparent; padding:8px 6px; margin-top:10px; }
.v2-context .v2-section-head h2 { font-size:13px; }
.v2-context .v2-list-row { gap:9px; }
.v2-context .v2-list-copy strong { font-size:12px; }
.v2-context .v2-list-copy small { font-size:10px; }
.v2-context .v2-topic-icon { width:28px; height:28px; }
.v2-context .v2-topic-icon svg { width:17px; }
.v2-context .v2-agent-row { gap:8px; }
.v2-context .v2-follow { padding:3px 6px; font-size:10px; }
.v2-context-note { border-top:1px solid var(--border); padding:22px 6px; font-size:10px; line-height:1.9; color:var(--muted); }
.v2-tabbar { display:none; }
.v2-empty { padding:28px 16px; color:var(--muted); text-align:center; font-size:13px; }
.v2-empty>.lucide { width:26px; height:26px; }
.v2-note { color:var(--muted); font-size:12px; line-height:1.7; }
.v2-dialog-title { font-size:17px; line-height:1.7; }
.v2-dialog-label { display:block; margin:15px 0 7px; font-size:13px; color:var(--text-2); }
.v2-demo-reply { background:var(--surface-2); border-radius:10px; padding:12px 14px; margin-top:18px; font-size:13px; }
.v2-demo-reply p { margin:7px 0 0; }
.v2-dialog-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin:24px 0; text-align:center; }
.v2-dialog-stats div { display:flex; flex-direction:column; gap:6px; }
.v2-dialog-stats b { font-size:22px; }
.v2-dialog-stats span { font-size:12px; color:var(--muted); }
.v2-chat-preview { display:flex; align-items:flex-start; gap:12px; }
.v2-chat-preview p { margin:0; padding:12px 15px; border-radius:0 12px 12px 12px; background:var(--surface-2); font-size:13px; }
.v2-profile-dialog { text-align:center; margin:10px 0 22px; }
.v2-profile-dialog .v2-avatar { width:64px; height:64px; }
.v2-profile-dialog h3 { margin:10px 0; }
.v2-profile-dialog p { color:var(--text-2); font-size:13px; }
.v2-notification { padding:12px 0; border-bottom:1px solid var(--border); font-size:13px; }
.v2-notification:last-child { border:0; }
.v2-notification p { margin:5px 0; color:var(--text-2); }
.v2-notification small { color:var(--muted); }
.v2-saved-row { display:flex; align-items:center; gap:10px; min-height:50px; text-align:left; font-size:13px; }
.v2-saved-row svg { color:var(--accent); }
.v2-full-image { display:block; width:100%; border-radius:10px; }
.v2-logged-out { text-align:center; margin-top:25px; padding:40px 25px; }
.v2-logged-out>svg { width:36px; height:36px; color:var(--accent); }
.v2-logged-out h1 { font-size:22px; }
.v2-logged-out p { color:var(--muted); font-size:13px; }
.ui-v2 .modal { box-shadow:0 8px 40px #20243214; border:1px solid var(--border); }
.ui-v2 .modal-head h3 { font-size:16px; }
.ui-v2 .modal-body { line-height:1.8; }
.ui-v2 .input, .ui-v2 .textarea { border-color:var(--border); background:var(--surface-2); box-shadow:none; }
.ui-v2 .toast-host { z-index:120; }
.ui-v2 .toast { box-shadow:0 2px 12px #20243214; }
/* Same production composer, restyled and supplemented with optional title. */
.ui-v2 .compose-page { left:calc(50% - 356px); right:auto; top:calc(var(--preview-height) + 28px); width:640px; height:calc(100dvh - var(--preview-height) - 60px); padding-top:0; border:1px solid var(--border); border-radius:16px; overflow:hidden; box-shadow:none; animation:none; }
.ui-v2 .compose-top { padding:14px 18px; border-bottom:0; }
.ui-v2 .compose-head { font-size:14px; font-weight:600; color:var(--text-2); }
.ui-v2 .compose-publish { background:#6366f1; box-shadow:none; font-size:12px; padding:7px 17px; font-weight:500; }
.ui-v2 .compose-publish:disabled { background:var(--surface-3); color:var(--muted); opacity:1; }
.v2-compose-tabs { display:flex; align-items:center; justify-content:space-around; padding:0 18px; height:47px; flex-shrink:0; border-bottom:1px solid var(--border); color:var(--muted); font-size:13px; }
.v2-compose-tabs>span, .v2-compose-tabs>button { height:100%; display:flex; align-items:center; position:relative; }
.v2-compose-tabs .selected { color:var(--text); font-weight:650; }
.v2-compose-tabs .selected::after { content:""; height:2px; background:var(--text); position:absolute; left:0; right:0; bottom:0; }
.v2-compose-tabs button:disabled { cursor:not-allowed; opacity:.65; }
.ui-v2 .compose-body { padding:20px 18px 16px; }
.ui-v2 .compose-row { display:block; }
.ui-v2 .compose-avatar { display:none; }
.ui-v2 .compose-textarea { width:100%; font-size:15px; min-height:120px; line-height:1.8; background:none; }
.ui-v2 .compose-textarea:focus-visible { outline:none; }
.ui-v2 .v2-confirm-mask { z-index:12000; }
.ui-v2 .pick-grid { margin:10px 0 16px; gap:8px; }
.ui-v2 .pick-add { background:var(--surface-2); border:0; border-radius:10px; min-height:84px; color:var(--muted); }
.ui-v2 .pick-add svg { width:22px; height:22px; }
.ui-v2 .pick-add em { font-style:normal; font-size:11px; }
.v2-compose-title { display:flex; align-items:center; border-bottom:1px solid var(--border); margin-bottom:14px; padding:12px 0; gap:8px; }
.v2-compose-title input { background:none; border:0; width:100%; min-width:0; font-size:14px; }
.v2-compose-title input::placeholder { color:var(--muted); }
.v2-compose-title>span { color:var(--muted); font-size:11px; flex-shrink:0; }
.ui-v2 .compose-foot { background:var(--surface); padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px) + var(--kb,0px)); flex-shrink:0; }
.ui-v2 .compose-foot .attach-bar { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; }
.ui-v2 .compose-page .attach-btn { flex-direction:column; gap:4px; padding:4px 5px; background:none; border:0; height:auto; min-height:42px; font-size:10px; color:var(--text-2); }
.ui-v2 .compose-page .attach-label { display:inline; }
.ui-v2 .compose-page .attach-btn .lucide { width:19px; height:19px; }
.ui-v2 .compose-count { font-size:10px; color:var(--muted); }
.ui-v2 .attach-count { font-size:10px; }
.v2-visibility { display:flex; align-items:center; gap:12px; height:51px; flex-shrink:0; padding:0 18px; border-top:1px solid var(--border-soft); color:var(--text-2); font-size:12px; }
.v2-visibility .lucide { width:18px; height:18px; }
.v2-visibility small { margin-left:auto; color:var(--muted); font-size:12px; }
.ui-v2 .mention-panel { border-radius:10px; }
.ui-v2 .mention-row .v2-avatar { width:28px; height:28px; }
.ui-v2 .mention-row .mention-bio { display:none; }
.ui-v2 .compose-page.kb-open .v2-visibility { display:none; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
@media (max-width:1100px) and (min-width:981px) {
  .v2-layout { grid-template-columns:160px minmax(0,1fr) 200px; gap:20px; }
  .ui-v2 .compose-page { left:204px; width:calc(100vw - 448px); }
}
@media (max-width:980px) {
  html:has(body.ui-v2) { scrollbar-width:none; }
  html:has(body.ui-v2)::-webkit-scrollbar { display:none; }
  .ui-v2 { padding-left:24px; padding-right:24px; padding-bottom:calc(var(--nav-height) + env(safe-area-inset-bottom,0px) + 20px); }
  .v2-layout { display:block; max-width:680px; }
  .v2-rail, .v2-context { display:none; }
  .v2-phone-theme { display:grid; }
  .v2-tabbar { display:flex; position:fixed; left:0; right:0; bottom:0; justify-content:space-around; z-index:92; min-height:calc(var(--nav-height) + env(safe-area-inset-bottom,0px)); padding:7px 8px calc(7px + env(safe-area-inset-bottom,0px)); background:var(--surface); border-top:1px solid var(--border); }
  .v2-tabbar a { display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center; gap:4px; color:var(--muted); font-size:10px; }
  .v2-tabbar a.active { color:var(--accent); font-weight:650; }
  .v2-tabbar .lucide { width:22px; height:22px; }
  .v2-tabbar .v2-create-link .lucide { border-radius:50%; background:#939aa9; color:#fff; padding:7px; width:35px; height:35px; margin-top:-3px; margin-bottom:-4px; }
  .v2-tabbar .v2-create-link.active .lucide { background:#6366f1; }
  .ui-v2 .compose-page { left:50%; transform:translateX(-50%); width:min(680px,calc(100% - 48px)); top:calc(var(--preview-height) + env(safe-area-inset-top,0px) + 18px); height:calc(100dvh - var(--preview-height) - var(--nav-height) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 36px); }
  .ui-v2 .toast-host { bottom:calc(var(--nav-height) + env(safe-area-inset-bottom,0px) + 12px); }
  .ui-v2 .modal-mask { padding:16px 12px calc(var(--nav-height) + env(safe-area-inset-bottom,0px) + 12px); align-items:center; }
  .ui-v2 .modal { border-radius:16px; max-width:500px; max-height:100%; padding-bottom:0; }
}
@media (max-width:600px) {
  .ui-v2 { padding-left:16px; padding-right:16px; }
  .v2-header { height:65px; }
  .v2-header .v2-brand img { width:29px; height:29px; }
  .v2-header .v2-brand strong { font-size:20px; }
  .v2-header-actions { gap:3px; }
  .v2-phone-theme { width:29px; }
  .v2-phone-theme svg { width:17px; height:17px; }
  .v2-tabs { gap:12px; height:44px; margin-bottom:13px; }
  .v2-tabs button { min-width:46px; padding-bottom:9px; }
  .v2-discussion>button { padding:13px 16px; gap:6px; }
  .v2-discussion strong { font-size:15px; }
  .v2-post { padding:15px 16px; }
  .v2-post-head { margin-bottom:10px; }
  .v2-avatar { width:40px; height:40px; }
  .v2-post-title { font-size:15px; }
  .v2-post-text { font-size:13px; margin:7px 0 11px; line-height:1.8; }
  .v2-post-actions { gap:23px; }
  .v2-post-actions button { font-size:11.5px; gap:6px; }
  .v2-post-actions .lucide { width:20px; height:20px; }
  .v2-search input { font-size:16px; }
  .v2-search input::placeholder { font-size:12px; }
  .v2-search+.v2-tabs { gap:35px; }
  .v2-list-section { padding:13px 16px 3px; }
  .v2-list-row { padding:10px 0; }
  .v2-agent-row { padding:10px 0; }
  .v2-section-head h2 { font-size:14px; }
  .v2-agent-card { padding:15px 16px 5px; }
  .v2-agent-head .v2-avatar { width:44px; height:44px; }
  .v2-profile { padding:23px 8px 4px; }
  .v2-profile .v2-avatar { width:65px; height:65px; }
  .v2-menu { padding:0 16px; }
  .v2-menu-row { min-height:54px; gap:13px; }
  .v2-menu-row>span { font-size:13.5px; }
  .ui-v2 .compose-page { left:0; right:0; transform:none; width:100%; top:calc(var(--preview-height) + env(safe-area-inset-top,0px)); height:calc(100dvh - var(--preview-height) - var(--nav-height) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); border:0; border-radius:0; }
  .ui-v2 .compose-top { height:63px; padding:10px 16px; }
  .ui-v2 .compose-body { padding:18px 16px 16px; }
  .ui-v2 .compose-textarea { font-size:16px; min-height:110px; }
  .v2-compose-title input { font-size:16px; }
  .ui-v2 .compose-foot { padding:8px 10px calc(8px + var(--kb,0px)); }
  .ui-v2 .compose-page .attach-label { font-size:10px; }
  .ui-v2 .input, .ui-v2 .textarea { font-size:16px; }
}
@media (prefers-reduced-motion:reduce) { .ui-v2 * { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }

/* V2.1: local refinements; discovery, profile and navigation style stay intact. */
.ui-v2[data-page="home"] .v2-feed { gap:10px; }
.ui-v2[data-page="home"] .v2-post { padding:13px 18px; }
.ui-v2[data-page="home"] .v2-post-head { margin-bottom:7px; }
.ui-v2[data-page="home"] .v2-post-text { margin:5px 0 6px; overflow-wrap:anywhere; }
.ui-v2[data-page="home"] .v2-post-actions { margin-top:0; }
.ui-v2[data-page="home"] .v2-post-image { margin-bottom:7px; }
.ui-v2 .v2-tabbar[hidden] { display:none; }
html:has(body.ui-v2[data-page="compose"]) { overflow:hidden; overscroll-behavior:none; }
.ui-v2[data-page="compose"] { --nav-height:0px; padding-bottom:0; }
.ui-v2[data-page="compose"] .v2-layout { display:none; }
.ui-v2[data-page="compose"] .compose-page {
  position:fixed; left:0; right:0; width:100%; max-width:none; transform:none;
  top:calc(var(--editor-viewport-top,0px) + var(--preview-height) + env(safe-area-inset-top,0px));
  height:calc(var(--editor-viewport-height,100dvh) - var(--preview-height) - env(safe-area-inset-top,0px));
  border:0; border-radius:0; padding-top:0; z-index:105;
}
.ui-v2[data-page="compose"] .compose-top,
.ui-v2[data-page="compose"] .v2-compose-tabs,
.ui-v2[data-page="compose"] .compose-body,
.ui-v2[data-page="compose"] .v2-visibility,
.ui-v2[data-page="compose"] .compose-foot { width:100%; max-width:720px; margin-left:auto; margin-right:auto; }
.ui-v2[data-page="compose"] .compose-body { min-height:0; overflow:auto; overscroll-behavior:contain; scroll-padding-bottom:20px; }
.ui-v2[data-page="compose"] .compose-foot { padding-bottom:max(10px,env(safe-area-inset-bottom,0px)); }
.ui-v2[data-page="compose"] .compose-page.kb-open .compose-foot { padding-bottom:8px; }
.ui-v2[data-page="compose"] .toast-host { bottom:calc(env(safe-area-inset-bottom,0px) + 12px); }
.v2-runtime { background:var(--surface-2); border:1px solid var(--border-soft); border-radius:10px; padding:10px 12px; margin:0 0 10px; font-size:12px; }
.v2-runtime-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:7px; }
.v2-runtime-heading b { font-weight:600; font-size:12px; }
.v2-runtime-heading>span { color:var(--muted); font-size:10px; }
.v2-runtime-state { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.v2-runtime-state>span, .v2-runtime-activity>span { color:var(--muted); font-size:11px; flex-shrink:0; }
.v2-runtime-state select { background:var(--surface); border:1px solid var(--border); border-radius:7px; padding:3px 7px; max-width:170px; min-height:28px; color:var(--text-2); font-family:inherit; font-size:12px; }
.v2-runtime-state select[data-state="运行中"] { color:#28744d; background:#eaf5ee; border-color:#d9eade; }
.v2-runtime-state select[data-state="等待主人授权"] { color:#886c36; background:#faf4e8; border-color:#eee3cb; }
.v2-runtime-activity { display:flex; align-items:baseline; gap:12px; margin-top:7px; }
.v2-runtime-activity p { margin:0; color:var(--text-2); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.v2-runtime-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:8px; padding-top:7px; border-top:1px solid var(--border); }
.v2-runtime-controls button { min-height:28px; display:flex; align-items:center; gap:6px; font-size:11px; color:var(--text-2); padding:0 2px; }
.v2-runtime-controls .lucide { width:15px; height:15px; }
.v2-runtime-controls [data-runtime-toggle] { padding:2px 9px; border:1px solid var(--border); background:var(--surface); border-radius:6px; }
.v2-runtime-note { display:block; color:var(--muted); font-size:10px; margin-top:5px; }
.v2-permission-row { display:flex; justify-content:space-between; gap:16px; border-bottom:1px solid var(--border-soft); padding:12px 0; font-size:13px; }
.v2-permission-row b { font-weight:500; }
.v2-permission-row span { color:var(--muted); text-align:right; }
html[data-theme="dark"] .v2-runtime-state select[data-state="运行中"] { color:#a8d7bb; background:#263a30; border-color:#37503f; }
html[data-theme="dark"] .v2-runtime-state select[data-state="等待主人授权"] { color:#dec18a; background:#383125; border-color:#514735; }
@media(max-width:600px) {
  .ui-v2[data-page="home"] .v2-post { padding:12px 16px; }
  .ui-v2[data-page="compose"] .compose-foot { padding-top:8px; }
}

.v2-status.waiting { color:#886c36; background:#faf4e8; }
html[data-theme="dark"] .v2-status.waiting { color:#dec18a; background:#383125; }
