/* Genitori: selettore nel marchio, viste Allievo condivise. */
/* Cambio Allievo/Genitore: nel footer della sidebar o accanto al titolo mobile. */
#app.registro-wordpress-app .account-profile-switch { flex:0 0 auto; }
#app.registro-wordpress-app .account-profile-switch button { box-sizing:border-box;margin:0;border:0;box-shadow:none;font-family:inherit;font-weight:600;line-height:1.25;text-transform:none;letter-spacing:normal;cursor:pointer; }
#app.registro-wordpress-app .account-profile-switch button:focus-visible { outline:2px solid #318bdf;outline-offset:3px; }
#app.registro-wordpress-app .account-profile-switch button:disabled { opacity:.55;cursor:wait; }
#app.registro-wordpress-app .sidebar-bottom > .account-profile-switch { margin:0 0 18px; }
#app.registro-wordpress-app .account-profile-toggle { display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:44px;padding:4px 0;background:transparent;color:#b3c8dc;font-size:13px; }
#app.registro-wordpress-app .account-profile-toggle:hover { background:rgba(255,255,255,.05);border-radius:10px; }
#app.registro-wordpress-app .account-profile-switch[data-active="student"] [data-profile-label="student"],
#app.registro-wordpress-app .account-profile-switch[data-active="parent"] [data-profile-label="parent"] { color:#fff;font-weight:700; }
#app.registro-wordpress-app .account-profile-track { box-sizing:border-box;position:relative;flex:0 0 44px;width:44px;height:24px;border:1px solid #55b4ff;border-radius:20px;background:#063861; }
#app.registro-wordpress-app .account-profile-track::after { content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:linear-gradient(135deg,#f1f9ff,#61b5ff);box-shadow:0 0 0 1px #bce1ff,0 0 8px #449ce477;transition:transform .18s ease; }
#app.registro-wordpress-app .account-profile-switch[data-active="parent"] .account-profile-track::after { transform:translateX(20px); }
@media(max-width:900px){
 #app.registro-wordpress-app .account-profile-title-row { display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%; }
 #app.registro-wordpress-app .account-profile-title-row h1 { flex:1 1 auto;min-width:0;overflow-wrap:break-word; }
 #app.registro-wordpress-app .account-profile-title-row > .account-profile-switch { margin-left:auto; }
 #app.registro-wordpress-app .account-profile-segments { display:flex;align-items:stretch;gap:2px;padding:3px;border-radius:17px;background:#e9edf2; }
 #app.registro-wordpress-app .account-profile-segments button { min-width:72px;min-height:38px;padding:7px 10px;border-radius:14px;background:transparent;color:var(--muted);font-size:13px; }
 #app.registro-wordpress-app .account-profile-segments button[aria-pressed="true"] { background:#fff;color:var(--forest);box-shadow:0 1px 4px #173b6210; }
 #app.registro-wordpress-app .account-profile-segments button:hover { color:var(--forest); }
}
@media(prefers-reduced-motion:reduce){#app.registro-wordpress-app .account-profile-track::after{transition:none;}}
:is(#app,#parent-editor) .family-student-option { display:flex!important;flex-direction:row!important;align-items:center;gap:12px;padding:12px;border:1px solid var(--theme-line);border-radius:12px; }
:is(#app,#parent-editor) .family-student-option input { flex:0 0 18px!important;width:18px!important;height:18px!important;min-height:18px!important;margin:0!important; }
:is(#app,#parent-editor) .family-student-option small { display:block;margin-top:6px;font-weight:400;line-height:1.45;color:var(--muted); }
:is(#app.registro-wordpress-app,body > #parent-editor) :is(#parent-admin-form,#parent-admin-edit-form) [hidden] { display:none!important; }
#app .family-feedback { margin:0 0 18px;padding:12px 16px;border-radius:12px;background:var(--theme-soft);color:var(--forest); }
#app .family-feedback.error { color:#9e2929;background:#fff1f1; }
#app .family-empty { color:var(--muted);padding:12px 0; }
#app .family-no-children { text-align:center;padding:36px 24px; }
#app .family-no-children svg { width:48px;height:48px;color:var(--forest);margin-bottom:16px; }
#app .family-no-children p { margin-top:10px; }
#app.registro-wordpress-app .family-parent-table :is(th,td) { vertical-align:middle;white-space:normal;overflow-wrap:anywhere; }
#app .family-parent-table .person > div { min-width:0; }
#app .family-parent-table .small-avatar { flex-shrink:0; }
#app .family-parent-username,
#app .family-parent-phone { display:block;margin-top:4px;color:var(--muted);font-weight:400; }
#app .family-parent-child { display:block;line-height:1.6; }
#app .family-parent-muted { color:var(--muted); }
#app .family-parent-badges { display:flex;flex-wrap:wrap;gap:5px;margin-top:8px; }
#app .family-parent-actions { display:flex;align-items:center;gap:8px;white-space:nowrap; }
#app .family-parent-actions button { flex-shrink:0; }
#app .family-parent-table .family-feedback { margin:8px 0 0;padding:8px;font-size:12px; }
#app.registro-wordpress-app .family-parent-directory .list-order { flex-wrap:nowrap!important;flex-shrink:0; }
@media(min-width:901px){
 #app .family-parent-table th:first-child { width:30%; }
 #app .family-parent-table th:nth-child(2) { width:28%; }
 #app .family-parent-table th:nth-child(3) { width:30%; }
}
:is(#app,#parent-editor) .family-children-picker { border:1px solid var(--theme-line);border-radius:14px;padding:16px;min-width:0; }
:is(#app,#parent-editor) .family-children-picker p,:is(#app,#parent-editor) .family-children-picker small { color:var(--muted);font-size:13px;line-height:1.5; }
:is(#app,#parent-editor) .family-search-label { margin:12px 0; }
:is(#app,#parent-editor) .family-children-options { max-height:260px;overflow:auto;display:grid;gap:6px;margin:12px 0; }
:is(#app.registro-wordpress-app.registro-ui,body > #parent-editor) .family-children-options label { display:flex!important;flex-direction:row!important;align-items:center!important;gap:10px!important;padding:10px!important;border-radius:10px;background:var(--theme-soft,#edf3f8); }
:is(#app.registro-wordpress-app.registro-ui,body > #parent-editor) .family-children-options label[hidden] { display:none!important; }
:is(#app.registro-wordpress-app.registro-ui,body > #parent-editor) .family-children-options input { width:18px!important;min-width:18px!important;max-width:18px!important;height:18px!important;min-height:18px!important;max-height:18px!important;margin:0!important;padding:0!important;flex:0 0 18px;accent-color:var(--forest); }
:is(#app,#parent-editor) .family-form-feedback { margin:12px 0;color:var(--forest); }
:is(#app,#parent-editor) .family-form-feedback[role=alert] { color:#a12727; }
#app.parent-shell .family-current-child { margin:8px 0 0;color:var(--muted);font-size:14px;flex-basis:100%; }
#app.parent-shell .topbar { flex-wrap:wrap; }
#app.parent-shell .notification-bell { display:none!important;place-items:center!important; }
#app.parent-shell .notification-bell::before { display:none!important; }
#app.parent-shell .notification-bell svg { width:22px;height:22px; }
#app.parent-shell .family-header-picker { display:flex!important;flex-direction:column!important;gap:4px!important;min-width:0;color:#fff;font-size:11px; }
#app.parent-shell .family-header-picker select { width:100%;min-width:0;max-width:180px;min-height:38px;border:1px solid #ffffff80;border-radius:10px;padding:6px 24px 6px 10px;background:#ffffff;color:var(--forest);font:600 13px var(--registro-body,Arial,sans-serif);text-overflow:ellipsis; }
@media(min-width:901px){
 #app.registro-wordpress-app.parent-shell .sidebar .brand { flex-wrap:wrap!important;height:auto!important;min-height:34px!important;flex-shrink:0!important; }
 #app.parent-shell .family-header-picker { flex:1 1 140px;order:3;margin-top:12px; }
 #app.parent-shell .brand .notification-bell { order:4;align-self:flex-end; }
}
@media(max-width:900px){
 #app.registro-wordpress-app.parent-shell .sidebar .brand { display:grid!important;grid-template-columns:34px max-content minmax(0,1fr) 32px;gap:clamp(4px,1.6vw,8px)!important;align-items:center!important;height:auto!important;min-height:38px!important; }
 #app.parent-shell .brand>span:nth-child(2) { grid-column:2;grid-row:1;min-width:0!important;margin:0!important; }
 #app.parent-shell .family-header-picker { grid-column:3;grid-row:1;margin:0!important; }
 #app.parent-shell .family-header-picker>span { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
 #app.parent-shell .family-header-picker select { max-width:none; }
 #app.parent-shell .notification-bell { display:inline-grid!important;grid-column:4;grid-row:1;margin:0!important;flex:0 0 32px!important;width:32px!important; }
}
/* Preferenza nel profilo; le altre sezioni mantengono il figlio selezionato. */
#app.registro-wordpress-app .family-calendar-option,
#app.registro-wordpress-app .notification-email-option { display:flex!important;flex-direction:row!important;align-items:center!important;gap:12px!important; }
#app.registro-wordpress-app :is(.family-calendar-option,.notification-email-option) input { flex:0 0 20px!important;width:20px!important;min-width:20px!important;height:20px!important;min-height:20px!important;margin:0!important;accent-color:var(--forest); }
#app .family-calendar-option small { display:block;margin-top:5px;color:var(--muted);font-weight:400; }
#app .family-calendar-legend { display:flex;flex-wrap:wrap;gap:12px 20px;padding:12px 20px;border-top:1px solid var(--theme-line);font-size:13px; }
#app .family-calendar-legend span { display:inline-flex;align-items:center;gap:7px; }
.family-lesson-colors { display:inline-flex;gap:3px;vertical-align:middle;margin-right:6px; }
:is(.family-calendar-legend,.family-lesson-colors) i { display:inline-block;flex:0 0 10px;width:10px;height:10px;border-radius:50%;background:var(--child-color); }
@media(max-width:900px){
 #app.parent-shell .family-header-picker { justify-self:end;width:min(100%,160px); }
 #app.registro-wordpress-app.parent-shell .family-header-picker select { height:32px!important;min-height:32px!important;padding:3px 20px 3px 5px!important;border-radius:8px!important;font-size:12px!important;text-align:right;text-align-last:right; }
}

#app .calendar-event.family-calendar-event { border-left:3px solid var(--child-color);background:color-mix(in srgb,var(--child-color) 10%,white); }
@media(max-width:900px){
 #app.registro-wordpress-app.registro-mobile-ui .calendar-event.family-calendar-event { width:auto!important;min-width:5px;border:0;background:transparent!important;overflow:visible; }
 #app .calendar-event.family-calendar-event .family-lesson-colors { display:flex;gap:2px;margin:0; }
 #app .calendar-event.family-calendar-event .family-lesson-colors i { width:5px;height:5px;flex-basis:5px; }
}

/* Dati genitore nei form Allievo: riferimento semplice o profilo reale. */
.student-parent-fields{min-width:0;margin:0;padding:16px;border:1px solid var(--border,#d5dfe9);border-radius:12px}
.student-parent-fields>legend{padding:0 6px;font-weight:700}
.student-parent-fields .subject-checkbox{display:flex;align-items:center;gap:8px}
.student-parent-fields .subject-checkbox input{width:18px!important;min-height:18px!important;height:18px!important;flex:0 0 18px}
.student-parent-fields .student-parent-help{font-size:13px;line-height:1.5;margin:10px 0;color:var(--muted,#506e89)}
.student-parent-fields [data-new-parent]{margin-top:14px}
.student-parent-fields input:disabled{opacity:.65}
.student-parent-fields [hidden]{display:none!important}
@media(max-width:600px){.student-parent-fields{padding:12px}.student-parent-fields .form-grid{grid-template-columns:minmax(0,1fr)!important}}

/* Il selettore mobile segue il nome selezionato e lascia respiro al logo. */
@media(max-width:900px){
 #app.parent-shell .family-header-picker { width:min(100%,var(--child-picker-width,130px));max-width:160px;justify-self:end; }
 #app.registro-wordpress-app.parent-shell .family-header-picker select { height:30px!important;min-height:30px!important;padding:3px 22px 3px 8px!important;border-radius:8px!important;font-size:11.5px!important;text-align:left;text-align-last:left; }
}
