/* PulseBot v22.6.5 — standard tool width and one divider rhythm for every module. */

/* Narzędzia use the same readable content width as Zarządzanie and the other module groups. */
body#pulsebot-app:is(
  .dashboard-active-identity,
  .dashboard-active-backups,
  .dashboard-active-templates,
  .dashboard-active-sticky,
  .dashboard-active-other
) .content-stack {
  width: min(1180px, calc(100% - 56px)) !important;
  max-width: 1180px !important;
  min-width: 0 !important;
  margin-inline: auto !important;
  gap: 0 !important;
}

body#pulsebot-app:is(
  .dashboard-active-identity,
  .dashboard-active-backups,
  .dashboard-active-templates,
  .dashboard-active-sticky,
  .dashboard-active-other
) .content-stack > :is(.server-top,.module-panel) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-inline: 0 !important;
  box-sizing: border-box !important;
}

/* Keep the tool shells compact instead of stretching their content vertically. */
body#pulsebot-app:is(
  .dashboard-active-identity,
  .dashboard-active-backups,
  .dashboard-active-templates,
  .dashboard-active-sticky,
  .dashboard-active-other
) .content-stack > .module-panel {
  align-content: start !important;
}

body#pulsebot-app.dashboard-module-v2177 .tool-lock-layout {
  min-height: 0 !important;
}

/* The final rhythm uses explicit sibling spacing, not a mix of grid gaps and margins. */
body#pulsebot-app.dashboard-module-v2177 .content-stack {
  row-gap: 0 !important;
}

/* One spacing rule after the top context divider on every regular module page. */
body#pulsebot-app.dashboard-module-v2177 .content-stack > .server-top + .module-panel {
  margin-top: 18px !important;
}

/* One spacing rule below the module title divider. */
body#pulsebot-app.dashboard-module-v2177 .content-stack > .module-panel > .module-headline {
  margin-bottom: 18px !important;
  padding-bottom: 18px !important;
}

/* Every direct module block gets the same vertical rhythm, including the intro divider. */
body#pulsebot-app.dashboard-module-v2177 .content-stack > .module-panel > .module-form:not(.form-section) {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) !important;
  row-gap: 18px !important;
  column-gap: 0 !important;
}

body#pulsebot-app.dashboard-module-v2177 .content-stack > .module-panel > .module-form:not(.form-section) > * {
  min-width: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* The intro line is always followed by the same clear gap before the first panel. */
body#pulsebot-app.dashboard-module-v2177 .content-stack > .module-panel > .module-form:not(.form-section) > .module-panel-special {
  padding-bottom: 17px !important;
}

/* Do not let fixed save controls participate in the section spacing. */
body#pulsebot-app.dashboard-module-v2177 .content-stack > .module-panel > .module-form:not(.form-section) > .savebar {
  margin: 0 !important;
}

@media (max-width: 1180px) {
  body#pulsebot-app:is(
    .dashboard-active-identity,
    .dashboard-active-backups,
    .dashboard-active-templates,
    .dashboard-active-sticky,
    .dashboard-active-other
  ) .content-stack {
    width: calc(100% - 40px) !important;
  }
}

@media (max-width: 760px) {
  body#pulsebot-app:is(
    .dashboard-active-identity,
    .dashboard-active-backups,
    .dashboard-active-templates,
    .dashboard-active-sticky,
    .dashboard-active-other
  ) .content-stack {
    width: calc(100% - 24px) !important;
  }

  body#pulsebot-app.dashboard-module-v2177 .content-stack > .server-top + .module-panel {
    margin-top: 14px !important;
  }

  body#pulsebot-app.dashboard-module-v2177 .content-stack > .module-panel > .module-headline {
    margin-bottom: 16px !important;
    padding-bottom: 16px !important;
  }

  body#pulsebot-app.dashboard-module-v2177 .content-stack > .module-panel > .module-form:not(.form-section) {
    row-gap: 16px !important;
  }
}

@media (max-width: 520px) {
  body#pulsebot-app:is(
    .dashboard-active-identity,
    .dashboard-active-backups,
    .dashboard-active-templates,
    .dashboard-active-sticky,
    .dashboard-active-other
  ) .content-stack {
    width: calc(100% - 16px) !important;
  }
}
