* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #213127;
  background: #f6f4ef;
  font-family: Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: #ffffff;
  border-bottom: 1px solid #dedbd1;
}

.brand {
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 16px;
}

nav a {
  text-decoration: none;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.page-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-title p,
.muted {
  color: #667067;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 24px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #dedbd1;
  border-radius: 8px;
}

input,
select,
textarea,
button {
  width: 100%;
  font: inherit;
}

input,
select,
textarea {
  padding: 9px 10px;
  color: #213127;
  background: #ffffff;
  border: 1px solid #c9c5bb;
  border-radius: 6px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

button {
  width: auto;
  padding: 9px 14px;
  color: #ffffff;
  background: #2f6f4e;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.filters input,
.filters select {
  width: auto;
  min-width: 180px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.card {
  overflow: hidden;
  min-height: 250px;
  color: inherit;
  background: #ffffff;
  border: 1px solid #dedbd1;
  border-radius: 8px;
  text-decoration: none;
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e6e2d8;
}

.card-body {
  padding: 12px;
}

.card h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.card p {
  margin: 0;
  color: #667067;
  font-size: 14px;
}

.detail {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 28px;
  margin-top: 18px;
  margin-bottom: 28px;
}

.detail img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 22px 0 0;
}

.facts div,
.sections > div,
.plan-item,
.flash {
  padding: 14px;
  background: #ffffff;
  border: 1px solid #dedbd1;
  border-radius: 8px;
}

dt {
  color: #667067;
  font-size: 13px;
}

dd {
  margin: 0;
  font-weight: 700;
}

.sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-header h2 {
  margin-bottom: 0;
}

.edit-form[hidden] {
  display: none;
}

.edit-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #dedbd1;
  border-radius: 8px;
}

.edit-form label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.edit-form textarea,
.edit-form button {
  grid-column: 1 / -1;
}

.plan-list {
  display: grid;
  gap: 10px;
}

.print-task-list {
  display: none;
}

.inline-action {
  margin-bottom: 18px;
}

.planned-seeds {
  margin-bottom: 24px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #dedbd1;
  border-radius: 8px;
}

.planned-seeds .section-header {
  margin-bottom: 10px;
}

.planned-seeds .section-header p {
  margin-bottom: 0;
}

.planned-seed-list {
  display: grid;
  gap: 8px;
}

.planned-seed-add {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.planned-seed-add label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.planned-seed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: #f9f8f4;
  border: 1px solid #dedbd1;
  border-radius: 6px;
}

.planned-seed a {
  font-weight: 700;
}

.planned-seed button {
  flex: 0 0 auto;
}

.print-heading {
  margin-bottom: 18px;
}

.print-heading p {
  color: #667067;
}

.calendar-list {
  display: grid;
  gap: 28px;
  margin-bottom: 30px;
}

.calendar-month {
  break-inside: avoid;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid #dedbd1;
  border-left: 1px solid #dedbd1;
  background: #ffffff;
}

.weekday,
.calendar-day {
  border-right: 1px solid #dedbd1;
  border-bottom: 1px solid #dedbd1;
}

.weekday {
  padding: 8px;
  color: #667067;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.calendar-day {
  min-height: 126px;
  padding: 7px;
  background: #ffffff;
}

.calendar-day.clickable-day {
  cursor: pointer;
}

.calendar-day.clickable-day:hover,
.calendar-day.clickable-day:focus {
  outline: 2px solid #2f6f4e;
  outline-offset: -2px;
  background: #fbfdfb;
}

.calendar-day.outside-month {
  background: #f3f1eb;
}

.calendar-day time,
.calendar-date {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  color: #667067;
  background: transparent;
  border-radius: 0;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.calendar-day time {
  color: #667067;
  padding-left: 0;
}

.calendar-event {
  display: block;
  margin-bottom: 5px;
  padding: 5px;
  color: inherit;
  background: #edf7ef;
  border-left: 3px solid #2f6f4e;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.25;
}

.calendar-event strong,
.calendar-event span {
  display: block;
  overflow-wrap: anywhere;
}

.calendar-more {
  display: block;
  padding: 5px;
  color: #667067;
  background: #f3f1eb;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.day-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.day-task-list {
  display: grid;
  gap: 18px;
}

.day-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.day-filters a {
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #dedbd1;
  border-radius: 6px;
  text-decoration: none;
}

.day-filters a.active {
  color: #ffffff;
  background: #2f6f4e;
  border-color: #2f6f4e;
}

.day-task {
  padding: 16px;
  background: #ffffff;
  border: 1px solid #dedbd1;
  border-radius: 8px;
}

.task-badge {
  align-self: start;
  padding: 6px 10px;
  color: #ffffff;
  background: #2f6f4e;
  border-radius: 6px;
  white-space: nowrap;
}

.planting-instructions {
  margin-top: 16px;
}

.planting-instructions p {
  margin-bottom: 10px;
}

.planting-list {
  display: grid;
  gap: 8px;
}

.planting-list a {
  display: grid;
  gap: 2px;
  padding: 9px;
  color: inherit;
  background: #f9f8f4;
  border: 1px solid #dedbd1;
  border-radius: 6px;
  text-decoration: none;
}

.planting-list span {
  color: #667067;
  font-size: 14px;
}

.add-to-tray {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #dedbd1;
}

.add-to-tray label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.print-map-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.tray-print-sheet {
  background: #ffffff;
}

.tray-print-sheet header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.tray-print-sheet h1,
.tray-print-sheet p {
  margin-bottom: 0;
}

.tray-print-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tray-print-cell {
  position: relative;
  min-height: 190px;
  padding: 12px;
  background: #ffffff;
  border: 2px solid #213127;
  border-radius: 8px;
}

.tray-print-cell::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: var(--flag-color);
  border-bottom-left-radius: 8px;
  content: "";
}

.print-cell-header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 8px;
  padding-right: 22px;
}

.print-cell-header strong {
  font-size: 18px;
}

.print-cell-header span {
  color: #667067;
  font-size: 13px;
}

.tray-print-cell h2 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.15;
}

.tray-print-cell p {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.25;
}

.tray-section {
  margin-bottom: 30px;
}

.tray-name {
  display: grid;
  gap: 5px;
  max-width: 360px;
  margin-bottom: 14px;
  font-weight: 700;
}

.tray-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 640px), 1fr));
  gap: 20px;
}

.tray-card {
  padding: 18px;
  color: inherit;
  background: #ffffff;
  border: 1px solid #dedbd1;
  border-radius: 8px;
}

.tray-card h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.tray-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.icon-link {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #c9c5bb;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
}

.tray-card p {
  margin-bottom: 6px;
  color: #667067;
}

.tray-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tray-preview a,
.tray-preview .empty-cell {
  display: grid;
  position: relative;
  align-content: start;
  gap: 5px;
  aspect-ratio: 1 / 1;
  min-height: 132px;
  overflow: hidden;
  padding: 12px;
  color: inherit;
  background: #f9f8f4;
  border: 3px solid #dedbd1;
  border-radius: 6px;
  text-decoration: none;
}

.tray-preview a {
  border-color: #4f9b62;
  background: #e9f8ed;
}

.tray-preview a.waiting {
  border-color: #d5b12f;
  background: #fff8cf;
}

.tray-preview a.late {
  border-color: #c53b2f;
  background: #ffe7e2;
}

.tray-preview a.ready {
  border-color: #2d6fb2;
  background: #e2f0ff;
}

.tray-preview a.uppotted {
  border-color: #73777d;
  background: #eeeeee;
}

.tray-preview a::before,
.tray-cell:not(.empty)::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background: var(--flag-color);
  border-bottom-left-radius: 6px;
  content: "";
}

.tray-preview strong {
  font-size: 15px;
}

.tray-preview span {
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tray-preview .seed-name {
  font-weight: 700;
}

.tray-preview a span:not(.seed-name) {
  font-size: 12px;
}

.tray-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.tray-cell {
  display: grid;
  position: relative;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  background: #ffffff;
  border: 2px solid #dedbd1;
  border-radius: 8px;
}

.tray-cell.empty {
  background: #f9f8f4;
}

.tray-cell.waiting {
  border-color: #d2a94d;
}

.tray-cell.sprouted {
  border-color: #4f9b62;
}

.tray-cell.ready {
  border-color: #3971a8;
}

.tray-cell.late {
  border-color: #b84a3a;
}

.tray-cell.uppotted {
  border-color: #8b8f96;
  background: #f2f3f3;
}

.cell-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
  padding-right: 18px;
}

.cell-header span {
  font-size: 13px;
  text-align: right;
}

.status-badge {
  padding: 3px 7px;
  color: #213127;
  background: #f3f1eb;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.2;
}

.tray-cell.sprouted .status-badge {
  color: #245c35;
  background: #dff2e4;
}

.tray-cell.late .status-badge {
  color: #8f2d22;
  background: #ffe2dc;
}

.tray-cell.waiting .status-badge {
  color: #735c17;
  background: #fff3c0;
}

.tray-cell.ready .status-badge {
  color: #245681;
  background: #dceeff;
}

.tray-cell.uppotted .status-badge {
  color: #545961;
  background: #e5e6e8;
}

.tray-cell label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
}

.tray-cell select,
.tray-cell input,
.tray-cell textarea {
  min-width: 0;
  padding: 7px;
  font-size: 14px;
}

.tray-cell input[type="color"] {
  width: 54px;
  height: 34px;
  padding: 3px;
}

.flag-field {
  align-items: start;
}

.tray-cell textarea {
  min-height: 58px;
}

.tray-cell p {
  margin-bottom: 0;
  color: #667067;
  font-size: 13px;
}

.save-tray {
  margin-bottom: 20px;
}

.plan-item {
  display: grid;
  grid-template-columns: 150px 150px 1fr;
  gap: 12px;
  text-decoration: none;
}

.flash {
  margin-bottom: 18px;
  border-color: #9fc5a8;
  background: #edf7ef;
}

@media (max-width: 700px) {
  .site-header,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .detail,
  .plan-item,
  .add-to-tray,
  .planned-seed-add {
    grid-template-columns: 1fr;
  }

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

  .filters input,
  .filters select,
  .filters button {
    width: 100%;
  }
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
    font-size: 11px;
  }

  .site-header,
  .filters,
  .calendar-list,
  .day-actions,
  .day-filters,
  .add-to-tray,
  .planned-seeds,
  .print-map-actions,
  main > h1,
  .flash {
    display: none;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .print-heading {
    margin-bottom: 10px;
  }

  .print-task-list {
    display: block;
  }

  .print-task-list h2 {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .print-task {
    display: grid;
    grid-template-columns: 90px 110px 1fr;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #cccccc;
    break-inside: avoid;
  }

  .calendar-list {
    gap: 16px;
    margin-bottom: 0;
  }

  .calendar-month {
    page-break-inside: avoid;
  }

  .calendar-month h2 {
    margin-bottom: 6px;
    font-size: 16px;
  }

  .weekday {
    padding: 4px;
    font-size: 10px;
  }

  .calendar-day {
    min-height: 92px;
    padding: 4px;
  }

  .calendar-event {
    padding: 3px;
    background: #ffffff;
    border: 1px solid #999999;
    border-left: 3px solid #000000;
    font-size: 9px;
  }

  .calendar-date,
  .calendar-day time {
    padding: 0;
    color: #000000;
    background: transparent;
    font-size: 10px;
  }

  .calendar-more {
    display: block;
    padding: 3px;
    background: #ffffff;
    border: 1px solid #999999;
    font-size: 9px;
  }

  .day-task {
    break-inside: avoid;
    padding: 10px 0;
    border: 0;
    border-top: 1px solid #999999;
    border-radius: 0;
  }

  .day-task .section-header a {
    display: none;
  }

  .task-badge {
    color: #000000;
    background: #ffffff;
    border: 1px solid #000000;
  }

  .facts div {
    padding: 6px;
    border-color: #999999;
  }

  .tray-print-sheet header {
    margin-bottom: 8px;
  }

  .tray-print-sheet header h1 {
    font-size: 18px;
  }

  .tray-print-grid {
    gap: 8px;
  }

  .tray-print-cell {
    min-height: 145px;
    padding: 8px;
    border-color: #000000;
    break-inside: avoid;
  }

  .tray-print-cell h2 {
    font-size: 13px;
  }

  .tray-print-cell p,
  .print-cell-header span {
    font-size: 10px;
  }

  .print-cell-header strong {
    font-size: 14px;
  }

  a {
    text-decoration: none;
  }
}
