/*
 * Memoriez Maglan Profiles — isolated front-end UI
 * The system pages use their own page shell, so every rule remains scoped to MZMP.
 */

:root {
    --mzmp-navy: #061b44;
    --mzmp-gold: #d29a34;
    --mzmp-navy-950: #03122f;
    --mzmp-navy-900: var(--mzmp-navy);
    --mzmp-navy-800: #0a2a63;
    --mzmp-navy-700: #123d7d;
    --mzmp-blue-100: #eaf1fb;
    --mzmp-gold-600: #b67a18;
    --mzmp-gold-500: var(--mzmp-gold);
    --mzmp-gold-400: #e9bd65;
    --mzmp-gold-100: #fff5dc;
    --mzmp-ink: #101828;
    --mzmp-muted: #667085;
    --mzmp-line: #dce3ee;
    --mzmp-surface: #ffffff;
    --mzmp-canvas: #f4f7fb;
    --mzmp-success: #087a4b;
    --mzmp-success-bg: #eafaf2;
    --mzmp-danger: #b42318;
    --mzmp-danger-bg: #fff0ee;
    --mzmp-warning: #9a6700;
    --mzmp-warning-bg: #fff7df;
    --mzmp-radius-sm: 10px;
    --mzmp-radius: 18px;
    --mzmp-radius-lg: 28px;
    --mzmp-shadow-sm: 0 6px 20px rgba(6, 27, 68, .07);
    --mzmp-shadow: 0 18px 52px rgba(6, 27, 68, .12);
    --mzmp-shadow-lg: 0 28px 80px rgba(3, 18, 47, .2);
    --mzmp-font: "Heebo", "Assistant", Arial, sans-serif;
}

.mzmp-login,
.mzmp-dashboard,
.mzmp-profile {
    /* These two variables are supplied inline from the plugin settings. */
    --mzmp-navy-900: var(--mzmp-navy, #061b44);
    --mzmp-gold-500: var(--mzmp-gold, #d29a34);
}

.mzmp-system-page,
.mzmp-system-page *,
.mzmp-system-page *::before,
.mzmp-system-page *::after {
    box-sizing: border-box;
}

html:has(body.mzmp-is-system-page) {
    scroll-behavior: smooth;
    background: var(--mzmp-canvas);
}

body.mzmp-is-system-page {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 8% 3%, rgba(233, 189, 101, .12), transparent 24rem),
        var(--mzmp-canvas);
    color: var(--mzmp-ink);
    font-family: var(--mzmp-font);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.mzmp-is-system-page.admin-bar {
    min-height: calc(100vh - 32px);
}

.mzmp-page-shell {
    width: 100%;
    min-height: 100svh;
    isolation: isolate;
}

.mzmp-system-page img,
.mzmp-system-page video,
.mzmp-system-page iframe {
    max-width: 100%;
}

.mzmp-system-page button,
.mzmp-system-page input,
.mzmp-system-page select,
.mzmp-system-page textarea {
    font: inherit;
}

.mzmp-system-page button,
.mzmp-system-page a {
    -webkit-tap-highlight-color: transparent;
}

.mzmp-system-page [hidden] {
    display: none !important;
}

.mzmp-system-page :focus-visible {
    outline: 3px solid rgba(210, 154, 52, .55);
    outline-offset: 3px;
}

.mzmp-system-page ::selection {
    background: var(--mzmp-gold-400);
    color: var(--mzmp-navy-950);
}

.mzmp-eyebrow {
    display: block;
    margin: 0 0 5px;
    color: var(--mzmp-gold-600);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .07em;
    line-height: 1.4;
    text-transform: uppercase;
}

.mzmp-button {
    position: relative;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--mzmp-navy-900);
    box-shadow: 0 8px 20px rgba(6, 27, 68, .13);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, opacity .18s ease;
}

.mzmp-button:hover {
    transform: translateY(-1px);
    background: var(--mzmp-navy-800);
    box-shadow: 0 12px 28px rgba(6, 27, 68, .2);
    color: #fff;
}

.mzmp-button:active {
    transform: translateY(0);
}

.mzmp-button:disabled,
.mzmp-button[aria-disabled="true"] {
    cursor: wait;
    opacity: .64;
    transform: none;
}

.mzmp-button.is-loading {
    padding-inline-end: 48px;
}

.mzmp-button.is-loading::after {
    position: absolute;
    inset-inline-end: 18px;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    content: "";
    animation: mzmp-spin .7s linear infinite;
}

.mzmp-button--primary {
    background: linear-gradient(135deg, var(--mzmp-navy-900), var(--mzmp-navy-700));
}

.mzmp-button--ghost {
    border-color: var(--mzmp-line);
    background: #fff;
    box-shadow: none;
    color: var(--mzmp-navy-900);
}

.mzmp-button--ghost:hover {
    border-color: #a9b8cf;
    background: var(--mzmp-blue-100);
    box-shadow: none;
    color: var(--mzmp-navy-900);
}

.mzmp-button--glass {
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .12);
    box-shadow: none;
    color: #fff;
    backdrop-filter: blur(12px);
}

.mzmp-button--glass:hover {
    background: rgba(255, 255, 255, .22);
}

.mzmp-button--danger {
    background: var(--mzmp-danger);
    box-shadow: none;
}

.mzmp-button--small {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 13px;
}

.mzmp-button--wide {
    width: 100%;
}

.mzmp-link-button {
    appearance: none;
    padding: 5px 2px;
    border: 0;
    background: transparent;
    color: var(--mzmp-navy-700);
    cursor: pointer;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: rgba(18, 61, 125, .25);
    text-underline-offset: 4px;
}

.mzmp-link-button:hover {
    color: var(--mzmp-gold-600);
}

.mzmp-link-button--danger {
    color: var(--mzmp-danger);
}

.mzmp-inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.mzmp-form-status {
    min-height: 24px;
    color: var(--mzmp-muted);
    font-size: 14px;
    font-weight: 700;
}

.mzmp-form-status:empty {
    min-height: 0;
}

.mzmp-form-status.is-info {
    color: var(--mzmp-navy-700);
}

.mzmp-form-status.is-success {
    color: var(--mzmp-success);
}

.mzmp-form-status.is-error {
    color: var(--mzmp-danger);
}

.mzmp-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
    margin: 0 0 16px;
}

.mzmp-field > span {
    color: #253858;
    font-size: 14px;
    font-weight: 800;
}

.mzmp-field small {
    color: var(--mzmp-muted);
    font-size: 12px;
}

.mzmp-field input,
.mzmp-field select,
.mzmp-field textarea {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 11px 14px;
    border: 1px solid #cfd8e6;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
    color: var(--mzmp-ink);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.mzmp-field input:hover,
.mzmp-field select:hover,
.mzmp-field textarea:hover {
    border-color: #9facbf;
}

.mzmp-field input:focus,
.mzmp-field select:focus,
.mzmp-field textarea:focus {
    border-color: var(--mzmp-gold-500);
    box-shadow: 0 0 0 4px rgba(210, 154, 52, .13);
    outline: 0;
}

.mzmp-field input:invalid:not(:placeholder-shown) {
    border-color: #e29b95;
}

.mzmp-field input[type="email"],
.mzmp-field input[type="url"] {
    direction: ltr;
    text-align: left;
}

.mzmp-field textarea {
    min-height: 112px;
    resize: vertical;
}

.mzmp-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Login */
.mzmp-login {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 100svh;
    grid-template-columns: minmax(360px, .92fr) minmax(420px, 1.08fr);
    overflow: hidden;
    background: #fff;
}

.mzmp-login__visual {
    position: relative;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(48px, 7vw, 104px);
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(3, 18, 47, .97), rgba(8, 43, 99, .93)),
        radial-gradient(circle at 30% 20%, #1b4b99, transparent 55%);
    color: #fff;
}

.mzmp-login__visual::before,
.mzmp-login__visual::after {
    position: absolute;
    border: 1px solid rgba(233, 189, 101, .3);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.mzmp-login__visual::before {
    inset: auto -170px -250px auto;
    width: 540px;
    height: 540px;
}

.mzmp-login__visual::after {
    inset: 8% auto auto -170px;
    width: 360px;
    height: 360px;
    box-shadow: 0 0 0 42px rgba(233, 189, 101, .025), 0 0 0 84px rgba(233, 189, 101, .018);
}

.mzmp-login__visual > * {
    position: relative;
    z-index: 1;
}

.mzmp-login__mark {
    width: 112px;
    height: 112px;
    margin-bottom: 28px;
    object-fit: contain;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .25));
}

.mzmp-login__visual .mzmp-eyebrow {
    color: var(--mzmp-gold-400);
}

.mzmp-login__visual h1 {
    max-width: 650px;
    margin: 5px 0 18px;
    color: #fff;
    font-size: clamp(36px, 4.5vw, 68px);
    font-weight: 900;
    letter-spacing: -.035em;
    line-height: 1.04;
}

.mzmp-login__visual p {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: clamp(17px, 1.5vw, 21px);
}

.mzmp-login__security {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 36px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .9);
    font-size: 14px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.mzmp-login__security span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: var(--mzmp-gold-400);
    color: var(--mzmp-navy-950);
    font-weight: 900;
}

.mzmp-login__card {
    display: flex;
    width: min(100%, 540px);
    align-self: center;
    justify-self: center;
    flex-direction: column;
    margin: 40px;
    padding: clamp(30px, 5vw, 58px);
    border: 1px solid var(--mzmp-line);
    border-radius: var(--mzmp-radius-lg);
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--mzmp-shadow);
}

.mzmp-login__step {
    animation: mzmp-rise .32s ease both;
}

.mzmp-login__step h2 {
    margin: 2px 0 8px;
    color: var(--mzmp-navy-900);
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.15;
}

.mzmp-login__step > p {
    margin: 0 0 26px;
    color: var(--mzmp-muted);
}

.mzmp-login__step form {
    margin: 0;
}

.mzmp-login__step .mzmp-link-button {
    display: block;
    margin: 14px auto 0;
}

.mzmp-login__card > .mzmp-form-status {
    margin-top: 16px;
    padding: 0 4px;
    text-align: center;
}

.mzmp-otp-input {
    height: 72px !important;
    padding-inline: 12px !important;
    color: var(--mzmp-navy-900) !important;
    font-size: 34px !important;
    font-variant-numeric: tabular-nums;
    font-weight: 900 !important;
    letter-spacing: .58em;
    text-align: center;
    text-indent: .58em;
}

/* Dashboard */
.mzmp-dashboard {
    width: min(100% - 40px, 1280px);
    margin: 0 auto;
    padding: 28px 0 70px;
}

.mzmp-dashboard__header {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 22px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 22px;
    background: linear-gradient(135deg, var(--mzmp-navy-950), var(--mzmp-navy-800));
    box-shadow: var(--mzmp-shadow);
    color: #fff;
}

.mzmp-dashboard__brand,
.mzmp-dashboard__account {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mzmp-dashboard__brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.mzmp-dashboard__brand .mzmp-eyebrow {
    margin: 0;
    color: var(--mzmp-gold-400);
}

.mzmp-dashboard__brand h1 {
    margin: 0;
    color: #fff;
    font-size: 23px;
    line-height: 1.15;
}

.mzmp-dashboard__account {
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
}

.mzmp-dashboard__account .mzmp-link-button {
    color: #fff;
    text-decoration-color: rgba(255, 255, 255, .35);
}

.mzmp-profile-switcher {
    display: flex;
    gap: 10px;
    margin: 24px 0;
    padding: 6px 2px 12px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.mzmp-profile-chip {
    display: inline-flex;
    min-width: max-content;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 8px;
    border: 1px solid var(--mzmp-line);
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--mzmp-shadow-sm);
    color: var(--mzmp-navy-900);
    font-weight: 800;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.mzmp-profile-chip:hover,
.mzmp-profile-chip.is-active {
    border-color: var(--mzmp-gold-500);
    background: var(--mzmp-gold-100);
    color: var(--mzmp-navy-900);
    transform: translateY(-1px);
}

.mzmp-profile-chip img,
.mzmp-profile-chip .wp-post-image {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--mzmp-blue-100);
    object-fit: cover;
}

.mzmp-dashboard__toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 18px 2px 22px;
}

.mzmp-dashboard__toolbar h2 {
    margin: 0;
    color: var(--mzmp-navy-900);
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.15;
}

.mzmp-dashboard-tabs {
    position: sticky;
    z-index: 15;
    top: 10px;
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    padding: 6px;
    border: 1px solid var(--mzmp-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--mzmp-shadow-sm);
    overflow-x: auto;
    backdrop-filter: blur(14px);
}

.mzmp-dashboard-tabs button {
    appearance: none;
    display: inline-flex;
    min-width: max-content;
    min-height: 44px;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #526078;
    cursor: pointer;
    font-weight: 800;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.mzmp-dashboard-tabs button span {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #edf1f6;
    font-size: 12px;
}

.mzmp-dashboard-tabs button:hover {
    background: var(--mzmp-blue-100);
    color: var(--mzmp-navy-900);
}

.mzmp-dashboard-tabs button.is-active {
    background: var(--mzmp-navy-900);
    box-shadow: 0 7px 18px rgba(6, 27, 68, .19);
    color: #fff;
}

.mzmp-dashboard-tabs button.is-active span {
    background: rgba(255, 255, 255, .15);
}

.mzmp-dashboard-panel {
    animation: mzmp-rise .26s ease both;
}

.mzmp-dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    gap: 20px;
    align-items: start;
}

.mzmp-card {
    min-width: 0;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--mzmp-line);
    border-radius: var(--mzmp-radius);
    background: #fff;
    box-shadow: var(--mzmp-shadow-sm);
}

.mzmp-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #edf0f4;
}

.mzmp-card__head h3,
.mzmp-info-card h3 {
    margin: 0 0 3px;
    color: var(--mzmp-navy-900);
    font-size: 22px;
    line-height: 1.25;
}

.mzmp-card__head p,
.mzmp-info-card p {
    margin: 0;
    color: var(--mzmp-muted);
    font-size: 14px;
}

.mzmp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.mzmp-field--full {
    grid-column: 1 / -1;
}

.mzmp-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.mzmp-upload-field {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border: 1px dashed #aebbcf;
    border-radius: 16px;
    background: #f9fbfd;
    color: var(--mzmp-navy-900);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    transition: border-color .18s ease, background-color .18s ease;
}

.mzmp-upload-field:hover,
.mzmp-upload-field.is-dragging {
    border-color: var(--mzmp-gold-500);
    background: var(--mzmp-gold-100);
}

.mzmp-upload-field__preview {
    display: grid;
    width: 100%;
    height: 130px;
    place-items: center;
    overflow: hidden;
    border-radius: 11px;
    background: #e9eef6;
    color: #7d8ba3;
}

.mzmp-upload-field__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mzmp-upload-field__preview svg {
    width: 35px;
    height: 35px;
}

.mzmp-upload-field input[type="file"] {
    width: 100%;
    color: var(--mzmp-muted);
    font-size: 12px;
}

.mzmp-upload-field input[type="file"]::file-selector-button {
    margin-inline-end: 8px;
    padding: 6px 9px;
    border: 0;
    border-radius: 8px;
    background: var(--mzmp-navy-900);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.mzmp-upload-field small {
    color: var(--mzmp-muted);
    font-weight: 500;
}

.mzmp-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #edf0f4;
}

.mzmp-content-list,
.mzmp-editor-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.mzmp-content-row,
.mzmp-editor-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e4e9f1;
    border-radius: 13px;
    background: #fbfcfe;
    transition: opacity .22s ease, transform .22s ease, background-color .18s ease;
}

.mzmp-content-row:hover,
.mzmp-editor-row:hover {
    background: #f5f8fc;
}

.mzmp-content-row.is-removing,
.mzmp-editor-row.is-removing,
.mzmp-pending-memory.is-removing {
    opacity: 0;
    transform: translateY(-8px) scale(.985);
}

.mzmp-content-row__icon,
.mzmp-avatar-letter {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: var(--mzmp-blue-100);
    color: var(--mzmp-navy-700);
}

.mzmp-content-row__icon svg {
    width: 22px;
    height: 22px;
}

.mzmp-avatar-letter {
    border-radius: 50%;
    background: var(--mzmp-gold-100);
    color: var(--mzmp-gold-600);
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
}

.mzmp-content-row strong,
.mzmp-editor-row strong {
    display: block;
    overflow: hidden;
    color: var(--mzmp-ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mzmp-content-row small,
.mzmp-editor-row small {
    display: block;
    color: var(--mzmp-muted);
    font-size: 12px;
}

.mzmp-icon-button {
    appearance: none;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #edf1f6;
    color: #536174;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.mzmp-icon-button:hover {
    transform: scale(1.06);
}

.mzmp-icon-button--danger:hover {
    background: var(--mzmp-danger-bg);
    color: var(--mzmp-danger);
}

.mzmp-status-pill,
.mzmp-count-badge {
    display: inline-grid;
    min-width: 42px;
    min-height: 28px;
    place-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--mzmp-gold-100);
    color: #86580d;
    font-size: 12px;
    font-weight: 900;
}

.mzmp-info-card {
    background: linear-gradient(145deg, #fff, #f7f9fc);
}

/* Per-profile content navigation manager */
.mzmp-navigation-manager {
    margin-top: 22px;
}

.mzmp-navigation-types-form {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--mzmp-line);
}

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

.mzmp-navigation-type-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 86px;
    align-items: end;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--mzmp-line);
    border-radius: 14px;
    background: #f9fbfd;
}

.mzmp-navigation-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    align-self: center;
    border-radius: 12px;
    background: var(--mzmp-blue-100);
    color: var(--mzmp-navy-700);
}

.mzmp-navigation-icon svg {
    width: 23px;
    height: 23px;
}

.mzmp-field--order {
    min-width: 76px;
}

.mzmp-navigation-collections {
    display: grid;
    grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
    gap: 20px;
    margin-top: 24px;
}

.mzmp-navigation-add,
.mzmp-navigation-list {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--mzmp-line);
    border-radius: 16px;
    background: #fbfcfe;
}

.mzmp-navigation-add h4,
.mzmp-navigation-list h4 {
    margin: 0;
    color: var(--mzmp-navy-900);
    font-size: 17px;
}

.mzmp-navigation-add > div > p,
.mzmp-navigation-list > div > p {
    margin: 3px 0 14px;
    color: var(--mzmp-muted);
    font-size: 13px;
}

.mzmp-navigation-add {
    display: grid;
    align-content: start;
    gap: 12px;
}

.mzmp-navigation-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 9px;
    padding: 12px 0;
    border-top: 1px solid var(--mzmp-line);
}

.mzmp-navigation-row__form {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(85px, .55fr) minmax(130px, 1.25fr) minmax(115px, 1fr) 76px auto;
    align-items: end;
    gap: 8px;
}

.mzmp-navigation-row__form .mzmp-form-status {
    grid-column: 1 / -1;
    grid-row: 2;
}

.mzmp-navigation-parent {
    align-self: center;
    overflow: hidden;
    color: var(--mzmp-muted);
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mzmp-login--message {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 24px;
}

.mzmp-login--message .mzmp-access-message img {
    width: 90px;
    height: 90px;
    margin-bottom: 12px;
    object-fit: contain;
}

.mzmp-empty-state,
.mzmp-access-message,
.mzmp-integration-notice {
    padding: 24px;
    border: 1px dashed #b8c3d3;
    border-radius: var(--mzmp-radius);
    background: rgba(255, 255, 255, .72);
    color: var(--mzmp-muted);
    text-align: center;
}

.mzmp-empty-state--large,
.mzmp-access-message {
    display: grid;
    min-height: 240px;
    place-content: center;
    margin: 30px auto;
}

.mzmp-empty-state h2,
.mzmp-empty-state h3,
.mzmp-access-message h2 {
    margin: 0 0 6px;
    color: var(--mzmp-navy-900);
}

.mzmp-empty-state p,
.mzmp-access-message p {
    margin: 0 0 16px;
}

/* Public profile */
.mzmp-profile {
    min-height: 100svh;
    direction: rtl;
    background: var(--mzmp-canvas);
    color: var(--mzmp-ink);
    text-align: right;
}

.mzmp-profile__topbar {
    position: relative;
    z-index: 20;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px max(24px, calc((100vw - 1240px) / 2));
    background: var(--mzmp-navy-950);
    box-shadow: 0 6px 20px rgba(3, 18, 47, .22);
}

.mzmp-profile__brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.mzmp-profile__brand:hover {
    color: var(--mzmp-gold-400);
}

.mzmp-profile__brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.mzmp-profile-hero {
    position: relative;
    z-index: 1;
    padding-bottom: 1px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(6, 27, 68, .08);
}

.mzmp-profile-hero__cover {
    position: relative;
    height: clamp(260px, 34vw, 470px);
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(3, 18, 47, .05), rgba(3, 18, 47, .78)),
        var(--mzmp-cover, linear-gradient(135deg, #153e78, #061b44));
    background-position: center;
    background-size: cover;
}

.mzmp-profile-hero__cover::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(3, 18, 47, .5), transparent 50%, rgba(3, 18, 47, .18));
    content: "";
    pointer-events: none;
}

.mzmp-profile-hero__content {
    position: relative;
    z-index: 2;
    display: grid;
    width: min(calc(100% - 40px), 1160px);
    min-height: 205px;
    grid-template-columns: 190px minmax(0, 1fr) 130px;
    align-items: center;
    gap: 30px;
    margin: -105px auto 0;
    padding: 28px 32px;
    border: 1px solid rgba(220, 227, 238, .9);
    border-radius: 26px;
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--mzmp-shadow-lg);
    backdrop-filter: blur(15px);
}

.mzmp-profile-hero__portrait {
    display: grid;
    width: 180px;
    height: 180px;
    place-items: center;
    overflow: hidden;
    border: 7px solid #fff;
    border-radius: 50%;
    background: var(--mzmp-blue-100);
    box-shadow: 0 0 0 5px var(--mzmp-gold-500), 0 18px 36px rgba(6, 27, 68, .22);
    color: var(--mzmp-navy-700);
}

.mzmp-profile-hero__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.mzmp-profile-hero__portrait svg {
    width: 68px;
    height: 68px;
}

.mzmp-profile-hero__identity {
    min-width: 0;
}

.mzmp-profile-hero__identity h1 {
    margin: 0;
    color: var(--mzmp-navy-900);
    font-size: clamp(35px, 4vw, 56px);
    font-weight: 900;
    letter-spacing: -.035em;
    line-height: 1.05;
}

.mzmp-rank {
    display: inline-block;
    margin-top: 7px;
    color: var(--mzmp-gold-600);
    font-size: 16px;
}

.mzmp-profile-hero__identity > p {
    max-width: 720px;
    margin: 12px 0 0;
    color: #48566b;
    line-height: 1.75;
}

.mzmp-date-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.mzmp-date-row > span {
    display: grid;
    min-width: 155px;
    grid-template-columns: 30px auto;
    grid-template-rows: auto auto;
    column-gap: 8px;
    align-items: center;
    padding: 9px 13px;
    border: 1px solid #e2e7ef;
    border-radius: 12px;
    background: #f9fbfd;
}

.mzmp-date-row svg {
    width: 24px;
    height: 24px;
    grid-row: 1 / 3;
    color: var(--mzmp-navy-700);
}

.mzmp-date-row small {
    color: var(--mzmp-muted);
    font-size: 10px;
    line-height: 1.2;
}

.mzmp-date-row strong {
    color: var(--mzmp-navy-900);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}

.mzmp-profile-hero__unit-mark {
    display: grid;
    width: 118px;
    height: 118px;
    place-items: center;
    padding: 12px;
    border: 1px solid #e1e7ef;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--mzmp-shadow-sm);
}

.mzmp-profile-hero__unit-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mzmp-profile-nav {
    display: flex;
    width: min(calc(100% - 40px), 760px);
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 26px auto 0;
}

.mzmp-profile-nav button {
    position: relative;
    appearance: none;
    display: inline-flex;
    min-height: 68px;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 22px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #5e6a7c;
    cursor: pointer;
    font-size: 17px;
    font-weight: 900;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.mzmp-profile-nav button:hover {
    background: #f8fafc;
    color: var(--mzmp-navy-900);
}

.mzmp-profile-nav button.is-active {
    border-bottom-color: var(--mzmp-gold-500);
    color: var(--mzmp-navy-900);
}

.mzmp-profile-nav svg {
    width: 22px;
    height: 22px;
}

.mzmp-profile-nav b {
    display: grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--mzmp-danger);
    color: #fff;
    font-size: 11px;
}

.mzmp-profile__body {
    width: min(calc(100% - 40px), 1240px);
    margin: 0 auto;
    padding: 52px 0 80px;
}

.mzmp-profile-section {
    animation: mzmp-rise .34s ease both;
}

.mzmp-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.mzmp-section-heading h2,
.mzmp-section-heading h3 {
    margin: 0;
    color: var(--mzmp-navy-900);
    font-size: clamp(27px, 3.2vw, 42px);
    line-height: 1.15;
}

.mzmp-section-heading h3 {
    font-size: clamp(23px, 2.3vw, 31px);
}

.mzmp-section-heading p {
    margin: 6px 0 0;
    color: var(--mzmp-muted);
}

.mzmp-about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, .65fr);
    gap: 22px;
    align-items: start;
}

.mzmp-prose,
.mzmp-about-grid aside {
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid var(--mzmp-line);
    border-radius: var(--mzmp-radius-lg);
    background: #fff;
    box-shadow: var(--mzmp-shadow-sm);
}

.mzmp-prose {
    color: #344054;
    font-size: 17px;
    line-height: 1.95;
}

.mzmp-prose > :first-child,
.mzmp-about-grid aside > :first-child {
    margin-top: 0;
}

.mzmp-prose > :last-child,
.mzmp-about-grid aside > :last-child {
    margin-bottom: 0;
}

.mzmp-about-grid aside {
    position: sticky;
    top: 22px;
    border-top: 4px solid var(--mzmp-gold-500);
}

.mzmp-about-grid aside h3 {
    margin: 0 0 10px;
    color: var(--mzmp-navy-900);
}

.mzmp-about-grid aside p {
    margin: 0;
    color: var(--mzmp-muted);
    line-height: 1.8;
}

.mzmp-media-types {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 26px;
}

.mzmp-media-types button {
    appearance: none;
    display: flex;
    min-height: 105px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 15px;
    background: linear-gradient(145deg, var(--mzmp-navy-900), var(--mzmp-navy-800));
    box-shadow: 0 10px 24px rgba(6, 27, 68, .14);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.mzmp-media-types button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(6, 27, 68, .22);
}

.mzmp-media-types button.is-active {
    border-color: #f0cc82;
    background: linear-gradient(145deg, var(--mzmp-gold-400), var(--mzmp-gold-500));
    box-shadow: 0 15px 32px rgba(182, 122, 24, .26);
    color: var(--mzmp-navy-950);
}

.mzmp-media-types svg {
    width: 31px;
    height: 31px;
}

.mzmp-collection-nav {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0 0 28px;
    padding: 4px 2px 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.mzmp-collection-nav button {
    appearance: none;
    display: flex;
    min-width: 84px;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #4e5b70;
    cursor: pointer;
    font-size: 13px;
}

.mzmp-collection-mark {
    display: grid;
    width: 67px;
    height: 67px;
    place-items: center;
    padding: 10px;
    border: 2px solid #c6d0df;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 5px 14px rgba(6, 27, 68, .07);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.mzmp-collection-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mzmp-collection-mark svg {
    width: 31px;
    height: 31px;
    color: var(--mzmp-navy-700);
}

.mzmp-collection-nav button:hover .mzmp-collection-mark,
.mzmp-collection-nav button.is-active .mzmp-collection-mark {
    border-color: var(--mzmp-gold-500);
    box-shadow: 0 8px 20px rgba(182, 122, 24, .17);
    transform: translateY(-2px);
}

.mzmp-collection-nav button.is-active {
    color: var(--mzmp-navy-900);
}

.mzmp-media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.mzmp-media-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--mzmp-line);
    border-radius: var(--mzmp-radius);
    background: #fff;
    box-shadow: var(--mzmp-shadow-sm);
    animation: mzmp-card-in .28s ease both;
    transition: transform .2s ease, box-shadow .2s ease;
}

.mzmp-media-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--mzmp-shadow);
}

.mzmp-media-card--videos,
.mzmp-media-card--audio {
    grid-column: span 1;
}

.mzmp-photo-card {
    position: relative;
    appearance: none;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #dce4ef;
    color: #fff;
    cursor: zoom-in;
}

.mzmp-photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .38s ease;
}

.mzmp-photo-card:hover img {
    transform: scale(1.035);
}

.mzmp-photo-card span {
    position: absolute;
    inset: auto 0 0;
    padding: 35px 17px 14px;
    background: linear-gradient(transparent, rgba(3, 18, 47, .9));
    font-weight: 800;
    text-align: start;
}

.mzmp-media-card__body {
    display: block;
    min-width: 0;
    padding: 21px;
    color: #364152;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.mzmp-media-card__body h3 {
    margin: 0 0 8px;
    color: var(--mzmp-navy-900);
    font-size: 19px;
    line-height: 1.35;
}

.mzmp-media-card__body p {
    margin: 0 0 12px;
    line-height: 1.75;
}

.mzmp-media-card__body > :last-child {
    margin-bottom: 0;
}

.mzmp-card-icon {
    display: grid;
    width: 45px;
    height: 45px;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 13px;
    background: var(--mzmp-blue-100);
    color: var(--mzmp-navy-700);
}

.mzmp-card-icon svg {
    width: 25px;
    height: 25px;
}

.mzmp-link-card {
    display: grid;
    min-height: 215px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px;
}

.mzmp-link-card > .mzmp-card-icon,
.mzmp-link-card > div {
    grid-column: 1 / -1;
}

.mzmp-link-card small {
    direction: ltr;
    display: block;
    overflow: hidden;
    color: var(--mzmp-muted);
    text-align: start;
    text-overflow: ellipsis;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.mzmp-link-card b {
    color: var(--mzmp-gold-600);
}

.mzmp-quote-mark {
    display: block;
    height: 35px;
    color: var(--mzmp-gold-500);
    font-family: Georgia, serif;
    font-size: 60px;
    line-height: .8;
}

.mzmp-media-card__body blockquote,
blockquote.mzmp-media-card__body {
    margin: 0;
}

.mzmp-media-card audio,
.mzmp-media-card video {
    display: block;
    width: 100%;
}

.mzmp-media-card--videos video {
    aspect-ratio: 16 / 9;
    background: var(--mzmp-navy-950);
    object-fit: contain;
}

.mzmp-embed {
    background: var(--mzmp-navy-950);
}

.mzmp-embed video,
.mzmp-oembed,
.mzmp-oembed iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.mzmp-oembed iframe {
    height: 100%;
    border: 0;
}

/* Memory wall bridge and secondary-editor moderation */
.mzmp-secondary-moderation {
    margin-bottom: 28px;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid #ecd59e;
    border-radius: var(--mzmp-radius-lg);
    background: linear-gradient(145deg, #fffdf8, var(--mzmp-gold-100));
    box-shadow: var(--mzmp-shadow-sm);
}

.mzmp-pending-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.mzmp-pending-memory {
    overflow: hidden;
    border: 1px solid var(--mzmp-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--mzmp-shadow-sm);
    transition: opacity .22s ease, transform .22s ease;
}

.mzmp-pending-memory > img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.mzmp-pending-memory__body {
    padding: 17px;
}

.mzmp-pending-memory__body strong {
    color: var(--mzmp-navy-900);
}

.mzmp-pending-memory__body p {
    margin: 7px 0 15px;
    color: #4c596c;
    line-height: 1.7;
}

.mzmp-memory-wall-bridge .mmw-wrap {
    --mmw-bg: #fff;
    --mmw-card: #fff;
    --mmw-border: var(--mzmp-line);
    --mmw-text: var(--mzmp-ink);
    --mmw-muted: var(--mzmp-muted);
    --mmw-accent: var(--mzmp-navy-900);
    --mmw-gold: var(--mzmp-gold-500);
    --mmw-gold-soft: var(--mzmp-gold-100);
    --mmw-success: var(--mzmp-success);
    --mmw-danger: var(--mzmp-danger);
    margin: 0;
    padding: clamp(22px, 4vw, 38px);
    border: 1px solid var(--mzmp-line);
    border-radius: var(--mzmp-radius-lg);
    background: #fff;
    box-shadow: var(--mzmp-shadow-sm);
    font-family: var(--mzmp-font);
}

.mzmp-memory-wall-bridge .mmw-title {
    color: var(--mzmp-navy-900);
    font-size: clamp(27px, 3vw, 40px);
}

.mzmp-memory-wall-bridge .mmw-toggle-form,
.mzmp-memory-wall-bridge .mmw-submit-btn {
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--mzmp-gold-400), var(--mzmp-gold-500));
    box-shadow: 0 10px 25px rgba(182, 122, 24, .22);
    color: var(--mzmp-navy-950);
    font-family: inherit;
    font-weight: 900;
}

.mzmp-memory-wall-bridge .mmw-card,
.mzmp-memory-wall-bridge .mmw-form-shell,
.mzmp-memory-wall-bridge .mmw-owner-card {
    border-color: var(--mzmp-line);
    box-shadow: var(--mzmp-shadow-sm);
}

.mzmp-memory-wall-bridge .mmw-field input,
.mzmp-memory-wall-bridge .mmw-field textarea {
    min-height: 48px;
    border-color: #cfd8e6;
    font-family: inherit;
}

.mzmp-memory-wall-bridge .mmw-field input:focus,
.mzmp-memory-wall-bridge .mmw-field textarea:focus {
    border-color: var(--mzmp-gold-500);
    box-shadow: 0 0 0 4px rgba(210, 154, 52, .13);
    outline: 0;
}

.mzmp-memory-wall-bridge .mmw-read-toggle {
    color: var(--mzmp-navy-700);
    font-family: inherit;
}

/* Secondary Maglan editors are not recognised as owners by the legacy wall.
 * Their dedicated moderation panel is rendered above, so hide the guest form. */
.mzmp-memory-wall-bridge.is-mzmp-editor .mmw-toggle-form,
.mzmp-memory-wall-bridge.is-mzmp-editor .mmw-form-shell {
    display: none !important;
}

/* Lightbox and non-blocking feedback */
.mzmp-lightbox {
    position: fixed;
    z-index: 999999;
    inset: 0;
    isolation: isolate;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 50px);
    background: rgba(1, 9, 25, .94);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.mzmp-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.mzmp-lightbox__figure {
    position: relative;
    display: grid;
    width: 100%;
    max-width: min(1200px, 100%);
    max-height: 100%;
    margin: 0;
    place-items: center;
    touch-action: pan-y pinch-zoom;
}

.mzmp-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(100svh - 130px);
    border-radius: 12px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.mzmp-lightbox__video {
    display: block;
    width: 100%;
    max-width: min(1200px, 100%);
    max-height: calc(100svh - 130px);
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 12px;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .08), transparent 35%),
        #030914;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
    object-fit: contain;
}

.mzmp-lightbox__image[hidden],
.mzmp-lightbox__video[hidden] {
    display: none !important;
}

.mzmp-lightbox__caption {
    margin-top: 13px;
    color: rgba(255, 255, 255, .88);
    font-weight: 700;
    text-align: center;
}

.mzmp-lightbox__close {
    position: fixed;
    z-index: 10;
    inset: max(12px, env(safe-area-inset-top)) auto auto max(12px, env(safe-area-inset-left));
    appearance: none;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
    backdrop-filter: blur(10px);
}

.mzmp-lightbox__nav {
    position: fixed;
    z-index: 2;
    top: 50%;
    appearance: none;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    padding: 0 0 5px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 42px;
    line-height: 1;
    transform: translateY(-50%);
    backdrop-filter: blur(10px);
    transition: background-color .18s ease, transform .18s ease;
}

.mzmp-lightbox__nav:hover {
    background: rgba(255, 255, 255, .2);
    transform: translateY(-50%) scale(1.05);
}

.mzmp-lightbox__nav--prev {
    left: 18px;
}

.mzmp-lightbox__nav--next {
    right: 18px;
}

/* The viewer follows the page's RTL reading direction: previous is on the
 * right and next is on the left. */
body.mzmp-is-system-page .mzmp-lightbox__nav--prev {
    right: 18px;
    left: auto;
}

body.mzmp-is-system-page .mzmp-lightbox__nav--next {
    right: auto;
    left: 18px;
}

body.mzmp-lightbox-open {
    overflow: hidden;
}

.mzmp-toast-region {
    position: fixed;
    z-index: 999998;
    inset: auto max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) auto;
    display: flex;
    width: min(390px, calc(100vw - 32px));
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.mzmp-toast {
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 13px;
    background: var(--mzmp-navy-950);
    box-shadow: var(--mzmp-shadow-lg);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease;
}

.mzmp-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.mzmp-toast--success {
    background: #075b3a;
}

.mzmp-toast--error {
    background: #8c1d14;
}

@keyframes mzmp-spin {
    to { transform: rotate(360deg); }
}

@keyframes mzmp-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes mzmp-card-in {
    from { opacity: 0; transform: scale(.985) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 1080px) {
    .mzmp-login {
        grid-template-columns: minmax(330px, .8fr) minmax(390px, 1.2fr);
    }

    .mzmp-login__visual {
        padding: 48px;
    }

    .mzmp-profile-hero__content {
        grid-template-columns: 150px minmax(0, 1fr) 96px;
        gap: 22px;
    }

    .mzmp-profile-hero__portrait {
        width: 145px;
        height: 145px;
    }

    .mzmp-profile-hero__unit-mark {
        width: 92px;
        height: 92px;
    }

    .mzmp-media-types {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mzmp-media-types button {
        min-height: 88px;
        flex-direction: row;
    }

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

    .mzmp-navigation-row__form {
        grid-template-columns: minmax(80px, .5fr) minmax(130px, 1.2fr) minmax(115px, 1fr) 72px;
    }

    .mzmp-navigation-row__form .mzmp-button {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

@media (max-width: 782px) {
    body.mzmp-is-system-page.admin-bar {
        min-height: calc(100vh - 46px);
    }

    .mzmp-login {
        display: block;
        min-height: 100svh;
        padding: 0 0 28px;
        background: linear-gradient(180deg, var(--mzmp-navy-950) 0, var(--mzmp-navy-800) 310px, var(--mzmp-canvas) 310px);
    }

    .mzmp-login.mzmp-login--message {
        display: grid;
        place-items: center;
        padding: 24px;
        background: var(--mzmp-canvas);
    }

    .mzmp-login__visual {
        min-height: 310px;
        justify-content: flex-start;
        padding: 34px 24px 85px;
        background: transparent;
        text-align: center;
        align-items: center;
    }

    .mzmp-login__mark {
        width: 72px;
        height: 72px;
        margin-bottom: 15px;
    }

    .mzmp-login__visual h1 {
        margin-bottom: 10px;
        font-size: 34px;
    }

    .mzmp-login__visual p {
        font-size: 15px;
    }

    .mzmp-login__security {
        display: none;
    }

    .mzmp-login__card {
        position: relative;
        z-index: 2;
        width: calc(100% - 32px);
        margin: -58px auto 0;
        padding: 28px 22px;
        border-radius: 22px;
    }

    .mzmp-dashboard {
        width: min(100% - 24px, 1280px);
        padding-top: 12px;
    }

    .mzmp-dashboard__header {
        align-items: flex-start;
        padding: 14px;
    }

    .mzmp-dashboard__brand img {
        width: 45px;
        height: 45px;
    }

    .mzmp-dashboard__brand h1 {
        font-size: 19px;
    }

    .mzmp-dashboard__account {
        align-items: flex-end;
        flex-direction: column;
        gap: 2px;
    }

    .mzmp-dashboard__account > span {
        display: none;
    }

    .mzmp-dashboard__toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .mzmp-dashboard-tabs {
        top: 5px;
        margin-inline: -3px;
    }

    .mzmp-dashboard-tabs button {
        padding-inline: 13px;
    }

    .mzmp-dashboard-columns,
    .mzmp-about-grid,
    .mzmp-navigation-collections {
        grid-template-columns: 1fr;
    }

    .mzmp-navigation-types {
        grid-template-columns: 1fr;
    }

    .mzmp-about-grid aside {
        position: static;
    }

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

    .mzmp-profile__topbar {
        min-height: 62px;
        padding: 8px 14px;
    }

    .mzmp-profile__brand span {
        display: none;
    }

    .mzmp-profile__brand img {
        width: 42px;
        height: 42px;
    }

    .mzmp-profile__topbar .mzmp-button {
        min-height: 38px;
        padding: 8px 14px;
        font-size: 13px;
    }

    .mzmp-profile-hero__cover {
        height: 285px;
    }

    .mzmp-profile-hero__content {
        width: calc(100% - 24px);
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 18px;
        margin-top: -70px;
        padding: 20px;
        border-radius: 21px;
    }

    .mzmp-profile-hero__portrait {
        width: 108px;
        height: 108px;
        border-width: 5px;
        box-shadow: 0 0 0 3px var(--mzmp-gold-500), 0 12px 26px rgba(6, 27, 68, .18);
    }

    .mzmp-profile-hero__identity h1 {
        font-size: 36px;
    }

    .mzmp-profile-hero__identity > p {
        grid-column: 1 / -1;
        font-size: 14px;
    }

    .mzmp-profile-hero__unit-mark {
        position: absolute;
        inset: 14px auto auto 14px;
        width: 62px;
        height: 62px;
        padding: 7px;
    }

    .mzmp-date-row {
        grid-column: 1 / -1;
    }

    .mzmp-profile-nav {
        width: 100%;
        margin-top: 18px;
    }

    .mzmp-profile-nav button {
        min-height: 60px;
        padding: 10px;
        font-size: 14px;
    }

    .mzmp-profile__body {
        width: calc(100% - 24px);
        padding: 34px 0 60px;
    }

    .mzmp-media-types {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .mzmp-media-types button {
        min-height: 70px;
        padding: 10px;
        font-size: 13px;
    }

    .mzmp-media-types svg {
        width: 24px;
        height: 24px;
    }

    .mzmp-media-grid,
    .mzmp-pending-grid {
        grid-template-columns: 1fr;
    }

    .mzmp-memory-wall-bridge .mmw-hero,
    .mzmp-memory-wall-bridge .mmw-form-header {
        align-items: stretch;
    }
}

@media (max-width: 560px) {
    .mzmp-login__step h2 {
        font-size: 27px;
    }

    .mzmp-dashboard__brand .mzmp-eyebrow {
        font-size: 9px;
    }

    .mzmp-dashboard__toolbar .mzmp-inline-actions,
    .mzmp-dashboard__toolbar .mzmp-button {
        width: 100%;
    }

    .mzmp-card {
        padding: 18px 15px;
        border-radius: 15px;
    }

    .mzmp-form-grid,
    .mzmp-upload-grid {
        grid-template-columns: 1fr;
    }

    .mzmp-navigation-type-row {
        grid-template-columns: 42px minmax(0, 1fr) 74px;
        padding: 10px;
    }

    .mzmp-navigation-add,
    .mzmp-navigation-list {
        padding: 14px;
    }

    .mzmp-navigation-row {
        grid-template-columns: 38px minmax(0, 1fr) 36px;
        align-items: start;
    }

    .mzmp-navigation-row__form {
        grid-template-columns: 1fr 78px;
    }

    .mzmp-navigation-row__form .mzmp-navigation-parent,
    .mzmp-navigation-row__form .mzmp-field:nth-of-type(2),
    .mzmp-navigation-row__form .mzmp-form-status,
    .mzmp-navigation-row__form .mzmp-button {
        grid-column: 1 / -1;
    }

    .mzmp-navigation-row__form .mzmp-form-status {
        grid-row: auto;
    }

    .mzmp-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .mzmp-form-footer .mzmp-button {
        width: 100%;
    }

    .mzmp-content-row,
    .mzmp-editor-row {
        gap: 9px;
        padding: 10px;
    }

    .mzmp-content-row strong,
    .mzmp-editor-row strong {
        max-width: 170px;
        font-size: 13px;
    }

    .mzmp-dashboard-tabs button {
        min-height: 42px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .mzmp-profile-hero__cover {
        height: 235px;
    }

    .mzmp-profile-hero__content {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 13px;
        margin-top: -54px;
        padding: 16px;
    }

    .mzmp-profile-hero__portrait {
        width: 92px;
        height: 92px;
        flex: 0 0 92px;
    }

    .mzmp-profile-hero__identity {
        min-width: 0;
        flex: 1 1 170px;
        padding-inline-end: 50px;
    }

    .mzmp-profile-hero__identity .mzmp-eyebrow {
        max-width: calc(100% - 52px);
        font-size: 9px;
    }

    .mzmp-profile-hero__identity h1 {
        font-size: 29px;
    }

    .mzmp-profile-hero__identity > p,
    .mzmp-date-row {
        width: 100%;
        flex-basis: 100%;
    }

    .mzmp-date-row > span {
        min-width: 0;
        flex: 1 1 130px;
    }

    .mzmp-profile-hero__unit-mark {
        width: 54px;
        height: 54px;
    }

    .mzmp-profile-nav button {
        flex-direction: column;
        gap: 3px;
        font-size: 12px;
    }

    .mzmp-profile-nav svg {
        width: 20px;
        height: 20px;
    }

    .mzmp-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .mzmp-prose,
    .mzmp-about-grid aside {
        padding: 21px 18px;
        border-radius: 18px;
    }

    .mzmp-prose {
        font-size: 15px;
    }

    .mzmp-media-types button {
        align-items: center;
        flex-direction: column;
    }

    .mzmp-collection-nav {
        gap: 7px;
    }

    .mzmp-collection-mark {
        width: 58px;
        height: 58px;
    }

    .mzmp-memory-wall-bridge .mmw-wrap {
        margin-inline: 0;
        padding: 17px;
        border-radius: 18px;
    }

    .mzmp-lightbox {
        padding: max(10px, env(safe-area-inset-top)) 8px max(76px, env(safe-area-inset-bottom));
    }

    .mzmp-lightbox__figure {
        max-width: 100%;
    }

    .mzmp-lightbox__image,
    .mzmp-lightbox__video {
        max-height: calc(100svh - 150px);
        border-radius: 8px;
    }

    .mzmp-lightbox__caption {
        max-width: calc(100vw - 24px);
        overflow: hidden;
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mzmp-lightbox__nav {
        top: auto;
        bottom: 18px;
        width: 44px;
        height: 44px;
        font-size: 34px;
        transform: none;
    }

    .mzmp-lightbox__nav:hover {
        transform: scale(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    html:has(body.mzmp-is-system-page) {
        scroll-behavior: auto;
    }

    .mzmp-system-page *,
    .mzmp-system-page *::before,
    .mzmp-system-page *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media print {
    .mzmp-profile__topbar,
    .mzmp-profile-nav,
    .mzmp-media-types,
    .mzmp-collection-nav,
    .mzmp-button,
    .mmw-toggle-form,
    .mmw-form-shell {
        display: none !important;
    }

    .mzmp-profile__body,
    .mzmp-profile-hero__content {
        width: 100%;
    }

    .mzmp-profile-section[hidden],
    .mzmp-media-card[hidden] {
        display: block !important;
    }
}
