.member-management-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}
.member-management-entry h3 { margin: 0; color: var(--ink, #18323a); font-size: 15px; }
.member-management-entry p { margin: 4px 0 0; color: var(--muted, #607377); font-size: 12px; line-height: 1.65; }
.member-management-entry .button { flex: 0 0 auto; }

.member-manager-host [hidden] { display: none !important; }
.member-manager-host #members-manager-body { display: grid; align-content: start; gap: 12px; }
.member-manager-sheet { --sheet-center-width: min(740px, calc(100vw - 32px)); --sheet-content-padding: 18px; }
.member-manager-header { display: flex; align-items: flex-start; gap: 12px; }
.member-manager-header h2 { margin: 2px 0 0; font-size: 20px; }
.member-manager-header .button { flex: 0 0 auto; }
.member-manager-content { display: grid; align-content: start; gap: 14px; }
.member-manager-intro { margin: 0; color: var(--muted, #607377); font-size: 13px; line-height: 1.65; }
.member-manager-section { display: grid; gap: 12px; padding-top: 15px; border-top: 1px solid var(--line, #d9e3de); }
.member-manager-section__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.member-manager-section__heading h3 { margin: 0; color: var(--ink, #18323a); font-size: 15px; }
.member-manager-section__heading p { margin: 4px 0 0; color: var(--muted, #607377); font-size: 11px; line-height: 1.6; }
.member-manager-note { padding: 10px 12px; margin: 0; border: 1px solid #eadcb9; border-radius: 10px; color: #625335; background: #fffaf0; font-size: 12px; line-height: 1.65; }
.member-manager-note--error { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-color: #e7c9c4; color: #873c33; background: #fff6f4; }
.member-manager-note--error strong { font-size: 12px; }
.member-manager-note--error p { margin: 3px 0 0; color: #76514b; }
.member-manager-note--error a { flex: 0 0 auto; color: #873c33; font-size: 11px; font-weight: 750; text-underline-offset: 3px; }
.members-view-nav { display: flex; gap: 5px; padding: 4px; border: 1px solid var(--line, #d9e3de); border-radius: 12px; background: #f3f6f3; }
.members-view-tab { flex: 1 1 0; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 9px; color: #53686a; background: transparent; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.members-view-tab[aria-selected="true"] { color: var(--ink, #18323a); background: #fff; box-shadow: 0 1px 4px #19352a18; }
.members-view-tab:focus-visible { outline: 2px solid #548e7c; outline-offset: 2px; }
.members-view { display: grid; align-content: start; gap: 12px; min-width: 0; }
.members-view[hidden] { display: none !important; }
.members-view > .member-manager-section:first-child { padding-top: 0; border-top: 0; }
.member-manager-message { display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 12px; background: #f4f7f5; }
.member-manager-message p { margin: 0; color: var(--muted, #607377); font-size: 13px; line-height: 1.6; }
.member-manager-message--error { justify-content: space-between; border: 1px solid #e7c9c4; background: #fff7f5; }
.member-manager-message--error p { color: #913f34; }
.member-manager-empty { padding: 12px; margin: 0; border: 1px dashed var(--line, #d9e3de); border-radius: 10px; color: var(--muted, #607377); font-size: 12px; text-align: center; }
.member-list,
.invitation-list { display: grid; gap: 8px; }
.member-row,
.invitation-row { min-width: 0; padding: 12px; border: 1px solid var(--line, #d9e3de); border-radius: 12px; background: #fff; }
.member-row__summary,
.invitation-row__summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; }
.member-row__identity { display: grid; min-width: 0; gap: 6px; }
.member-row__email,
.invitation-row__email { min-width: 0; color: var(--ink, #18323a); font-size: 13px; overflow-wrap: anywhere; }
.member-row__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.member-role,
.member-representative { display: inline-flex; min-height: 23px; align-items: center; padding: 2px 8px; border-radius: 999px; color: #42585a; background: #edf2ef; font-size: 10px; font-weight: 750; }
.member-representative { color: #694b1f; background: #fff2d9; }
.member-row__facts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 12px; margin: 0; }
.member-row__facts > div { display: grid; gap: 2px; }
.member-row__facts dt { color: var(--muted, #607377); font-size: 9px; }
.member-row__facts dd { margin: 0; color: var(--ink, #18323a); font-size: 11px; font-weight: 700; white-space: nowrap; }
.member-row__actions,
.invitation-row__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 9px; }
.member-row__editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 9px; padding-top: 11px; margin-top: 10px; border-top: 1px solid #edf0ed; }
.member-row__editor label,
.member-invite-form label,
.representative-transfer-form label,
.representative-term-form label { display: grid; min-width: 0; gap: 6px; color: var(--ink, #18323a); font-size: 11px; font-weight: 750; }
.member-row__editor input,
.member-row__editor select,
.member-invite-form input,
.member-invite-form select,
.representative-transfer-form select,
.representative-term-form input { width: 100%; min-width: 0; min-height: 43px; padding: 9px 11px; border: 1px solid var(--line, #d9e3de); border-radius: 10px; color: var(--ink, #18323a); background: #fff; font: inherit; font-size: 12px; }
.member-row__editor .button-row { display: flex; gap: 6px; }
.member-role-help { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted, #607377); font-size: 10px; line-height: 1.55; }
.member-invite-form .member-role-help { margin: -2px 0 0; }
.invitation-row__summary { grid-template-columns: minmax(0, 1fr); }
.invitation-row__facts { margin: 5px 0 0; color: var(--muted, #607377); font-size: 10px; line-height: 1.6; }
.member-invite-form,
.representative-transfer-form,
.representative-term-form { display: grid; gap: 10px; }
.member-invite-form__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.member-invite-form > .button,
.representative-transfer-form > .button { justify-self: start; min-height: 44px; }
.representative-transfer-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.representative-transfer-form > .field-help { grid-column: 1 / -1; margin: -4px 0 0; }
.representative-transfer-form > .button { grid-column: 2; grid-row: 1; }
.representative-term-form { grid-template-columns: minmax(0, 260px) auto; align-items: end; }
.representative-term-form .button { min-height: 43px; }
.transfer-pending { display: grid; justify-items: start; gap: 7px; padding: 13px; border-color: #d8e0cc; background: #f5f8ef; }
.transfer-pending strong { color: var(--ink, #18323a); font-size: 13px; }
.transfer-pending p { margin: 0; color: var(--muted, #607377); font-size: 11px; line-height: 1.65; }
.transfer-pending .field-help { font-size: 10px; }
.member-manager-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line, #d9e3de); }
.member-manager-footer p { margin: 0; color: var(--muted, #607377); font-size: 10px; line-height: 1.6; }
.member-manager-footer a,
.year-tools-support a { color: var(--green-strong, #0d443d); font-size: 11px; font-weight: 750; text-underline-offset: 3px; white-space: nowrap; }

.representative-term-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; margin: 0 0 12px; border-color: #e8d9b6; background: #fff9eb; }
.representative-term-notice[data-level="critical"],
.representative-term-notice[data-level="expired"] { border-color: #e7c9c4; background: #fff6f4; }
.representative-term-notice strong { color: #594921; font-size: 13px; }
.representative-term-notice[data-level="critical"] strong,
.representative-term-notice[data-level="expired"] strong { color: #873c33; }
.representative-term-notice p { margin: 4px 0 0; color: var(--muted, #607377); font-size: 11px; line-height: 1.6; }
.representative-term-notice .button { flex: 0 0 auto; }
.confirm-summary { display: grid; gap: 0; padding: 10px 12px; margin: 10px 0 14px; border: 1px solid var(--line, #d9e3de); border-radius: 11px; background: #f7f8f5; }
.confirm-summary > div { display: grid; grid-template-columns: minmax(90px, 0.65fr) minmax(0, 1.35fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid #e7ebe7; }
.confirm-summary > div:last-child { padding-bottom: 0; border-bottom: 0; }
.confirm-summary dt { color: var(--muted, #607377); font-size: 11px; }
.confirm-summary dd { margin: 0; color: var(--ink, #18323a); font-size: 11px; font-weight: 700; line-height: 1.55; }
.year-tools-support { margin: 0; color: var(--muted, #607377); font-size: 10px; }

.legacy-email-gate { display: grid; gap: 12px; max-width: 540px; margin: 20px auto; padding: clamp(22px, 4vw, 34px); }
.legacy-email-gate h2 { margin: 0; color: var(--ink, #18323a); font-size: clamp(21px, 3vw, 27px); line-height: 1.3; }
.legacy-email-gate__intro { margin: 0; color: var(--muted, #607377); font-size: 13px; line-height: 1.7; }
.legacy-email-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.legacy-email-form label { grid-column: 1 / -1; color: var(--ink, #18323a); font-size: 12px; font-weight: 750; }
.legacy-email-form input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line, #d9e3de); border-radius: var(--radius-control, 12px); color: var(--ink, #18323a); background: #fff; font: inherit; font-size: 13px; }
.legacy-email-form .button { min-height: 46px; white-space: nowrap; }
.legacy-email-waiting { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line, #d9e3de); border-radius: 12px; background: #f7f8f5; }
.legacy-email-waiting h3 { margin: 0; color: var(--ink, #18323a); font-size: 15px; }
.legacy-email-waiting p { margin: 0; color: var(--muted, #607377); font-size: 12px; line-height: 1.65; }
.legacy-email-gate > .field-help { margin: 0; }
.member-expired-gate { display: grid; justify-items: start; gap: 12px; max-width: 540px; margin: 20px auto; padding: clamp(22px, 4vw, 34px); border-color: #e7c9c4; background: #fff8f6; }
.member-expired-gate h2 { margin: 0; color: #713a33; font-size: clamp(21px, 3vw, 27px); line-height: 1.35; }
.member-expired-gate > p:not(.eyebrow) { margin: 0; color: #665b58; font-size: 13px; line-height: 1.7; }
.member-expired-gate .button { min-height: 44px; }

@media (max-width: 680px) {
  .member-management-entry { align-items: stretch; flex-direction: column; }
  .member-management-entry .button { width: 100%; }
  .member-manager-sheet { --sheet-center-width: calc(100vw - 16px); --sheet-content-padding: 15px; }
  .member-manager-header h2 { font-size: 17px; }
  .member-manager-header .button { min-height: 35px; padding-inline: 8px; font-size: 10px; }
  .member-row__summary { grid-template-columns: minmax(0, 1fr); }
  .member-row__facts { justify-content: flex-start; }
  .member-row__editor { grid-template-columns: minmax(0, 1fr); }
  .member-row__editor .button-row { display: grid; grid-template-columns: 1fr 1fr; }
  .member-row__editor .button { width: 100%; }
  .member-invite-form__row { grid-template-columns: minmax(0, 1fr); }
  .member-invite-form > .button { width: 100%; }
  .legacy-email-form { grid-template-columns: 1fr; }
  .legacy-email-form .button { width: 100%; }
  .members-view-tab { min-height: 38px; padding-inline: 7px; font-size: 11px; }
  .member-manager-note--error { align-items: stretch; flex-direction: column; }
  .invitation-row__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .invitation-row__actions .button { width: 100%; }
  .representative-transfer-form { grid-template-columns: minmax(0, 1fr); }
  .representative-transfer-form > .button { grid-column: 1; grid-row: auto; width: 100%; }
  .representative-term-form { grid-template-columns: minmax(0, 1fr); }
  .representative-term-form .button { width: 100%; }
  .member-manager-footer { align-items: flex-start; flex-direction: column; }
  .representative-term-notice { align-items: stretch; flex-direction: column; }
  .representative-term-notice .button { width: 100%; }
  .confirm-summary > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}
