.account-shell {
    display: block;
    padding: clamp(24px, 4vw, 56px);
}

.account-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    padding: 0 12px;
}

.account-tabs__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 18px;
    color: #e3c36c;
    background: rgba(4, 23, 50, 0.88);
    border: 1px solid rgba(190, 148, 53, 0.7);
    text-decoration: none;
}

.account-tabs__item.is-active {
    color: #fff1bd;
    background: rgba(31, 72, 118, 0.95);
    box-shadow: inset 0 -3px 0 #d8a936;
}

.account-tabs__item.is-disabled {
    opacity: 0.48;
}

.account-profile {
    padding: clamp(22px, 4vw, 48px);
    color: #1f2630;
    background: rgba(236, 220, 178, 0.96);
    border: 1px solid rgba(105, 72, 20, 0.72);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.account-profile-stage {
    position: relative;
    min-width: 0;
}

.account-notice {
    margin: 0 0 20px;
    padding: 11px 14px;
    border: 1px solid;
}

.account-notice--success {
    color: #244c24;
    background: rgba(216, 239, 199, 0.82);
    border-color: #668e4d;
}

.account-notice--error {
    color: #6f1f1f;
    background: rgba(249, 214, 205, 0.86);
    border-color: #a44d42;
}

.account-profile__heading,
.account-profile__identity,
.account-profile__security,
.account-profile__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.account-profile__eyebrow {
    margin: 0 0 4px;
    color: #6a4c16;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.account-profile h1 {
    margin: 0;
    color: #17375d;
}

.account-profile__role {
    padding: 7px 12px;
    color: #f7e7ae;
    background: #183d6a;
    border: 1px solid #ad8128;
    font-weight: 700;
}

.account-profile__identity {
    align-items: flex-start;
    margin-top: 28px;
}

.profile-image-control {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.profile-image-control__preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 190px;
    aspect-ratio: 1 / 1;
    padding: 0;
    color: #e2c369;
    background: #173653;
    border: 2px solid #a97924;
    cursor: pointer;
    overflow: hidden;
}

.profile-image-control__preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image-control__preview span {
    font-weight: 800;
    letter-spacing: 0.08em;
}

.profile-image-control__actions {
    display: grid;
    gap: 8px;
}

.profile-image-control__actions form {
    margin: 0;
}

.profile-image-control__actions button,
.profile-display-field button {
    width: 36px;
    height: 36px;
    color: #183d6a;
    background: rgba(255, 244, 204, 0.7);
    border: 1px solid #8b661f;
}

.profile-image-control__actions button:not(:disabled) {
    cursor: pointer;
}

.avatar-picker {
    position: absolute;
    inset: 0;
    z-index: 8;
    min-height: 100%;
    padding: clamp(22px, 4vw, 48px);
    color: #1f2630;
    background: rgb(236, 220, 178);
    border: 1px solid rgba(105, 72, 20, 0.72);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

.avatar-picker[hidden] {
    display: none;
}

.avatar-picker__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.avatar-picker__heading h2 {
    margin: 0;
    color: #17375d;
}

.avatar-picker__close {
    width: 42px;
    height: 42px;
    color: #17375d;
    background: rgba(255, 249, 226, 0.7);
    border: 1px solid #8b661f;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.avatar-picker__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 26px;
    border-bottom: 1px solid rgba(108, 78, 24, 0.48);
}

.avatar-picker__tab {
    min-height: 42px;
    padding: 8px 17px;
    color: #5c4317;
    background: rgba(255, 249, 226, 0.48);
    border: 1px solid rgba(108, 78, 24, 0.48);
    border-bottom: 0;
    cursor: pointer;
}

.avatar-picker__tab.is-active {
    color: #fff1bd;
    background: #183d6a;
}

.avatar-picker__panel {
    padding-top: 26px;
}

.avatar-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 18px;
    align-items: start;
}

.avatar-option {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 9px;
    min-width: 0;
    padding: 12px;
    color: #17375d;
    background: rgba(255, 249, 226, 0.56);
    border: 1px solid rgba(108, 78, 24, 0.42);
    cursor: pointer;
}

.avatar-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.avatar-option__selection {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 20px;
    height: 20px;
    background: #fff9e2;
    border: 2px solid #8b661f;
    border-radius: 50%;
}

.avatar-option input:checked + .avatar-option__selection::after {
    position: absolute;
    inset: 3px;
    content: '';
    background: #183d6a;
    border-radius: 50%;
}

.avatar-option:has(input:checked) {
    border-color: #183d6a;
    box-shadow: 0 0 0 2px rgba(24, 61, 106, 0.28);
}

.avatar-option img {
    position: relative;
    z-index: 1;
    display: block;
    width: 88px;
    height: 88px;
    object-fit: cover;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.avatar-option:hover img,
.avatar-option:focus-within img {
    z-index: 5;
    transform: scale(2.45);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.avatar-option strong {
    text-align: center;
    font-size: 13px;
}

.avatar-picker__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.avatar-picker__placeholder {
    min-height: 180px;
    color: #5c4317;
}

.avatar-upload {
    display: grid;
    grid-template-columns: minmax(220px, 310px) minmax(240px, 1fr);
    gap: clamp(20px, 4vw, 42px);
    align-items: center;
}

.avatar-upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.avatar-upload__dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 245px;
    padding: 24px;
    color: #17375d;
    background: rgba(255, 249, 226, 0.58);
    border: 2px dashed #8b661f;
    cursor: pointer;
    text-align: center;
    transition: background 150ms ease, border-color 150ms ease,
        transform 150ms ease;
}

.avatar-upload__dropzone:hover,
.avatar-upload__input:focus + .avatar-upload__dropzone,
.avatar-upload.is-dragging .avatar-upload__dropzone {
    background: rgba(255, 249, 226, 0.9);
    border-color: #17375d;
    transform: translateY(-2px);
}

.avatar-upload__folder {
    display: block;
    margin-bottom: 12px;
    font-size: 78px;
    line-height: 1;
}

.avatar-upload__dropzone strong {
    font-size: 18px;
}

.avatar-upload__dropzone span:last-child {
    margin-top: 6px;
    text-decoration: underline;
}

.avatar-upload__rules {
    color: #3e321f;
}

.avatar-upload__rules > strong {
    color: #17375d;
    font-size: 17px;
}

.avatar-upload__rules ul {
    display: grid;
    gap: 7px;
    margin: 12px 0 0;
    padding-left: 22px;
}

.avatar-upload-result {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 18px;
    align-items: center;
    margin-top: 24px;
    padding: 16px;
    color: #26313c;
    background: rgba(255, 249, 226, 0.66);
    border: 1px solid rgba(108, 78, 24, 0.45);
}

.avatar-upload-result[hidden] {
    display: none;
}

.avatar-upload-result img {
    display: block;
    width: 110px;
    height: 110px;
    object-fit: cover;
    border: 1px solid #8b661f;
}

.avatar-upload-result p {
    margin: 5px 0 0;
}

.avatar-upload-result__status {
    font-weight: 700;
}

.avatar-upload-result__status.is-valid {
    color: #31662d;
}

.avatar-upload-result__status.is-invalid {
    color: #8b2727;
}

.avatar-own-gallery {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid rgba(108, 78, 24, 0.42);
}

.avatar-own-gallery h3 {
    margin: 0 0 18px;
    color: #17375d;
}

.avatar-cropper {
    position: absolute;
    inset: 0;
    z-index: 12;
    min-height: 100%;
    padding: clamp(22px, 4vw, 48px);
    color: #1f2630;
    background: rgb(236, 220, 178);
}

.avatar-cropper[hidden] {
    display: none;
}

.avatar-cropper__stage {
    position: relative;
    margin-top: 20px;
    overflow: hidden;
    background: #101721;
    border: 1px solid #8b661f;
    touch-action: none;
    user-select: none;
}

.avatar-cropper__stage canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: grab;
    touch-action: none;
}

.avatar-cropper__stage canvas.is-dragging {
    cursor: grabbing;
}

.avatar-cropper__zoom {
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) 56px;
    gap: 14px;
    align-items: center;
    margin-top: 20px;
    color: #17375d;
    font-weight: 700;
}

.avatar-cropper__zoom input {
    width: 100%;
    accent-color: #183d6a;
}

.avatar-cropper__zoom output {
    text-align: right;
}

.avatar-cropper__message {
    min-height: 24px;
    margin: 14px 0 0;
    color: #8b2727;
    font-weight: 700;
}

.avatar-cropper__actions {
    display: flex;
    gap: 9px;
    justify-content: flex-end;
    margin-top: 14px;
}

.avatar-cropper__button {
    width: 42px;
    height: 34px;
    padding: 0;
    color: #f5e6ba;
    background: #131313;
    border: 1px solid #5b4b2f;
    cursor: pointer;
    font-size: 21px;
    font-weight: 900;
}

.avatar-cropper__button--confirm {
    color: #75d26e;
}

.avatar-cropper__button--cancel {
    color: #ee6c65;
}

.avatar-cropper__button:disabled {
    cursor: wait;
    opacity: 0.55;
}

@media (max-width: 720px) {
    .avatar-upload {
        grid-template-columns: 1fr;
    }

    .avatar-upload-result {
        grid-template-columns: 82px 1fr;
    }

    .avatar-upload-result img {
        width: 82px;
        height: 82px;
    }

    .avatar-cropper__zoom {
        grid-template-columns: 1fr auto;
    }

    .avatar-cropper__zoom span {
        grid-column: 1 / -1;
    }
}

.account-profile__identity-fields {
    display: grid;
    flex: 1;
    gap: 14px;
}

.profile-display-field {
    display: grid;
    grid-template-columns: minmax(130px, 0.35fr) 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
    background: rgba(255, 249, 226, 0.62);
    border: 1px solid rgba(108, 78, 24, 0.45);
}

form.profile-display-field {
    margin: 0;
}

.profile-display-field__input {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 7px 10px;
    color: #222b35;
    background: rgba(255, 250, 233, 0.9);
    border: 1px solid rgba(108, 78, 24, 0.7);
    font: inherit;
    font-weight: 700;
}

.profile-display-field__edit-actions {
    display: flex;
    gap: 5px;
}

.profile-display-field__edit-actions[hidden] {
    display: none;
}

.profile-display-field__confirm {
    color: #2f782c !important;
}

.profile-display-field__cancel {
    color: #a62d2d !important;
}

.profile-display-field__label,
.profile-input-field > span,
.profile-input-field__title {
    color: #5c4317;
    font-weight: 700;
}

.profile-input-field {
    display: grid;
    gap: 6px;
}

.profile-input-field input,
.profile-input-field select {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    color: #222b35;
    background: rgba(255, 250, 233, 0.78);
    border: 1px solid rgba(108, 78, 24, 0.58);
}

.account-profile__section,
.account-profile__options,
.account-profile__actions {
    margin-top: 24px;
}

.profile-editor {
    margin-top: 7px;
    border: 1px solid rgba(108, 78, 24, 0.58);
}

.profile-email-field__inputs {
    display: grid;
    gap: 7px;
    width: min(100%, 520px);
}

.profile-email-field__inputs[hidden] {
    display: none;
}

.profile-email-field__inputs input {
    min-height: 38px;
    padding: 7px 9px;
}

.profile-email-field__inputs small {
    font-weight: 400;
}

.profile-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px;
    background: rgba(23, 54, 83, 0.95);
}

.profile-editor__toolbar button,
.profile-editor__toolbar select {
    min-height: 32px;
    padding: 5px 9px;
    color: #f4df9e;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(218, 176, 73, 0.55);
}

.profile-editor__toolbar button,
.profile-editor__toolbar select {
    cursor: pointer;
}

.profile-editor__color-control {
    position: relative;
}

.profile-editor__palette {
    position: absolute;
    z-index: 12;
    top: calc(100% + 5px);
    left: 0;
    display: grid;
    grid-template-columns: repeat(6, 28px);
    gap: 5px;
    width: max-content;
    padding: 8px;
    background: #17375d;
    border: 1px solid #d8a936;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.profile-editor__palette[hidden] {
    display: none;
}

.profile-editor__palette button {
    width: 28px;
    min-height: 28px;
    padding: 0;
    background: var(--profile-color);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.profile-editor__surface {
    min-height: 180px;
    max-height: 620px;
    padding: 16px;
    background: rgba(255, 250, 233, 0.78);
    overflow: auto;
    resize: vertical;
    outline: none;
    white-space: normal;
}

.profile-editor__surface:focus {
    box-shadow: inset 0 0 0 2px rgba(30, 77, 125, 0.55);
}

.profile-editor__status {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    background: rgba(255, 249, 226, 0.72);
}

.profile-editor__error {
    color: #8f201d;
    font-weight: 700;
}

.profile-link-dialog {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(10, 20, 30, 0.66);
}

.profile-link-dialog[hidden] {
    display: none;
}

.profile-link-dialog__panel {
    width: min(520px, 100%);
    padding: 22px;
    color: #17375d;
    background: #ecddbe;
    border: 1px solid #83601d;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.38);
}

.profile-link-dialog__panel label {
    display: grid;
    gap: 5px;
    margin-top: 14px;
}

.profile-link-dialog__panel input {
    min-height: 42px;
    padding: 8px 10px;
}

.profile-link-dialog__hint {
    font-size: 0.9rem;
}

.profile-link-dialog__actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.profile-link-pending {
    padding: 1px 5px;
    color: #704b13;
    background: #fff1bd;
    border-bottom: 1px dashed #a88e6b;
}

.member-dialog__richtext {
    overflow-wrap: anywhere;
}

.member-dialog__richtext a {
    color: #17375d;
    text-decoration: underline;
}

.account-profile__security,
.account-profile__options {
    padding: 16px;
    background: rgba(255, 249, 226, 0.52);
    border: 1px solid rgba(108, 78, 24, 0.4);
}

.account-profile__security p {
    margin: 5px 0 0;
}

.profile-password [hidden] { display: none !important; }
.profile-password__body { flex: 1; min-width: 0; }
.profile-password__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.profile-password__fields label { display: grid; gap: 6px; }
.profile-password__input-wrap { display: flex; align-items: stretch; }
.profile-password__input-wrap input { min-width: 0; width: 100%; padding: 9px; border: 1px solid #a88e6b; background: #fff9e2; color: #17375d; }
.profile-password__eye { padding: 8px; border: 1px solid #a88e6b; background: #ecddbe; color: #17375d; cursor: pointer; }
.profile-password__actions { display: flex; flex-wrap: wrap; gap: 8px; align-self: start; }
.profile-password__rules { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: #b7332e; font-size: 0.85rem; }
.profile-password .is-valid { color: #357a38; }
.profile-password .is-invalid { color: #b7332e; }
.profile-password__history-hint { font-size: 0.85rem; }
@media (max-width: 900px) {
    .account-profile__security.profile-password { display: flex; flex-direction: column; align-items: stretch; }
    .profile-password__fields { grid-template-columns: 1fr; }
}

.account-profile__options {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-option-column { display: grid; align-content: start; gap: 8px; min-width: 0; }
.profile-option-column label { display: flex; align-items: flex-start; gap: 8px; }
.profile-option-column input { flex-shrink: 0; margin-top: 3px; }
.profile-option-column small { margin: -3px 0 10px 23px; }
.profile-option-column .is-disabled { opacity: 0.5; }
.profile-options-migration { grid-column: 1 / -1; }
@media (max-width: 680px) { .account-profile__options { grid-template-columns: 1fr; } }

.account-primary-button,
.account-secondary-button,
.account-danger-button {
    min-height: 42px;
    padding: 8px 18px;
    border: 1px solid #83601d;
    font-weight: 700;
}

.account-primary-button {
    color: #f9e7ae;
    background: #1e4d7d;
}

.account-secondary-button {
    color: #173653;
    background: #e4c876;
}

.account-danger-button {
    margin-left: auto;
    color: #f7e9d0;
    background: #6d2722;
}

.account-profile button:disabled,
.account-profile input:disabled,
.account-profile select:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.moderation-panel {
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid rgba(116, 78, 25, 0.48);
    background: rgba(246, 229, 178, 0.91);
}

.moderation-panel__count {
    padding: 7px 12px;
    border: 1px solid #83601d;
    background: #e4c876;
    font-weight: 700;
}

.moderation-panel__empty,
.moderation-notice {
    padding: 14px;
    border: 1px solid rgba(116, 78, 25, 0.48);
    background: rgba(255, 249, 226, 0.72);
}

.moderation-notice--success {
    border-color: #3d6f42;
}

.moderation-notice--error {
    border-color: #8e302b;
}

.moderation-list {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.moderation-card {
    border: 2px solid #b48722;
    background: rgba(255, 251, 235, 0.88);
}

.moderation-card--escalated {
    border-color: #bd7621;
}

.moderation-card--rejected {
    border-color: #8e302b;
}

.moderation-card__header {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.moderation-card__header::-webkit-details-marker {
    display: none;
}

.moderation-card__header:hover {
    background: rgba(226, 198, 118, 0.18);
}

.moderation-card__body {
    padding: 0 16px 16px;
    border-top: 1px solid rgba(116, 78, 25, 0.25);
}

.moderation-card__summary-text {
    min-width: 0;
}

.moderation-card__header small {
    display: block;
    margin-top: 3px;
}

.moderation-card__signal {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e3b629;
    box-shadow: 0 0 0 3px rgba(227, 182, 41, 0.22);
}

.moderation-card--rejected .moderation-card__signal {
    background: #a62d29;
    box-shadow: 0 0 0 3px rgba(166, 45, 41, 0.2);
}

.moderation-card__status {
    font-size: 0.82rem;
    font-weight: 700;
}

.moderation-card__toggle {
    font-size: 1.35rem;
    line-height: 1;
    transition: transform 150ms ease;
}

.moderation-card[open] .moderation-card__toggle {
    transform: rotate(180deg);
}

.moderation-card__meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.moderation-card__meta div {
    padding: 8px;
    background: rgba(226, 198, 118, 0.22);
}

.moderation-card__meta dt {
    font-size: 0.72rem;
    text-transform: uppercase;
}

.moderation-card__meta dd {
    margin: 4px 0 0;
}

.moderation-card__form label,
.moderation-card__form textarea {
    display: block;
    width: 100%;
}

.moderation-card__preview {
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid rgba(116, 78, 25, 0.36);
    background: rgba(255, 255, 255, 0.42);
}

.moderation-card__preview p {
    margin: 8px 0 0;
    white-space: pre-wrap;
}

.moderation-card__preview img {
    display: block;
    width: min(180px, 100%);
    max-height: 180px;
    margin-top: 10px;
    object-fit: contain;
}

.moderation-card__history {
    margin: 0 0 16px;
    padding: 12px;
    border-left: 4px solid #bd7621;
    background: rgba(189, 118, 33, 0.12);
}

.moderation-card__history p {
    margin: 7px 0 0;
    line-height: 1.5;
}

.moderation-card__form textarea {
    margin-top: 6px;
    box-sizing: border-box;
}

.moderation-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.moderation-card__actions .account-danger-button {
    margin-left: 0;
}

.moderation-archive {
    margin-top: 24px;
    border-top: 1px solid rgba(116, 78, 25, 0.45);
}

.moderation-archive > summary {
    padding: 14px 0;
    font-weight: 700;
    cursor: pointer;
}

.moderation-archive__list {
    display: grid;
    gap: 8px;
}

.moderation-archive__list form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    background: rgba(255, 251, 235, 0.65);
}

.moderation-archive__list button {
    flex: 0 0 auto;
}

.administration-section > h2 {
    margin-bottom: 8px;
}

.administration-section > p {
    line-height: 1.55;
}

.administration-maintenance {
    margin-bottom: 2rem;
    padding: 1.25rem;
    border: 1px solid rgba(181, 141, 58, 0.45);
    background: rgba(255, 248, 225, 0.55);
}

.administration-maintenance__toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    font-weight: 700;
    cursor: pointer;
}

.administration-maintenance__toggle input {
    width: 1.25rem;
    height: 1.25rem;
}

.administration-maintenance__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.members-search {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(190px, 1fr) auto auto;
    align-items: end;
    gap: 12px;
    margin: 20px 0 28px;
}

.members-panel {
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid rgba(116, 78, 25, 0.48);
    background: rgba(246, 229, 178, 0.91);
}

.members-search label,
.member-role-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.members-search input,
.members-search select,
.member-role-form select {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid rgba(92, 64, 28, 0.45);
    background: rgba(255, 252, 239, 0.92);
    color: #2f2418;
}

.members-search small {
    grid-column: 1 / -1;
    color: #6c6255;
}

.members-group + .members-group {
    margin-top: 28px;
}

.members-group h2 {
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(142, 101, 38, 0.45);
    font-size: 1.15rem;
}

.members-group__empty {
    margin: 0;
    padding: 10px 12px;
    color: #6c6255;
}

.members-list {
    display: grid;
    gap: 5px;
}

.members-list__row {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(135px, 0.85fr) 135px 120px minmax(220px, 1.7fr);
    gap: 12px;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid rgba(142, 101, 38, 0.2);
    background: rgba(255, 251, 235, 0.62);
    color: inherit;
    text-decoration: none;
}

.members-list__row span:nth-of-type(2) {
    overflow: visible;
    text-overflow: clip;
}

.members-list__row:hover,
.members-list__row:focus-visible {
    border-color: rgba(142, 101, 38, 0.75);
    background: rgba(255, 248, 215, 0.95);
}

.members-list__row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-dialog {
    position: fixed;
    z-index: 3000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.member-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 14, 8, 0.72);
}

.member-dialog__panel {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px;
    border: 2px solid #9b742e;
    background: #f7efd9;
    box-shadow: 0 22px 65px rgba(0, 0, 0, 0.42);
}

.member-dialog__close {
    position: absolute;
    top: 8px;
    right: 12px;
    color: #382719;
    font-size: 2rem;
    line-height: 1;
    text-decoration: none;
}

.member-dialog__identity {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 20px;
    align-items: center;
}

.member-dialog__image {
    display: grid;
    place-items: center;
    width: 110px;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid #9b742e;
    background: #e7d7ae;
    font-size: 3rem;
}

.member-dialog__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-dialog__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0;
}

.member-dialog__facts div {
    padding: 10px 12px;
    background: rgba(255, 251, 235, 0.7);
}

.member-dialog__facts dt {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.member-dialog__facts dd {
    margin: 3px 0 0;
}

.member-dialog__bio h3 {
    margin-bottom: 6px;
}

.member-role-form {
    display: flex;
    align-items: end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(142, 101, 38, 0.4);
}

.member-role-form label {
    flex: 1;
}

.member-role-form__notice {
    margin: 0;
    font-weight: 700;
}

@media (max-width: 760px) {
    .account-shell {
        padding: 18px 12px;
    }

    .account-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0;
    }

    .members-search {
        grid-template-columns: 1fr;
    }

    .members-search small {
        grid-column: auto;
    }

    .members-list__row {
        grid-template-columns: 1fr 1fr;
    }

    .members-list__row strong,
    .members-list__row span:last-child {
        grid-column: 1 / -1;
    }

    .member-dialog {
        padding: 10px;
    }

    .member-dialog__panel {
        max-height: calc(100vh - 20px);
        padding: 24px 18px;
    }

    .member-dialog__identity,
    .member-dialog__facts {
        grid-template-columns: 1fr;
    }

    .member-role-form {
        align-items: stretch;
        flex-direction: column;
    }

    .account-profile__heading,
    .account-profile__identity,
    .account-profile__security,
    .account-profile__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-image-control {
        justify-content: center;
    }

    .profile-image-control__preview {
        width: min(68vw, 220px);
    }

    .profile-display-field {
        grid-template-columns: 1fr auto;
    }

    .profile-display-field__label {
        grid-column: 1 / -1;
    }

    .account-danger-button {
        margin-left: 0;
    }

    .moderation-card__header {
        grid-template-columns: auto 1fr auto;
    }

    .moderation-card__status {
        grid-column: 2;
    }

    .moderation-card__toggle {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .moderation-card__meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .moderation-archive__list form {
        align-items: stretch;
        flex-direction: column;
    }
}
