/* The paper sheet, shared by the edit screen and the printed page.
   Sizes are in em so the print code can shrink a whole page by changing one font-size. */

.sheet-page {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  background: #fff;
  color: #000;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 11px;
  line-height: 1.25;
}

.sheet-page *,
.sheet-page *::before {
  box-sizing: border-box;
}

.sheet-row {
  display: flex;
  align-items: baseline;
  gap: 1em;
}

.field-label {
  font-size: 0.85em;
  font-weight: 700;
  white-space: nowrap;
}

.field-value {
  min-width: 0;
  font: inherit;
  color: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.line-field {
  display: flex;
  flex: var(--grow, 1) 1 0;
  align-items: baseline;
  gap: 0.4em;
  min-width: 0;
}

.line-field > .field-value {
  flex: 1;
  min-height: 1.4em;
  border-bottom: 1px solid #000;
}

.block-field {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.2em;
  min-width: 0;
}

.block-field > .field-value {
  flex: 1;
  min-height: 1.25em;
}

/* Boxes */

.box-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: 1fr 1.25fr;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
}

.box {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  min-width: 0;
  padding: 0.6em;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}

.box > .line-field {
  flex: 0 0 auto;
}

/* Page two */

.page-two-body {
  display: flex;
  flex: 1;
  gap: 0.7em;
}

.notes-box {
  flex: 0 0 28%;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
}

.days-grid {
  display: grid;
  flex: 1;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-template-rows: 3fr 2.3fr auto 1.3fr;
  min-width: 0;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
}

.day-cell {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  min-width: 0;
  padding: 0.6em;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}

.day-header {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
}

.day-header > .line-field {
  flex: 1;
}

.day-number {
  font-size: 0.85em;
  font-weight: 700;
  white-space: nowrap;
}

.day-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 0.8em;
  font-size: 0.85em;
  font-weight: 700;
}

.day-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.printed-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  border: 1px solid #000;
  line-height: 1;
}

/* Edit screen */

.sheet-editable textarea.field-value {
  width: 100%;
  margin: 0;
  padding: 0.1em 0.2em;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: none;
  field-sizing: content;
}

.sheet-editable .line-field > textarea.field-value {
  border-bottom: 1px solid #000;
}

.sheet-editable .field-value:hover,
.sheet-editable .field-value:focus {
  background: var(--field-tint, #e8f1ed);
}

.sheet-editable .box-grid {
  grid-template-rows: minmax(22em, auto) minmax(30em, auto);
}

.sheet-editable .notes-box {
  flex-basis: 22%;
}

.sheet-editable .days-grid {
  grid-auto-columns: 19em;
  grid-template-rows: minmax(20em, auto) minmax(15em, auto) auto minmax(8em, auto);
  overflow-x: auto;
}

.day-counter .date-input,
.day-counter .manual-count-input {
  min-width: 0;
  padding: 0 0.2em;
  border: 0;
  border-bottom: 1px solid #000;
  background: transparent;
  font: inherit;
  color: inherit;
}

.day-counter .manual-count-input {
  flex: 1;
  width: 4em;
}

.calculated-count {
  font-weight: 700;
  white-space: nowrap;
}
