/* Shared desktop component. No native bridge = unchanged browser/mobile UI. */
html.corvion-native-chrome {
  --corvion-native-content-top: 54px;
  --corvion-app-header-height: 54px;
  --corvion-calendar-titlebar-height: 54px;
  --corvion-window-leading: 20px;
}
html.corvion-native-chrome[data-corvion-window-header="integrated"] { --corvion-native-content-top: 0px; }
html.corvion-native-chrome[data-corvion-window-kind="corvion"] { --corvion-native-content-top: 52px; }
html.corvion-native-chrome[data-corvion-window-kind="organization-brain"][data-corvion-window-fullscreen="true"] { --corvion-native-content-top: 0px; }
html.corvion-native-chrome[data-corvion-window-platform="darwin"][data-corvion-window-focused="true"][data-corvion-window-fullscreen="false"] { --corvion-window-leading: 104px; }
corvion-window-header {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 var(--corvion-window-header-height, 54px);
  align-items: center;
  gap: 18px;
  width: 100%;
  height: var(--corvion-window-header-height, 54px);
  min-height: var(--corvion-window-header-height, 54px);
  min-width: 0;
  padding: 0 16px 0 var(--corvion-window-leading, 104px);
  border-bottom: var(--corvion-window-header-border, 1px solid #2b2e30);
  background: var(--corvion-window-header-background, #181a1c);
  color: #edf2f3;
  font: 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-app-region: drag;
  user-select: none;
  transition: padding-left 180ms cubic-bezier(.22,.8,.22,1);
}
corvion-window-header[data-appearance="frameless"] {
  --corvion-window-header-height: 34px;
  --corvion-window-header-border: 0;
  --corvion-window-header-background: transparent;
}
corvion-window-header[data-standalone] { position: fixed; inset: 0 0 auto; z-index: 2147483647; }
html.corvion-native-chrome[data-corvion-window-kind="organization-brain"][data-corvion-window-fullscreen="true"] corvion-window-header { display: none; }
corvion-window-brand { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; min-width: 0; }
corvion-window-brand > svg { width: 21px; height: 21px; flex: 0 0 21px; color: #55d4ca; }
corvion-window-brand > strong { font: inherit; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
corvion-window-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; margin-left: auto; overflow-x: auto; scrollbar-width: none; -webkit-app-region: no-drag; }
corvion-window-tools > :is(div, nav) { display: flex; align-items: center; gap: 6px; min-width: 0; }
corvion-window-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; min-width: 30px; min-height: 30px; padding: 5px 8px; border: 0; border-radius: 8px; background: transparent; color: #b5bec3; font: 12px/1.2 -apple-system, BlinkMacSystemFont, sans-serif; cursor: pointer; }
corvion-window-tools button:hover { background: #282c2f; color: #fff; }
corvion-window-tools button:focus-visible { outline: 2px solid #55d4ca; outline-offset: -2px; }
corvion-window-tools svg { width: 18px; height: 18px; }
corvion-window-tools :is([data-mail-close], [data-mail-window-mode], [data-calendar-close], [data-calendar-window-minimize], [data-calendar-window-mode], [data-contacts-close], [data-files-window-close], [data-files-window-minimize], [data-files-window-maximize], .vidu-app-modal-close, .vidu-ai-close, .corvion-app-header-detach) { display: none; }
corvion-window-context { min-width: 0; flex: 1 1 220px; overflow: hidden; -webkit-app-region: no-drag; }
corvion-window-context > div { display: flex; align-items: center; min-width: 0; gap: 8px; }
corvion-window-context > div > span:first-child { display: none; }
corvion-window-context input { min-width: 0; max-width: 100%; }
/* Office's old > header selectors no longer match the integrated titlebar. */
.vidu-office-editor-shell > corvion-window-header { position: relative; z-index: 30; }
.vidu-office-editor-shell corvion-window-context { flex: 1 1 240px; min-width: 100px; }
.vidu-office-editor-shell corvion-window-context .vidu-office-title-field { flex: 1 1 0; }
.vidu-office-editor-shell corvion-window-context input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #f3f7f5;
  font: 600 16px/1.2 Inter, system-ui, sans-serif;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  -webkit-app-region: no-drag;
}
.vidu-office-editor-shell corvion-window-context input:focus { outline: 2px solid #8294d8; outline-offset: -2px; background: #24272b; }
@media (max-width: 900px) {
  .vidu-office-editor-shell corvion-window-brand > strong,
  .vidu-office-editor-shell corvion-window-context em,
  .vidu-office-editor-shell corvion-window-tools small { display: none; }
}
corvion-window-header :is(button, input, select, textarea, a, [contenteditable="true"]) { -webkit-app-region: no-drag; }
@media (prefers-reduced-motion: reduce) { corvion-window-header { transition: none; } }
/* Embedded windows use DOM dragging; only a detached window uses native drag regions. */
html:not(.corvion-detached-app):not(.corvion-detached-surface) :is(.corvion-files-titlebar,.corvion-files-window > corvion-window-header,.vidu-office-editor-shell > header,.vidu-office-editor-shell > corvion-window-header,#vidu-app-modal.vidu-messages-modal-shell .vidu-app-modal-header) {
 -webkit-app-region:no-drag !important; pointer-events:auto !important; touch-action:none; cursor:grab; user-select:none;
}
html:not(.corvion-detached-app):not(.corvion-detached-surface) :is(.corvion-files-titlebar,.vidu-office-editor-shell > header,#vidu-app-modal.vidu-messages-modal-shell .vidu-app-modal-header) :is(button,a,input,select,textarea,summary,[contenteditable]) {
 -webkit-app-region:no-drag !important; pointer-events:auto !important; touch-action:auto;
}
#vidu-app-modal.vidu-messages-modal-shell .vidu-app-modal-dialog.is-messages-positioned {
 position:fixed !important; margin:0 !important; inset:auto !important;
 left:var(--messages-window-left) !important; top:var(--messages-window-top) !important;
 width:var(--messages-window-width) !important; height:var(--messages-window-height) !important;
 transform:none !important; animation:none !important;
}
