/* The authentication card owns its heading; keep every login entry point centered. */
.bm-container:has(.pama-auth-dialog) { display:flex; align-items:center; justify-content:center; padding:24px 16px; background:rgba(235,231,251,.78); backdrop-filter:blur(5px); }
.bm-container:has(.pama-auth-dialog) > .blazored-modal-focus-trap { width:720px; max-width:100%; min-width:0; }
.blazored-modal:has(.pama-auth-dialog) { flex-shrink:0; width:100%; max-width:100%; max-height:calc(100dvh - 48px); margin:auto; padding:0; overflow:auto; border:1px solid #eeebf8; border-radius:22px; background:linear-gradient(140deg,#fff 35%,#faf9ff); box-shadow:0 20px 70px #4c2a9226; }
.blazored-modal:has(.pama-auth-dialog) > .bm-header { display:none; }
.pama-auth-dialog { color:#201d36; padding:36px; font-family:Roboto,Arial,sans-serif; }
.pama-auth-heading { position:relative; padding-right:38px; }
.pama-auth-heading h1 { margin:0; font-size:38px; line-height:1.18; font-weight:700; letter-spacing:-1px; color:#201d36; }
.pama-auth-heading p { color:#77748e; font-size:19px; margin:8px 0 0; line-height:1.4; }
.pama-auth-close { position:absolute; top:-8px; right:-7px; display:grid; place-items:center; width:40px; height:40px; padding:0; border:0; background:transparent; color:#7a7889; font-size:40px; font-weight:300; line-height:1; border-radius:10px; }
.pama-auth-close:hover { background:#f0ecfa; }
.pama-auth-brand { display:flex; flex-direction:column; align-items:center; gap:20px; padding:28px 0 36px; }
.pama-id-mark { display:grid; place-items:center; width:150px; height:146px; flex-shrink:0; border-radius:36px; color:#fff; background:linear-gradient(35deg,#4b2d8a,#773cc8 60%,#a456ff); font-size:96px; font-weight:800; letter-spacing:-5px; line-height:1; padding-right:5px; box-shadow:0 14px 23px #784bd61c; }
.pama-auth-brand p { color:#78718f; font-size:18px; letter-spacing:2px; text-align:center; margin:0; }
.pama-login-methods { display:grid; grid-template-columns:220px 1px minmax(0,1fr); gap:28px; align-items:stretch; }
.pama-qr-panel { padding:22px 16px; border-radius:17px; background:linear-gradient(135deg,#f4f0fd,#f0edfa); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:24px; }
.pama-qr-code { display:grid; place-items:center; width:188px; height:188px; padding:6px; background:white; border:1px solid #e6e2f2; border-radius:17px; overflow:hidden; }
.pama-qr-code img { display:block; width:100%; height:auto; }
.pama-qr-code > div { text-align:center; color:#77748e; font-size:14px; }
.pama-qr-code .pama-auth-link { display:block; margin:12px auto 0; }
.pama-qr-caption { display:flex; align-items:flex-start; gap:10px; width:100%; }
.pama-qr-caption .mud-icon-root { color:#793ada; width:28px; height:28px; }
.pama-qr-caption strong { font-size:17px; font-weight:500; display:block; }
.pama-qr-caption span { color:#7b7493; font-size:13px; display:block; margin-top:5px; }
.pama-auth-divider { position:relative; background:#e7e2f1; }
.pama-auth-divider span { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); display:grid; place-items:center; width:38px; height:46px; border-top:5px solid #fff; border-bottom:5px solid #fff; border-radius:50%; background:#f0edfb; color:#79708f; font-size:17px; }
.pama-login-form { display:flex; flex-direction:column; gap:18px; justify-content:center; padding-top:16px; }
.pama-auth-field { margin:0; display:flex; align-items:center; gap:12px; min-height:62px; padding:0 17px; border:1.5px solid #ded9ec; border-radius:11px; background:#ffffffa8; color:#868096; }
.pama-auth-field:focus-within { border-color:#9950f3; box-shadow:0 0 0 3px #9950f312; }
.pama-auth-field .mud-icon-root { width:24px; height:24px; flex-shrink:0; }
.pama-auth-field input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:#201d36; font-size:18px; padding:0; height:58px; }
.pama-auth-field input::placeholder { color:#9690a6; opacity:1; }
.pama-password-toggle { padding:6px; margin-right:-6px; border:0; border-radius:6px; background:transparent; color:#858092; display:flex; }
.pama-auth-primary { display:inline-flex; justify-content:center; align-items:center; gap:16px; min-height:54px; border:0; border-radius:11px; padding:12px 22px; background:linear-gradient(115deg,#9d4cf6,#7545ce); color:white; font-size:18px; font-weight:500; box-shadow:0 8px 18px #8645d919; cursor:pointer; }
.pama-auth-primary span { font-size:27px; line-height:1; }
.pama-auth-primary:hover { filter:brightness(1.04); }
.pama-auth-primary:disabled { opacity:.65; cursor:wait; }
.pama-login-form > .pama-auth-primary { margin-top:12px; }
.pama-auth-link { padding:3px 0; border:0; background:transparent; color:#793bce; font-size:17px; font-weight:500; cursor:pointer; }
.pama-auth-cancel { align-self:center; margin:4px 0 0; }
.pama-auth-dialog button:focus-visible,.pama-auth-dialog input:focus-visible { outline:2px solid #9950f3; outline-offset:3px; }
.pama-auth-field input:focus-visible { outline:0; }
.pama-auth-error { color:#a32a43; font-size:14px; background:#fff1f3; border-radius:8px; padding:10px 12px; margin:0; }
.pama-visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.pama-invite .pama-auth-heading,.pama-signup .pama-auth-heading { margin-bottom:26px; }
.pama-invite .pama-auth-heading h1,.pama-signup .pama-auth-heading h1 { font-size:30px; }
.pama-invite .pama-auth-heading p,.pama-signup .pama-auth-heading p { font-size:16px; }
.pama-invite > p { color:#78718f; line-height:1.6; }
.pama-invite-label { display:block; font-size:14px; margin:22px 0 8px; }
.pama-invite-copy { display:flex; gap:10px; }
.pama-invite-copy input { flex:1; min-width:0; border:1px solid #ded9ec; border-radius:10px; padding:12px; color:#554e6d; background:#fbfaff; }
.pama-invite-copy button { flex-shrink:0; font-size:16px; }
.pama-auth-note { font-size:13px; margin:10px 0 24px; }
.pama-invite > .pama-auth-error { margin:16px 0; }
.pama-signup-page { min-height:calc(100dvh - 100px); display:flex; justify-content:center; align-items:center; padding:28px 0; }
.pama-signup { width:520px; max-width:100%; border:1px solid #eeebf8; border-radius:22px; background:white; box-shadow:0 20px 70px #4c2a9214; }
.pama-registration-fields { display:flex; flex-direction:column; gap:7px; }
.pama-registration-fields label { display:flex; flex-direction:column; gap:6px; color:#625873; font-size:14px; margin:8px 0 0; }
.pama-registration-fields input { padding:13px 14px; border:1px solid #ded9ec; border-radius:10px; color:#201d36; background:#fff; font-size:16px; }
.pama-registration-fields .pama-auth-primary { margin-top:18px; }
.pama-registration-fields .validation-message { font-size:13px; color:#a32a43; }
.pama-invitation-context { padding:12px; border-radius:10px; background:#f5f0ff; color:#706287; font-size:14px; }
.pama-signup > .pama-auth-error { margin-top:18px; }
.pama-registration-success { display:flex; flex-direction:column; align-items:center; text-align:center; gap:22px; }
.pama-registration-success h2 { font-size:23px; margin:0; }
.pama-registration-success p { color:#77748e; }
@media(max-width:620px) {
    .bm-container:has(.pama-auth-dialog) { padding:12px; }
    .blazored-modal:has(.pama-auth-dialog) { max-height:calc(100dvh - 24px); border-radius:18px; }
    .pama-auth-dialog { padding:24px; }
    .pama-auth-heading h1 { font-size:30px; }
    .pama-auth-heading p { font-size:16px; }
    .pama-auth-brand { padding:24px 0; gap:18px; }
    .pama-id-mark { width:106px; height:104px; border-radius:27px; font-size:68px; }
    .pama-auth-brand p { font-size:14px; letter-spacing:1px; }
    .pama-login-methods { display:flex; flex-direction:column; gap:24px; }
    .pama-login-form { order:0; padding-top:0; gap:14px; }
    .pama-auth-divider { order:1; height:1px; margin:4px 0; }
    .pama-auth-divider span { height:32px; border:0; }
    .pama-qr-panel { order:2; flex-direction:row; padding:16px; gap:16px; }
    .pama-qr-code { flex-shrink:0; width:116px; height:116px; border-radius:12px; }
    .pama-qr-caption { flex-direction:column; gap:5px; }
    .pama-qr-caption strong { font-size:15px; }
    .pama-invite-copy { flex-direction:column; }
    .pama-signup-page { padding:18px 0; }
}
/* Shared profile photos retain the size and presence badge of each existing avatar. */
.pama-user-photo { width:100%; height:100%; min-width:0; display:block; object-fit:cover; border-radius:inherit; }
.bm-container:has(.pama-profile) > .blazored-modal-focus-trap { width:620px; }
.pama-profile { padding:28px; }
.pama-profile .pama-auth-heading h1 { font-size:28px; }
.pama-profile .pama-auth-heading p { font-size:14px; }
.profile-photo-row { display:flex; gap:18px; align-items:center; margin:24px 0; }
.profile-avatar { position:relative; display:flex; align-items:center; justify-content:center; width:84px; height:84px; border-radius:50%; background:#eee9fc; color:#7139ba; font-size:28px; flex-shrink:0; }
.profile-remove-photo { position:absolute; right:0; bottom:0; display:flex; align-items:center; justify-content:center; width:26px; height:26px; padding:0; border:2px solid #fff; border-radius:50%; background:#d94356; color:#fff; font-size:22px; line-height:1; cursor:pointer; }
.profile-remove-photo:hover:not(:disabled) { background:#bd3044; }
.profile-remove-photo:disabled { opacity:.55; cursor:wait; }
.profile-photo-row strong,.profile-photo-row small,.profile-username { display:block; }
.profile-photo-row small,.profile-username { color:#77748e; font-size:12px; }
.profile-upload { position:relative; display:inline-block; overflow:hidden; margin:8px 14px 6px 0; color:#8343d5; font-size:14px; cursor:pointer; }
.profile-upload input { position:absolute; inset:0; width:100%; opacity:0; cursor:pointer; }
.profile-upload:focus-within { outline:2px solid #8343d5; outline-offset:3px; }
.profile-tabs { display:flex; gap:20px; border-bottom:1px solid #e6dfef; margin-bottom:20px; }
.profile-tabs button { padding:10px 0; border:0; border-bottom:2px solid transparent; background:none; color:#77748e; font-size:14px; }
.profile-tabs button.active { color:#8343d5; border-bottom-color:#8343d5; }
.profile-fields { border:0; padding:0; margin:0; display:grid; grid-template-columns:1fr 1fr; gap:16px; min-width:0; }
.profile-fields label { display:flex; flex-direction:column; gap:6px; font-size:13px; color:#645b76; margin:0; min-width:0; }
.profile-fields input { width:100%; min-width:0; border:1px solid #ded9ec; border-radius:9px; padding:10px 12px; font-size:15px; color:#201d36; background:white; }
.profile-fields input:focus { outline:2px solid #b788ee; outline-offset:1px; }
.profile-password-fields { grid-template-columns:1fr; }
.profile-account-info { font-size:12px; color:#77748e; margin-top:18px; }
.profile-actions { display:flex; align-items:center; justify-content:flex-end; gap:24px; margin-top:24px; }
.profile-actions .pama-auth-primary { font-size:15px; min-height:42px; padding:9px 20px; }
.profile-success { padding:10px 12px; background:#edf7ef; color:#276b39; border-radius:8px; font-size:14px; margin-top:16px; }
.pama-profile .validation-errors { color:#b73952; padding-left:18px; font-size:13px; }
@media(max-width:480px) { .pama-profile { padding:20px; } .profile-fields { grid-template-columns:1fr; gap:12px; } .profile-photo-row { gap:12px; } .profile-avatar { width:64px; height:64px; } }

.pama-existing-account { display:block; margin:18px auto 0; text-align:center; }
.pama-login-page { display:flex; align-items:center; justify-content:center; min-height:calc(100dvh - 100px); padding:24px 16px; }
.pama-login-page>.pama-login { width:468px; max-width:100%; border:1px solid #eeebf8; border-radius:22px; background:linear-gradient(140deg,#fff 35%,#faf9ff); box-shadow:0 20px 70px #4c2a9214; }
@media(max-width:480px) { .pama-login-page { padding:16px 0; } }

/* Team management uses the same dialog, tabs and form language as Profile. */
.team-identity { display:flex; align-items:center; gap:14px; margin:24px 0; }
.team-symbol { display:grid; place-items:center; width:56px; height:56px; flex-shrink:0; border-radius:16px; background:#eee9fc; color:#793bce; font-size:22px; }
.team-identity>div { min-width:0; overflow-wrap:anywhere; }
.team-identity strong { font-size:17px; overflow-wrap:anywhere; }
.team-identity span:not(.team-symbol):not(.oi) { display:block; color:#77748e; font-size:12px; margin-top:3px; }
.team-tabs { gap:24px; flex-wrap:wrap; }
.team-tabs button { min-height:44px; }
.team-section-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.team-section-heading h2 { margin:0; font-size:16px; font-weight:600; }
.team-section-heading .pama-auth-link { font-size:14px; min-height:44px; }
.team-note,.team-invitation>p { color:#77748e; font-size:13px; line-height:1.6; }
.team-list { list-style:none; padding:0; margin:0; }
.team-member { display:flex; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid #eee8f5; }
.team-avatar { display:flex; align-items:center; justify-content:center; flex:0 0 42px; width:42px; height:42px; border-radius:50%; background:#eee9fc; color:#7139ba; font-size:15px; }
.team-member-details { flex:1; min-width:0; }
.team-member-details strong,.team-product strong { display:block; font-size:14px; font-weight:500; overflow-wrap:anywhere; }
.team-member-details span,.team-product > div > span { display:block; font-size:12px; color:#77748e; overflow-wrap:anywhere; }
.team-member-details small { margin-left:4px; color:#77748e; font-size:12px; font-weight:400; }
.team-access-button { min-height:44px; min-width:68px; padding:8px 12px; border:1px solid #e6dfef; border-radius:9px; background:white; color:#793bce; font-size:13px; }
.team-access-button:disabled { opacity:.6; }
.team-blocked { border-radius:6px; padding:4px 7px; color:#9b3e54; background:#fff0f3; font-size:11px; }
.team-count { padding:3px 9px; border-radius:12px; background:#f2ecfc; color:#793bce; font-size:12px; }
.team-product { display:flex; align-items:flex-start; gap:12px; padding:16px 0; border-bottom:1px solid #eee8f5; }
.team-product-icon { display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; border-radius:9px; background:#f2ecfc; color:#793bce; }
.team-product>div { min-width:0; }
.team-product p { font-size:13px; color:#77748e; margin:6px 0 0; overflow-wrap:anywhere; }
.team-fields { grid-template-columns:1fr; }
.team-fields textarea { width:100%; min-width:0; border:1px solid #ded9ec; border-radius:9px; padding:10px 12px; font:inherit; font-size:15px; color:#201d36; background:white; resize:vertical; }
.team-fields textarea:focus-visible { outline:2px solid #b788ee; outline-offset:1px; }
.pama-team>.pama-auth-error { margin-top:16px; }
.team-loading,.team-empty { margin:24px 0; }
.pama-team .profile-actions button { min-height:44px; }
.team-invitation .pama-auth-primary { min-height:44px; font-size:14px; padding:10px 16px; }
.team-invitation .pama-auth-link { font-size:14px; min-height:44px; }
@media(max-width:480px) {
    .team-tabs { justify-content:space-between; gap:10px; }
    .team-tabs button { font-size:13px; }
    .team-member { flex-wrap:wrap; gap:10px; }
    .team-member-details { min-width:80px; }
    .team-blocked { order:1; margin-left:52px; }
    .team-invitation .pama-invite-copy { flex-direction:column; }
    .team-invitation .pama-invite-copy input { width:100%; }
}

/* Product management is 30% narrower than the shared 620px settings dialog. */
.bm-container:has(.product-management) > .blazored-modal-focus-trap { width:434px; }
.product-management .team-product { flex-wrap:wrap; align-items:center; }
.product-management .product-summary { flex:1 1 110px; }
.product-management .product-actions { display:flex; gap:8px; margin-left:auto; }
.product-management .product-actions .team-access-button { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; white-space:nowrap; }
.product-management .product-actions .team-access-button:hover { background:#f8f5ff; }
.product-management .product-actions .team-access-button:focus-visible { outline:2px solid #8343d5; outline-offset:2px; }
.product-management form { margin-top:20px; }

/* Product management actions follow the existing primary action style. */
.bm-container:has(.product-management) > .blazored-modal-focus-trap { width:560px; max-width:calc(100vw - 32px); }
.product-management .product-actions { margin-left:auto; gap:8px; }
.product-management .product-actions .pama-auth-primary { width:122px; min-height:36px; padding:7px 10px; font-size:12px; margin:0; gap:7px; }
.product-management .product-back { display:inline-flex; margin:12px 0; }
.product-management .product-back + form { margin-top:0; }
@media(max-width:540px) { .product-management .product-actions { width:100%; justify-content:flex-end; } }

.miniapp-model-picker{display:flex;flex-direction:column;gap:4px;min-width:0;max-width:100%;font-size:12px;color:#5b3a85}.miniapp-model-picker select{max-width:100%;min-height:42px;padding:8px 10px;border:1px solid #e6dcf3;border-radius:8px;background:#fff;color:#424142;font-size:14px}.miniapp-refine-composer .miniapp-model-picker{flex:1 1 180px}

/* Team settings keep context visible while long tabs scroll independently. */
.blazored-modal:has(.pama-team){overflow:hidden}
.pama-team{display:flex;flex-direction:column;max-height:calc(100dvh - 48px);overflow:hidden}
.pama-team>.pama-auth-heading,.pama-team>.team-identity,.pama-team>.team-tabs{flex-shrink:0}
.pama-team .team-tabs{flex-wrap:nowrap;overflow-x:auto;white-space:nowrap;gap:20px;margin-bottom:0}
.pama-team .team-tab-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:22px 14px 4px 0;margin-right:-14px}
.pama-team .team-tab-content:focus-visible{outline:2px solid #a86bfa;outline-offset:-2px}
@media(max-width:480px){.pama-team .team-tabs{gap:14px}.pama-team .team-tabs button{font-size:13px}.pama-team{max-height:calc(100dvh - 32px)}}

/* Team selection shares the original Pama ID field styling. */
.pama-auth-field select {flex:1;min-width:0;width:100%;border:0;background:transparent;color:inherit;font:inherit;outline-offset:4px;padding:12px 0;}
.pama-auth-help {font-size:13px;line-height:1.5;}

/* Show the supported sign-in method across the full original card. */
.pama-login .pama-login-methods.pama-login-password { grid-template-columns:minmax(0,1fr); }
.pama-login .pama-auth-primary { min-height:44px; }

/* Compact Pama ID: QR beside the brand and credentials, without a separate hero row. */
.pama-login-page > .pama-login,
.bm-container:has(.pama-login) > .blazored-modal-focus-trap { width:640px; max-width:100%; }
.pama-login { padding:24px; }
.pama-login .pama-auth-heading { margin-bottom:20px; }
.pama-login .pama-auth-heading h1 { font-size:26px; letter-spacing:-.5px; }
.pama-login .pama-auth-heading p { font-size:14px; margin-top:4px; }
.pama-login .pama-login-methods:has(.pama-qr-panel) { display:grid; grid-template-columns:220px 1px minmax(0,1fr); gap:20px; align-items:start; }
.pama-login .pama-auth-brand { padding:0 0 8px; gap:10px; }
.pama-login .pama-id-mark { width:80px; height:80px; font-size:52px; border-radius:20px; letter-spacing:-2px; padding-right:2px; }
.pama-login .pama-auth-brand p { font-size:12px; line-height:1.4; letter-spacing:0; }
.pama-login .pama-login-form { padding:0; gap:12px; min-width:0; justify-content:flex-start; width:280px; max-width:100%; justify-self:center; }
.pama-login .pama-login-methods:has(.pama-qr-panel) .pama-auth-brand { margin-top:-12px; }
.pama-login-page > .pama-login-team,
.bm-container:has(.pama-login-team) > .blazored-modal-focus-trap { width:448px; max-width:100%; }
.pama-login-team .pama-login-form { width:100%; }
.pama-login .pama-auth-field { min-height:44px; gap:8px; padding:0 10px; border-radius:9px; }
.pama-login .pama-auth-field input { height:42px; font-size:16px; }
.pama-login .pama-auth-field .mud-icon-root { width:20px; height:20px; }
.pama-login .pama-auth-primary { min-height:44px; padding:9px 16px; margin-top:0; font-size:16px; }
.pama-login .pama-auth-link { font-size:14px; min-height:32px; }
.pama-login .pama-qr-panel { padding:10px; gap:12px; flex-direction:column; order:0; }
.pama-login .pama-qr-code { width:200px; height:200px; max-width:100%; padding:0; border-radius:4px; }
.pama-login .pama-qr-code > div { padding:12px; font-size:13px; }
.pama-login .pama-qr-caption { flex-direction:column; align-items:center; text-align:center; gap:4px; }
.pama-login .pama-qr-caption strong { font-size:14px; }
.pama-login .pama-qr-caption span { font-size:12px; line-height:1.4; margin:0; }
.pama-login .pama-auth-divider { align-self:stretch; height:auto; margin:0; }
.pama-login .pama-auth-divider span { width:28px; height:36px; font-size:13px; }
.pama-login .pama-invitation-context { margin-bottom:10px; }
.pama-login > .pama-auth-link { display:inline-block; margin-bottom:16px; }
@media(max-width:620px) {
 .pama-login { padding:20px; }
 .pama-login .pama-login-methods:has(.pama-qr-panel) { display:flex; flex-direction:column; gap:20px; }
 .pama-login .pama-login-form,.pama-login .pama-qr-panel { width:100%; }
 .pama-login .pama-login-methods:has(.pama-qr-panel) .pama-auth-brand { margin-top:0; }
 .pama-login .pama-auth-brand { flex-direction:row; justify-content:flex-start; text-align:left; }
 .pama-login .pama-auth-brand p { text-align:left; }
 .pama-login .pama-id-mark { width:48px; height:48px; font-size:32px; border-radius:12px; }
 .pama-login .pama-qr-panel { order:2; }
 .pama-login .pama-auth-divider { display:none; }
}

/* Review: reduce only the desktop credential column by 30% (329px to 230.3px).
   The QR column, divider, gaps, padding and separate team-selection card retain their sizes. */
@media(min-width:621px) {
 .pama-login-page > .pama-login:has(.pama-qr-panel),
 .bm-container:has(.pama-login .pama-qr-panel) > .blazored-modal-focus-trap { width:541.3px; }
}
