/* The studio account bar stays in the shell across all workspaces. */
.app {
  grid-template-rows: auto minmax(0, 1fr);
}
.app > .icon-rail {
  grid-column: 1;
  grid-row: 1 / 3;
}
.app > main {
  grid-column: 2;
  grid-row: 2;
}
.studio-account-bar {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  padding: 10px clamp(20px, 3.2vw, 52px);
  border-bottom: 1px solid #25282a;
  background: #0c0d12;
}
.studio-account-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.studio-wallet-button,
.studio-profile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  font: inherit;
}
.studio-wallet-button {
  gap: 16px;
  max-width: 100%;
  padding: 5px 6px 5px 18px;
  border: 1px solid #49513c;
  border-radius: 100px;
  color: #eef4e4;
  background: #1b2019;
}
.studio-wallet-button:hover,
.studio-wallet-button:focus-visible {
  border-color: #9bac6d;
  background: #22291e;
}
.studio-wallet-button #credits-nav-label {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font: 750 1.08rem/1.2 'DM Sans', Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-wallet-plus {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #19210c;
  background: var(--accent);
  font: 500 1.5rem/1 Arial, sans-serif;
}
.studio-profile-toggle {
  flex: none;
  width: 56px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
}
.studio-profile-toggle:hover,
.studio-profile-toggle[aria-expanded="true"] {
  border-color: #b6c09f;
}
.studio-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid #b1c29b;
  border-radius: 50%;
  color: #213019;
  background: #cad9b8;
  font: 800 1.12rem/1 'Manrope', Arial, sans-serif;
  letter-spacing: -.03em;
}
.studio-profile-popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: min(404px, calc(100vw - 32px));
  max-height: calc(100dvh - 90px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #464a46;
  border-radius: 18px;
  color: var(--text);
  background: #191b20;
  box-shadow: 0 16px 40px #0006;
}
.studio-profile-identity {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
}
.studio-profile-identity .studio-avatar {width: 50px; height: 50px}
.studio-profile-details {
  display: grid;
  min-width: 0;
  gap: 4px;
  overflow-wrap: anywhere;
}
#profile-name {font: 770 1.3rem/1.2 'Manrope', Arial, sans-serif}
#profile-email {color: #c1c6c1; font-size: .94rem; line-height: 1.35}
.studio-profile-wallet {
  margin: 0 12px 8px;
  padding: 14px;
  border: 1px solid #47513c;
  border-radius: 12px;
  background: #20261d;
}
.studio-wallet-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.studio-wallet-plan,
.studio-wallet-total {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 3px 4px;
  line-height: 1.25;
}
.studio-wallet-overview span {color: #c0c8b7; font-size: .875rem}
.studio-wallet-overview strong {color: #f0f3e8; font: 750 1.14rem/1.2 'Manrope', Arial, sans-serif}
.studio-wallet-total {
  min-height: 48px;
  justify-items: end;
  align-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: right;
}
.studio-wallet-total:hover strong {text-decoration: underline; text-underline-offset: 3px}
#profile-credit-balance {font-size: 1.5rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere}
.studio-wallet-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.studio-wallet-actions button {
  min-width: 0;
  min-height: 52px;
  padding: 10px 8px;
  border: 1px solid #626a5e;
  border-radius: 8px;
  color: #f1f3eb;
  background: #292f28;
  font: 730 .98rem/1.2 'DM Sans', Arial, sans-serif;
}
.studio-wallet-actions .studio-account-buy {
  color: #1a220d;
  border-color: var(--accent);
  background: var(--accent);
}
.studio-wallet-actions button:hover {border-color: #a4af96; background: #394035}
.studio-wallet-actions .studio-account-buy:hover {border-color: #dbff78; background: #dbff78}
.studio-profile-actions,
.studio-profile-session {padding: 4px 10px}
.studio-profile-session {
  border-top: 1px solid #383b3c;
  margin-top: 4px;
}
.studio-profile-actions button,
.studio-profile-session button {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 9px 10px;
  min-height: 56px;
  border: 0;
  border-radius: 9px;
  color: #ecefea;
  background: transparent;
  font: 640 1.03rem/1.35 'DM Sans', Arial, sans-serif;
  text-align: left;
}
.studio-profile-popover button svg {
  box-sizing: content-box;
  flex: none;
  width: 21px;
  height: 21px;
  padding: 7px;
  border-radius: 8px;
  background: #292c30;
  fill: none;
  stroke: #c3ccbd;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.studio-profile-actions button:hover,
.studio-profile-session button:hover,
.studio-profile-actions button:focus-visible,
.studio-profile-session button:focus-visible {background: #2a3029; color: #fff}
.studio-account-bar [hidden] {
  display: none !important;
}
.studio-profile-dialog {
  width: min(410px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid #4d5548;
  border-radius: 16px;
  color: var(--text);
  background: #191c1e;
  box-shadow: 0 18px 60px #0007;
}
.studio-profile-dialog::backdrop {
  background: #07090bc9;
}
.studio-profile-dialog-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 24px;
}
.studio-profile-dialog h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #f5f5f1;
  font: 750 1.45rem/1.2 'Manrope', Arial, sans-serif;
  letter-spacing: -.045em;
}
.studio-profile-dialog label {
  display: block;
  margin-bottom: 7px;
  font-size: .94rem;
  font-weight: 650;
}
.studio-profile-dialog input:not([type=file]) {
  min-height: 48px;
  border: 1px solid #535a53;
  border-radius: 8px;
  background: #101315;
  color: var(--text);
  font-size: 1rem;
}
#profile-status {
  margin: 10px 0 0;
  color: #e6d9c8;
  font-size: .875rem;
}
#profile-status:empty {display: none}
.studio-profile-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}
.studio-profile-dialog-actions .btn {
  min-height: 50px;
  border-radius: 8px;
  font: 700 1rem/1.2 'DM Sans', Arial, sans-serif;
}
.studio-profile-dialog-actions .btn:disabled {
  opacity: .6;
  cursor: wait;
}

@media (max-width: 650px) {
  /* Put wordmark, navigation and account controls on one shared header row.
     The expanded navigation spans the whole viewport on the next row. */
  .app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: start;
  }
  .app > .icon-rail {display: contents}
  .app::before {
    content: "";
    grid-area: 1 / 1 / 2 / -1;
    align-self: stretch;
    border-bottom: 1px solid #303236;
    background: #090a0d;
  }
  .app > .icon-rail > .fusion-wordmark {
    grid-area: 1 / 1;
    z-index: 1;
    align-self: center;
    justify-self: start;
    margin-inline-start: 14px;
  }
  #studio-menu {
    grid-area: 1 / 2;
    z-index: 1;
    align-self: center;
    gap: 7px;
  }
  .studio-account-bar {
    grid-area: 1 / 3;
    align-self: center;
    padding: 8px 12px 8px 8px;
    border: 0;
    background: transparent;
  }
  .studio-account-tools {gap: 5px}
  .studio-wallet-button {gap: 7px; padding-left: 11px}
  .studio-wallet-button, .studio-profile-toggle {min-height: 50px}
  .studio-profile-toggle {width: 50px}
  .studio-profile-toggle .studio-avatar {width: 42px; height: 42px}
  .studio-wallet-plus {width: 34px; height: 34px}
  .studio-wallet-button #credits-nav-label {font-size: 1rem}
  .icon-rail #studio-nav {
    grid-area: 2 / 1 / 3 / -1;
    position: relative;
    margin: 0;
    padding: 7px 12px 12px;
    border-bottom: 1px solid #303236;
    background: #090a0d;
  }
  .app > main {grid-area: 3 / 1 / 4 / -1}
}
@media (max-width: 470px) {
  #studio-menu {
    width: 44px;
    justify-content: center;
    gap: 0;
    padding: 0;
    font-size: 0;
  }
  #studio-menu > span {font: 500 1.2rem/1 Arial, sans-serif}
  .studio-wallet-button {max-width: 133px}
}
@media (max-width: 355px) {
  .app > .icon-rail > .fusion-wordmark {margin-inline-start: 8px}
  .app > .icon-rail > .fusion-wordmark strong {display: none}
  .studio-account-bar {padding-inline: 5px 8px}
  .studio-account-tools {gap: 3px}
  .studio-wallet-button {max-width: 125px}
  .studio-profile-identity {padding: 16px}
  .studio-profile-wallet {margin-inline: 8px; padding: 12px}
  .studio-wallet-actions button {padding-inline: 5px}
}
