/* Shared account-menu polish: compact desktop dropdown + mobile Help & About row. */
@media(min-width:760px){
  #app>.app>.topbar .profile-actions{position:relative}
  #profilePopover.profile-popover{
    position:absolute;
    top:calc(100% + 10px);
    right:0;
    z-index:1400;
    width:min(370px,calc(100vw - 28px));
    padding:12px;
    border:1px solid var(--fb-shell-border,var(--line));
    border-radius:18px;
    background:var(--fb-shell-panel,var(--paper));
    color:var(--fb-shell-text,var(--ink));
    box-shadow:0 18px 48px rgba(0,0,0,.28);
    transform-origin:top right;
    animation:fbDesktopProfileMenuIn .16s ease-out both;
  }
  #profilePopover.profile-popover[hidden]{display:none!important}
  #profilePopover .profile-popover-user{
    display:grid;
    grid-template-columns:52px minmax(0,1fr);
    align-items:center;
    gap:11px;
    padding:10px;
    border-radius:14px;
    background:var(--fb-shell-panel-2,rgba(127,127,127,.06));
  }
  #profilePopover .profile-popover-avatar{
    width:52px;
    height:52px;
    border-radius:50%;
    overflow:hidden;
    display:grid;
    place-items:center;
    font-weight:900;
    background:var(--fb-shell-accent-soft,rgba(70,130,90,.14));
    border:1px solid var(--fb-shell-border,var(--line));
  }
  #profilePopover .profile-popover-avatar img{width:100%;height:100%;object-fit:cover;object-position:center;display:block}
  #profilePopover .profile-popover-user>div:last-child{min-width:0;display:grid;gap:3px}
  #profilePopover .profile-popover-user strong{font-size:.98rem;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #profilePopover .profile-popover-user span{font-size:.78rem;color:var(--fb-shell-muted,var(--muted));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  #profilePopover .profile-popover-menu{
    display:grid;
    gap:4px;
    margin-top:10px;
    padding-top:8px;
    border-top:1px solid var(--fb-shell-border,var(--line));
  }
  #profilePopover .profile-popover-menu button,
  #profilePopover .profile-popover-signout{
    width:100%;
    min-height:52px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:inherit;
    padding:7px 9px;
    display:grid;
    grid-template-columns:38px minmax(0,1fr);
    align-items:center;
    gap:10px;
    text-align:left;
    cursor:pointer;
  }
  #profilePopover .profile-popover-menu button:hover,
  #profilePopover .profile-popover-signout:hover{background:var(--fb-shell-panel-2,rgba(127,127,127,.08))}
  #profilePopover .profile-popover-menu button>svg,
  #profilePopover .profile-popover-signout>svg{
    width:38px;
    height:38px;
    padding:9px;
    border-radius:50%;
    background:var(--fb-shell-accent-soft,rgba(70,130,90,.14));
    color:var(--fb-shell-accent,var(--accent));
  }
  #profilePopover .profile-popover-menu button>span{min-width:0;display:grid;gap:2px}
  #profilePopover .profile-popover-menu button strong{font-size:.91rem;line-height:1.15}
  #profilePopover .profile-popover-menu button small{font-size:.72rem;color:var(--fb-shell-muted,var(--muted));line-height:1.2}
  #profilePopover .profile-popover-signout{
    margin-top:7px;
    border-top:1px solid var(--fb-shell-border,var(--line));
    border-radius:0 0 12px 12px;
    font-weight:800;
  }
  @keyframes fbDesktopProfileMenuIn{from{opacity:0;transform:translateY(-5px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
}

@media(max-width:759px){
  #profilePopover{display:none!important}
  .mobile-profile-menu-wide{
    width:100%;
    margin-top:10px;
    min-height:62px;
    border:1px solid var(--fb-shell-border,rgba(49,92,67,.16));
    border-radius:15px;
    background:var(--fb-shell-panel,#fffdf8);
    color:inherit;
    padding:11px 13px;
    display:grid;
    grid-template-columns:38px minmax(0,1fr) 20px;
    align-items:center;
    gap:11px;
    text-align:left;
  }
  .mobile-profile-menu-wide>span:first-child{
    width:38px;
    height:38px;
    border-radius:11px;
    background:var(--fb-shell-accent-soft,#e7efe9);
    color:var(--fb-shell-accent,#315c43);
    display:grid;
    place-items:center;
  }
  .mobile-profile-menu-wide>span:first-child svg{width:20px;height:20px}
  .mobile-profile-menu-wide>span:nth-child(2){min-width:0;display:grid;gap:3px}
  .mobile-profile-menu-wide strong{font-size:.92rem;line-height:1.15}
  .mobile-profile-menu-wide small{font-size:.72rem;color:var(--fb-shell-muted,#738076);line-height:1.25}
  .mobile-profile-menu-wide>svg{width:20px;height:20px;color:var(--fb-shell-muted,#738076)}
  .mobile-profile-menu-wide:active{transform:scale(.985);background:var(--fb-shell-panel-2,#f7f4ec)}
}

@media(prefers-reduced-motion:reduce){
  #profilePopover.profile-popover{animation:none!important}
}

/* Help & About header repair. The enhancement script previously targeted the icon span for the long description. */
.settings-about-card.fb-help-ready .settings-card-head>.settings-card-icon{
  font-size:0!important;
  overflow:hidden;
  position:relative;
}
.settings-about-card.fb-help-ready .settings-card-head>.settings-card-icon::before{
  content:'?';
  font-size:18px;
  font-weight:900;
  line-height:1;
  color:var(--accent);
}
.settings-about-card.fb-help-ready .settings-card-head>div{min-width:0}
.settings-about-card.fb-help-ready .settings-card-head>div>span{
  font-size:0!important;
  line-height:1.35;
}
.settings-about-card.fb-help-ready .settings-card-head>div>span::before{
  content:'What Family Book is for, how to connect your family, and how the main features work.';
  font-size:.8rem;
  line-height:1.35;
  color:var(--muted);
}
@media(max-width:759px){
  .settings-about-card.fb-help-ready .settings-card-head{
    grid-template-columns:40px minmax(0,1fr)!important;
    align-items:start!important;
    gap:10px!important;
  }
  .settings-about-card.fb-help-ready .settings-card-head>.settings-card-icon{
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
  }
}

/* Consolidated desktop account-menu styles formerly injected by JS. */
@media(min-width:760px){
  #profilePopover .fb-account-card{width:100%;border:0;border-radius:14px;background:var(--fb-shell-panel-2,rgba(127,127,127,.06));color:inherit;padding:10px;display:grid;grid-template-columns:52px minmax(0,1fr) 34px;align-items:center;gap:11px;text-align:left;cursor:pointer}
  #profilePopover .fb-account-card:hover{background:color-mix(in srgb,var(--fb-shell-panel-2,rgba(127,127,127,.06)) 80%,var(--fb-shell-accent-soft,rgba(70,130,90,.12)))}
  #profilePopover .fb-account-avatar{width:52px;height:52px;border-radius:50%;overflow:hidden;display:grid;place-items:center;font-weight:900;background:var(--fb-shell-accent-soft,rgba(70,130,90,.14));border:1px solid var(--fb-shell-border,var(--line))}
  #profilePopover .fb-account-avatar img{width:100%;height:100%;object-fit:cover;object-position:center;display:block}
  #profilePopover .fb-account-copy{min-width:0;display:grid;gap:2px}
  #profilePopover .fb-account-copy strong{font-size:.98rem;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #profilePopover .fb-account-copy span{font-size:.78rem;color:var(--fb-shell-muted,var(--muted));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #profilePopover .fb-account-copy small{font-size:.76rem;color:var(--fb-shell-accent,var(--accent));font-weight:800}
  #profilePopover .fb-account-chevron{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--fb-shell-panel,var(--paper));color:var(--fb-shell-muted,var(--muted))}
  #profilePopover .fb-account-chevron svg{width:18px;height:18px}
  #profilePopover .fb-desktop-menu-row{grid-template-columns:38px minmax(0,1fr) 20px!important}
  #profilePopover .fb-desktop-menu-row>span:nth-child(2){min-width:0;display:grid;gap:2px}
  #profilePopover .fb-desktop-menu-row>.fb-menu-chevron{width:18px;height:18px;padding:0;border-radius:0;background:transparent;color:var(--fb-shell-muted,var(--muted))}
  #profilePopover .fb-theme-panel{margin:2px 2px 7px 46px;padding:8px;border-radius:12px;background:var(--fb-shell-panel-2,rgba(127,127,127,.06));display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  #profilePopover .fb-theme-panel[hidden]{display:none!important}
  #profilePopover .fb-theme-choice{min-height:62px!important;padding:8px 5px!important;border:1px solid var(--fb-shell-border,var(--line))!important;border-radius:10px!important;display:flex!important;flex-direction:column;justify-content:center;gap:5px!important;text-align:center!important;background:var(--fb-shell-panel,var(--paper))!important}
  #profilePopover .fb-theme-choice svg{width:18px!important;height:18px!important;padding:0!important;border-radius:0!important;background:transparent!important;margin:auto}
  #profilePopover .fb-theme-choice strong{font-size:.74rem!important}
  #profilePopover .fb-theme-choice.active{outline:2px solid var(--fb-shell-accent,var(--accent));outline-offset:-2px}
  #profilePopover .fb-admin-row{margin-top:2px}
}
