/* ===== Design tokens (copy to next pages) ===== */
.nd-page{
    --bg: #F7F8FC;
    --surface: #ffffff;
    --text: #111214;
    --muted: rgba(17,18,20,.58);

    --ink: #121316;
    --line: rgba(17,18,20,.10);

    --p1: #5B6CFF;
    --p2: #FF5BC8;

    --radius-xl: 26px;
    --radius-lg: 18px;

    --shadow-1: 0 18px 60px rgba(17,18,20,.14);
    --shadow-2: 0 10px 32px rgba(17,18,20,.12);
    --shadow-soft: 0 16px 40px rgba(91,108,255,.18);

    min-height: 100vh;
    background: radial-gradient(900px 500px at 70% 40%, rgba(91,108,255,.10), transparent 60%),
    radial-gradient(800px 500px at 85% 65%, rgba(255,91,200,.10), transparent 60%),
    var(--bg);
    color: var(--text);
    overflow-x: clip;
    font-family: "Quicksand", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.nd-container{
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ===== Nav ===== */
.nd-nav{
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    background: rgba(247,248,252,.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(17,18,20,.06);
    transition: box-shadow .25s ease;
}
.nd-nav:hover{
    box-shadow: 0 4px 24px rgba(17,18,20,.06);
}
.nd-nav-inner{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    height: 64px;
}

.nd-brand{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.nd-brand-mark{
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
}
.nd-brand-mark svg{ width: 36px; height: 36px; }
.nd-brand-logo{ width: 34px; height: 34px; border-radius: 8px; object-fit: contain; }
.nd-brand-text{ display: grid; gap: 2px; }
.nd-brand-name{ font-weight: 800; font-size: 1rem; letter-spacing: -.2px; color: rgba(17,18,20,.88); }

.nd-menu{ margin-left: auto; }
.nd-burger{
    display:none;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
}
.nd-burger span{
    display:block;
    height: 2px;
    width: 22px;
    background: rgba(17,18,20,.70);
    margin: 5px auto;
    border-radius: 999px;
    transition: all .2s ease;
}

.nd-menu-links{
    display: flex;
    align-items: center;
    gap: 24px;
}
.nd-menu-spacer{ width: 12px; }

.nd-link{
    position: relative;
    text-decoration: none;
    color: rgba(17,18,20,.58);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: color .18s ease;
}
.nd-link::after{
    content:'';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--p1), var(--p2));
    transition: width .25s ease;
}
/* Hover-only decoration — guarded so a tap on touch devices doesn't leave
   the link "stuck" highlighted until the next tap elsewhere. */
@media (hover: hover){
    .nd-link:hover{ color: rgba(17,18,20,.92); }
    .nd-link:hover::after{ width: 100%; }
}

.nd-link-login{
    color: rgba(17,18,20,.65);
    font-weight: 800;
}

.nd-link-cta{
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 20px;
    border-radius: 999px;
    color: white !important;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: .08em;
    background: linear-gradient(135deg, var(--p1), var(--p2));
    box-shadow: 0 8px 24px rgba(91,108,255,.18);
    transition: transform .18s ease, box-shadow .18s ease;
}
@media (hover: hover){
    .nd-link-cta:hover{
        transform: translateY(-1px);
        box-shadow: 0 12px 30px rgba(91,108,255,.28);
    }
}
.nd-link-cta::after{ display: none; }

.nd-nav-signout{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 10px;
    border: none;
    background: rgba(239,68,68,.08);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    font-size: 0.8125rem;
    color: rgba(239,68,68,.85);
    transition: background .15s, color .15s;
}
.nd-nav-signout:hover{
    background: rgba(239,68,68,.16);
    color: #dc2626;
}

/* ===== Footer (adapted) ===== */
.nd-footer{
    margin-top: 0;
    background:
        radial-gradient(900px 400px at 15% 10%, rgba(91,108,255,.14), transparent 55%),
        radial-gradient(900px 400px at 85% 0%, rgba(255,91,200,.10), transparent 55%),
        #0D1020;
    color: rgba(255,255,255,.82);
    padding: 44px 0 24px;
    border-top: 1px solid rgba(91,108,255,.12);
}
.nd-footer-top{
    display:flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: space-between;
}
.nd-footer-brand{
    min-width: 240px;
    max-width: 280px;
}
.nd-footer-logo{
    display:flex;
    align-items:center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -.2px;
}
.nd-footer-tagline{
    margin-top: 10px;
    max-width: 280px;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: rgba(255,255,255,.50);
}
.nd-footer-company{
    margin-top: 14px;
    font-size: 0.75rem;
    line-height: 1.7;
    color: rgba(255,255,255,.45);
}
.nd-footer-company strong{
    color: rgba(255,255,255,.65);
}
.nd-footer-logo-img{
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}
.nd-social{
    margin-top: 18px;
    display:flex;
    gap: 8px;
}
.nd-social-ic{
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display:grid;
    place-items:center;
    text-decoration:none;
    color: rgba(255,255,255,.65);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    font-size: 0.875rem;
    transition: all .2s ease;
}
.nd-social-ic:hover{
    background: rgba(91,108,255,.20);
    border-color: rgba(91,108,255,.30);
    color: rgba(255,255,255,.95);
    transform: translateY(-2px);
}

.nd-footer-cols{
    display:flex;
    gap: 50px;
}
.nd-footer-col{ display:grid; gap: 10px; align-content: start; }
.nd-footer-title{
    font-weight: 800;
    font-size: 0.8125rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255,255,255,.92);
    margin-bottom: 4px;
}
.nd-footer-link{
    text-decoration:none;
    color: rgba(255,255,255,.55);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: color .18s ease;
}
@media (hover: hover){
    .nd-footer-link:hover{ color: rgba(255,255,255,.95); }
}

.nd-footer-divider{
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
    margin: 28px 0 20px;
}

.nd-footer-bottom{
    display:flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
}
.nd-footer-copy{
    max-width: 500px;
    font-size: 0.75rem;
    line-height: 1.55;
    color: rgba(255,255,255,.40);
}
.nd-footer-copy-muted{
    display:block;
    margin-top: 4px;
    color: rgba(255,255,255,.30);
}

.nd-footer-actions{
    display:flex;
    align-items:center;
    gap: 14px;
}
.nd-lang{
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.70);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    transition: all .18s ease;
}
.nd-lang:hover{
    border-color: rgba(255,255,255,.20);
    background: rgba(255,255,255,.08);
}
.nd-pay{
    display:flex;
    gap: 6px;
    align-items:center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nd-pay-pill{
    width: 38px;
    height: 26px;
    border-radius: 6px;
    display:grid;
    place-items:center;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.60);
    font-size: 0.9375rem;
}

.nd-auth-terms{
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    font-size: .85rem;
    color: rgba(17,18,20,.68);
    cursor: pointer;
    line-height: 1.4;
}
.nd-auth-terms input[type="checkbox"]{
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--p1, #5B6CFF);
    cursor: pointer;
    flex-shrink: 0;
}
.nd-auth-terms a{
    color: var(--p1, #5B6CFF);
    text-decoration: underline;
    font-weight: 600;
}
.nd-auth-terms a:hover{ color: var(--p2, #FF5BC8); }

.nd-auth-error{
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,91,200,.28);
    background: rgba(255,91,200,.10);
    color: rgba(17,18,20,.78);
    font-weight: 700;
    font-size: 0.75rem;
}

/* ===== Common (adapted) ===== */
.nd-hero{
    padding: 28px 0 0;
}

.nd-hero-inner{
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 28px;
    align-items: start;
}

/* ===== Responsive ===== */
@media (max-width: 980px){
    .nd-hero{ padding-top: 14px; }

    .nd-pm-head{ display: none; }

    .nd-hero-inner{
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .nd-footer-top{
        flex-direction: column;
        gap: 28px;
    }
    .nd-footer-cols{
        gap: 36px;
        flex-wrap: wrap;
    }
    .nd-footer-bottom{
        flex-direction: column;
        align-items: flex-start;
    }
    .nd-pay{ justify-content: flex-start; }
}

@media (max-width: 760px){
    .nd-container{ padding-inline: 18px; }

    .nd-burger{ display:block; }
    .nd-menu-links{
        position: fixed;
        right: 14px;
        top: 72px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        background: rgba(255,255,255,.96);
        border: 1px solid rgba(17,18,20,.08);
        border-radius: 20px;
        padding: 12px;
        box-shadow: 0 20px 60px rgba(17,18,20,.18);
        display: none;
        min-width: 240px;
        backdrop-filter: blur(14px);
        z-index: 200;
    }
    .nd-menu-links.is-open{ display:flex; }
    .nd-menu-spacer{ display:none; }
    .nd-menu-links .nd-link{
        padding: 10px 14px;
        border-radius: 12px;
        font-size: 0.875rem;
    }
    .nd-menu-links .nd-link::after{ display:none; }
    .nd-menu-links .nd-link-cta{
        height: 44px;
        justify-content: center;
        border-radius: 14px;
        margin-top: 4px;
    }
    .nd-menu-links .nd-nav-signout{
        height: 44px;
        justify-content: center;
        border-radius: 14px;
        width: 100%;
    }

    .nd-footer-cols{
        flex-direction: column;
        gap: 22px;
    }
    .nd-footer-brand{ min-width: auto; }
}
@media (max-width: 760px) and (hover: hover){
    .nd-menu-links .nd-link:hover{
        background: rgba(91,108,255,.06);
    }
}

/* ===== Shared info-page layout ===== */
.nd-info-page{
    padding: 40px 0 60px;
}
.nd-info-hero{
    text-align: center;
    padding-bottom: 36px;
}
.nd-info-hero h1{
    margin: 0;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 900;
    letter-spacing: -.02em;
    color: rgba(17,18,20,.92);
}
.nd-info-hero p{
    margin: 12px auto 0;
    max-width: 560px;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: rgba(17,18,20,.50);
}
.nd-info-kicker{
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(91,108,255,.90);
}
.nd-info-body{
    max-width: 800px;
    margin: 0 auto;
}
.nd-info-section{
    margin-bottom: 28px;
}
.nd-info-section h2{
    margin: 0 0 12px;
    font-size: 1.375rem;
    font-weight: 800;
    color: rgba(17,18,20,.88);
}
.nd-info-section h3{
    margin: 0 0 8px;
    font-size: 1.0625rem;
    font-weight: 800;
    color: rgba(17,18,20,.82);
}
.nd-info-section p,
.nd-info-section ul,
.nd-info-section ol{
    margin: 0 0 12px;
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(17,18,20,.55);
}
.nd-info-section ul{ padding-left: 20px; }
.nd-info-section li{ margin-bottom: 6px; }
.nd-info-placeholder{
    padding: 32px 24px;
    border-radius: 18px;
    border: 2px dashed rgba(17,18,20,.12);
    background: rgba(91,108,255,.03);
    text-align: center;
    color: rgba(17,18,20,.35);
    font-weight: 700;
    font-size: 0.875rem;
}
.nd-info-updated{
    text-align: center;
    font-size: 0.75rem;
    color: rgba(17,18,20,.40);
    margin-bottom: 28px;
}

/* Info page mobile */
@media (max-width: 760px){
    .nd-info-page{
        padding: 24px 0 40px;
    }
    .nd-info-hero{
        padding-bottom: 24px;
    }
    .nd-info-hero p{
        font-size: 0.875rem;
    }
    .nd-info-placeholder{
        padding: 24px 16px;
        font-size: 0.8125rem;
    }
    .nd-info-section h2{
        font-size: 1.1875rem;
    }
}

/* ===== Profile header ===== */
.nd-ph{
    position: relative;
    padding: 16px 0 10px;
    background: rgba(255,255,255,.72);
    border-bottom: 1px solid rgba(17,18,20,.08);
    backdrop-filter: blur(10px);
}
.nd-ph-inner{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 14px;
}
.nd-ph-left{
    display:flex;
    align-items:center;
    gap: 14px;
    min-width: 0;
}
.nd-ph-brand{
    display:flex;
    align-items:center;
    gap: 10px;
    min-width: 0;
    cursor:pointer;
    text-decoration:none;
    color: inherit;
}
.nd-ph-brand-text{
    font-weight: 900;
    letter-spacing: .2px;
    color: rgba(17,18,20,.86);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.nd-ph-search{
    position: relative;
    width: min(420px, 52vw);
    min-width: 160px;
}
.nd-ph-search-input{
    width: 100%;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(17,18,20,.12);
    background: rgba(255,255,255,.85);
    padding: 0 44px 0 14px;
    outline: none;
    font-weight: 700;
    color: rgba(17,18,20,.80);
}
.nd-ph-search-ic{
    position:absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(17,18,20,.45);
    font-weight: 900;
}
.nd-ph-signout{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: none;
    background: rgba(239,68,68,.08);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8125rem;
    color: rgba(239,68,68,.85);
    transition: background .15s, color .15s;
}
.nd-ph-signout:hover{
    background: rgba(239,68,68,.16);
    color: #dc2626;
}
.nd-ph-signout-icon{
    font-size: 0.875rem;
}
.nd-ph-signout-text{}
@media (max-width: 760px){
    .nd-ph-search{ display:none; } /* на мобиле как у топ проектов — убираем */
}



.nd-profile-loading{
    display:grid;
    place-items:center;
    gap: 12px;
    padding: 38px 0;
}
.nd-profile-loading-text{
    font-weight: 900;
    color: rgba(17,18,20,.60);
    font-size: 0.75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nd-profile-empty{
    display: grid;
    place-items: center;
    gap: 6px;
    text-align: center;
    padding: 48px 24px;
    border-radius: var(--radius-xl);
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(17,18,20,.08);
    box-shadow: var(--shadow-2);
    color: rgba(17,18,20,.55);
}
.nd-profile-empty h3{
    margin: 0;
    font-weight: 900;
    font-size: 1.125rem;
    color: rgba(17,18,20,.80);
}

.nd-pm{ min-width: 0; }
.nd-pm-head{ padding: 6px 4px 10px; }
.nd-pm-title{ margin:0; font-size: 1.625rem; line-height: 1.15; font-weight: 900; letter-spacing: -.3px; color: rgba(17,18,20,.90); }
.nd-pm-sub{ margin-top: 6px; font-size: 0.8125rem; color: rgba(17,18,20,.65); }

.nd-pm-card{
    border-radius: var(--radius-xl);
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(17,18,20,.10);
    box-shadow: var(--shadow-2);
    padding: 16px;
    min-width: 0;
}

.nd-save{
    height: 48px;
    padding: 0 48px;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(90deg, var(--p1), var(--p2));
    color: #fff;
    font-weight: 900;
    font-size: 0.9375rem;
    cursor: pointer;
    box-shadow: 0 16px 40px rgba(91,108,255,.22);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.nd-save:hover{
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 20px 52px rgba(91,108,255,.28);
}
.nd-save:active{ transform: translateY(0); }
.nd-save:disabled{ opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }

.nd-pm-form{ display:grid; gap: 14px; }

.nd-pm-row{ display:grid; gap: 8px; }
.nd-pm-label{ font-weight: 900; font-size: 0.75rem; color: rgba(17,18,20,.70); }

/* ===== Input baseline (global) ===== */
.nd-auth-input{
    width: 100%;
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(17,18,20,.12);
    background: rgba(255,255,255,.85);
    padding: 0 14px;
    outline: none;
    font-weight: 800;
    color: rgba(17,18,20,.78);
}
.nd-auth-input:focus{
    border-color: rgba(91,108,255,.45);
    box-shadow: 0 0 0 6px rgba(91,108,255,.10);
}

/* ===== Profile lock popup ===== */
.nd-warn-overlay{
    position: fixed;
    inset: 0;
    background: rgba(13,16,32,.45);
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    z-index: 1200;
}

.nd-warn-modal{
    width: min(420px, calc(100% - 32px));
    background: #fff;
    border-radius: 26px;
    padding: 26px 24px 24px;
    box-shadow: 0 30px 90px rgba(17,18,20,.25);
    animation: nd-warn-in .25s ease-out;
}

@keyframes nd-warn-in{
    from{
        opacity: 0;
        transform: translateY(10px) scale(.96);
    }
    to{
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.nd-warn-title{
    font-size: 1.125rem;
    font-weight: 900;
    color: rgba(17,18,20,.92);
}

.nd-warn-text{
    margin-top: 10px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(17,18,20,.55);
}

.nd-warn-actions{
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.nd-warn-btn{
    height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    font-weight: 900;
    font-size: 0.8125rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nd-warn-btn-primary{
    color: #fff;
    background: linear-gradient(90deg, var(--p1), var(--p2));
    box-shadow: var(--shadow-soft);
}

.nd-warn-btn-primary:hover{
    transform: translateY(-1px);
}

.nd-warn-btn-primary:active{
    transform: translateY(0);
}

/* mobile */
@media (max-width: 480px){
    .nd-warn-modal{
        padding: 22px 18px 20px;
    }
    .nd-warn-title{
        font-size: 1rem;
    }
}


.nd-pm-actions{
    display:flex;
    justify-content:center;
    padding-top: 6px;
}


/* ===== Auth modal ===== */
.nd-modal-open{
    overflow: hidden;
}

.nd-modal-open .nd-nav,
.nd-modal-open .nd-hero,
.nd-modal-open .nd-footer{
    filter: blur(10px);
    transform: translateZ(0);
    transition: filter .18s ease;
}

.nd-auth-overlay{
    position: fixed;
    overflow: auto;
    overscroll-behavior: contain;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(13,16,32,.38);
    backdrop-filter: blur(10px);
}
/* On phones: prevent top-clipping when modal is taller than viewport */
@media (max-width: 560px){
    .nd-auth-overlay{
        padding: 6px;
        align-items: start;
    }
    .nd-auth-overlay > .nd-topup-modal,
    .nd-auth-overlay > .nd-auth-modal{
        margin: auto;
    }
    /* Hide decorative glow on phones — saves GPU/battery */
    .nd-auth-glow{ display: none; }
    /* Auth modal: less border-radius on phones */
    .nd-auth-modal{
        width: min(520px, calc(100vw - 16px));
        border-radius: 20px;
    }
}

.nd-auth-glow{
    position: absolute;
    width: min(720px, 92vw);
    height: min(720px, 92vw);
    border-radius: 999px;
    background:
            radial-gradient(circle at 30% 30%, rgba(91,108,255,.30), transparent 60%),
            radial-gradient(circle at 70% 60%, rgba(255,91,200,.26), transparent 62%);
    filter: blur(10px);
    opacity: .9;
}

.nd-auth-modal{
    position: relative;
    width: min(520px, 92vw);
    border-radius: 26px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(17,18,20,.10);
    box-shadow: var(--shadow-1);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.nd-auth-x{
    position: absolute;
    right: 12px;
    top: 10px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.75);
    cursor: pointer;
    font-size: 1.375rem;
    line-height: 0;
    color: rgba(17,18,20,.75);
}

.nd-auth-head{
    padding: 20px 20px 0;
}
.nd-auth-title{
    font-weight: 900;
    letter-spacing: -.3px;
    font-size: 1.25rem;
    color: rgba(17,18,20,.90);
}
.nd-auth-sub{
    margin-top: 6px;
    font-size: 0.75rem;
    color: rgba(17,18,20,.55);
}
.nd-auth-progress{
    margin-top: 12px;
    height: 10px;
    border-radius: 999px;
    background: rgba(17,18,20,.08);
    overflow: hidden;
}
.nd-auth-progress span{
    display:block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--p1), var(--p2));
    box-shadow: var(--shadow-soft);
}

.nd-auth-body{
    padding: 16px 20px 8px;
}
.nd-auth-label{
    font-weight: 800;
    font-size: 0.75rem;
    color: rgba(17,18,20,.80);
    margin-bottom: 8px;
}
.nd-auth-input{
    width: 100%;
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(17,18,20,.12);
    background: rgba(255,255,255,.85);
    padding: 0 14px;
    outline: none;
    font-weight: 700;
    color: rgba(17,18,20,.86);
}
.nd-auth-input:focus{
    border-color: rgba(91,108,255,.45);
    box-shadow: 0 0 0 6px rgba(91,108,255,.12);
}

.nd-auth-btn{
    width: min(340px, 100%);
    height: 48px;
    border-radius: 14px;
    border: 0;
    cursor:pointer;
    color: white;
    font-weight: 900;
    background: linear-gradient(90deg, var(--p1), var(--p2));
    box-shadow: 0 16px 40px rgba(91,108,255,.22);
}
.nd-auth-btn:disabled{ opacity: .55; cursor:not-allowed; }

.nd-auth-btn i{
    margin-right: 8px;
}

.nd-auth-actions{
    padding: 12px 50px 14px;
    display: grid;
    gap: 12px;
}

.nd-auth-actions-one-action{
    padding: 12px 20px 14px;
    display: grid;
    gap: 12px;
}
/* ===== Shared Layout (Authorized/FakeAuthorized) ===== */
.nd-auth-side{
    position: sticky;
    top: 18px;
    align-self: start;
}

.nd-profile{ padding-top: 20px; padding-bottom: 24px; }

.nd-profile-grid{
    display:grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

@media (max-width: 980px){
    .nd-auth-side{
        position: relative;
        top: 0;
    }

    .nd-profile-grid{ grid-template-columns: 1fr; }
}

.nd-page.nd-modal-open{
    height: 100dvh;
    overflow: hidden;
}

/* ===== Shared Profile Form (Profile/FakeProfile) ===== */



.nd-readonly{
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(17,18,20,.04);
    display:flex;
    align-items:center;
    padding: 0 14px;
    font-weight: 800;
    color: rgba(17,18,20,.70);
}

.nd-upload{
    display:grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    align-items: start;
}
.nd-upload-box{
    height: 120px;
    border-radius: 18px;
    border: 2px dashed rgba(17,18,20,.18);
    background: rgba(247,248,252,.80);
    display:grid;
    place-items:center;
    cursor:pointer;
    position: relative;
}
.nd-upload-box input{ position:absolute; inset:0; opacity:0; cursor:pointer; }
.nd-upload-ic{ font-size: 1.375rem; }
.nd-upload-txt{ font-weight: 900; color: rgba(17,18,20,.65); font-size: 0.75rem; }
.nd-upload-box.is-error{ border-color: rgba(255,91,200,.60); background: rgba(255,91,200,.06); }
.nd-upload-hint{ font-size: 0.75rem; line-height: 1.45; color: rgba(17,18,20,.50); }
.nd-upload-err{ margin-top: 8px; color: rgba(255,91,200,.95); font-weight: 900; }

.nd-dob2{
    display:grid;
    grid-template-columns: 120px 1fr 140px;
    gap: 10px;
}
.nd-select{
    width: 100%;
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(17,18,20,.12);
    background: rgba(255,255,255,.85);
    padding: 0 40px 0 12px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 900;
    color: rgba(17,18,20,.75);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='14'%20height='14'%20viewBox='0%200%2020%2020'%3E%3Cpath%20d='M5.8%207.6%2010%2011.8l4.2-4.2%201.4%201.4-5.6%205.6L4.4%209z'%20fill='rgba(17,18,20,.65)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.nd-select:focus{
    border-color: rgba(91,108,255,.55);
    box-shadow: 0 0 0 6px rgba(91,108,255,.12);
}
.nd-select:hover{
    border-color: rgba(91,108,255,.30);
}
.nd-select::-ms-expand{
    display: none;
}

.nd-toggle{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.nd-toggle-btn{
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(17,18,20,.12);
    background: rgba(255,255,255,.80);
    cursor:pointer;
    font-weight: 900;
    color: rgba(17,18,20,.65);
}
.nd-toggle-btn.is-on{
    border-color: rgba(91,108,255,.55);
    box-shadow: 0 0 0 6px rgba(91,108,255,.12);
    color: rgba(91,108,255,.95);
}

.nd-age{
    display:grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 10px;
    align-items:center;
}
.nd-age-cap{ font-weight: 900; font-size: 0.75rem; color: rgba(17,18,20,.55); }

.nd-textarea{
    min-height: 120px;
    border-radius: 16px;
    border: 1px solid rgba(17,18,20,.12);
    background: rgba(255,255,255,.85);
    padding: 12px 14px;
    font-weight: 800;
    color: rgba(17,18,20,.78);
    outline: none;
    resize: vertical;
}

.nd-check{
    display:flex;
    gap: 10px;
    align-items:flex-start;
    font-size: 0.75rem;
    color: rgba(17,18,20,.55);
}
.nd-check a{ color: rgba(91,108,255,.95); font-weight: 900; text-decoration:none; }


/* ===== Field validation UX ===== */
.nd-field-error{
    font-size: 0.75rem;
    font-weight: 900;
    color: rgba(255,91,200,.95);
}

.nd-field-invalid{
    border-color: rgba(255,91,200,.55) !important;
    box-shadow: 0 0 0 6px rgba(255,91,200,.12) !important;
}

.nd-about-meta{
    display:flex;
    align-items:center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(17,18,20,.45);
}
.nd-about-count{
    font-weight: 900;
    letter-spacing: .08em;
}

/* ===== Photos (up to 7) ===== */
.nd-photos{ display:grid; gap: 10px; }

.nd-photo-add{
    height: 120px;
    border-radius: 18px;
    border: 2px dashed rgba(17,18,20,.18);
    background: rgba(247,248,252,.80);
    display:grid;
    place-items:center;
    cursor:pointer;
    position: relative;
}

.nd-file-input{
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.nd-photo-add input{
    position:absolute;
    inset:0;
    opacity:0;
    cursor:pointer;
}
.nd-photo-add-ic{
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display:grid;
    place-items:center;
    font-weight: 900;
    color: rgba(91,108,255,.95);
    background: rgba(91,108,255,.10);
}
.nd-photo-add-txt{
    margin-top: 6px;
    font-weight: 900;
    font-size: 0.75rem;
    color: rgba(17,18,20,.60);
}
.nd-photo-add.is-error{
    border-color: rgba(255,91,200,.60);
    background: rgba(255,91,200,.06);
}

.nd-photo-grid{
    display:grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.nd-photo{
    position: relative;
    border: 0;
    padding: 0;
    border-radius: 18px;
    overflow:hidden;
    cursor:pointer;
    background: rgba(17,18,20,.06);
    aspect-ratio: 1 / 1;
    min-height: 160px;
    border: 1px solid rgba(17,18,20,.10);
    box-shadow: 0 10px 28px rgba(17,18,20,.08);
}
.nd-photo img{
    width:100%;
    height:100%;
    object-fit: cover;
    display:block;
}
.nd-photo-badge{
    position:absolute;
    left: 8px;
    bottom: 8px;
    font-size: 0.625rem;
    font-weight: 900;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    color: rgba(17,18,20,.70);
    border: 1px solid rgba(17,18,20,.10);
}
.nd-photo.is-avatar{
    border-color: rgba(91,108,255,.60);
    box-shadow: 0 0 0 6px rgba(91,108,255,.10);
}
.nd-photo.is-avatar .nd-photo-badge{
    background: linear-gradient(90deg, rgba(91,108,255,.92), rgba(255,91,200,.92));
    color: white;
    border: 0;
}
.nd-photo-remove{
    position:absolute;
    right: 6px;
    top: 6px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display:grid;
    place-items:center;
    background: rgba(13,16,32,.55);
    color: rgba(255,255,255,.92);
    font-weight: 900;
    line-height: 1;
}

@media (max-width: 980px){
    .nd-photo-grid{ grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .nd-photo{ min-height: 180px; }
}
@media (max-width: 560px){
    .nd-photo-grid{ grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .nd-photo{ min-height: 150px; border-radius: 16px; }
}




/* ===== Shared Sidebar (ProfileSidebar/ProfileFakeSidebar) ===== */
.nd-ps-card{
    border-radius: var(--radius-xl);
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(17,18,20,.10);
    box-shadow: var(--shadow-2);
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.nd-ps-avatar{
    width: 112px;
    height: 112px;
    border-radius: 999px;
    overflow:hidden;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(17,18,20,.06);
    display: grid;
    place-items: center;
    margin: auto;
}
.nd-ps-avatar img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.nd-ps-avatar-ph{
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: rgba(17,18,20,.35);
    font-size: 2.125rem;
}

@media (max-width: 760px){
    .nd-ps-avatar{
        width: 96px;
        height: 96px;
    }
}

/* ── Wallet card ────────────────────────────── */
.nd-ps-wallet{
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(91,108,255,.07) 0%, rgba(255,91,200,.05) 100%);
    border: 1px solid rgba(91,108,255,.12);
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
}
.nd-ps-wallet:hover{
    border-color: rgba(91,108,255,.25);
    box-shadow: 0 4px 20px rgba(91,108,255,.08);
}
.nd-ps-wallet-info{
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.nd-ps-wallet-label{
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(17,18,20,.40);
}
.nd-ps-wallet-val{
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 900;
    font-size: 1.25rem;
    color: rgba(17,18,20,.88);
    line-height: 1.1;
}
.nd-ps-wallet-ic{
    font-size: 1rem;
    color: var(--p1);
}
.nd-ps-wallet-unit{
    font-size: 0.8125rem;
    font-weight: 700;
    color: rgba(17,18,20,.40);
    align-self: flex-end;
    margin-bottom: 1px;
}

.nd-ps-topup{
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    border: 0;
    background: linear-gradient(135deg, var(--p1), var(--p2));
    color: white;
    font-weight: 800;
    font-size: 0.8125rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(91,108,255,.20);
    transition: transform .18s ease, box-shadow .18s ease;
}
.nd-ps-topup:hover{
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(91,108,255,.30);
}
.nd-ps-topup:active{
    transform: translateY(0);
}
.nd-ps-topup i{
    font-size: 0.6875rem;
}

.nd-ps-nav{ margin-top: 18px; display:grid; gap: 8px; }

.nd-search-cta{
    width: 100%;
    border: 0;
    border-radius: 18px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    margin-bottom: 14px;

    color: #fff;
    background: linear-gradient(90deg, var(--p1), var(--p2));
    box-shadow: 0 18px 40px rgba(91,108,255,.22);
    position: relative;
    overflow: hidden;
}

/* animated glow */
.nd-search-cta::before{
    content:"";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 30% 40%, rgba(255,255,255,.28), transparent 55%);
    transform: translateX(-10%);
    opacity: .8;
    pointer-events: none;
}

.nd-search-cta:hover{
    transform: translateY(-1px);
    box-shadow: 0 22px 54px rgba(91,108,255,.28);
}

/* ===== Search ACTIVE (clean & premium) ===== */
.nd-search-cta.is-active{
    transform: none;
    filter: saturate(1.1);
    box-shadow:
            0 26px 64px rgba(91,108,255,.32);
}

@media (prefers-reduced-motion: no-preference){
    .nd-search-cta.is-active{
        animation: nd-search-active-breathe 3.2s ease-in-out infinite;
    }

    @keyframes nd-search-active-breathe{
        0%,100%{ filter: saturate(1.08); }
        50%{ filter: saturate(1.18); }
    }
}


.nd-search-cta-ic{
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22);
}

.nd-search-cta-ic i{
    font-size: 1rem;
    color: rgba(255,255,255,.95);
}

.nd-search-cta-txt{
    display: grid;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.nd-search-cta-title{
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1.1;
}

.nd-search-cta-sub{
    font-size: 0.75rem;
    opacity: .85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nd-search-cta-arrow i{
    font-size: 1rem;
    font-weight: 900;
    opacity: .95;
    transition: transform .25s ease;
}

.nd-search-cta:hover .nd-search-cta-arrow i{
    transform: translateX(3px);
}

@media (prefers-reduced-motion: no-preference){
    .nd-search-cta-arrow i{
        animation: nd-arrow-pulse 1.6s ease-in-out infinite;
    }

    @keyframes nd-arrow-pulse{
        0%,100%{ transform: translateX(0); }
        50%{ transform: translateX(4px); }
    }
}

/* subtle pulse */
@media (prefers-reduced-motion: no-preference){
    .nd-search-cta{
        animation: nd-cta-pulse 2.2s ease-in-out infinite;
    }
    @keyframes nd-cta-pulse{
        0%,100%{ filter: saturate(1); }
        50%{ filter: saturate(1.18); }
    }
}

.nd-ps-link{
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.82);
    color: rgba(17,18,20,.80);
    font-weight: 800;
    cursor: pointer;
    text-align: left;
}

.nd-ps-link i{
    width: 18px;
    text-align: center;
    color: rgba(91,108,255,.90);
}

.nd-ps-link:hover{
    background: rgba(91,108,255,.06);
    border-color: rgba(91,108,255,.18);
}

.nd-ps-link.is-active{
    background: rgba(91,108,255,.10);
    border-color: rgba(91,108,255,.32);
    color: rgba(91,108,255,.95);
    box-shadow: 0 10px 24px rgba(91,108,255,.14);
}

.nd-ps-link.is-active i{
    color: rgba(91,108,255,.98);
}

.nd-ps-link:disabled{
    opacity: .45;
    cursor: not-allowed;
}

.nd-ps-link:disabled i{
    color: rgba(17,18,20,.35);
}

.nd-ps-badge{
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size: 0.6875rem;
    font-weight: 1000;
    color: white;
    background: linear-gradient(90deg, var(--p1), var(--p2));
    box-shadow: 0 10px 24px rgba(91,108,255,.22);
    animation: nd-badge-pulse 1.2s ease-in-out infinite;
}

@keyframes nd-badge-pulse{
    0%,100%{ transform: scale(1); }
    50%{ transform: scale(1.06); }
}

/* ===== Shared Messages (Messages/FakeMessages) ===== */
.nd-msg{
    display:grid;
    grid-template-columns: 360px 1fr;
    gap: 14px;
    height: calc(100vh - 190px);
    height: calc(100dvh - 190px);
    min-height: 520px;
}

.nd-msg-left{
    border-radius: 18px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.86);
    overflow:hidden;
    display:flex;
    flex-direction: column;
}

.nd-msg-filters{
    padding: 12px 12px 10px 12px;
    border-bottom: 1px solid rgba(17,18,20,.08);
    display:flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    background: rgba(247,248,252,.65);
}

.nd-ios{
    display:flex;
    align-items:center;
    gap: 8px;
    font-weight: 900;
    color: rgba(17,18,20,.70);
    font-size: 0.75rem;
    user-select:none;
}
.nd-ios input{ display:none; }
.nd-ios-track{
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: rgba(17,18,20,.14);
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(17,18,20,.08);
}
.nd-ios-track::after{
    content:"";
    position:absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(17,18,20,.18);
    transition: transform .18s ease, background .18s ease;
}
.nd-ios input:checked + .nd-ios-track{
    background: rgba(91,108,255,.75);
}
.nd-ios input:checked + .nd-ios-track::after{
    transform: translateX(20px);
}

.nd-msg-list{
    overflow:auto;
    padding: 10px;
    display:flex;
    flex-direction: column;
    gap: 10px;
}

.nd-msg-empty{
    padding: 20px;
    text-align:center;
    color: rgba(17,18,20,.55);
    font-weight: 900;
}

.nd-msg-item{
    width:100%;
    text-align:left;
    border-radius: 16px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.92);
    padding: 12px;
    display:grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    cursor:pointer;
    box-shadow: 0 10px 26px rgba(17,18,20,.07);
}
@media (hover: hover){
    .nd-msg-item:hover{
        transform: translateY(-1px);
        box-shadow: 0 16px 40px rgba(17,18,20,.10);
    }
}
.nd-msg-item.is-active{
    border-color: rgba(91,108,255,.40);
    box-shadow: 0 0 0 6px rgba(91,108,255,.10), 0 18px 44px rgba(17,18,20,.12);
    background: rgba(255,255,255,.96);
}

.nd-msg-ava{
    width: 72px;
    height: 72px;
    border-radius: 999px;
    position: relative;
    overflow: visible;
    border: 2px solid rgba(17,18,20,.06);
    background: rgba(91,108,255,.08);
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow: 0 8px 20px rgba(17,18,20,.08);
}
.nd-msg-ava img{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius: 999px;
}
.nd-msg-ava-fallback{
    font-weight: 950;
    color: rgba(17,18,20,.55);
}

.nd-msg-unread{
    position:absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255,91,200,.95);
    color:#fff;
    font-weight: 950;
    font-size: 0.75rem;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow: 0 10px 22px rgba(255,91,200,.25);
    border: 2px solid rgba(255,255,255,.95);
    z-index: 3;
}

.nd-dot{
    width: 12px; height: 12px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.95);
    position:absolute;
    right: -1px; bottom: -1px;
    z-index: 2;
}
.nd-dot-online{ background: rgba(38,177,95,.95); box-shadow: 0 10px 18px rgba(38,177,95,.25); }

.nd-msg-meta{ min-width:0; }
.nd-msg-top{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
}
.nd-msg-title{
    font-weight: 950;
    color: rgba(17,18,20,.86);
    white-space: nowrap;
    overflow:hidden;
    text-overflow: ellipsis;
}
.nd-msg-time{
    font-weight: 900;
    font-size: 0.75rem;
    color: rgba(17,18,20,.45);
    white-space: nowrap;
}
.nd-msg-bottom{
    margin-top: 6px;
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
}
.nd-msg-snippet{
    font-weight: 900;
    color: rgba(17,18,20,.55);
    white-space: nowrap;
    overflow:hidden;
    text-overflow: ellipsis;
}
.nd-msg-photo{
    color: rgba(91,108,255,.95);
}
.nd-msg-star{
    width: 34px; height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.90);
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    color: rgba(17,18,20,.25);
}
.nd-msg-star.is-on{
    color: rgba(255,193,7,.95);
}

.nd-msg-right{
    border-radius: 18px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.86);
    overflow:hidden;
    display:flex;
    flex-direction: column;
}

.nd-msg-placeholder{
    height: 100%;
    display:flex;
    flex-direction: column;
    align-items:center;
    justify-content:center;
    gap: 10px;
    color: rgba(17,18,20,.55);
}
.nd-msg-pl-ic{
    width: 58px; height: 58px;
    border-radius: 18px;
    display:flex;
    align-items:center;
    justify-content:center;
    background: transparent;
    color: rgba(91,108,255,.95);
    font-size: 1.625rem;
}
.nd-msg-pl-title{ font-weight: 950; }

.nd-token-modal{
    width: min(640px, calc(100vw - 28px));
    max-width: 640px;
}

.nd-token-head{
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 16px;
    align-items: center;
}

.nd-token-ava{
    width: 68px;
    height: 68px;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid rgba(17,18,20,.08);
    background: rgba(91,108,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(17,18,20,.5);
    font-size: 1.5rem;
}

.nd-token-ava img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nd-token-title{
    font-weight: 950;
    font-size: 2.125rem;
    line-height: 1.15;
    color: rgba(17,18,20,.92);
}

.nd-token-sub{
    margin-top: 8px;
    font-weight: 800;
    font-size: 1.125rem;
    line-height: 1.35;
    color: rgba(17,18,20,.62);
}

.nd-token-note{
    margin-top: 20px;
    border-radius: 16px;
    border: 1px solid rgba(91,108,255,.18);
    background: rgba(91,108,255,.08);
    color: rgba(17,18,20,.72);
    padding: 16px 18px;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.4;
}

.nd-token-pay-btn{
    margin-top: 22px;
    height: 56px;
    width: min(420px, 100%);
    font-size: 1.5rem;
}

.nd-token-modal .nd-auth-modal-inner{
    padding: 28px;
}

@media (max-width: 700px){
    .nd-token-modal{
        width: min(95vw, 560px);
    }

    .nd-token-modal .nd-auth-modal-inner{
        padding: 20px;
    }

    .nd-token-head{
        grid-template-columns: 58px 1fr;
        gap: 12px;
    }

    .nd-token-ava{
        width: 58px;
        height: 58px;
    }

    .nd-token-title{
        font-size: 1.875rem;
    }

    .nd-token-sub{
        font-size: 1rem;
    }

    .nd-token-note{
        font-size: 0.875rem;
        padding: 14px 14px;
    }

    .nd-token-pay-btn{
        height: 52px;
        font-size: 1.25rem;
    }
}

.nd-msg-head{
    padding: 12px;
    display:flex;
    align-items:center;
    gap: 10px;
    border-bottom: 1px solid rgba(17,18,20,.08);
    background: rgba(247,248,252,.65);
}
.nd-msg-back{
    display:none;
    align-items:center;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.85);
    padding: 8px 10px;
    font-weight: 900;
    cursor:pointer;
}
.nd-msg-head-profile{
    display:flex;
    align-items:center;
    gap: 10px;
    text-decoration:none;
    color:inherit;
    cursor:pointer;
    border-radius: 14px;
    padding: 4px 8px;
    margin: -4px -8px;
    transition: background .15s;
}
.nd-msg-head-profile:hover{
    background: rgba(91,108,255,.06);
}
.nd-msg-head-ava{
    width: 64px;
    height: 64px;
    min-width: 64px;
    flex: 0 0 64px;
    border-radius: 999px;
    overflow: visible;
    position: relative;
    background: rgba(91,108,255,.08);
    border: 2px solid rgba(17,18,20,.06);
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow: 0 10px 22px rgba(17,18,20,.10);
}
.nd-msg-head-ava img{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius: 999px;
}

.nd-msg-head-ava .nd-dot{
    right: -2px;
    bottom: -2px;
    width: 11px;
    height: 11px;
    border-width: 2px;
    z-index: 3;
}

.nd-msg-head-title{
    font-weight: 950;
    color: rgba(17,18,20,.86);
}
.nd-msg-head-sub{
    margin-top: 2px;
    font-weight: 900;
    color: rgba(38,177,95,.95);
}

.nd-msg-thread{
    flex: 1;
    overflow:auto;
    padding: 14px;
    background: rgba(247,248,252,.35);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.nd-msg-day{
    width: fit-content;
    margin: 10px auto;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.75);
    font-weight: 950;
    color: rgba(17,18,20,.55);
    text-transform: lowercase;
}

.nd-bubble{
    display:flex;
    margin: 10px 0;
}
.nd-bubble.is-me{ justify-content:flex-end; }
.nd-bubble.is-them{ justify-content:flex-start; }

.nd-bubble-inner{
    max-width: min(560px, 78%);
    border-radius: 18px;
    padding: 12px 12px 10px 12px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.92);
    box-shadow: 0 10px 26px rgba(17,18,20,.06);
}
.nd-bubble.is-me .nd-bubble-inner{
    background: rgba(91,108,255,.12);
    border-color: rgba(91,108,255,.25);
}
.nd-bubble-text{
    font-weight: 800;
    color: rgba(17,18,20,.80);
    white-space: pre-wrap;
    word-break: break-word;
}
.nd-bubble-photo{
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor:pointer;
}
.nd-bubble-photo img{
    /* Portrait dating photos must not be cropped/letterboxed to 4:3 —
       size to the image's own ratio, capped so tall shots stay on-screen. */
    width: auto;
    max-width: min(420px, 100%);
    max-height: min(420px, 52vh);
    border-radius: 14px;
    border: 1px solid rgba(17,18,20,.10);
    box-shadow: 0 14px 34px rgba(17,18,20,.10);
}

.nd-bubble-meta{
    margin-top: 6px;
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 900;
    font-size: 0.75rem;
    color: rgba(17,18,20,.45);
}
.nd-ticks{
    color: rgba(91,108,255,.95);
}

.nd-msg-compose{
    padding: 12px;
    border-top: 1px solid rgba(17,18,20,.08);
    background: rgba(255,255,255,.86);
    display:grid;
    grid-template-columns: 44px 44px 1fr 52px;
    gap: 10px;
    align-items:center;
    position: relative;
}
.nd-msg-file{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.90);
    padding: 10px;
    cursor:pointer;
}
.nd-msg-ic{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.90);
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    color: rgba(17,18,20,.55);
}
.nd-msg-input{
    height: 44px;
    min-width: 0;
    border-radius: 14px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.92);
    padding: 0 12px;
    font-weight: 850;
}
.nd-msg-send{
    width: 52px;
    height: 44px;
    border-radius: 14px;
    border: 0;
    cursor:pointer;
    background: linear-gradient(90deg, rgba(91,108,255,.95), rgba(255,91,200,.95));
    color: #fff;
    box-shadow: 0 16px 40px rgba(91,108,255,.22);
}

.nd-emoji-pop{
    position: fixed;
    width: 340px;
    max-width: calc(100vw - 24px);
    display:none;
    z-index: 9999;
    border-radius: 18px;
    overflow:hidden;
    box-shadow: 0 24px 80px rgba(17,18,20,.22);
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.96);
}
.nd-emoji-pop.is-open{ display:block; animation: nd-emoji-in .18s ease both; }

@keyframes nd-emoji-in{
    from{ opacity: 0; transform: translateY(10px); }
    to{ opacity: 1; transform: none; }
}

/* Mobile: emoji picker becomes a sheet pinned above the compose bar */
@media (max-width: 760px){
    .nd-emoji-pop{
        position: absolute;
        left: 8px !important;
        right: 8px;
        top: auto !important;
        bottom: calc(100% + 8px);
        width: auto;
        max-width: none;
    }
    .nd-emoji-pop emoji-picker{
        width: 100%;
        height: min(320px, 45vh);
    }
}

/* image viewer */
.nd-imgv{
    position: fixed;
    inset: 0;
    background: rgba(17,18,20,.55);
    display:none;
    z-index: 9999;
    align-items:center;
    justify-content:center;
    padding: 18px;
}
.nd-imgv.is-open{ display:flex; }
.nd-imgv-box{
    width: min(980px, calc(100vw - 24px));
    border-radius: 18px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.35);
    overflow:hidden;
    position: relative;
    padding: 12px;
}
.nd-imgv-x{
    position:absolute;
    top: 10px;
    right: 10px;
    width: 44px; height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(17,18,20,.10);
    background: rgba(255,255,255,.90);
    cursor:pointer;
    font-size: 1.375rem;
}
.nd-imgv img{
    /* Full viewer: no forced 4:3 crop — let portrait photos keep their ratio */
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 80vh;
    margin: 0 auto;
    border-radius: 14px;
}

/* Disable text selection globally; keep it only in editable controls */
html, body{
    -webkit-user-select: none;
    user-select: none;
    /* No gray flash on tap — press feedback is styled per-control */
    -webkit-tap-highlight-color: transparent;
    /* App is light-only — opt out of UA auto-dark so form controls stay legible */
    color-scheme: light;
}

input, textarea, select, [contenteditable], [contenteditable="true"]{
    -webkit-user-select: text;
    user-select: text;
}

/* responsive */
@media (max-width: 980px){
    /* The list lives in the normal page flow — one scroll surface, no
       card-bounded inner scrollbar. An open chat is a fixed overlay with
       its own height, so it is unaffected by auto here. */
    .nd-msg{ grid-template-columns: 1fr; height: auto; min-height: 0; }
    .nd-msg-back{ display:flex; }
    .nd-msg-left.is-collapsed-mobile{ display:none; }

    /* Mobile shows only the conversation list — no empty-chat placeholder
       pane. The right pane returns when a chat opens (.is-chat-open). */
    .nd-msg:not(.is-chat-open) .nd-msg-right{ display:none; }

    /* An open conversation becomes a full-screen keyboard-aware layer:
       --nd-vvh follows the visual viewport (set by ndMsg.initChatViewport),
       so the compose bar always sits right above the on-screen keyboard. */
    .nd-msg.is-chat-open{
        position: fixed;
        inset: 0;
        z-index: 1000;
        height: 100dvh;
        height: var(--nd-vvh, 100dvh);
        min-height: 0;
        gap: 0;
        padding: 0;
        background: var(--bg, #F7F8FC);
        /* height/transform are driven per-frame by ndMsg (visualViewport
           tracking) so the layer follows the iOS keyboard pixel-for-pixel */
        will-change: transform, height;
    }
    .nd-msg.is-chat-open .nd-msg-right{
        border-radius: 0;
        border: 0;
        height: 100%;
        min-height: 0;
    }
    .nd-msg.is-chat-open .nd-msg-compose{
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    /* Slide the conversation in on the compositor. The animation lives on the
       inner pane, NOT on .nd-msg — ndMsg's rAF loop writes inline
       height/transform onto .nd-msg and would fight it. */
    .nd-msg.is-chat-open .nd-msg-right{
        animation: nd-chat-in .28s cubic-bezier(.32,.72,.33,1) both;
    }
    @keyframes nd-chat-in{
        from{ transform: translateX(100%); }
        to{ transform: translateX(0); }
    }
    @media (prefers-reduced-motion: reduce){
        .nd-msg.is-chat-open .nd-msg-right{ animation: none; }
    }

    /* 16px stops iOS Safari from auto-zooming the page on input focus */
    .nd-msg-input{ font-size: 1rem; }

    /* backdrop must not scroll while a conversation layer is open */
    html.nd-chat-lock, html.nd-chat-lock body{
        overflow: hidden;
        height: 100%;
        overscroll-behavior: none;
    }
}



/* ===== Global modal (reusable) ===== */
.nd-modal-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(17,18,20,.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 9998;
    animation: nd-modal-fade-in .25s ease both;
}

.nd-modal{
    width: min(420px, 100%);
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.5);
    background:
        radial-gradient(400px 180px at 20% 0%, rgba(91,108,255,.14), transparent 55%),
        radial-gradient(400px 180px at 80% 0%, rgba(255,91,200,.12), transparent 55%),
        rgba(255,255,255,.97);
    box-shadow: 0 28px 90px rgba(17,18,20,.25);
    padding: 28px 24px;
    text-align: center;
    animation: nd-modal-pop-in .35s cubic-bezier(.34,1.56,.64,1) both;
}

.nd-modal-icon{
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    color: rgba(34,197,94,.95);
    background: rgba(34,197,94,.10);
    border: 1px solid rgba(34,197,94,.20);
}

.nd-modal-title{
    font-weight: 950;
    font-size: 1.375rem;
    color: rgba(17,18,20,.88);
    margin-bottom: 6px;
}

.nd-modal-sub{
    color: rgba(17,18,20,.55);
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.45;
}

.nd-btn{
    display:inline-flex;align-items:center;justify-content:center;
    padding:12px 24px;border-radius:var(--radius-lg);
    font-size: 0.9375rem;font-weight:700;cursor:pointer;
    border:none;transition:all .15s ease;
}
.nd-btn:hover{opacity:.9;transform:translateY(-1px);}
.nd-btn-primary{
    background:linear-gradient(135deg,var(--p1),var(--p2));
    color:#fff;
    box-shadow:0 8px 24px rgba(91,108,255,.25);
}
.nd-modal-btn{
    width: 100%;
    justify-content: center;
}

@keyframes nd-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes nd-modal-pop-in {
    from { transform: scale(0.85) translateY(12px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

@media (max-width: 560px) {
    .nd-modal { padding: 18px 16px; border-radius: 18px; }
    .nd-modal-title { font-size: 1.25rem; }
    .nd-modal-icon { width: 54px; height: 54px; font-size: 1.5rem; border-radius: 16px; }
}

/* ===== Blazor reconnect modal (custom themed) ===== */
#components-reconnect-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(13, 16, 32, 0.38);
    backdrop-filter: blur(4px);
    padding: 20px;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed {
    display: flex;
}

/* Session expired (rejected) — centered square card, no backdrop */
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
    background: rgba(13, 16, 32, 0.25);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#components-reconnect-modal .nd-reconnect-panel {
    width: min(560px, 100%);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background:
        radial-gradient(500px 200px at 20% 0%, rgba(91, 108, 255, 0.16), transparent 60%),
        radial-gradient(500px 200px at 80% 0%, rgba(255, 91, 200, 0.14), transparent 60%),
        rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(17, 18, 20, 0.28);
    padding: 26px 24px;
}

/* When rejected, shrink the panel to fit the card */
#components-reconnect-modal.components-reconnect-rejected .nd-reconnect-panel {
    width: auto;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    border-radius: 0;
}

#components-reconnect-modal .nd-reconnect-state {
    display: none;
    text-align: center;
}

#components-reconnect-modal.components-reconnect-show .nd-reconnect-show-state {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed:not(.components-reconnect-rejected) .nd-reconnect-failed-state {
    display: block;
}

#components-reconnect-modal.components-reconnect-rejected .nd-reconnect-rejected-state {
    display: block;
}

/* Session expired card-button */
#components-reconnect-modal .nd-reconnect-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 200px;
    height: 200px;
    padding: 24px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    background:
        radial-gradient(200px 200px at 25% 25%, rgba(91, 108, 255, 0.16), transparent 60%),
        radial-gradient(200px 200px at 75% 75%, rgba(255, 91, 200, 0.12), transparent 60%),
        rgba(255, 255, 255, 0.97);
    box-shadow:
        0 16px 50px rgba(91, 108, 255, 0.20),
        0 4px 12px rgba(17, 18, 20, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: nd-reconnect-card-in 0.4s ease both;
}

#components-reconnect-modal .nd-reconnect-card:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow:
        0 20px 60px rgba(91, 108, 255, 0.28),
        0 6px 16px rgba(17, 18, 20, 0.10);
}

#components-reconnect-modal .nd-reconnect-card:active {
    transform: scale(0.96);
}

#components-reconnect-modal .nd-reconnect-card-ic {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: #5B6CFF;
    background: rgba(91, 108, 255, 0.10);
    border: 1px solid rgba(91, 108, 255, 0.20);
    animation: nd-reconnect-card-spin 2.5s ease-in-out infinite;
}

#components-reconnect-modal .nd-reconnect-card-text {
    font-size: 0.875rem;
    font-weight: 800;
    color: rgba(17, 18, 20, 0.75);
    text-align: center;
    line-height: 1.35;
}

@keyframes nd-reconnect-card-in {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes nd-reconnect-card-spin {
    0%, 80%, 100% { transform: rotate(0deg); }
    90% { transform: rotate(360deg); }
}

#components-reconnect-modal .nd-reconnect-spinner {
    width: 74px;
    height: 74px;
    margin: 2px auto 14px;
    border-radius: 999px;
    border: 4px solid rgba(91, 108, 255, 0.2);
    border-top-color: rgba(91, 108, 255, 0.95);
    animation: nd-reconnect-spin 0.9s linear infinite;
}

#components-reconnect-modal .nd-reconnect-failed-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: rgba(91, 108, 255, 0.96);
    font-size: 1.75rem;
    background: rgba(91, 108, 255, 0.1);
    border: 1px solid rgba(91, 108, 255, 0.22);
}

#components-reconnect-modal .nd-reconnect-title {
    font-size: 1.75rem;
    line-height: 1.1;
    font-weight: 900;
    color: rgba(17, 18, 20, 0.9);
}

#components-reconnect-modal .nd-reconnect-sub {
    margin-top: 8px;
    color: rgba(17, 18, 20, 0.62);
    font-size: 1rem;
    font-weight: 700;
}

#components-reconnect-modal .nd-reconnect-btn {
    margin-top: 18px;
    height: 42px;
    min-width: 132px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(90deg, #5b6cff, #ff5bc8);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(91, 108, 255, 0.3);
}

#components-reconnect-modal .nd-reconnect-btn:hover {
    filter: brightness(1.05);
}

@keyframes nd-reconnect-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 680px) {
    #components-reconnect-modal .nd-reconnect-panel {
        padding: 22px 16px;
        border-radius: 18px;
    }

    #components-reconnect-modal .nd-reconnect-title {
        font-size: 1.5rem;
    }

    #components-reconnect-modal .nd-reconnect-sub {
        font-size: 0.875rem;
    }

    #components-reconnect-modal .nd-reconnect-card {
        padding: 14px 22px;
        gap: 10px;
        border-radius: 16px;
    }

    #components-reconnect-modal .nd-reconnect-card-text {
        font-size: 0.875rem;
    }
}

/* =================================================================
   MOBILE RESPONSIVE — AUTHORIZED LAYOUT BOTTOM NAV & HEADER
   ================================================================= */

/* Hidden by default; activated inside the media queries below */
.nd-mobile-nav          { display: none; }
.nd-ph-mobile-extras    { display: none; }

/* While the on-screen keyboard is up (html.nd-kb-open, set by nd-auth.js)
   the fixed nav would ride the iOS viewport pan across the screen —
   hide it outright for the duration instead of animating anything. */
.nd-kb-open .nd-mobile-nav{ display: none; }

/* ── Burger animation ──────────────────────────────────────────── */
.nd-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nd-burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nd-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nd-burger span { transition: transform .22s ease, opacity .18s ease; }

/* ── Mobile menu backdrop ──────────────────────────────────────── */
.nd-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(17, 18, 20, 0.22);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: nd-fade-in .18s ease;
}
@keyframes nd-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Tablet + Phone breakpoint (≤ 980px): bottom nav ──────────── */
@media (max-width: 980px) {

    /* Shared mobile chrome heights — single source of truth for the
       clearance math used by content padding and full-height panels.
       Bottom nav ≈ 6px top pad + ~59px item + 6px bottom pad + safe-area.
       Header  ≈ 16px+10px padding + ~36px content. */
    .nd-page{
        /* Header grows by the safe-area-inset-top padding added above, so the
           clearance math (.nd-msg height, toast top offset) stays exact. */
        --nd-header-h: calc(64px + env(safe-area-inset-top, 0px));
        --nd-bottomnav-h: calc(74px + env(safe-area-inset-bottom, 0px));
    }

    /*
     * Use display:contents so the aside box disappears
     * but its children (.nd-ps-card + .nd-mobile-nav) stay in the DOM.
     * We hide .nd-ps-card; the fixed-positioned .nd-mobile-nav survives.
     */
    .nd-auth-side { display: contents; }
    .nd-ps-card   { display: none; }

    /* Sticky authorized header */
    .nd-ph {
        position: sticky;
        top: 0;
        z-index: 100;
        /* Clear the notch/status-bar area (viewport-fit=cover) */
        padding-top: max(16px, env(safe-area-inset-top));
    }

    /* Hide footer on authorized layout on mobile */
    .nd-auth-footer { display: none; }

    /* Bottom padding so page content (e.g. Save/Finish buttons) always
       clears the fixed bottom nav with a comfortable 20px gap. */
    .nd-profile {
        padding-bottom: calc(var(--nd-bottomnav-h) + 20px);
    }

    /* Messages: the chat list scrolls with the page (height:auto set in the
       .nd-msg mobile rule above); the open-chat overlay manages its own
       height via --nd-vvh, so no fixed panel height is needed here. */

    /* landscape: keep header content clear of the rounded-corner/notch cutout */
    .nd-ph-inner {
        padding-left: max(28px, env(safe-area-inset-left));
        padding-right: max(28px, env(safe-area-inset-right));
    }

    /* ── Header right section — flex row ──────────────────────── */
    .nd-ph-right {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* ── Mobile avatar + credits in authorized header ──────────── */
    .nd-ph-mobile-extras {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .nd-ph-mobile-credits {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        height: 36px;
        padding: 0 12px;
        border-radius: 999px;
        background: rgba(91, 108, 255, 0.09);
        border: 1px solid rgba(91, 108, 255, 0.18);
        color: rgba(91, 108, 255, 0.90);
        font-size: 0.8125rem;
        font-weight: 900;
        cursor: pointer;
        transition: background 0.18s ease;
        -webkit-tap-highlight-color: transparent;
    }
    /* Expand the tappable area to 44px without growing the visual pill */
    .nd-ph-mobile-credits::before {
        content: "";
        position: absolute;
        inset: 50% 0 auto 0;
        height: 44px;
        transform: translateY(-50%);
    }
    .nd-ph-mobile-credits i   { font-size: 0.75rem; opacity: 0.75; }
    .nd-ph-mobile-credits:active { background: rgba(91, 108, 255, 0.18); }

    .nd-ph-mobile-ava {
        /* overflow:hidden clips the circular avatar image — a pseudo-element
           hit-area trick would get clipped too, so the tap target grows for real. */
        width: 44px;
        height: 44px;
        border-radius: 999px;
        overflow: hidden;
        border: 2px solid rgba(17, 18, 20, 0.10);
        background: rgba(91, 108, 255, 0.08);
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(17, 18, 20, 0.40);
        font-size: 0.875rem;
        cursor: pointer;
        flex-shrink: 0;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.15s ease;
    }
    .nd-ph-mobile-ava img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    .nd-ph-mobile-ava:active { transform: scale(0.93); }

    /* Sign-out: moved to Settings page on mobile — hide from header */
    .nd-ph-signout { display: none; }

    /* ── Bottom navigation bar ─────────────────────────────────── */
    .nd-mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(17, 18, 20, 0.08);
        /* Fixed height so the clearance math (--nd-bottomnav-h) is exact, not estimated */
        box-sizing: border-box;
        height: calc(74px + env(safe-area-inset-bottom, 0px));
        /* top padding + bottom safe-area inset for notched phones */
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
        /* landscape: keep clear of the rounded-corner/notch cutout on the sides */
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
        justify-content: space-around;
        align-items: flex-end;
        box-shadow: 0 -2px 20px rgba(17, 18, 20, 0.07);
    }

    .nd-mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 2px;
        flex: 1;
        padding: 6px 6px 2px;
        border: none;
        background: transparent;
        color: rgba(17, 18, 20, 0.62);
        font-size: 0.625rem;
        font-weight: 900;
        cursor: pointer;
        border-radius: 10px;
        transition: color 0.18s ease, transform 0.12s ease;
        min-height: 56px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }
    .nd-mobile-nav-item:active { transform: scale(0.88); }

    .nd-mobile-nav-ic {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        border-radius: 12px;
        transition: background 0.18s ease;
    }
    .nd-mobile-nav-ic i { font-size: 1.5rem; line-height: 1; }

    .nd-mobile-nav-item.is-active {
        color: var(--p1);
    }
    .nd-mobile-nav-item.is-active .nd-mobile-nav-ic {
        background: rgba(91, 108, 255, 0.10);
    }

    /* Search is the primary action — always-on brand-gradient chip so it
       never reads as a pale ghost icon. Must come after the .is-active
       rules (same specificity for the .is-active override below). */
    .nd-mobile-nav-item.nd-mobile-nav-search .nd-mobile-nav-ic {
        background: linear-gradient(135deg, var(--p1), var(--p2));
        box-shadow: 0 6px 16px rgba(91, 108, 255, 0.35);
    }
    .nd-mobile-nav-item.nd-mobile-nav-search .nd-mobile-nav-ic i { color: #fff; }
    .nd-mobile-nav-item.nd-mobile-nav-search.is-active .nd-mobile-nav-ic {
        background: linear-gradient(135deg, var(--p1), var(--p2));
    }

    /* Unread badge on nav icon */
    .nd-mobile-badge {
        position: absolute;
        top: -3px;
        right: -3px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--p1), var(--p2));
        color: white;
        font-size: 0.5625rem;
        font-weight: 900;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(255, 255, 255, 0.96);
        line-height: 1;
    }
}

/* ── Social sign-in (auth modal) ───────────────────────────────── */
.nd-auth-social-divider{
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 10px;
    color: rgba(17,18,20,.40);
    font-size: 0.75rem;
    font-weight: 700;
}
.nd-auth-social-divider::before,
.nd-auth-social-divider::after{
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(17,18,20,.10);
}
/* Standard, instantly recognisable provider buttons: Google's white
   button with the four-colour G (inline SVG in the markup), Facebook's
   brand-blue one. Pill radius keeps them in the app's shape language. */
.nd-auth-social-row{
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nd-auth-social{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 52px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.9375rem;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.nd-auth-social:active{ transform: scale(.985); }
.nd-auth-social svg{ flex-shrink: 0; }

.nd-auth-social-google{
    background: #fff;
    border: 1px solid #dadce0;
    color: #1f1f1f;
}
.nd-auth-social-google:hover{
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(17,18,20,.10);
}

.nd-auth-social-facebook{
    background: #1877F2;
    border: 1px solid #1877F2;
    color: #fff;
}
.nd-auth-social-facebook:hover{
    background: #166FE5;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(24,119,242,.28);
}
.nd-auth-social-facebook i{ color: #fff; font-size: 1.125rem; }

/* ── Settings entry on the Profile page — mobile only (desktop keeps
      the sidebar Settings link) ─────────────────────────────────── */
.nd-pm-settings { display: none; }

/* ── Mobile-only quick entries on the Profile tab ──────────────────
   Credits/Top Up (moved out of Messages) and the About Me survey —
   both unreachable from the bottom nav, so Profile is their home. */
.nd-pm-quick{ display: none; }

@media (max-width: 980px){
    .nd-pm-quick{
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        margin: 0 0 10px;
        padding: 14px;
        border-radius: 18px;
        border: 1px solid rgba(17,18,20,.08);
        background: rgba(255,255,255,.92);
        box-shadow: 0 10px 26px rgba(17,18,20,.06);
        cursor: pointer;
        text-align: left;
        -webkit-tap-highlight-color: transparent;
        transition: transform .15s ease;
    }
    .nd-pm-quick:active{ transform: scale(.985); }

    .nd-pm-quick-ic{
        width: 44px;
        height: 44px;
        border-radius: 14px;
        display: grid;
        place-items: center;
        font-size: 1.125rem;
        flex-shrink: 0;
    }
    .nd-pm-quick-ic.is-coins{ background: rgba(91,108,255,.10); color: rgba(91,108,255,.92); }
    .nd-pm-quick-ic.is-me{ background: rgba(255,91,200,.10); color: rgba(255,91,200,.92); }

    .nd-pm-quick-body{ flex: 1; min-width: 0; display: grid; gap: 2px; }
    .nd-pm-quick-title{
        font-weight: 950;
        font-size: 1rem;
        color: rgba(17,18,20,.85);
    }
    .nd-pm-quick-sub{
        font-weight: 700;
        font-size: 0.75rem;
        color: rgba(17,18,20,.48);
    }

    .nd-pm-quick-cta{
        display: inline-flex;
        align-items: center;
        gap: 6px;
        height: 36px;
        padding: 0 14px;
        border-radius: 999px;
        background: linear-gradient(90deg, rgba(91,108,255,.95), rgba(255,91,200,.95));
        color: #fff;
        font-weight: 900;
        font-size: 0.8125rem;
        flex-shrink: 0;
        box-shadow: 0 10px 26px rgba(91,108,255,.18);
    }
    .nd-pm-quick-cta i{ font-size: 0.6875rem; }

    .nd-pm-quick-arrow{
        color: rgba(17,18,20,.30);
        font-size: 0.875rem;
        flex-shrink: 0;
    }
}

/* ── Header avatar menu (mobile): profile + sign out ─────────────── */
.nd-ph-ava-wrap{ position: relative; }

.nd-ph-ava-backdrop{
    position: fixed;
    inset: 0;
    z-index: 210;
    background: transparent;
}

.nd-ph-ava-menu{
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 211;
    min-width: 200px;
    padding: 6px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(17,18,20,.08);
    box-shadow: 0 18px 50px rgba(17,18,20,.18);
    animation: nd-ava-menu-in .16s ease both;
}
@keyframes nd-ava-menu-in{
    from{ opacity: 0; transform: translateY(-6px) scale(.97); }
    to{ opacity: 1; transform: none; }
}

.nd-ph-ava-form{ margin: 0; }

.nd-ph-ava-item{
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 0.9375rem;
    color: rgba(17,18,20,.78);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.nd-ph-ava-item:active{ background: rgba(17,18,20,.05); }
.nd-ph-ava-item i{
    width: 18px;
    text-align: center;
    color: rgba(91,108,255,.85);
}
.nd-ph-ava-item.is-danger{ color: rgba(220,53,69,.92); }
.nd-ph-ava-item.is-danger i{ color: rgba(220,53,69,.85); }

@media (max-width: 980px) {
    .nd-pm-settings {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        margin: 0 0 14px;
        padding: 12px 16px;
        border: 1px solid rgba(17, 18, 20, 0.08);
        border-radius: var(--radius-lg);
        background: var(--surface, #fff);
        color: rgba(17, 18, 20, 0.85);
        font-weight: 900;
        font-size: 0.875rem;
        cursor: pointer;
        box-shadow: 0 2px 14px rgba(17, 18, 20, 0.05);
        -webkit-tap-highlight-color: transparent;
        transition: transform .12s ease;
    }
    .nd-pm-settings:active { transform: scale(0.985); }
    .nd-pm-settings-ic {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: rgba(91, 108, 255, 0.10);
        color: var(--p1);
        font-size: 1.0625rem;
    }
    .nd-pm-settings-arrow {
        margin-left: auto;
        color: rgba(17, 18, 20, 0.30);
        font-size: 0.8125rem;
    }
}

/* ── Very small screens (< 400px) ─────────────────────────────── */
@media (max-width: 400px) {
    .nd-mobile-nav-item {
        font-size: 0.5625rem;
        padding: 6px 2px 2px;
    }
    .nd-mobile-nav-ic i { font-size: 1.375rem; }
    .nd-container { padding-inline: 12px; }
}

/* ── Global smooth scroll ──────────────────────────────────────── */
/* Not while a chat layer is open: ndMsg resets window scroll per-frame
   and a smooth-animated reset visibly stutters the layer. */
html:not(.nd-chat-lock) { scroll-behavior: smooth; }

/* ── Better touch targets on small screens ─────────────────────── */
@media (max-width: 760px) {
    .nd-ps-link,
    .nd-toggle-btn,
    .nd-select { min-height: 46px; }

    .nd-auth-btn { min-height: 50px; }
    .nd-save { min-height: 46px; width: 100%; }

    /* Touch targets ≥44px for chat controls */
    .nd-msg-star { width: 44px; height: 44px; }
    .nd-msg-back { min-height: 44px; }
}

/* ── Push notification modal ──────────────────────────────────── */
.nd-push-overlay{
    position:fixed;inset:0;z-index:9999;
    background:rgba(13,16,32,.45);
    backdrop-filter:blur(6px);
    display:flex;align-items:center;justify-content:center;
    animation:ndFadeIn .25s ease;
    padding:20px;
}
.nd-push-modal{
    background:#fff;border-radius:var(--radius-xl);
    padding:36px 32px 28px;max-width:400px;width:100%;
    text-align:center;
    box-shadow:0 24px 80px rgba(13,16,32,.22);
    animation:ndScaleIn .3s ease;
}
.nd-push-modal-icon{
    width:64px;height:64px;margin:0 auto 18px;
    border-radius:50%;
    background:linear-gradient(135deg,var(--p1),var(--p2));
    display:flex;align-items:center;justify-content:center;
    font-size: 1.625rem;color:#fff;
    box-shadow:0 12px 32px rgba(91,108,255,.3);
}
.nd-push-modal-title{
    font-size: 1.25rem;font-weight:800;color:var(--text);
    margin-bottom:8px;
}
.nd-push-modal-text{
    font-size: 0.875rem;line-height:1.55;color:rgba(17,18,20,.55);
    margin-bottom:24px;
}
.nd-push-modal-actions{display:flex;flex-direction:column;gap:10px;}
.nd-push-modal-btn{
    width:100%;padding:13px 20px;border-radius:var(--radius-lg);
    font-size: 0.9375rem;font-weight:700;cursor:pointer;
    border:none;transition:all .15s ease;
}
.nd-push-modal-btn:hover{opacity:.9;transform:translateY(-1px);}
.nd-push-modal-enable{
    background:linear-gradient(135deg,var(--p1),var(--p2));
    color:#fff;
    box-shadow:0 8px 24px rgba(91,108,255,.3);
}
.nd-push-modal-enable i{margin-right:6px;}
.nd-push-modal-skip{
    background:transparent;color:rgba(17,18,20,.4);
    font-size: 0.8125rem;font-weight:600;
}
.nd-push-modal-skip:hover{color:rgba(17,18,20,.6);}

/* Push steps (denied state) */
.nd-push-steps{
    text-align:left;margin-bottom:20px;
    display:flex;flex-direction:column;gap:10px;
}
.nd-push-step{
    display:flex;align-items:center;gap:10px;
    font-size: 0.875rem;color:rgba(17,18,20,.7);line-height:1.4;
}
.nd-push-step i{color:var(--p1);font-size: 0.75rem;}
.nd-push-step strong{color:var(--text);}
.nd-push-step-num{
    flex-shrink:0;width:24px;height:24px;
    border-radius:50%;
    background:linear-gradient(135deg,var(--p1),var(--p2));
    color:#fff;font-size: 0.75rem;font-weight:800;
    display:flex;align-items:center;justify-content:center;
}

@keyframes ndFadeIn{from{opacity:0}to{opacity:1}}
@keyframes ndScaleIn{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:scale(1)}}

/* ── Keyboard-focus visibility (a11y) ──────────────────────────── */
/* Only shows for keyboard/assistive-tech focus, not mouse/touch clicks,
   so it layers on top of any existing :focus styling without changing it. */
:focus-visible{
    outline: 3px solid rgba(91,108,255,.55);
    outline-offset: 2px;
}

/* ── Background scroll lock for overlays without .nd-modal-open ─── */
/* .nd-modal-open (toggled on .nd-page via Ui.TopUpOpen) already covers
   TopUpModal; these overlays are conditionally rendered instead, so lock
   scroll straight off their presence in the DOM. */
body:has(.nd-auth-overlay),
body:has(.nd-imgv.is-open){
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   Messages v2 — end-user chat surface (.nd-msg-user)
   Reference-matched messenger look: flat full-width chat rows, one-line
   filter strip, wallpapered conversation, round icon controls, and an
   auto-growing composer. Scoped to .nd-msg-user so the operator chat
   (FakeMessages, scoped CSS) keeps its own look.
   ═══════════════════════════════════════════════════════════════════ */

/* ── chat list: unread badge top-left, online dot top-right ──────── */
.nd-msg-user .nd-msg-unread{
    left: -4px;
    top: -4px;
    right: auto;
}
.nd-msg-user .nd-msg-ava .nd-dot{
    top: 2px;
    right: 2px;
    bottom: auto;
    width: 13px;
    height: 13px;
}

/* mobile-only "16:30 today" line under the snippet */
.nd-msg-when{ display: none; }

/* ── conversation header ─────────────────────────────────────────── */
.nd-msg-user .nd-msg-head{
    background: #fff;
    padding: 10px 12px;
}
.nd-msg-user .nd-msg-back{
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 999px;
    color: rgba(91,108,255,.92);
    font-size: 1rem;
    transition: transform .15s ease, background .15s ease;
}
.nd-msg-user .nd-msg-back span{ display: none; }
.nd-msg-user .nd-msg-back:active{ transform: scale(.92); }

/* online state lives next to the name, not on the avatar */
.nd-msg-user .nd-msg-head-ava .nd-dot{ display: none; }
.nd-msg-head-dot{
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(38,177,95,.95);
    margin-left: 3px;
    vertical-align: middle;
}
.nd-msg-user .nd-msg-head-sub{ font-size: 0.8125rem; }

.nd-msg-head-star{
    margin-left: auto;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(17,18,20,.12);
    background: #fff;
    color: rgba(17,18,20,.28);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.nd-msg-head-star:active{ transform: scale(.92); }
.nd-msg-head-star.is-on{
    color: rgba(255,193,7,.95);
    border-color: rgba(255,193,7,.45);
}
@media (hover: none){
    .nd-msg-user .nd-msg-head-profile:hover{ background: transparent; }
}

/* ── conversation wallpaper: brand gradient + line-art pattern ───── */
.nd-msg-user .nd-msg-thread{
    background:
        url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='240'%20height='240'%20viewBox='0%200%20240%20240'%3E%3Cg%20fill='none'%20stroke='%235B6CFF'%20stroke-opacity='0.09'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20transform='translate(16%2014)%20rotate(-12%2012%2012)'%20d='M20.84%204.61a5.5%205.5%200%200%200-7.78%200L12%205.67l-1.06-1.06a5.5%205.5%200%200%200-7.78%207.78l1.06%201.06L12%2021.23l7.78-7.78%201.06-1.06a5.5%205.5%200%200%200%200-7.78z'/%3E%3Cpath%20transform='translate(148%2032)%20rotate(9%2012%2012)%20scale(1.2)'%20d='M21%2011.5a8.38%208.38%200%200%201-.9%203.8%208.5%208.5%200%200%201-7.6%204.7%208.38%208.38%200%200%201-3.8-.9L3%2021l1.9-5.7a8.38%208.38%200%200%201-.9-3.8%208.5%208.5%200%200%201%204.7-7.6%208.38%208.38%200%200%201%203.8-.9h.5a8.48%208.48%200%200%201%208%208v.5z'/%3E%3Cg%20transform='translate(50%20144)%20rotate(-7%2012%2012)'%3E%3Cpath%20d='M3%206h18v12H3z'/%3E%3Cpath%20d='M3%207l9%206%209-6'/%3E%3C/g%3E%3Cg%20transform='translate(182%20174)%20rotate(11%2012%2012)'%3E%3Cpath%20d='M6%204h12l-6%207z'/%3E%3Cpath%20d='M12%2011v7'/%3E%3Cpath%20d='M8.5%2020h7'/%3E%3C/g%3E%3C/g%3E%3Cg%20fill='none'%20stroke='%23FF5BC8'%20stroke-opacity='0.08'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20transform='translate(194%2082)%20rotate(14%2012%2012)%20scale(0.8)'%20d='M20.84%204.61a5.5%205.5%200%200%200-7.78%200L12%205.67l-1.06-1.06a5.5%205.5%200%200%200-7.78%207.78l1.06%201.06L12%2021.23l7.78-7.78%201.06-1.06a5.5%205.5%200%200%200%200-7.78z'/%3E%3Cpath%20transform='translate(94%2082)%20rotate(-6%2012%2012)%20scale(0.85)'%20d='M12%202l3.09%206.26L22%209.27l-5%204.87%201.18%206.88L12%2017.77l-6.18%203.25L7%2014.14%202%209.27l6.91-1.01L12%202z'/%3E%3Cpath%20transform='translate(110%20194)%20rotate(-10%2012%2012)%20scale(0.9)'%20d='M20.84%204.61a5.5%205.5%200%200%200-7.78%200L12%205.67l-1.06-1.06a5.5%205.5%200%200%200-7.78%207.78l1.06%201.06L12%2021.23l7.78-7.78%201.06-1.06a5.5%205.5%200%200%200%200-7.78z'/%3E%3Cg%20transform='translate(18%20192)%20rotate(8%2012%2012)'%3E%3Ccircle%20cx='12'%20cy='14'%20r='6'/%3E%3Cpath%20d='M12%202l3.5%203-3.5%203-3.5-3z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(165deg, #EFF1FE 0%, #FAEFF8 60%, #F2F0FD 100%);
    background-size: 240px 240px, cover;
}
.nd-msg-user .nd-msg-day{
    border: 0;
    background: rgba(255,255,255,.72);
    font-size: 0.75rem;
    font-weight: 800;
    color: rgba(17,18,20,.52);
    box-shadow: 0 1px 2px rgba(17,18,20,.05);
}

/* ── bubbles: time + ticks sit under the bubble, on the wallpaper ── */
.nd-msg-user .nd-bubble{
    flex-direction: column;
    margin: 8px 0;
}
.nd-msg-user .nd-bubble.is-me{ align-items: flex-end; }
.nd-msg-user .nd-bubble.is-them{ align-items: flex-start; }
.nd-msg-user .nd-bubble-inner{
    border: 0;
    border-radius: 16px;
    padding: 10px 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(17,18,20,.10), 0 5px 16px rgba(17,18,20,.04);
}
.nd-msg-user .nd-bubble.is-me .nd-bubble-inner{
    background: linear-gradient(135deg, rgba(91,108,255,.15), rgba(255,91,200,.13)), #fff;
}
.nd-msg-user .nd-bubble-text{
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: rgba(17,18,20,.88);
}
.nd-msg-user .nd-bubble-meta{
    margin: 4px 6px 0;
    font-size: 0.6875rem;
    font-weight: 800;
    color: rgba(17,18,20,.40);
    gap: 6px;
}

/* ── composer: quiet icons, pill textarea, round gradient send ───── */
.nd-msg-user .nd-msg-compose{
    grid-template-columns: 40px 40px 1fr 46px;
    gap: 8px;
    align-items: end;
}
.nd-msg-user .nd-msg-ic{
    width: 40px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(17,18,20,.45);
    font-size: 1.25rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease, transform .15s ease;
}
.nd-msg-user .nd-msg-ic:active{ transform: scale(.9); }
.nd-msg-user .nd-msg-input{
    height: 46px;
    min-height: 46px;
    max-height: 132px;
    resize: none;
    border: 0;
    border-radius: 23px;
    background: rgba(17,18,20,.055);
    padding: 12px 16px;
    font-family: inherit;
    /* 1rem (16px) everywhere: no iOS focus zoom on any device width */
    font-size: 1rem;
    font-weight: 600;
    line-height: 22px;
    color: rgba(17,18,20,.88);
    overflow-y: hidden;
}
.nd-msg-user .nd-msg-input:focus{
    outline: none;
    box-shadow: 0 0 0 3px rgba(91,108,255,.18);
}
.nd-msg-user .nd-msg-send{
    width: 46px;
    height: 46px;
    border-radius: 999px;
    font-size: 1rem;
    box-shadow: 0 8px 22px rgba(91,108,255,.28);
    transition: transform .15s ease, opacity .15s ease;
}
.nd-msg-user .nd-msg-send:active{ transform: scale(.9); }
.nd-msg-user .nd-msg-send:disabled{ opacity: .55; cursor: default; }

/* ── mobile: the reference layout ────────────────────────────────── */
@media (max-width: 980px){
    /* 2×2 grid — all four toggles visible at once, nothing clipped */
    .nd-msg-user .nd-msg-filters{
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 18px;
        padding: 12px 16px;
        background: #fff;
    }
    .nd-msg-user .nd-ios{ min-width: 0; }
    .nd-msg-user .nd-ios-label{
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.8125rem;
    }
    .nd-msg-user .nd-ios-track{ width: 40px; height: 22px; min-width: 40px; }
    .nd-msg-user .nd-ios-track::after{ width: 16px; height: 16px; }
    .nd-msg-user .nd-ios input:checked + .nd-ios-track::after{ transform: translateX(18px); }

    /* flat full-width rows with hairline dividers instead of cards;
       the list scrolls with the page, not inside the card */
    .nd-msg-user .nd-msg-left{ background: #fff; }
    .nd-msg-user .nd-msg-list{ padding: 0; gap: 0; overflow: visible; }
    .nd-msg-user .nd-msg-item{
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        padding: 12px 14px;
        grid-template-columns: 76px 1fr;
        border-bottom: 1px solid rgba(17,18,20,.06);
        transition: background .18s ease;
    }
    .nd-msg-user .nd-msg-item:active{ background: rgba(91,108,255,.06); }
    .nd-msg-user .nd-msg-item.is-active{
        box-shadow: none;
        border-color: rgba(17,18,20,.06);
        background: transparent;
    }
    .nd-msg-user .nd-msg-ava{
        width: 76px;
        height: 76px;
        border: 0;
        box-shadow: none;
    }

    /* phone keyboards ship their own emoji layer — drop the picker */
    #nd-emoji-btn{ display: none; }
    .nd-msg-user .nd-msg-title{ font-size: 1.0625rem; }
    .nd-msg-user .nd-msg-snippet{
        font-size: 0.9375rem;
        font-weight: 600;
        color: rgba(17,18,20,.60);
    }
    /* time moves under the snippet; favorite lives in the chat header */
    .nd-msg-user .nd-msg-time{ display: none; }
    .nd-msg-user .nd-msg-star{ display: none; }
    .nd-msg-user .nd-msg-bottom{ margin-top: 4px; }
    .nd-msg-user .nd-msg-when{
        display: block;
        margin-top: 5px;
        font-size: 0.75rem;
        font-weight: 600;
        color: rgba(17,18,20,.38);
    }

    /* header sized to the reference */
    .nd-msg-user .nd-msg-head-ava{
        width: 48px;
        height: 48px;
        min-width: 48px;
        flex-basis: 48px;
        box-shadow: none;
    }
    .nd-msg-user .nd-msg-head-title{ font-size: 1.0625rem; }

    /* 16px stops iOS Safari from auto-zooming on focus (must match the
       two-class specificity of the base .nd-msg-user rule above) */
    .nd-msg-user .nd-msg-input{ font-size: 1rem; }

    .nd-msg-user .nd-bubble-inner{ max-width: 84%; }
}

/* ── Respect prefers-reduced-motion globally ───────────────────── */
@media (prefers-reduced-motion: reduce){
    *, *::before, *::after{
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    html{ scroll-behavior: auto !important; }
}

/* ── 404 page actions ─────────────────────────────────── */
.nd-info-actions{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 22px;
}
@media (max-width: 480px){
    .nd-info-actions{ gap: 10px; }
}
