/*
 * Joint Compass shared workspace shell.
 *
 * ONE drawer implementation for:
 * - branch study pages
 * - Questions
 * - Pathways
 * - Overview
 * - Workflow
 * - MEPS
 * - Readiness
 * - About
 * - Privacy
 * - Terms
 *
 * Colors come from jc-theme-system.css.
 */

.search-inner--logo
[data-jc-workspace-trigger] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.search-inner--logo
[data-jc-workspace-trigger]:focus-visible {
  outline: 2px solid
    var(--jc-accent, #d0d4d8);
  outline-offset: 4px;
}

.jc-workspace-standalone-trigger {
  width: 48px;
  height: 48px;
  margin: 0 0 14px;
  padding: 7px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid
    var(
      --jc-border,
      rgba(255,255,255,.18)
    );

  border-radius: 999px;

  background: transparent;
  color: var(--jc-text, #f5f7f8);

  cursor: pointer;

  -webkit-tap-highlight-color:
    transparent;
}

.jc-workspace-standalone-trigger img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.jc-workspace-standalone-trigger:focus-visible {
  outline: 2px solid
    var(--jc-accent, #d0d4d8);
  outline-offset: 3px;
}

body.jc-workspace-shell > footer,
body.jc-workspace-shell .app-footer,
body.jc-workspace-shell .site-footer,
body.jc-workspace-shell .bottom-nav,
body.jc-workspace-shell .bottom-bar,
body.jc-workspace-shell .footer-nav,
body.jc-workspace-shell [data-footer],
body.jc-workspace-shell [data-bottom-nav] {
  display: none !important;
}

.jc-workspace-backdrop {
  position: fixed;
  inset: 0;

  z-index: 9000;

  background:
    rgba(0,0,0,.70);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  touch-action: manipulation;

  transition:
    opacity .18s ease,
    visibility .18s ease;
}

.jc-workspace-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.jc-workspace-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 9010;

  box-sizing: border-box;

  width: min(390px, calc(100vw - 52px));
  max-width: calc(100vw - 52px);
  min-width: 0;

  padding:
    max(18px, env(safe-area-inset-top))
    18px
    max(18px, env(safe-area-inset-bottom));

  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;

  border-right: 0;

  background:
    var(--jc-surface-1, #0d1013);

  color:
    var(--jc-text, #f5f7f8);

  box-shadow:
    24px 0 64px
    rgba(0,0,0,.34);

  transform: translateX(-102%);
  transition: transform .2s ease;
}

.jc-workspace-drawer.is-open {
  transform: translateX(0);
}

/* Drawer receives programmatic focus when opened.
   Suppress the container's browser focus ring while
   preserving focus indicators on interactive controls. */
.jc-workspace-drawer:focus,
.jc-workspace-drawer:focus-visible {
  outline: none;
}

/* -----------------------------------------
   CLEAN BRANCH SELECTOR HEADER
------------------------------------------ */

.jc-workspace-brand {
  min-height: 62px;

  padding:
    4px 6px 16px;

  display: flex;
  align-items: center;

  gap: 12px;

  min-width: 0;

  border-bottom:
    1px solid
    var(
      --jc-border,
      rgba(255,255,255,.18)
    );
}

.jc-workspace-brand > img {
  flex: 0 0 auto;

  width: 38px;
  height: 38px;

  object-fit: contain;
}

.jc-workspace-branch-picker {
  min-width: 0;
  flex: 1;

  touch-action: manipulation;
}

.jc-workspace-branch-picker select {
  width: 100%;
  min-height: 46px;

  padding:
    0 42px
    0 14px;

  border:
    1px solid
    var(
      --jc-border-strong,
      rgba(255,255,255,.32)
    );

  border-radius: 12px;

  background:
    var(
      --jc-surface-2,
      #12161b
    );

  color:
    var(
      --jc-text,
      #f5f7f8
    );

  font: inherit;

  font-size: .88rem;
  font-weight: 750;

  cursor: pointer;

  touch-action: manipulation;
  -webkit-tap-highlight-color:
    transparent;
}

/* -----------------------------------------
   STUDY CONTROLS
------------------------------------------ */

.jc-workspace-study-controls {
  padding: 16px 6px;

  display: grid;
  gap: 10px;

  border-bottom:
    1px solid
    var(
      --jc-border,
      rgba(255,255,255,.18)
    );
}

.jc-workspace-study-link {
  box-sizing: border-box;

  width: 100%;
  min-height: 48px;

  margin: 0;
  padding: 10px 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  border:
    1px solid
    var(--jc-border, rgba(255,255,255,.18));

  border-radius: 999px;

  background: transparent;
  color: var(--jc-text, #f5f7f8);

  font: inherit;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;

  text-transform: uppercase;
  text-decoration: none;

  cursor: pointer;
}

.jc-workspace-study-link:hover,
.jc-workspace-study-link:focus-visible {
  border-color:
    var(--jc-accent, #d0d4d8);
}

.jc-workspace-toggle-row {
  display: grid;

  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );

  gap: 8px;
}

.jc-workspace-toggle-row button,
.jc-workspace-exam-pill {
  min-height: 42px;

  padding:
    0 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  border:
    1px solid
    var(
      --jc-border,
      rgba(255,255,255,.18)
    );

  border-radius: 999px;

  background: transparent;

  color:
    var(
      --jc-text,
      #f5f7f8
    );

  font: inherit;

  font-size: .74rem;
  font-weight: 800;

  letter-spacing: .07em;

  text-transform: uppercase;
}

.jc-workspace-toggle-row button {
  cursor: pointer;
}

.jc-workspace-toggle-row
button.is-active,
.jc-workspace-toggle-row
button[aria-pressed="true"],
.jc-workspace-exam-pill {
  border-color:
    var(
      --jc-accent,
      #d0d4d8
    );

  background:
    var(
      --jc-accent,
      #d0d4d8
    );

  color:
    var(
      --jc-accent-text,
      #080b0f
    );
}

.jc-workspace-exam {
  min-width: 0;
}

/* -----------------------------------------
   DRAWER SECTIONS
------------------------------------------ */

.jc-workspace-section {
  padding: 16px 0;

  border-bottom:
    1px solid
    var(
      --jc-border,
      rgba(255,255,255,.18)
    );
}

.jc-workspace-heading {
  margin:
    0 10px
    8px;

  color:
    var(
      --jc-muted,
      rgba(245,247,248,.68)
    );

  font-size: .68rem;
  font-weight: 800;

  letter-spacing: .14em;

  text-transform: uppercase;
}

.jc-workspace-link {
  min-height: 44px;

  padding:
    0 11px;

  display: flex;
  align-items: center;

  gap: 12px;

  border:
    1px solid
    transparent;

  border-radius: 10px;

  color:
    var(
      --jc-text,
      #f5f7f8
    );

  text-decoration: none;

  font-size: .88rem;

  transition:
    background .14s ease,
    border-color .14s ease;
}

.jc-workspace-link:hover,
.jc-workspace-link.is-active {
  border-color:
    var(
      --jc-border,
      rgba(255,255,255,.18)
    );

  background:
    var(
      --jc-surface-2,
      #12161b
    );
}

.jc-workspace-link.is-active {
  box-shadow:
    inset 2px 0 0
    var(
      --jc-accent,
      #d0d4d8
    );
}

.jc-workspace-icon {
  width: 22px;

  flex:
    0 0 22px;

  color:
    var(
      --jc-accent,
      #d0d4d8
    );

  font-size: .75rem;
  font-weight: 800;

  text-align: center;
}

.jc-workspace-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0 auto;
}

.jc-workspace-copyright {
  padding:
    18px 10px
    4px;

  color:
    var(
      --jc-muted,
      rgba(245,247,248,.68)
    );

  font-size: .68rem;

  line-height: 1.5;

  opacity: .68;
}

/* -----------------------------------------
   FOCUS
------------------------------------------ */

.jc-workspace-drawer
a:focus-visible,

.jc-workspace-drawer
button:focus-visible,

.jc-workspace-drawer
select:focus-visible {

  outline:
    2px solid
    var(
      --jc-accent,
      #d0d4d8
    );

  outline-offset: 2px;
}

/* -----------------------------------------
   MOBILE
------------------------------------------ */



/* -----------------------------------------
   REDUCED MOTION
------------------------------------------ */

@media (
  prefers-reduced-motion:
  reduce
) {

  .jc-workspace-drawer,
  .jc-workspace-backdrop {
    transition: none;
  }

}

/* -----------------------------------------
   UNIVERSAL DRAWER GEOMETRY
------------------------------------------ */

@supports (width: 100dvw) {
  .jc-workspace-drawer {
    width: min(390px, calc(100dvw - 52px));
    max-width: calc(100dvw - 52px);
  }
}

.jc-workspace-drawer *,
.jc-workspace-brand,
.jc-workspace-branch-picker,
.jc-workspace-study-controls,
.jc-workspace-toggle-row,
.jc-workspace-exam,
.jc-workspace-section {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.jc-workspace-branch-picker,
.jc-workspace-branch-picker select,
.jc-workspace-study-link,
.jc-workspace-toggle-row,
.jc-workspace-exam {
  width: 100%;
  max-width: 100%;
}


/* =========================================================
   R15 — UNIVERSAL DRAWER VISUAL SCALE
   Drawer owns its own typography and sizing.
   Host pages and mobile Safari cannot enlarge it.
========================================================= */

.jc-workspace-drawer {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.25;
}

.jc-workspace-brand {
  min-height: 62px;
  padding: 4px 6px 16px;
  gap: 12px;
}

.jc-workspace-brand > img {
  width: 38px;
  height: 38px;
}

.jc-workspace-branch-picker select {
  min-height: 46px;
  font-size: 14px;
  line-height: 1.2;
}

.jc-workspace-study-controls {
  padding: 16px 6px;
  gap: 10px;
}

.jc-workspace-study-link {
  min-height: 42px;
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
}

.jc-workspace-toggle-row button,
.jc-workspace-exam-pill {
  min-height: 42px;
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
}

.jc-workspace-section {
  padding: 16px 0;
}

.jc-workspace-heading {
  margin: 0 10px 8px;
  font-size: 11px;
  line-height: 1.2;
}

.jc-workspace-link {
  min-height: 44px;
  padding: 0 11px;
  gap: 12px;
  font-size: 14px;
  line-height: 1.2;
}

.jc-workspace-icon {
  width: 22px;
  flex-basis: 22px;
  font-size: 12px;
}

.jc-workspace-copyright {
  padding: 18px 10px 4px;
  font-size: 11px;
  line-height: 1.5;
}

/* R16 — final responsive drawer footprint */
@media (max-width: 600px) {
  .jc-workspace-drawer {
    width: min(310px, calc(100dvw - 52px)) !important;
    max-width: min(310px, calc(100dvw - 52px)) !important;
  }
}

@media (max-width: 767px) {
  .jc-workspace-branch-picker select {
    font-size: 16px;
  }
}

/* JC DRAWER ACCESS / DOWNLOAD */

.jc-workspace-access-row {
  padding: 2px 8px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.jc-workspace-access-card {
  min-height: 68px;
  padding: 9px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
  background: rgba(255,255,255,.015);
  color: inherit;
  text-decoration: none;
  text-align: center;
}

.jc-workspace-access-card:hover {
  background: rgba(255,255,255,.07);
}

.jc-workspace-access-card[aria-disabled="true"] {
  cursor: default;
}

.jc-workspace-access-icon {
  min-height: 23px;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.86);
  font-size: 1.05rem;
  line-height: 1;
}

.jc-workspace-access-label {
  color: rgba(255,255,255,.76);
  font-size: .65rem;
  font-weight: 700;
}
