/* Shared Web / independent iOS shell: original handlers, native interaction layout. */
.composer-input-mode { display:none!important; }
.ws-desktop-identity { display:none; }
/* Shared Web composer: use the same controls and input modes at every width. */
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) .composer-box {
  display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 0;
  border:0; border-radius:0; background:transparent; box-shadow:none;
}
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) :is(.composer-toolbar,.voice-entry-actions) { display:contents; }
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) .composer-attachment-button,
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) .composer-input-mode {
  display:inline-flex!important; justify-content:center; align-items:center;
  width:44px; min-width:44px; height:48px; min-height:48px; flex:0 0 44px; padding:10px;
  border:1px solid var(--ws-line); border-radius:50%; background:var(--ws-surface); color:var(--ws-ink);
  user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
}
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) .composer-attachment-button { order:1; }
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) .composer-attachment-button > svg { display:none; }
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) .composer-attachment-button::after { content:'+'; font-size:30px; font-weight:500; line-height:1; }
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) .composer-input-mode { order:5; }
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) .composer-input-mode > svg { width:24px; height:24px; }
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) :is(#message,#im-entry) {
  display:block; order:3; flex:1 1 80px; width:0; min-width:0; min-height:50px; max-height:140px;
  padding:13px 12px; border:1px solid var(--ws-line); border-radius:16px; background:var(--ws-surface); font-size:16px;
}
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) :is(#send-button,#im-send) { order:4; width:48px; min-width:48px; height:48px; flex:0 0 48px; border-radius:50%; }
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) :is(#voice-toggle,#voice-push,#im-hold) { display:none!important; }
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer)[data-composer-mode=voice] :is(:is(#message,#im-entry),:is(#send-button,#im-send)) { display:none!important; }
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer)[data-composer-mode=voice] :is(#voice-push,#im-hold) {
  display:inline-flex!important; order:3; align-items:center; justify-content:center; gap:7px;
  flex:1 1 96px; width:auto; min-width:96px; max-width:none; height:64px; min-height:64px; padding:10px 8px;
  border:1px solid var(--vi-action,var(--ws-accent)); border-radius:16px;
  background:var(--vi-action,var(--ws-accent)); color:var(--vi-on-action,#fff);
  touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
}
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer)[data-composer-mode=voice] :is(#voice-push-label,#im-hold-label) {
  position:static; display:inline; width:auto; height:auto; overflow:visible; clip-path:none;
  font-size:16px; line-height:1.4; font-weight:600; white-space:normal; pointer-events:none;
}
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) :is(#voice-push,#im-hold) * {
  touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; pointer-events:none;
}
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer)[data-voice-capture=true] :is(#voice-push,#im-hold) {
  background:var(--vi-action-pressed,var(--ws-accent));
  border-color:var(--vi-action-pressed,var(--ws-accent));
}

/* The send button sits inside the text field so both modes occupy the same row. */
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer):not(:where(.ws-global-call #composer)) .composer-box {
  position:relative;
}
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer)[data-composer-mode]:not(:where(.ws-global-call #composer)) :is(#message,#im-entry,#voice-push,#im-hold) {
  box-sizing:border-box; flex:1 1 80px; width:0; min-width:0; margin:0;
  height:64px; min-height:64px; max-height:64px;
}
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer)[data-composer-mode]:not(:where(.ws-global-call #composer)) :is(#message,#im-entry) {
  max-height:min(194px,35dvh); padding:18px 64px 18px 12px; line-height:26px; overflow-y:auto;
}
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer) :is(#message,#im-entry):focus {
  border-color:var(--vi-action,var(--ws-accent)); outline:none;
}
html:not(.native-global-shell) body #web-workspace :is(#composer,#im-composer):not(:where(.ws-global-call #composer)) :is(#send-button,#im-send) {
  position:absolute; inset-inline-end:60px; inset-block-end:16px; z-index:1;
}

html:not(.native-global-shell) body[data-voice-mode=conversation] #web-workspace #composer .composer-input-mode { display:none!important; }

/* The message menu has its own lane below the bubble. Its touch target stays
   generous, while the visible highlight is a small circle around the dots. */
html[data-visual-theme=warm] #web-workspace #conversation > .message:has(> .message-footer > .chat-message-menu) {
  margin-bottom:24px;
}
html[data-visual-theme=warm] #web-workspace #conversation > .message > .message-footer > .chat-message-menu {
  position:absolute; top:calc(100% + 4px); right:0; bottom:auto; left:auto;
  width:44px; height:44px; margin:0; padding:0; background:transparent;
}
html[data-visual-theme=warm] #web-workspace #conversation > .message > .message-footer > .chat-message-menu > summary {
  position:relative; display:flex; align-items:center; justify-content:center; isolation:isolate;
  box-sizing:border-box; width:44px; min-width:44px; max-width:44px;
  height:44px; min-height:44px; max-height:44px; padding:13px; border:0; border-radius:50%;
  background:transparent!important; box-shadow:none; -webkit-tap-highlight-color:transparent;
}
html[data-visual-theme=warm] #web-workspace #conversation > .message > .message-footer > .chat-message-menu > summary::before {
  content:''; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:28px; height:28px; border-radius:50%; background:transparent; pointer-events:none; z-index:-1;
}
html[data-visual-theme=warm] #web-workspace #conversation > .message > .message-footer > .chat-message-menu > summary:is(:hover,:active)::before,
html[data-visual-theme=warm] #web-workspace #conversation > .message > .message-footer > .chat-message-menu[open] > summary::before {
  background:var(--ws-hover);
}
html[data-visual-theme=warm] #web-workspace #conversation > .message > .message-footer > .chat-message-menu > summary svg {
  width:18px; height:18px; flex:none; pointer-events:none;
}
@media (min-width:760px) {
  /* One flow layout for Web: app switches, current-window controls and call.
     The warm conversation overlay must not place several controls at one right offset. */
  html:not(.native-global-shell) body #web-workspace.has-global-system-bar {
    --system-bar-height:56px!important;
  }
  html:not(.native-global-shell) body #web-workspace > .ws-system-bar {
    position:relative!important; inset:auto!important; grid-row:1!important;
    display:flex!important; align-items:center; flex-wrap:nowrap; gap:4px;
    height:56px!important; min-height:56px; padding:6px 16px!important;
    background:var(--ws-surface)!important; border-bottom:1px solid var(--ws-line); pointer-events:auto!important;
  }
  html:not(.native-global-shell) body #web-workspace .assistant-header { display:none!important; }
  html:not(.native-global-shell) body #web-workspace .assistant-main { grid-template-rows:minmax(0,1fr) auto auto; }
  html:not(.native-global-shell) body[data-surface=conversation] #web-workspace .ws-desktop-identity {
    display:flex; align-items:center; flex:0 1 auto; min-width:0; gap:10px; order:0; margin-right:16px;
  }
  html:not(.native-global-shell) body #web-workspace .ws-desktop-identity::before { display:none; }
  html:not(.native-global-shell) body #web-workspace .ws-desktop-identity .assistant-avatar {
    display:flex!important; align-items:center; justify-content:center; width:44px; height:44px; min-width:44px;
    background:transparent url('/brand/vi-v1/logo/symbol-small-brand.svg') center/32px 32px no-repeat!important;
    color:transparent; font-size:0; padding:0; border-radius:10px; cursor:pointer; pointer-events:auto;
  }
  html:not(.native-global-shell) body #web-workspace .ws-desktop-identity .assistant-avatar:focus-visible { outline:2px solid var(--ws-accent); outline-offset:2px; }
  html:not(.native-global-shell) body #web-workspace .ws-desktop-identity h1 { max-width:160px; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:17px; }
  html:not(.native-global-shell) body #web-workspace .ws-desktop-identity #runtime { display:none; }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-system-button:first-child {
    display:inline-flex!important; position:static!important; inset:auto!important; margin:0!important;
    width:44px; min-width:44px; height:44px!important; flex:0 0 44px; padding:10px; order:0;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-system-apps {
    display:flex!important; flex:1 1 auto!important; min-width:44px; height:44px; margin:0 8px!important; gap:6px;
    justify-content:flex-start; overflow-x:auto; overflow-y:hidden; pointer-events:auto;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-system-apps[hidden] { display:none!important; }
  html:not(.native-global-shell) body #web-workspace .ws-system-apps > .ws-system-tab {
    width:44px; min-width:44px; max-width:44px; height:44px; flex:0 0 44px; box-sizing:border-box;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-apps > .ws-system-tab:first-child { margin-left:auto; }
  html:not(.native-global-shell) body #web-workspace .ws-system-tab svg { width:21px; height:21px; }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-application-header:not([hidden]) {
    display:flex!important; order:3; align-items:center; flex:0 0 auto; min-width:0; max-width:none;
    width:auto; height:44px; margin:0; padding:0 0 0 8px; border-left:1px solid var(--ws-line); pointer-events:auto;
  }
  html:not(.native-global-shell) body #web-workspace .ws-application-header > .ax-header {
    display:flex!important; order:1; align-items:center; flex:0 0 auto; min-width:0; height:44px; padding:0; margin:0; border:0; gap:0;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar .ax-header-actions {
    display:flex; flex:none; flex-wrap:nowrap; height:44px; margin:0; gap:0;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar .ax-header-actions > .ax-icon-button {
    position:static; inset:auto; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center;
    width:44px; min-width:44px; max-width:44px; height:44px; min-height:44px; flex:0 0 44px; padding:10px;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar .ax-header-actions svg { width:20px; height:20px; }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-system-separator {
    display:block; order:4; margin:0 8px; pointer-events:none;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar:has(>.ws-system-apps[hidden]) > .ws-system-separator { margin-left:auto; }
  /* Android supplies a fixed native mute/call/end group through the existing bridge. */
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-call-cluster:not(.android-native-call-cluster) {
    position:static!important; inset:auto!important; order:6; display:flex; flex:0 0 auto; margin:0!important;
    width:auto!important; min-width:44px!important; max-width:none; height:44px!important; border:0; background:transparent;
  }
  html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-call-cluster:not(.android-native-call-cluster) > .ws-system-button {
    position:static!important; inset:auto!important; box-sizing:border-box; margin:0!important; padding:10px!important;
    width:44px!important; min-width:44px!important; max-width:44px!important; height:44px!important; min-height:44px; flex:0 0 44px!important;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar .ws-chat-actions { display:none; order:5; }
  html:not(.native-global-shell) body[data-surface=conversation] #web-workspace .ws-system-bar .ws-chat-actions { position:static; display:flex; gap:0; margin:0; }
  html:not(.native-global-shell) body #web-workspace .ws-chat-actions > :is([data-workspace-search],.application-call-entry) { display:none!important; }
  html:not(.native-global-shell) body #web-workspace .ws-chat-actions > #project-direct-open { width:44px; min-width:44px; height:44px; padding:10px; }
  html:not(.native-global-shell) body #web-workspace .ws-chat-actions > #project-direct-open > span { display:none; }
}

@media (max-width:759px) {
  html:not(.native-global-shell) body #web-workspace.has-global-system-bar,
  html:not(.native-global-shell) body #web-workspace.has-global-system-bar[data-toolbar-style=wide] {
    --system-bar-height:52px!important;
  }
  html:not(.native-global-shell) body #web-workspace > .ws-system-bar {
    position:static!important; inset:auto!important; grid-row:1; display:flex!important;
    height:52px!important; min-height:52px; padding:4px 8px!important; gap:2px;
    pointer-events:auto!important; background:var(--ws-surface)!important; border-bottom:1px solid var(--ws-line);
    user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-system-button:first-child {
    display:inline-flex!important; position:static!important; inset:auto!important; margin:0!important;
    width:44px; min-width:44px; height:44px!important; min-height:44px; flex:0 0 44px; padding:10px;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-system-apps {
    display:flex!important; flex:1 1 auto!important; min-width:44px; justify-content:flex-start;
    height:44px; gap:4px; margin:0!important; overflow-x:auto; overflow-y:hidden;
    overscroll-behavior-x:contain; scrollbar-width:none;
  }
  #web-workspace .ws-system-apps::-webkit-scrollbar { display:none; }
  html:not(.native-global-shell) body #web-workspace .ws-system-apps > .ws-system-tab {
    width:44px; min-width:44px; max-width:44px; height:44px; flex:0 0 44px; border-radius:10px;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-tab svg { width:23px; height:23px; }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar .ws-system-label { display:none!important; }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-application-header:not([hidden]),
  html:not(.native-global-shell) body #web-workspace .ws-application-header > .ax-header { display:contents!important; }
  html:not(.native-global-shell) body #web-workspace .ws-application-header .ax-header h1 {
    position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%);
  }
  html:not(.native-global-shell) body #web-workspace .ws-application-header .ax-header-actions {
    display:flex; flex:none; margin:0; gap:0; height:44px;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar .ax-header-actions > .ax-icon-button {
    display:inline-flex; position:static; inset:auto; box-sizing:border-box;
    width:44px; min-width:44px; max-width:44px; flex:0 0 44px;
    height:44px; min-height:44px; padding:10px; overflow:hidden;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar .ax-header-actions svg { width:20px; height:20px; }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-system-separator { display:none!important; }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-call-cluster:not(.android-native-call-cluster) {
    position:static!important; inset:auto!important; display:flex; flex:0 0 44px; margin:0!important;
    width:44px!important; min-width:44px; max-width:44px; height:44px!important; border:0; background:transparent;
  }
  /* The legacy idle entry fills an absolutely positioned desktop call group.
     A flat mobile bar must keep this same button in its own flex slot. */
  html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-call-cluster:not(.android-native-call-cluster) > .ws-call-entry.ws-system-button {
    position:static!important; inset:auto!important; margin:0!important; box-sizing:border-box;
    width:44px!important; min-width:44px!important; max-width:44px!important;
    height:44px!important; min-height:44px; flex:0 0 44px!important; overflow:hidden;
  }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar > .ws-call-cluster:not(.android-native-call-cluster) .ws-call-quick { display:none!important; }
  html:not(.native-global-shell) body #web-workspace .ws-system-bar .ws-chat-actions { display:none; }
  html:not(.native-global-shell) body #web-workspace .ws-chat-actions > button {
    width:44px; min-width:44px; height:44px; min-height:44px; padding:10px; border:0; background:transparent;
  }
  html:not(.native-global-shell) body #web-workspace .ws-chat-actions > .application-call-entry { display:none; }
  html:not(.native-global-shell) body #web-workspace .assistant-header { display:none!important; }
  html:not(.native-global-shell) body #web-workspace .assistant-main { grid-template-rows:minmax(0,1fr) auto auto; }

  /* Mobile calls occupy one page; minimizing retains the existing call. */
  html[data-theme] #web-workspace .ws-global-call[data-mode=stage] {
    inset:var(--app-top,0px) 0 auto; width:100%!important; max-width:100%;
    height:var(--app-height,100dvh); max-height:var(--app-height,100dvh);
    padding:12px 20px max(20px,env(safe-area-inset-bottom)); border:0; border-radius:0;
    box-shadow:none; background:var(--ws-surface); color:var(--ws-ink);
  }
  html[data-theme][data-visual-theme=warm] #web-workspace .ws-global-call[data-mode=stage] {
    --ws-ink:var(--vi-ink); --ws-muted:var(--vi-muted); --ws-accent:var(--vi-action);
    --ws-surface:var(--vi-surface); --ws-line:var(--vi-border);
    --ws-hover:var(--vi-paper); --ws-accent-soft:var(--vi-brand-soft);
  }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-window-controls > .ws-call-resize { display:none; }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-window-controls > .ws-call-minimize {
    display:inline-flex; width:44px; min-width:44px; height:44px; min-height:44px;
  }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-handle { cursor:default; touch-action:auto; }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-connecting {
    display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center;
    min-height:0; padding:32px 0;
  }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-dock > .ws-call-actions {
    border:0; border-radius:0; background:transparent; box-shadow:none; padding:12px 0!important;
  }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-end[data-action=start] {
    background:var(--ws-accent); color:var(--vi-on-action,#fff);
  }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-end[data-action=start] .ws-call-end-icon { transform:rotate(135deg); }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-heading,
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-actions {
    user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
  }

  /* Settings are rows of names and values; editable fields retain their border. */
  #host-manager:not([data-application-embedded]) :is(#settings-category-toggle,#host-manager-close) {
    border:0; background:transparent; border-radius:10px;
  }
  #host-manager:not([data-application-embedded]) .workspace-appearance { gap:0; padding:0; border-top:0; }
  #host-manager:not([data-application-embedded]) .workspace-appearance .settings-row-heading {
    display:flex; align-items:center; flex-wrap:nowrap; gap:16px;
    min-height:60px; margin:0; padding:6px 0; border-bottom:1px solid var(--ws-line);
    font-size:15px; font-weight:500;
  }
  #host-manager:not([data-application-embedded]) .workspace-appearance .settings-row-heading h3 {
    flex:1; min-width:0; font-size:15px; font-weight:500;
  }
  #host-manager:not([data-application-embedded]) .workspace-appearance select {
    width:auto; min-width:0; max-width:62%; min-height:48px; padding:8px 2px 8px 8px;
    border:0; border-radius:0; background:transparent; color:var(--ws-muted);
    font-size:16px; text-align:right; text-align-last:right;
  }
  #host-manager:not([data-application-embedded]) .personal-settings-content { padding:12px 20px max(24px,env(safe-area-inset-bottom)); }
  #host-manager:not([data-application-embedded]) :is(.settings-form-card,.model-settings-card,.marketplace-section) { border-radius:0; box-shadow:none; }
  #host-manager:not([data-application-embedded]) .settings-panel-header { padding-bottom:4px; }
  #host-manager:not([data-application-embedded]) .settings-panel-header h2 { font-size:23px; }
  #host-manager:not([data-application-embedded]) .settings-row-heading select:focus-visible { outline:2px solid var(--ws-accent); outline-offset:2px; }

  /* The selection action stays small instead of expanding a message into a form. */
  #web-workspace #conversation > .message.message-selecting { outline:none; }
  #web-workspace #conversation .message-selection-toolbar {
    gap:4px; margin-top:8px; padding:4px 0 0; border:0; border-top:1px solid var(--ws-line);
    border-radius:0; background:transparent;
  }
  #web-workspace #conversation .message-selection-toolbar > span { font-size:12px; }
  #web-workspace #conversation .message-selection-toolbar > button {
    min-height:44px; padding:8px; border:0; border-radius:7px; background:transparent; font-size:13px;
  }
}

@media (max-width:759px) and (max-height:480px) {
  #web-workspace .ws-global-call[data-mode=stage] { padding-block:8px; }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-connecting { padding-block:8px; }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-calling-face { width:64px; height:64px; margin-bottom:8px; }
  #web-workspace .ws-global-call[data-mode=stage] .ws-call-calling-name { font-size:19px; margin-bottom:6px; }
}
/* Keep the existing reply playback toggle next to the call entry on every Web surface. */
#web-workspace .ws-system-bar > #chat-auto-voice {
  display:inline-flex; align-items:center; justify-content:center; order:5; flex:none;
  width:44px; min-width:44px; height:44px; min-height:44px; padding:0;
  margin-inline-start:auto;
  color:var(--ws-muted); border:0; border-radius:8px; background:transparent;
}
#web-workspace .ws-system-bar > #chat-auto-voice svg { width:19px; height:19px; }
#web-workspace .ws-system-bar > #chat-auto-voice + .ws-call-cluster { margin-inline-start:0!important; }
@media (hover:hover) { #web-workspace .ws-system-bar > #chat-auto-voice:hover { background:var(--ws-hover); } }
html[data-theme] #web-workspace .ws-system-bar > #chat-auto-voice[aria-pressed=true] { color:var(--vi-action,var(--ws-accent)); }

@media (max-width:759px) {
  html:not(.native-global-shell) #web-workspace .assistant-main[data-im-mode] :is(.im-chat-head,.assistant-header) {
    min-height:48px; padding:2px 8px; gap:4px;
  }
  html:not(.native-global-shell) body[data-surface=conversation] #web-workspace.has-global-system-bar:has(.assistant-main:is([data-im-mode=thread],[data-im-mode=assistant])),
  html:not(.native-global-shell) body.keyboard-open[data-surface=conversation] #web-workspace.has-global-system-bar {
    grid-template-rows:var(--system-bar-height) minmax(0,1fr) 0;
  }
  html:not(.native-global-shell) body[data-surface=conversation] #web-workspace:has(.assistant-main:is([data-im-mode=thread],[data-im-mode=assistant])) > .mobile-nav {
    display:none;
  }
  html:not(.native-global-shell) body[data-surface=conversation] #web-workspace .assistant-main[data-im-mode=assistant] {
    grid-template-rows:auto minmax(0,1fr) auto auto;
  }
  html:not(.native-global-shell) body[data-surface=conversation] #web-workspace .assistant-main[data-im-mode=assistant] > .assistant-header {
    display:grid!important;grid-template-columns:minmax(44px,1fr) minmax(0,auto) minmax(44px,1fr);
  }
  html:not(.native-global-shell) body[data-surface=conversation] #web-workspace .assistant-main[data-im-mode] :is(.assistant-header,.im-chat-head) {
    background:var(--ws-surface);border-bottom:1px solid var(--ws-line);
  }
  html:not(.native-global-shell) .assistant-main[data-im-mode=assistant] .im-assistant-title {
    display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px;font-weight:650;
  }
  html:not(.native-global-shell) .assistant-main[data-im-mode=assistant] .im-assistant-actions {
    display:flex;align-items:center;justify-self:end;
  }
  html:not(.native-global-shell) body[data-surface=conversation] #web-workspace .assistant-main[data-im-mode] :is(#composer,#im-composer) {
    padding:5px 12px 8px;
  }
  html:not(.native-global-shell) body[data-surface=conversation]:not(.keyboard-open) #web-workspace .assistant-main[data-im-mode] :is(#composer,#im-composer) {
    padding-bottom:max(8px,env(safe-area-inset-bottom));
  }
}

#conversation .message-source-replay { display:flex; justify-content:flex-end; margin-block:0 6px; }
#conversation .message-source-replay .im-voice-bubble { background:var(--ws-hover); }

/* Message playback feedback stays with the message, including failed starts. */
.message-playback-status{display:block;margin-top:8px;font-size:12px;line-height:1.5;color:var(--ws-muted);background:none;border:0}

@media(min-width:760px){
  html:not(.native-global-shell) body[data-surface=conversation] #web-workspace .assistant-main[data-im-mode=assistant] {
    grid-template-rows:auto minmax(0,1fr) auto auto;
  }
  html:not(.native-global-shell) body[data-surface=conversation] #web-workspace .assistant-main[data-im-mode=assistant] > .assistant-header {
    display:flex!important; min-height:48px; padding:2px 14px; gap:8px;
    border-bottom:1px solid var(--ws-line);
  }
  html:not(.native-global-shell) .assistant-main[data-im-mode=assistant] :is(.im-assistant-title,.im-assistant-actions) { display:flex; }
  html:not(.native-global-shell) .im-assistant-actions { margin-inline-start:auto;align-items:center; }
  html:not(.native-global-shell) #web-workspace .im-chat-head .im-mobile-back {display:grid;flex:none}
  html:not(.native-global-shell) .im-assistant-actions #project-direct-open {min-height:44px}
}
@media(max-width:759px){
  html:not(.native-global-shell) .im-assistant-actions #project-direct-open {display:none}
}

/* The persistent Web toolbar and the current page have separate rows. */
html:not(.native-global-shell) body #web-workspace > .ws-system-bar > :is(.ws-desktop-identity,.ws-chat-actions,.ws-system-separator) {
  display:none!important;
}
html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-system-apps {
  align-items:center; justify-content:flex-end;
}
html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-system-apps[hidden] {
  display:none!important;
}
html:not(.native-global-shell) #web-workspace .ws-system-apps > .ws-system-tab:first-child {
  margin-inline-start:0;
}
html:not(.native-global-shell) #web-workspace .ws-system-apps > .ws-system-tab:is([aria-current=page],[data-minimized=true]) {
  color:var(--ws-ink)!important;background:transparent!important;box-shadow:none;
}
html:not(.native-global-shell) #web-workspace .ws-system-apps > .ws-system-tab[aria-current=page] {
  position:relative;
}
html:not(.native-global-shell) #web-workspace .ws-system-apps > .ws-system-tab[aria-current=page]::after {
  content:''; position:absolute; bottom:2px; left:50%; width:16px; height:2px;
  transform:translateX(-50%); border-radius:2px; background:var(--ws-accent);
}
html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-global-search-entry {
  display:none;
}
html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-call-cluster:not(.android-native-call-cluster) {
  width:44px!important; min-width:44px!important; max-width:44px; flex:0 0 44px;
  background:transparent; border:0; margin-inline-start:auto!important;
}
html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-call-cluster:not(.android-native-call-cluster) > .ws-call-entry.ws-system-button {
  position:relative!important; width:44px!important; min-width:44px!important; max-width:44px!important; flex:0 0 44px!important;
  background:transparent; color:var(--ws-muted);border-radius:8px;box-shadow:none;
}
html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-call-cluster:not(.android-native-call-cluster) > .ws-call-entry.ws-system-button:hover {
  background:var(--ws-hover)!important; color:var(--ws-ink);
}
html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-call-cluster:not(.android-native-call-cluster) .ws-call-quick {
  display:none!important;
}
/* Keep the phone glyph and show the current conversation phase in its corner. */
html:not(.native-global-shell) #web-workspace .ws-system-bar .ws-call-entry > .ws-call-entry-signal {
  position:absolute; top:4px; right:2px; width:16px; height:13px; gap:1px;
  background:var(--ws-surface); border-radius:4px; color:var(--ws-accent); pointer-events:none;
}
html:not(.native-global-shell) #web-workspace .ws-system-bar .ws-call-entry > .ws-call-entry-signal > i {
  display:block; width:2px; height:3px; flex:none;
}
#web-workspace .ws-system-bar .ws-call-entry > .ws-call-entry-signal:is([data-signal=listening],[data-signal=wave]) > :is(i:nth-child(2),i:nth-child(4)) { height:6px; }
#web-workspace .ws-system-bar .ws-call-entry > .ws-call-entry-signal[data-signal=listening] > i:nth-child(3) { height:8px; }
#web-workspace .ws-system-bar .ws-call-entry > .ws-call-entry-signal[data-signal=wave] > i:nth-child(3) { height:10px; }
#web-workspace .ws-system-bar .ws-call-entry > .ws-call-entry-signal[data-signal=wave] > :is(i:first-child,i:last-child) { height:5px; }
html:not(.native-global-shell) #web-workspace .ws-system-bar .ws-call-entry > .ws-call-entry-signal:is([data-signal=thinking],[data-signal=connecting]) > :is(i:first-child,i:last-child) { display:none; }
html:not(.native-global-shell) #web-workspace .ws-system-bar .ws-call-entry > .ws-call-entry-signal:is([data-signal=muted],[data-signal=failed]) { color:var(--ws-danger); }
html:not(.native-global-shell) body #web-workspace > .ws-system-bar :is(.ws-system-button,.ws-system-tab) > svg {
  width:19px; height:19px;
}
html:not(.native-global-shell) #web-workspace > .applications-surface:not(:has(>.ax-header:not([hidden]))) > .ax-root {
  grid-row:1 / -1;
}
html:not(.native-global-shell) #web-workspace > .applications-surface > .ax-header {
  min-height:48px; padding:2px 8px; gap:6px;
}
html:not(.native-global-shell) #web-workspace .applications-surface .ax-header .ax-window-icon {
  display:none!important;
}
html:not(.native-global-shell) #web-workspace .applications-surface .ax-page-back {
  width:44px; min-width:44px; height:44px;padding:10px;flex:none;color:var(--ws-muted);
}
html:not(.native-global-shell) #web-workspace .applications-surface .ax-header h1 {
  font-size:16px;
}
html:not(.native-global-shell) #web-workspace .applications-surface .ax-header-actions {
  margin-inline-start:auto; flex:none; gap:0; flex-wrap:nowrap;
}
html:not(.native-global-shell) #web-workspace .applications-surface .ax-header-actions > :is(.ws-app-fullscreen,.ws-app-minimize,.ws-close-page) {
  width:44px; min-width:44px; height:44px; min-height:44px; padding:0;
  flex:0 0 44px; color:var(--ws-muted);
}
html:not(.native-global-shell) #web-workspace .applications-surface .ax-header-actions > :is(.ws-app-fullscreen,.ws-app-minimize,.ws-close-page) > svg {
  width:20px; height:20px;
}
@media(max-width:759px){
  html:not(.native-global-shell) body #web-workspace > .ws-system-bar {
    gap:0; padding-inline:8px!important;
  }
  html:not(.native-global-shell) body[data-surface] #web-workspace.has-global-system-bar > .ws-system-bar > .ws-global-search-entry {
    display:inline-flex!important; position:static!important; inset:auto!important; order:1;
    width:44px; min-width:44px; height:44px; flex:0 0 44px; padding:10px;
  }
  /* Fit all five app buttons in the remaining space. */
  html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-system-apps > .ws-system-tab {
    width:44px; min-width:0; max-width:44px; flex:0 1 44px; padding-inline:0;
  }
  html:not(.native-global-shell) body #web-workspace > .ws-system-bar > .ws-system-apps {
    gap:0; min-width:0;
  }
}

/* A phone is still a single-column conversation when turned sideways. */
/* Keep the compact navigation and its reserved space uniform across surfaces. */
html[data-compact-landscape]:not(.native-global-shell) {
  --workspace-bottom:calc(45px + env(safe-area-inset-bottom));
}
html[data-compact-landscape]:not(.native-global-shell) body[data-surface="conversation"] #web-workspace.has-global-system-bar {
  --system-bar-height:48px!important;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:var(--system-bar-height) minmax(0,1fr) var(--workspace-bottom);
}
html[data-compact-landscape]:not(.native-global-shell) body[data-surface="conversation"] #web-workspace > .side-rail { display:none; }
html[data-compact-landscape]:not(.native-global-shell) body[data-surface="conversation"] #web-workspace > .ws-system-bar {
  grid-column:1; height:48px!important; min-height:48px; padding-block:2px!important;
}
html[data-compact-landscape]:not(.native-global-shell) body[data-surface="conversation"] #web-workspace > .assistant-main {
  grid-area:2 / 1; min-height:0; padding:0;
}
html[data-compact-landscape]:not(.native-global-shell) body #web-workspace > .mobile-nav {
  min-height:var(--workspace-bottom); padding:0 6px env(safe-area-inset-bottom);
}
html[data-compact-landscape]:not(.native-global-shell) body #web-workspace > .mobile-nav button {
  min-height:44px; display:flex; align-items:center; justify-content:center; gap:6px; padding-block:0;
}
html[data-compact-landscape]:not(.native-global-shell) body[data-surface="conversation"] #web-workspace #composer {
  padding:4px clamp(12px,3vw,28px) 6px;
}
html[data-compact-landscape]:not(.native-global-shell) body[data-surface="conversation"] #web-workspace #conversation {
  padding-block:12px; gap:14px;
}

/* Workspace section tabs. Each row begins at the content gutter. */
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) :is(.work-tabs,.ax-panes,.library-mobile-tabs) {
  align-items:center; justify-content:flex-start; flex:0 0 auto;
  gap:20px; min-height:44px; overflow-x:auto; scrollbar-width:none;
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) :is(.work-tabs,.ax-panes,.library-mobile-tabs) > button {
  position:relative; display:inline-flex; align-items:center; justify-content:flex-start;
  flex:0 0 auto; min-width:44px; min-height:44px; padding:0; gap:5px;
  border:0; border-radius:0; background:transparent; color:var(--ws-muted);
  font-family:inherit; font-size:14px; line-height:20px; font-weight:500;
  white-space:nowrap; text-align:start; cursor:pointer;
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) :is(.work-tabs,.ax-panes,.library-mobile-tabs) > button:is([aria-selected=true],[aria-current=page]) {
  background:transparent; color:var(--ws-accent); font-weight:600;
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) :is(.work-tabs,.ax-panes,.library-mobile-tabs) > button:is([aria-selected=true],[aria-current=page])::after {
  content:''; position:absolute; inset:auto auto 0 0; width:18px; height:2px;
  background:var(--ws-accent); border-radius:2px;
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) :is(.work-tabs,.ax-panes,.library-mobile-tabs) > button:focus-visible {
  outline:2px solid var(--ws-accent); outline-offset:-2px;
  border-radius:6px; box-shadow:none;
}
html[data-theme][data-visual-theme] body[data-surface] #web-workspace .task-panel-header {
  min-height:45px; padding-block:0;
}
html[data-theme][data-visual-theme] body[data-surface] #web-workspace .task-panel-header > div > p { display:none; }
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) :is(.work-tabs,.ax-panes,.library-mobile-tabs) > button > #project-count-mini { margin:0; font-size:11px; font-weight:500; }
@media(max-width:979px) {
  html[data-theme][data-visual-theme] body[data-surface] #cloud-manager .library-mobile-tabs {
    margin-inline:20px; padding:0; border-bottom:1px solid var(--ws-line);
  }
}
@media(max-width:759px) {
  html[data-theme][data-visual-theme] body[data-surface] #web-workspace .task-panel-header { padding-inline:16px; }
  html[data-theme][data-visual-theme] body[data-surface] #cloud-manager .library-mobile-tabs { margin-inline:16px; }
  html[data-theme][data-visual-theme] body[data-surface] #cloud-manager[open] .cloud-drive-toolbar { padding-inline:16px; }
}

/* Workspace list toolbar */
html[data-theme][data-visual-theme] body[data-surface] #web-workspace .task-controls {
  grid-template-columns:auto minmax(100px,1fr) 108px 108px 124px;
  gap:8px;
}
html[data-theme][data-visual-theme] body[data-surface] #cloud-manager[open] .cloud-drive-toolbar {
  flex-wrap:nowrap; gap:8px;
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-list-create {
  order:-1; flex-shrink:0; justify-self:start;
}
/* Main create entries share one shape and one theme action role. */
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-create-button {
  box-sizing:border-box; display:grid; place-items:center; flex:0 0 44px;
  width:44px; min-width:44px; max-width:44px; height:44px; min-height:44px; padding:0; gap:0;
  border:1px solid transparent; border-radius:var(--vi-radius-control,11px); list-style:none; cursor:pointer;
  background:var(--ws-accent); color:var(--ws-on-accent); box-shadow:none;
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-create-button:is(:hover,:active),
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) details[open] > .workspace-create-button {
  background:var(--ws-accent-hover);
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-create-button:focus-visible {
  outline:2px solid var(--ws-accent); outline-offset:3px;
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-create-button > svg {
  display:block; width:21px; height:21px; margin:0; fill:none;
  stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;
}
.workspace-create-button::marker { content:""; }
.workspace-create-button::-webkit-details-marker { display:none; }
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-list-create > :is(.work-create-options,.cloud-action-menu-popover) {
  inset-inline:0 auto;
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-list-search {
  box-sizing:border-box; display:flex; align-items:center; flex:1 1 auto;
  height:44px; min-height:44px; max-width:none; padding:0 10px 0 0; gap:0;
  border:1px solid var(--app-field-border); border-radius:11px; background:var(--app-field-bg);
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-list-search :is(#task-search,#cloud-file-query) {
  height:42px; min-height:0; flex:1; width:0; padding:0;
  font-size:14px; line-height:20px;
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-list-search > .workspace-list-search-icon {
  order:-1; display:grid; place-items:center; flex:0 0 42px;
  min-width:0; min-height:0; height:42px; padding:0; border:0; border-radius:10px;
  color:var(--app-muted); background:transparent;
}
html[data-theme][data-visual-theme] body[data-surface] #cloud-manager .workspace-list-search > button:hover {
  color:var(--app-ink); background:var(--ws-hover);
}
html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-list-search-icon > svg {
  display:block; width:18px; height:18px; fill:none; stroke:currentColor;
  color:inherit; stroke-width:1.7; stroke-linecap:round;
}
@media(max-width:979px) {
  html[data-theme][data-visual-theme] body[data-surface] #web-workspace .task-controls {
    grid-template-columns:auto minmax(100px,1fr) 104px 104px;
  }
  html[data-theme][data-visual-theme] body[data-surface] #cloud-manager .library-mobile-tabs { margin-inline:16px; }
  html[data-theme][data-visual-theme] body[data-surface] #cloud-manager[open] .cloud-drive-toolbar {
    padding-top:12px; padding-inline:16px;
  }
}
@media(max-width:759px) {
  html[data-theme][data-visual-theme] body[data-surface] #web-workspace .task-controls {
    grid-template-columns:repeat(3,minmax(0,1fr)); padding-inline:16px;
  }
  html[data-theme][data-visual-theme] body[data-surface] #web-workspace .task-controls > .task-toolbar {
    display:grid; grid-area:1 / 1 / 2 / -1; grid-template-columns:auto minmax(0,1fr);
    padding:0; gap:8px;
  }
  html[data-theme][data-visual-theme] body[data-surface] #web-workspace .workspace-list-create { grid-area:1 / 1; }
  html[data-theme][data-visual-theme] body[data-surface] #web-workspace .workspace-list-search { grid-area:1 / 2; }
  html[data-theme][data-visual-theme] body[data-surface] :is(#web-workspace,#cloud-manager) .workspace-list-search :is(#task-search,#cloud-file-query) {
    font-size:16px;
  }
}

/* Web workspace chrome uses one palette across the four primary sections. */
html[data-visual-theme="warm"]:not(.native-global-shell) body[data-access="app"] #web-workspace > .ws-system-bar {
  --ws-muted: var(--vi-muted);
}
#cloud-file-list[hidden] { display: none !important; }
:is(.library-search-status, #cloud-upload-progress) > p { margin: 0; }
#cloud-manager .cloud-notice-action {
  min-height: 44px;
  margin-block-start: 4px;
  margin-inline-end: 8px;
  padding-inline: 12px;
  border: 1px solid var(--ws-line);
  border-radius: 8px;
  color: var(--ws-ink);
  background: var(--ws-surface);
}
#cloud-manager .cloud-notice-action:hover { background: var(--ws-hover); }
#cloud-manager .cloud-notice-action:focus-visible {
  outline: 2px solid var(--ws-accent);
  outline-offset: 2px;
}
@media (min-width: 760px) and (max-width: 1000px) and (orientation: portrait) {
  html:not(.native-global-shell):not([data-sidebar-collapsed="true"]) { --workspace-nav: 132px; }
  html:not(.native-global-shell) #web-workspace .side-rail { padding-inline: 8px; }
  html:not(.native-global-shell) #web-workspace .side-rail .workspace-search kbd { display: none; }
  html:not(.native-global-shell) #web-workspace .assistant-main[data-im-mode] { --im-width: 190px; }
  html:not(.native-global-shell) #web-workspace .im-inbox { padding-inline: 8px; }
  html:not(.native-global-shell) #web-workspace .im-row { column-gap: 6px; grid-template-columns: 36px minmax(0, 1fr) auto; }
  html:not(.native-global-shell) #web-workspace .im-row .im-avatar { width: 36px; height: 36px; }
  html:not(.native-global-shell) #web-workspace .im-rows > .im-row .im-row-title:has(.im-row-time) {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px;
  }
  html:not(.native-global-shell) #web-workspace .im-rows > .im-row .im-row-time {
    display: inline; justify-self: start; font-size: 11px;
  }
}
@media (min-width: 1520px) {
  html:not(.native-global-shell) #web-workspace .applications-surface[data-pane="mine"]:not([data-layout="list"]) > .ax-root {
    max-width: min(100%, 1840px);
    padding-inline: 28px;
  }
  html:not(.native-global-shell) #web-workspace .applications-surface[data-pane="mine"]:not([data-layout="list"]) .ax-catalog {
    grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  }
}
@media (max-width: 759px) {
  html:not(.native-global-shell) #web-workspace .applications-surface > .ax-header {
    min-height: 48px;
  }
  html:not(.native-global-shell) #web-workspace .applications-surface > .ax-header h1 {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    line-height: 1.4;
  }
}

@media (max-width: 759px) {
  html:not(.native-global-shell) #web-workspace .ax-header:is([data-application-id="course-app"], [data-application-id="whiteboard"]) :is(.ax-page-back, .ws-close-page):not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: auto;
    gap: 3px;
    padding-inline: 6px;
    font-size: 12px;
    white-space: nowrap;
  }
  html:not(.native-global-shell) #web-workspace .ax-header:is([data-application-id="course-app"], [data-application-id="whiteboard"]) :is(.ax-page-back, .ws-close-page) svg {
    width: 16px;
    height: 16px;
  }
  html:not(.native-global-shell) #web-workspace .ax-header:is([data-application-id="course-app"], [data-application-id="whiteboard"]) .ax-page-back-label,
  html:not(.native-global-shell) #web-workspace .ax-header:is([data-application-id="course-app"], [data-application-id="whiteboard"]) .ax-page-close-label { display: inline; }
}
