html,
body {
  overflow-x: hidden;
}

.shell {
  overflow-x: clip;
}

.table-wrap {
  max-width: 100%;
  contain: inline-size;
}

.office-sheets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.office-sheet {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  box-shadow: none;
}

.office-sheet:hover {
  background: #f3f4f6;
  border-color: var(--ink);
  color: var(--ink);
}

.office-sheet.is-active,
.office-sheet.is-active:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: none;
}

.office-sheet-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.route-tab {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  box-shadow: none;
}

.route-tab:hover {
  border-color: var(--purple);
  background: #f4eeff;
  color: var(--purple-deep);
}

.route-tab.is-active,
.route-tab.is-active:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--orange);
}

.route-tab.is-add {
  background: transparent;
  color: var(--orange-deep);
  border-style: dashed;
  border-color: var(--orange);
}

.route-tab.is-add:hover {
  border-color: var(--orange-deep);
  background: #fff;
  color: var(--orange-deep);
}

.route-jump {
  background: transparent;
  color: var(--purple);
  border: 0;
  padding: 0;
  font-weight: 650;
  text-align: left;
}

.route-jump:hover {
  background: transparent;
  text-decoration: underline;
}

.schedule-history.all-routes-sheet th,
.schedule-history.all-routes-sheet td {
  padding: 0.2rem 0.45rem;
  vertical-align: middle;
  white-space: nowrap;
}

.all-routes-sheet .status-detail {
  display: inline;
  margin: 0 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.2;
}

.all-routes-sheet .status-detail::before {
  content: "· ";
}

.driver-history-route + .driver-history-route {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.topbar-side .secondary,
.topbar-side .payroll-export {
  max-width: 100%;
  min-width: 0;
  gap: 0.6rem;
  white-space: normal;
  text-align: center;
}

.dash-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 999px;
  flex: none;
}

.dash-ico .icon {
  width: 1.28rem;
  height: 1.28rem;
  fill: currentColor;
  stroke: none;
}

.dash-ico-down {
  background: var(--purple);
  color: #fff;
}

.dash-ico-up {
  background: var(--orange);
  color: #fff;
}

.dash-ico-sheet {
  background: #fff;
  color: var(--purple);
}

.topbar-side .payroll-export {
  margin-inline-start: 0.35rem;
  padding: 0.42rem 0.75rem;
  border-color: var(--orange-deep);
  background: var(--orange);
  color: #fff;
  font-size: 0.84rem;
}

.topbar-side .payroll-export:hover {
  border-color: var(--orange-deep);
  background: var(--orange-deep);
  color: #fff;
}

.file-status {
  grid-column: 1 / -1;
  margin: 0;
}

.schedule-history tr.is-new-change th,
.schedule-history tr.is-new-change td {
  background: #fff;
  vertical-align: middle;
  white-space: nowrap;
}

.schedule-history tr.is-new-change th {
  box-shadow: inset 4px 0 0 var(--accent);
}

.entry-line {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.schedule-history tr.is-new-change .row-kind {
  display: inline;
  margin: 0;
}

.entry-editor {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 11rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  white-space: normal;
}

.entry-editor input {
  width: 100%;
  min-width: 11rem;
  font-weight: 400;
}

.schedule-history td.is-editor {
  white-space: normal;
}

.change-stamp-wrap {
  display: inline-block;
  margin-top: 0.35rem;
  vertical-align: middle;
}

.change-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.change-stamp:hover,
.change-stamp[aria-expanded='true'] {
  background: #f3f4f6;
  color: var(--ink);
  border-color: var(--ink);
}

.change-stamp svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.change-stamp-pop {
  display: block;
  width: min(16rem, 100%);
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  white-space: normal;
}

.change-stamp-pop p {
  margin: 0 0 0.3rem;
  font-size: 0.85rem;
  line-height: 1.35;
}

.change-stamp-pop p:last-child {
  margin-bottom: 0;
}

.change-stamp-when,
.change-stamp-kicker {
  color: var(--muted);
  font-size: 0.75rem;
}

.change-stamp-name {
  font-weight: 650;
}

.entry-dash {
  color: var(--muted);
}

.schedule-history tr.is-history .entry-input,
.schedule-history tr.is-new-change .entry-input {
  width: auto;
  max-width: 9.5rem;
  padding: 0.3rem 0.4rem;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(23, 36, 51, 0.06);
}

.schedule-history tr.is-history th,
.schedule-history tr.is-history td,
.schedule-history tr.is-new-change th,
.schedule-history tr.is-new-change td {
  white-space: nowrap;
  vertical-align: middle;
}

.schedule-history tr.is-new-change button {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

#drivers-view .table-wrap {
  border: 1px solid #b4b4b4;
  border-radius: 0;
  background: #fff;
}

.driver-sheet {
  min-width: 36rem;
  font-family: Calibri, "Segoe UI", sans-serif;
  font-size: 13px;
  border-collapse: collapse;
}

.driver-sheet th,
.driver-sheet td {
  border: 1px solid #d4d4d4;
  padding: 0;
  vertical-align: middle;
  background: #fff;
}

.driver-sheet thead th {
  padding: 0.28rem 0.5rem;
  background: #f3f3f3;
  color: #1c1e22;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
  border-color: #b4b4b4;
  white-space: nowrap;
}

.driver-sheet .sheet-rowhead {
  width: 2.4rem;
  min-width: 2.4rem;
  padding: 0 0.4rem;
  background: #f3f3f3;
  color: #6b7280;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  user-select: none;
}

.driver-sheet tbody tr:last-child td,
.driver-sheet tbody tr:last-child th {
  border-bottom: 1px solid #d4d4d4;
}

.driver-sheet .entry-input {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0.38rem 0.5rem;
  font: inherit;
  color: inherit;
}

.driver-sheet .entry-input:focus {
  outline: 2px solid #107c41;
  outline-offset: -2px;
  border-color: transparent;
  background: #fff;
}

.driver-sheet .sheet-readonly {
  padding: 0.38rem 0.5rem;
  background: #f7f7f7;
  color: #1c1e22;
}

.schedule-history .notice-sent {
  white-space: nowrap;
}

.schedule-history .notice-sent-value {
  display: inline-block;
  min-width: 1.8rem;
  margin-right: 0.45rem;
  font-weight: 700;
}

.schedule-history .js-send-notice {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

@media (min-width: 960px) {
  .shell {
    width: calc(100% - 2.5rem);
  }

  .brand-sub,
  .lead,
  .rules ol {
    max-width: 78ch;
  }

  .topbar {
    grid-template-columns: minmax(26rem, 1fr) auto;
    align-items: start;
  }

  .topbar-side {
    max-width: none;
  }

  .brand {
    line-height: 1.15;
  }

  .run-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .schedule-history {
    min-width: 0;
    width: 100%;
  }

  .schedule-history th,
  .schedule-history td {
    padding: 0.5rem 0.4rem;
  }

  .schedule-history tr.is-history th,
  .schedule-history tr.is-history td,
  .schedule-history tr.is-new-change th,
  .schedule-history tr.is-new-change td {
    white-space: normal;
  }

  .schedule-history .times,
  .schedule-history .entry-line {
    white-space: nowrap;
  }

  .schedule-history tr.is-history .entry-input,
  .schedule-history tr.is-new-change .entry-input {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0.25rem 0.2rem;
    font-size: 0.85rem;
  }

  .schedule-history input[type='date'] {
    min-width: 8.6rem;
  }

  .schedule-history input[type='time'] {
    min-width: 6.1rem;
  }

  .schedule-history .contracted-label {
    min-width: 0;
  }

  .schedule-history .row-kind,
  .schedule-history .contracted-detail,
  .schedule-history .change-note {
    white-space: normal;
  }

  .calendar-months {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

}

@media (min-width: 1400px) {
  .calendar-months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1800px) {
  .calendar-months {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body.is-booting .shell > :not(.topbar) {
  visibility: hidden;
}

body.needs-account .shell > :not(.topbar):not(#account-gate) {
  display: none;
}

body.needs-account .topbar-side,
body.needs-account .brand-sub,
body.needs-account #file-status {
  display: none;
}

.account-gate {
  max-width: 28rem;
}

.account-chip:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0;
  font-weight: 650;
}

.account-chip button {
  font-weight: 600;
}
