body[data-browser-preview="true"] { --titlebar: 0px; }
body[data-browser-preview="true"] .topbar { display: none; }

body[data-browser-preview="true"]:not([data-packaged-web="true"]) .topbar-spacer {
  display: flex;
  justify-content: flex-end;
  overflow: hidden;
}

body[data-browser-preview="true"]:not([data-packaged-web="true"]) .topbar-spacer::after {
  flex: none;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  content: "LOCAL PREVIEW";
  font: 650 9px/1.2 var(--mono);
  letter-spacing: .08em;
  pointer-events: none;
}

body[data-packaged-web="true"] .conversation-force-refresh { display: none; }

.browser-live-crm-surface { position: absolute; z-index: 10; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface); }
.browser-live-ai-surface { position: absolute; z-index: 11; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface); }
.browser-live-cockpit-surface { position: absolute; z-index: 12; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface); }
.browser-live-mail-surface { position: absolute; z-index: 13; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface); }
.web-iam-login-frame { width: 100%; height: min(760px, calc(100vh - 180px)); min-height: min(520px, calc(100vh - 180px)); border: 0; background: var(--surface); }
.web-iam-login-frame[hidden], .desktop-login-brand[hidden], .desktop-login-form[hidden] { display: none; }
.web-session-restoring {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 0;
  padding: 32px;
  color: var(--muted);
  background: var(--canvas);
}
.web-session-brand { color: var(--ink); font: 650 18px/1.4 var(--display); letter-spacing: -.02em; }
.web-session-copy { font: 500 13px/1.5 var(--body); text-align: center; overflow-wrap: anywhere; }
.web-session-spinner { position: relative; display: inline-block; flex: none; width: 32px; height: 32px; color: var(--action); transform: rotate(45deg); animation: web-session-rotate 1.2s linear infinite; }
.web-session-spinner > span { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: currentColor; opacity: .3; transform: scale(.75); animation: web-session-pulse 1s linear infinite alternate; }
.web-session-spinner > span:nth-child(1) { top: 0; left: 0; }
.web-session-spinner > span:nth-child(2) { top: 0; right: 0; animation-delay: .4s; }
.web-session-spinner > span:nth-child(3) { right: 0; bottom: 0; animation-delay: .8s; }
.web-session-spinner > span:nth-child(4) { bottom: 0; left: 0; animation-delay: 1.2s; }
@keyframes web-session-rotate { to { transform: rotate(405deg); } }
@keyframes web-session-pulse { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .web-session-spinner, .web-session-spinner > span { animation: none; }
  .web-session-spinner > span { opacity: .65; }
}
.web-session-restoring[hidden] { display: none; }
.desktop-login-form[data-web-session-restoring="true"] > :not(#web-session-restoring) { display: none !important; }
body[data-cookie-web-pending="true"] #workbench-shell { visibility: hidden; }
body[data-cookie-web-pending="true"] #web-session-restoring {
  visibility: visible;
}
.preview-service-banner { position: absolute; z-index: 30; top: 10px; right: 14px; left: 14px; display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 10px 8px 14px; border: 1px solid var(--warning); border-radius: 10px; color: var(--warning); background: var(--warning-soft); box-shadow: 0 8px 24px rgb(55 43 8 / 14%); font-size: 12px; }
.preview-service-banner[hidden] { display: none; }
.preview-service-banner button { flex: none; min-height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--warning); background: var(--surface); font: 650 12px/1 var(--sans); cursor: pointer; }
.preview-service-banner button:disabled { cursor: wait; opacity: .65; }
body[data-live-crm="true"][data-module="settings"] .browser-live-crm-surface { left: var(--settings-nav-width); width: calc(100% - var(--settings-nav-width)); }
body[data-surface="MAIL"][data-module="settings"] .browser-live-mail-surface,
body[data-live-ai="true"][data-module="settings"] .browser-live-ai-surface { left: var(--settings-nav-width); width: calc(100% - var(--settings-nav-width)); }
.browser-preview-surface { display: none; height: 100%; overflow: auto; padding-bottom: 44px; }
body[data-browser-preview="true"][data-surface="MAIL"][data-module="mail"] .browser-preview-surface { display: block; }

.preview-evidence-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--page); font-size: 11px; }
.preview-evidence-bar strong { color: var(--ink); font-size: 11px; }
.preview-module { display: none; min-height: calc(100% - 35px); overflow: hidden; background: var(--surface); }
body[data-module="mail"] .preview-module[data-preview-module="mail"] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.preview-module > header { padding: 26px 28px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.preview-module > header p, .preview-module > header span { display: none; }
.preview-module > header h2 { margin: 0; font: 700 24px/1.2 var(--display); letter-spacing: -.03em; text-wrap: balance; }
.preview-module__list { align-self: start; padding: 16px 28px 28px; }
.preview-module__list button { display: grid; width: 100%; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 92px; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; }
.preview-module__list button:first-child { border-top: 1px solid var(--line); }
.preview-module__list button:hover { background: var(--canvas); }
.preview-module__list small { color: var(--faint); font-size: 11px; }
.preview-module__list strong { font-size: 14px; }
.preview-module__list b { color: var(--muted); }

.preview-settings-list { overflow: hidden; margin-top: 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.preview-settings-list button { display: flex; width: 100%; min-height: 62px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; }
.preview-settings-list button:last-child { border-bottom: 0; }
.preview-settings-list button:hover { background: var(--canvas); }
.preview-settings-list b { color: var(--faint); }
@media (max-width: 620px) {
  body[data-browser-preview="true"]::after { display: none; }
  .browser-preview-surface { padding-bottom: 82px; }
  body[data-live-crm="true"][data-module="settings"] .browser-live-crm-surface { top: 64px; left: 0; width: 100%; height: calc(100% - 64px); }
  body[data-surface="MAIL"][data-module="settings"] .browser-live-mail-surface,
body[data-live-ai="true"][data-module="settings"] .browser-live-ai-surface { top: 64px; left: 0; width: 100%; height: calc(100% - 64px); }
  .preview-evidence-bar { align-items: flex-start; flex-direction: column; }
  .preview-service-banner { top: 8px; right: 8px; left: 8px; align-items: flex-start; }
  .preview-module > header { padding: 20px 16px 14px; }
  .preview-module__list { padding: 12px; }
  .preview-module__list button { grid-template-columns: 72px minmax(0, 1fr); }
  .preview-module__list b { grid-column: 2; }
}

body[data-hosted-web='true']::after { display: none; }
.web-iam-workspace-selection { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1000; border: 0; }
.web-iam-login-controls { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 12px; font-size: 14px; }
.web-iam-login-controls[hidden] { display: none; }
.web-iam-login-controls a { color: var(--action); }
.web-iam-login-controls button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.hosted-assistant-download { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 32px; background: var(--surface); text-align: center; }
.hosted-assistant-download[hidden] { display: none; }
body[data-hosted-assistant='true'] .local-view { display: none; }
.hosted-assistant-download h2 { margin: 0; font-size: 28px; }
.hosted-assistant-download p { max-width: 560px; color: var(--muted); line-height: 1.8; }
.hosted-assistant-download a { display: inline-flex; padding: 12px 24px; border-radius: 10px; background: var(--action-fill); color: var(--on-action); text-decoration: none; }
