/* v447 - platform-wide visual audit corrections.
   Keeps the shared canvas, responsive grids, headers and controls on one rhythm. */

:root{
  --audit447-gap:12px;
  --audit447-line:#d8e1ea;
  --audit447-ink:#102841;
}

/* Prevent isolated labels and actions from breaking in the middle of a word. */
.content :is(.btn,button,a,summary,.status-badge){
  word-break:normal;
  overflow-wrap:normal;
}

/* SO detail: preserve the identity block and make the action area a deliberate grid. */
.endpoint-main-job_detail .sample-hero-v16{
  display:grid!important;
  grid-template-columns:minmax(250px,320px) minmax(0,1fr)!important;
  align-items:start!important;
  min-height:0!important;
}
.endpoint-main-job_detail .sample-hero-v16 h1{
  white-space:nowrap;
  font-size:clamp(25px,2vw,34px)!important;
}

/* Long operational totals remain one readable value. */
.endpoint-main-job_detail .detail-kpis-v16{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
.endpoint-main-job_detail .detail-kpis-v16 .mini-stat strong{
  white-space:nowrap!important;
  font-size:clamp(22px,1.75vw,28px)!important;
  font-variant-numeric:tabular-nums;
}
.endpoint-main-job_detail .sample-hero-v16>.action-stack{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(126px,1fr));
  align-items:stretch!important;
  width:100%;
  gap:8px!important;
}
.endpoint-main-job_detail .sample-hero-v16>.action-stack :is(a,.status-badge){
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  margin:0!important;
  padding-inline:10px!important;
  text-align:center;
  white-space:nowrap;
}

/* Stuffing booking: clean two-zone header; action labels stay intact. */
.endpoint-main-stuffing_booking .stuffing-booking-head-v295{
  display:grid!important;
  grid-template-columns:minmax(250px,340px) minmax(0,1fr)!important;
  align-items:start!important;
  min-height:0!important;
}
.endpoint-main-stuffing_booking .stuffing-booking-state-v295{
  display:flex!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
  align-items:center!important;
  gap:7px!important;
}
.endpoint-main-stuffing_booking .stuffing-booking-state-v295 :is(a,button,span){
  white-space:nowrap!important;
}
.endpoint-main-stuffing_booking .stuffing-booking-title-v295 h1{
  font-size:clamp(25px,2.1vw,34px)!important;
}

/* Laboratory summary uses the complete horizontal canvas on desktop. */
@media(min-width:901px){
  .endpoint-main-laboratory_dashboard .lab-kpi-grid-v298{
    grid-template-columns:repeat(7,minmax(0,1fr))!important;
  }
}

/* Command Center: 3 + 2 balanced cards at compact desktop widths. */
@media(min-width:821px) and (max-width:1180px){
  .endpoint-main-dashboard .ccx-kpis{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
  }
  .endpoint-main-dashboard .ccx-kpis>article{
    grid-column:span 2!important;
  }
  .endpoint-main-dashboard .ccx-kpis>article:nth-child(4),
  .endpoint-main-dashboard .ccx-kpis>article:nth-child(5){
    grid-column:span 3!important;
  }
}

/* Vessel line-up: filters occupy the full card instead of shrinking to the left. */
@media(min-width:901px) and (max-width:1050px){
  .endpoint-main-jobs_board .lineup443-filterbar{
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:end!important;
  }
  .endpoint-main-jobs_board .lineup443-filterbar>form{
    width:100%!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  .endpoint-main-jobs_board .lineup443-filterbar>form label.search{
    grid-column:span 2!important;
  }
  .endpoint-main-jobs_board .lineup443-filterbar>details{
    justify-self:end;
  }
}

/* Stuffing command filters: presets on top; date range and lifecycle share one row. */
@media(min-width:901px) and (max-width:1180px){
  .endpoint-main-stuffing_dashboard .v379-filter-lower{
    grid-template-columns:minmax(300px,1fr) auto!important;
    align-items:end!important;
  }
  .endpoint-main-stuffing_dashboard .v379-date-presets{
    grid-column:1/-1!important;
  }
  .endpoint-main-stuffing_dashboard .v379-custom-dates{
    grid-column:1!important;
    justify-content:flex-start!important;
  }
  .endpoint-main-stuffing_dashboard .v379-lifecycle-tabs{
    grid-column:2!important;
    justify-self:end!important;
  }
}

/* Stuffing line-up toolbar: compact without broken labels. */
@media(max-width:1500px){
  .endpoint-main-stuffing_lineup .stuffing-lineup-head-v345 nav{
    gap:6px!important;
  }
  .endpoint-main-stuffing_lineup .stuffing-lineup-head-v345 nav :is(a,button){
    min-width:max-content!important;
    padding-inline:10px!important;
    font-size:11px!important;
    white-space:nowrap!important;
  }
}

/* Atlas stacked header has room for its text label at this breakpoint. */
@media(min-width:901px) and (max-width:1240px){
  .endpoint-main-operations_atlas #atlas425MoreToggle span{
    display:inline!important;
  }
}

@media(max-width:1180px){
  .endpoint-main-job_detail .sample-hero-v16,
  .endpoint-main-stuffing_booking .stuffing-booking-head-v295{
    grid-template-columns:1fr!important;
  }
  .endpoint-main-job_detail .sample-hero-v16>.action-stack{
    grid-template-columns:repeat(3,minmax(126px,1fr));
  }
  .endpoint-main-stuffing_booking .stuffing-booking-state-v295{
    justify-content:flex-start!important;
  }
  .endpoint-main-dashboard .ccx-workspace{
    grid-template-columns:minmax(0,1fr)!important;
    height:auto!important;
    min-height:0!important;
  }
  .endpoint-main-job_detail .inline-edit-help + .job-section-grid.two-equal{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .endpoint-main-schedule_dashboard .schedule374-employee{
    content-visibility:visible!important;
    contain-intrinsic-size:auto!important;
  }
}

@media(max-width:700px){
  .endpoint-main-job_detail .sample-hero-v16>.action-stack{
    grid-template-columns:1fr 1fr;
  }
  .endpoint-main-job_detail .sample-hero-v16 h1{
    white-space:normal;
  }
  .endpoint-main-stuffing_booking .stuffing-booking-title-v295 h1{
    font-size:22px!important;
  }
}
