/* Upkeep, renewal, inspections. Built on the tokens and shared page patterns in app.css. */
button.danger-btn { color: var(--red); }
button.danger-btn:hover { background: var(--red-soft); }
.quiet.armed { background: var(--red-soft); color: var(--red); padding: .1rem .45rem; border-radius: 6px; }
.cy-narrow { max-width: 720px; }
.cy-foot { margin-top: 1rem; }
.cy-issue { font-size: 1.15rem; }

/* home cards: heading row, one or two lines, then the way in */
.cycle-card .section-head { margin-bottom: .35rem; }
.cycle-card p + p { margin-top: .25rem; }
.cc-foot { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; margin-top: .35rem; }
.cc-act { margin-top: .8rem; }
/* renewal blocked: what's in the way, each a link to fix it; the button waits */
.cycle-card .cc-before { margin: .7rem 0 .25rem; font-weight: 500; }
.cc-blockers { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.cc-blockers li { min-height: 32px; display: flex; align-items: center; }
.cc-blockers a { padding: .3rem 0; }
.cc-act button:disabled { opacity: 1; background: var(--fill); color: var(--muted); font-weight: 500; }

/* member pages */
.cy-member .checklist + * { margin-top: 0; }
.mn-card > * + * { margin-top: .35rem; }
.mn-card + .mn-card { margin-top: 1rem; }
.mn-issue { font-size: 1.05rem; }
.mn-due { color: var(--ink); font-weight: 500; font-size: .95rem; }
.mn-appeal { margin-top: 1rem !important; }
form.mn-appeal { padding-top: 1rem; box-shadow: inset 0 .5px 0 var(--sep); }
@media (max-width: 560px) {
  .cy-member .actions > .primary, .cy-member .actions > .btn.primary { flex: 1 1 100%; }
}

/* Upkeep: the new-notice form opens beneath the page head */
.cy-newbox { margin-bottom: 1.5rem; }
@media (min-width: 700px) { .cy-newfields { grid-template-columns: 7rem minmax(0, 1fr) 12rem; } }
.cy-formact { display: flex; align-items: center; gap: 1.25rem; }

/* Upkeep rows: plot and holders, the problem, a stage/deadline line; quiet actions on the right */
.nlist > li.nrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1.5rem; align-items: start; }
.nrow-main > * + * { margin-top: .2rem; }
.nrow-main > .notice, .nrow-main > .notes { margin-top: .5rem; }
.nrow-head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.nrow-issue { margin: 0; }
.nrow-when { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .6rem; margin: 0; }
.nrow-when .chip { flex: none; }
.nrow-when > span + span::before { content: "·"; margin-inline-end: .6rem; color: var(--muted); }
.nrow .row-actions { padding-top: .15rem; }
.nrow .row-actions .quiet { min-height: 32px; }
.nrow .notes { list-style: none; padding: 0; }
.nrow .notes li + li { margin-top: .15rem; }
.nrow > .cy-note { grid-column: 1 / -1; margin-top: .2rem; }
@media (max-width: 640px) {
  .nlist > li.nrow { grid-template-columns: minmax(0, 1fr); }
  .nrow .row-actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 0; }
  .nrow .row-actions .quiet { min-height: 44px; }
}

.cy-note { display: flex; gap: .5rem; margin-top: .9rem; }
.cy-note input { flex: 1; min-width: 0; }
.cy-note button { flex: none; min-height: 44px; }
.nd-main > .nrow-when { margin-top: .4rem; }
.nd-main + .group { margin-top: 1.5rem; }

/* tappable rows: name + one status + chevron */
.cy-row { display: flex; align-items: center; gap: .75rem; color: var(--ink); margin: -.75rem -1.25rem; padding: .75rem 1.25rem; min-height: 44px; }
.list > li:first-child .cy-row { margin-top: -.25rem; padding-top: .25rem; }
.list > li:last-child .cy-row { margin-bottom: -.25rem; padding-bottom: .25rem; }
.cy-row:hover { text-decoration: none; }
.cy-row:hover .row-title { color: var(--tint); }
.cy-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cy-row .chip { flex: none; }

/* notice rules: stages as one consistent stack of cards */
.stage-list { display: grid; gap: .75rem; }
fieldset.stage { border: 0; margin: 0; min-width: 0; }
.stage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.stage-title { font-family: var(--sys-display); font-size: 1.05rem; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.stage .fields { grid-template-columns: minmax(0, 1fr) 9rem; }
.stage-final .fields { grid-template-columns: minmax(0, 1fr); }
.stage-final .stage-title { color: var(--muted); }
.stage-list + .help .quiet { margin-inline-start: .5rem; }
.cy-sub { display: block; margin-inline-start: 0; }

/* renewal table */
.table td.num { font-variant-numeric: tabular-nums; }
.table td.num, .table td.row-title, .table td > .chip { white-space: nowrap; }

/* walking the garden: phone in one hand. A strip of plot numbers, one plot at a time, the save bar under the thumb */
.walk { max-width: 640px; }
.plot-strip { position: relative; display: flex; gap: .45rem; overflow-x: auto; padding: .2rem .1rem .8rem; margin-bottom: .4rem; scrollbar-width: thin;
  scroll-behavior: auto; overscroll-behavior-x: contain; }
.plot-strip a { flex: none; min-width: 2.9rem; height: 2.9rem; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--sep); }
.plot-strip a:hover { text-decoration: none; }
.plot-strip a.ok { background: var(--tint-soft); color: var(--tint); box-shadow: none; }
.plot-strip a.bad { background: var(--amber-soft); color: var(--amber); box-shadow: none; }
.plot-strip a.here { background: var(--tint); color: var(--tint-ink); box-shadow: none; }
.walk-done { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.walk-done p { margin: 0; font-weight: 500; }
.walk-form > .card + .card { margin-top: 1rem; }
.walk-head { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; }
.plot-title { font-size: 1.6rem; margin: 0; }

.rate-list { list-style: none; padding: 0; margin: 0 -1.25rem; }
.rate-list li { display: flex; align-items: center; gap: .5rem .75rem; padding: .6rem 1.25rem; flex-wrap: wrap; position: relative; }
.rate-list li + li::before { content: ""; position: absolute; top: 0; inset-inline-start: 1.25rem; inset-inline-end: 0; border-top: .5px solid var(--sep); }
.rate-list .grow { flex: 1 1 12rem; }
.rate { display: inline-flex; background: var(--fill); border-radius: 11px; padding: 3px; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label { margin: 0; padding: .55rem 1.1rem; border-radius: 8px; font-size: 1rem; font-weight: 500; color: var(--ink); cursor: pointer; min-height: 48px;
  display: grid; place-items: center; }
.rate input:checked + label { background: var(--tint); color: var(--tint-ink); }
.rate input:checked + label.no { background: var(--amber); color: var(--surface); }
.rate input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--tint) 45%, transparent); outline-offset: 1px; }
.walk-allok { width: 100%; min-height: 48px; }
.walk-allok-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

.label-like { display: block; font-size: .875rem; font-weight: 500; color: var(--muted); margin: 0 0 .3rem .1rem; }
.photo-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.photo-row img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: var(--fill); }
.photo-add { width: 84px; height: 84px; border-radius: 10px; background: var(--fill); display: grid; place-items: center; margin: 0;
  color: var(--tint); font-weight: 600; font-size: .9rem; cursor: pointer; }
.photo-add:hover { background: var(--fill-strong); }
.walk-check { min-height: 44px; align-items: center; }
.walk-check input { margin-top: 0; width: 22px; height: 22px; min-height: 0; }

.walk-bar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem;
  padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom)); background: var(--bg); }
.walk-bar button { min-height: 48px; }
@media (max-width: 720px) {
  body:has(.tabbar:not([hidden])) .walk-bar { bottom: calc(3.6rem + env(safe-area-inset-bottom)); padding-bottom: .75rem; }
  .walk-bar { display: grid; grid-template-columns: 1fr; }
  .walk-bar button { width: 100%; }
  .walk-bar button.primary { min-height: 52px; font-size: 1.05rem; }
  .rate { width: 100%; }
  .rate label { flex: 1; }
  .rate-list .grow { flex-basis: 100%; }
}
.table td.cy-standing { min-width: 14rem; }

/* renew: the current step sits a card's gap below the checklist */
.cy-member #step:not(:empty) { margin-top: 1rem; }

/* renew: the first step when not in good standing. Says what to do, lists each thing in the way as a link to fix it
   (amber underline, ink text: not success green), and one line on whether it stops renewal. */
.cy-steplabel { font-weight: 600; }
.cy-member .checklist li:has(.cy-reasons) { align-items: flex-start; }
.cy-reasons { list-style: none; margin: .3rem 0 0; padding: 0; }
.cy-reasons li { min-height: 32px; display: flex; align-items: center; }
a.cy-fix { color: var(--ink); text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 1.5px; text-underline-offset: 3px; padding: .2rem 0; }
a.cy-fix:hover { color: var(--amber); }
.cy-why { margin: .3rem 0 0; font-size: .9rem; color: var(--muted); }

/* admin renewal: reasons as a short list; the bulk exception sits under the table */
.cy-reasons-admin { list-style: none; margin: 0; padding: 0; }
.cy-reasons-admin li + li { margin-top: .15rem; }
.cy-standing .chip { display: inline-block; margin-top: .3rem; }
.cy-bulk .quiet { margin-inline-start: .4rem; }
@media (max-width: 640px) {
  .cy-renew-table .row-actions .quiet, .cy-bulk .quiet { min-height: 44px; }
  /* phone: each holder is a stacked row (name and status, plots, reasons, action) instead of a 700px-wide table */
  .table-wrap:has(> .cy-renew-table) { overflow-x: visible; }
  .cy-renew-table, .cy-renew-table tbody { display: block; }
  .table.cy-renew-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.cy-renew-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .75rem; align-items: center; padding: .75rem 1.25rem; }
  .table.cy-renew-table tr + tr { border-top: 1px solid var(--sep); }
  .table.cy-renew-table td, .table.cy-renew-table td:has(> .row-actions) { display: block; padding: 0; border: 0; text-align: start; min-width: 0; width: auto; }
  .table.cy-renew-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--muted); font-size: .9rem; }
  .table.cy-renew-table td:nth-child(2)::before { content: "Plot "; }
  .table.cy-renew-table td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .table.cy-renew-table td.cy-standing, .table.cy-renew-table td:last-child { grid-column: 1 / -1; min-width: 0; }
  .table.cy-renew-table td:last-child:has(.row-actions:empty) { display: none; }
}
.cycle-card .cc-carry { margin: .4rem 0 0; }

/* Renewal not open yet: what to settle first */
.cy-before { margin: .4rem 0 0; font-weight: 500; }

/* Member notice: the two answers, said once each */
.mn-choices { list-style: none; margin: .35rem 0 0; padding: 0; }
.mn-choices li + li { margin-top: .15rem; }

/* "Fixed" asks first, inline, with an optional note */
.cy-fixed { margin-top: .6rem; padding-top: .6rem; box-shadow: inset 0 .5px 0 var(--sep); }
.cy-fixed p { margin: 0; }
.nrow > .cy-fixed { grid-column: 1 / -1; }

/* Walk: section filter and vacant toggle above the plot strip; an old walk's age; continue-or-new chooser */
.walk-filter { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; margin: 0 0 .6rem; }
.walk-filter select { width: auto; min-height: 40px; }
.walk-filter .check { margin: 0; }
.walk-old { margin-bottom: .8rem; }
.walk-old .actions, .walk-choose .actions, #fixprompt .actions { margin-top: .4rem; }
.walk-choose { margin-bottom: 1rem; }
.walk-choose p { margin: 0; }
.walk-age { margin: -.25rem 0 .8rem; }

/* A holder away on plot cover, and an appeal waiting long enough to reach the admins. */
.cy-away, .cy-late { margin: 4px 0 0; color: var(--muted); }
.cy-late { color: var(--ink); }
.cy-late::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-end: 6px; border-radius: 50%; background: var(--amber); vertical-align: 1px; }
.walk-away { margin: 0; }
.cy-close-appeal { margin: 8px 0 0; }
.cy-close-appeal .link { padding: 0; min-height: 0; }

/* Renew page: steps locked until the member is in good standing look disabled and say so in words */
.cy-member .checklist li.locked { color: var(--muted); }
.cy-member .checklist li.locked .state { color: var(--muted); box-shadow: inset 0 0 0 1px var(--sep); }
.cy-member .checklist li.locked .state svg { width: 12px; height: 12px; stroke-width: 1.8; }
.cy-locked { display: block; font-size: .875rem; color: var(--muted); }
.cy-contact { margin: .8rem 0 0; color: var(--muted); }
.cy-contact a { color: var(--ink); }
.cy-decline { margin-top: 1rem; }
.cy-decline p { margin: 0; }
.cy-decline .actions { margin-top: .35rem; }
.cy-closed > * + * { margin-top: .35rem; }

/* Renewals admin: closing sits with the current run; the last closed run lists each former holder */
.cy-close { margin-bottom: 1.25rem; }
.cy-past + .card { margin-top: 1rem; }
.cy-past-title { margin: 0 0 .25rem; font-size: 1rem; }
.cy-past-title .row-meta { font-weight: 400; margin-inline-start: .4rem; }
.cy-past > p { margin: 0 0 .6rem; }
.cy-rel { display: block; }
.cy-exc-why { display: block; margin-top: .2rem; }
.cy-exc { margin-top: .5rem; min-width: 14rem; }
.cy-exc .actions { margin-top: .4rem; }
.cy-exc-all { margin-top: .75rem; }
.cy-exc-all p { margin: 0; }
.cy-fees-help { margin: -.25rem 0 1rem; }

/* Walk: a head farmer's section is finished; the whole walk is finished */
.walk-section-done { margin: 0 0 .8rem; }
.walk-finish { margin-top: 1rem; }

/* Round 14 decisions: this season's hours and fees as warnings (1), leaving the garden (9, 20), late renewal (14). */
.cy-rule { margin: -.25rem 0 1rem; }
.cy-warnings .cy-why { margin-top: .4rem; }
.cy-leaving .cy-leave-opt + .cy-leave-opt { border-top: 1px solid var(--hair); padding-top: .6rem; }
.cy-leaving .cy-leave-opt > p { margin: 0; }
.cy-leaving .actions { margin-top: .4rem; }
.cy-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cy-inline input[type=date] { max-width: 12rem; }
.cy-sub-title { font-size: 1rem; margin: .75rem 0 .25rem; }

/* plot check results: "Got it" / "It's fixed" (Home, Messages), and the results list */
.ck-ans { margin-top: .6rem; }
.ck-ans > * + * { margin-top: .35rem; }
.ck-due { font-weight: 500; }
.ck-due.late { color: var(--red); }
.ck-said { color: var(--muted); }
.ck-btns button { min-height: 44px; }
@media (max-width: 560px) { .ck-btns > button { flex: 1 1 auto; } }
.ck-items li { min-height: 0; }
.ckr-facts { margin: 0 0 .75rem; }
.ckr-row > * + * { margin-top: .15rem; }
.ckr-row .row-title { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .5rem; }
.ck-yes { color: var(--tint); }
.ck-no { color: var(--amber, var(--muted)); font-weight: 500; }
/* Step 5: Registration Day checklist, one row per renewing plot (phone first) */
.rd-filter { margin: .25rem 0 .75rem; display: flex; flex-wrap: wrap; }
.rd-filter .rd-n { color: var(--muted); font-weight: 500; margin-inline-start: .2rem; }
.rd-filter button { flex: 1 1 auto; min-height: 44px; padding: .3rem .6rem; white-space: nowrap; }
.rd-list .rd-row { display: block; }
.rd-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; }
.rd-ticks { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .2rem .9rem; font-size: .9rem; }
.rd-ticks li { display: flex; gap: .4rem; align-items: baseline; min-width: 0; }
.rd-ticks li.no { color: var(--muted); }
.rd-ticks .rd-mark { width: 1rem; flex: none; text-align: center; font-weight: 700; }
.rd-ticks li.ok .rd-mark { color: var(--tint); }
.rd-foot { margin-top: .55rem; }
.rd-foot button { min-height: 44px; }
.rd-okd, .rd-late { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; margin: .35rem 0 0; }
.rd-day { margin: 0 0 .75rem; }
.rd-day form { margin-top: .4rem; }

/* A Needs-work item's own note, photos and drawings (plot check walk) */
.rate-list .fix-detail { flex: 1 1 100%; gap: .6rem; padding: .7rem .8rem; margin-top: .2rem; border-radius: 12px;
  background: color-mix(in srgb, var(--amber) 10%, var(--surface)); }
.rate-list .fix-detail[hidden] { display: none; }
.photo-row .pic { position: relative; display: block; }
.photo-row .pic-draw { padding: 0; border: 0; background: none; min-height: 0; border-radius: 10px; display: block; cursor: pointer; }
.photo-row .pic-x { position: absolute; top: -8px; inset-inline-end: -8px; width: 32px; height: 32px; min-height: 0; padding: 0;
  border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; line-height: 1; background: var(--surface);
  color: var(--ink); border: 1px solid var(--sep); box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
button.photo-add { border: 0; padding: 0; min-height: 0; }

/* Drawing screen (js/draw.js): full screen, tools at the thumb */
.draw-dlg { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: #1b1b1b; color: #fff; display: flex; flex-direction: column; }
.draw-dlg:not([open]) { display: none; }
.draw-dlg::backdrop { background: #1b1b1b; }
.draw-top, .draw-tools { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; flex-wrap: wrap; }
.draw-top { justify-content: space-between; padding-top: calc(.6rem + env(safe-area-inset-top)); }
.draw-tools { justify-content: center; padding-bottom: calc(.8rem + env(safe-area-inset-bottom)); }
.draw-title { font-weight: 600; text-align: center; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draw-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: .4rem; }
.draw-stage canvas { width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 9.5rem); touch-action: none; background: #fff; border-radius: 6px; cursor: crosshair; }
.draw-group { display: inline-flex; gap: .45rem; align-items: center; }
.draw-dlg button { min-height: 44px; }
.draw-dlg .quiet { color: #fff; background: rgb(255 255 255 / .12); }
.draw-dlg .quiet[aria-pressed="true"] { background: rgb(255 255 255 / .34); }
.draw-dlg button:disabled { opacity: .45; }
.draw-color { width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--c); border: 3px solid rgb(255 255 255 / .35); }
.draw-color[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px #4ea1ff; }
.draw-group > button { flex: none; }
.draw-group > .quiet { padding: 0 .95rem; }
.draw-tools { row-gap: .55rem; }
.walk-by { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .5rem; margin: -.4rem 0 .8rem; }
.walk-by .walk-by-form { flex: 1 1 100%; }
.walk-by .link { min-height: 44px; }
.cl-items { margin: .5rem 0 0; padding-inline-start: 1.4rem; display: grid; gap: .3rem; }
#checklist { scroll-margin-top: 5.5rem; }
/* Checklist items numbered by the app: same size, numbers lined up (10 no wider than 9) */
.item-line { display: flex; gap: .45rem; align-items: baseline; }
.item-num { flex: none; min-width: 1.6em; text-align: end; font: inherit; font-variant-numeric: tabular-nums; color: var(--muted); }
ol.cl-items { list-style: none; padding-inline-start: 0; }
