/* Mat Zone Index — Capillary Mat catalog
   Watering-mat zone map · sort valves · seed-slip bay
   NOT Variety Ladder rungs / Type Tray / Furrow. */

.page-a105-matzone {
  background:
    radial-gradient(ellipse 80% 40% at 20% 0%, rgba(14, 124, 116, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 35% at 90% 10%, rgba(152, 216, 50, 0.12), transparent 50%),
    var(--a105-mist);
}

.mz-map {
  padding-bottom: 2rem;
}

/* —— Mast —— */
.mz-mast {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.85rem 0 1.35rem;
}
.mz-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a105-mat);
}
.mz-mast h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  color: var(--a105-loam);
}
.mz-mast-copy p:last-child {
  margin: 0;
  max-width: 44ch;
  color: var(--a105-mute);
}
.mz-meters {
  display: flex;
  gap: 0.65rem;
}
.mz-meter {
  min-width: 5.75rem;
  padding: 0.8rem 1rem;
  border-radius: 4px 18px 4px 18px;
  background: var(--a105-surface);
  border: 2px solid var(--a105-border);
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
}
.mz-meter strong {
  font-family: var(--a105-font-display);
  font-size: 1.55rem;
}
.mz-meter span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--a105-mute);
}
.mz-meter--mat {
  border-color: rgba(14, 124, 116, 0.4);
  box-shadow: inset 0 -4px 0 rgba(14, 124, 116, 0.2);
}
.mz-meter--mat strong { color: var(--a105-mat-deep); }
.mz-meter--sprout {
  border-color: rgba(152, 216, 50, 0.55);
  box-shadow: inset 0 -4px 0 rgba(152, 216, 50, 0.35);
}
.mz-meter--sprout strong { color: var(--a105-sprout-ink); }

.mz-label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--a105-mute);
}

/* —— Field: zone map + bay —— */
.mz-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding-bottom: 1.5rem;
  min-width: 0;
}

.mz-capillary {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  top: 3.2rem;
  height: 6px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.mz-capillary-line {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--a105-mat), var(--a105-sprout), var(--a105-sun), var(--a105-plug));
  opacity: 0.35;
}
.mz-capillary-bead {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--a105-mat);
  box-shadow: 0 0 0 3px rgba(14, 124, 116, 0.25);
  animation: mz-bead-flow 4.5s ease-in-out infinite;
}
.mz-capillary-bead--1 { left: 8%; animation-delay: 0s; }
.mz-capillary-bead--2 {
  left: 42%;
  background: var(--a105-sprout);
  box-shadow: 0 0 0 3px rgba(152, 216, 50, 0.3);
  animation-delay: 1.2s;
}
.mz-capillary-bead--3 {
  left: 78%;
  background: var(--a105-sun);
  box-shadow: 0 0 0 3px rgba(255, 180, 31, 0.35);
  animation-delay: 2.4s;
}
@keyframes mz-bead-flow {
  0%, 100% { transform: translateX(0) scale(1); opacity: 0.7; }
  50% { transform: translateX(18px) scale(1.15); opacity: 1; }
}

/* Zone map — mat panels (former rungs) */
.mz-zones {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 1rem 1rem 1.15rem;
  border-radius: 8px;
  background:
    linear-gradient(165deg, rgba(14, 124, 116, 0.08), transparent 40%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 11px,
      rgba(14, 124, 116, 0.04) 11px,
      rgba(14, 124, 116, 0.04) 12px
    ),
    var(--a105-surface);
  border: 2px solid rgba(14, 124, 116, 0.22);
  box-shadow: 0 10px 0 rgba(14, 124, 116, 0.08);
}

.mz-zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(0, 1fr));
  gap: 0.65rem;
  min-width: 0;
}

.vl-rung,
.mz-zone {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  .vl-rung,
  .mz-zone {
    animation: mz-zone-in 0.45s cubic-bezier(.2,.85,.2,1) both;
    animation-delay: calc(var(--mz-i, 0) * 0.05s);
  }
}
@keyframes mz-zone-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.mz-zone-panel {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.2rem 0.5rem;
  align-items: center;
  min-width: 0;
  min-height: 4.5rem;
  padding: 0.75rem 0.8rem 0.7rem;
  border-radius: 6px;
  background: var(--a105-paper);
  border: 2px solid rgba(14, 124, 116, 0.2);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.mz-zone-wet {
  position: absolute;
  inset: auto 0 0 0;
  height: 5px;
  background: linear-gradient(90deg, var(--a105-mat), transparent 70%);
  opacity: 0.45;
  transition: height 0.25s ease, opacity 0.25s ease;
}
.mz-zone-panel em {
  grid-column: 1;
  grid-row: 1 / -1;
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--a105-mute);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.06em;
}
.mz-zone-panel strong {
  grid-column: 2;
  grid-row: 1;
  font-size: 0.92rem;
  color: var(--a105-loam);
  line-height: 1.2;
}
.mz-zone-panel b {
  grid-column: 3;
  grid-row: 1 / -1;
  align-self: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--a105-mat-deep);
  background: var(--a105-mist);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.vl-rung:hover .mz-zone-panel,
.mz-zone:hover .mz-zone-panel {
  transform: translateY(-3px);
  border-color: var(--a105-mat);
  box-shadow: 0 6px 0 rgba(14, 124, 116, 0.12);
}
.vl-rung:hover .mz-zone-wet,
.mz-zone:hover .mz-zone-wet {
  height: 8px;
  opacity: 0.7;
}

.vl-rung.is-active .mz-zone-panel,
.mz-zone.is-active .mz-zone-panel {
  background: var(--a105-mat);
  border-color: var(--a105-mat-deep);
  box-shadow: 0 6px 0 var(--a105-loam);
}
.vl-rung.is-active .mz-zone-panel em,
.vl-rung.is-active .mz-zone-panel strong,
.mz-zone.is-active .mz-zone-panel em,
.mz-zone.is-active .mz-zone-panel strong {
  color: var(--a105-on-mat);
}
.vl-rung.is-active .mz-zone-panel b,
.mz-zone.is-active .mz-zone-panel b {
  background: var(--a105-sprout);
  color: var(--a105-sprout-ink);
}
.vl-rung.is-active .mz-zone-wet,
.mz-zone.is-active .mz-zone-wet {
  height: 10px;
  opacity: 1;
  background: linear-gradient(90deg, var(--a105-sprout), var(--a105-sun));
}

.vl-rung.mz-zone--sprout.is-active .mz-zone-panel,
.mz-zone--sprout.is-active .mz-zone-panel {
  background: #7FB820;
  border-color: var(--a105-sprout-ink);
}
.vl-rung.mz-zone--sun.is-active .mz-zone-panel,
.mz-zone--sun.is-active .mz-zone-panel {
  background: var(--a105-sun);
  border-color: var(--a105-sun-ink);
}
.vl-rung.mz-zone--sun.is-active .mz-zone-panel em,
.vl-rung.mz-zone--sun.is-active .mz-zone-panel strong,
.mz-zone--sun.is-active .mz-zone-panel em,
.mz-zone--sun.is-active .mz-zone-panel strong {
  color: var(--a105-sun-ink);
}
.vl-rung.mz-zone--plug.is-active .mz-zone-panel,
.mz-zone--plug.is-active .mz-zone-panel {
  background: var(--a105-plug);
  border-color: var(--a105-plug-deep);
}

.vl-rung.is-latched .mz-zone-panel,
.mz-zone.is-latched .mz-zone-panel {
  animation: none;
}
@media (prefers-reduced-motion: no-preference) {
  .vl-rung.is-latched .mz-zone-panel,
  .mz-zone.is-latched .mz-zone-panel {
    animation: mz-zone-latch 0.4s cubic-bezier(.2,.9,.2,1);
  }
}
@keyframes mz-zone-latch {
  0% { transform: scale(1); }
  35% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* —— Seed slip bay —— */
.mz-bay {
  position: relative;
  z-index: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 1.1rem 1.2rem 1.35rem;
  border-radius: 6px 28px 6px 28px;
  background: var(--a105-surface);
  border: 2px solid rgba(14, 124, 116, 0.18);
  box-shadow: inset 0 0 0 1px rgba(214, 244, 238, 0.8);
}
.mz-bay.is-refresh {
  animation: none;
}
@media (prefers-reduced-motion: no-preference) {
  .mz-bay.is-refresh {
    animation: mz-bay-soak 0.45s ease;
  }
}
@keyframes mz-bay-soak {
  from { box-shadow: inset 0 0 0 0 rgba(14, 124, 116, 0.25); }
  40% { box-shadow: inset 0 0 0 6px rgba(14, 124, 116, 0.1); }
  to { box-shadow: inset 0 0 0 1px rgba(214, 244, 238, 0.8); }
}

.mz-valves {
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 2px solid rgba(14, 124, 116, 0.12);
}
.mz-valve-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.mz-valve {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 2px solid rgba(43, 33, 24, 0.14);
  border-radius: 4px;
  padding: 0.5rem 0.9rem 0.5rem 1.55rem;
  background: var(--a105-paper);
  color: var(--a105-ink);
  font-family: var(--a105-font-body);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mz-valve::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: rgba(18, 35, 30, 0.2);
  transform: translateY(-50%) rotate(45deg);
}
.mz-valve.is-on {
  background: var(--a105-loam);
  color: var(--a105-on-loam);
  border-color: var(--a105-loam);
}
.mz-valve.is-on::before {
  background: var(--a105-sprout);
  box-shadow: 0 0 0 2px rgba(152, 216, 50, 0.35);
}
.mz-valve.is-snap {
  animation: none;
}
@media (prefers-reduced-motion: no-preference) {
  .mz-valve.is-snap {
    animation: mz-valve-click 0.28s ease;
  }
}
@keyframes mz-valve-click {
  0% { transform: scale(1); }
  40% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.mz-bay-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.mz-bay-head h2 {
  margin: 0;
  font-family: var(--a105-font-display);
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  color: var(--a105-loam);
}

.mz-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  background: var(--a105-plug);
  color: #fff;
  font-family: var(--a105-font-body);
  font-weight: 800;
  text-decoration: none;
  border: 2px solid var(--a105-plug-deep);
  box-shadow: 3px 3px 0 var(--a105-loam);
  transition: background 0.15s ease, transform 0.15s ease;
}
.mz-open:hover {
  background: var(--a105-plug-deep);
  transform: translateY(-1px);
}
.mz-open:focus-visible {
  outline: 3px solid var(--a105-sun);
  outline-offset: 2px;
}
.mz-open--ghost {
  background: var(--a105-surface);
  color: var(--a105-mat-deep);
  border: 2px solid var(--a105-mat);
  box-shadow: none;
}
.mz-open--ghost:hover {
  background: var(--a105-mat);
  color: var(--a105-on-mat);
  border-color: var(--a105-mat-deep);
}

.mz-slips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(0, 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.mz-slip {
  display: grid;
  grid-template-columns: 8px 52px minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  min-width: 0;
  padding: 0.55rem 0.7rem 0.55rem 0.4rem;
  border-radius: 4px 14px 4px 14px;
  background: var(--a105-paper);
  border: 1.5px solid rgba(14, 124, 116, 0.16);
  text-decoration: none;
  color: inherit;
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  .mz-slip {
    animation: mz-slip-rise 0.4s cubic-bezier(.2,.9,.2,1) both;
    animation-delay: calc(var(--mz-i, 0) * 0.03s);
  }
}
@keyframes mz-slip-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.mz-slip:hover {
  border-color: var(--a105-mat);
  background: var(--a105-surface);
  box-shadow: 0 4px 0 rgba(14, 124, 116, 0.1);
}
.mz-slip:focus-visible {
  outline: 3px solid var(--a105-sun);
  outline-offset: 2px;
}
.mz-slip-wick {
  width: 6px;
  height: 100%;
  min-height: 40px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--a105-mat), var(--a105-mat-deep));
  justify-self: center;
}
.mz-slip-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--a105-mist);
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--a105-mat);
}
.mz-slip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mz-slip-copy {
  min-width: 0;
}
.mz-slip-copy strong {
  display: block;
  font-size: 0.93rem;
  line-height: 1.25;
  color: var(--a105-loam);
  overflow-wrap: anywhere;
}
.mz-slip-price {
  font-weight: 800;
  color: var(--a105-ink);
  white-space: nowrap;
}

.mz-empty {
  margin: 1rem 0 0;
  color: var(--a105-mute);
  text-align: center;
}

.mz-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.35rem 0 3rem;
  border-top: 2px dashed rgba(14, 124, 116, 0.22);
  margin-top: 0.35rem;
}
.mz-foot p {
  margin: 0;
  color: var(--a105-mute);
}

.vl-rung:focus-visible .mz-zone-panel,
.mz-zone:focus-visible .mz-zone-panel,
.mz-valve:focus-visible {
  outline: 3px solid var(--a105-sun);
  outline-offset: 2px;
}

@media (min-width: 481px) {
  .mz-zone-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(148px, 100%), 1fr));
  }
  .mz-slips {
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  }
}

@media (max-width: 720px) {
  .mz-mast {
    flex-direction: column;
    align-items: flex-start;
  }
  .mz-meters { width: 100%; }
  .mz-meter { flex: 1; min-width: 0; }
  .mz-capillary { display: none; }
  .mz-zone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mz-slips {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .mz-zone-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .mz-slip {
    grid-template-columns: 6px 48px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .mz-slip-price {
    grid-column: 3;
  }
  .mz-open { width: 100%; }
  .mz-foot { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .vl-rung,
  .mz-zone,
  .mz-slip,
  .vl-rung.is-latched .mz-zone-panel,
  .mz-zone.is-latched .mz-zone-panel,
  .mz-valve.is-snap,
  .mz-bay.is-refresh,
  .mz-capillary-bead {
    animation: none !important;
  }
  .vl-rung,
  .mz-zone,
  .mz-slip {
    opacity: 1 !important;
    transform: none !important;
  }
}
