#schedule {
  --schedule-line: #d6e4c6;
}
#schedule .paper {
  border-color: var(--schedule-line);
}
.schedule-header {
  background: #edf6dc;
}
.schedule-header > p:first-of-type {
  color: #36583f;
}
.schedule-actions, .schedule-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}
.schedule-actions label {
  margin: 0;
}
#schedule-year {
  width: 8rem;
}
#schedule-status:empty, #crop-error:empty, #growth-error:empty {
  display: none;
}
#schedule-status {
  margin: 10px 0 0;
}
.schedule-legend span, #schedule-table td span, .work-item span, .crop-periods dt {
  border-radius: 6px;
  padding: 2px 5px;
}
.sow { background: #e1efb2; color: #344808; }
.nursery { background: #ccecd8; color: #184b37; }
.harvest { background: #ffe6ad; color: #593909; }
.schedule-hint {
  color: #455641;
  font-size: .88rem;
}
.schedule-scroll {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--schedule-line);
  border-radius: 8px;
}
#schedule-table {
  border-spacing: 0;
  width: 100%;
  min-width: 895px;
  font-size: .8rem;
  text-align: center;
}
#schedule-table :is(th, td) {
  border-bottom: 1px solid var(--schedule-line);
  padding: 6px 4px;
  vertical-align: top;
}
#schedule-table td span {
  display: block;
  white-space: nowrap;
  margin: 2px 0;
}
#schedule-table th {
  background: #f1f7e8;
}
#schedule-table tr > :first-child {
  position: sticky;
  left: 0;
  width: 115px;
  padding-inline: 7px;
  text-align: left;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.work-item, .schedule-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.work-item {
  padding: 6px 0;
  margin: 0;
  min-height: 44px;
  border-top: 1px solid var(--schedule-line);
}
.work-item small {
  font-weight: normal;
}
.work-done span {
  text-decoration: line-through;
}
.crop-card {
  border-top: 1px solid var(--schedule-line);
  padding-block: 12px;
}
.crop-periods {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 8px;
  margin: 8px 0;
  align-items: start;
}
.crop-periods dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.growth-entry {
  margin: 8px 0 0;
  border-radius: 8px;
  background: #f3f8ec;
  padding: 10px;
}
.growth-entry img, #growth-preview {
  display: block;
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 8px;
}
.growth-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(88px,1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
.photo-grid:empty { display: none; }
.photo-edit-grid { grid-template-columns: repeat(auto-fill,minmax(136px,1fr)); }
.photo-tile {
  width: 100%;
  padding: 0;
  overflow: hidden;
  display: block;
}
.photo-tile img, .growth-entry .photo-tile img {
  width: 100%;
  max-height: none;
  aspect-ratio: 1;
  margin: 0;
  display: block;
  object-fit: cover;
}
.photo-edit-grid label { font-size: .85rem; margin-top: 6px; }
.photo-edit-grid input { font-size: .8rem; }
#photo-viewer { width: min(96%, 1000px); padding: 12px; }
#photo-enlarged {
  display: block;
  width: 100%;
  max-height: 72dvh;
  object-fit: contain;
  margin-top: 8px;
}
#more-records { margin-top: 12px; }
