/* Mobile drawer corrections and private chapter member roster. */

.cp2-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.cp2-main,
.cp2-content,
.cp2-heading,
.cp2-heading > div,
.cp2-card,
.cp2-actions a,
.cp2-metrics article {
  min-width: 0;
}

.cp2-actions {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cp2-drawer-close {
  display: none;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fffaf0;
  cursor: pointer;
}

.cp2-drawer-close svg {
  width: 21px;
  height: 21px;
}

.cp2-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cp2-drawer-head .cp2-brand {
  flex: 1 1 auto;
  min-width: 0;
}

.cp2-backdrop {
  display: none;
}

.cp2-member-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.cp2-member-intro h2,
.cp2-member-intro p {
  margin: 0;
}

.cp2-member-intro p {
  margin-top: 7px;
  max-width: 700px;
  color: var(--muted, #746d62);
  line-height: 1.6;
}

.cp2-member-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.4fr);
  gap: 20px;
  align-items: start;
}

.cp2-member-form-card,
.cp2-member-list-card {
  border: 1px solid var(--line, rgba(0, 0, 0, 0.1));
  border-radius: 22px;
  background: var(--paper, #fffdf8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  padding: 24px;
}

.cp2-member-form-card h2,
.cp2-member-list-card h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.6rem;
}

.cp2-member-form-card > p,
.cp2-member-list-card > p {
  margin: 8px 0 20px;
  color: var(--muted, #746d62);
  line-height: 1.55;
}

.cp2-member-form {
  display: grid;
  gap: 14px;
}

.cp2-member-form label > span {
  display: block;
  margin-bottom: 7px;
  font-size: 0.88rem;
  font-weight: 800;
}

.cp2-member-form input,
.cp2-member-form select,
.cp2-member-form textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.13));
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.cp2-member-form textarea {
  resize: vertical;
}

.cp2-member-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.cp2-member-privacy {
  margin-top: 16px;
  padding: 13px;
  border: 1px dashed rgba(213, 174, 96, 0.5);
  border-radius: 12px;
  color: var(--muted, #746d62);
  font-size: 0.83rem;
  line-height: 1.5;
}

.cp2-member-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}

.cp2-member-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(213, 174, 96, 0.15);
  color: inherit;
  font-weight: 900;
}

.cp2-member-list {
  display: grid;
  gap: 12px;
}

.cp2-member-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.1));
  border-radius: 16px;
}

.cp2-member-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d5ae60;
  color: #171612;
  font-weight: 900;
}

.cp2-member-details {
  min-width: 0;
}

.cp2-member-details strong,
.cp2-member-details span,
.cp2-member-details small {
  display: block;
}

.cp2-member-details strong {
  overflow-wrap: anywhere;
}

.cp2-member-details span {
  margin-top: 4px;
  color: var(--muted, #746d62);
}

.cp2-member-details small {
  margin-top: 5px;
  color: var(--muted, #746d62);
  overflow-wrap: anywhere;
}

.cp2-member-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cp2-member-actions button {
  padding: 8px 11px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.12));
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.cp2-member-actions button[data-member-action="archive"] {
  color: #a93636;
}

.cp2-members-readonly {
  margin-bottom: 18px;
  padding: 15px;
  border: 1px solid rgba(213, 174, 96, 0.35);
  border-radius: 14px;
  background: rgba(213, 174, 96, 0.08);
  color: var(--muted, #746d62);
  line-height: 1.55;
}

body.cp2-drawer-locked {
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 980px) {
  .cp2-member-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .cp2-sidebar {
    z-index: 1001 !important;
    width: min(340px, 90vw) !important;
    max-width: 90vw;
    background: #171612 !important;
    color: #fffaf0;
    opacity: 1 !important;
    isolation: isolate;
    box-shadow: 22px 0 60px rgba(0, 0, 0, 0.48) !important;
  }

  .cp2-drawer-close {
    display: grid;
  }

  .cp2-sidebar .cp2-brand {
    padding-bottom: 14px;
  }

  .cp2-sidebar .cp2-brand strong {
    font-size: 1rem;
    line-height: 1.1;
  }

  .cp2-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.64);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .cp2-sidebar.open + .cp2-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .cp2-topbar {
    z-index: 50;
    min-height: 74px;
  }

  .cp2-topbar > div:first-of-type {
    min-width: 0;
  }

  .cp2-topbar strong {
    font-size: clamp(1.15rem, 5vw, 1.45rem);
    overflow-wrap: anywhere;
  }

  .cp2-heading h1 {
    font-size: clamp(2.1rem, 11vw, 3.25rem) !important;
    line-height: 0.98;
    overflow-wrap: anywhere;
  }

  .cp2-heading span {
    line-height: 1.55;
  }

  .cp2-actions {
    grid-template-columns: 1fr !important;
  }

  .cp2-actions a {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .cp2-content {
    padding: 22px 14px 42px !important;
  }

  .cp2-heading {
    gap: 12px;
    margin-bottom: 20px;
  }

  .cp2-member-form-card,
  .cp2-member-list-card,
  .cp2-card,
  .cp2-notices > article,
  .cp2-list > article,
  .cp2-documents > article {
    border-radius: 17px;
    padding: 17px;
  }

  .cp2-member-intro,
  .cp2-member-list-head {
    display: grid;
  }

  .cp2-member-row {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 14px;
  }

  .cp2-member-avatar {
    width: 44px;
    height: 44px;
  }

  .cp2-member-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .cp2-member-actions button {
    flex: 1 1 120px;
  }

  .cp2-member-form-actions {
    display: grid;
  }

  .cp2-member-form-actions .btn {
    width: 100%;
  }
}