/* Patch 13: final GuildMesh portal consistency pass.
   Intentionally scoped to signed-in community pages to avoid altering public/login pages. */
body.community-context .portal-workspace {
  min-width: 0;
}

body.community-context .portal-workspace > .page-heading,
body.community-context .portal-workspace > header.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

body.community-context .portal-workspace .page-heading > div:first-child {
  min-width: 0;
}

body.community-context .portal-workspace .page-heading h1 {
  margin-top: 5px;
}

body.community-context .portal-workspace .section-actions,
body.community-context .portal-workspace .form-actions,
body.community-context .portal-workspace .dialog-actions,
body.community-context .portal-workspace .setup-save-row,
body.community-context .portal-workspace .form-footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body.community-context .portal-workspace input,
body.community-context .portal-workspace select,
body.community-context .portal-workspace textarea,
body.community-context .portal-workspace button,
body.community-context .portal-workspace .button,
body.community-context .portal-workspace .primary-button,
body.community-context .portal-workspace .secondary-button,
body.community-context .portal-workspace .danger-button {
  border-radius: 0 !important;
  box-sizing: border-box;
}

body.community-context .portal-workspace input:not([type="checkbox"]):not([type="radio"]),
body.community-context .portal-workspace select {
  min-height: 44px;
}

body.community-context .portal-workspace input::placeholder,
body.community-context .portal-workspace textarea::placeholder {
  color: #7f8da3;
}

body.community-context .portal-workspace input:focus,
body.community-context .portal-workspace select:focus,
body.community-context .portal-workspace textarea:focus {
  outline: none;
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 1px #8b5cf6;
}

body.community-context .portal-workspace .module-empty,
body.community-context .portal-workspace .empty-state,
body.community-context .portal-workspace .raid-empty-state,
body.community-context .portal-workspace .mythic-empty-state,
body.community-context .portal-workspace .log-empty {
  padding: 26px !important;
}

body.community-context .portal-workspace .module-empty h2,
body.community-context .portal-workspace .empty-state h2,
body.community-context .portal-workspace .empty-state h3,
body.community-context .portal-workspace .raid-empty-state h2,
body.community-context .portal-workspace .raid-empty-state h3,
body.community-context .portal-workspace .mythic-empty-state h2,
body.community-context .portal-workspace .log-empty h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

body.community-context .portal-workspace .module-empty p,
body.community-context .portal-workspace .empty-state p,
body.community-context .portal-workspace .raid-empty-state p,
body.community-context .portal-workspace .mythic-empty-state p,
body.community-context .portal-workspace .log-empty p {
  margin-top: 0;
  line-height: 1.55;
}

body.community-context .portal-workspace > .panel + .panel,
body.community-context .portal-workspace > section.panel + section.panel {
  margin-top: 18px;
}

body.community-context .portal-workspace .notice + .panel,
body.community-context .portal-workspace .notice + section {
  margin-top: 16px;
}

body.community-context .portal-workspace a:focus-visible,
body.community-context .portal-workspace button:focus-visible,
.navigation-v3-sidebar a:focus-visible,
.app-topbar button:focus-visible,
.app-topbar a:focus-visible {
  outline: 2px solid #a582ff;
  outline-offset: 2px;
}

/* Keep action clusters readable on narrow screens without changing bespoke desktop layouts. */
@media (max-width: 720px) {
  body.community-context .portal-workspace > .page-heading,
  body.community-context .portal-workspace > header.page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  body.community-context .portal-workspace .page-heading > .button,
  body.community-context .portal-workspace .page-heading > .primary-button,
  body.community-context .portal-workspace .page-heading > .secondary-button,
  body.community-context .portal-workspace .page-heading > .section-actions,
  body.community-context .portal-workspace .page-heading > div:last-child:not(:first-child) {
    width: 100%;
    box-sizing: border-box;
  }

  body.community-context .portal-workspace .page-heading > .section-actions > *,
  body.community-context .portal-workspace .form-actions > *,
  body.community-context .portal-workspace .form-footer-actions > * {
    flex: 1 1 100%;
    width: 100%;
    box-sizing: border-box;
  }
}
