[data-office-header] {
  --office-app-accent: #2459bd;
  --office-app-accent-hover: #174799;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
[data-office-header="xlsx"] { --office-app-accent: #277047; --office-app-accent-hover: #195736; }
[data-office-header="pptx"] { --office-app-accent: #ab4c20; --office-app-accent-hover: #873b19; }
[data-office-header="pdf"] { --office-app-accent: #b33149; --office-app-accent-hover: #91263b; }
[data-office-header="notes"] { --office-app-accent: #846018; --office-app-accent-hover: #664b13; }
[data-office-header="png"] { --office-app-accent: #7345a1; --office-app-accent-hover: #5b3287; }
[data-office-header="zip"] { --office-app-accent: #38667b; --office-app-accent-hover: #285266; }

[data-office-header] :is(.office-header-control,.office-profile-action)[hidden],
.office-header-legacy { display: none !important; }

.office-header-control {
  box-sizing: border-box;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  padding: 4px 8px;
  font: inherit;
  font-size: .8125rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.office-header-control:hover, .office-header-control[aria-expanded=true] {
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.office-header-control:disabled { cursor: wait; opacity: .65; }
.office-header-icon { display: block; width: 17px; height: 17px; flex: 0 0 auto; }
.office-header-icon path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.office-header-drive-icon { width: 22px; height: 22px; }
.office-header-profile { width: 34px; padding: 2px; }
.office-header-share {
  background: var(--office-app-accent);
  border-color: var(--office-app-accent);
  color: white;
  padding-inline: 11px;
}
.office-header-share:hover {
  background: var(--office-app-accent-hover);
  border-color: var(--office-app-accent-hover);
}
.office-header-control:focus-visible, .office-profile-action:focus-visible {
  outline: 2px solid #78a8fb;
  outline-offset: 2px;
}
.office-header-avatar {
  box-sizing: border-box;
  position: relative;
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: #dce8fb;
  color: #183b75;
  font: 700 .7rem/1 system-ui, sans-serif;
}
.office-header-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

.office-profile-popover {
  --office-profile-panel: var(--panel, #fff);
  --office-profile-border: var(--line, #cfdae9);
  --office-profile-color: var(--ink, #202b3f);
  --office-profile-muted: var(--muted, #53657e);
  box-sizing: border-box;
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(300px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--office-profile-border);
  border-radius: 9px;
  color: var(--office-profile-color);
  background: var(--office-profile-panel);
  box-shadow: 0 6px 18px #1b2f4c25;
  font: 400 .8125rem/1.4 system-ui, sans-serif;
}
:root:is([data-office-theme=dark],[data-theme=dark]) .office-profile-popover {
  --office-profile-panel: var(--panel, #282c35);
  --office-profile-border: var(--line, #464f60);
  --office-profile-color: var(--ink, #edf2fc);
  --office-profile-muted: var(--muted, #bcc8d8);
}
.office-profile-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 13px 12px;
}
.office-profile-identity > div { min-width: 0; overflow-wrap: anywhere; }
.office-profile-identity .office-header-avatar { width: 43px; height: 43px; flex: 0 0 auto; font-size: .95rem; }
.office-profile-identity strong, .office-profile-identity div > span { display: block; }
.office-profile-identity div > span { color: var(--office-profile-muted); font-size: .77rem; }
.office-profile-storage {
  margin: 0;
  padding: 9px 13px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 9px;
  border-block: 1px solid var(--office-profile-border);
}
.office-profile-storage dt { color: var(--office-profile-muted); }
.office-profile-storage dd { margin: 0; text-align: end; overflow-wrap: anywhere; }
.office-profile-links { display: grid; padding: 4px; }
.office-profile-action {
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  text-align: start;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.office-profile-action:hover:not(:disabled) { background: color-mix(in srgb, currentColor 10%, transparent); }
.office-profile-action:disabled { opacity: .55; cursor: default; }

@media (max-width: 900px) {
  [data-office-header] { gap: 2px; }
  .office-header-drive .office-header-caption { display: none; }
  .office-header-drive { padding-inline: 5px; }
}
@media (max-width: 540px) {
  .office-header-share .office-header-caption { display: none; }
  .office-header-share { padding-inline: 7px; }
  .office-header-control { min-height: 30px; }
  .topbar:has([data-office-header]) { padding-inline: 7px; gap: 5px; }
  .topbar:has([data-office-header]) .title-row { padding-inline-start: 4px; }
  .topbar:has([data-office-header]) .top-actions { gap: 3px; }
  .topbar:has([data-office-header]) .top-actions > .header-button { padding-inline: 6px; }
}
@media print { [data-office-header], .office-profile-popover { display: none !important; } }
