/* Eterano v1.21.2d — Settings layout + migration stability */

/* Account & appearance: use a real two-column composition instead of one shared
   grid row whose height is dictated by the taller Team card. This removes the
   large dead area below Appearance and keeps Subscription directly beneath it. */
#settingsAccountPanel > .account-left-stack1212d{
  grid-column:1;
  display:grid;
  gap:17px;
  align-content:start;
  align-self:start;
  min-width:0;
}
#settingsAccountPanel > #teamAccess1212{
  grid-column:2;
  align-self:start;
  min-width:0;
}
#settingsAccountPanel .account-left-stack1212d > #themeSettingsCard,
#settingsAccountPanel .account-left-stack1212d > .plan-card{
  width:100%;
  height:auto!important;
  min-height:0!important;
  margin:0!important;
}
#settingsAccountPanel .account-left-stack1212d > .plan-card{grid-column:auto!important}

/* Accountant has only two Settings tabs. Size the rail to its content instead
   of drawing a full-width bar with a long empty middle. */
body.role-accountant1212 #settingsTabsShell .settings-tabs-nav.settings-nav-compact1212d{
  display:inline-flex!important;
  width:max-content!important;
  max-width:100%!important;
  justify-self:start!important;
  justify-content:flex-start!important;
  gap:8px!important;
  overflow-x:auto!important;
}
body.role-accountant1212 #settingsTabsShell .settings-tabs-nav.settings-nav-compact1212d button:not([hidden]){
  flex:0 0 auto!important;
  width:auto!important;
  min-width:max-content!important;
}

/* Four migration tools should read as one stable set. Two-by-two avoids the
   orphan fourth card caused by the older three-column opening-balance layout. */
#migrationTools1202.has-opening1203 .migration-tools-grid1202{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}

@media(max-width:1100px){
  #settingsAccountPanel > .account-left-stack1212d,
  #settingsAccountPanel > #teamAccess1212{grid-column:1!important}
}
@media(max-width:760px){
  body.role-accountant1212 #settingsTabsShell .settings-tabs-nav.settings-nav-compact1212d{
    width:100%!important;
  }
  #migrationTools1202.has-opening1203 .migration-tools-grid1202{grid-template-columns:1fr!important}
}
