/* Shared finishing rules: keep names, avatars and compact navigation consistent. */
.social-page-title, .social-page-subtitle { text-shadow: none; filter: drop-shadow(0 1px 2px #000c) drop-shadow(0 2px 4px #0008); }
.network-finder .bdx-section-title { text-shadow: none; }
.social-switch--cards { position: relative; display: flex; align-items: center; gap: var(--space-1); width: fit-content; max-width: 100%; margin: 0 auto var(--space-4); padding: var(--space-1); box-sizing: border-box; background: #ffffff80; backdrop-filter: blur(12px) saturate(150%); -webkit-backdrop-filter: blur(12px) saturate(150%); border: 1px solid #ffffffcc; border-radius: 24px; }
.social-switch--cards a { position: relative; z-index: 1; flex: 1 1 0; min-width: 132px; display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 20px; text-decoration: none; color: #3f3f3f; font-weight: 600; font-size: .8rem; transition: color .2s; }
.social-switch--cards a.active { background: var(--nav-active-color); color: var(--nav-active-text); }
.social-switch--cards .nav-pill { position: absolute; z-index: 0; top: 50%; left: 0; width: calc(50% - 8px); height: 34px; border-radius: 20px; background: var(--nav-active-color); transform: translate(0, -50%); transition: transform .34s cubic-bezier(.34, 1.4, .5, 1); pointer-events: none; opacity: 0; }
.social-switch--cards.nav-pill-ready .nav-pill { opacity: 1; }
.social-switch--cards.nav-pill-ready a.active { background: transparent; }
@media (prefers-reduced-motion: reduce) { .social-switch--cards .nav-pill { transition: none; } }
@media (max-width: 768px) { html:not(.bdx-desktop-nav) body:has(.social-switch--cards) { padding-bottom: calc(140px + env(safe-area-inset-bottom)); } }
@media (max-width: 768px) {
    html:not(.bdx-desktop-nav) .social-switch:is(.social-switch--people, .social-switch--cards) { display: flex; align-items: center; position: fixed; bottom: max(73px, calc(58px + env(safe-area-inset-bottom))); left: 50%; transform: translateX(-50%); width: min(280px, calc(100% - 48px)); max-width: 280px; margin: 0; box-sizing: border-box; height: 47px; padding: 4px; gap: 0; z-index: 999; border: 1px solid #ffffffcc; border-bottom: none; border-radius: 22px 22px 0 0; background: #ffffff73; backdrop-filter: blur(12px) saturate(150%); -webkit-backdrop-filter: blur(12px) saturate(150%); }
    html:not(.bdx-desktop-nav) .social-switch:is(.social-switch--people, .social-switch--cards) a { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; height: 36px; display: flex; align-items: center; justify-content: center; gap: 0; color: #3f3f3f; text-decoration: none; font-weight: 600; font-size: .8rem; border-radius: 22px; }
    html:not(.bdx-desktop-nav) .social-switch:is(.social-switch--people, .social-switch--cards) a svg { flex: 0 0 16px; }
    html:not(.bdx-desktop-nav) .social-switch:is(.social-switch--people, .social-switch--cards) a.active { background: var(--nav-active-color); color: var(--nav-active-text); }
    html:not(.bdx-desktop-nav) .social-switch:is(.social-switch--people, .social-switch--cards) .nav-pill { position: absolute; z-index: 0; top: 22px; left: 0; height: 34px; width: calc(33.333% - 8px); border-radius: 20px; background: var(--nav-active-color); transform: translate(0, -50%); transition: transform .34s cubic-bezier(.34, 1.4, .5, 1); pointer-events: none; opacity: 0; }
    html:not(.bdx-desktop-nav) .social-switch:is(.social-switch--people, .social-switch--cards).nav-pill-ready .nav-pill { opacity: 1; }
    html:not(.bdx-desktop-nav) .social-switch:is(.social-switch--people, .social-switch--cards).nav-pill-ready a.active { background: transparent; }
    @media (prefers-reduced-motion: reduce) { html:not(.bdx-desktop-nav) .social-switch:is(.social-switch--people, .social-switch--cards) .nav-pill { transition: none; } }
}
@media (min-width: 769px) { .social-switch.social-switch--people { display: none; } }
html.bdx-desktop-nav .social-switch.social-switch--people { display: none; }
html .bdx-popup .bdx-back, .bdx-back.bdx-back { box-sizing: border-box; width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important; flex: 0 0 44px; padding: 0 !important; border: 1px solid var(--border-subtle) !important; border-radius: 50% !important; background: #fff !important; color: var(--action-primary) !important; box-shadow: var(--shadow-soft) !important; align-items: center; justify-content: center; text-decoration: none; }
.bdx-back:not([hidden]) { display: inline-flex; }
.bdx-back svg { flex: 0 0 20px; width: 20px !important; height: 20px !important; margin: 0 !important; }
.bdx-back:focus-visible { outline: 3px solid var(--action-primary); outline-offset: 3px; }
.home-hero .home-hero__avatar-wrap { width: 120px; height: 120px; padding: 4px; box-sizing: border-box; border-radius: 30px; background: #fff; box-shadow: none; }
.home-hero .home-hero__avatar { border-radius: 26px; }
.settings-profile .settings-profile__frame { border-radius: 24px; box-sizing: border-box; }
.settings-profile .settings-profile__avatar, .settings-profile .settings-profile__initial { border-radius: 21px; }
.border-option .border-preview { border-radius: 18px; background: #fff; }
.border-option .border-preview img { border-radius: 14px; }
.home-hero .home-hero__name { flex-wrap: nowrap; min-width: 0; gap: 5px; }
.bdx-fit-name, .name-ellipsis { min-width: 0; white-space: nowrap !important; overflow-wrap: normal !important; word-break: normal !important; text-overflow: clip !important; }
.bdx-fit-name { display: inline-block; max-width: 100%; }
.home-hero__name > .bdx-fit-name { flex: 0 1 auto; }
.gold-username.gold-username { color: #926b0a; background-image: linear-gradient(110deg, #926b0a 15%, #c29320 35%, #ffe392 49%, #c29320 63%, #926b0a 85%); background-size: 220% 100%; background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 0 10px #f0bc4433; animation: gold-username-shimmer 4s linear infinite; }
.friends-controls .fr-toolbar { margin: 0; gap: 8px; align-items: center; }
.friends-controls .fr-sort__btn, .friends-controls .fr-requests-btn { box-sizing: border-box; min-height: 40px; padding: 8px 12px !important; margin: 0; border: 1px solid #dce3eb; border-radius: 999px; background: #fff; color: var(--action-primary); font-size: .8rem; font-weight: 700; box-shadow: none; }
.friends-controls .fr-sort__menu { padding: 4px; min-width: 170px; border-radius: 12px; border: 1px solid #dce3eb; box-shadow: 0 8px 24px #1c25301f; }
.friends-controls .fr-sort__opt { border-radius: 8px; padding: 10px 12px; }
.friend-card.friend-card.expanded .friend-header { padding-bottom: 8px; }
.friend-card.friend-card.expanded .friend-details-inner { gap: 8px; padding-top: 8px; border-top: 1px solid #1c253018; }
.friend-card .friend-stat { padding: 4px; border: 0; background: transparent; }
.friend-card .friend-stat__value { font-size: 1.1rem; }
.friend-card .friend-last-log { padding: 8px; border: 0; background: #f5f7fa; }
.friend-card .friend-last-log__value { font-size: .8rem; font-weight: 600; }
.referral-strip.referral-strip { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; box-sizing: border-box; max-width: 100%; padding: 12px 15px; margin: var(--space-4) auto var(--space-6); background: rgba(255,255,255,.72); color: var(--text-strong); }
.referral-strip .referral-strip__text { flex: 1; min-width: 0; margin: 0; font-size: .8rem; color: inherit; }
.referral-strip .referral-strip__btn { flex: 0 0 auto; margin: 0; }
.friends-load-more-wrap { display: flex; justify-content: center; margin-bottom: var(--space-5); }
.friends-load-more-wrap .load-more-btn { margin-inline: auto; width: auto; }
.friends-load-more-wrap .is-loading::after { content: ''; width: .8em; height: .8em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: friends-button-spin .7s linear infinite; }
@keyframes friends-button-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .friends-load-more-wrap .is-loading::after { animation: none; } }
#fr-add-panel form { align-items: stretch; }
#fr-add-panel input { max-width: none !important; width: 100%; }
#fr-add-panel button { width: 100% !important; }
.settings-app.settings-app .settings-group { margin: 0 0 20px; padding: 0; overflow: hidden; background: #fff; border: 1px solid #dce3eb; border-radius: 16px; box-shadow: var(--shadow-soft); }
.settings-app.settings-app .settings-group-title { position: static; display: block; width: auto; max-width: none; margin: 0; padding: 14px 16px; border: 0; border-bottom: 1px solid #e4e8ef; border-radius: 0; background: #f5f7fa; color: #596879; font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; box-shadow: none; transform: none; }
.settings-app.settings-app .settings-row, .settings-app.settings-app .settings-link-row { min-height: 56px; padding: 14px 16px; border-radius: 0; }
.settings-app.settings-app .settings-list--single > .settings-row { padding: 0; }
.settings-theme-control { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); flex: 0 0 auto; }
.settings-theme-preview { width: 64px; height: 24px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); box-sizing: border-box; }
@media (max-width: 768px) {
    .settings-app .priv-row { flex-direction: column; align-items: stretch; gap: var(--space-2); }
    .settings-app .priv-row .settings-row-text { flex: none; }
    .settings-app .priv-control { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-left: 0; }
}
.settings-app.settings-app .settings-subpage { margin-bottom: 24px; }
.settings-app.settings-app .settings-profile { padding-bottom: 20px; }
.settings-app.settings-app .settings-profile__name { max-width: 100%; color: #fff; text-shadow: none; filter: drop-shadow(0 1px 2px #000c) drop-shadow(0 2px 4px #0008); }
.settings-profile-customise-actions { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin-bottom: 90px; text-align: center; }
.settings-profile-customise-actions .bdx-help { margin: 0; }
.widget-order-list { touch-action: pan-y; }
.widget-order-row { min-height: 52px; }
.widget-order-row.is-dragging { position: relative; z-index: 2; background: var(--surface-info); border-radius: var(--radius-md); box-shadow: 0 8px 24px #1c253033; will-change: transform; }
.widget-order-row .widget-order-handle { touch-action: none; cursor: grab; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; color: #596879; background: #edf1f6; font-size: 22px; }
.widget-order-row .widget-order-handle:active { cursor: grabbing; }
.timeline-time .bdx-relative-time { display: inline; padding: 2px 0; margin: 0; min-height: 0; width: auto !important; color: inherit; background: none; border: 0; border-radius: 0; font: inherit; cursor: pointer; text-decoration-line: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
/* Inline history controls never inherit the global raised button treatment. */
button.attribute-history-trigger,
.timeline-time .bdx-relative-time { appearance: none; box-shadow: none; transform: none; }
@media (prefers-reduced-motion: reduce) { .gold-username.gold-username { animation: none; } }
@media (max-width: 420px) {
    .home-hero .home-hero__id { gap: 10px; }
    .home-hero .home-hero__avatar-wrap { width: 84px; height: 84px; border-radius: 21px; }
    .home-hero .home-hero__avatar { border-radius: 17px; }
    .home-hero.home-hero--has-customise .home-hero__name { padding-right: 0; }
    .home-hero--has-customise .home-hero__meta { padding-top: 32px; }
}

.settings-app.settings-app .settings-group > .settings-link-row { border-radius: 0 !important; }

#fr-manage-popup .fr-manage-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.friend-card .friend-toggle { border-radius: 50% !important; border-color: transparent !important; background: #f3f6fa !important; }

/* Expanded stats must remain readable over every selectable profile gradient. */
.friend-card .friend-stats-container { padding: 12px 8px; background: var(--surface-muted); border-radius: 12px; }
.friend-card .friend-stat__label { color: var(--text-muted); }
.customise-other { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 14px 16px; min-height: 44px; box-sizing: border-box; border: 1px dashed #c6ced9; border-radius: 12px; background: #eaf0f6; color: var(--text-strong); text-decoration: none; }
.customise-other strong { display: block; font-size: .9rem; }
.customise-other small { display: block; margin-top: 4px; font-size: .75rem; color: var(--text-muted); }
.customise-other svg { flex: 0 0 20px; color: var(--text-muted); }
.customise-other:hover { background: #dfe8f1; }
.bdx-time-pill { position: fixed; z-index: 10000; max-width: calc(100vw - 24px); box-sizing: border-box; padding: 6px 10px; border: 1px solid #dce3eb; border-radius: 999px; background: #fff; color: #334155; box-shadow: 0 3px 12px #172d4520; font: 600 .75rem/1.4 var(--font-ui); text-align: center; pointer-events: none; }
.bdx-time-pill[hidden] { display: none; }

.profile-icon-action { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; border: 1px solid var(--border-subtle); border-radius: 50%; background: #fff; color: var(--action-primary); box-shadow: 0 3px 8px #0004; cursor: pointer; }
.profile-icon-action--danger, .profile-icon-action[title="Report User"] { color: var(--action-danger); }
.profile-actions > .profile-icon-action, .profile-actions > form { flex: 0 0 auto; }
.profile-actions > form { margin: 0; }
.profile-icon-action[title="Customise Profile"], .home-hero .home-hero__customise { color: #7856b8; }
.profile-icon-action[title="User Settings"] { color: var(--text-muted); }
.profile-icon-action:disabled { opacity: .6; cursor: default; }
.referral-strip__avatar { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border-radius: 14px; background: #ffffff80; color: var(--text-muted); font-size: 28px; }
.profile-picture-preview { width: min(320px, 100%); aspect-ratio: 1; margin: auto; padding: 8px; box-sizing: border-box; border-radius: 25%; background: #fff; }
.profile-picture-preview img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: calc(25% - 8px); }
.global-bus-search-result { display: flex; flex-direction: column; gap: var(--space-1); color: var(--text-strong); text-decoration: none; overflow-wrap: anywhere; }
#global-bus-search { margin-bottom: var(--space-4); }
.logres-friends .route-step__body { overflow-wrap: anywhere; }
.logres-friends .route-step::before { left: 18px; top: 36px; }
.logres-friends .route-step__marker { width: 36px; height: 36px; }
.logres-friend__avatar { display: block; width: 36px; height: 36px; box-sizing: border-box; padding: 3px; border-radius: 10px; background: #fff; }
.logres-friend__avatar img { display: block; width: 100%; height: 100%; border-radius: 7px; object-fit: cover; background: #cfd8dc; }
.logres-friends .route-step__title { text-decoration: underline; }
.logres-friends .logres-panel__title { margin: 0 0 var(--space-3); text-align: left; }
.profile-actions.profile-actions--with-back { left: var(--space-4); }
.profile-actions--with-back > .bdx-back { margin-right: auto; }
.profile-locked-actions { position: absolute; top: var(--space-4); left: var(--space-4); display: flex; z-index: 10; }
@media (max-width: 768px) {
    html.bdx-desktop-nav .profile-actions.profile-actions--with-back,
    html.bdx-desktop-nav .profile-locked-actions { left: max(188px, calc(172px + env(safe-area-inset-left))); }
}
@media (min-width: 769px) {
    .profile-actions.profile-actions--with-back, .profile-locked-actions { left: 280px; }
}
