/* NameCard left-panel header v1: visual-only layout, shared by three pages.
   Keep top account/menu and page heading untouched. The public tabs stay
   in #content (no DOM movement) to preserve all card-rendering contracts. */
body:is(.nc-home,.nc-public,.nc-admin) .nc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  box-sizing: border-box;
  min-height: 50px;
  margin: 0 0 14px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--nc-panel-divider,#e2e8f0);
}
body:is(.nc-home,.nc-public,.nc-admin) .nc-panel-head > h2 {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 17px !important;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.2px;
  color: var(--nc-ds-text,#263445);
  text-align: left;
}
/* Replace the previous homepage top divider with the shared heading divider. */
body.nc-home .nc-how-it-works {
  border-top: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}
/* The editor used 18px extra top padding, unlike Home and Card. */
body.nc-admin .app { padding-top: 0 !important; }
/* Keep the actual editor buttons and their IDs/event handlers unchanged. */
body.nc-admin #adminPreviewPanel > .nc-panel-head .tabs {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
  width: auto !important;
  margin: 0 !important;
}
body.nc-admin #adminPreviewPanel > .nc-panel-head .tabs button {
  min-height: 42px;
  margin: 0;
  padding: 10px 18px;
}
/* Public view: the existing dynamically rendered .public-tabs remains inside
   #content so the render code, button listeners and translations keep working.
   Only its visual placement is changed to the top-right of the same panel. */
body.nc-public .nc-public-main { position: relative; }
body.nc-public .nc-public-main > .nc-panel-head { padding-right: 165px; }
body.nc-public .nc-public-main #content .public-tabs {
  position: absolute;
  top: var(--nc-panel-padding,24px);
  right: var(--nc-panel-padding,24px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 !important;
  z-index: 1;
}
body.nc-public .nc-public-main #content .public-tabs button {
  min-height: 42px;
  margin: 0;
  padding: 10px 18px;
}
/* On narrow screens, tabs flow below the heading rather than overlapping
   a long translation or causing horizontal overflow. */
@media (max-width: 520px) {
  body.nc-public .nc-public-main > .nc-panel-head { padding-right: 0; }
  body.nc-public .nc-public-main #content .public-tabs {
    position: static;
    justify-content: flex-start;
    margin: 0 0 14px !important;
  }
  body.nc-admin #adminPreviewPanel > .nc-panel-head .tabs button,
  body.nc-public .nc-public-main #content .public-tabs button {
    padding: 10px 14px;
  }
}
