/* V106 source-level responsive fit for Audit Workday.
   Goal: no cut-off desktop phase rail, compact above-the-fold console, and mobile-safe stacking. */

html,
body{
  max-width:100%;
  overflow-x:hidden!important;
}

body.audit-workday-active.safe-compact-ui .topbar,
body.audit-workday-active.safe-compact-ui .hero,
body.audit-workday-active.safe-compact-ui .stats-grid,
body.audit-workday-active.safe-compact-ui #dashboardSection{
  display:none!important;
}

body.audit-workday-active.safe-compact-ui .app-shell{
  min-height:100dvh!important;
  overflow-x:hidden!important;
}

body.audit-workday-active.safe-compact-ui .workspace{
  padding:0!important;
  gap:0!important;
  min-width:0!important;
  overflow-x:hidden!important;
}

body.audit-workday-active.safe-compact-ui #modulesSection{
  display:block!important;
  width:100%!important;
  min-width:0!important;
}

body.audit-workday-active.safe-compact-ui #modulesSection .section-card{
  padding:0!important;
  margin:0!important;
  border:0!important;
  box-shadow:none!important;
  background:transparent!important;
  min-height:100dvh!important;
  overflow:visible!important;
}

body.audit-workday-active.safe-compact-ui #modulesSection .section-card > .section-head{
  display:none!important;
}

body.audit-workday-active.safe-compact-ui #moduleList.module-grid{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  padding:0!important;
  margin:0!important;
  min-width:0!important;
}

/* Replace the V105 big blocks with a compact console that fits the viewport. */
.workday-v106-fit{
  --fit-line:rgba(184,214,255,.115);
  --fit-soft:rgba(255,255,255,.035);
  --fit-card:linear-gradient(180deg,rgba(16,22,36,.94),rgba(7,12,23,.94));
  width:100%;
  max-width:100%;
  min-width:0;
  min-height:100dvh;
  padding:12px clamp(10px,1.2vw,18px) 18px!important;
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
  overflow-x:hidden!important;
}

.workday-fit-header{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(430px,38vw);
  gap:10px;
  align-items:stretch;
  min-width:0;
}

.workday-fit-title,
.workday-fit-pills,
.workday-fit-tabs,
.workday-fit-stage,
.fit-side-card{
  border:1px solid var(--fit-line);
  background:var(--fit-card);
  box-shadow:0 14px 34px rgba(0,0,0,.24);
}

.workday-fit-title{
  border-radius:22px;
  padding:14px 16px;
  min-width:0;
}

.workday-fit-title .eyebrow{
  margin-bottom:5px!important;
  font-size:10px!important;
  letter-spacing:.16em!important;
}

.workday-fit-title h3{
  margin:0 0 5px!important;
  font-size:clamp(25px,2.35vw,36px)!important;
  line-height:.98!important;
  letter-spacing:-.055em!important;
}

.workday-fit-title span{
  display:block;
  max-width:78ch;
  color:rgba(232,237,248,.72);
  line-height:1.38;
  font-size:clamp(12px,1vw,14px);
}

.workday-fit-pills{
  border-radius:22px;
  padding:8px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  min-width:0;
}

.workday-fit-pills article{
  border:1px solid rgba(184,214,255,.075);
  background:rgba(255,255,255,.034);
  border-radius:16px;
  padding:10px 9px;
  min-width:0;
  min-height:58px;
}

.workday-fit-pills strong{
  display:block;
  font-size:clamp(17px,1.45vw,22px);
  line-height:1.05;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.workday-fit-pills small{
  display:block;
  margin-top:5px;
  color:rgba(224,232,246,.68);
  font-size:10.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Phase tabs: fit all 6 on desktop; no horizontal cut. */
.workday-fit-tabs{
  border-radius:22px;
  padding:8px;
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:8px;
  overflow:visible!important;
  min-width:0;
}

.workday-v106-fit .workday-phase-card{
  min-width:0!important;
  width:100%!important;
  flex:unset!important;
  grid-template-columns:30px minmax(0,1fr) auto!important;
  padding:10px 10px!important;
  border-radius:16px!important;
  background:rgba(255,255,255,.03)!important;
  gap:9px!important;
  min-height:68px!important;
  overflow:hidden!important;
}

.workday-v106-fit .workday-phase-card .phase-index{
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  border-radius:10px!important;
  font-size:11px!important;
}

.workday-v106-fit .workday-phase-card strong{
  font-size:12.2px!important;
  line-height:1.1!important;
  white-space:normal!important;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.workday-v106-fit .workday-phase-card small{
  font-size:10px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

.workday-v106-fit .workday-phase-card em{
  font-size:10px!important;
  white-space:nowrap!important;
}

.workday-fit-body{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(245px,280px);
  gap:10px;
  align-items:start;
  min-width:0;
}

.workday-fit-stage{
  border-radius:24px;
  padding:12px;
  min-width:0;
  min-height:auto!important;
  overflow:hidden;
}

.workday-fit-aside{
  display:flex;
  flex-direction:column;
  gap:9px;
  min-width:0;
  position:sticky;
  top:10px;
}

.fit-side-card{
  border-radius:20px;
  padding:12px 13px;
  min-width:0;
}

.fit-side-card span{
  display:block;
  color:rgba(190,204,225,.82);
  text-transform:uppercase;
  letter-spacing:.13em;
  font-size:10px;
  margin-bottom:6px;
}

.fit-side-card strong{
  display:block;
  font-size:18px;
  line-height:1.12;
  letter-spacing:-.035em;
  overflow-wrap:anywhere;
}

.fit-side-card small{
  display:block;
  color:rgba(226,234,247,.68);
  line-height:1.38;
  font-size:11.5px;
  margin-top:5px;
}

.fit-side-card.mini-progress{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
}

.fit-side-card.mini-progress span{
  grid-column:1/-1;
}

.fit-side-card.mini-progress div{
  background:rgba(255,255,255,.035);
  border:1px solid rgba(184,214,255,.07);
  border-radius:14px;
  padding:8px 7px;
  min-width:0;
}

.fit-side-card.mini-progress b{
  display:block;
  font-size:15px;
  line-height:1.05;
}

.fit-side-card.mini-progress small{
  font-size:9.5px;
  margin-top:3px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.fit-side-card.dev-tools{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
}

.fit-side-card.dev-tools span{
  grid-column:1/-1;
}

.fit-side-card.dev-tools button{
  min-width:0!important;
  padding:8px 9px!important;
  font-size:11px!important;
}

/* Active phase content: tighter, readable, not hidden below fold. */
.workday-v106-fit .workday-phase-panel{
  padding:0!important;
  border:0!important;
  box-shadow:none!important;
  background:transparent!important;
  min-width:0!important;
}

.workday-v106-fit .workday-panel-head{
  border-radius:20px!important;
  padding:12px 14px!important;
  margin-bottom:10px!important;
  gap:10px!important;
}

.workday-v106-fit .workday-panel-head h3{
  font-size:clamp(24px,2.25vw,35px)!important;
  line-height:1.02!important;
  margin:3px 0 5px!important;
}

.workday-v106-fit .workday-panel-head span{
  font-size:13px!important;
  line-height:1.35!important;
}

.workday-v106-fit .orientation-board,
.workday-v106-fit .client-file-grid,
.workday-v106-fit .process-builder-grid,
.workday-v106-fit .evidence-card-grid,
.workday-v106-fit .field-score-grid{
  gap:10px!important;
}

.workday-v106-fit .orientation-board{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}

.workday-v106-fit .client-file-grid,
.workday-v106-fit .process-builder-grid,
.workday-v106-fit .evidence-card-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}

.workday-v106-fit .orientation-tile,
.workday-v106-fit .client-folder-card,
.workday-v106-fit .process-flow-card,
.workday-v106-fit .evidence-tag-card{
  border-radius:19px!important;
  padding:12px!important;
  min-width:0!important;
}

.workday-v106-fit .orientation-tile p,
.workday-v106-fit .client-folder-card small,
.workday-v106-fit .process-flow-card p,
.workday-v106-fit .evidence-tag-card p{
  font-size:12.2px!important;
  line-height:1.42!important;
}

.workday-v106-fit .evidence-tag-card p{
  min-height:auto!important;
}

.workday-v106-fit .rotation-workspace{
  grid-template-columns:minmax(190px,230px) minmax(0,1fr)!important;
  gap:10px!important;
}

.workday-v106-fit .station-rail{
  max-height:calc(100dvh - 305px);
  overflow:auto;
  padding-right:3px;
}

.workday-v106-fit .station-detail{
  min-width:0!important;
}

.workday-v106-fit .fit-report-hero{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:10px!important;
}

/* Medium desktops/laptops */
@media (max-width: 1280px){
  .workday-fit-header{
    grid-template-columns:1fr;
  }
  .workday-fit-pills{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  .workday-fit-body{
    grid-template-columns:1fr;
  }
  .workday-fit-aside{
    position:relative;
    top:auto;
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
  }
  .fit-side-card.dev-tools{
    grid-template-columns:1fr;
  }
}

/* Tablets and small laptops */
@media (max-width: 980px){
  .workday-v106-fit{
    padding:10px 9px 18px!important;
  }
  .workday-fit-tabs{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .workday-v106-fit .orientation-board,
  .workday-v106-fit .client-file-grid,
  .workday-v106-fit .process-builder-grid,
  .workday-v106-fit .evidence-card-grid,
  .workday-v106-fit .field-score-grid,
  .workday-v106-fit .fit-report-hero{
    grid-template-columns:1fr!important;
  }
  .workday-fit-aside{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .workday-v106-fit .rotation-workspace{
    grid-template-columns:1fr!important;
  }
  .workday-v106-fit .station-rail{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    max-height:none!important;
    overflow:visible!important;
  }
}

/* Mobile */
@media (max-width: 640px){
  body.audit-workday-active.safe-compact-ui .app-shell{
    display:block!important;
  }
  body.audit-workday-active.safe-compact-ui .sidebar{
    display:none!important;
  }
  .workday-v106-fit{
    min-height:100svh!important;
    padding:9px 8px calc(72px + env(safe-area-inset-bottom,0px))!important;
    gap:9px!important;
  }
  .workday-fit-title{
    border-radius:20px;
    padding:13px 13px;
  }
  .workday-fit-title h3{
    font-size:28px!important;
  }
  .workday-fit-title span{
    font-size:12.2px!important;
  }
  .workday-fit-pills{
    border-radius:20px;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
    padding:7px;
  }
  .workday-fit-pills article{
    min-height:58px;
    padding:9px 8px;
  }
  .workday-fit-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
    padding:7px;
    border-radius:20px;
  }
  .workday-v106-fit .workday-phase-card{
    min-height:62px!important;
    grid-template-columns:27px minmax(0,1fr)!important;
    padding:9px!important;
  }
  .workday-v106-fit .workday-phase-card em{
    display:none!important;
  }
  .workday-v106-fit .workday-phase-card .phase-index{
    width:27px!important;
    height:27px!important;
    min-width:27px!important;
  }
  .workday-fit-stage{
    border-radius:20px;
    padding:9px;
  }
  .workday-fit-aside{
    grid-template-columns:1fr!important;
  }
  .fit-side-card{
    border-radius:18px;
    padding:11px 12px;
  }
  .fit-side-card.mini-progress{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  .fit-side-card.dev-tools{
    grid-template-columns:1fr 1fr!important;
  }
  .workday-v106-fit .workday-panel-head{
    border-radius:18px!important;
    padding:11px 12px!important;
    flex-direction:column!important;
    align-items:flex-start!important;
  }
  .workday-v106-fit .workday-panel-head h3{
    font-size:24px!important;
  }
  .workday-v106-fit .station-rail{
    grid-template-columns:1fr!important;
  }
  .workday-v106-fit .choice-chip-row,
  .workday-v106-fit .tag-chip-grid{
    grid-template-columns:1fr!important;
  }
}

@media (max-width: 390px){
  .workday-fit-tabs{
    grid-template-columns:1fr;
  }
  .workday-fit-pills{
    grid-template-columns:1fr 1fr;
  }
}
