/* PeakFour V85 • scoped dark design system; preserves room-specific visuals and light theme. */
:root[data-pf-theme="dark"]{
  --pf85-background:#0b0f19;
  --pf85-panel:#131825;
  --pf85-elevated:#1a2232;
  --pf85-border:rgba(148,163,184,.17);
  --pf85-primary:#3b82f6;
  --pf85-heading:#f8fafc;
  --pf85-muted:#a8b5c8;
}
:root[data-pf-theme="dark"] body,
:root[data-pf-theme="dark"] .peak-layout{background-color:var(--pf85-background)!important;}
:root[data-pf-theme="dark"] .peak-sidebar{
  background:var(--pf85-panel)!important;
  border-right:1px solid var(--pf85-border)!important;
  color:#e2e8f0!important;
}
:root[data-pf-theme="dark"] .peak-sidebar .category-tab:not(.is-active):not([aria-selected="true"]){
  color:#cbd5e1!important;
  background:transparent!important;
}
:root[data-pf-theme="dark"] .peak-sidebar .category-tab:is(.is-active,[aria-selected="true"]){
  color:white!important;background:#2563eb!important;border-color:#3b82f6!important;border-radius:13px!important;
}
:root[data-pf-theme="dark"] .peak-sidebar-heading,
:root[data-pf-theme="dark"] .peak-sidebar-separator{color:#a8b5c8!important;}
:root[data-pf-theme="dark"] :is(#page-discover,#page-lessons,#page-profile,#page-dictation,#page-chunking,#page-shadowing,#page-vocabulary,#page-grammar,#page-cms){
  --pf85-background:#0b0f19;--pf85-panel:#131825;--pf85-border:rgba(148,163,184,.17);
}
:root[data-pf-theme="dark"] :is(.pf-auth-backdrop,#page-profile) :is(button,input,select,textarea):focus-visible{
  outline:2px solid #60a5fa!important;outline-offset:3px!important;
}
:root[data-pf-theme="dark"] .pf-profile-page :is(.pf-profile-panel,.pf-profile-overview article,.pf-v63-analytics .pf-profile-panel){
  background:var(--pf85-panel)!important;border:1px solid var(--pf85-border)!important;
  box-shadow:0 14px 32px rgba(0,0,0,.12)!important;
}
:root[data-pf-theme="dark"] .pf-profile-page :is(.pf-profile-panel,.pf-profile-overview article) p{color:#aab7cc!important;}
:root[data-pf-theme="dark"] .pf-profile-page :is(.pf-panel-head h2,.pf-profile-settings h2){color:#f8fafc!important;}

/* Google login button is outside the HTML form so it never triggers password validation. */
.pf85-auth-separator{display:flex;align-items:center;gap:12px;margin:8px 0 5px;color:#64748b;font-size:12px;font-weight:650;text-align:center}
.pf85-auth-separator:before,.pf85-auth-separator:after{content:"";height:1px;flex:1;background:#dce5ef}
.pf85-google-login{display:flex;align-items:center;justify-content:center;gap:12px;min-height:50px;width:100%;padding:12px 16px;border:1px solid #cbd5e1;background:#fff;color:#17243b;border-radius:13px;cursor:pointer;font-size:14px;font-weight:750;transition:background .16s,border-color .16s,transform .16s}
.pf85-google-login:hover{background:#f2f7ff;border-color:#93c5fd;transform:translateY(-1px)}
.pf85-google-login:active{transform:translateY(0)}
.pf85-google-login:disabled{opacity:.55;cursor:progress}
.pf85-google-login[hidden],.pf85-auth-separator[hidden]{display:none!important}
.pf85-google-login:focus-visible{outline:3px solid #60a5fa;outline-offset:2px}

/* Profile-only 3-column dashboard: existing app navigation remains functional everywhere. */
#page-profile.pf-profile-page{width:100%;max-width:1700px!important;padding:clamp(10px,1.7vw,26px)!important;overflow:visible}
#page-profile .pf85-profile-shell{display:grid;grid-template-columns:minmax(185px,210px) minmax(0,1fr) minmax(232px,270px);align-items:start;gap:18px;width:100%}
#page-profile .pf85-profile-core{min-width:0;display:grid;gap:16px}
#page-profile .pf85-profile-nav,
#page-profile .pf85-profile-widgets .pf85-widget{
  border:1px solid #dce5f3;background:white;border-radius:22px;padding:20px;min-width:0;
}
#page-profile .pf85-profile-nav{position:sticky;top:76px;display:grid;gap:8px}
#page-profile .pf85-nav-brand{display:flex;align-items:center;gap:10px;margin-bottom:24px;color:#17243b;font-size:21px;letter-spacing:-.05em}
#page-profile .pf85-nav-brand img{width:35px;height:35px;object-fit:contain}
#page-profile .pf85-nav-caption{font-size:10px;letter-spacing:.15em;font-weight:800;color:#64748b;margin-bottom:8px}
#page-profile .pf85-profile-nav>button{display:flex;align-items:center;gap:12px;text-align:left;padding:12px 15px;color:#334155;background:transparent;border:1px solid transparent;border-radius:13px;cursor:pointer;font:700 13px/1.3 Inter,system-ui,sans-serif;white-space:normal;min-height:45px}
#page-profile .pf85-profile-nav>button:hover{background:#eaf2ff;color:#1d4ed8}
#page-profile .pf85-profile-nav>button.is-active{background:#2563eb;color:#fff;box-shadow:0 10px 20px rgba(37,99,235,.13)}
#page-profile .pf85-profile-nav>p{font-size:11px;line-height:1.7;color:#64748b;margin:18px 4px 0}
#page-profile .pf85-profile-welcome{display:flex;justify-content:space-between;align-items:center;gap:18px}
#page-profile .pf85-profile-welcome span{display:block;font-size:10px;font-weight:850;letter-spacing:.18em;color:#2563eb}
#page-profile .pf85-profile-welcome h2{font-size:clamp(19px,2vw,29px);letter-spacing:-.045em;margin:7px 0;color:#17243b}
#page-profile .pf85-profile-welcome small{color:#64748b;font-size:12px}
#page-profile .pf-profile-hero{margin:0!important;display:flex;align-items:center;background:#eff5ff!important;border:1px solid #dbe8fa!important;padding:24px!important;border-radius:23px!important;box-shadow:none!important}
#page-profile .pf-profile-hero h1{font-size:clamp(25px,2.3vw,37px)!important}
#page-profile .pf-profile-identity{min-width:0;max-width:410px;flex-wrap:wrap}
#page-profile .pf-profile-overview{margin:0!important;gap:12px;grid-template-columns:repeat(4,minmax(0,1fr))}
#page-profile .pf-profile-overview article{min-height:137px;padding:18px!important}
#page-profile .pf-profile-overview article strong{font-size:clamp(22px,2.5vw,34px)!important;margin:14px 0 5px}
#page-profile .pf-v63-analytics{margin:0!important;grid-template-columns:1.15fr 1fr;gap:14px}
#page-profile .pf-profile-grid{margin:0!important;gap:14px}
#page-profile .pf-profile-panel{padding:20px!important}
#page-profile .pf-profile-settings{margin-bottom:0!important}
#page-profile .pf-path-entry{margin-bottom:0!important}
#page-profile .pf85-section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:12px}
#page-profile .pf85-section-heading h2{font-size:18px!important;margin:0;color:#17243b}
#page-profile .pf85-section-heading span{font-size:11px;color:#64748b}
#page-profile .pf85-skills-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#page-profile .pf85-skills-grid article{padding:18px 15px;border:1px solid #dbe5f3;border-radius:17px;background:white;min-width:0}
#page-profile .pf85-skills-grid article>span{color:#475569;font-size:12px;font-weight:750}
#page-profile .pf85-skills-grid strong{display:block;color:#94a3b8;font-size:24px;margin:10px 0}
#page-profile .pf85-skills-grid small{display:block;color:#64748b;font-size:10px;line-height:1.5;min-height:30px}
#page-profile .pf85-skill-track{height:4px;background:#e2e8f0;margin-top:15px;border-radius:4px}
#page-profile .pf85-attendance{padding:21px;border:1px solid #dbe5f3;border-radius:20px;background:#fff;display:grid;gap:8px}
#page-profile .pf85-attendance-title{display:flex;align-items:center;justify-content:space-between;gap:14px}
#page-profile .pf85-attendance-title h2{margin:0;font-size:18px!important;color:#17243b}
#page-profile .pf85-attendance-title p,#page-profile .pf85-attendance>p{font-size:12px;margin:6px 0;color:#64748b;line-height:1.6}
#page-profile .pf85-attendance-ring{--pf85-progress:0%;background:conic-gradient(#3b82f6 var(--pf85-progress),#dfe8f7 0);border-radius:50%;min-width:94px;width:94px;height:94px;display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;isolation:isolate}
#page-profile .pf85-attendance-ring:before{content:"";position:absolute;inset:11px;border-radius:50%;background:#fff;z-index:-1}
#page-profile .pf85-attendance-ring strong{font-size:22px;color:#17243b;line-height:1}
#page-profile .pf85-attendance-ring small{font-size:10px;color:#64748b;margin-top:5px}
#page-profile .pf85-profile-widgets{position:sticky;top:76px;display:grid;gap:16px}
#page-profile .pf85-profile-widgets .pf85-widget{padding:20px}
#page-profile .pf85-widget-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
#page-profile .pf85-widget-head h2{font-size:17px!important;color:#17243b;margin:0}
#page-profile .pf85-widget-head button{width:31px;height:31px;border:1px solid #dce5ef;border-radius:9px;background:#f8fafc;color:#334155;cursor:pointer;font-size:19px}
#page-profile .pf85-widget h3{color:#334155;font-size:13px;margin:14px 0}
#page-profile .pf85-calendar-weekdays,#page-profile .pf85-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
#page-profile .pf85-calendar-weekdays span{text-align:center;color:#94a3b8;font-size:10px;font-weight:750;padding:6px 0}
#page-profile .pf85-calendar-grid button{min-height:31px;padding:0;color:#475569;background:transparent;border:1px solid transparent;border-radius:9px;font-size:11px;cursor:pointer}
#page-profile .pf85-calendar-grid button:hover{border-color:#93c5fd}
#page-profile .pf85-calendar-grid button.is-today{border-color:#60a5fa}
#page-profile .pf85-calendar-grid button.has-activity{color:#1d4ed8;background:#dbeafe;font-weight:800}
#page-profile .pf85-calendar-grid button.is-selected{background:#2563eb;color:#fff;border-color:#2563eb}
#page-profile .pf85-widget p{color:#64748b;font-size:12px;line-height:1.6}
#page-profile .pf85-upcoming-empty{border:1px dashed #cbd5e1;border-radius:16px;padding:18px 12px;text-align:center;margin-top:15px}
#page-profile .pf85-upcoming-empty>span{font-size:24px;color:#93c5fd}
#page-profile .pf85-upcoming-empty strong{display:block;color:#334155;margin-top:5px;font-size:13px}
#page-profile .pf85-profile-widgets #pf85-courses-open{min-height:42px;width:100%;border-radius:11px;border:0;background:#2563eb;color:white;font-weight:750;cursor:pointer;padding:10px}
#page-profile .pf85-profile-widgets #pf85-courses-open:hover{background:#1d4ed8}

/* Shared dark foundation for dashboard. Do not force dark styles into the light theme. */
:root[data-pf-theme="dark"] #page-profile .pf85-profile-shell{color:#f8fafc}
:root[data-pf-theme="dark"] #page-profile :is(.pf85-profile-nav,.pf85-profile-widgets .pf85-widget,.pf85-skills-grid article,.pf85-attendance){background:#131825!important;border-color:rgba(148,163,184,.17)!important;box-shadow:none!important}
:root[data-pf-theme="dark"] #page-profile .pf-profile-hero{background:#182439!important;border-color:rgba(148,163,184,.18)!important}
:root[data-pf-theme="dark"] #page-profile :is(.pf85-profile-welcome h2,.pf85-nav-brand,.pf85-section-heading h2,.pf85-widget-head h2,.pf85-attendance-title h2,.pf85-upcoming-empty strong){color:#f8fafc!important}
:root[data-pf-theme="dark"] #page-profile :is(.pf85-profile-welcome small,.pf85-profile-nav>p,.pf85-section-heading span,.pf85-skills-grid small,.pf85-skills-grid article>span,.pf85-widget p,.pf85-attendance>p,.pf85-attendance-title p){color:#a8b5c8!important}
:root[data-pf-theme="dark"] #page-profile .pf85-nav-caption{color:#8ea7ce}
:root[data-pf-theme="dark"] #page-profile .pf85-profile-nav>button{color:#cbd5e1}
:root[data-pf-theme="dark"] #page-profile .pf85-profile-nav>button:hover{background:#24304b;color:#fff}
:root[data-pf-theme="dark"] #page-profile .pf85-profile-nav>button.is-active{background:#2563eb;color:#fff}
:root[data-pf-theme="dark"] #page-profile .pf85-profile-welcome span{color:#60a5fa}
:root[data-pf-theme="dark"] #page-profile .pf85-skills-grid strong{color:#91a5c2}
:root[data-pf-theme="dark"] #page-profile .pf85-skill-track{background:#2b3852}
:root[data-pf-theme="dark"] #page-profile .pf85-attendance-ring{background:conic-gradient(#3b82f6 var(--pf85-progress),#28364c 0)}
:root[data-pf-theme="dark"] #page-profile .pf85-attendance-ring:before{background:#131825}
:root[data-pf-theme="dark"] #page-profile .pf85-attendance-ring strong{color:#f8fafc}
:root[data-pf-theme="dark"] #page-profile .pf85-attendance-ring small{color:#9caec7}
:root[data-pf-theme="dark"] #page-profile .pf85-widget h3{color:#dbeafe}
:root[data-pf-theme="dark"] #page-profile .pf85-widget-head button{background:#1b2435;border-color:#334155;color:#f8fafc}
:root[data-pf-theme="dark"] #page-profile .pf85-calendar-grid button{color:#cbd5e1}
:root[data-pf-theme="dark"] #page-profile .pf85-calendar-grid button.has-activity{color:#bfdbfe;background:#233e68}
:root[data-pf-theme="dark"] #page-profile .pf85-calendar-grid button.is-selected{color:#fff;background:#2563eb}
:root[data-pf-theme="dark"] #page-profile .pf85-upcoming-empty{border-color:#3a475c}
:root[data-pf-theme="dark"] #page-profile .pf85-profile-overview article,#page-profile .pf-v63-analytics .pf-profile-panel{background:#131825!important}

@media(max-width:1350px){
 #page-profile .pf85-profile-shell{grid-template-columns:170px minmax(0,1fr) 225px;gap:12px}
 #page-profile .pf-profile-overview{grid-template-columns:repeat(2,minmax(0,1fr))}
 #page-profile .pf85-skills-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #page-profile .pf-v63-analytics{grid-template-columns:1fr}
}
@media(max-width:1050px){
 #page-profile .pf85-profile-shell{grid-template-columns:175px minmax(0,1fr)}
 #page-profile .pf85-profile-widgets{grid-column:2;position:static;grid-template-columns:repeat(2,minmax(0,1fr))}
 #page-profile .pf85-profile-nav{position:static}
}
@media(max-width:690px){
 #page-profile .pf85-profile-shell{display:flex;flex-direction:column;gap:12px}
 #page-profile .pf85-profile-core,#page-profile .pf85-profile-nav,#page-profile .pf85-profile-widgets{width:100%}
 #page-profile .pf85-profile-nav{display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;padding:9px;position:static}
 #page-profile .pf85-nav-brand,#page-profile .pf85-nav-caption,#page-profile .pf85-profile-nav>p{display:none}
 #page-profile .pf85-profile-nav>button{flex:0 0 auto;white-space:nowrap;min-height:40px;padding:9px 12px}
 #page-profile .pf85-profile-widgets{display:grid;grid-template-columns:1fr}
 #page-profile .pf85-profile-welcome{flex-wrap:wrap}
 #page-profile .pf85-skills-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #page-profile .pf-profile-overview{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:380px){#page-profile .pf85-skills-grid{grid-template-columns:1fr 1fr}#page-profile .pf85-skills-grid article{padding:12px}}
@media(prefers-reduced-motion:reduce){#page-profile .pf85-profile-shell *, .pf85-google-login{transition:none!important;animation:none!important}}
/* Prevent legacy page width:100% plus padding from widening the document. */
#page-profile.pf-profile-page{box-sizing:border-box!important;max-width:100%!important;overflow-x:clip}
#page-profile .pf85-profile-shell,
#page-profile .pf85-profile-core,
#page-profile .pf85-profile-nav,
#page-profile .pf85-profile-widgets,
#page-profile .pf85-profile-widgets .pf85-widget,
#page-profile .pf85-skills-grid article,
#page-profile .pf-profile-overview article{box-sizing:border-box;min-width:0}
@media(max-width:690px){
 #page-profile .pf85-profile-shell{width:100%}
 #page-profile .pf85-profile-nav{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
 #page-profile .pf85-profile-core{max-width:100%}
 #page-profile .pf85-section-heading{flex-wrap:wrap}
}
