/* Profilo dedicato; ogni regola e' confinata alla sua vista. */
#userProfileView[hidden], #userProfileView [hidden] { display: none !important; }
body.user-profile-open > #catalogView, body.user-profile-open > #bottomNav { display: none !important; }
#userProfileView { max-width: 600px; margin: 0 auto; padding: 16px 16px 32px; color: white; }
#userProfileView .up-header { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
#userProfileView .up-header h1 { font-size: 22px; margin: 0; flex: 1; text-align: right; }
#userProfileView .up-back { background: rgba(255,255,255,.2); border: 2px solid white; color: white; padding: 9px 13px; border-radius: 12px; font-weight: bold; font-size: 13px; cursor: pointer; }
#userProfileView .up-avatar { width: 90px; height: 90px; margin: 0 auto 12px; border-radius: 50%; border: 4px solid white; background: linear-gradient(135deg,#667eea,#764ba2); display: flex; align-items: center; justify-content: center; font-size: 46px; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
#userProfileView .up-name { color: white; text-align: center; font-size: 22px; margin: 0 0 6px; overflow-wrap: anywhere; }
#userProfileView .up-subtitle { text-align: center; color: rgba(255,255,255,.85); margin: 0 0 24px; font-size: 14px; }
#userProfileView .up-sections { display: flex; flex-direction: column; gap: 16px; }
#userProfileView .up-section { background: rgba(255,255,255,.15); border-radius: 20px; padding: 18px; border: 2px solid rgba(255,255,255,.2); }
#userProfileView .up-section h3 { color: white; font-size: 18px; margin: 0 0 13px; }
#userProfileView .up-content { background: rgba(0,0,0,.1); padding: 14px; border-radius: 12px; }
#userProfileView .up-balance-label { margin: 0 0 8px; text-align: center; font-size: 13px; }
#userProfileView .up-balance { text-align: center; font-size: 38px; font-weight: 800; color: white; overflow-wrap: anywhere; }
#userProfileView .up-status { font-size: 12px; line-height: 1.5; margin: 10px 0 0; overflow-wrap: anywhere; }
#userProfileView .up-status:empty { display: none; }
#userProfileView .up-button { border: 0; border-radius: 12px; width: 100%; background: linear-gradient(135deg,#667eea,#764ba2); color: white; padding: 12px; margin-top: 10px; font-size: 13px; font-weight: 700; cursor: pointer; }
#userProfileView .up-button:disabled { opacity: .5; cursor: default; }
#userProfileView .up-retry { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.5); }
#userProfileView .up-help, #userProfileView .up-empty { font-size: 12px; line-height: 1.5; margin: 0 0 10px; color: inherit; }
#userProfileView .up-invite { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 7px; padding: 10px; background: #e8f4fd; border: 1px solid #c3d3f7; border-radius: 10px; color: #333; cursor: pointer; font-weight: 700; }
#userProfileView .up-invite > span:first-child { font-family: monospace; font-size: 14px; letter-spacing: .04em; }
#userProfileView .up-copy-hint { font-size: 11px; color: #667eea; }
#userProfileView .up-invite-used { background: #f8f9fa; cursor: default; font-size: 11px; color: #408e5d; }
#userProfileView .up-invite-used > span:first-child { color: #999; text-decoration: line-through; }
#userProfileView .up-order-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; background: white; border: 2px solid transparent; padding: 12px; border-radius: 14px; margin-bottom: 8px; text-align: left; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
#userProfileView .up-order-card:hover { border-color: #764ba2; }
#userProfileView .up-order-left { flex: 1; min-width: 0; }
#userProfileView .up-order-id { display: block; font: bold 12px monospace; color: #764ba2; margin-bottom: 4px; }
#userProfileView .up-order-products { display: block; font-size: 12px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#userProfileView .up-order-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
#userProfileView .up-order-status { font-size: 11px; color: #444; font-weight: bold; }
#userProfileView .up-order-total { font-size: 13px; color: #408e5d; font-weight: bold; }
#userProfileView .up-order-points { font-size: 11px; color: #764ba2; font-weight: 700; }
#userProfileView .up-detail-overlay { position: fixed; inset: 0; z-index: 9999; padding: 20px; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; }
#userProfileView .up-detail-card { width: 100%; max-width: 360px; max-height: 90vh; overflow-y: auto; border-radius: 24px; background: white; color: #333; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
#userProfileView .up-detail-head { background: linear-gradient(135deg,#f6a623,#f7c948); color: white; padding: 22px 18px 16px; text-align: center; }
#userProfileView .up-detail-head > div { font-size: 44px; }
#userProfileView .up-detail-head h2 { font-size: 18px; margin: 8px 0; }
#userProfileView .up-detail-head p { font-family: monospace; margin: 0; font-size: 12px; }
#userProfileView .up-detail-body { padding: 18px; }
#userProfileView .up-detail-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; padding: 10px 0; border-bottom: 1px solid #eee; }
#userProfileView .up-detail-row strong { text-align: right; overflow-wrap: anywhere; }
#userProfileView .up-detail-products { background: #f8f9fa; border-radius: 14px; padding: 4px 10px; }
#userProfileView .up-detail-total { display: flex; justify-content: space-between; padding: 12px; margin: 12px 0; border-radius: 12px; background: rgba(72,187,120,.1); color: #408e5d; font-weight: bold; }
#userProfileView .up-cancel { background: #fff0f0; color: #e53e3e; border: 2px solid #feb2b2; }
#userProfileView .up-cancel small { display: block; margin-top: 4px; font-size: 10px; }
#userProfileView .up-copy-buffer { position: fixed; opacity: 0; }
#userProfileView .up-detail-products { overflow-wrap: anywhere; }

.notification-consent {
    position: fixed;
    inset: 0;
    width: min(390px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    overflow: auto;
    margin: auto;
    box-sizing: border-box;
    padding: 24px;
    border: 1px solid #64748b;
    border-radius: 20px;
    background: #172338;
    color: #fff;
    box-shadow: 0 12px 48px #0008;
}
.notification-consent::backdrop { background: #0009; }
.notification-consent:not([open]) { display: none; }
.notification-consent h2 { margin: 0 0 12px; font-size: 21px; }
.notification-consent p { margin: 0 0 16px; font-size: 14px; line-height: 1.5; }
#notificationConsentStatus { margin: 10px 0 0; }
#notificationConsentStatus:empty { display: none; }
.notification-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    cursor: pointer;
}
.notification-choice input {
    appearance: none;
    width: 36px;
    height: 20px;
    margin: 0 0 0 auto;
    border-radius: 15px;
    flex: 0 0 36px;
    border: 1px solid #a8b6c8;
    background: radial-gradient(circle at 9px center, #fff 0 6px, transparent 7px), #48556a;
}
.notification-choice input:checked {
    background: radial-gradient(circle at 25px center, #fff 0 6px, transparent 7px), #276854;
}
.notification-choice input:focus-visible { outline: 2px solid white; outline-offset: 3px; }
.notification-choice-value { min-width: 3ch; font-size: 13px; }
.notification-choice-value::after { content: 'OFF'; }
.notification-choice input:checked + .notification-choice-value::after { content: 'ON'; }
#userProfileView .up-notification-toggle { margin: 0; }

#userProfileView .up-access-danger { margin-top: 1.25rem; border-top: 1px solid rgba(245, 102, 115, .35); padding-top: 1rem; }
#userProfileView .up-danger { color: #ffdbe0; background: #792032; border: 1px solid #ba5262; min-height: 44px; }
#userProfileView .up-revoke-panel { width: min(100%, 410px); padding: 1.25rem; border-radius: 14px; background: #21191e; color: #fff; }
#userProfileView .up-revoke-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; }
#userProfileView #profileRevokeDialog[hidden], #userProfileView .up-access-danger[hidden] { display: none; }
