:root {
  --paper: #faf6ef;
  --paper-deep: #f1e9dc;
  --ink: #243124;
  --green: #3d5a3a;
  --green-soft: #dce8d7;
  --planned: #4f7d70;
  --planned-soft: #d8ebe5;
  --candidate: #9b9588;
  --candidate-soft: #f0ece3;
  --terracotta: #d4622a;
  --terracotta-soft: #f3d3c3;
  --amber: #d49a28;
  --amber-soft: #f2e2bb;
  --line-f: #8a8a8a;
  --line-m: #5b8a4a;
  --rule: #c9bdab;
  --focus: #1b4c77;
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
}

a {
  color: var(--green);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.8rem max(1rem, env(safe-area-inset-left));
  background: rgb(250 246 239 / 96%);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65rem;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

.wordmark span {
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.wordmark small {
  color: #536151;
  font-size: 0.75rem;
}

nav {
  display: flex;
  gap: 0.2rem;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

nav a {
  min-height: 44px;
  padding: 0.7rem 0.8rem;
  color: #465443;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--paper);
  background: var(--green);
}

.page-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 1.4rem 1rem 4rem;
}

.page-heading {
  margin-bottom: 1.8rem;
}

.page-heading h1,
.login-sheet h1,
.empty-sheet h1 {
  margin: 0;
  color: var(--green);
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.context-line {
  margin: 0 0 0.35rem;
  color: #566453;
  font-size: 0.82rem;
  font-weight: 700;
}

.heading-with-note,
.bed-heading {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.revision-note {
  margin: 0;
  color: #596456;
  font-size: 0.82rem;
}

.coherence-warning {
  margin: -0.6rem 0 1.2rem;
  padding: 0.8rem 0.9rem;
  background: #fffdf9;
  border: 2px solid var(--terracotta);
  border-radius: 8px;
}

.coherence-warning p {
  margin: 0;
}

.coherence-warning p + p {
  margin-top: 0.35rem;
}

.coherence-ack {
  margin: -0.6rem 0 1.2rem;
  padding: 0.65rem 0.8rem;
  color: #4f5b4d;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-left: 3px solid #899286;
  border-radius: 6px;
  font-size: 0.82rem;
}

.coherence-ack p {
  margin: 0;
}

.coherence-ack p + p {
  margin-top: 0.25rem;
}

.garden-block {
  margin-bottom: 2rem;
}

.row-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--green);
}

.row-label h2 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.row-label span {
  color: #606b5e;
  font-size: 0.78rem;
}

.garden-scroll,
.rotation-scroll,
.calendar-scroll,
.table-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.bed-map {
  display: grid;
  gap: 0.45rem;
  min-width: 980px;
}

.bed-map-10 {
  grid-template-columns: repeat(10, minmax(90px, 1fr));
}

.bed-map-8 {
  grid-template-columns: repeat(8, minmax(112px, 1fr));
}

.bed-tile {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  padding: 0.65rem;
  color: var(--ink);
  border: 2px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 160ms ease-out, border-color 160ms ease-out;
}

.bed-tile:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.status-sembrado,
.status-plantado {
  background: var(--green-soft);
  border-color: var(--green);
}

.status-plantando {
  background: #e9e6c8;
  border-color: #728443;
}

.status-planificado {
  background: var(--planned-soft);
  border-color: var(--planned);
}

.status-candidato {
  background: var(--candidate-soft);
  border-color: var(--candidate);
}

.status-paso_sin_asignar,
.status-pendiente {
  background: var(--amber-soft);
  border-color: var(--amber);
}

.status-revisar_destino {
  background: var(--terracotta-soft);
  border-color: var(--terracotta);
}

.status-perenne {
  background: #ece9e2;
  border-color: #8a8478;
}

.bed-id {
  color: var(--green);
  font-size: 1.18rem;
  font-weight: 800;
}

.paso-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.2rem;
  padding: 0.15rem 0.42rem;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 730;
  line-height: 1.35;
}

.paso-badge.large {
  margin: 0;
  padding: 0.28rem 0.65rem;
  font-size: 0.76rem;
}

.queen-label {
  margin-top: auto;
  color: #576255;
  font-size: 0.65rem;
}

.bed-tile strong {
  font-size: 0.82rem;
  line-height: 1.2;
}

.bed-tile small {
  margin-top: 0.22rem;
  color: #536151;
  font-size: 0.68rem;
}

.garden-groups {
  display: grid;
  gap: 1.6rem;
}

.bed-map-group {
  display: grid;
  gap: 0.4rem;
}

.bed-row-head {
  display: none;
}

.bed-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 1.25rem;
  min-height: 88px;
  padding: 0.65rem;
  color: var(--ink);
  border-width: 1px;
  border-style: solid;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 160ms ease-out, transform 160ms ease-out;
}

.bed-row:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.bed-row-id {
  display: flex;
  grid-row: 1 / 4;
  flex-direction: column;
  padding-right: 0.55rem;
}

.bed-row-id strong {
  color: var(--green);
  font-size: 1.08rem;
}

.bed-row-id small,
.bed-row-value {
  color: #536151;
  font-size: 0.7rem;
}

.bed-row-value {
  grid-column: 2;
  padding: 0.12rem 0;
}

.mobile-column-label {
  display: inline-block;
  min-width: 4.1rem;
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bed-row-change {
  font-weight: 700;
}

.bed-row-alert {
  display: inline-flex;
  grid-column: 3;
  grid-row: 1 / 4;
  width: 1.15rem;
  height: 1.15rem;
  align-self: center;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--terracotta);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.status-legend,
.calendar-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  color: #4f5b4d;
  font-size: 0.78rem;
}

.status-legend {
  display: grid;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.status-legend span {
  display: grid;
  grid-template-columns: 0.9rem auto 1fr;
  align-items: baseline;
  gap: 0.25rem;
}

.status-legend i,
.calendar-key i {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.28rem;
  border-radius: 3px;
  vertical-align: -0.08rem;
}

.legend-seeded,
.legend-planted { background: var(--green); }
.legend-planting { background: #728443; }
.legend-planned { background: var(--planned); }
.legend-candidate { background: var(--candidate); }
.legend-pending { background: var(--amber); }
.legend-review { background: var(--terracotta); }
.legend-perennial { background: #8a8478; }

.back-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-bottom: 0.55rem;
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}

.bed-heading-meta {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.notes-sheet,
.empty-sheet,
.login-sheet {
  padding: 1rem;
  background: #fffdf9;
  border: 1px solid var(--rule);
  border-radius: 10px;
}

.notes-sheet h2,
.section-block h2,
.empty-sheet h2 {
  margin: 0 0 0.75rem;
  color: var(--green);
  font-size: 1.05rem;
}

.notes-sheet p {
  max-width: 65ch;
  margin: 0 0 0.8rem;
}

.notes-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.notes-heading h2 {
  margin-bottom: 0.55rem;
}

.notes-editor {
  position: relative;
  margin-top: -0.45rem;
}

.notes-editor form {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 0.65rem;
  width: min(420px, calc(100vw - 3rem));
  padding: 0.85rem;
  background: #fffdf9;
  border: 1px solid var(--green);
  border-radius: 8px;
  box-shadow: 0 6px 8px rgb(36 49 36 / 14%);
}

.notes-editor label {
  color: #4f5b4d;
  font-size: 0.72rem;
  font-weight: 700;
}

.notes-editor textarea {
  min-height: 7rem;
  padding: 0.55rem 0.6rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--green);
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}

.compact-success {
  width: fit-content;
  margin: 0 0 0.7rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
}

.step-note {
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  color: #4b5948;
  font-size: 0.88rem;
}

.section-block {
  margin-bottom: 2.2rem;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  background: #fffdf9;
  font-size: 0.82rem;
}

th,
td {
  padding: 0.72rem;
  border-bottom: 1px solid #d7cec0;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--green);
  background: var(--paper-deep);
  font-size: 0.72rem;
  white-space: nowrap;
}

.line-chip {
  display: inline-block;
  min-width: 2rem;
  padding: 0.18rem 0.38rem;
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  text-align: center;
}

.pattern-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.pattern-chip {
  padding: 0.12rem 0.36rem;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 750;
}

.kind-F { background: var(--line-f); }
.kind-M { background: var(--line-m); }
.kind-Q { background: var(--terracotta); }
.kind-I { background: #4c4b48; }

.weekly-group ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

.step-number {
  display: inline-grid;
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--terracotta);
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 800;
}

.calendar-key {
  margin-bottom: 1rem;
}

.key-line.key-f { background: var(--line-f); }
.key-line.key-m { background: var(--line-m); }
.key-line.key-q { background: var(--terracotta); }
.key-shoulder { background: #e9ddc8; }
.calendar-key .key-relevo {
  width: 3px;
  background: var(--terracotta);
  border-radius: 0;
}

.calendar-board {
  min-width: 880px;
  padding-bottom: 1rem;
}

.month-axis {
  display: grid;
  grid-template-columns: 130px repeat(12, 1fr);
  margin-bottom: 0.5rem;
  padding-right: 0.2rem;
  color: #5d685b;
  font-size: 0.7rem;
}

.month-axis::before {
  content: "";
}

.month-axis span {
  text-align: left;
}

.month-axis b {
  position: absolute;
  right: 0;
  font-weight: 600;
}

.calendar-bed,
.nursery-lane {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
}

.calendar-bed > header,
.nursery-lane > header {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}

.calendar-bed h2,
.nursery-lane h2 {
  margin: 0;
  color: var(--green);
  font-size: 1rem;
}

.calendar-bed h2 a {
  text-decoration: none;
}

.calendar-bed header span,
.nursery-lane header span {
  color: #5a6757;
  font-size: 0.76rem;
}

.calendar-line {
  display: grid;
  grid-template-columns: 130px 1fr;
  min-height: 31px;
  align-items: center;
}

.calendar-line-name {
  padding-right: 0.6rem;
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-track {
  position: relative;
  height: 24px;
  border-bottom: 1px solid #d6ccbd;
}

.month-shades {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}

.month-shades i {
  border-left: 1px solid #e1d9cc;
}

.month-shades i:last-child {
  border-right: 1px solid #e1d9cc;
}

.month-shades .shoulder {
  background: #e9ddc8;
}

.crop-bar {
  position: absolute;
  top: 4px;
  z-index: 2;
  height: 16px;
  min-width: 4px;
  padding: 0 0.28rem;
  overflow: hidden;
  color: #fff;
  border-radius: 3px;
  font-size: 0.62rem;
  font-style: normal;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exit-marker {
  position: absolute;
  top: 2px;
  z-index: 3;
  width: 2px;
  height: 20px;
  background: var(--ink);
}

.relevo-marker {
  position: absolute;
  top: 0;
  z-index: 4;
  width: 3px;
  height: 24px;
  background: var(--terracotta);
}

.nursery-lane {
  padding: 0.8rem;
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: 8px;
}

.nursery-track {
  height: 38px;
}

.nursery-marker {
  position: absolute;
  top: 4px;
  z-index: 3;
  width: 7px;
  height: 24px;
  background: var(--green);
  border-radius: 2px;
}

.nursery-marker span {
  position: absolute;
  top: 25px;
  left: 50%;
  color: var(--green);
  font-size: 0.55rem;
  font-style: normal;
  transform: translateX(-50%);
}

.weekly-groups {
  display: grid;
  gap: 1.2rem;
}

.weekly-group {
  padding-top: 0.25rem;
}

.weekly-group h2 {
  margin: 0;
  padding-bottom: 0.45rem;
  color: var(--green);
  border-bottom: 2px solid var(--green);
  font-size: 1.05rem;
}

.weekly-group h2 a {
  text-decoration: none;
}

.weekly-group li {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}

.weekly-group time {
  color: var(--terracotta);
  font-size: 0.85rem;
  font-weight: 800;
}

.weekly-group p {
  margin: 0;
  font-size: 0.88rem;
}

.weekly-group li span {
  display: block;
  max-width: 72ch;
  margin-top: 0.18rem;
  color: #526050;
  font-size: 0.78rem;
}

.weekly-heading {
  gap: 0.8rem;
}

.week-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 720;
}

.weekly-checklist > h2,
.weekly-plain-section h2 {
  margin: 0;
  color: var(--green);
  font-size: 1.05rem;
}

.weekly-bed-group {
  margin-top: 0.9rem;
}

.weekly-bed-group h3 {
  margin: 0;
  padding: 0.35rem 0;
  border-bottom: 2px solid var(--green);
  font-size: 0.95rem;
}

.weekly-bed-group h3 a {
  text-decoration: none;
}

.field-task {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: 0.6rem;
  align-items: center;
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

.task-tick {
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 2px solid var(--green);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.field-task.is-done .task-tick {
  background: var(--green);
}

.field-task.is-done p {
  color: #687267;
  text-decoration: line-through;
}

.field-task p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  align-items: baseline;
  margin: 0;
  font-size: 0.83rem;
}

.field-task p span {
  color: #657062;
  font-size: 0.74rem;
}

.overdue-chip {
  padding: 0.08rem 0.38rem;
  color: #772d19 !important;
  background: var(--terracotta-soft);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.weekly-empty {
  margin: 0.7rem 0 0;
  color: #657062;
  font-size: 0.84rem;
}

.weekly-plain-section,
.next-week-preview {
  margin-top: 1.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}

.weekly-simple-list {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.weekly-simple-list li,
.weekly-simple-list a {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  justify-content: space-between;
  padding: 0.36rem 0;
  color: var(--ink);
  font-size: 0.8rem;
}

.weekly-simple-list li + li {
  border-top: 1px dotted var(--rule);
}

.weekly-simple-list a {
  width: 100%;
  padding: 0;
  text-decoration: none;
}

.weekly-simple-list span {
  color: #657062;
}

.next-week-preview summary {
  display: flex;
  justify-content: space-between;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.plant-bed-action {
  margin: 0 0 0.45rem;
}

.rotation-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  min-width: 980px;
  border: 2px solid var(--green);
  border-radius: 12px;
}

.rotation-step {
  position: relative;
  min-height: 420px;
  padding: 1rem;
  background: #fffdf9;
  border-left: 1px solid var(--rule);
}

.rotation-step:first-child {
  border-left: 0;
  border-radius: 9px 0 0 9px;
}

.rotation-step:last-child {
  border-radius: 0 9px 9px 0;
}

.rotation-step > header {
  display: flex;
  gap: 0.65rem;
  min-height: 136px;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
}

.rotation-step h2 {
  margin: 0;
  color: var(--green);
  font-size: 1.05rem;
}

.rotation-step header p {
  margin: 0.3rem 0 0;
  color: #566253;
  font-size: 0.72rem;
}

.step-beds {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.8rem;
}

.rotation-bed {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  justify-content: center;
  padding: 0.65rem;
  color: var(--ink);
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: 8px;
  text-decoration: none;
}

.rotation-bed:hover {
  background: #cadcc3;
}

.rotation-bed span {
  margin-top: 0.2rem;
  color: #52604f;
  font-size: 0.68rem;
}

.cycle-arrow {
  position: absolute;
  top: 1.25rem;
  right: -0.62rem;
  z-index: 2;
  display: grid;
  width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  color: #fff;
  background: var(--terracotta);
  border-radius: 50%;
  font-size: 0.78rem;
}

.rotation-step:last-child .cycle-arrow {
  transform: rotate(180deg);
}

.no-beds {
  color: #647061;
  font-size: 0.78rem;
}

.login-sheet {
  width: min(100%, 440px);
  margin: 8vh auto 0;
  padding: 1.4rem;
}

.login-sheet form {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.login-sheet label {
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 700;
}

.login-sheet input {
  min-height: 48px;
  padding: 0.7rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--green);
  border-radius: 7px;
  font: inherit;
}

.login-sheet button {
  min-height: 48px;
  margin-top: 0.35rem;
  padding: 0.7rem 1rem;
  color: #fff;
  background: var(--green);
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.login-sheet button:hover {
  background: #2f492d;
}

.form-error {
  margin: 0;
  color: #992f13;
  font-size: 0.82rem;
  font-weight: 650;
}

.empty-sheet {
  max-width: 680px;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.section-heading-row h2,
.section-heading-row p {
  margin: 0;
}

.section-heading-row p {
  max-width: 68ch;
  margin-top: 0.25rem;
  color: #556252;
  font-size: 0.8rem;
}

.section-title-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}

.section-title-inline > a {
  font-size: 0.82rem;
  font-weight: 650;
}

.assigned-patterns {
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.actions-menu {
  position: relative;
  flex: 0 0 auto;
}

.actions-menu > summary,
.configuration-disclosure > summary,
.notes-editor > summary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.7rem;
  color: var(--green);
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
}

.actions-menu > summary::-webkit-details-marker,
.configuration-disclosure > summary::-webkit-details-marker,
.notes-editor > summary::-webkit-details-marker {
  display: none;
}

.actions-menu > summary:hover,
.actions-menu > summary:focus-visible,
.configuration-disclosure > summary:hover,
.configuration-disclosure > summary:focus-visible,
.notes-editor > summary:hover,
.notes-editor > summary:focus-visible,
.actions-menu[open] > summary {
  background: var(--green-soft);
}

.actions-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 20;
  overflow: auto;
  width: min(760px, calc(100vw - 2rem));
  max-height: min(72vh, 720px);
  padding: 0.35rem 1rem;
  background: #fffdf9;
  border: 1px solid var(--green);
  border-radius: 10px;
  box-shadow: 0 6px 8px rgb(36 49 36 / 14%);
}

.action-disclosure {
  padding: 0.35rem 0;
}

.action-disclosure + .action-disclosure {
  border-top: 1px solid var(--rule);
}

.action-disclosure > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
}

.action-disclosure > p {
  margin: 0 0 0.7rem;
  color: #536050;
  font-size: 0.8rem;
}

.assignment-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 1rem;
  margin-bottom: 0.8rem;
  color: #536050;
  font-size: 0.78rem;
}

.assignment-meter strong {
  color: var(--ink);
}

.assignment-meter progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 0.65rem;
  accent-color: var(--green);
}

.assignment-form,
.metadata-editor form,
.actions-popover form {
  display: grid;
  gap: 0.8rem;
}

.assignment-rows {
  display: grid;
  gap: 0.45rem;
}

.assignment-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: end;
  padding: 0.7rem;
  background: #fffdf9;
  border: 1px solid var(--rule);
  border-radius: 7px;
}

.assignment-number {
  align-self: center;
  color: var(--terracotta);
  text-align: center;
}

.assignment-main-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(90px, 0.35fr) minmax(145px, 0.55fr);
  gap: 0.55rem;
}

.escalonado-fields {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin: 0;
  padding: 0.5rem 0 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.escalonado-fields legend {
  padding: 0 0.45rem 0 0;
  color: #4f5b4d;
  font-size: 0.7rem;
  font-weight: 750;
}

.escalonado-fields label {
  display: grid;
  grid-template-columns: auto 4.2rem auto;
  align-items: center;
  gap: 0.3rem;
}

.escalonado-fields input {
  min-height: 36px;
  padding: 0.35rem 0.45rem;
}

.escalonado-fields small {
  color: #667063;
  font-weight: 500;
}

.assignment-row label,
.assignment-controls label,
.metadata-editor label,
.actions-popover label {
  display: grid;
  gap: 0.25rem;
  color: #4f5b4d;
  font-size: 0.7rem;
  font-weight: 700;
}

.assignment-row select,
.assignment-row input,
.assignment-controls select,
.metadata-editor input,
.metadata-editor textarea,
.actions-popover input,
.actions-popover select,
.actions-popover textarea {
  min-height: 44px;
  padding: 0.55rem 0.6rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--green);
  border-radius: 6px;
  font: inherit;
}

.metadata-editor textarea,
.actions-popover textarea {
  min-height: 7rem;
  resize: vertical;
}

.assignment-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem;
}

.assignment-controls label {
  min-width: min(100%, 320px);
}

.button-secondary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.8rem;
  color: var(--green);
  background: transparent;
  border: 1px solid var(--green);
  border-radius: 7px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.button-secondary:hover {
  color: #fff;
  background: var(--green);
}

.button-secondary:disabled {
  color: #71786f;
  border-color: #9da49a;
  cursor: not-allowed;
}

.assignment-preview {
  margin-top: 1rem;
  padding: 0.9rem;
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: 8px;
}

.assignment-preview h3 {
  margin: 0 0 0.55rem;
  color: var(--green);
  font-size: 0.95rem;
}

.assignment-preview ol {
  margin: 0 0 0.8rem;
  padding-left: 1.4rem;
}

.assignment-preview li {
  padding: 0.2rem 0;
  font-size: 0.78rem;
}

.assignment-preview li span {
  margin-left: 0.4rem;
  color: #536050;
}

.form-error-box {
  margin: 0 0 0.8rem;
  padding: 0.7rem;
  background: var(--terracotta-soft);
  border: 1px solid var(--terracotta);
  border-radius: 7px;
}

.pattern-instances {
  display: grid;
  grid-template-columns: repeat(var(--instance-count), minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.pattern-mini {
  min-width: 0;
  padding: 0.38rem;
  background: #fffdf9;
}

.pattern-mini > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.25rem;
  padding-bottom: 0.28rem;
  border-bottom: 1px solid var(--rule);
}

.pattern-mini header span {
  color: #5e695b;
  font-size: clamp(0.5rem, 1.25vw, 0.65rem);
  white-space: nowrap;
}

.pattern-mini h3 {
  min-width: 0;
  margin: 0;
  font-size: clamp(0.72rem, 2vw, 1rem);
}

.mini-plan {
  margin: 0.28rem 0 0;
  overflow: hidden;
}

.mini-plan svg {
  width: 100%;
  height: auto;
}

.mini-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  margin: 0.22rem 0 0;
  padding-top: 0.25rem;
  border-top: 1px solid #ddd4c6;
  color: #536050;
  font-size: clamp(0.5rem, 1.15vw, 0.63rem);
}

.planting-summary td small {
  display: block;
  margin-top: 0.1rem;
  color: #667063;
  font-size: 0.66rem;
}

.assigned-notes {
  margin-top: 1rem;
}

.date-list {
  white-space: nowrap;
}

.rotation-timeline-section {
  margin-top: 2.2rem;
}

.rotation-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fffdf9;
  border: 1px solid var(--rule);
  border-radius: 10px;
  list-style: none;
}

.rotation-segment {
  position: relative;
  min-width: 0;
  padding: 1rem;
}

.rotation-segment + .rotation-segment {
  border-left: 1px solid var(--rule);
}

.rotation-segment:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 1.8rem;
  right: -1px;
  width: calc(100% - 1.9rem);
  border-top: 2px solid var(--green);
  content: "";
}

.rotation-segment header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.rotation-segment header > div {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  padding-right: 0.3rem;
  background: #fffdf9;
}

.rotation-paso-badge {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 1.65rem;
  align-items: center;
  padding: 0.22rem 0.5rem;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 780;
}

.rotation-segment header strong {
  color: var(--green);
  font-size: 0.9rem;
}

.rotation-season {
  color: #5b6758;
  font-size: 0.68rem;
  font-weight: 700;
}

.rotation-segment > p {
  display: grid;
  gap: 0.18rem;
  margin: 0;
  padding: 0.6rem 0;
  border-top: 1px solid #ddd4c6;
}

.rotation-segment > p > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #5b6758;
  font-size: 0.67rem;
}

.rotation-segment > p > strong {
  font-size: 0.78rem;
  line-height: 1.35;
}

.rotation-segment .confirmed-summer {
  margin: 0.2rem -0.45rem -0.45rem;
  padding: 0.6rem 0.45rem;
  background: var(--terracotta-soft);
  border: 1px solid var(--terracotta);
  border-radius: 7px;
}

.confirmed-summer small {
  padding: 0.1rem 0.35rem;
  color: #6f2d12;
  background: #fffdf9;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
}

.inline-empty {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.8rem;
  color: #536050;
  background: var(--paper-deep);
  border-radius: 7px;
  font-size: 0.8rem;
}

.inline-empty strong {
  color: var(--ink);
}

.measured-pattern {
  display: block;
  max-width: 100%;
  height: auto;
  color: var(--ink);
  font-family: "DejaVu Sans", Helvetica, Arial, sans-serif;
}

.module-outline,
.ruler line {
  fill: #fffdf9;
  stroke: #2c2c2a;
  stroke-width: 1;
}

.ruler line {
  fill: none;
}

.ruler text,
.line-id,
.distance-label,
.orientation {
  fill: #5f5e5a;
  font-size: 8px;
}

.line-guide {
  stroke: #888780;
  stroke-width: 0.65;
  stroke-dasharray: 2 3;
}

.irrigation-tape {
  stroke: #888780;
  stroke-width: 1.3;
  stroke-dasharray: 7 3;
}

.plant-symbol {
  fill: #fffdf9;
  stroke: #5f5e5a;
  stroke-width: 1;
}

.plant-symbol.class-Q {
  fill: #d85a30;
  stroke: #d85a30;
}

.plant-symbol.class-I {
  fill: #5f5e5a;
  stroke: #5f5e5a;
}

.measured-pattern-compact .ruler,
.measured-pattern-compact .distance-label,
.measured-pattern-compact .orientation {
  display: none;
}

.pattern-code {
  margin: 0 0 0.3rem;
  color: var(--terracotta);
  font-size: 0.78rem;
  font-weight: 800;
}

.pattern-library {
  border-top: 1px solid var(--green);
}

.pattern-library-item {
  display: grid;
  gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--rule);
}

.pattern-library-copy h2 {
  max-width: 34ch;
  margin: 0 0 0.65rem;
  color: var(--green);
  font-size: 1.25rem;
  line-height: 1.15;
}

.pattern-library-copy h2 a {
  text-decoration: none;
}

.pattern-library-copy > p:last-of-type {
  color: #536050;
  font-size: 0.8rem;
}

.library-plan {
  align-self: center;
  overflow: hidden;
}

.pattern-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.button-primary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.9rem;
  color: #fff;
  background: var(--green);
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button-primary:hover {
  background: #2f492d;
}

.pattern-hero {
  display: grid;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 2px solid var(--green);
}

.pattern-hero h1,
.species-hero h1 {
  max-width: 26ch;
  margin: 0;
  color: var(--green);
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.pattern-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0;
}

.pattern-hero-side {
  position: relative;
  display: grid;
  gap: 0.45rem;
}

.pattern-actions-menu {
  justify-self: end;
}

.pattern-stats div {
  padding-top: 0.35rem;
  border-top: 1px solid var(--rule);
}

.pattern-stats dt {
  color: #5a6757;
  font-size: 0.67rem;
}

.pattern-stats dd {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  font-weight: 760;
}

.compact-stats {
  max-width: 420px;
}

.pattern-page-actions {
  margin: 1rem 0 1.5rem;
}

.pattern-page-actions span {
  color: #596456;
  font-weight: 500;
}

.pattern-plan-layout {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.2rem;
}

.pattern-plan-layout h2,
.pattern-reading-grid h2,
.module-calendar h2,
.species-calendar h2,
.species-detail-grid h2,
.config-section h2,
.confirmation-sheet h2 {
  margin: 0 0 0.75rem;
  color: var(--green);
  font-size: 1.05rem;
}

.full-pattern-plan,
.line-instructions {
  min-width: 0;
}

.full-pattern-plan {
  width: min(100%, 540px);
}

.measured-plan-scroll {
  overflow-x: auto;
}

.line-instructions article {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
}

.line-instructions article p,
.line-instructions article b {
  margin: 0;
  font-size: 0.78rem;
}

.line-instructions article p {
  margin-top: 0.2rem;
  color: #536050;
}

.pattern-table {
  min-width: 760px;
}

.class-symbol.text-symbol {
  display: inline-grid;
  min-width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  font-size: 0.66rem;
  font-weight: 800;
}

.text-symbol.class-F { background: var(--line-f); }
.text-symbol.class-M { background: var(--line-m); }
.text-symbol.class-Q { background: var(--terracotta); }
.text-symbol.class-I { background: #4c4b48; }

.pattern-reading-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.metadata-editor {
  margin: 1rem 0;
  padding: 0.8rem;
  background: #fffdf9;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.metadata-editor summary {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

.metadata-editor form {
  margin-top: 0.8rem;
}

.instruction-editor > p {
  color: #536050;
  font-size: 0.8rem;
}

.llm-plan-comparison,
.assignment-comparison {
  display: grid;
  gap: 1rem;
}

.llm-plan-comparison {
  margin-bottom: 2rem;
}

.llm-plan-comparison article {
  min-width: 0;
  padding: 1rem;
  background: #fffdf9;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.llm-plan-comparison h2,
.assignment-comparison h4 {
  margin: 0 0 0.7rem;
  color: var(--green);
  font-size: 0.95rem;
}

.llm-diff table {
  min-width: 760px;
}

.llm-diff td {
  max-width: 34rem;
  overflow-wrap: anywhere;
}

.llm-save-choice form {
  display: grid;
  gap: 0.8rem;
}

.llm-save-choice label {
  display: grid;
  gap: 0.25rem;
  color: #4f5b4d;
  font-size: 0.78rem;
  font-weight: 700;
}

.llm-save-choice label:has(input[type="radio"]) {
  display: flex;
  align-items: center;
}

.llm-save-choice input:not([type]),
.llm-save-choice input[type="text"] {
  min-height: 44px;
  padding: 0.55rem 0.6rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--green);
  border-radius: 6px;
  font: inherit;
}

.llm-assignment-preview form {
  margin-top: 0.8rem;
}

.assignment-comparison > div {
  padding: 0.7rem;
  background: #fffdf9;
  border-radius: 6px;
}

.symbol-legend {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.symbol-legend li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.8rem;
}

.legend-symbol {
  display: inline-block;
  flex: 0 0 auto;
  border: 1.5px solid #5f5e5a;
  border-radius: 50%;
  background: #fffdf9;
}

.legend-symbol.class-F { width: 7px; height: 7px; }
.legend-symbol.class-M { width: 16px; height: 16px; }
.legend-symbol.class-Q { width: 28px; height: 28px; background: #d85a30; border-color: #d85a30; }
.legend-symbol.class-I { width: 12px; height: 12px; background: #5f5e5a; }

.pattern-note {
  max-width: 68ch;
  color: #536050;
  font-size: 0.78rem;
}

.module-calendar-rows {
  border-top: 1px solid var(--rule);
}

.module-calendar-row {
  display: grid;
  gap: 0.55rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

.module-calendar-row > header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.module-calendar-row h3,
.module-calendar-row p {
  margin: 0;
}

.module-calendar-row h3 {
  font-size: 0.95rem;
}

.module-calendar-row header p,
.date-range {
  color: #596456;
  font-size: 0.72rem;
}

.module-band-track {
  position: relative;
  height: 18px;
  background: var(--paper-deep);
  border-radius: 3px;
}

.module-band {
  position: absolute;
  inset: 3px auto 3px 0;
  border-radius: 2px;
}

.module-band-track > i {
  position: absolute;
  top: 1px;
  width: 2px;
  height: 16px;
  background: var(--ink);
}

.batch-arrows {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.batch-arrows span {
  padding: 0.22rem 0.42rem;
  color: #485545;
  background: var(--green-soft);
  border-radius: 4px;
  font-size: 0.68rem;
}

.view-tabs {
  display: inline-flex;
  gap: 0;
  margin-bottom: 1rem;
  overflow: visible;
  border: 1px solid var(--green);
  border-radius: 8px;
}

.view-tabs a {
  border-radius: 0;
}

.view-tabs a:first-child { border-radius: 6px 0 0 6px; }
.view-tabs a:last-child { border-radius: 0 6px 6px 0; }

.calendar-key .key-nursery { background: var(--amber); }
.calendar-key .key-bed { background: var(--green); }

.crop-calendar-row {
  border-bottom: 1px solid var(--rule);
}

.crop-calendar-row summary {
  display: grid;
  grid-template-columns: 130px 1fr;
  min-height: 52px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.crop-calendar-row summary::-webkit-details-marker {
  display: none;
}

.crop-calendar-name {
  display: flex;
  flex-direction: column;
  padding-right: 0.6rem;
  font-size: 0.78rem;
}

.crop-calendar-name::before {
  content: "+";
  float: left;
  width: 1rem;
  color: var(--terracotta);
  font-weight: 800;
}

.crop-calendar-row[open] .crop-calendar-name::before {
  content: "−";
}

.crop-calendar-name small,
.crop-instance-row small {
  display: block;
  color: #596456;
  font-size: 0.65rem;
}

.crop-summary-track {
  height: 32px;
}

.nursery-block,
.bed-block {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 2px;
}

.nursery-block {
  top: 3px;
  height: 9px;
  background: var(--amber);
}

.bed-block {
  bottom: 3px;
  height: 13px;
  background: var(--green);
}

.crop-instance-list {
  padding: 0.45rem 0 0.8rem 1rem;
  background: #fffdf9;
}

.crop-instance-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 38px;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
}

.crop-instance-track {
  height: 20px;
}

.species-family {
  margin-bottom: 2rem;
}

.species-table {
  min-width: 1100px;
}

.species-table td:first-child small,
.variety-line {
  display: block;
  margin-top: 0.16rem;
  color: #596456;
  font-size: 0.7rem;
}

.muted {
  color: #5f695d;
}

.month-band {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  width: 180px;
  height: 16px;
  border: 1px solid var(--rule);
}

.month-band i {
  border-right: 1px solid #ddd4c6;
}

.month-band i:last-child {
  border-right: 0;
}

.month-band .active {
  background: var(--green);
}

.month-band .nursery-active {
  background: var(--amber);
}

.species-hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 2px solid var(--green);
}

.species-hero p {
  max-width: 68ch;
}

.species-facts,
.record-list {
  margin: 0;
}

.species-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.species-facts div,
.farm-identity div {
  padding-top: 0.45rem;
  border-top: 1px solid var(--rule);
}

.species-facts dt,
.farm-identity span,
.record-list dt {
  color: #596456;
  font-size: 0.7rem;
}

.species-facts dd,
.record-list dd {
  margin: 0.12rem 0 0;
  font-weight: 700;
}

.species-calendar {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #fffdf9;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.month-labels,
.species-calendar-line {
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: center;
  gap: 0.7rem;
}

.month-labels::before {
  content: "";
}

.month-labels > span {
  display: none;
}

.month-labels {
  grid-template-columns: 145px repeat(12, 1fr);
  color: #596456;
  font-size: 0.65rem;
}

.month-labels > span {
  display: block;
  text-align: center;
}

.month-band.large {
  width: 100%;
  height: 24px;
}

.species-calendar-line {
  min-width: 620px;
  margin: 0.45rem 0;
  font-size: 0.76rem;
}

.species-calendar {
  overflow-x: auto;
}

.species-calendar > p {
  color: #596456;
  font-size: 0.75rem;
}

.species-detail-grid {
  display: grid;
  gap: 1.5rem;
}

.record-list div {
  padding: 0.55rem 0;
  border-top: 1px solid var(--rule);
}

.record-list dd {
  font-size: 0.82rem;
}

.variety-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.variety-list li {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0;
  border-top: 1px solid var(--rule);
}

.variety-list span {
  color: #596456;
  font-size: 0.75rem;
}

.farm-identity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

.farm-identity strong {
  display: block;
  margin-top: 0.12rem;
}

.configuration-form {
  display: grid;
  gap: 1.2rem;
  margin-top: 0.8rem;
}

.configuration-disclosure {
  margin-bottom: 2rem;
}

.config-group,
.config-add {
  margin: 0 0 1rem;
  padding: 1rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.confirmation-sheet {
  margin: 0 0 1rem;
  padding: 1rem;
  background: #fffdf9;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.config-group legend,
.config-add legend {
  padding: 0 0.4rem;
  color: var(--green);
  font-weight: 800;
}

.configuration-form label,
.config-group > label,
.config-add label {
  display: grid;
  gap: 0.25rem;
  color: #4f5b4d;
  font-size: 0.72rem;
  font-weight: 700;
}

.configuration-form input,
.configuration-form select {
  min-height: 44px;
  padding: 0.55rem 0.6rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--green);
  border-radius: 6px;
  font: inherit;
}

.config-group > label {
  max-width: 380px;
  margin-bottom: 0.8rem;
}

.config-bed-row {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
}

.config-bed-row > strong {
  color: var(--green);
}

.module-readout {
  align-self: end;
  padding-bottom: 0.7rem;
  color: #596456;
  font-size: 0.72rem;
}

.config-add-grid {
  display: grid;
  gap: 1rem;
}

.config-add {
  display: grid;
  gap: 0.7rem;
}

.form-success {
  padding: 0.75rem;
  color: #244522;
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: 7px;
  font-weight: 700;
}

.confirmation-sheet {
  max-width: 820px;
}

.confirm-group {
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
}

.confirm-group p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.confirm-group span {
  padding: 0.3rem 0.45rem;
  background: var(--paper-deep);
  border-radius: 4px;
  font-size: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shopping-sections {
  display: grid;
  gap: 1.1rem;
}

.shopping-section {
  margin: 0;
  border-top: 2px solid var(--green);
}

.shopping-supplier-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.1rem;
}

.shopping-supplier-heading h2 {
  margin: 0;
  color: var(--green);
  font-size: 0.95rem;
}

.shopping-supplier-heading h2 a {
  text-underline-offset: 0.16rem;
}

.shopping-supplier-heading span {
  color: #626d60;
  font-size: 0.68rem;
  white-space: nowrap;
}

.shopping-table-scroll {
  border: 1px solid var(--rule);
}

.shopping-table {
  min-width: 700px;
  font-size: 0.7rem;
}

.shopping-table th,
.shopping-table td {
  padding: 0.27rem 0.42rem;
  vertical-align: middle;
}

.shopping-table thead th {
  padding-block: 0.32rem;
  font-size: 0.64rem;
}

.shopping-table th:first-child {
  width: 31%;
}

.shopping-table th:nth-child(2) {
  width: 25%;
}

.shopping-table th:nth-child(3) {
  width: 15%;
}

.shopping-kind-row th {
  padding: 0.18rem 0.42rem;
  color: var(--paper);
  background: var(--green);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shopping-name a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.13rem;
}

.shopping-name small,
.shopping-format small {
  display: block;
  margin-top: 0.05rem;
  color: #657063;
  font-size: 0.61rem;
  font-weight: 500;
  line-height: 1.15;
}

.bed-chips,
.purchase-states {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
}

.bed-chips a {
  padding: 0.08rem 0.28rem;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  text-decoration: none;
}

.purchase-states form {
  margin: 0;
}

.purchase-state {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.32rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--green);
  border-radius: 999px;
  font: inherit;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.purchase-state:hover {
  background: var(--green-soft);
}

.purchase-state span {
  color: var(--terracotta);
  font-size: 0.72rem;
  line-height: 1;
}

.purchase-state small {
  color: inherit;
  font-size: 0.54rem;
  font-weight: 850;
}

.purchase-state.state-comprado,
.purchase-state.state-en_invernadero {
  background: var(--green-soft);
}

.purchase-state.state-en_invernadero {
  color: #fff;
  background: var(--green);
}

.purchase-state.state-en_invernadero span {
  color: #fff;
}

.production-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.2rem;
  margin-bottom: 0.75rem;
  color: #556252;
  font-size: 0.75rem;
}

.production-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.production-legend i,
.production-adjustment-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--terracotta);
  border-radius: 50%;
}

.production-save-status {
  min-height: 1.2rem;
  margin: -0.45rem 0 0.35rem;
  color: #52604f;
  font-size: 0.72rem;
}

.production-save-status:empty {
  min-height: 0;
  margin: 0;
}

.production-save-status.is-error {
  color: #992f13;
  font-weight: 700;
}

.production-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(70vh, 48rem);
  border-top: 1px solid var(--green);
  border-bottom: 1px solid var(--green);
  background: #fffdf9;
  overscroll-behavior: contain;
}

.production-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.78rem;
}

.production-table th,
.production-table td {
  padding: 0.48rem 0.55rem;
  border-bottom: 1px solid var(--rule);
}

.production-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: #fff;
  background: var(--green);
  font-size: 0.7rem;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
}

.production-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 185px;
  text-align: left;
}

.production-table thead th:first-child {
  z-index: 4;
}

.production-table tbody tr:nth-child(odd) td,
.production-table tbody tr:nth-child(odd) th {
  background: #fffdf9;
}

.production-table tbody tr:nth-child(even) td,
.production-table tbody tr:nth-child(even) th {
  background: var(--paper-deep);
}

.production-table tbody th {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 750;
}

.production-table tbody th > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-row-edit {
  display: inline-block;
  margin-top: 0.08rem;
  color: #5b6858;
  font-size: 0.65rem;
  font-weight: 650;
}

.production-table td {
  position: relative;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  cursor: text;
}

.production-table td:hover,
.production-table td:focus-visible {
  background: var(--green-soft) !important;
}

.production-table td[data-value="0"] .production-cell-value {
  color: #aaa294;
}

.production-adjustment-dot {
  position: absolute;
  top: 0.3rem;
  right: 0.25rem;
  width: 0.34rem;
  height: 0.34rem;
}

.production-inline-input {
  width: 100%;
  height: 1.65rem;
  padding: 0.12rem 0.25rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--terracotta);
  border-radius: 4px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.production-edit-heading {
  max-width: 760px;
}

.production-row-form {
  display: grid;
  gap: 1rem;
  max-width: 760px;
}

.production-row-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem 0.8rem;
}

.production-row-fields label {
  display: grid;
  gap: 0.25rem;
  color: #4f5b4d;
  font-size: 0.72rem;
  font-weight: 700;
}

.production-row-fields input {
  min-height: 42px;
  padding: 0.5rem 0.6rem;
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid var(--green);
  border-radius: 6px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.production-row-form .button-primary {
  width: fit-content;
}

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

@media (max-width: 719px) {
  .rotation-timeline {
    grid-template-columns: 1fr;
  }

  .rotation-segment + .rotation-segment {
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .rotation-segment:not(:last-child)::after {
    top: 2.65rem;
    right: auto;
    bottom: -1px;
    left: 1.78rem;
    width: 0;
    border-top: 0;
    border-left: 2px solid var(--green);
  }

  .assignment-row {
    grid-template-columns: 1.7rem minmax(0, 1fr);
  }

  .assignment-row > .button-secondary {
    grid-column: 2;
    justify-self: start;
  }

  .assignment-main-fields {
    grid-template-columns: 1fr;
  }

  .escalonado-fields {
    grid-column: 2;
  }
}

@media (min-width: 720px) {
  .llm-plan-comparison,
  .assignment-comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem max(1.5rem, calc((100vw - 1240px) / 2));
  }

  .page-shell {
    padding: 2.3rem 1.5rem 5rem;
  }

  .page-heading h1,
  .login-sheet h1,
  .empty-sheet h1 {
    font-size: 2.55rem;
  }

  .heading-with-note,
  .bed-heading {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .bed-heading-meta {
    align-items: flex-end;
  }

  .weekly-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem 2.5rem;
  }

  .bed-row-head,
  .bed-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1.45fr) minmax(0, 1fr) 92px 1.25rem;
    gap: 0.65rem;
  }

  .bed-row-head {
    padding: 0 0.65rem 0.2rem;
    color: #5d685b;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .bed-row {
    min-height: 70px;
    align-items: center;
  }

  .bed-row-id {
    grid-row: auto;
  }

  .bed-row-value,
  .bed-row-alert {
    grid-column: auto;
    grid-row: auto;
  }

  .mobile-column-label {
    display: none;
  }

  .pattern-library-item {
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 2rem;
    align-items: center;
  }

  .pattern-hero,
  .species-hero {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
    align-items: end;
  }

  .pattern-hero h1,
  .species-hero h1 {
    font-size: 2.55rem;
  }

  .pattern-reading-grid,
  .species-detail-grid,
  .config-add-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-calendar-row {
    grid-template-columns: 180px minmax(180px, 1fr) minmax(260px, 1.2fr);
    align-items: center;
  }

  .module-calendar-row .date-range {
    grid-column: 2;
  }

  .module-calendar-row .batch-arrows,
  .module-calendar-row > p:last-child {
    grid-column: 3;
  }

  .config-bed-row {
    grid-template-columns: 56px minmax(150px, 0.7fr) 130px minmax(180px, 1fr);
    align-items: end;
  }
}

@media (min-width: 980px) {
  .garden-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }

  .pattern-plan-layout {
    grid-template-columns: 540px minmax(280px, 1fr);
    gap: 1.8rem;
  }
}

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


/* Registro de campo: una fila por entrada prevista */
.field-record-summary {
  margin: 0.2rem 0 0;
  color: #657062;
  font-size: 0.83rem;
}

.field-record-list {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.field-record-row {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

.field-record-plan {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  align-items: baseline;
  margin: 0;
  font-size: 0.83rem;
}

.field-record-plan span {
  color: #657062;
  font-size: 0.74rem;
}

.field-status-chip {
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--green) !important;
  font-weight: 700;
}

.field-record-row.campo-hecho .field-status-chip,
.field-record-row.campo-sustituido .field-status-chip {
  color: #fff !important;
  background: var(--green);
}

.field-record-row.campo-parcial .field-status-chip,
.field-record-row.campo-sin_confirmar .field-status-chip {
  color: #772d19 !important;
  background: var(--terracotta-soft);
}

.field-record-row.campo-descartado .field-record-plan strong {
  text-decoration: line-through;
  color: #687267;
}

.field-record-edit summary {
  margin-top: 0.25rem;
  color: var(--green);
  font-size: 0.78rem;
  cursor: pointer;
}

.field-record-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.4rem;
  align-items: end;
}

.field-record-fields label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.74rem;
  color: #657062;
}

.field-record-fields input,
.field-record-fields select {
  width: 100%;
  padding: 0.38rem 0.45rem;
  border: 1px solid #d7cec0;
  border-radius: 6px;
  font: inherit;
  font-size: 0.83rem;
}

.decision-list {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.decision-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.85rem;
}

.decision-list time,
.decision-actor {
  margin-right: 0.35rem;
  color: #657062;
  font-size: 0.74rem;
}
