/* Additions only: existing account and selection components retain their styles. */
#profileSwitcher{gap:5px;max-width:105px;padding:10px 9px}
#profileSwitcher #profileSwitcherName{display:block;width:auto;height:auto;border-radius:0;background:none;color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600}
#profileSwitcher svg{flex:none}
.profile-feature{background:#fff;border:1px solid var(--line);border-radius:18px;padding:20px;margin:20px 0}
.profile-feature .help-text{margin:12px 0 0;font-size:12px}
.profile-manage-link{display:flex;align-items:center;justify-content:space-between;width:100%;padding:14px 0 0;margin:15px 0 0;border:0;border-top:1px solid var(--line);background:none;text-align:start;color:var(--blue);min-height:54px}
.profile-manage-link strong,.profile-manage-link small{display:block}.profile-manage-link small{color:var(--muted);margin-top:5px}
#profileContext{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:#fff;margin-bottom:18px}
#profileContext strong{display:block;font-size:14px;overflow-wrap:anywhere}#profileContext small{display:block;font-size:12px;color:var(--muted);margin-top:4px}
#settingsView .sticky-action{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 46px}
#settingsView #saveSelection{grid-column:1/-1}
#selectAll{color:var(--blue)}
#settingsView{padding-bottom:170px}
body:has(#settingsView.active) .toast{bottom:calc(185px + env(safe-area-inset-bottom))}
#toggleSubjects{padding:10px;color:var(--blue);display:grid;place-items:center}
.profile-sheet{width:min(440px,100%)}.profile-sheet h2{padding-inline-end:22px}.profile-sheet .lead{font-size:14px;line-height:1.65}
.profile-choice{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;border:1px solid var(--line);border-radius:14px;background:#fff;padding:14px;margin:10px 0;text-align:start;color:var(--ink)}
.profile-choice strong,.profile-choice small{display:block}.profile-choice small{color:var(--muted);margin-top:6px;font-size:12px}.profile-choice:is([aria-current=true],[aria-pressed=true]){background:var(--blue-soft);border-color:#bfd0ff}.profile-check{color:var(--blue);font-weight:700}
.saved-profile{padding:18px;background:#fff;border:1px solid var(--line);border-radius:18px;margin-bottom:12px}.saved-profile-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.saved-profile h3{margin:0 0 5px;overflow-wrap:anywhere}.saved-profile small{color:var(--muted)}
.primary-profile-badge{font-size:12px;background:var(--blue-soft);color:var(--blue);border-radius:30px;padding:6px 9px;white-space:nowrap}
.saved-profile-title{min-width:0}.saved-profile-name{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.saved-profile-name h3{margin:0}.saved-profile-title>small{display:block;margin-top:5px}
.saved-profile-actions{display:grid;grid-template-columns:44px minmax(0,1fr) minmax(0,1.35fr) 44px;gap:6px;margin-top:16px;align-items:stretch}
.saved-profile-actions.is-primary{grid-template-columns:44px auto 1fr}
.saved-profile-actions .compact{padding:8px 6px;min-width:0;min-height:44px;line-height:1.3;white-space:normal}
.profile-order{display:flex;gap:4px;margin-inline-start:auto;flex:none}.profile-order button{width:44px;min-height:44px;padding:8px}
.saved-profile-actions .profile-action-icon{width:44px;padding:10px;display:grid;place-items:center}.profile-action-icon svg{width:22px;height:22px}
.saved-profile-actions .profile-share{color:var(--blue)}.saved-profile-actions .profile-delete{grid-column:4;color:#c83d56}
#shareContext{font-size:14px}
.profile-sheet input[type=text],#shareUrl{display:block;width:100%;margin:10px 0 16px;padding:12px;border:1px solid var(--line);border-radius:12px;font:inherit;background:white;color:var(--ink)}
#shareUrl{direction:ltr;text-align:left}.profile-dialog-actions{display:flex;gap:10px;margin-top:18px}.profile-dialog-actions button{min-height:46px}.profile-sheet .primary{width:100%}
#sharedGroups{list-style:none;margin:16px 0;padding:0;max-height:35dvh;overflow:auto;border:1px solid var(--line);border-radius:14px}#sharedGroups li{padding:12px 14px;border-bottom:1px solid var(--line)}#sharedGroups li:last-child{border-bottom:0}#sharedGroups strong,#sharedGroups span,#sharedGroups small{display:block}#sharedGroups span{color:var(--muted);margin-top:4px;font-size:14px}#sharedGroups small{color:#98651b;margin-top:5px}
@media(max-width:360px){#profileSwitcher{max-width:76px}#settingsView .sticky-action{gap:8px}#settingsView .sticky-action .primary,#settingsView .sticky-action #clearSelection,#settingsView .sticky-action #selectAll{font-size:13px;padding-inline:10px}}
.profile-sheet .profile-dialog-actions{display:flex}

.new-profile-button{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;color:var(--blue);margin:16px 0}
.profile-push-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line);min-height:54px}
.profile-push-row span{font-size:14px}.profile-push-row small{display:block;font-size:12px;color:var(--muted);margin-top:3px}
.profile-push-row input{appearance:none;flex:none;width:46px;height:27px;border:0;border-radius:20px;background:#d9e0e9;margin:0;position:relative;cursor:pointer}
.profile-push-row input:before{content:'';position:absolute;top:3px;left:3px;width:21px;height:21px;border-radius:50%;background:white;box-shadow:0 1px 3px #13223a26}
.profile-push-row input:checked{background:#2f5be9}.profile-push-row input:checked:before{left:22px}.profile-push-row input:disabled{opacity:.5}
.profile-push-note{font-size:12px}
#newProfileForm label,#importProfileForm label{display:block;font-size:14px;font-weight:700;margin:20px 0}
#newProfileForm input,#newProfileForm select,#importProfileForm input{display:block;width:100%;margin-top:8px;padding:12px;background:#fff;color:var(--ink);border:1px solid #cbd3df;border-radius:12px;min-height:48px;font-size:16px}
#newProfileForm .profile-dialog-actions,#importProfileForm .profile-dialog-actions{display:flex;gap:10px;margin-top:24px}
.new-profile-context{padding:12px 14px;background:#fff;border:1px solid var(--line);border-radius:14px;margin-bottom:18px;font-size:14px}
.new-profile-context small{display:block;color:var(--muted);font-size:12px;margin-top:3px}

.profile-add-actions{display:flex;gap:8px;margin:16px 0}
.profile-add-actions .new-profile-button{flex:1;min-width:0;width:auto;margin:0;padding-inline:10px;font-size:14px;white-space:nowrap}
.profile-add-actions svg{flex:none}
#importProfileForm .primary{flex:1}
#importProfileUrl{text-align:left}
.shared-back{width:100%;margin-top:10px}

/* Shared imports: choose an explicit destination before changing any choices. */
#sharedChoices{display:grid;gap:10px}#sharedChoices button{width:100%;min-height:46px}
#sharedDialog .shared-cancel{width:100%;min-height:44px;margin-top:10px;border:0;background:none;color:var(--muted);font-weight:400}
#sharedNameLabel{display:block;font-size:14px;font-weight:700;margin-top:22px}
#sharedReplacement{display:flex;align-items:center;justify-content:center;gap:20px;padding:18px 12px;margin:0 0 24px;background:var(--bg);border-radius:14px}
#sharedDialog #sharedGroups li{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:4px 10px}
#sharedDialog #sharedGroups span{margin:0;text-align:end}#sharedDialog #sharedGroups small{grid-column:1/-1}

#sharedPushLabel{display:flex;font-weight:400;margin:0 0 8px;padding:18px 0;min-height:72px}

/* Invite single-profile users to the existing profile management screen. */
#profileMeetHint p{margin:20px 0 12px;text-align:center;font-size:14px;line-height:1.6;color:var(--muted)}
#addFirstFriend{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;min-height:44px;color:var(--blue);font-size:14px}
#addFirstFriend svg{flex:none}
/* Live schedule identity uses the same compact tag in picker, management and landing. */
.schedule-live-badge{display:inline-flex;align-items:center;max-width:100%;padding:4px 8px;margin-block:5px 0;border-radius:8px;background:var(--blue-soft);color:var(--blue);font-size:11px;font-weight:600;line-height:1.5;white-space:normal}
.schedule-share-modes{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin:16px 0;border:1px solid var(--line);border-radius:12px;background:var(--bg)}
.schedule-share-modes button{border:0;background:transparent;color:var(--muted);border-radius:8px;padding:12px 6px;font-size:13px;min-height:44px}
.schedule-share-modes button[aria-pressed=true]{background:var(--blue-soft);color:var(--blue);font-weight:700}
.schedule-sharing-notice{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;background:var(--blue-soft);color:var(--blue);border-radius:13px;margin:16px 0}
.schedule-sharing-notice strong,.schedule-sharing-notice small{display:block}.schedule-sharing-notice small{margin-top:5px;font-size:12px}
.schedule-share-row{display:block;border-top:1px solid var(--line);padding:12px 0;font-size:14px}.schedule-share-row small{display:block;margin-top:4px;color:var(--muted);font-size:12px}
#scheduleShareList h3{font-size:16px;margin-top:22px}#generateScheduleShare{width:100%;margin-block:12px}.readonly-group-check{color:var(--blue);margin-inline-end:8px}
#settingsView.shared-schedule{padding-bottom:0}#settingsView.shared-schedule #schoolSelectRow{display:none}#settingsView.shared-schedule #classSelect{appearance:none;opacity:1;color:var(--ink)}
#settingsView.shared-schedule .pill{cursor:default}#sharedTargetLabel{margin-block:14px}#sharedTarget{width:100%}

.schedule-share-heading,.schedule-share-status{display:flex;align-items:center;justify-content:space-between;gap:10px}.schedule-share-heading strong{min-width:0;overflow-wrap:anywhere}.schedule-share-heading .profile-action-icon{flex-shrink:0}.schedule-share-status{margin-top:6px}.schedule-share-status small{margin:0}.schedule-share-status button{flex-shrink:0}.schedule-share-edit input{width:100%;min-width:0}.schedule-share-edit .profile-dialog-actions{margin-top:12px}#scheduleShareNameHelp{margin-top:6px}

/* Keep both received sources on one line, including narrow phone pickers. */
.profile-choice>span:first-child{min-width:0}.profile-check{flex:none}
.profile-sharing-badges{display:flex;align-items:center;gap:5px;margin-top:6px;white-space:nowrap}
.profile-sharing-badges .schedule-live-badge,.homework-shared-badge{display:inline-flex;align-items:center;flex:none;margin:0;padding:4px 6px;border-radius:8px;font-size:11px;font-weight:600;line-height:1.5;white-space:nowrap}
.homework-shared-badge{background:#eeebff;color:#6650b5}
:root[data-appearance="dark"] .homework-shared-badge{background:#30294d;color:#c6b8ff}
