/* Owner-approved child profile screen. Scoped to the existing editor portal. */
html.fcc-profile-editor-active, body.fcc-profile-editor-open { overflow: hidden; overscroll-behavior: none; }
.fcc-profile-editor { --editor-ink: #191535; --editor-muted: #64617b; --editor-accent: #7436e8; --editor-border: #e6e2f2; position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 24px; color: var(--editor-ink); font-family: Inter, system-ui, sans-serif; text-align: left; }
.fcc-profile-editor, .fcc-profile-editor * { box-sizing: border-box; }
.fcc-profile-editor [hidden] { display: none !important; }
.fcc-profile-editor .fcc-profiles-action-backdrop { position: absolute; inset: 0; background: #17112f70; backdrop-filter: blur(6px); }
.fcc-profile-editor .fcc-profiles-action-modal { position: relative; display: flex; flex-direction: column; width: min(720px, 100%); height: min(860px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); min-height: 0; border-radius: 24px; border: 1px solid var(--editor-border); background: #faf9ff; overflow: hidden; box-shadow: 0 24px 80px #21104030; }
.fcc-profile-editor .fcc-profiles-action-modal-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; padding: 22px 24px 14px; background: #faf9ff; gap: 16px; }
.fcc-profile-editor .fcc-profiles-action-eyebrow { margin: 0 0 5px; color: var(--editor-accent); font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.fcc-profile-editor .fcc-profiles-action-modal-header h2 { margin: 0; font-size: 25px; line-height: 1.2; letter-spacing: -.035em; color: var(--editor-ink); }
.fcc-profile-editor .fcc-editor-context { color: var(--editor-muted); font-size: 14px; line-height: 1.4; margin: 5px 0 0; }
.fcc-profile-editor .fcc-profiles-action-close { width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid #e2d5ff; border-radius: 50%; background: #fff; color: var(--editor-accent); font-size: 27px; line-height: 1; cursor: pointer; }
.fcc-profile-editor .fcc-profiles-action-modal-body { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height: 0; padding: 4px 24px 22px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b9aecb transparent; scroll-padding: 66px 0 20px; }
.fcc-profile-editor .fcc-editor-identity { display: flex; align-items: center; gap: 22px; padding: 16px 0 22px; min-width: 0; }
.fcc-profile-editor .fcc-editor-portrait { width: 108px; height: 108px; flex: 0 0 108px; overflow: hidden; border-radius: 50%; background: #ece4fa; }
.fcc-profile-editor .fcc-editor-portrait > *, .fcc-profile-editor .fcc-editor-portrait img { width: 100% !important; height: 100% !important; border-radius: 50%; object-fit: cover; margin: 0; }
.fcc-profile-editor .fcc-editor-identity-copy { min-width: 0; }
.fcc-profile-editor .fcc-editor-identity h3 { margin: 0 0 4px; font-size: 26px; line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
.fcc-profile-editor .fcc-editor-identity p { margin: 2px 0; color: var(--editor-muted); font-size: 14px; }
.fcc-profile-editor .fcc-editor-identity p:empty { display: none; }
.fcc-profile-editor .fcc-editor-identity button { margin-top: 10px; border-radius: 24px; min-height: 42px; color: var(--editor-accent); font-size: 13px; padding: 8px 16px; }
.fcc-profile-editor .fcc-editor-tabs { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; padding: 10px 0 12px; margin: 0 0 4px; position: sticky; top: -4px; background: #faf9ff; z-index: 2; scrollbar-width: thin; scrollbar-color: #d8cdf1 transparent; }
.fcc-profile-editor .fcc-editor-tabs button { flex: 0 0 auto; min-height: 44px; padding: 9px 16px; border: 1px solid var(--editor-border); border-radius: 24px; font: inherit; font-size: 13px; font-weight: 600; color: #5d5576; background: #fff; white-space: nowrap; cursor: pointer; }
.fcc-profile-editor .fcc-editor-tabs button[aria-selected="true"] { background: #eadeff; border-color: #dbc6ff; color: #641bd1; }
.fcc-profile-editor :focus-visible { outline: 3px solid #9a6cf0; outline-offset: 2px; }
.fcc-profile-editor .fcc-editor-panel { display: grid; gap: 16px; min-width: 0; }
.fcc-profile-editor .fcc-editor-card, .fcc-profile-editor .fcc-profile-module, .fcc-profile-editor .profile-sms-card, .fcc-profile-editor .profile-permissions-section, .fcc-profile-editor .profile-section-card, .fcc-profile-editor .fcc-editor-source-settings { min-width: 0; margin: 0; padding: 18px; background: #fff; border: 1px solid var(--editor-border); border-radius: 16px; box-shadow: 0 2px 6px #26124e03; }
.fcc-profile-editor h3, .fcc-profile-editor h4, .fcc-profile-editor legend { margin: 0 0 16px; font-size: 17px; line-height: 1.35; font-weight: 700; letter-spacing: -.025em; color: var(--editor-ink); }
.fcc-profile-editor .fcc-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; min-width: 0; }
.fcc-profile-editor .child-identity-top-row { display: contents; }
.fcc-profile-editor .fcc-editor-fields > *, .fcc-profile-editor .fcc-field { min-width: 0; }
.fcc-profile-editor label { display: block; margin: 0 0 6px; font-size: 13px; line-height: 1.45; color: var(--editor-ink); }
.fcc-profile-editor label strong { font-weight: 550; }
.fcc-profile-editor .input, .fcc-profile-editor select, .fcc-profile-editor textarea { width: 100%; max-width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 10px 12px; border: 1px solid #d9d5e6; border-radius: 10px; background: #fefdff; color: var(--editor-ink); box-shadow: none; font: inherit; font-size: 16px; line-height: 1.35; }
.fcc-profile-editor textarea { min-height: 116px; resize: vertical; }
.fcc-profile-editor input[type="checkbox"], .fcc-profile-editor input[type="radio"] { width: auto; }
.fcc-profile-editor input[type="color"] { min-width: 44px; height: 44px; padding: 3px; }
.fcc-profile-editor .btn { min-height: 44px; border-radius: 11px; padding: 10px 14px; font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer; box-shadow: none; }
.fcc-profile-editor .btn-primary { background: #7838e8 !important; border: 1px solid #7030dd; color: white; border-radius: 11px !important; }
.fcc-profile-editor .btn-secondary { background: #fff !important; border-radius: 11px !important; border: 1px solid #d8cee8; color: #4d426a; }
.fcc-profile-editor .btn:disabled { opacity: .55; cursor: default; }
.fcc-profile-editor .fcc-editor-help, .fcc-profile-editor .muted, .fcc-profile-editor .small { color: var(--editor-muted); font-size: 12px; line-height: 1.5; }
.fcc-profile-editor .fcc-editor-help { margin: 0; grid-column: 1/-1; }
.fcc-profile-editor .fcc-editor-school-workflow { display: grid; gap: 16px; }
.fcc-profile-editor .fcc-school-meals-section { gap: 10px; padding: 16px; }
.fcc-profile-editor .fcc-profile-module__title-row { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fcc-profile-editor .fcc-profile-module__title { margin: 0; font-size: 19px; }
.fcc-profile-editor .fcc-meals-status-pill { font-size: 11px; padding: 5px 9px; border-radius: 20px; white-space: nowrap; }
.fcc-profile-editor .fcc-meals-connection { background: #edf8f1; border-radius: 12px; padding: 13px; gap: 3px; }
.fcc-profile-editor .fcc-meals-connection__school { font-size: 14px; font-weight: 650; }
.fcc-profile-editor .fcc-meals-subsection { border: 0; padding: 0; gap: 8px; }
.fcc-profile-editor .fcc-meals-subsection__title { font-size: 15px; font-weight: 650; letter-spacing: -.015em; text-transform: none; color: var(--editor-ink); }
.fcc-profile-editor .fcc-segmented { display: flex; padding: 2px; gap: 3px; margin: 0; background: #f3f1fa; border: 1px solid #e7e0f5; border-radius: 22px; }
.fcc-profile-editor .fcc-segmented-btn { flex: 1; min-height: 40px; border: 1px solid transparent; border-radius: 20px; background: none; font: inherit; font-size: 13px; color: #51476b; cursor: pointer; }
.fcc-profile-editor .fcc-segmented-btn.active { background: #eee2ff; border-color: #c6a2ff; color: #621acb; box-shadow: 0 1px 3px #571e9310; }
.fcc-profile-editor .fcc-nutrislice-days-scroll { display: grid; grid-template-columns: 1fr; max-height: none; overflow: visible; padding: 0; gap: 8px; }
.fcc-profile-editor .fcc-nutrislice-day-card { min-width: 0; width: 100%; border: 1px solid #dfdaea; background: #fff; border-radius: 12px; padding: 12px; }
.fcc-profile-editor .fcc-nutrislice-day-card__dow { font-size: 12px; color: var(--editor-muted); margin-bottom: 5px; }
.fcc-profile-editor .fcc-nutrislice-day-card__body { font-size: 14px; line-height: 1.5; color: var(--editor-ink); }
.fcc-profile-editor .fcc-meals-full-menu { border: 0; background: #f0ebfb; color: #6926d3; min-height: 40px; width: 100%; border-radius: 10px; font-weight: 600; cursor: pointer; }
.fcc-profile-editor .fcc-meals-destination { padding: 14px 0 0; border-top: 1px solid #eee8f6; }
.fcc-profile-editor .fcc-nutrislice-destination-select { max-width: 100%; }
.fcc-profile-editor .fcc-meals-destination__status { text-align: right; font-size: 12px; min-height: 18px; }
.fcc-profile-editor .fcc-meals-actions { padding-top: 8px; }
.fcc-profile-editor .fcc-meals-action-primary { min-height: 48px; }
.fcc-profile-editor .fcc-meals-actions__secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fcc-profile-editor .fcc-meals-actions__secondary.is-disconnected { grid-template-columns: 1fr; }
.fcc-profile-editor .fcc-nutrislice-remove-link { min-height: 44px; border: 1px solid #ebbbbd; border-radius: 11px; font: inherit; font-size: 13px; font-weight: 600; color: #b42b39; background: #fff; }
.fcc-profile-editor .fcc-editor-info { background: #eff3ff; border: 1px solid #dbe5ff; padding: 17px; border-radius: 14px; }
.fcc-profile-editor .fcc-editor-info h3 { font-size: 15px; margin: 0 0 7px; }
.fcc-profile-editor .fcc-editor-info p { margin: 0 0 5px; color: #4f5777; line-height: 1.55; font-size: 13px; }
.fcc-profile-editor .fcc-editor-field-label { font-size: 13px; margin: 16px 0 7px; }
.fcc-profile-editor .fcc-profile-module__value { font-size: 15px; border: 1px solid #ded9ea; padding: 12px; border-radius: 10px; }
.fcc-profile-editor .fcc-profile-module__display { margin-top: 14px; }
.fcc-profile-editor .fcc-editor-save-region { flex: 0 0 auto; padding: 10px 24px 18px; background: #faf9ff; border-top: 1px solid #e9e2f5; }
.fcc-profile-editor .fcc-editor-save-region > .btn { width: 100%; min-height: 48px; }
.fcc-profile-editor .fcc-editor-save-hint { font-size: 11px; line-height: 1.3; color: var(--editor-muted); text-align: center; margin: 0 0 7px; }
.fcc-profile-editor .profile-save-banner { margin: 0 0 9px; font-size: 13px; }
.fcc-profile-editor .profile-color-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: end; gap: 10px; }
.fcc-profile-editor .fcc-editor-photo-choices { margin-bottom: 16px; }
.fcc-profile-editor .profile-avatar-picker { display: grid; gap: 12px; }
.fcc-profile-editor .profile-avatar-picker-preview { display: none; }
.fcc-profile-editor .profile-avatar-emoji-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.fcc-profile-editor .profile-sms-card__grid, .fcc-profile-editor .profile-permissions-grid { display: grid; gap: 16px; }
.fcc-profile-editor .permission-row, .fcc-profile-editor .profile-sms-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.fcc-profile-editor .profile-permissions-section legend, .fcc-profile-editor .profile-sms-card legend { padding: 0 5px; font-size: 17px; }
.fcc-profile-editor .fcc-editor-source-settings > .btn { width: 100%; margin: 14px 0; }
@media (max-width: 760px) {
  .fcc-profile-editor { padding: 0; top: var(--editor-top, 0px); bottom: auto; height: var(--editor-height, 100dvh); width: 100%; display: block; }
  .fcc-profile-editor .fcc-profiles-action-backdrop { display: none; }
  .fcc-profile-editor .fcc-profiles-action-modal { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
  .fcc-profile-editor .fcc-profiles-action-modal-header { padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 10px; }
  .fcc-profile-editor .fcc-profiles-action-modal-body { padding: 0 16px 20px; }
  .fcc-profile-editor .fcc-editor-fields { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .fcc-profile-editor .fcc-editor-save-region { padding: 9px 16px calc(env(safe-area-inset-bottom, 0px) + 12px); }
  .fcc-profile-editor .fcc-editor-identity { gap: 20px; padding: 18px 4px; }
  .fcc-profile-editor .fcc-editor-portrait { width: 108px; height: 108px; flex-basis: 108px; }
  body.fcc-profile-editor-open #bottomNav, body.fcc-profile-editor-open .bottom-nav { display: none !important; pointer-events: none !important; }
}

/* School meal sync status. The progress card and the sync result sit with the
   Sync Now action, never in the connection summary at the top of the section. */
.fcc-profile-editor .fcc-meals-sync-status { margin: 0 0 10px; }
.fcc-profile-editor .fcc-meals-sync-status .fcc-sync-card { gap: 8px; padding: 12px; border-radius: 12px; background: #f6f1ff; border: 1px solid #e0d2fb; box-shadow: none; }
.fcc-profile-editor .fcc-meals-sync-status .fcc-sync-card__title { font-size: 14px; font-weight: 650; color: var(--editor-ink); }
.fcc-profile-editor .fcc-meals-sync-status .fcc-sync-card__meta { font-size: 12px; font-weight: 650; color: #6926d3; }
.fcc-profile-editor .fcc-meals-sync-status .fcc-sync-card__detail { font-size: 12px; color: var(--editor-muted); }
.fcc-profile-editor .fcc-meals-sync-status .fcc-sync-progress { width: 100%; flex-shrink: 1; height: 10px; background: #e7dcfb; }
.fcc-profile-editor .fcc-meals-sync-status .fcc-sync-bar { background: linear-gradient(90deg, #a77dfb 0%, #7436e8 65%, #6321cf 100%); }
.fcc-profile-editor .fcc-meals-sync-status .fcc-sync-bar.error { background: linear-gradient(90deg, #e8697a, #c0392b); }
.fcc-profile-editor .fcc-meals-sync-status .fcc-sync-step { font-size: 12px; color: #7d7495; }
.fcc-profile-editor .fcc-meals-sync-status .fcc-sync-step.active { color: #6926d3; font-weight: 650; }
.fcc-profile-editor .fcc-meals-sync-status .fcc-sync-step.done { color: #1f7a45; font-weight: 600; }
.fcc-profile-editor .fcc-meals-sync-result { display: grid; gap: 3px; padding: 11px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.fcc-profile-editor .fcc-meals-sync-result__title { font-weight: 650; }
.fcc-profile-editor .fcc-meals-sync-result__detail { font-size: 12px; color: var(--editor-muted); }
.fcc-profile-editor .fcc-meals-sync-result.is-ok { background: #edf8f1; border: 1px solid #b9e2c9; color: #1f7a45; }
.fcc-profile-editor .fcc-meals-sync-result.is-error { background: #fdf1f1; border: 1px solid #f0c3c3; color: #b42318; }
.fcc-profile-editor .fcc-meals-sync-result.is-ok .fcc-meals-sync-result__detail,
.fcc-profile-editor .fcc-meals-sync-result.is-error .fcc-meals-sync-result__detail { color: inherit; opacity: .82; }
.fcc-profile-editor .fcc-meals-action-spinner { display: inline-block; width: 15px; height: 15px; margin-right: 8px; vertical-align: -2px; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: fccMealsSpin .7s linear infinite; }
@keyframes fccMealsSpin { to { transform: rotate(360deg); } }

/* The portal card keeps its own styling elsewhere in the app; inside the editor
   it follows the same flat white/purple system as its neighbouring cards. */
.fcc-profile-editor .fcc-school-portal-card { margin: 0; padding: 18px; border-radius: 16px; border: 1px solid var(--editor-border); background: #fff; box-shadow: 0 2px 6px #26124e03; backdrop-filter: none; -webkit-backdrop-filter: none; }
.fcc-profile-editor .fcc-school-portal-card__header { margin-bottom: 12px; }
.fcc-profile-editor .fcc-school-portal-card__header h3 { margin: 0 0 4px; }
.fcc-profile-editor .fcc-school-portal-source { gap: 12px; padding: 13px; border-radius: 12px; background: #f6f3fd; border: 1px solid #e7e0f5; margin-bottom: 14px; }
.fcc-profile-editor .fcc-school-portal-source__icon { background: #fff; box-shadow: none; border: 1px solid #e7e0f5; color: var(--editor-accent); }
.fcc-profile-editor .fcc-school-portal-source__eyebrow { color: var(--editor-accent); }
.fcc-profile-editor .fcc-school-portal-source__title { font-size: 15px; font-weight: 650; color: var(--editor-ink); }
.fcc-profile-editor .fcc-school-portal-source__meta { color: var(--editor-muted); }
.fcc-profile-editor .fcc-school-portal-source__hint { color: var(--editor-muted); }
.fcc-profile-editor .fcc-school-portal-card__grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 14px; }
.fcc-profile-editor .fcc-school-portal-field span { font-size: 13px; font-weight: 550; color: var(--editor-ink); }
.fcc-profile-editor .fcc-school-portal-field .input, .fcc-profile-editor .fcc-school-portal-field select.input { min-height: 44px; border-radius: 10px; border: 1px solid #d9d5e6; background: #fefdff; box-shadow: none; }
.fcc-profile-editor .fcc-school-portal-switches { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
/* Keep the switch row a flex context. Without it the 51px switch collapses to
   zero width and its absolutely positioned knob paints over the label. */
.fcc-profile-editor .fcc-ios-toggle--portal { position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px; border-radius: 12px; background: #fbfaff; border: 1px solid var(--editor-border); box-shadow: none; cursor: pointer; }
.fcc-profile-editor .fcc-ios-toggle--portal .fcc-ios-toggle__ui { flex: 0 0 51px; width: 51px; height: 31px; }
.fcc-profile-editor .fcc-ios-toggle__labelwrap { display: flex; flex-direction: column; min-width: 0; }
.fcc-profile-editor .fcc-ios-toggle__label { font-size: 14px; font-weight: 650; color: var(--editor-ink); }
.fcc-profile-editor .fcc-ios-toggle__sub { font-size: 12px; color: var(--editor-muted); }
.fcc-profile-editor .fcc-inline-actions--portal { margin-top: 16px; gap: 10px; }
.fcc-profile-editor .fcc-inline-actions--portal .btn { flex: 1 1 180px; min-height: 44px; border-radius: 11px; font-weight: 600; box-shadow: none; }
/* styles.css stacks this row on phones; a 180px basis would then become the button height. */
@media (max-width: 640px) { .fcc-profile-editor .fcc-inline-actions--portal .btn { flex: 0 0 auto; } }
.fcc-profile-editor .fcc-school-portal-btn { border-radius: 12px; border: 1px solid var(--editor-border); background: #fff; box-shadow: none; }
.fcc-profile-editor .fcc-school-portal-btn__icon { color: var(--editor-accent); }
.fcc-profile-editor .fcc-school-portal-btn__title { font-size: 14px; font-weight: 650; color: var(--editor-ink); }
.fcc-profile-editor .fcc-school-portal-btn__subtitle { color: var(--editor-muted); }

@media (prefers-reduced-motion: reduce) {
  .fcc-profile-editor .fcc-meals-sync-status .fcc-sync-bar { transition: none; }
  .fcc-profile-editor .fcc-meals-sync-status .fcc-sync-bar::after { animation: none; background: none; }
}

.fcc-profile-editor .profile-school-info { border: 0; background: none; padding: 0; margin: 16px 0 0; }
.fcc-profile-editor .profile-school-info details { margin-top: 16px; }
.fcc-profile-editor .profile-school-info summary { min-height: 44px; padding: 12px 0; color: var(--editor-accent); cursor: pointer; font-size: 13px; }
.fcc-profile-editor .profile-school-info__grid { gap: 16px; }
.fcc-meal-sync-scope { box-sizing: border-box; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid #dfdaea; border-radius: 18px; padding: 24px; color: #272236; background: #fff; box-shadow: 0 18px 70px #21133840; }
.fcc-meal-sync-scope::backdrop { background: #21133888; }
.fcc-meal-sync-scope h2 { font-size: 20px; margin: 0 0 18px; }
.fcc-meal-sync-scope label { display: flex; align-items: center; gap: 12px; padding: 14px 12px; margin: 10px 0; border: 1px solid #d5cfe0; border-radius: 12px; min-height: 48px; cursor: pointer; }
.fcc-meal-sync-scope label:has(input:checked) { background: #f2edff; border-color: #7950bd; }
.fcc-meal-sync-scope input { flex: 0 0 auto; accent-color: #7950bd; width: 18px; height: 18px; }
.fcc-meal-sync-scope p { font-size: 14px; line-height: 1.5; color: #635b72; }
.fcc-meal-sync-scope__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.fcc-meal-sync-scope button { min-height: 44px; padding: 10px 18px; border-radius: 10px; font: inherit; cursor: pointer; }
.fcc-meals-sync-result ul { padding-left: 18px; margin: 8px 0 0; }
