:root {
  background: #eef1ef;
  color: #101312;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.sheet {
  background: #fff;
  margin: 0 auto;
  max-width: 540px;
  min-height: 100vh;
  padding: 8px;
}

.header {
  border: 1px solid #222;
  display: grid;
  grid-template-columns: 92px 1fr 108px;
  min-height: 74px;
}

.logo,
.title,
.meta {
  align-items: center;
  display: flex;
  justify-content: center;
}

.logo {
  border-right: 1px solid #222;
  padding: 8px;
}

.logo img {
  display: block;
  max-height: 58px;
  max-width: 100%;
  width: 100%;
}

.title {
  border-right: 1px solid #222;
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: 0;
}

.meta {
  align-items: stretch;
  flex-direction: column;
  font-size: 0.52rem;
  font-weight: 700;
  padding: 0;
  text-align: center;
}

.meta div {
  align-items: center;
  border-bottom: 1px solid #222;
  display: flex;
  flex: 1;
  justify-content: center;
  padding: 2px;
}

.meta div:last-child {
  border-bottom: 0;
}

.barTitle {
  border: 1px solid #222;
  border-top: 0;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 5px 4px;
}

.workGrid {
  border-left: 1px solid #222;
  border-right: 1px solid #222;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.workCell {
  align-items: center;
  border-bottom: 1px solid #222;
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 13px;
  min-height: 54px;
  padding: 5px 4px;
}

.workCell label {
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.22;
}

.workCell.activeWork {
  background: #fff2b8;
}

.tinyBox {
  appearance: none;
  background: #fff;
  border: 1px solid #222;
  flex: 0 0 auto;
  height: 12px;
  margin: 0;
  width: 12px;
}

.tinyBox:checked {
  background:
    linear-gradient(45deg, transparent 42%, #111 42%, #111 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, #111 42%, #111 58%, transparent 58%),
    #fff;
}

.labor {
  align-items: center;
  border: 1px solid #222;
  border-top: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto auto;
  min-height: 31px;
  padding: 5px 4px;
}

.labor strong {
  font-size: 0.82rem;
}

.inlineCheck {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.dataGrid {
  border-left: 1px solid #222;
  border-top: 1px solid #222;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
}

.dataCell {
  border-bottom: 1px solid #222;
  border-right: 1px solid #222;
  min-height: 35px;
  padding: 4px;
}

.dataCell.full {
  grid-column: 1 / -1;
  min-height: 64px;
}

.dataCell label {
  display: block;
  font-size: 0.6rem;
  font-weight: 900;
  margin-bottom: 4px;
}

input.line,
textarea.line {
  border: 0;
  border-bottom: 1px solid #999;
  min-height: 18px;
  outline: none;
  padding: 0;
  width: 100%;
}

textarea.line {
  min-height: 38px;
  resize: vertical;
}

.sectionTitle {
  border: 1px solid #222;
  font-size: 1rem;
  font-weight: 900;
  margin: 9px 0 0;
  padding: 4px;
}

.checkList {
  border: 1px solid #222;
  border-top: 0;
  padding: 6px 4px;
}

.checkRow {
  align-items: flex-start;
  background: #fff;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 6px;
  grid-template-columns: 13px 1fr;
  min-height: 28px;
  padding: 3px 0;
  text-align: left;
  width: 100%;
}

.checkRow span {
  font-size: 0.7rem;
  line-height: 1.25;
}

.evidenceRow {
  border-bottom: 1px solid #d7d7d7;
  grid-template-columns: 13px 1fr auto;
  padding: 6px 0;
}

.evidenceRow:last-child {
  border-bottom: 0;
}

.evidenceRow.hasEvidence {
  background: #e6f6e8;
}

.evidenceRow em {
  color: #4f5b55;
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  text-align: right;
}

.workers {
  border-left: 1px solid #222;
  border-top: 1px solid #222;
  display: grid;
  grid-template-columns: 0.95fr 1.45fr;
  margin-top: 10px;
}

.workerHead,
.workerCell {
  border-bottom: 1px solid #222;
  border-right: 1px solid #222;
  min-height: 30px;
}

.workerHead {
  align-items: center;
  display: flex;
  font-size: 0.64rem;
  font-weight: 900;
  justify-content: center;
  padding: 5px;
  text-align: center;
}

.workerCell {
  min-height: 38px;
  padding: 2px;
}

.workerCell input {
  border: 0;
  font: inherit;
  height: 100%;
  min-height: 32px;
  outline: none;
  padding: 3px;
  width: 100%;
}

.imageUpload {
  border-left: 1px solid #222;
  border-top: 1px solid #222;
  margin-top: 10px;
}

.imageHead {
  border-bottom: 1px solid #222;
  border-right: 1px solid #222;
  font-size: 0.66rem;
  font-weight: 900;
  padding: 6px 5px;
  text-align: center;
}

.imagePicker {
  align-items: center;
  border-bottom: 1px solid #222;
  border-right: 1px solid #222;
  display: flex;
  gap: 8px;
  min-height: 38px;
  padding: 6px;
}

.imagePicker span {
  background: #f2f4f3;
  border: 1px solid #222;
  cursor: pointer;
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 6px 8px;
}

.imagePicker input {
  font-size: 0.62rem;
  min-width: 0;
  width: 100%;
}

.imageMessage {
  color: #8a1f11;
  font-size: 0.66rem;
  font-weight: 700;
  min-height: 20px;
  padding: 4px 6px;
}

.imagePreview {
  border-right: 1px solid #222;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  min-height: 72px;
  padding: 6px;
}

.imageItem {
  border: 1px solid #222;
  margin: 0;
  padding: 4px;
}

.imageItem img {
  display: block;
  max-height: 260px;
  object-fit: contain;
  width: 100%;
}

.imageItem figcaption {
  font-size: 0.62rem;
  line-height: 1.2;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.imageItem button {
  background: #fff;
  border: 1px solid #222;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 900;
  margin-top: 5px;
  padding: 4px 6px;
}

.modal[hidden] {
  display: none;
}

.modal {
  align-items: center;
  background: rgba(0, 0, 0, 0.42);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 16px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 10;
}

.modalPanel {
  background: #fff;
  border: 1px solid #222;
  max-width: 460px;
  padding: 12px;
  width: 100%;
}

.modalPanel h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}

.modalPanel p {
  border: 1px solid #d5d5d5;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 10px;
  padding: 8px;
}

.evidencePreview {
  border: 1px solid #d5d5d5;
  min-height: 76px;
  padding: 6px;
}

.evidencePreview img {
  display: block;
  max-height: 240px;
  object-fit: contain;
  width: 100%;
}

.evidencePreview span {
  display: block;
  font-size: 0.62rem;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.modalActions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 10px;
}

.modalActions button,
.submitArea button {
  background: #fff;
  border: 1px solid #222;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 900;
  min-height: 34px;
  padding: 7px 8px;
}

#saveEvidence,
#submitAptos {
  background: #d9f0df;
}

.submitArea {
  border: 1px solid #222;
  margin-top: 10px;
  padding: 8px;
}

.submitArea button {
  width: 100%;
}

.submitMessage {
  color: #285c36;
  font-size: 0.72rem;
  font-weight: 900;
  min-height: 18px;
  padding-top: 6px;
  text-align: center;
}

@media (min-width: 460px) {
  .workGrid {
    grid-template-columns: repeat(4, 1fr);
  }

  .imagePreview {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 459px) {
  .evidenceRow {
    grid-template-columns: 13px 1fr;
  }

  .evidenceRow em {
    grid-column: 2;
    text-align: left;
  }

  .modalActions {
    grid-template-columns: 1fr;
  }
}

@media print {
  :root {
    background: #fff;
  }

  .sheet {
    max-width: none;
  }

  .imagePicker,
  .imageMessage,
  .imageItem button,
  .modal,
  .submitArea {
    display: none;
  }
}
