/* Plots, garden map, garden hours and plot signs. Map colors use app.css tokens so they work in both themes. */
:root {
  --pm-ground: color-mix(in srgb, #8a6a48 14%, var(--surface));
  --pm-path: color-mix(in srgb, #b89e7a 30%, var(--surface));
  --pm-open: color-mix(in srgb, var(--tint) 18%, var(--surface));
  --pm-taken: color-mix(in srgb, var(--ink) 10%, var(--surface));
  --pm-offered: color-mix(in srgb, var(--amber) 28%, var(--surface));
  --pm-inactive: color-mix(in srgb, var(--ink) 4%, var(--surface));
}

/* ---------- map ---------- */
.pmap-wrap { overflow-x: auto; }
/* r5: the side with more map beyond it fades out, so a wide map reads as "scroll for more" (scrollCue). */
.pmap-wrap.cue-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.pmap-wrap.cue-start { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px);
  mask-image: linear-gradient(to right, transparent, #000 56px); }
.pmap-wrap.cue-start.cue-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
[dir="rtl"] .pmap-wrap.cue-end { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent); }
[dir="rtl"] .pmap-wrap.cue-start { -webkit-mask-image: linear-gradient(to left, transparent, #000 56px);
  mask-image: linear-gradient(to left, transparent, #000 56px); }
.pmap-scroll-hint { margin: 0 0 .4rem; }
.pmap { width: 100%; height: auto; display: block; max-height: calc(70vh / var(--z, 1)); min-width: 320px; touch-action: none; }
/* Read-only maps scroll the page and zoom with the fingers as usual; only the editor takes over touch. */
.pmap:not(.editing) { touch-action: manipulation; }
.pmap:not(.editing) .pm-plot { cursor: pointer; }
.pmap:not(.editing) .pm-plot:hover rect:not(.pm-hatch) { stroke-width: 1; }
.pm-ground { fill: var(--pm-ground); }
.pm-feature rect { fill: var(--pm-path); }
.pm-feature-label { font-size: 2.2px; fill: var(--muted); text-anchor: middle; dominant-baseline: central; }
.pm-plot rect { fill: var(--pm-taken); stroke: color-mix(in srgb, var(--ink) 28%, var(--pm-taken)); stroke-width: .7; }
.pm-plot text { fill: var(--ink); text-anchor: middle; dominant-baseline: central; font-weight: 600; font-variant-numeric: tabular-nums;
  pointer-events: none; }
.pm-plot.st-open rect { fill: var(--pm-open); stroke: var(--tint); stroke-dasharray: 1 .6; }
.pm-plot.st-offered rect { fill: var(--pm-offered); }
.pm-plot.st-inactive rect { fill: var(--pm-inactive); stroke-dasharray: .4 .4; }
.pm-plot.st-inactive text { fill: var(--muted); }
.pm-plot.mine rect { fill: var(--tint); stroke: var(--tint); stroke-width: .8; }
/* The farm band across the top of a plot (identity, not status), never outlined. */
.pmap .pm-plot rect.pm-farm { fill: var(--farm); stroke: none !important; pointer-events: none; }
.pmap .pm-plot.mine rect.pm-farm { fill: color-mix(in srgb, var(--farm) 85%, var(--tint)); }
/* The editor still edges plots in their farm's colour, to check farm groups while arranging. */
.pmap.editing .pm-plot rect { stroke: var(--farm, var(--sep)); }
/* Offered plots: an amber hatch over the fill, so they differ from taken ones by more than colour. */
.pmap .pm-plot rect.pm-hatch { fill: url(#pm-hatch); stroke: none; pointer-events: none; }
.pm-hatch-line { fill: color-mix(in srgb, var(--amber) 45%, transparent); }
.pm-plot.mine text { fill: var(--tint-ink); }
.pm-plot.hl rect { stroke: var(--amber); stroke-width: 1.1; stroke-dasharray: none; }
/* Accessible raised bed: a small wheelchair badge in the plot's top corner. */
.pm-acc { pointer-events: none; }
.pm-acc > circle { fill: var(--surface); stroke: var(--tint); stroke-width: .18; }
.pm-acc-icon { fill: none; stroke: var(--tint); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pmap.editing .pm-plot { cursor: grab; }
.pmap.editing .pm-plot:active { cursor: grabbing; }
.pmap.editing .pm-plot.sel rect { stroke: var(--tint); stroke-width: 1; stroke-dasharray: none; }
.pmap .pm-plot:focus { outline: none; }
.pmap .pm-plot:focus-visible rect:not(.pm-hatch) { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: none; }
/* The plot whose details are open. */
.pmap .pm-plot.on rect:not(.pm-hatch) { stroke: var(--ink); stroke-width: 1.3; stroke-dasharray: none; }
.pm-legend { margin: .9rem 0 0; color: var(--ink); }
.pm-legend-things { margin-top: .5rem; padding-top: .6rem; box-shadow: inset 0 .5px 0 var(--sep); color: var(--muted); }
.pm-thing { display: inline-flex; align-items: center; gap: .35rem; }
.pm-thing .fi { width: 1rem; height: 1rem; }
.pm-thing.pm-path { --fk: #9a7b55; } .pm-thing.pm-shed { --fk: #8a5a32; } .pm-thing.pm-greenhouse { --fk: #2c8c7c; }
.pm-thing.pm-water { --fk: #2b7cc4; } .pm-thing.pm-compost { --fk: #6b4f2c; } .pm-thing.pm-tree { --fk: #2f8a3e; }
.pm-thing.pm-bench { --fk: #a06a2c; } .pm-thing.pm-beehive { --fk: #c58a00; } .pm-thing.pm-gate { --fk: #5f6670; }
.pm-thing.pm-area { --fk: #8e8e93; } .pm-thing.pm-sink { --fk: #1f8fb0; } .pm-thing.pm-valve { --fk: #c46a12; }
.pm-thing.pm-firstaid { --fk: #cf3a2e; }
/* Key swatches mirror the map: fill and edge style, not colour alone. */
.legend i.pm-key { display: inline-block; box-sizing: border-box; width: .9rem; height: .9rem; border-radius: 3px; margin-inline-end: .4rem;
  vertical-align: -2px; background: var(--pm-taken); border: 1.5px solid color-mix(in srgb, var(--ink) 30%, var(--surface)); }
.legend i.pm-key.st-open { background: var(--pm-open); border: 1.5px dashed var(--tint); }
.legend i.pm-key.st-offered { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--amber) 45%, var(--pm-offered)) 0 1.5px,
  var(--pm-offered) 1.5px 4px); border-color: color-mix(in srgb, var(--amber) 50%, var(--surface)); }
.legend i.pm-key.st-inactive { background: var(--pm-inactive); border-style: dotted; }
.legend i.pm-key.mine { background: var(--tint); border-color: var(--tint); }
.legend i.pm-key.pm-farm-key { background: linear-gradient(var(--farm) 0 32%, var(--pm-taken) 32%); }
.pm-acc-key { display: inline-flex; align-items: center; gap: .3rem; }
.pm-acc-key .fi { width: 1.05rem; height: 1.05rem; --fk: var(--tint); stroke-width: 2; }
.pm-legend-farms { margin-top: .5rem; }
.pm-farms-lead { color: var(--muted); }

/* status chips */
.chip.pm-chip.st-open { background: var(--tint-soft); color: var(--tint); }
.chip.pm-chip.st-offered { background: var(--amber-soft); color: var(--amber); }
.chip.pm-chip.st-inactive { background: var(--fill); color: var(--muted); }
.plot-table tbody tr { cursor: pointer; }
.plot-table tbody tr:hover td { background: var(--fill); }
.plot-table td { white-space: nowrap; }
@media (min-width: 641px) { .plot-table td:nth-child(3) { white-space: normal; } }
/* Narrow screens: the five filters scroll sideways instead of squeezing. */
@media (max-width: 640px) {
  .toolbar:has([data-show]) .segmented { max-width: 100%; overflow-x: auto; }
  .toolbar:has([data-show]) .segmented button { white-space: nowrap; }
  .pm-detail .row-actions { flex-basis: 100%; justify-content: flex-start; }
}
.pm-count { color: var(--muted); font-variant-numeric: tabular-nums; margin-inline-start: .15rem; }
[aria-selected="true"] > .pm-count { color: inherit; }
.pm-newplot { margin-bottom: 1rem; }
/* Plot detail: holders' actions wrap under the name on a narrow screen rather than squeezing it. */
.pm-detail .list > li.row-split { flex-wrap: wrap; }
.pm-detail .row-actions { white-space: normal; flex-wrap: wrap; row-gap: .3rem; }
.pm-add { margin-top: .75rem; box-shadow: inset 0 .5px 0 var(--sep); margin-inline: -1.25rem; padding-inline: 1.25rem; }
.pm-add:only-child { margin-top: 0; box-shadow: none; }

/* ---------- garden hours ---------- */
.hours-today { font-family: var(--sys-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
  margin: 0 0 .15rem; display: flex; flex-wrap: wrap; gap: 0 .4rem; font-variant-numeric: tabular-nums; }
.hours-today .dash { color: var(--muted); font-weight: 400; }
.plots-hours-card .section-head { flex-wrap: wrap; }
.pm-rule-line { margin: 0; gap: 1rem; }
.pm-rule-line a { flex: none; }
.hours-table tr.closed td { color: var(--muted); }
.hours-table tr.today td { font-weight: 600; }
.hours-table tr.today .row-meta { font-weight: 400; }
.hours-table.compact td:first-child, .hours-table .pm-h { white-space: nowrap; }
.hours-table.compact td { padding-inline: .5rem; }
.pm-twilight { margin: .6rem 1.25rem 0; }
fieldset.spec { border: 0; padding: 0; margin: 0; display: grid; gap: .6rem; min-width: 0; }
fieldset.spec legend { font-weight: 600; padding: 0; margin-bottom: .4rem; color: var(--ink); }
fieldset.spec .fields { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .75rem; }
fieldset.spec [hidden] { display: none; }
/* Garden hours settings: Opens and Closes side by side; rows inside a card separated by hairlines. */
/* Opens above Closes, each fieldset's fields three across where there's room. */
.pm-pair { display: grid; gap: 1rem; }
.pm-pair[hidden] { display: none; }
.pm-pair > fieldset.spec + fieldset.spec { padding-top: 1rem; box-shadow: inset 0 .5px 0 var(--sep); }
.pm-rule, .pm-weekday { padding: .9rem 0; box-shadow: inset 0 .5px 0 var(--sep); display: grid; gap: .8rem; }
.pm-rule:first-child, .pm-weekday:first-child { box-shadow: none; padding-top: 0; }
.pm-weekday:last-child { padding-bottom: 0; }
.pm-weekday .row-split select { width: auto; }
.pm-weekday .row-split label { margin: 0; }
.pm-rule p { margin: 0; }
.pm-closure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: .75rem; align-items: end;
  padding: .75rem 0; box-shadow: inset 0 .5px 0 var(--sep); }
.pm-closure:first-child { box-shadow: none; padding-top: 0; }
.pm-closure-x { padding-bottom: .7rem; }
@media (max-width: 640px) { .pm-closure { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pm-closure > :nth-child(3) { grid-column: 1 / -1; } }
.pm-add-row { margin: 0; }
#seasons:not(:empty) + .pm-add-row, #closures:not(:empty) + .pm-add-row { margin-top: .9rem; padding-top: .9rem; box-shadow: inset 0 .5px 0 var(--sep); }
body:has(.pm-hours) .page { max-width: 1180px; }
.pm-hours { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
.pm-hours > div > .group + .group { margin-top: 0; }
.pm-hours > div { gap: 1.5rem; }
.pm-preview .section-head h3 { margin: 0; font-size: 1rem; }
.pm-preview .actions { margin: 0; }
.pm-preview .actions .primary { width: 100%; }
.pm-preview .form-error:empty { display: none; }
@media (min-width: 901px) { .pm-preview { position: sticky; top: calc(52px + 1rem); } }
@media (max-width: 900px) { .pm-hours { grid-template-columns: minmax(0, 1fr); } }

/* ---------- plot signs (print) ---------- */
.signs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 1rem; }
.sign { background: #fff; color: #111; border-radius: 12px; padding: 1rem 1rem 1.1rem; border-top: 10px solid var(--farm, #2f6b3a);
  display: grid; justify-items: center; text-align: center; gap: .35rem; break-inside: avoid; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
/* app.css styles the gate code as .gate; undo that here for the gate sign. */
.sign.gate { border-top-color: #2f6b3a; font-family: inherit; font-size: inherit; font-weight: inherit; letter-spacing: normal; color: #111; margin: 0; }
.sign p { margin: 0; }
.sign-garden { font-size: .8rem; color: #555; }
.sign-num { font-family: var(--sys-display); font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.sign-label { font-weight: 600; }
.sign-qr { width: 150px; aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; }
.sign-qr .qr { width: 100%; height: 100%; }
.sign-cap { font-size: .8rem; color: #444; max-width: 20ch; }
.sign-url { font-size: .75rem; word-break: break-all; color: #333; }
@media print {
  .signs { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .sign { box-shadow: 0 0 0 .3mm #999; }
}

/* ---------- public garden page (splash) ---------- */
.splash .pub-hours { display: inline-grid; gap: .1rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 14px;
  padding: .75rem 1.1rem; margin: 0 0 2rem; }
.splash .pub-hours .now { font-weight: 600; font-size: 1.05rem; }
.splash .pub-hours .rule { color: var(--eucalyptus-soft); font-size: .95rem; }
.splash .pub-map { padding-block: 1rem 3.5rem; }
.splash .pub-map .intro { color: var(--eucalyptus-soft); max-width: 52ch; margin: 0 0 1.5rem; }
.splash .pub-map-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.splash .pub-map .pmap { max-height: 32rem; }
.splash .pub-map .legend { color: var(--eucalyptus-soft); font-size: .95rem; display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; }
.splash .pub-week h3 { font-family: var(--serif); font-size: 1.35rem; margin: 0 0 .6rem; letter-spacing: -.02em; }
.splash .pub-week table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.splash .pub-week td, .splash .pub-week th { padding: .5rem 0; border-top: 1px solid var(--rule); text-align: start; vertical-align: top; }
.splash .pub-week th { font-weight: 500; color: var(--eucalyptus-soft); border-top: 0; font-size: .9rem; }
.splash .pub-week td:last-child, .splash .pub-week th:last-child { text-align: end; }
.splash .pub-week .row-meta { color: var(--eucalyptus-soft); font-size: .875rem; }
.splash .pub-week tr.closed td { color: var(--eucalyptus-soft); }
.splash .pub-week .note { color: var(--eucalyptus-soft); font-size: .9rem; margin-top: .75rem; }
.splash .plot-callout { background: var(--paper); border: 1px solid var(--marigold); border-radius: 12px; padding: .6rem 1rem; margin: 0 0 1rem;
  display: inline-block; }
.splash .apply-link { display: inline-block; margin-top: .75rem; font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--marigold); }
@media (max-width: 860px) { .splash .pub-map-grid { grid-template-columns: 1fr; } }

/* ---------- map editor: tools over the canvas, an inspector column of grouped panels beside it ---------- */
.me-bar { margin: 0 0 .75rem; gap: .5rem .75rem; }
.me-bar .end { gap: .5rem .75rem; }
.me-bar label { margin: 0; }
.me-bar .check { display: flex; align-items: center; gap: .4rem; }
.me-group { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.me-group button, .me-menu > summary { padding: .4rem .75rem; font-size: .9rem; min-height: 36px; }
.me-add span { margin-inline-end: .15rem; }
.me-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.me-side { display: grid; gap: 1.25rem; }
.me-side .group + .group { margin-top: 0; }
.me-side .card { margin: 0; }
.me-side h3 { margin: 0; font-size: 1.05rem; }
.me-side h3 .muted { font-weight: 400; }
.me-canvas-card { padding: .75rem; }
.me-svg { max-height: calc(74vh / var(--z, 1)); user-select: none; -webkit-user-select: none; }
.me-tips { margin: .75rem .25rem 0; padding-inline-start: 1.1rem; display: grid; gap: .2rem; }
.me-tips b { font-weight: 600; color: var(--ink); }
.me-gridnote { margin: 0; }
.ph-actions .me-status { margin-inline-end: .25rem; }
/* Keep the map in view while working down the inspector: the grid fields redraw it as you type. */
@media (min-width: 901px) { .me-main { position: sticky; top: calc(52px + 1rem); } }
.me-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: end; }
.me-pair:not(:has(.me-x)) { grid-template-columns: 1fr 1fr; }
.me-pair input, .me-pair select { width: 100%; min-width: 0; }
.me-x { color: var(--muted); padding-bottom: .55rem; }
.me-btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.me-btns button { padding: .4rem .7rem; font-size: .9rem; }
.me-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-btn { padding: .25rem .6rem; border-radius: 999px; font-size: .875rem; font-variant-numeric: tabular-nums; }
.pm-lines line { stroke: color-mix(in srgb, var(--ink) 9%, transparent); stroke-width: .12; pointer-events: none; }
.me-svg .pm-plot, .me-svg .pm-feature { cursor: grab; }
.me-svg .pm-feature-label { pointer-events: none; }
.me-svg .sel rect, .me-svg .sel ellipse { stroke: var(--tint); stroke-width: .7; stroke-dasharray: none; }
.pm-ghost rect { fill: color-mix(in srgb, var(--tint) 8%, var(--surface)); stroke: var(--tint); stroke-width: .35; stroke-dasharray: .9 .6; }
.pm-ghost text { fill: var(--tint); }
.pm-handle { fill: var(--surface); stroke: var(--tint); stroke-width: .35; cursor: nwse-resize; }
.pm-band { fill: color-mix(in srgb, var(--tint) 12%, transparent); stroke: var(--tint); stroke-width: .2; pointer-events: none; }
@media (max-width: 900px) { .me-layout { grid-template-columns: minmax(0, 1fr); } }
body:has(.me-layout) .page { max-width: 1280px; }
.me-status.on { color: var(--amber); font-weight: 500; }
.me-menu { position: relative; }
.me-menu summary { list-style: none; cursor: pointer; }
.me-menu summary::-webkit-details-marker { display: none; }
.me-menu-list { position: absolute; z-index: 20; top: calc(100% + .35rem); inset-inline-start: 0; min-width: 170px; display: grid; padding: .35rem;
  background: var(--surface); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.14), 0 0 0 .5px var(--sep); }
.me-menu-list button { justify-content: flex-start; text-align: start; background: none; border: 0; padding: .5rem .6rem; border-radius: 8px;
  display: flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 400; }
.me-menu-list button:hover { background: var(--fill); }
.pm-handle.nw, .pm-handle.se { cursor: nwse-resize; }
.pm-handle.ne, .pm-handle.sw { cursor: nesw-resize; }
.me-size { display: grid; gap: .3rem; }
.me-size label { margin: 0; }
.me-size-row { display: flex; align-items: center; gap: .45rem; }
.me-size-row input[type=range] { flex: 1; min-height: 0; padding: 0; background: none; accent-color: var(--tint); }
.me-size-row button { width: 2rem; min-height: 2rem; padding: 0; border-radius: 50%; font-size: 1.15rem; line-height: 1; }
.me-size-row output { min-width: 3.2rem; text-align: end; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.me-size .help { margin: 0; }
.me-numbering { border: 0; padding: 0; margin: 0; display: grid; gap: .55rem; min-width: 0; }
.me-numbering legend { font-weight: 600; padding: 0; margin-bottom: .35rem; }
.me-numbering .help { margin: 0; }

/* ---------- feature icons: one hue per kind; the shape is a pale wash, the icon the strong tone ---------- */
.pm-feature { --fk: #9a7b55; }
.pm-feature.pm-path { --fk: #9a7b55; } .pm-feature.pm-shed { --fk: #8a5a32; } .pm-feature.pm-greenhouse { --fk: #2c8c7c; }
.pm-feature.pm-water { --fk: #2b7cc4; } .pm-feature.pm-compost { --fk: #6b4f2c; } .pm-feature.pm-tree { --fk: #2f8a3e; }
.pm-feature.pm-bench { --fk: #a06a2c; } .pm-feature.pm-beehive { --fk: #c58a00; } .pm-feature.pm-gate { --fk: #5f6670; }
.pm-feature.pm-area { --fk: #8e8e93; }
.pm-feature rect, .pm-feature ellipse { fill: color-mix(in srgb, var(--fk) 18%, var(--surface)); stroke: color-mix(in srgb, var(--fk) 45%, var(--surface)); stroke-width: .25; }
.pm-feature.pm-path rect { fill: color-mix(in srgb, var(--fk) 22%, var(--surface)); stroke: none; }
.pm-feature.pm-area rect { fill: color-mix(in srgb, var(--fk) 6%, var(--surface)); stroke-dasharray: .8 .5; }
.pm-glyph { fill: none; stroke: var(--fk); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.pm-glyph rect, .pm-glyph ellipse { fill: none; stroke: var(--fk); stroke-width: 1.7; }
.pm-feature .pm-feature-label { fill: color-mix(in srgb, var(--fk) 70%, var(--ink)); font-weight: 600; pointer-events: none; }

/* Add menu: the same icon on a soft tile */
.me-ico { width: 1.7rem; height: 1.7rem; border-radius: 7px; display: grid; place-items: center; flex: none;
  --fk: #9a7b55; background: color-mix(in srgb, var(--fk) 16%, var(--surface)); }
.me-ico.pm-shed { --fk: #8a5a32; } .me-ico.pm-greenhouse { --fk: #2c8c7c; } .me-ico.pm-water { --fk: #2b7cc4; }
.me-ico.pm-compost { --fk: #6b4f2c; } .me-ico.pm-tree { --fk: #2f8a3e; } .me-ico.pm-bench { --fk: #a06a2c; }
.me-ico.pm-beehive { --fk: #c58a00; } .me-ico.pm-gate { --fk: #5f6670; } .me-ico.pm-area { --fk: #8e8e93; }
.fi { width: 1.15rem; height: 1.15rem; fill: none; stroke: var(--fk, currentColor); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fi rect { fill: none; }
.me-menu-list { min-width: 200px; }
.me-numbering .me-pair { grid-template-columns: 1fr; }

/* The garden's own edges in the map editor: drag to resize the garden. */
.me-svg { overflow: visible; }
.pm-edge { fill: var(--surface); stroke: var(--muted); stroke-width: .3; opacity: .85; }
.pm-edge:hover { stroke: var(--tint); opacity: 1; }
.pm-edge.n, .pm-edge.s { cursor: ns-resize; }
.pm-edge.e, .pm-edge.w { cursor: ew-resize; }
.pm-edge.nw, .pm-edge.se { cursor: nwse-resize; }
.pm-edge.ne, .pm-edge.sw { cursor: nesw-resize; }

/* Sink, shut-off valve and first aid kit */
.pm-feature.pm-sink, .me-ico.pm-sink { --fk: #1f8fb0; }
.pm-feature.pm-valve, .me-ico.pm-valve { --fk: #c46a12; }
.pm-feature.pm-firstaid, .me-ico.pm-firstaid { --fk: #cf3a2e; }

/* ---------- member map: the map leads, the key sits right under it, hours one tap away ---------- */
.pm-foot { margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.pm-mapcard { padding: .75rem .75rem 1rem; }
.pm-mapcard .pm-legend { padding-inline: .5rem; }
.pm-mapcard .pmap { max-height: calc(72vh / var(--z, 1)); }
.pm-hourslink { display: grid; gap: .05rem; padding: .55rem .9rem; min-height: 44px; border-radius: 12px; background: var(--surface);
  color: var(--ink); line-height: 1.25; }
.pm-hourslink:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--tint-soft); }
.pm-hl-label { color: var(--tint); font-weight: 600; font-size: .95rem; }
.pm-hl-value { font-size: .9rem; font-variant-numeric: tabular-nums; }

/* ---------- plot details: under the map on a wide screen, a sheet from the bottom on a phone ---------- */
.pm-mapbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem;
  margin: 0 .5rem .6rem; }
.pm-mapbar .help, p.pm-mapbar { margin: 0; }
.pm-zoom { padding: .4rem .85rem; font-size: .9rem; min-height: 36px; }
.pm-info { margin: .75rem .5rem 0; padding: .9rem 1rem 1rem; background: var(--fill); outline: none; }
.pm-info:focus, .pm-info:focus-visible { outline: none; }
/* Focus moves here when it opens so a screen reader reads it; no ring, since nobody tabbed to it. */
.pm-info-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.pm-info-head h2 { margin: 0; font-size: 1.15rem; }
.pm-info-head h2 .muted { font-weight: 400; }
.pm-info-x { flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: -.5rem -.5rem -.5rem 0; border-radius: 50%;
  display: grid; place-items: center; background: none; border: 0; color: var(--muted); }
.pm-info-x:hover { background: var(--surface); color: var(--ink); }
.pm-info-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pm-info-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem 1.25rem; margin: 0; }
.pm-info-facts dt { color: var(--muted); font-size: .875rem; }
.pm-info-facts dd { margin: .1rem 0 0; }
.pm-info-type { display: inline-flex; align-items: center; gap: .3rem; }
.pm-info-type .fi { --fk: var(--tint); width: 1.05rem; height: 1.05rem; }
.pm-info-mine { margin: .8rem 0 0; }
@media (max-width: 600px) {
  .pm-info { position: fixed; inset: auto 0 0 0; z-index: 30; margin: 0; max-height: 60vh; overflow-y: auto;
    padding: 1rem 1.1rem max(1.1rem, env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; background: var(--surface);
    box-shadow: 0 -6px 28px rgba(0, 0, 0, .18); }
  .pm-mapcard .pmap.zoomed { max-height: none; }
}

/* ---------- list of plots: the map as text, one row of numbers per status ---------- */
.pm-list { margin: .9rem .5rem 0; padding-top: .3rem; box-shadow: inset 0 .5px 0 var(--sep); }
.pm-list-group + .pm-list-group { margin-top: .9rem; }
.pm-list-title { margin: 0 0 .45rem; font-size: .95rem; font-weight: 600; display: flex; align-items: center; }
.pm-list-title .muted { font-weight: 400; margin-inline-start: .35rem; }
.pm-list-title i.pm-key { display: inline-block; box-sizing: border-box; width: .9rem; height: .9rem; border-radius: 3px; margin-inline-end: .45rem;
  background: var(--pm-taken); border: 1.5px solid color-mix(in srgb, var(--ink) 30%, var(--surface)); }
.pm-list-title i.pm-key.st-open { background: var(--pm-open); border: 1.5px dashed var(--tint); }
.pm-list-title i.pm-key.st-offered { background: var(--pm-offered); border-color: color-mix(in srgb, var(--amber) 50%, var(--surface)); }
.pm-list-title i.pm-key.st-inactive { background: var(--pm-inactive); border-style: dotted; }
.pm-list-nums { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.pm-list-nums .chip-btn { min-width: 44px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: .2rem; }
.pm-list-nums .chip-btn.mine { background: var(--tint); color: var(--tint-ink); border-color: var(--tint); }
.pm-list-acc { --fk: currentColor; width: .95rem; height: .95rem; }

/* ---------- map editor: the colour key under the canvas ---------- */
.me-key { padding: 0 .25rem .25rem; }
.me-key .pm-legend { font-size: .9rem; }
.me-key-edit { margin-top: .5rem; padding-top: .6rem; box-shadow: inset 0 .5px 0 var(--sep); color: var(--muted); }
.legend i.pm-key.me-key-sel { background: var(--pm-taken); border: 2.5px solid var(--tint); }
.legend i.pm-key.me-key-new { background: color-mix(in srgb, var(--tint) 8%, var(--surface)); border: 1.5px dashed var(--tint); }
.legend i.pm-key.me-key-handle { background: var(--surface); border: 1.5px solid var(--tint); width: .6rem; height: .6rem; border-radius: 2px; vertical-align: 0; }
.me-menu-list button:focus-visible { background: var(--fill); outline: 2px solid var(--tint); outline-offset: -2px; }

/* Hand-adding someone to an empty plot: the waitlist it skips, with an optional reason */
.pm-skip { display: grid; gap: .4rem; }
.pm-skip p { margin: 0; }
.pm-skip input { background: var(--surface, #fff); }

/* Head farmers and chores per season (owner decision 12) */
.sec-season { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--muted); }
.sec-season select { width: auto; min-height: 36px; }
.sec-p { margin: 0; }
.sec-card h2 { display: flex; align-items: center; gap: .5rem; }
.sec-dot { width: .8rem; height: .8rem; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px var(--line, rgba(0,0,0,.15)); }
.sec-h { font-size: .95rem; margin: 0 0 .35rem; }
.sec-add { margin-top: .5rem; }
.sec-add.row > button { flex: 0 0 auto; }
.sec-add .form-error:empty { display: none; }
.sec-add.row > .form-error { flex-basis: 100%; }

/* Communal plot (a shared herb garden): everyone's, never open or offered. A sage fill with a dotted edge, and its name. */
:root { --pm-communal: color-mix(in srgb, var(--tint) 9%, color-mix(in srgb, #8a6a48 8%, var(--surface))); }
.pm-plot.st-communal rect { fill: var(--pm-communal); stroke: color-mix(in srgb, var(--tint) 55%, var(--surface)); stroke-dasharray: .25 .5; stroke-linecap: round; }
.pm-plot text.pm-communal-label { font-weight: 500; fill: var(--muted); }
.legend i.pm-key.st-communal, .pm-list-title i.pm-key.st-communal { background: var(--pm-communal); border: 1.5px dotted var(--tint); }
.chip.pm-chip.st-communal { background: var(--tint-soft); color: var(--ink); }

/* The plot number opens the plot: a comfortable target (44px wide at least), not just the digits. */
.plot-table td.num > a { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 44px; min-height: 44px; margin-block: -.6rem; }

/* "Plot becoming available…" on the plot page */
.pm-choices { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: .3rem; }
.pm-choices legend { padding: 0; margin-bottom: .3rem; font-weight: 600; }
.pm-leaving { display: grid; gap: .4rem; }
.pm-leaving p { margin: 0; }
.pm-leaving .actions { margin-top: .2rem; }
.pm-avail { margin-top: .2rem; }

/* ---------- gardeners' names on the members' map: drawn wide enough to read; a phone scrolls it sideways ---------- */
.pmap.named:not(.zoomed), .pm-mapcard .pmap.named:not(.zoomed) { min-width: var(--named-min, 320px); max-height: none; }
.pm-plot text.pm-name { font-weight: 500; font-variant-numeric: normal; }
.pm-plot.st-inactive text.pm-name { fill: var(--muted); }

/* Plot page: Details and History fold to one row each. The details column lines up with the Holders card. */
@media (min-width: 901px) { .pm-detail > aside { padding-top: 1.9rem; } }
.pm-fold > summary { min-height: 44px; }
.pm-fold[open] > summary { margin-bottom: .5rem; }

/* Desktop: the whole map fits the screen (its height is set inline); names are sized or shortened to fit. */
.pmap.fitted:not(.zoomed) { min-width: 0; height: auto; margin-inline: auto; }
.pmap.fitted.zoomed { aspect-ratio: auto !important; width: 100% !important; }
.pm-hours-now .hours-today { margin: .1rem 0 .35rem; }
.pm-hours-week { margin-top: .75rem; }
/* The hours preview in Garden hours settings: a wide row (longer languages) scrolls inside its box, not the page. */
#preview { overflow-x: auto; max-width: 100%; }
/* Farm duties drawn by lot (Head farmers and chores) */
.duty-table select { width: auto; max-width: 100%; min-height: 44px; }
.duty-edit > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--tint); }
.duty-row { border: .5px solid var(--sep); border-radius: 10px; padding: .75rem; margin: 0; }
.duty-rem { align-items: center; flex-wrap: wrap; }
.duty-rem select { width: auto; }
.duty-rem input { min-width: 10rem; }
#duty-err:empty { display: none; }
