/* Precision student panel shell v2: exact shared width, flush top, shared home monogram. */
:root{
  --pe-panel-max:1120px;
  --pe-panel-gutter:24px;
}

/* Remove WordPress/theme spacing before Precision workspace pages. */
body.pe-consistent-panel-page,
body.pe-consistent-panel-page .wp-site-blocks,
body.pe-consistent-panel-page .wp-site-blocks > main,
body.pe-consistent-panel-page main.wp-block-group,
body.pe-consistent-panel-page .wp-block-post-content,
body.pe-consistent-panel-page .entry-content,
body.pe-consistent-panel-page article.wp-block-post,
body.pe-consistent-panel-page .wp-block-group:has(.pe-dashboard),
body.pe-consistent-panel-page .wp-block-group:has(.pe-tests-page),
body.pe-consistent-panel-page .wp-block-group:has(.pe-results-page),
body.pe-consistent-panel-page .wp-block-group:has(.pe-profile-page),
body.pe-consistent-panel-page .wp-block-group:has(.pe-student-leaderboard),
body.pe-consistent-panel-page .wp-block-group:has(.pe-result-page),
body.pe-consistent-panel-page .wp-block-group:has(.pe-public-resources){
  margin-top:0!important;
  padding-top:0!important;
  margin-block-start:0!important;
}

body.pe-consistent-panel-page .wp-block-post-content > :first-child,
body.pe-consistent-panel-page .entry-content > :first-child{
  margin-top:0!important;
  margin-block-start:0!important;
}

/* Exact shared width for every student workspace page. */
body.pe-consistent-panel-page .pe-dashboard,
body.pe-consistent-panel-page main.pe-tests-page,
body.pe-consistent-panel-page .pe-results-page,
body.pe-consistent-panel-page .pe-profile-page,
body.pe-consistent-panel-page .pe-student-leaderboard,
body.pe-consistent-panel-page .pe-result-page:not(.pe-evaluation-report-page){
  box-sizing:border-box!important;
  width:min(var(--pe-panel-max),calc(100vw - var(--pe-panel-gutter)))!important;
  max-width:var(--pe-panel-max)!important;
  margin:0 auto 48px!important;
  padding-top:0!important;
}

/* Dashboard used its own top padding; remove it. */
body.pe-consistent-panel-page .pe-dashboard{
  padding-top:0!important;
}

/* Public resource library uses a different outer wrapper. */
body.pe-consistent-panel-page .pe-public-resources{
  box-sizing:border-box!important;
  width:min(var(--pe-panel-max),calc(100vw - var(--pe-panel-gutter)))!important;
  max-width:var(--pe-panel-max)!important;
  margin:0 auto 48px!important;
  padding-top:0!important;
  padding-left:0!important;
  padding-right:0!important;
}
body.pe-consistent-panel-page .pe-public-resources .pe-lib-shell,
body.pe-consistent-panel-page .pe-public-resources > .pe-lib-shell{
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
}
body.pe-consistent-panel-page .pe-public-resources .pe-lib-hero{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
}

/* Every primary hero/header is exactly aligned to the shared panel edges. */
body.pe-consistent-panel-page :is(
  .pe-student-creator-hero,
  .pe-student-welcome,
  .pe-tests-page-hero,
  .pe-results-hero,
  .pe-profile-hero,
  .pe-sl-header,
  .pe-result-header,
  .pe-lib-hero
){
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  margin-top:0!important;
  margin-left:0!important;
  margin-right:0!important;
  position:relative!important;
}

/* Clickable home monogram: inline in each header so it never overlaps controls. */
.pe-panel-home-mark{
  position:relative;
  z-index:6;
  display:grid;
  width:48px;
  height:48px;
  flex:0 0 48px;
  place-items:center;
  border:1px solid rgba(255,255,255,.72);
  border-radius:14px;
  background:rgba(255,255,255,.96);
  box-shadow:0 8px 22px rgba(20,45,105,.14);
  text-decoration:none!important;
  transition:transform .18s ease,box-shadow .18s ease;
}
.pe-panel-home-mark:hover{transform:translateY(-1px);box-shadow:0 12px 26px rgba(20,45,105,.19)}
.pe-panel-home-mark img{display:block;width:36px;height:36px;object-fit:contain}

/* Available Tests: mark + back + title + profile in one clean row. */
.pe-tests-page-hero-top.pe-panel-brand-row{
  grid-template-columns:48px auto minmax(0,1fr) auto!important;
  gap:12px!important;
}

/* Results / Profile: mark and Back button on left, badge/count on far right. */
.pe-results-hero-top.pe-panel-brand-row,
.pe-profile-hero-top.pe-panel-brand-row{
  display:grid!important;
  grid-template-columns:48px auto minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:12px!important;
}
.pe-results-hero-top.pe-panel-brand-row .pe-results-count,
.pe-profile-hero-top.pe-panel-brand-row .pe-profile-account-badge{grid-column:4}

/* Leaderboard / Result navigation: brand is a first-class navigation item. */
.pe-sl-nav.pe-panel-brand-row,
.pe-result-nav.pe-panel-brand-row{
  display:grid!important;
  grid-template-columns:48px auto minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:12px!important;
}
.pe-sl-nav.pe-panel-brand-row>a:last-child,
.pe-result-nav.pe-panel-brand-row>a:last-child{grid-column:4;justify-self:end}

/* Resources: brand sits beside the hero copy and before the artwork. */
.pe-lib-hero-inner.pe-panel-brand-row{
  grid-template-columns:48px minmax(0,1fr) auto!important;
  gap:18px!important;
}

/* Shared branded-header spacing. Keep the original hero inset on every page. */
body.pe-consistent-panel-page :is(
  .pe-tests-page-hero,
  .pe-results-hero,
  .pe-profile-hero,
  .pe-sl-header,
  .pe-result-header,
  .pe-lib-hero
){
  padding:24px!important;
}

/* Results/Profile top row: logo + back + flexible space + badge. */
.pe-results-hero-top.pe-panel-brand-row,
.pe-profile-hero-top.pe-panel-brand-row{
  width:100%;
  margin-bottom:20px!important;
}

/* Keep titles and content safely inside the hero after the brand row. */
.pe-results-hero.pe-panel-has-home-mark > :not(.pe-results-hero-top),
.pe-profile-hero.pe-panel-has-home-mark > :not(.pe-profile-hero-top),
.pe-sl-header.pe-panel-has-home-mark > :not(.pe-sl-nav),
.pe-result-header.pe-panel-has-home-mark > :not(.pe-result-nav){
  margin-left:0!important;
  margin-right:0!important;
}

/* The Available Tests title participates in the desktop row, with no overlap. */
.pe-tests-page-hero-top.pe-panel-brand-row > .pe-tests-page-title{min-width:0}
.pe-tests-page-hero-top.pe-panel-brand-row > .pe-tests-context{justify-self:end}

/* Leaderboard/result navigation always preserves a flexible centre column. */
.pe-sl-nav.pe-panel-brand-row,
.pe-result-nav.pe-panel-brand-row{width:100%}

/* Existing Student Dashboard monogram: make the original logo itself the home button. */
.pe-student-creator-home-link{
  display:grid;
  place-items:center;
  align-self:center;
  border-radius:14px;
  text-decoration:none!important;
  transition:transform .18s ease;
}
.pe-student-creator-home-link:hover{transform:translateY(-1px)}
.pe-student-creator-home-link .pe-student-creator-logo{display:block}

@media(max-width:700px){
  :root{--pe-panel-gutter:16px}
  body.pe-consistent-panel-page .pe-dashboard,
  body.pe-consistent-panel-page main.pe-tests-page,
  body.pe-consistent-panel-page .pe-results-page,
  body.pe-consistent-panel-page .pe-profile-page,
  body.pe-consistent-panel-page .pe-student-leaderboard,
  body.pe-consistent-panel-page .pe-result-page:not(.pe-evaluation-report-page),
  body.pe-consistent-panel-page .pe-public-resources{
    width:calc(100vw - var(--pe-panel-gutter))!important;
    margin-top:0!important;
  }

  body.pe-consistent-panel-page :is(
    .pe-tests-page-hero,
    .pe-results-hero,
    .pe-profile-hero,
    .pe-sl-header,
    .pe-result-header,
    .pe-lib-hero
  ){padding:18px!important}

  .pe-panel-home-mark{width:42px;height:42px;flex-basis:42px;border-radius:12px}
  .pe-panel-home-mark img{width:31px;height:31px}

  /* Available Tests: brand/back/profile first row, title gets full second row. */
  .pe-tests-page-hero-top.pe-panel-brand-row{
    grid-template-columns:42px minmax(0,1fr) auto!important;
    gap:9px!important;
    align-items:center!important;
  }
  .pe-tests-page-hero-top.pe-panel-brand-row > .pe-panel-home-mark{grid-column:1;grid-row:1}
  .pe-tests-page-hero-top.pe-panel-brand-row > .pe-tests-page-back{grid-column:2;grid-row:1;justify-self:start}
  .pe-tests-page-hero-top.pe-panel-brand-row > .pe-tests-context{grid-column:3;grid-row:1}
  .pe-tests-page-hero-top.pe-panel-brand-row > .pe-tests-page-title{grid-column:1/-1;grid-row:2;margin-top:4px}

  /* Results/Profile: compact one-row controls, page content below. */
  .pe-results-hero-top.pe-panel-brand-row,
  .pe-profile-hero-top.pe-panel-brand-row{
    grid-template-columns:42px minmax(0,1fr) auto!important;
    gap:9px!important;
    align-items:center!important;
  }
  .pe-results-hero-top.pe-panel-brand-row > .pe-results-back,
  .pe-profile-hero-top.pe-panel-brand-row > .pe-profile-back{grid-column:2;min-width:0;justify-self:start}
  .pe-results-hero-top.pe-panel-brand-row .pe-results-count,
  .pe-profile-hero-top.pe-panel-brand-row .pe-profile-account-badge{grid-column:3!important;justify-self:end}

  /* Leaderboard and individual result: same three-item control row. */
  .pe-sl-nav.pe-panel-brand-row,
  .pe-result-nav.pe-panel-brand-row{
    grid-template-columns:42px minmax(0,1fr) auto!important;
    gap:9px!important;
  }
  .pe-sl-nav.pe-panel-brand-row>a:first-of-type,
  .pe-result-nav.pe-panel-brand-row>a:first-of-type{grid-column:2;justify-self:start}
  .pe-sl-nav.pe-panel-brand-row>a:last-child,
  .pe-result-nav.pe-panel-brand-row>a:last-child{grid-column:3!important;justify-self:end}

  /* Resources: logo + copy; artwork falls below/away without crowding. */
  .pe-lib-hero-inner.pe-panel-brand-row{grid-template-columns:42px minmax(0,1fr)!important;gap:12px!important}
  .pe-lib-hero-inner.pe-panel-brand-row .pe-lib-hero-art{grid-column:2}
}

@media(max-width:460px){
  .pe-results-back span,
  .pe-profile-back span,
  .pe-sl-nav.pe-panel-brand-row>a span,
  .pe-result-nav.pe-panel-brand-row>a span{display:none}
  .pe-results-back,
  .pe-profile-back,
  .pe-sl-nav.pe-panel-brand-row>a,
  .pe-result-nav.pe-panel-brand-row>a{
    width:42px;min-width:42px;height:42px;min-height:42px;padding:0!important;justify-content:center!important
  }
  .pe-tests-page-back{font-size:12px!important;padding:8px 10px!important}
}


/* v26: one consistent Dashboard control in every student-page header. */
body.pe-consistent-panel-page .pe-panel-dashboard-action{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  min-width:auto!important;
  min-height:44px!important;
  padding:10px 16px!important;
  border:1px solid rgba(255,255,255,.92)!important;
  border-radius:12px!important;
  color:#5b2be0!important;
  -webkit-text-fill-color:#5b2be0!important;
  background:#fff!important;
  box-shadow:0 8px 20px rgba(27,43,96,.10)!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  font-size:13px!important;
  font-weight:900!important;
  line-height:1!important;
  text-shadow:none!important;
}
body.pe-consistent-panel-page .pe-panel-dashboard-action b{
  color:#5b2be0!important;
  -webkit-text-fill-color:#5b2be0!important;
  font:inherit!important;
  line-height:1!important;
  text-shadow:none!important;
}
body.pe-consistent-panel-page .pe-panel-dashboard-action svg{
  width:18px!important;
  height:18px!important;
  flex:0 0 18px!important;
  fill:none!important;
  stroke:#5b2be0!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
body.pe-consistent-panel-page .pe-panel-dashboard-action:hover{
  transform:translateY(-1px)!important;
  color:#4820c4!important;
  background:#fbfaff!important;
  box-shadow:0 12px 24px rgba(27,43,96,.14)!important;
}

@media(max-width:700px){
  body.pe-consistent-panel-page .pe-panel-dashboard-action{
    min-height:42px!important;
    padding:9px 13px!important;
    border-radius:11px!important;
    font-size:12px!important;
  }
  body.pe-consistent-panel-page .pe-panel-dashboard-action svg{
    width:17px!important;
    height:17px!important;
    flex-basis:17px!important;
  }
}

/* v27 — Student Dashboard hero: true centred copy with balanced side zones. */
body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-hero{
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
  align-items:center!important;
}
body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-home-link,
body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-logo{
  justify-self:start!important;
}
body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-hero-copy{
  justify-self:center!important;
  text-align:center!important;
  width:max-content!important;
  max-width:min(620px,58vw)!important;
}
body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-hero-copy > span,
body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-hero-copy h2,
body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-hero-copy p,
body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-hero-copy small{
  text-align:center!important;
}
body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-logout{
  justify-self:end!important;
}

@media(max-width:760px){
  body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-hero{
    grid-template-columns:44px minmax(0,1fr) auto!important;
  }
  body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-hero-copy{
    width:auto!important;
    max-width:100%!important;
    justify-self:stretch!important;
    text-align:center!important;
  }
}
@media(max-width:480px){
  body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-hero{
    grid-template-columns:42px minmax(0,1fr)!important;
  }
  body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-hero-copy{
    grid-column:2!important;
    text-align:center!important;
  }
  body.pe-consistent-panel-page .pe-dashboard-compact .pe-student-creator-logout{
    grid-column:1/-1!important;
    justify-self:stretch!important;
  }
}

/* v28 — Available Tests final cleanup: no subject heading block; Dashboard action pinned right. */
body.pe-consistent-panel-page .pe-tests-page .pe-tests-subject-hub-head{
  display:none!important;
}

body.pe-consistent-panel-page .pe-tests-page .pe-tests-subject-hub{
  margin-top:0!important;
  padding-top:0!important;
}

body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top,
body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top.pe-panel-brand-row{
  display:flex!important;
  align-items:center!important;
  width:100%!important;
  gap:12px!important;
}

body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top > .pe-panel-home-mark{
  flex:0 0 auto!important;
  order:1!important;
  margin:0!important;
}

body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top > .pe-tests-page-back,
body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top > .pe-panel-dashboard-action{
  flex:0 0 auto!important;
  order:4!important;
  margin-left:auto!important;
  margin-right:0!important;
  justify-self:auto!important;
  white-space:nowrap!important;
}

body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top > .pe-tests-page-title,
body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top > .pe-tests-context{
  display:none!important;
}

@media(max-width:700px){
  body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top,
  body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top.pe-panel-brand-row{
    display:flex!important;
    grid-template-columns:none!important;
    gap:10px!important;
  }
  body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top > .pe-tests-page-back,
  body.pe-consistent-panel-page .pe-tests-page .pe-tests-page-hero-top > .pe-panel-dashboard-action{
    margin-left:auto!important;
    margin-right:0!important;
  }
}

/* v29 — Student Profile compact header: monogram left, Dashboard action right. */
body.pe-consistent-panel-page .pe-profile-page .pe-profile-hero-top,
body.pe-consistent-panel-page .pe-profile-page .pe-profile-hero-top.pe-panel-brand-row{
  display:flex!important;
  align-items:center!important;
  width:100%!important;
  gap:12px!important;
  grid-template-columns:none!important;
}
body.pe-consistent-panel-page .pe-profile-page .pe-profile-hero-top > .pe-panel-home-mark{
  flex:0 0 auto!important;
  order:1!important;
  margin:0!important;
}
body.pe-consistent-panel-page .pe-profile-page .pe-profile-hero-top > .pe-profile-back,
body.pe-consistent-panel-page .pe-profile-page .pe-profile-hero-top > .pe-panel-dashboard-action{
  flex:0 0 auto!important;
  order:4!important;
  margin-left:auto!important;
  margin-right:0!important;
  justify-self:auto!important;
  white-space:nowrap!important;
}
body.pe-consistent-panel-page .pe-profile-page .pe-profile-hero-top > .pe-profile-account-badge{
  display:none!important;
}
@media(max-width:700px){
  body.pe-consistent-panel-page .pe-profile-page .pe-profile-hero-top,
  body.pe-consistent-panel-page .pe-profile-page .pe-profile-hero-top.pe-panel-brand-row{
    display:flex!important;
    gap:10px!important;
  }
  body.pe-consistent-panel-page .pe-profile-page .pe-profile-hero-top > .pe-profile-back,
  body.pe-consistent-panel-page .pe-profile-page .pe-profile-hero-top > .pe-panel-dashboard-action{
    margin-left:auto!important;
    margin-right:0!important;
  }
}
