/* V107 hard no-cut viewport layout.
   This is source-level cleanup on top of V106: no horizontal overflow, no clipped right column,
   compact top area, and mobile-safe single-column Workday content. */

html, body, #appView, .app-shell, .workspace, .app-section, #modulesSection, #moduleList{
  max-width:100vw!important;
  overflow-x:hidden!important;
  box-sizing:border-box!important;
}

*, *::before, *::after{
  box-sizing:border-box!important;
}

body.audit-workday-active.safe-compact-ui{
  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{
  width:100vw!important;
  max-width:100vw!important;
  overflow-x:hidden!important;
  grid-template-columns:0 minmax(0,1fr)!important;
  display:grid!important;
}

body.audit-workday-active.safe-compact-ui .sidebar{
  display:none!important;
  width:0!important;
}

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

body.audit-workday-active.safe-compact-ui #modulesSection .section-card{
  width:100vw!important;
  max-width:100vw!important;
  min-width:0!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow-x:hidden!important;
}

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

body.audit-workday-active.safe-compact-ui #moduleList{
  width:100vw!important;
  max-width:100vw!important;
  min-width:0!important;
  padding:0!important;
  margin:0!important;
  display:block!important;
  overflow-x:hidden!important;
}

/* Full console with strict viewport containment */
.workday-v107-fit{
  --line:rgba(191,220,255,.115);
  --card:linear-gradient(180deg,rgba(15,21,34,.96),rgba(7,11,21,.96));
  --soft:rgba(255,255,255,.038);
  width:100vw!important;
  max-width:100vw!important;
  min-width:0!important;
  padding:10px clamp(8px,1vw,14px) calc(18px + env(safe-area-inset-bottom,0px))!important;
  margin:0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:9px!important;
  overflow-x:hidden!important;
}

/* Header: never taller than needed, never extends right */
.workday-v107-fit .workday-fit-header{
  width:100%!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:8px!important;
}

.workday-v107-fit .workday-fit-title,
.workday-v107-fit .workday-fit-pills,
.workday-v107-fit .workday-fit-tabs,
.workday-v107-fit .workday-fit-stage,
.workday-v107-fit .fit-side-card{
  max-width:100%!important;
  min-width:0!important;
  border:1px solid var(--line)!important;
  background:var(--card)!important;
  border-radius:18px!important;
  box-shadow:0 12px 28px rgba(0,0,0,.22)!important;
}

.workday-v107-fit .workday-fit-title{
  padding:12px 14px!important;
}

.workday-v107-fit .workday-fit-title .eyebrow{
  font-size:9px!important;
  letter-spacing:.15em!important;
  margin:0 0 4px!important;
}

.workday-v107-fit .workday-fit-title h3{
  font-size:clamp(22px,2vw,30px)!important;
  line-height:1!important;
  margin:0 0 5px!important;
  letter-spacing:-.05em!important;
}

.workday-v107-fit .workday-fit-title span{
  font-size:12px!important;
  line-height:1.32!important;
  display:block!important;
  max-width:100%!important;
  color:rgba(232,237,248,.72)!important;
}

/* Metrics become compact row. */
.workday-v107-fit .workday-fit-pills{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:7px!important;
  padding:7px!important;
}

.workday-v107-fit .workday-fit-pills article{
  min-width:0!important;
  min-height:48px!important;
  border-radius:13px!important;
  padding:8px 9px!important;
  background:var(--soft)!important;
  border:1px solid rgba(191,220,255,.075)!important;
  overflow:hidden!important;
}

.workday-v107-fit .workday-fit-pills strong{
  display:block!important;
  font-size:clamp(15px,1.3vw,20px)!important;
  line-height:1.05!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

.workday-v107-fit .workday-fit-pills small{
  display:block!important;
  margin-top:4px!important;
  font-size:9.5px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  color:rgba(226,235,248,.67)!important;
}

/* Phase rail: desktop 3x2 or 6 depending width? Use 3 columns to avoid cutting on low-resolution laptops. */
.workday-v107-fit .workday-fit-tabs{
  width:100%!important;
  max-width:100%!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:7px!important;
  padding:7px!important;
  overflow:visible!important;
}

.workday-v107-fit .workday-phase-card{
  min-width:0!important;
  width:100%!important;
  max-width:100%!important;
  flex:unset!important;
  display:grid!important;
  grid-template-columns:28px minmax(0,1fr) auto!important;
  gap:8px!important;
  min-height:56px!important;
  padding:8px 9px!important;
  border-radius:14px!important;
  overflow:hidden!important;
  background:rgba(255,255,255,.03)!important;
}

.workday-v107-fit .workday-phase-card .phase-index{
  width:28px!important;
  height:28px!important;
  min-width:28px!important;
  border-radius:9px!important;
  font-size:10px!important;
}

.workday-v107-fit .workday-phase-card div{
  min-width:0!important;
  overflow:hidden!important;
}

.workday-v107-fit .workday-phase-card strong{
  display:block!important;
  max-width:100%!important;
  font-size:11.8px!important;
  line-height:1.1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

.workday-v107-fit .workday-phase-card small{
  display:block!important;
  max-width:100%!important;
  font-size:9.4px!important;
  line-height:1.2!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

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

/* Body: single column. Right panel no longer causes clipping. */
.workday-v107-fit .workday-fit-body{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:9px!important;
  overflow-x:hidden!important;
}

.workday-v107-fit .workday-fit-stage{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  padding:9px!important;
  border-radius:18px!important;
  overflow:hidden!important;
}

.workday-v107-fit .workday-fit-aside{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:7px!important;
  position:relative!important;
  top:auto!important;
  overflow:hidden!important;
  order:-1!important; /* summary above content, compact and visible */
}

.workday-v107-fit .fit-side-card{
  padding:9px 10px!important;
  border-radius:15px!important;
  min-height:70px!important;
  overflow:hidden!important;
}

.workday-v107-fit .fit-side-card span{
  font-size:8.8px!important;
  letter-spacing:.12em!important;
  margin:0 0 5px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

.workday-v107-fit .fit-side-card strong{
  font-size:15.5px!important;
  line-height:1.1!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

.workday-v107-fit .fit-side-card small{
  font-size:10px!important;
  line-height:1.25!important;
  margin-top:4px!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
}

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

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

.workday-v107-fit .fit-side-card.mini-progress div{
  min-width:0!important;
  border-radius:10px!important;
  padding:6px 5px!important;
  background:rgba(255,255,255,.035)!important;
}

.workday-v107-fit .fit-side-card.mini-progress b{
  font-size:13px!important;
  white-space:nowrap!important;
}

.workday-v107-fit .fit-side-card.mini-progress small{
  font-size:8.5px!important;
  white-space:nowrap!important;
  display:block!important;
  -webkit-line-clamp:unset!important;
}

.workday-v107-fit .fit-side-card.dev-tools{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:5px!important;
}

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

.workday-v107-fit .fit-side-card.dev-tools button{
  min-width:0!important;
  padding:7px 6px!important;
  font-size:10px!important;
}

/* Active phase: force all internal grids into safe columns. */
.workday-v107-fit .workday-phase-panel,
.workday-v107-fit .workday-panel-head,
.workday-v107-fit .orientation-board,
.workday-v107-fit .client-file-grid,
.workday-v107-fit .process-builder-grid,
.workday-v107-fit .evidence-card-grid,
.workday-v107-fit .field-score-grid,
.workday-v107-fit .fit-report-hero,
.workday-v107-fit .rotation-workspace,
.workday-v107-fit .station-detail,
.workday-v107-fit .artifact-stack,
.workday-v107-fit .choice-chip-row,
.workday-v107-fit .tag-chip-grid,
.workday-v107-fit .station-rail{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:hidden!important;
}

.workday-v107-fit .workday-phase-panel{
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

.workday-v107-fit .workday-panel-head{
  padding:10px 12px!important;
  margin-bottom:8px!important;
  border-radius:16px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:5px!important;
}

.workday-v107-fit .workday-panel-head h3{
  font-size:clamp(21px,1.85vw,29px)!important;
  line-height:1.05!important;
  margin:2px 0 3px!important;
  letter-spacing:-.045em!important;
}

.workday-v107-fit .workday-panel-head span{
  font-size:11.5px!important;
  line-height:1.3!important;
}

.workday-v107-fit .workday-panel-head b{
  font-size:12px!important;
  padding:7px 9px!important;
}

.workday-v107-fit .orientation-board,
.workday-v107-fit .client-file-grid,
.workday-v107-fit .process-builder-grid,
.workday-v107-fit .evidence-card-grid,
.workday-v107-fit .field-score-grid,
.workday-v107-fit .fit-report-hero{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
}

.workday-v107-fit .orientation-tile,
.workday-v107-fit .client-folder-card,
.workday-v107-fit .process-flow-card,
.workday-v107-fit .evidence-tag-card,
.workday-v107-fit .fit-report-hero > div,
.workday-v107-fit .field-score-grid article{
  min-width:0!important;
  max-width:100%!important;
  padding:10px!important;
  border-radius:15px!important;
  overflow:hidden!important;
}

.workday-v107-fit .orientation-tile h4,
.workday-v107-fit .client-folder-card h4,
.workday-v107-fit .process-flow-card h4,
.workday-v107-fit .evidence-tag-card h4{
  font-size:13.5px!important;
  line-height:1.18!important;
  overflow-wrap:anywhere!important;
}

.workday-v107-fit .orientation-tile p,
.workday-v107-fit .client-folder-card small,
.workday-v107-fit .client-folder-card li,
.workday-v107-fit .process-flow-card p,
.workday-v107-fit .evidence-tag-card p{
  font-size:11.3px!important;
  line-height:1.32!important;
  max-width:100%!important;
  overflow-wrap:anywhere!important;
}

.workday-v107-fit .tile-top,
.workday-v107-fit .folder-strip,
.workday-v107-fit .flow-head{
  min-width:0!important;
  gap:6px!important;
}

.workday-v107-fit .tile-top button,
.workday-v107-fit .folder-strip button,
.workday-v107-fit .flow-head button{
  white-space:nowrap!important;
  min-width:0!important;
  max-width:48%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* Rotation panel safe layout */
.workday-v107-fit .rotation-workspace{
  display:grid!important;
  grid-template-columns:minmax(0,230px) minmax(0,1fr)!important;
  gap:8px!important;
}

.workday-v107-fit .station-rail{
  max-height:calc(100svh - 310px)!important;
  overflow:auto!important;
  padding-right:2px!important;
}

.workday-v107-fit .station-rail button{
  min-width:0!important;
  max-width:100%!important;
}

.workday-v107-fit .station-head,
.workday-v107-fit .artifact-stack,
.workday-v107-fit .station-choice-block{
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
}

.workday-v107-fit .choice-chip-row,
.workday-v107-fit .tag-chip-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px!important;
}

.workday-v107-fit .choice-chip-row button,
.workday-v107-fit .tag-chip-grid button{
  min-width:0!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  text-align:left!important;
  padding:7px 8px!important;
  font-size:10.8px!important;
}

/* Reduce top dead space if user loads in smaller viewport/browser chrome. */
body.audit-workday-active.safe-compact-ui{
  scroll-padding-top:0!important;
}

/* Medium/laptop */
@media (max-width: 1180px){
  .workday-v107-fit .workday-fit-aside{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .workday-v107-fit .workday-fit-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .workday-v107-fit .orientation-board,
  .workday-v107-fit .client-file-grid,
  .workday-v107-fit .process-builder-grid,
  .workday-v107-fit .evidence-card-grid,
  .workday-v107-fit .field-score-grid,
  .workday-v107-fit .fit-report-hero{
    grid-template-columns:1fr!important;
  }
  .workday-v107-fit .rotation-workspace{
    grid-template-columns:1fr!important;
  }
  .workday-v107-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: 700px){
  .workday-v107-fit{
    padding:8px 7px calc(74px + env(safe-area-inset-bottom,0px))!important;
    gap:7px!important;
  }

  .workday-v107-fit .workday-fit-title{
    padding:11px 12px!important;
  }

  .workday-v107-fit .workday-fit-title h3{
    font-size:25px!important;
  }

  .workday-v107-fit .workday-fit-pills{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .workday-v107-fit .workday-fit-tabs{
    grid-template-columns:1fr!important;
  }

  .workday-v107-fit .workday-phase-card{
    min-height:52px!important;
    grid-template-columns:28px minmax(0,1fr)!important;
  }

  .workday-v107-fit .workday-phase-card em{
    display:none!important;
  }

  .workday-v107-fit .workday-fit-aside{
    grid-template-columns:1fr!important;
    order:0!important;
  }

  .workday-v107-fit .fit-side-card.mini-progress{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  .workday-v107-fit .fit-side-card.dev-tools{
    grid-template-columns:1fr 1fr!important;
  }

  .workday-v107-fit .orientation-board,
  .workday-v107-fit .client-file-grid,
  .workday-v107-fit .process-builder-grid,
  .workday-v107-fit .evidence-card-grid,
  .workday-v107-fit .field-score-grid,
  .workday-v107-fit .fit-report-hero,
  .workday-v107-fit .station-rail,
  .workday-v107-fit .choice-chip-row,
  .workday-v107-fit .tag-chip-grid{
    grid-template-columns:1fr!important;
  }
}

/* Very small mobile */
@media (max-width: 390px){
  .workday-v107-fit .workday-fit-pills{
    grid-template-columns:1fr!important;
  }
}
