.topbar { position: relative; }
.topbar > .top-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  width: min(222px, 100%);
  min-width: 0;
  padding: 0;
}
.topbar:not(.has-header-ad) > .top-actions { flex-direction: row; align-items: center; justify-content: flex-end; justify-self: end; gap: 8px; width: auto; max-width: calc(100vw - 90px); margin-inline: 10px; }
.topbar:not(.has-header-ad) .top-actions-account-row { flex: 0 1 auto; width: auto; min-height: 42px; }
.topbar:not(.has-header-ad) .account-link { flex: 0 1 auto; min-width: 146px; min-height: 44px; max-width: min(230px, 29vw); }
.topbar:not(.has-header-ad) .editor-language { flex: 0 0 auto; min-height: 28px; height: 28px; max-height: 28px; }
.topbar:not(.has-header-ad) .header-action-buttons { display: flex; flex: 0 0 auto; width: auto; }
.topbar:not(.has-header-ad) .header-action-buttons > button { width: auto; min-height: 32px; padding-inline: 10px; }
.topbar .top-actions-account-row { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-width: 0; width: 100%; }
.topbar .account-link,
.topbar.has-header-ad .account-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 0;
  min-width: 0;
  min-height: 43px;
  gap: 8px;
  padding: 4px 9px;
  overflow: hidden;
  border: 1px solid #3d394d;
  border-radius: 4px;
  background: linear-gradient(120deg, #1d1b29, #14141d 72%);
  box-shadow: inset 0 1px rgba(255, 255, 255, .055);
  text-decoration: none;
  transform: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.topbar .account-link::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 2px; background: linear-gradient(#b295f5, #7657d5); pointer-events: none; }
.topbar .account-link:hover,
.topbar.has-header-ad .account-link:hover { border-color: #8e72ce; background: linear-gradient(120deg, #252138, #191722 72%); box-shadow: inset 0 1px rgba(255,255,255,.08), 0 5px 18px rgba(49,34,85,.18); transform: none; }
.topbar .account-link:hover .account-name { color: #fff; }
.topbar .account-link .avatar,
.topbar.has-header-ad .account-link .avatar { flex: 0 0 30px; width: 30px; height: 30px; border-color: #846cc6; border-radius: 4px; background: linear-gradient(145deg, #6546ae, #29203f); box-shadow: inset 0 1px rgba(255,255,255,.15); color: #fff; font-weight: 800; }
.topbar .account-link .avatar.has-image { border-radius: 4px; }
.account-identity { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; padding-inline-start: 8px; border-inline-start: 1px solid rgba(180,168,211,.2); text-align: start; }
.account-name { max-width: 100%; overflow: hidden; color: #f8f5ff; font-size: 13px; font-weight: 750; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.account-plan { max-width: 100%; overflow: hidden; color: #c4b8e5; font-size: 10px; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.account-plan::before { content: ''; display: inline-block; width: 4px; height: 4px; margin-inline-end: 5px; border-radius: 1px; vertical-align: 2px; background: #a98de9; }
body[data-plan-type="paid"] .topbar .account-link { border-color: #6a574b; background: linear-gradient(120deg, #252026, #17161c 72%); }
body[data-plan-type="paid"] .topbar .account-link::before { background: linear-gradient(#f0cb91, #b98244); }
body[data-plan-type="paid"] .topbar .account-link:hover { border-color: #b58d62; background: linear-gradient(120deg, #30262a, #1d191e 72%); }
body[data-plan-type="paid"] .account-plan { color: #e7c99d; }
body[data-plan-type="paid"] .account-plan::before { background: #e7bb76; }
.header-action-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; min-width: 0; }
.topbar .header-action-buttons > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-width: 0; min-height: 33px; padding: 4px 7px; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 700; white-space: nowrap; }
.topbar .header-action-buttons .export-button { border: 1px solid #8f6af1; background: linear-gradient(115deg, #7054e7, #9460e9); color: #fff; }
.topbar .header-action-buttons .export-button:hover { filter: brightness(1.1); }
.topbar .header-action-buttons .project-button { border: 1px solid #444052; background: #1c1a26; color: #e2ddeb; }
.topbar .header-action-buttons .project-button:hover { border-color: #8f76da; background: #272135; color: #fff; }
.topbar .header-action-buttons svg { display: block; flex: 0 0 15px; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.topbar .header-action-buttons .export-glyph { display: block; font-size: inherit; }
.topbar .header-action-buttons b { display: inline; overflow: hidden; font-size: inherit; text-overflow: ellipsis; }
.topbar .header-action-buttons > button:focus-visible,.topbar .account-link:focus-visible { outline: 2px solid #bea8ff; outline-offset: 2px; }

.topbar:not(.has-header-ad) .header-action-buttons {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: auto;
  transform: translate(-50%, -50%);
}

@media (max-width: 1100px) {
  .topbar.has-header-ad > .top-actions,
  .topbar.has-header-ad:has(.editor-ad-slot--adsense) > .top-actions { flex-direction: column; align-items: stretch; justify-content: center; gap: 2px; justify-self: end; width: min(222px, 100%); min-width: 0; height: 62px; padding: 0; }
  .topbar .account-link .avatar,.topbar.has-header-ad .account-link .avatar { flex-basis: 27px; width: 27px; height: 27px; }
  .topbar .account-link,.topbar.has-header-ad .account-link { min-height: 33px; padding: 3px 8px; }
  .topbar.has-header-ad .editor-language { min-height: 23px; height: 23px; }
  .topbar .header-action-buttons > button { min-height: 27px; padding-block: 2px; font-size: 10px; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .topbar.has-header-ad > .top-actions,
  .topbar.has-header-ad:has(.editor-ad-slot--adsense) > .top-actions { flex-direction: row; align-items: center; justify-content: flex-end; width: auto; height: 55px; gap: 7px; }
  .topbar.has-header-ad .top-actions-account-row { flex: 0 1 222px; width: auto; }
  .topbar.has-header-ad .header-action-buttons { display: flex; flex: 0 0 auto; width: auto; min-width: 124px; }
  .topbar.has-header-ad .header-action-buttons > button { width: auto; min-height: 34px; padding-inline: 8px; }
  .topbar.has-header-ad .account-link { min-height: 38px; }
}
@media (max-width: 900px) {
  .topbar.has-header-ad > .top-actions { flex-direction: column; align-items: stretch; height: 58px; }
  .topbar.has-header-ad .account-link { min-height: 31px; }
  .topbar.has-header-ad .account-link .avatar { flex-basis: 24px; width: 24px; height: 24px; }
}
@media (min-width: 701px) and (max-width: 900px) {
  .topbar.has-header-ad > .top-actions,
  .topbar.has-header-ad:has(.editor-ad-slot--adsense) > .top-actions { flex-direction: row; align-items: center; height: 55px; }
  .topbar.has-header-ad .account-link { min-height: 36px; }
}
@media (max-width: 520px) {
  .topbar:not(.has-header-ad) > .top-actions { gap: 4px; max-width: calc(100vw - var(--rail) - 8px); margin-inline: 4px; }
  .topbar:not(.has-header-ad) .top-actions-account-row { gap: 3px; }
  .topbar:not(.has-header-ad) .header-action-buttons > button { min-height: 29px; padding-inline: 5px; }
  .topbar:not(.has-header-ad) .account-link { min-width: 0; min-height: 31px; max-width: 128px; padding: 3px 6px; gap: 5px; }
  .topbar:not(.has-header-ad) .account-link .avatar { flex-basis: 23px; width: 23px; height: 23px; }
  .topbar:not(.has-header-ad) .account-plan { display: none; }
  .topbar .top-actions-account-row { height: auto; }
  .topbar .header-action-buttons { gap: 4px; }
  .topbar .header-action-buttons > button { gap: 3px; min-height: 25px; padding-inline: 4px; }
  .topbar .header-action-buttons svg { flex-basis: 13px; width: 13px; height: 13px; }
  .account-name { font-size: 11px; }
  .account-plan { font-size: 9px; }
}
@media (max-width: 800px) {
  .topbar:not(.has-header-ad) { grid-template-columns: var(--rail) minmax(0, 1fr) auto; }
}
