:root {
  --my-work-body: 18px;
  --my-work-title: clamp(26px, 4vw, 32px);
  --my-work-card-title: 20px;
  --my-work-action: 20px;
}

body:not(.my-work-ready) #myWorkMain {
  visibility: hidden;
  content-visibility: hidden;
  contain-intrinsic-size: 1000px;
}

body.my-work-ready #myWorkMain {
  content-visibility: auto;
  contain-intrinsic-size: auto 1000px;
}

.my-work-route {
  --middleton-body-size: 18px;
  --middleton-support-size: 16px;
  min-width: 0;
  overflow-x: clip;
}

.my-work-route button,
.my-work-route a,
.my-work-route input,
.my-work-route textarea {
  font-size: var(--my-work-body);
}

.my-work-skip {
  position: fixed;
  z-index: 2000;
  top: -100px;
  left: 12px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #315e51;
  color: #fff;
  font-weight: 900;
}

.my-work-skip:focus {
  top: 12px;
}

.my-work-page {
  padding-bottom: calc(var(--middleton-mobile-nav-height, 86px)
    + env(safe-area-inset-bottom, 0px) + 24px);
  font-size: var(--my-work-body);
}

.my-work-heading {
  padding: 18px 4px 2px;
}

.my-work-kicker,
.shift-eyebrow {
  margin: 0 0 4px;
  color: #315e51;
  font-weight: 900;
}

.my-work-heading h2 {
  margin: 0;
  color: #5f4b3f;
  font-size: var(--my-work-title);
  line-height: 1.25;
  letter-spacing: -.025em;
}

.my-work-heading p:last-child {
  margin: 7px 0 0;
  color: #596761;
}

.shift-heading,
.reflection-heading,
.work-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.shift-heading h2,
.reflection-heading h2,
.work-section-heading h2,
.work-shortcuts h2,
.completed-panel h2 {
  margin: 0;
  font-size: var(--my-work-card-title);
  line-height: 1.35;
}

.shift-status-badge,
.private-badge {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #9fbcaf;
  border-radius: 14px;
  background: #eaf5f0;
  color: #315e51;
  font-weight: 900;
}

.shift-status-badge[data-status="CHECKOUT_PENDING"] {
  border-color: #d6b57e;
  background: #fff6e6;
  color: #75501d;
}

.shift-status-badge[data-status="CLOCKED_OUT"] {
  border-color: #a8c4dc;
  background: #eef6ff;
  color: #315b79;
}

.shift-facts {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) minmax(0, 1.12fr)
    minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.shift-facts > div {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  min-width: 0;
  gap: 6px;
  padding: 14px;
  border: 1px solid #ddd7cd;
  border-radius: 14px;
  background: #fffdf8;
}

.shift-facts dt {
  color: #68736e;
  font-weight: 800;
}

.shift-facts dd {
  margin: 0;
  color: #243d35;
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#workDate {
  display: grid;
  gap: 3px;
  overflow-wrap: normal;
}

#workDate > span {
  display: block;
  white-space: nowrap;
}

#workDateDay {
  letter-spacing: -.015em;
}

.demo-notice,
.reflection-privacy {
  padding: 14px 16px;
  border-radius: 14px;
  line-height: 1.6;
}

.demo-notice {
  border: 1px solid #dfbd82;
  background: #fff7e8;
  color: #67491d;
}

.demo-notice strong {
  display: block;
}

.shift-primary-action {
  display: grid;
  gap: 8px;
}

.shift-primary-action button,
.complete-shift-button {
  width: 100%;
  min-height: 60px;
  font-size: var(--my-work-action);
}

.shift-primary-action p,
.work-section-heading p {
  margin: 0;
  color: #68736e;
}

.my-work-message {
  min-height: 0;
  margin-top: 10px;
  color: #315e51;
  font-weight: 800;
}

.my-work-message:empty {
  display: none;
}

.my-work-message.is-error {
  padding: 14px 16px;
  border: 1px solid #c98478;
  border-radius: 14px;
  background: #fff1ee;
  color: #852f22;
}

.my-work-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.my-work-overview .panel {
  min-width: 0;
}

.work-section-heading a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #9fbcaf;
  border-radius: 12px;
  color: #315e51;
  font-weight: 900;
  text-decoration: none;
}

.work-summary-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 9px;
  margin-top: 16px;
  padding-right: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #799e90 #edf3f0;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
}

.work-summary-list--residents {
  max-height: 520px;
}

.work-summary-list--records {
  max-height: 440px;
}

.work-summary-list::-webkit-scrollbar {
  width: 11px;
}

.work-summary-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #edf3f0;
}

.work-summary-list::-webkit-scrollbar-thumb {
  border: 2px solid #edf3f0;
  border-radius: 999px;
  background: #799e90;
}

.work-summary-list:focus-visible {
  outline: 3px solid #537f70;
  outline-offset: 4px;
}

.work-summary-item {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 14px;
  border: 1px solid #d5ddd8;
  border-radius: 14px;
  background: #fff;
}

.work-summary-item strong,
.work-summary-item span,
.work-summary-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.work-summary-item small,
.empty-copy {
  color: #68736e;
}

.record-work-card {
  gap: 9px;
  padding: 15px 16px;
  border-color: #cbd9d3;
  background: linear-gradient(135deg, #fff 0%, #fbfdfc 100%);
}

.record-work-heading,
.record-work-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
}

.record-work-heading {
  justify-content: space-between;
  gap: 8px 12px;
}

.record-work-heading strong {
  flex: 1 1 13rem;
  color: #243d35;
  font-size: var(--my-work-card-title);
  line-height: 1.4;
}

.record-status-badge {
  display: inline-flex;
  min-height: 32px;
  flex: 0 0 auto;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff0d8;
  color: #744b16;
  font-size: 15px;
  font-weight: 900;
}

.record-status-badge[data-tone="progress"] {
  background: #eaf3f8;
  color: #28566f;
}

.record-status-badge[data-tone="correction"] {
  background: #fff0e9;
  color: #853f2d;
}

.record-work-resident {
  margin: 0;
  color: #3f514a;
  font-weight: 800;
}

.record-work-label {
  margin-right: 7px;
  color: #68736e;
  font-size: 15px;
  font-weight: 900;
}

.record-work-meta {
  justify-content: flex-start;
  gap: 5px 12px;
  color: #68736e;
  font-size: 14px;
}

.resident-work-card {
  --resident-photo-size: 72px;
  display: grid;
  grid-template-columns: var(--resident-photo-size) minmax(0, 1fr);
  min-width: 0;
  min-height: 48px;
  gap: 13px;
  align-items: start;
  padding: 14px;
  border: 1px solid #cbd9d3;
  border-radius: 14px;
  background: #fff;
  color: #243d35;
  text-decoration: none;
}

.resident-work-card:focus-visible {
  outline: 3px solid #537f70;
  outline-offset: 3px;
}

.resident-work-media {
  display: block;
  width: var(--resident-photo-size);
  height: var(--resident-photo-size);
}

.resident-work-photo {
  display: grid;
  width: var(--resident-photo-size);
  height: var(--resident-photo-size);
  place-items: center;
  border-radius: 18px;
  background: #eaf5f0;
  color: #315e51;
  object-fit: cover;
}

.resident-work-placeholder {
  border: 1px solid #b7cfc5;
  background: linear-gradient(145deg, #f5f8f6, #e6efeb);
  color: #6f8b80;
}

.resident-work-placeholder svg {
  width: 46px;
  height: 46px;
  fill: #bfd0c9;
  stroke: #6f8b80;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.resident-work-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.resident-work-heading {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

.resident-work-heading strong {
  min-width: 0;
  font-size: var(--my-work-card-title);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.resident-status-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 12px;
  background: #f3f1ed;
  color: #565f5b;
  font-size: 16px;
  font-weight: 900;
}

.resident-status-badge[data-tone="stable"] {
  background: #eaf5f0;
  color: #245f52;
}

.resident-status-badge[data-tone="caution"] {
  background: #fff3dc;
  color: #704917;
}

.resident-work-meta,
.resident-work-caution,
.resident-work-freshness {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 3px 6px;
  align-items: baseline;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.resident-work-meta {
  color: #4e5d57;
  font-weight: 800;
}

.resident-work-caution {
  align-items: flex-start;
  color: #594a40;
}

.resident-work-caution > span:first-child,
.resident-work-freshness > span:first-child {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 8px;
  background: #fff3dc;
  color: #704917;
  font-size: 14px;
  font-weight: 900;
}

.resident-work-caution > span:last-child {
  min-width: 0;
  flex: 1 1 14rem;
}

.resident-work-freshness {
  color: #68736e;
  font-size: 16px;
}

.resident-work-freshness > span:first-child {
  background: #eef2f0;
  color: #52615b;
}

.resident-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.shortcut-grid a {
  display: grid;
  min-width: 0;
  min-height: 96px;
  align-content: center;
  gap: 5px;
  padding: 14px;
  border: 1px solid #c7d7d0;
  border-radius: 14px;
  background: #fff;
  color: #243d35;
  text-decoration: none;
}

.shortcut-grid strong {
  font-size: var(--my-work-card-title);
}

.shortcut-grid span {
  color: #68736e;
  line-height: 1.45;
}

.reflection-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.reflection-steps li {
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: #f3f1ed;
  color: #626b67;
  font-weight: 850;
}

.reflection-steps li[aria-current="step"] {
  background: #eaf5f0;
  color: #315e51;
}

.stress-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

.stress-choices legend,
.reflection-label {
  width: 100%;
  margin-bottom: 9px;
  color: #344b43;
  font-weight: 900;
}

.stress-choices button {
  min-width: 0;
  min-height: 54px;
  padding: 10px;
  border: 1px solid #9fbcaf;
  border-radius: 13px;
  background: #fff;
  color: #315e51;
  font-weight: 900;
}

.stress-choices button[aria-pressed="true"] {
  border-color: #315e51;
  background: #eaf5f0;
  box-shadow: inset 0 0 0 2px #315e51;
}

.reflection-label {
  display: block;
  margin-top: 18px;
}

#reflectionText {
  width: 100%;
  min-height: 150px;
  padding: 14px 15px;
  border: 2px solid #9fb7ad;
  border-radius: 14px;
  background: #fff;
  color: #2e3c37;
  font: inherit;
  line-height: 1.65;
  resize: vertical;
}

#reflectionText:focus {
  outline: 3px solid rgba(83, 127, 112, .24);
  outline-offset: 2px;
}

.draft-status {
  margin: 8px 0 14px;
  color: #596761;
}

.complete-shift-button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.reflection-privacy {
  margin: 14px 0 0;
  background: #f4f9f6;
  color: #52615b;
}

.support-reply {
  min-height: 120px;
  margin: 16px 0;
  padding: 18px;
  border: 1px solid #c7d7d0;
  border-radius: 14px;
  background: #f7fbf8;
  line-height: 1.8;
}

.support-reply p {
  margin: 0;
  white-space: pre-wrap;
}

.support-caret {
  color: #315e51;
  font-weight: 900;
}

@media (max-width: 1024px) {
  .shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .my-work-page {
    width: min(100% - 16px, 1180px);
  }

  .my-work-heading {
    padding-inline: 2px;
  }

  .reflection-heading,
  .work-section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .private-badge {
    justify-self: start;
  }

  .my-work-overview,
  .stress-choices,
  .reflection-steps,
  .shortcut-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .shift-heading {
    gap: 8px;
  }

  .shift-status-badge {
    min-height: 48px;
    padding-inline: 10px;
  }

  .shift-facts {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 8px;
    margin-block: 14px;
  }

  .shift-facts > div {
    padding: 11px;
  }

  .work-section-heading a {
    width: 100%;
  }

  .resident-work-card {
    --resident-photo-size: 64px;
  }

  .resident-work-photo {
    border-radius: 16px;
  }

  .work-summary-list--residents {
    max-height: 430px;
  }

  .work-summary-list--records {
    max-height: 410px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .shift-facts {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  }

  .my-work-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (orientation: landscape) and (max-width: 1024px) and (max-height: 700px) {
  .my-work-heading {
    padding-block: 4px 0;
  }

  .my-work-kicker,
  .my-work-heading p:last-child {
    display: none;
  }

  .shift-panel {
    margin-top: 8px;
    padding: 14px;
  }

  .shift-facts {
    grid-template-columns:
      minmax(0, 1fr) minmax(0, 1.12fr)
      minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-block: 10px;
  }

  .shift-facts > div {
    padding: 9px;
  }

  .demo-notice {
    padding: 8px 11px;
    line-height: 1.35;
  }

  .demo-notice strong {
    display: inline;
    margin-right: 6px;
  }
}

@media (min-width: 1025px) {
  .my-work-page {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    gap: 0 20px;
  }

  .my-work-heading,
  .my-work-page > .my-work-message,
  .work-shortcuts,
  .reflection-panel,
  .completed-panel {
    grid-column: 1 / -1;
  }

  .shift-panel {
    grid-column: 1;
  }

  .my-work-overview {
    grid-column: 2;
    grid-template-columns: 1fr;
  }

  .my-work-overview .panel:first-child {
    margin-top: 20px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .resident-work-card:hover {
    border-color: #8fb7a8;
    background: #fbfefc;
    box-shadow: 0 7px 18px rgba(49, 94, 81, .08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .my-work-route *,
  .my-work-route *::before,
  .my-work-route *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
