/* One disc contract, loaded after mobile-ux.css to avoid concurrent-file edits. */
html.s1 body #gbBottomTools.arc-disc{box-sizing:border-box;width:212px;height:212px;border:1px solid #555b64;background:#20242b;box-shadow:0 3px 12px #0002;border-radius:50%;isolation:isolate;z-index:var(--layer-stack-62);padding:0}
html.s1 body #gbBottomTools.arc-disc #gbAiRing{position:absolute;inset:0;width:212px;height:212px;margin:0;display:block;pointer-events:none}
html.s1 body #gbBottomTools.arc-disc #gbAiDisc{left:78px!important;top:78px!important;width:56px;height:56px;padding:0;transform:none!important;margin:0;background:#FFFFFF}
html.s1 body #gbBottomTools.arc-disc #gbAiRing>.arc-action,html body :is(#objectToolbar,#arcAiMenu)>.arc-action{box-sizing:border-box;width:44px;height:44px;min-width:44px;min-height:44px;padding:2px;border:0;border-radius:50%;display:flex!important;flex-direction:column!important;align-items:center;justify-content:center;gap:2px;background:#2c323b;color:#f4f5f7;box-shadow:none;line-height:1.1;font:500 9px/1.1 var(--font-ui,system-ui);cursor:pointer;white-space:normal;pointer-events:auto;touch-action:manipulation;animation:none}
html.s1 body #gbBottomTools.arc-disc #gbAiRing>.arc-action{position:absolute;margin:-22px 0 0 -22px}
html.s1 body #gbBottomTools.arc-disc #gbAiRing>.arc-action svg,html body :is(#objectToolbar,#arcAiMenu)>.arc-action svg{width:16px;height:16px;flex:none;color:var(--arc-color);stroke:currentColor;fill:none}
html.s1 body #gbBottomTools.arc-disc #gbAiRing>.arc-action .arc-label,html body :is(#objectToolbar,#arcAiMenu)>.arc-action .arc-label{display:block;max-width:42px;overflow:visible;white-space:normal;overflow-wrap:anywhere;text-wrap:balance;font-size:9px;line-height:10px}
html.s1 body #gbBottomTools.arc-disc #gbAiRing>.arc-action[aria-pressed=true],html body :is(#objectToolbar,#arcAiMenu)>.arc-action[aria-pressed=true]{background:color-mix(in srgb,var(--arc-color) 24%,#20242b);outline:1px solid var(--arc-color);outline-offset:-1px;color:#fff}
html.s1 body #gbBottomTools.arc-disc .arc-center,html body :is(#objectToolbar,#arcAiMenu)>.arc-center{background:#FFFFFF;color:#6B6B70;display:grid!important;place-items:center;font:800 15px/1 system-ui;border:1px solid #d4d4d8}
html body #objectToolbar::before{width:212px;height:212px;background:#20242b;border:1px solid #555b64;box-shadow:0 3px 12px #0002}
.arc-action:focus-visible,#arcPenPanel button:focus-visible{outline:2px solid #8ab4f8!important;outline-offset:2px}
#arcPenPanel{box-sizing:border-box;position:fixed;z-index:var(--layer-stack-89);width:324px;max-width:calc(100vw - 16px);max-height:min(65dvh,540px);overflow:auto;overscroll-behavior:contain;padding:14px;border:1px solid #454b54;border-radius:18px;background:#20242b;color:#f4f5f7;box-shadow:0 6px 20px #0003;font:13px/1.4 var(--font-ui,system-ui);touch-action:pan-y}
#arcPenPanel[hidden]{display:none!important}
#arcPenPanel header{display:flex;align-items:center;gap:8px;margin-bottom:12px}
#arcPenPanel header strong{flex:1;font-size:14px;font-weight:600}
#arcPenPanel button{min-height:44px;min-width:44px;border:1px solid #454b54;border-radius:10px;background:#2c323b;color:inherit;font:inherit;cursor:pointer;padding:6px}
#arcPenPanel header button{background:transparent;border:0;font-size:20px;padding:0}
#arcPenPanel .arc-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#arcPenPanel .arc-grid button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;overflow-wrap:anywhere;min-height:64px}
#arcPenPanel .arc-grid svg{width:20px;height:20px;color:var(--arc-color)}
#arcPenPanel button[aria-pressed=true]{border-color:var(--arc-color,#4285F4);background:#303d56}
#arcPenPanel .arc-field{display:flex;align-items:center;gap:12px;margin:14px 0}
#arcPenPanel .arc-field input[type=range]{flex:1;min-width:0;min-height:44px;accent-color:#4285F4;touch-action:none}
#arcPenPanel .arc-field .cp-swatch{width:44px;height:44px}
#arcPenPanel .arc-pen-types{margin-bottom:12px}
#arcPenPanel .arc-pen-types button{font-size:12px}
#arcPenPanel .arc-grid.arc-tools{border-top:1px solid #454b54;padding-top:12px}
@media(prefers-reduced-motion:reduce){.arc-action{transition:none!important}}
/* Conversation view consumes the existing microphone/playback meters. No idle pulse. */
#voice-panel .arc-voice-wave,#voice-panel .arc-voice-capabilities,#voice-conversation-type{display:none}
html body #voice-panel[data-conversation=true]{left:auto;right:16px;top:auto;bottom:calc(var(--s1-bottom,48px) + 12px);transform:none;width:400px;max-width:calc(100vw - 16px);height:auto;max-height:70dvh;display:block;padding:18px;border-radius:20px;background:#20242b;color:#f4f5f7;border-color:#454b54;--surface:#20242b;--ink:#f4f5f7;--line:#454b54;--muted:#c0c6cf}
#voice-panel[data-conversation=true] .arc-voice-wave{display:flex!important;align-items:center;justify-content:center;gap:6px;height:116px;--voice-level:0}
.arc-voice-wave i{display:block;width:6px;border-radius:4px;background:#4285f4;height:calc(4px + var(--voice-level,0) * var(--wave-weight) * 84px);transition:height 80ms linear}
.arc-voice-wave i:nth-child(4n+2){background:#ea4335}.arc-voice-wave i:nth-child(4n+3){background:#fbbc05}.arc-voice-wave i:nth-child(4n){background:#34a853}
#voice-panel[data-conversation=true] .arc-voice-capabilities{display:grid!important;grid-template-columns:1fr 1fr;gap:8px}
#voice-panel[data-conversation=true] #voice-conversation-type{display:block!important;margin-top:12px}
#voice-panel[data-conversation=true] button{min-height:44px;white-space:normal}
#voice-panel[data-conversation=true] #voice-ring,#voice-panel[data-conversation=true] #voice-expand{display:none!important}
#voice-panel[data-conversation=true] #voice-results{max-height:110px;overflow:auto}
#voice-panel[data-conversation=true] #voice-results .voice-result:last-child{display:block}
/* The legacy light theme styles every section paragraph and details with
   !important. Keep the conversation's own dark surface and readable copy. */
html body #voice-panel[data-conversation=true] :is(p,summary){color:#c0c6cf!important}
html body #voice-panel[data-conversation=true] details{background:transparent!important;border-color:#454b54!important}
html body #voice-panel[data-conversation=true] details div{color:inherit!important}
@media(prefers-reduced-motion:reduce){.arc-voice-wave i{transition:none}}

html.s1 body #gbBottomTools.arc-disc #gbAiRing > .arc-action {backdrop-filter:none}
html.otb-open body #gbBottomTools{visibility:hidden;pointer-events:none}
html.s1 body:has(#voice-panel[data-conversation=true]:not([hidden])) #gbBottomTools{visibility:hidden;pointer-events:none}
/* Q-61：打开「文字提问」输入框时，圆盘自动收起为小 AI 按钮并保持可见（位于输入框上方，由 subject-tools chromeTop 自动避让），绝不让 AI 按钮消失 */
html.s1 body:has(#ai-assistant-bar:not(.hidden)) #gbBottomTools.arc-disc.is-collapsed,
html.s1 body:has(#ai-assistant-bar:not(.hidden)) #gbBottomTools.arc-disc.is-collapsed #gbAiDisc{visibility:visible!important;pointer-events:auto!important;opacity:1}
@media(max-width:767.98px){#arcPenPanel{left:8px!important;right:8px;bottom:auto;top:52px;width:auto;max-height:min(55dvh,480px)}}
#voice-panel[hidden]{display:none!important}
/* Topbar layout only: preserve the existing entry order and controls. */
@media(min-width:768px){
html.s1 body #topNavbar{gap:8px;flex-wrap:nowrap!important;align-items:center}
html.s1 body #topNavbar .redesign-start{min-width:0;flex:1;gap:8px;align-items:center;flex-wrap:nowrap}
html.s1 body #topNavbar .redesign-end{flex-shrink:0;gap:8px;align-items:center;flex-wrap:nowrap}
html.s1 body #topNavbar button{white-space:nowrap;flex-shrink:0;margin-top:0;margin-bottom:0}
html.s1 body #topNavbar #redesignWorkName{min-width:50px!important;width:auto!important;max-width:260px;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.s1 body #topNavbar .redesign-end > #btnShowShortcuts.onboard-help{width:auto!important;height:36px!important;min-height:36px!important;min-width:36px!important;padding:0 10px!important;display:inline-flex!important;align-items:center;justify-content:center;gap:0;flex-shrink:0}
html.s1 body #btnShowShortcuts::before,html.s1 body #btnShowShortcuts::after{content:none!important;display:none!important}
}

@media(max-width:767.98px){html body #voice-panel[data-conversation=true]{box-sizing:border-box;right:8px;bottom:calc(var(--s1-bottom,100px) + 8px);width:calc(100vw - 16px);max-height:66dvh}}
html body #voice-panel[data-conversation=true]{box-sizing:border-box;overflow:auto}
html body :is(#objectToolbar,#arcAiMenu)>.arc-action{backdrop-filter:none}

/* The AI submenu uses the same disc renderer and hit sizes as every other arc. */
#arcAiMenu{position:fixed;box-sizing:border-box;width:212px;height:212px;border:1px solid #555b64;border-radius:50%;background:#20242b;z-index:var(--layer-stack-92);isolation:isolate}
#arcAiMenu>.arc-action{position:absolute;margin:-22px 0 0 -22px}
#arcAiMenu>.arc-center{left:106px;top:106px}
html body #arcAiMenu>.arc-primary{background:#174ea6;outline:1px solid #8ab4f8;outline-offset:-1px}
html body #arcAiMenu>.arc-primary svg{color:#fff}
html.arc-ai-open body :is(#gbBottomTools,#objectToolbar){visibility:hidden;pointer-events:none}

/* UX-A: text alone, without animation, shadow or glow. */
html body :is(#gbAiDisc,#objectToolbar>.arc-center,#arcAiMenu>.arc-center){text-shadow:none!important;filter:none!important;animation:none!important}
html body :is(#gbAiDisc,#objectToolbar>.arc-center,#arcAiMenu>.arc-center) .arc-ai-text{width:auto;height:auto;background:linear-gradient(135deg,#4285F4 0%,#4285F4 30%,#EA4335 48%,#F29900 66%,#34A853 84%)!important;-webkit-background-clip:text!important;background-clip:text!important;color:transparent!important;font:800 15px/1 system-ui;text-shadow:none!important;filter:none!important}
html.s1 body #gbAiDisc .arc-ai-text{font-size:20px}
html body #arcAiMenu>.arc-collapse{color:#6B6B70;background:#FFFFFF;font:500 10px/1 system-ui}
html.s1 body #gbAiRing .arc-pen-options{position:absolute;transform:none;width:44px;height:44px;margin:0;padding:12px;border:0;background:none;box-shadow:none;cursor:pointer;pointer-events:auto;z-index:3;display:grid;place-items:center}
html.s1 body #gbAiRing .arc-pen-options span{box-sizing:border-box;width:20px;height:20px;border:2px solid #fff;border-radius:50%;background:var(--pen-current);display:grid;place-items:center;color:#fff}
html.s1 body #gbAiRing .arc-pen-options svg{width:12px;height:12px;color:#fff;stroke:currentColor;mix-blend-mode:difference}
@media(max-width:767.98px){
 html.s1 body #gbBottomTools.arc-disc,html.s1 body #gbBottomTools.arc-disc #gbAiRing{width:224px;height:224px}
 html.s1 body #gbBottomTools.arc-disc #gbAiDisc{left:82px!important;top:82px!important;width:60px;height:60px}
 html.s1 body #gbAiDisc .arc-ai-text{font-size:22px}
 html.s1 body #gbBottomTools.arc-disc #gbAiRing>.arc-action{width:48px;height:48px;min-width:48px;min-height:48px;margin:-24px 0 0 -24px}
}

/* 华哥 10-29：没选中物体时圆盘收起，只留底部小 AI。展开 180ms，按钮从中心错开弹出。 */
html.s1 body #gbBottomTools.arc-disc.is-placed{transition:width 180ms ease-out,height 180ms ease-out,top 180ms ease-out}
html.s1 body #gbBottomTools.arc-disc.is-placed #gbAiDisc{transition:width 180ms ease-out,height 180ms ease-out,left 180ms ease-out,top 180ms ease-out}
html.s1 body #gbBottomTools.arc-disc.is-collapsed{width:48px;height:48px;border:0;background:transparent;box-shadow:none;overflow:visible}
html.s1 body #gbBottomTools.arc-disc.is-collapsed #gbAiRing,
html.s1 body #gbBottomTools.arc-disc.is-collapsed #gbAiRing button{visibility:hidden!important;pointer-events:none!important;opacity:0}
html.s1 body #gbBottomTools.arc-disc.is-collapsed #gbAiDisc{left:0!important;top:0!important;width:48px;height:48px}
html.s1 body #gbBottomTools .arc-tool-chip{position:absolute;left:calc(100% + 6px);top:50%;width:16px;height:16px;margin:0;padding:0;border:0;background:none;box-shadow:none;filter:none;text-shadow:none;transform:translateY(-50%);display:grid;place-items:center;pointer-events:none;color:var(--arc-tool,#EA4335);z-index:3}
html.s1 body #gbBottomTools .arc-tool-chip svg{width:16px;height:16px;stroke:currentColor;fill:none;filter:none}
html.s1 body #gbBottomTools.arc-disc:not(.is-collapsed) .arc-tool-chip{display:none!important}
html.s1 body #gbBottomTools.arc-disc.is-open #gbAiRing>.arc-action{animation:arc-disc-in 180ms ease-out both}
html.s1 body #gbBottomTools.arc-disc.is-open #gbAiRing>.arc-action:nth-child(2){animation-delay:20ms}
html.s1 body #gbBottomTools.arc-disc.is-open #gbAiRing>.arc-action:nth-child(3){animation-delay:40ms}
html.s1 body #gbBottomTools.arc-disc.is-open #gbAiRing>.arc-action:nth-child(4){animation-delay:60ms}
html.s1 body #gbBottomTools.arc-disc.is-open #gbAiRing>.arc-action:nth-child(5){animation-delay:80ms}
html.s1 body #gbBottomTools.arc-disc.is-open #gbAiRing>.arc-action:nth-child(6){animation-delay:100ms}
html.s1 body #gbBottomTools.arc-disc.is-open #gbAiRing>.arc-action:nth-child(7){animation-delay:120ms}
@keyframes arc-disc-in{from{opacity:0;transform:scale(.72)}to{opacity:1;transform:none}}
@media(max-width:767.98px){
 html.s1 body #gbBottomTools.arc-disc.is-collapsed,
 html.s1 body #gbBottomTools.arc-disc.is-collapsed #gbAiDisc{width:52px;height:52px}
 html.s1 body #gbBottomTools.arc-disc.is-collapsed #gbAiDisc{left:0!important;top:0!important}
}
@media(prefers-reduced-motion:reduce){
 html.s1 body #gbBottomTools.arc-disc,
 html.s1 body #gbBottomTools.arc-disc #gbAiDisc,
 html.s1 body #gbBottomTools.arc-disc #gbAiRing>.arc-action{transition:none!important;animation:none!important}
}

/* flows: voice states consume the existing meters; no new microphone pipeline. */
html body #voice-panel[data-conversation=true] { background:#242423; color:#F2F0EA; border-color:#454541; --surface:#242423; --ink:#F2F0EA; --muted:#C7C4BB; }
#voice-panel[data-conversation=true][data-connecting=true] .arc-voice-wave i,
#voice-panel[data-conversation=true][data-state=paused] .arc-voice-wave i,
#voice-panel[data-conversation=true][data-state=disconnected] .arc-voice-wave i { height:4px; background:#9C9A92; animation:none; }
#voice-panel[data-conversation=true][data-state=thinking]:not([data-connecting=true]) .arc-voice-wave i { height:16px; animation:flow-voice-thinking 1.2s ease-in-out infinite; }
#voice-panel[data-conversation=true][data-state=thinking] .arc-voice-wave i:nth-child(2) { animation-delay:.2s; }
#voice-panel[data-conversation=true][data-state=thinking] .arc-voice-wave i:nth-child(3) { animation-delay:.4s; }
#voice-panel[data-conversation=true][data-state=thinking] .arc-voice-wave i:nth-child(4) { animation-delay:.6s; }
#voice-panel[data-conversation=true] :is(#voice-message,#voice-guide,#voice-results) { font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
#voice-panel[data-conversation=true] #voice-results { max-height:128px; overscroll-behavior:contain; }
#voice-panel[data-conversation=true] textarea { font-size:16px; }
@keyframes flow-voice-thinking { 0%,100% { transform:scaleY(.4); opacity:.5; } 50% { transform:scaleY(1); opacity:1; } }
@media (prefers-reduced-motion:reduce) { #voice-panel[data-conversation=true] .arc-voice-wave i { animation:none!important; transition:none!important; transform:none!important; } }

/* 矮窗口（10-29 冒烟：约 800×350 时 212px 圆盘占了六成高度，压住录制条和缩放条）：
   以圆盘底边为原点整体缩小（独立的 scale 属性，和定位用的 translateX(-50%) 叠加，点击区域跟着缩），底边位置不变、上沿下移。 */
@media (max-height:560px){html.s1 body #gbBottomTools.arc-disc{scale:.78;transform-origin:50% 100%}}
@media (max-height:420px){html.s1 body #gbBottomTools.arc-disc{scale:.64}}
