#profileMenu[hidden], .profile-panel [hidden], .profile-panel[hidden], .profile-old { display:none !important; }
.profile-slot { justify-self:end; }
#profileMenu { position:relative; }
.profile-trigger, .profile-close {
  display:grid; place-items:center; border:1px solid var(--line); background:var(--white);
  color:var(--ink); cursor:pointer; border-radius:50%; padding:3px;
}
.profile-trigger { width:50px; height:50px; }
.profile-avatar {
  display:grid; place-items:center; border-radius:50%; overflow:hidden; width:40px; height:40px;
  background:#7b2463; color:white; font:bold 20px/1 "Segoe UI",sans-serif;
}
.profile-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-avatar-large { width:52px; height:52px; font-size:24px; }
.profile-panel {
  position:absolute; z-index:60; right:0; top:100%;
  width:min(340px,calc(100vw - 32px)); max-height:min(620px,70dvh); overflow:auto;
  padding:14px; border-radius:20px; background:var(--white,#fff); color:var(--ink);
  border:1px solid var(--line); box-shadow:0 15px 42px #17152e2e;
  animation:profile-open 140ms ease-out;
}
@keyframes profile-open { from { opacity:0; transform:translateY(-6px); } }
@media(prefers-reduced-motion:reduce) { .profile-panel { animation:none; } }
.profile-heading { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; margin-bottom:10px; }
.profile-name,.profile-email { display:block; overflow-wrap:anywhere; }
.profile-email { color:var(--muted); font-size:12px; }
.profile-close { width:34px; height:34px; min-height:34px; font-size:21px; }
.profile-row {
  display:flex; align-items:center; width:100%; min-height:44px; padding:8px 12px;
  background:var(--paper,#f5f5fb); color:var(--ink); border:1px solid var(--line);
  border-radius:7px; font:inherit; font-weight:650; text-decoration:none; text-align:left;
}
.profile-row:hover { background:var(--lilac); }
.profile-actions { display:grid; gap:5px; margin:9px 0; }
.profile-details { border-top:1px solid var(--line); margin:9px 0; padding:9px 2px 2px; }
.profile-details summary { cursor:pointer; padding:5px; font-weight:700; }
.profile-details label { display:block; margin-top:9px; font-weight:650; }
.profile-details input,.profile-details select { width:100%; min-height:42px; font:inherit; color:var(--ink); background:var(--white); }
.profile-details p { color:var(--muted); margin:7px 0 0; font-size:12px; }
.profile-remove { background:transparent; color:var(--ink); border:0; text-decoration:underline; }
html[data-planit-text=blue] { --ink:#183d78; }
html[data-planit-text=purple] { --ink:#553174; }
html[data-planit-text=green] { --ink:#18513f; }
html[data-planit-theme=dark] {
  color-scheme:dark;
  --ink:#edf0ff; --muted:#b7c2d5; --paper:#171b28; --bg:#171b28; --white:#252b3b;
  --line:#4a536a; --mint:#244137; --peach:#4a3336; --lilac:#3e3455; --butter:#493d28; --blue:#273f55;
}
html[data-planit-theme=dark][data-planit-text=blue] { --ink:#bcd8ff; }
html[data-planit-theme=dark][data-planit-text=purple] { --ink:#e5ceff; }
html[data-planit-theme=dark][data-planit-text=green] { --ink:#b6efd6; }
html[data-planit-theme=dark] body:not(.auth-page) { background:var(--paper); color:var(--ink); }
html[data-planit-theme=dark] :is(.siteheader,.task,.weekday,.day:not(.holiday,.study,.activity),.quarterMonth,.tipbubble,.tipbubble:after,.example,table,th,.miniweek button:not(.sel),.iconbutton,.nav button:not(.active),.btn.secondary,.btn.minor,.deck,.card,.chip,.notice,.week-day,.week-empty,.stat) {
  background:var(--white); color:var(--ink); border-color:var(--line);
}
html[data-planit-theme=dark] :is(.panel,details,th,td) { border-color:var(--line); box-shadow:none; }
html[data-planit-theme=dark] :is(.panel:not(.mint,.peach,.lilac,.butter,.blue),.field input,.field select,.field textarea,.tt input,input:not([type=checkbox]),select,textarea) {
  background:var(--white); color:var(--ink); border-color:var(--line);
}
html[data-planit-theme=dark] :is(.foot,.footer,.hint,.meta,.sub,.dayinfo,.tips,.planit-notice,.weekday p,.day .tcount,.task.done .taskname,.profile-details p) { color:var(--muted); }
html[data-planit-theme=dark] :is(a:not(.btn,.profile-row), .status, .opslag-indicator, #cloudStatus) { color:#a4e2cf; }
html[data-planit-theme=dark] :is(.pill,.tag,.badge) { background:#434c63; color:#fff; }
@media print { #profileMenu { display:none !important; } }
.profile-entry {
  position:absolute; right:clamp(12px,4vw,36px); top:12px; z-index:1; color:#275f82;
  background:#fff; border:1px solid #cbd2e4; padding:8px 12px; border-radius:6px; text-decoration:none; font-weight:700;
}
.school-lessons { margin:7px 0 11px; color:var(--ink); }
.school-lessons ul { padding-left:22px; }
.school-lessons summary { cursor:pointer; font-size:.94rem; font-weight:700; }
#schoolSchedule form { display:grid; gap:8px; max-width:520px; }
#schoolSchedule input[type=file] { max-width:100%; }
