/*
 * Certigate 1.30.26 — Candidate Studio Premium Refit
 * Presentation-only layer over the existing Candidate Studio runtime.
 * No business data, routes, REST contracts or interactive data-* hooks are replaced.
 */

/* Shared visual tokens */
body.cg-candidate-studio{
  --cg26-ivory:#FAF9F4;
  --cg26-paper:#FFFFFF;
  --cg26-paper-2:#F6F3EA;
  --cg26-ink:#132737;
  --cg26-muted:#657681;
  --cg26-line:#E5E0D5;
  --cg26-gold:#B68A19;
  --cg26-gold-strong:#9C7410;
  --cg26-gold-wash:rgba(182,138,25,.10);
  --cg26-green:#16975F;
  --cg26-red:#C94B47;
  --cg26-radius:18px;
  --cg26-shadow:0 14px 38px rgba(17,35,48,.055);
  --cg26-title:'Source Serif 4',Georgia,serif;
  --cg26-ui:Inter,'IBM Plex Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}

html[data-theme="light"] body.cg-candidate-studio{
  --cgcs-bg:var(--cg26-ivory)!important;
  --cgcs-panel:var(--cg26-paper)!important;
  --cgcs-panel2:var(--cg26-paper-2)!important;
  --cgcs-border:var(--cg26-line)!important;
  --cgcs-text:var(--cg26-ink)!important;
  --cgcs-muted:var(--cg26-muted)!important;
  --cgcs-gold:var(--cg26-gold)!important;
  --cgcs-gold2:#C69B28!important;
  --cgcs-shadow:var(--cg26-shadow)!important;
}
body.cg-candidate-studio,
body.cg-candidate-studio .cgcs-app,
body.cg-candidate-studio .cgcs-main{font-family:var(--cg26-ui)!important}

/* ---------------- Desktop shell ---------------- */
@media(min-width:821px){
  body.cg-candidate-studio .cgcs-side{
    width:222px!important;
    padding:14px 11px 12px!important;
  }
  body.cg-candidate-studio .cgcs-main{
    margin-left:222px!important;
    padding:18px clamp(20px,2.4vw,36px) 46px!important;
  }
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{
    padding:18px clamp(20px,2.4vw,36px) 46px!important;
  }
  body.cg-candidate-studio .cgcs-boot,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-boot{
    left:222px!important;
    inset-left:222px!important;
  }

  /* Brand + navigation density */
  body.cg-candidate-studio .cgcs-side .cgcs-brand{
    gap:10px!important;
    padding:2px 7px 13px!important;
    margin-bottom:0!important;
  }
  body.cg-candidate-studio .cgcs-side .cgcs-brand-mark{
    width:42px!important;height:42px!important;flex:0 0 42px!important;
    padding:5px!important;border-radius:13px!important;
  }
  body.cg-candidate-studio .cgcs-side .cgcs-brand strong{font-size:.94rem!important}
  body.cg-candidate-studio .cgcs-side .cgcs-brand small{font-size:.58rem!important;letter-spacing:.1em!important;margin-top:3px!important}
  body.cg-candidate-studio .cgcs-nav{
    gap:1px!important;
    padding:10px 0!important;
  }
  body.cg-candidate-studio .cgcs-nav a{
    min-height:41px!important;
    gap:10px!important;
    padding:0 10px!important;
    border-radius:10px!important;
    font-size:.79rem!important;
  }
  body.cg-candidate-studio .cgcs-nav a i{width:17px!important;font-size:.84rem!important}
  body.cg-candidate-studio .cgcs-user{padding-top:10px!important}
  body.cg-candidate-studio .cgcs-logout{min-height:41px!important;border-radius:10px!important;font-size:.72rem!important}

  /* Header */
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-top,
  body.cg-candidate-studio .cgcs-top{
    min-height:0!important;
    margin:0 auto 16px!important;
    padding:8px 0 14px!important;
    gap:16px!important;
    border-bottom:1px solid var(--cgcs-border)!important;
  }
  body.cg-candidate-studio .cgcs-eyebrow{
    margin:0 0 4px!important;
    font-size:.62rem!important;
    letter-spacing:.15em!important;
  }
  body.cg-candidate-studio .cgcs-top h1{
    margin:0!important;
    font-family:var(--cg26-title)!important;
    font-size:clamp(2rem,2.55vw,2.65rem)!important;
    line-height:1.02!important;
    letter-spacing:-.035em!important;
    font-weight:650!important;
  }
  body.cg-candidate-studio .cgcs-top p{
    margin:5px 0 0!important;
    max-width:770px!important;
    font-size:.84rem!important;
    line-height:1.45!important;
  }
  body.cg-candidate-studio .cgcs-desktop-tools{
    padding:4px!important;gap:5px!important;border-radius:13px!important;box-shadow:none!important;
  }
  body.cg-candidate-studio .cgcs-account-chip{min-height:37px!important;border-radius:10px!important}
  body.cg-candidate-studio .cgcs-lang a{min-width:33px!important;min-height:30px!important}
}

/* Light shell = Stitch-inspired ivory/white */
html[data-theme="light"] body.cg-candidate-studio .cgcs-side{
  background:#FFFDF9!important;
  border-right:1px solid var(--cg26-line)!important;
  box-shadow:4px 0 26px rgba(17,35,48,.025)!important;
}
html[data-theme="light"] body.cg-candidate-studio .cgcs-side .cgcs-brand{
  color:var(--cg26-ink)!important;
  border-bottom-color:var(--cg26-line)!important;
}
html[data-theme="light"] body.cg-candidate-studio .cgcs-side .cgcs-brand small{color:#84929A!important}
html[data-theme="light"] body.cg-candidate-studio .cgcs-nav a{color:#52636D!important}
html[data-theme="light"] body.cg-candidate-studio .cgcs-nav a:hover{background:#F5F1E7!important;color:var(--cg26-ink)!important}
html[data-theme="light"] body.cg-candidate-studio .cgcs-nav a.is-active{
  background:var(--cg26-gold-wash)!important;
  color:#8B6811!important;
  box-shadow:inset 3px 0 0 var(--cg26-gold)!important;
}
html[data-theme="light"] body.cg-candidate-studio .cgcs-nav a.is-active i{color:var(--cg26-gold)!important}
html[data-theme="light"] body.cg-candidate-studio .cgcs-user{
  background:transparent!important;border-top-color:var(--cg26-line)!important;
}
html[data-theme="light"] body.cg-candidate-studio .cgcs-logout{
  background:#FFF3F1!important;border:1px solid #F1D5D0!important;color:#B34741!important;
}
html[data-theme="light"] body.cg-candidate-studio .cgcs-main,
html[data-theme="light"] body.cg-candidate-studio .cgcs-app{background:var(--cg26-ivory)!important}

/* ---------------- Shared surfaces ---------------- */
body.cg-candidate-studio .cgcs-card,
body.cg-candidate-studio .cgcs-kpi,
body.cg-candidate-studio .cgcs-stage{
  border-radius:var(--cg26-radius)!important;
  box-shadow:none!important;
}
html[data-theme="light"] body.cg-candidate-studio .cgcs-card,
html[data-theme="light"] body.cg-candidate-studio .cgcs-kpi,
html[data-theme="light"] body.cg-candidate-studio .cgcs-stage{
  background:var(--cg26-paper)!important;
  border:1px solid var(--cg26-line)!important;
  box-shadow:var(--cg26-shadow)!important;
}
body.cg-candidate-studio .cgcs-card{padding:18px!important}
body.cg-candidate-studio .cgcs-card-head{margin-bottom:13px!important;gap:12px!important}
body.cg-candidate-studio .cgcs-card h2,
body.cg-candidate-studio .cgcs-card h3,
body.cg-candidate-studio .cgcs-empty h2{
  font-family:var(--cg26-title)!important;
  letter-spacing:-.022em!important;
}
body.cg-candidate-studio .cgcs-card h2{font-size:1.3rem!important}
body.cg-candidate-studio .cgcs-card h3{font-size:1.06rem!important}
body.cg-candidate-studio .cgcs-card-kicker{
  font-size:.63rem!important;letter-spacing:.13em!important;color:var(--cgcs-gold)!important;
}
body.cg-candidate-studio .cgcs-status{min-height:27px!important;padding:4px 9px!important;font-size:.64rem!important}
body.cg-candidate-studio .cgcs-actions{gap:8px!important;margin-top:13px!important}
body.cg-candidate-studio .cgcs-btn{
  min-height:40px!important;padding:8px 13px!important;border-radius:10px!important;font-size:.75rem!important;
}
body.cg-candidate-studio .cgcs-btn.primary{
  background:var(--cg26-gold)!important;color:#121B21!important;box-shadow:none!important;
}
body.cg-candidate-studio .cgcs-btn.primary:hover{background:#C39A2F!important}
html[data-theme="light"] body.cg-candidate-studio .cgcs-btn:not(.primary){background:#FFF!important;border-color:var(--cg26-line)!important}

/* Dashboard next action */
body.cg-candidate-studio .cgcs-preassignment{display:grid;gap:12px!important}
body.cg-candidate-studio .cgcs-review-hero{
  display:grid!important;grid-template-columns:52px minmax(0,1fr) auto!important;
  gap:16px!important;align-items:center!important;padding:22px!important;
}
html[data-theme="light"] body.cg-candidate-studio .cgcs-review-hero,
html[data-theme="light"] body.cg-candidate-studio .cgcs-primary-card{
  border-color:rgba(182,138,25,.38)!important;
}
body.cg-candidate-studio .cgcs-review-icon{
  width:48px!important;height:48px!important;border-radius:14px!important;
}
body.cg-candidate-studio .cgcs-review-copy h2{
  margin:4px 0 6px!important;font-family:var(--cg26-title)!important;font-size:1.6rem!important;line-height:1.1!important;
}
body.cg-candidate-studio .cgcs-review-copy p{margin:0!important;font-size:.84rem!important;line-height:1.5!important;color:var(--cgcs-muted)!important}

/* Journey 1 → 4: clean horizontal rail */
body.cg-candidate-studio .cgcs-stage-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important;margin:0!important;
}
body.cg-candidate-studio .cgcs-stage{
  min-height:88px!important;padding:13px 14px!important;display:grid!important;
  grid-template-columns:34px minmax(0,1fr) auto!important;gap:10px!important;align-items:center!important;
}
body.cg-candidate-studio .cgcs-stage>span{
  width:34px!important;height:34px!important;border-radius:11px!important;font-size:.84rem!important;
}
body.cg-candidate-studio .cgcs-stage strong{font-size:.79rem!important}
body.cg-candidate-studio .cgcs-stage small{font-size:.67rem!important;margin-top:3px!important}

/* Active dashboard */
body.cg-candidate-studio .cgcs-dashboard-command{
  display:grid!important;grid-template-columns:minmax(0,1.65fr) minmax(220px,.55fr)!important;gap:12px!important;margin-bottom:12px!important;
}
body.cg-candidate-studio .cgcs-command-main{padding:20px!important}
body.cg-candidate-studio .cgcs-current-module{
  grid-template-columns:42px minmax(0,1fr)!important;gap:12px!important;padding:12px!important;border-radius:12px!important;
}
body.cg-candidate-studio .cgcs-module-index{width:42px!important;height:42px!important}
body.cg-candidate-studio .cgcs-progress-ring-card{padding:18px!important;text-align:center!important}
body.cg-candidate-studio .cgcs-progress-orbit{width:108px!important;height:108px!important;margin:12px auto!important}
body.cg-candidate-studio .cgcs-progress-orbit strong{font-family:var(--cg26-title)!important}

/* KPI density */
body.cg-candidate-studio .cgcs-kpis{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;margin:0 auto 12px!important;
}
body.cg-candidate-studio .cgcs-kpi{padding:14px 15px!important}
body.cg-candidate-studio .cgcs-kpi>span{margin-bottom:6px!important;font-size:.62rem!important}
body.cg-candidate-studio .cgcs-kpi>strong{
  font-family:var(--cg26-title)!important;font-size:1.35rem!important;letter-spacing:-.02em!important;
}
body.cg-candidate-studio .cgcs-kpi>small{font-size:.68rem!important;margin-top:4px!important}
body.cg-candidate-studio .cgcs-dashboard-grid{gap:12px!important;grid-template-columns:minmax(0,1.6fr) minmax(270px,.72fr)!important}
body.cg-candidate-studio .cgcs-stack{gap:10px!important}

/* Path, lists, sessions and generic live data containers */
body.cg-candidate-studio .cgcs-path-card,
body.cg-candidate-studio [data-cgcs-sessions-root],
body.cg-candidate-studio .cgcs-quiz-card{max-width:1480px!important}
body.cg-candidate-studio .cgcs-path-part{padding:14px 0!important}
body.cg-candidate-studio .cgcs-module-list{gap:7px!important}
body.cg-candidate-studio .cgcs-module-row{padding:10px 11px!important;border-radius:11px!important;gap:10px!important}
body.cg-candidate-studio .cgcs-session-row{padding:11px 12px!important;border-radius:11px!important;gap:11px!important}
body.cg-candidate-studio .cgcs-session-icon{width:38px!important;height:38px!important;border-radius:10px!important}
body.cg-candidate-studio .cgcs-empty{padding:clamp(24px,4vw,44px) 16px!important}
body.cg-candidate-studio .cgcs-empty-icon{width:48px!important;height:48px!important;margin-bottom:12px!important}

/* Payments: preserve commerce mechanics; only visual refinement */
body.cg-candidate-studio #screen-payment .cg-commerce-grid{gap:14px!important}
body.cg-candidate-studio #screen-payment .cg-commerce-card{padding:20px!important;border-radius:18px!important;box-shadow:none!important}
html[data-theme="light"] body.cg-candidate-studio #screen-payment .cg-commerce-card{box-shadow:var(--cg26-shadow)!important;border-color:var(--cg26-line)!important}
body.cg-candidate-studio #screen-payment .cg-commerce-card h2{font-family:var(--cg26-title)!important;font-size:1.55rem!important}
body.cg-candidate-studio #screen-payment .cg-commerce-rails{gap:9px!important;margin:16px 0!important}
body.cg-candidate-studio #screen-payment .cg-commerce-rail{padding:13px!important;border-radius:13px!important}
body.cg-candidate-studio #screen-payment .cg-commerce-total{padding:15px 0!important}

/* Account / preferences — reuse current mechanics */
body.cg-candidate-studio .cgcs-account-chip,
body.cg-candidate-studio .cgcs-lang,
body.cg-candidate-studio .cg-theme-switch{
  box-shadow:none!important;
}

/* ---------------- Mobile guard ---------------- */
@media(max-width:820px){
  body.cg-candidate-studio .cgcs-main,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{
    margin-left:0!important;
    padding:12px 12px calc(90px + env(safe-area-inset-bottom,0px))!important;
  }
  body.cg-candidate-studio .cgcs-top h1{font-family:var(--cg26-title)!important}
  body.cg-candidate-studio .cgcs-card{padding:16px!important;border-radius:16px!important}
  body.cg-candidate-studio .cgcs-review-hero{
    grid-template-columns:44px minmax(0,1fr)!important;padding:16px!important;gap:12px!important;
  }
  body.cg-candidate-studio .cgcs-review-hero>.cgcs-status{grid-column:1/-1;justify-self:start!important}
  body.cg-candidate-studio .cgcs-review-copy h2{font-size:1.35rem!important}
  body.cg-candidate-studio .cgcs-stage-grid{grid-template-columns:1fr 1fr!important;gap:8px!important}
  body.cg-candidate-studio .cgcs-stage{min-height:78px!important;padding:11px!important}
  body.cg-candidate-studio .cgcs-dashboard-command{grid-template-columns:1fr!important}
  body.cg-candidate-studio .cgcs-kpis{grid-template-columns:1fr!important;gap:8px!important}
  body.cg-candidate-studio .cgcs-dashboard-grid{grid-template-columns:1fr!important;gap:9px!important}
}

@media(max-width:430px){
  body.cg-candidate-studio .cgcs-main,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{padding-left:10px!important;padding-right:10px!important}
  body.cg-candidate-studio .cgcs-stage-grid{grid-template-columns:1fr!important}
}

@media(prefers-reduced-motion:reduce){
  body.cg-candidate-studio *{scroll-behavior:auto!important}
}

/* ========================================================================
   Certigate 1.31.0 — Candidate Studio V2 Consolidated Authority
   This block is the only final learner-shell authority loaded in production.
   Historical v13027-v13031 layers are explicitly dequeued by functions.php.
   ======================================================================== */

body.cg-candidate-studio{
  --cg131-side-w:222px;
  --cg131-page-max:1480px;
  overflow-x:hidden!important;
}
body.cg-candidate-studio .cgcs-app{
  display:block!important;
  position:relative!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:100vh!important;
  min-height:100dvh!important;
  overflow:visible!important;
  transform:none!important;
}

/* Desktop: same robust fixed-rail model as Admin Studio. */
@media(min-width:821px){
  body.cg-candidate-studio .cgcs-side{
    display:flex!important;
    flex-direction:column!important;
    position:fixed!important;
    inset:0 auto 0 0!important;
    top:0!important;
    left:0!important;
    bottom:0!important;
    width:var(--cg131-side-w)!important;
    min-width:var(--cg131-side-w)!important;
    max-width:var(--cg131-side-w)!important;
    height:100vh!important;
    height:100dvh!important;
    min-height:0!important;
    padding:14px 11px 12px!important;
    overflow:hidden!important;
    z-index:120!important;
    transform:none!important;
    contain:layout paint!important;
  }
  body.cg-candidate-studio .cgcs-side .cgcs-brand{
    flex:0 0 auto!important;
    position:relative!important;
    top:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
  body.cg-candidate-studio .cgcs-nav{
    display:grid!important;
    grid-auto-rows:min-content!important;
    align-content:start!important;
    flex:1 1 auto!important;
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    overflow:hidden!important;
    overscroll-behavior:none!important;
    scrollbar-width:none!important;
    scroll-behavior:auto!important;
  }
  body.cg-candidate-studio .cgcs-nav::-webkit-scrollbar{display:none!important}
  body.cg-candidate-studio .cgcs-user{
    flex:0 0 auto!important;
    position:relative!important;
    margin-top:auto!important;
  }
  body.cg-candidate-studio .cgcs-main,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{
    display:block!important;
    position:relative!important;
    margin-left:var(--cg131-side-w)!important;
    width:calc(100% - var(--cg131-side-w))!important;
    max-width:calc(100vw - var(--cg131-side-w))!important;
    min-width:0!important;
    min-height:100vh!important;
    min-height:100dvh!important;
    padding:18px clamp(20px,2.4vw,36px) 46px!important;
    box-sizing:border-box!important;
    overflow:visible!important;
    transform:none!important;
  }
  body.cg-candidate-studio .cgcs-boot{
    left:var(--cg131-side-w)!important;
    right:0!important;
    width:auto!important;
    max-width:none!important;
  }
  body.cg-candidate-studio .cgcs-top,
  body.cg-candidate-studio .cgcs-main > section,
  body.cg-candidate-studio .cgcs-main > div,
  body.cg-candidate-studio .cg-commerce-shell{
    width:100%!important;
    max-width:var(--cg131-page-max)!important;
    min-width:0!important;
    margin-left:auto!important;
    margin-right:auto!important;
    box-sizing:border-box!important;
  }

  /* Only genuinely short desktop viewports may scroll the menu internally. */
  @media(max-height:620px){
    body.cg-candidate-studio .cgcs-nav{
      overflow-y:auto!important;
      overflow-x:hidden!important;
      overscroll-behavior:contain!important;
    }
  }
}

/* Containment: no learner component may widen the document. */
body.cg-candidate-studio .cgcs-main *,
body.cg-candidate-studio .cgcs-card,
body.cg-candidate-studio .cgcs-stage,
body.cg-candidate-studio .cgcs-kpi,
body.cg-candidate-studio .cgcs-path-card,
body.cg-candidate-studio .cgcs-module-row,
body.cg-candidate-studio .cgcs-session-row,
body.cg-candidate-studio .cg-commerce-card,
body.cg-candidate-studio .cg-commerce-rail{
  box-sizing:border-box!important;
  min-width:0!important;
}
body.cg-candidate-studio .cgcs-card,
body.cg-candidate-studio .cgcs-path-card,
body.cg-candidate-studio .cgcs-dashboard-grid,
body.cg-candidate-studio .cgcs-stage-grid,
body.cg-candidate-studio .cgcs-kpis,
body.cg-candidate-studio [data-cgcs-path-root],
body.cg-candidate-studio [data-cgcs-sessions-root],
body.cg-candidate-studio [data-cgcs-quiz-root],
body.cg-candidate-studio #screen-payment{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
body.cg-candidate-studio .cgcs-module-row > *,
body.cg-candidate-studio .cgcs-session-row > *,
body.cg-candidate-studio .cgcs-card h1,
body.cg-candidate-studio .cgcs-card h2,
body.cg-candidate-studio .cgcs-card h3,
body.cg-candidate-studio .cgcs-card p,
body.cg-candidate-studio .cgcs-card strong,
body.cg-candidate-studio .cgcs-card span{
  min-width:0!important;
  overflow-wrap:anywhere;
}

/* Path: reduce repetition and keep action column contained. */
body.cg-candidate-studio .cgcs-path-part{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
body.cg-candidate-studio .cgcs-module-row{
  width:100%!important;
  max-width:100%!important;
}
body.cg-candidate-studio .cgcs-module-row .cgcs-btn,
body.cg-candidate-studio .cgcs-module-row button,
body.cg-candidate-studio .cgcs-module-row a[role="button"]{
  flex:0 0 auto!important;
  max-width:180px!important;
}

/* Premium density: more useful content above the fold without feeling cramped. */
@media(min-width:821px){
  body.cg-candidate-studio .cgcs-card{padding:17px!important}
  body.cg-candidate-studio .cgcs-dashboard-grid{gap:11px!important}
  body.cg-candidate-studio .cgcs-stack{gap:9px!important}
  body.cg-candidate-studio .cgcs-module-list{gap:6px!important}
  body.cg-candidate-studio .cgcs-module-row{padding:9px 10px!important}
  body.cg-candidate-studio .cgcs-session-row{padding:10px 11px!important}
}

/* Light mode is the primary visual direction validated in Claude/Stitch V3/V4. */
html[data-theme="light"] body.cg-candidate-studio .cgcs-main{
  background:var(--cg26-ivory)!important;
}
html[data-theme="light"] body.cg-candidate-studio .cgcs-side{
  background:#FFFDF9!important;
}

/* Mobile remains an independent app-like layout; no desktop offsets leak in. */
@media(max-width:820px){
  body.cg-candidate-studio .cgcs-app{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }
  body.cg-candidate-studio .cgcs-side{display:none!important}
  body.cg-candidate-studio .cgcs-main,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{
    margin-left:0!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding:12px 12px calc(90px + env(safe-area-inset-bottom,0px))!important;
  }
}

/* ==========================================================
   1.31.3 — Document-height rail + sticky inner navigation
   Architecture:
   - .cgcs-side is the grid column and stretches to the full document height
   - .cgcs-side-sticky is the viewport-sticky navigation panel
   - .cgcs-main stays in normal document flow
   This matches the requested admin-style behavior without a fixed column.
   ========================================================== */
@media (min-width:821px){
  :root{--cgcs-v2-side-w:222px}

  html,
  body.cg-candidate-studio{
    overflow-x:hidden!important;
  }

  body.cg-candidate-studio .cgcs-app,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280{
    display:grid!important;
    grid-template-columns:var(--cgcs-v2-side-w) minmax(0,1fr)!important;
    align-items:stretch!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    min-height:100vh!important;
    min-height:100dvh!important;
    overflow:visible!important;
  }

  /* Outer column: follows the complete document height. */
  body.cg-candidate-studio .cgcs-side{
    grid-column:1!important;
    position:relative!important;
    inset:auto!important;
    top:auto!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    align-self:stretch!important;
    width:var(--cgcs-v2-side-w)!important;
    min-width:var(--cgcs-v2-side-w)!important;
    max-width:var(--cgcs-v2-side-w)!important;
    height:auto!important;
    min-height:100vh!important;
    min-height:100dvh!important;
    padding:0!important;
    box-sizing:border-box!important;
    overflow:visible!important;
    transform:none!important;
    z-index:40!important;
  }

  /* Inner rail: this is what stays visible while the document scrolls. */
  body.cg-candidate-studio .cgcs-side-sticky{
    position:sticky!important;
    top:0!important;
    width:100%!important;
    height:100vh!important;
    height:100dvh!important;
    min-height:0!important;
    box-sizing:border-box!important;
    display:flex!important;
    flex-direction:column!important;
    padding:14px 11px 12px!important;
    overflow:hidden!important;
    background:inherit!important;
    color:inherit!important;
  }

  body.cg-candidate-studio .cgcs-side-sticky .cgcs-brand{
    flex:0 0 auto!important;
    margin:0!important;
  }

  body.cg-candidate-studio .cgcs-side-sticky .cgcs-nav{
    flex:0 0 auto!important;
    display:flex!important;
    flex-direction:column!important;
    gap:3px!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:8px 0 0!important;
    padding:0!important;
    overflow:visible!important;
    overscroll-behavior:none!important;
    scrollbar-width:none!important;
    transform:none!important;
  }
  body.cg-candidate-studio .cgcs-side-sticky .cgcs-nav::-webkit-scrollbar{display:none!important}
  body.cg-candidate-studio .cgcs-side-sticky .cgcs-nav a{
    flex:0 0 auto!important;
    min-height:38px!important;
    padding:8px 10px!important;
    margin:0!important;
  }

  body.cg-candidate-studio .cgcs-side-sticky .cgcs-user{
    flex:0 0 auto!important;
    margin-top:auto!important;
    padding-top:12px!important;
  }

  body.cg-candidate-studio .cgcs-main,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{
    grid-column:2!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    min-height:100vh!important;
    min-height:100dvh!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
    overflow:visible!important;
    transform:none!important;
  }

  body.cg-candidate-studio .cgcs-boot,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-boot{
    left:var(--cgcs-v2-side-w)!important;
  }
}

/* Only genuinely short desktop windows need menu scrolling.
   The outer column still follows the document height. */
@media (min-width:821px) and (max-height:610px){
  body.cg-candidate-studio .cgcs-side-sticky .cgcs-nav{
    flex:1 1 auto!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
}

@media (max-width:820px){
  body.cg-candidate-studio .cgcs-side{display:none!important}
  body.cg-candidate-studio .cgcs-side-sticky{display:none!important}
  body.cg-candidate-studio .cgcs-app,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280{display:block!important}
  body.cg-candidate-studio .cgcs-main,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{
    margin-left:0!important;
    width:100%!important;
    max-width:100%!important;
  }
}


/* ==========================================================
   1.31.4 — Document-height column + viewport-fixed inner rail
   Final shell authority:
   - outer .cgcs-side stays in document flow and stretches with main
   - inner .cgcs-side-sticky is fixed to the viewport
   - no whole-sidebar sticky behaviour remains on desktop
   ========================================================== */
@media (min-width:821px){
  body.cg-candidate-studio .cgcs-app,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280{
    display:grid!important;
    grid-template-columns:var(--cgcs-v2-side-w,222px) minmax(0,1fr)!important;
    align-items:stretch!important;
    min-height:100dvh!important;
    overflow:visible!important;
  }

  body.cg-candidate-studio .cgcs-side{
    grid-column:1!important;
    position:relative!important;
    width:var(--cgcs-v2-side-w,222px)!important;
    min-width:var(--cgcs-v2-side-w,222px)!important;
    max-width:var(--cgcs-v2-side-w,222px)!important;
    height:auto!important;
    min-height:100dvh!important;
    align-self:stretch!important;
    overflow:visible!important;
    background:#071D29!important;
  }

  body.cg-candidate-studio .cgcs-side-sticky{
    position:fixed!important;
    inset:0 auto auto 0!important;
    top:0!important;
    left:0!important;
    right:auto!important;
    bottom:auto!important;
    width:var(--cgcs-v2-side-w,222px)!important;
    min-width:var(--cgcs-v2-side-w,222px)!important;
    max-width:var(--cgcs-v2-side-w,222px)!important;
    height:100vh!important;
    height:100dvh!important;
    min-height:0!important;
    padding:12px 11px 12px!important;
    box-sizing:border-box!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    transform:none!important;
    z-index:120!important;
    background:#071D29!important;
  }

  body.cg-candidate-studio .cgcs-side-sticky .cgcs-brand{
    flex:0 0 auto!important;
    min-height:52px!important;
    margin:0 0 6px!important;
  }

  body.cg-candidate-studio .cgcs-side-sticky .cgcs-nav{
    flex:0 0 auto!important;
    display:flex!important;
    flex-direction:column!important;
    gap:2px!important;
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    transform:none!important;
    scrollbar-width:none!important;
  }
  body.cg-candidate-studio .cgcs-side-sticky .cgcs-nav::-webkit-scrollbar{display:none!important}
  body.cg-candidate-studio .cgcs-side-sticky .cgcs-nav a{
    flex:0 0 auto!important;
    min-height:36px!important;
    padding:7px 9px!important;
    margin:0!important;
  }

  body.cg-candidate-studio .cgcs-side-sticky .cgcs-user{
    flex:0 0 auto!important;
    margin-top:auto!important;
    padding-top:10px!important;
  }

  body.cg-candidate-studio .cgcs-main,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{
    grid-column:2!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    overflow:visible!important;
  }

  /* Only unusually short desktop windows get an internal nav scroller. */
  @media (max-height:590px){
    body.cg-candidate-studio .cgcs-side-sticky .cgcs-nav{
      flex:1 1 auto!important;
      overflow-y:auto!important;
      overflow-x:hidden!important;
      overscroll-behavior:contain!important;
    }
  }
}

html[data-theme="light"] body.cg-candidate-studio .cgcs-side,
html[data-theme="light"] body.cg-candidate-studio .cgcs-side-sticky{
  background:#FFFDF9!important;
}

@media (max-width:820px){
  body.cg-candidate-studio .cgcs-side-sticky{display:none!important}
}

/* ==========================================================
   1.31.5 — Viewport rail portal authority
   The outer .cgcs-side remains in the document grid and therefore follows
   the complete page height. On desktop, JS portals only .cgcs-side-sticky
   to <body>, so no transformed/overflow ancestor can alter fixed positioning.
   ========================================================== */
@media (min-width:821px){
  body.cg-candidate-studio.cgcs-rail-portaled-v1315{
    transform:none!important;
    filter:none!important;
    perspective:none!important;
  }
  body.cg-candidate-studio.cgcs-rail-portaled-v1315 > .cgcs-side-sticky{
    position:fixed!important;
    top:0!important;
    left:0!important;
    right:auto!important;
    bottom:auto!important;
    inset:0 auto auto 0!important;
    width:var(--cgcs-v2-side-w,222px)!important;
    min-width:var(--cgcs-v2-side-w,222px)!important;
    max-width:var(--cgcs-v2-side-w,222px)!important;
    height:100vh!important;
    height:100dvh!important;
    min-height:0!important;
    margin:0!important;
    padding:12px 11px!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    transform:none!important;
    translate:none!important;
    filter:none!important;
    perspective:none!important;
    contain:none!important;
    will-change:auto!important;
    z-index:999!important;
    background:#071D29!important;
  }
  body.cg-candidate-studio.cgcs-rail-portaled-v1315 > .cgcs-side-sticky .cgcs-brand{
    flex:0 0 auto!important;
    margin:0 0 6px!important;
    transform:none!important;
  }
  body.cg-candidate-studio.cgcs-rail-portaled-v1315 > .cgcs-side-sticky .cgcs-nav{
    flex:0 0 auto!important;
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    overflow:visible!important;
    transform:none!important;
  }
  body.cg-candidate-studio.cgcs-rail-portaled-v1315 > .cgcs-side-sticky .cgcs-user{
    flex:0 0 auto!important;
    margin-top:auto!important;
    transform:none!important;
  }

  html[data-theme="light"] body.cg-candidate-studio.cgcs-rail-portaled-v1315 > .cgcs-side-sticky{
    background:#FFFDF9!important;
  }

  @media (max-height:590px){
    body.cg-candidate-studio.cgcs-rail-portaled-v1315 > .cgcs-side-sticky .cgcs-nav{
      flex:1 1 auto!important;
      overflow-y:auto!important;
      overflow-x:hidden!important;
      overscroll-behavior:contain!important;
    }
  }
}


/* ========================================================================
   Certigate 1.31.6 — Candidate Studio Mobile Experience Polish
   Mobile/tablet presentation only. Desktop 821px+ is intentionally untouched.
   Goals:
   - use the available phone width instead of stacking large nested margins
   - keep a consistent 8–12px visual gutter
   - improve touch targets and information hierarchy
   - prevent module/action rows from feeling cramped
   - preserve all existing runtime/data hooks and mobile navigation mechanics
   ======================================================================== */
@media (max-width:820px){
  body.cg-candidate-studio{
    --cg1316-gutter:10px;
    --cg1316-card-pad:14px;
    overflow-x:hidden!important;
  }

  body.cg-candidate-studio .cgcs-app,
  body.cg-candidate-studio .cgcs-main,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    box-sizing:border-box!important;
    overflow-x:hidden!important;
  }

  body.cg-candidate-studio .cgcs-main,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{
    padding:
      max(10px,env(safe-area-inset-top,0px))
      max(var(--cg1316-gutter),env(safe-area-inset-right,0px))
      calc(88px + env(safe-area-inset-bottom,0px))
      max(var(--cg1316-gutter),env(safe-area-inset-left,0px))!important;
  }

  /* Remove legacy narrow-page caps on learner screens. */
  body.cg-candidate-studio .cgcs-main > section,
  body.cg-candidate-studio .cgcs-main > div,
  body.cg-candidate-studio .cgcs-main .cgcs-card,
  body.cg-candidate-studio .cgcs-path-card,
  body.cg-candidate-studio [data-cgcs-sessions-root],
  body.cg-candidate-studio .cgcs-quiz-card,
  body.cg-candidate-studio .cg-commerce-shell,
  body.cg-candidate-studio .cg-commerce-grid{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
  }

  /* Header: compact but not cramped. */
  body.cg-candidate-studio .cgcs-top,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-top{
    width:100%!important;
    max-width:100%!important;
    margin:0 0 12px!important;
    padding:8px 2px 12px!important;
    gap:8px!important;
  }
  body.cg-candidate-studio .cgcs-top h1{
    font-size:clamp(1.75rem,8.2vw,2.25rem)!important;
    line-height:1.04!important;
    letter-spacing:-.035em!important;
  }
  body.cg-candidate-studio .cgcs-top p{
    max-width:none!important;
    font-size:.9rem!important;
    line-height:1.48!important;
  }

  /* Cards: one clear outer gutter, then modest internal padding. */
  body.cg-candidate-studio .cgcs-card,
  body.cg-candidate-studio .cgcs-primary-card,
  body.cg-candidate-studio .cgcs-review-hero,
  body.cg-candidate-studio .cgcs-command-main,
  body.cg-candidate-studio .cgcs-progress-ring-card{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    padding:var(--cg1316-card-pad)!important;
    border-radius:15px!important;
  }

  body.cg-candidate-studio .cgcs-review-hero{
    grid-template-columns:40px minmax(0,1fr)!important;
    gap:10px!important;
  }
  body.cg-candidate-studio .cgcs-review-icon{
    width:40px!important;
    height:40px!important;
    border-radius:12px!important;
  }
  body.cg-candidate-studio .cgcs-review-copy h2{
    font-size:1.28rem!important;
    line-height:1.12!important;
  }
  body.cg-candidate-studio .cgcs-review-copy p{
    font-size:.84rem!important;
    line-height:1.48!important;
  }

  /* Dashboard grids become full-width vertical flows. */
  body.cg-candidate-studio .cgcs-dashboard-command,
  body.cg-candidate-studio .cgcs-dashboard-grid,
  body.cg-candidate-studio .cgcs-kpis{
    width:100%!important;
    max-width:100%!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:9px!important;
  }
  body.cg-candidate-studio .cgcs-kpi{
    width:100%!important;
    min-width:0!important;
    padding:13px 14px!important;
    border-radius:14px!important;
  }

  /* Journey remains useful without creating tiny two-column cards. */
  body.cg-candidate-studio .cgcs-stage-grid{
    width:100%!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:8px!important;
  }
  body.cg-candidate-studio .cgcs-stage{
    min-height:68px!important;
    padding:10px 11px!important;
    grid-template-columns:32px minmax(0,1fr) auto!important;
    gap:9px!important;
    border-radius:13px!important;
  }
  body.cg-candidate-studio .cgcs-stage>span{
    width:32px!important;
    height:32px!important;
  }

  /* Path page: make every level use the same phone width. */
  body.cg-candidate-studio .cgcs-path-card{
    padding:12px!important;
    border-radius:15px!important;
    overflow:hidden!important;
  }
  body.cg-candidate-studio .cgcs-path-part{
    width:100%!important;
    max-width:100%!important;
    padding:12px 0!important;
    min-width:0!important;
  }
  body.cg-candidate-studio .cgcs-module-list{
    width:100%!important;
    min-width:0!important;
    gap:7px!important;
  }
  body.cg-candidate-studio .cgcs-module-row{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    padding:10px!important;
    gap:9px!important;
    border-radius:12px!important;
    overflow:hidden!important;
  }
  body.cg-candidate-studio .cgcs-module-row > *{
    min-width:0!important;
    max-width:100%!important;
  }
  body.cg-candidate-studio .cgcs-module-row strong,
  body.cg-candidate-studio .cgcs-module-row small,
  body.cg-candidate-studio .cgcs-module-row span{
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }

  /* Actions: never squeeze beside long lesson names on phones. */
  body.cg-candidate-studio .cgcs-path-part .cgcs-btn,
  body.cg-candidate-studio .cgcs-path-part button,
  body.cg-candidate-studio .cgcs-module-row .cgcs-btn,
  body.cg-candidate-studio .cgcs-module-row button{
    min-height:44px!important;
    max-width:100%!important;
    white-space:normal!important;
  }

  /* Sessions, evaluations and generic list rows. */
  body.cg-candidate-studio .cgcs-session-row{
    width:100%!important;
    min-width:0!important;
    padding:11px!important;
    gap:10px!important;
    border-radius:12px!important;
    box-sizing:border-box!important;
  }
  body.cg-candidate-studio .cgcs-session-row > *{min-width:0!important}

  /* Payment stays close to the screen edges but keeps safe breathing room. */
  body.cg-candidate-studio #screen-payment .cg-commerce-card{
    width:100%!important;
    max-width:100%!important;
    padding:14px 12px!important;
    border-radius:15px!important;
  }
  body.cg-candidate-studio #screen-payment .cg-commerce-rail{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding:12px!important;
    box-sizing:border-box!important;
  }
  body.cg-candidate-studio #screen-payment .cg-commerce-submit{
    width:100%!important;
    min-height:48px!important;
  }

  /* Mobile touch ergonomics. */
  body.cg-candidate-studio .cgcs-btn,
  body.cg-candidate-studio button,
  body.cg-candidate-studio a[role="button"]{
    min-height:44px;
  }

  /* Avoid accidental horizontal scroll from legacy width/min-width values. */
  body.cg-candidate-studio .cgcs-main *,
  body.cg-candidate-studio .cgcs-main *::before,
  body.cg-candidate-studio .cgcs-main *::after{
    box-sizing:border-box!important;
  }
  body.cg-candidate-studio .cgcs-main img,
  body.cg-candidate-studio .cgcs-main svg,
  body.cg-candidate-studio .cgcs-main canvas,
  body.cg-candidate-studio .cgcs-main video{
    max-width:100%!important;
  }
}

@media (max-width:430px){
  body.cg-candidate-studio{
    --cg1316-gutter:8px;
    --cg1316-card-pad:12px;
  }
  body.cg-candidate-studio .cgcs-main,
  body.cg-candidate-studio .cgcs-app.cgcs-shell-compact-v1280 .cgcs-main{
    padding-left:max(8px,env(safe-area-inset-left,0px))!important;
    padding-right:max(8px,env(safe-area-inset-right,0px))!important;
  }
  body.cg-candidate-studio .cgcs-path-card{padding:10px!important}
  body.cg-candidate-studio .cgcs-module-row{padding:9px!important}
  body.cg-candidate-studio .cgcs-card h2{font-size:1.22rem!important}
  body.cg-candidate-studio .cgcs-card h3{font-size:1rem!important}
}
