img,
video,
iframe {
    max-width: 100%;
}

button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

.table-wrap {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table-wrap table {
    white-space: normal;
}

.dashboard,
.section,
.form-page,
.site-footer,
.site-header,
.hero,
.promise-strip {
    min-width: 0;
}

.dashboard-head > *,
.member-detail-grid > *,
.stat-grid > *,
.feature-grid > *,
.memory-grid > *,
.footer-main > * {
    min-width: 0;
}

.memory-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin: 24px 0;
    padding: 18px;
    background: var(--white);
    border: 1px solid var(--line);
}

.memory-filters label {
    flex: 1 1 180px;
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.memory-filters input,
.memory-filters select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--white);
    color: var(--ink);
}

.memory-filters > small {
    flex: 1 1 100%;
    color: var(--muted);
    font-size: 11px;
}

.memory-draft-notice,
.memory-draft-status {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--muted);
    font-size: 12px;
}

.memory-draft-status {
    border-top: 0;
    color: var(--green);
}

.memory-draft-clear {
    justify-self: start;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 11px;
    text-decoration: underline;
}

.memory-filter-clear {
    padding: 8px 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.memory-filter-empty {
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

[data-memory-card][hidden] {
    display: none;
}

.status-next-step {
    display: block;
    max-width: 260px;
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.5;
}

.status-banner.rejected {
    border-color: #e7c8bd;
    background: #fbefeb;
}

@media (max-width: 900px) {
    .nav-wrap {
        gap: 12px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .form-page {
        width: 100%;
        gap: 32px;
    }

    .form-aside {
        min-width: 0;
    }

    .form-panel {
        min-width: 0;
    }

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

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

@media (max-width: 700px) {
    .site-header {
        height: auto;
        min-height: 68px;
    }

    .nav-wrap {
        min-height: 68px;
        height: auto;
        padding-top: 10px;
        padding-bottom: 10px;
        flex-wrap: wrap;
    }

    .nav-links {
        flex: 1 1 100%;
        gap: 8px;
        justify-content: flex-start;
        padding: 2px 0;
    }

    .nav-links > a,
    .nav-links > button {
        min-height: 38px;
    }

    .dashboard {
        width: 100%;
    }

    .dashboard-head {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .dashboard-head > .button,
    .dashboard-head > .notification-dropdown {
        align-self: flex-start;
    }

    .dash-nav {
        gap: 0;
        margin-right: -17px;
        padding-right: 17px;
        scrollbar-width: thin;
    }

    .dash-nav a {
        flex: 0 0 auto;
        padding: 0 12px 13px 0;
        margin-right: 14px;
    }

    .subsection,
    .form-panel,
    .member-detail-card,
    .feedback-card {
        max-width: 100%;
    }

    .table-wrap {
        border-radius: 3px;
        overscroll-behavior-x: contain;
    }

    .table-wrap table {
        min-width: 660px;
    }

    .review-form {
        min-width: 0;
        flex-wrap: wrap;
    }

    .review-form input[name="note"] {
        flex: 1 1 100%;
        min-width: 0;
    }

    .review-form button {
        min-height: 38px;
        flex: 1 1 auto;
    }

    .form-panel form,
    .profile-panel form {
        min-width: 0;
    }

    .form-panel input,
    .form-panel select,
    .form-panel textarea,
    .form-panel button,
    .profile-panel input,
    .profile-panel select,
    .profile-panel textarea,
    .profile-panel button {
        max-width: 100%;
    }

    .form-panel input[type="file"] {
        width: 100%;
        min-width: 0;
        font-size: 12px;
    }

    .memory-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .memory-filters label {
        flex-basis: auto;
    }

    .form-panel .check-row {
        align-items: flex-start;
    }

    .form-panel .check-row input {
        flex: 0 0 auto;
        margin-top: 4px;
    }

    .member-search > div {
        flex-wrap: wrap;
    }

    .member-search input[type="search"] {
        flex: 1 1 100%;
        min-width: 0;
    }

    .member-search button {
        min-height: 40px;
    }

    .admin-delete-panel,
    .account-delete-panel {
        min-width: 0;
    }

    .admin-delete-panel form,
    .account-delete-panel form {
        min-width: 0;
    }

    .notification-menu {
        max-width: calc(100vw - 34px);
    }

    .alert {
        overflow-wrap: anywhere;
    }

    .footer-main,
    .footer-bottom {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .nav-wrap {
        padding-right: 14px;
        padding-left: 14px;
    }

    .nav-links {
        column-gap: 7px;
        row-gap: 4px;
    }

    .nav-links > a,
    .nav-links > button {
        font-size: 10px;
    }

    .theme-toggle {
        padding: 7px 8px;
    }

    .dashboard {
        padding-right: 14px;
        padding-left: 14px;
    }

    .dashboard h1 {
        font-size: clamp(32px, 10vw, 39px);
        overflow-wrap: anywhere;
    }

    .dashboard-head p {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .dash-nav {
        margin-right: -14px;
        padding-right: 14px;
    }

    .dash-nav a {
        font-size: 11px;
    }

    .form-page {
        padding-right: 14px;
        padding-left: 14px;
    }

    .form-aside h1,
    .not-found h1 {
        font-size: clamp(34px, 10vw, 43px);
        overflow-wrap: anywhere;
    }

    .form-panel {
        padding: 22px 16px;
    }

    .form-panel h2 {
        font-size: 25px;
    }

    .form-panel input,
    .form-panel select,
    .form-panel textarea,
    .member-search input,
    .admin-delete-panel input,
    .account-delete-panel input {
        width: 100%;
        min-width: 0;
    }

    .form-panel .check-row input {
        width: auto;
    }

    .button,
    .danger-button,
    .member-search button {
        max-width: 100%;
        min-height: 42px;
        white-space: normal;
    }

    .stat-grid {
        gap: 8px;
    }

    .stat-grid article {
        min-width: 0;
        padding: 12px 10px;
    }

    .stat-grid strong {
        font-size: clamp(23px, 8vw, 32px);
    }

    .stat-grid article > span,
    .stat-grid article > small {
        overflow-wrap: anywhere;
    }

    .member-list-head,
    .member-detail-head,
    .member-pagination {
        min-width: 0;
    }

    .member-pagination {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .review-form {
        gap: 7px;
    }

    .review-form button {
        flex-basis: 100%;
    }

    .account-delete-panel,
    .admin-delete-panel {
        padding: 17px;
    }

    .feedback-contact {
        overflow-wrap: anywhere;
    }

    .table-wrap table {
        min-width: 620px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
@media(max-width:700px){.admin-permission-nav{padding:0 16px;margin-top:16px;gap:6px}.admin-permission-nav a{flex:1 1 auto;justify-content:center;min-height:38px;padding:7px 9px;font-size:11px}.manager-list{grid-template-columns:minmax(0,1fr)}.manager-card-head{flex-direction:column}.manager-remove-form{grid-template-columns:1fr}.manager-remove-form .danger-button{justify-self:stretch}.admin-managers fieldset{grid-template-columns:1fr}}
@media(max-width:700px){.account-security-panel form{grid-template-columns:1fr}.account-security-panel .button{width:100%;justify-self:stretch}.admin-request-actions{flex-direction:column}.admin-request-actions button{width:100%}}
@media(max-width:760px){.account-welcome{grid-template-columns:1fr;gap:22px;padding:28px 24px}.memory-count-card{min-height:190px}.account-snapshot-grid{grid-template-columns:1fr}.account-snapshot-grid article{padding:15px}.settings-grid{grid-template-columns:1fr}.settings-grid .profile-panel{grid-row:auto}.settings-grid .export-panel,.settings-grid .account-delete-panel{grid-column:auto}.settings-grid>.form-panel{padding:24px}}
@media(max-width:700px){.admin-list-search{min-width:0;width:100%}.admin-list-search>div{align-items:stretch}.admin-list-search input[type=search]{flex-basis:100%}.admin-list-search select{flex:1 1 130px;max-width:none}.admin-list-search .button{flex:1 1 100%}}
@media(max-width:560px){.beneficiary-card{align-items:flex-start;flex-direction:column;gap:13px;padding:16px}.beneficiary-card-actions{align-self:flex-end}}
@media(max-width:560px){.beneficiary-identity-fields{grid-template-columns:1fr}}
@media(max-width:480px){.account-welcome{padding:23px 18px}.account-welcome h2{font-size:31px}.account-welcome-actions{align-items:flex-start;flex-direction:column;gap:13px}.memory-count-card{min-height:170px;padding:23px}.memory-count-card strong{font-size:56px}.account-privacy-note{align-items:flex-start;padding:13px}.settings-grid>.form-panel{padding:21px 16px}}
