/* Zones: the drawing editor, the admin list, and the contact panel that
   hangs off a report page.  Every colour here is a token from app.css --
   the Leaflet shapes get theirs through `currentColor`, which is why the
   paths below are styled by class rather than by a hard-coded stroke. */

/* ------------------------------------------------------------- the editor */
.zone-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}
.zone-map-card { display: flex; flex-direction: column; gap: 10px; }
.zone-map {
  height: min(68vh, 620px);
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--map-bg);
}
.zone-map.drawing { cursor: crosshair; }

/* The same editor as a popout on /settings/regions rather than as a page of
   its own.  app.css's own `dialog` rule sizes a dialog for the plate and
   note fields it was written for, which is too narrow for a map and its
   drawing tools to be worth using -- so this widens the one wrapping the
   region editor back out, while leaving the form itself to stack the way it
   always has.  The line under the map is the coordinates the click settled,
   which app.css dims and spaces the same way inside any dialog. */
.region-editor-dialog { width: min(640px, 94vw); }
.region-editor { display: flex; flex-direction: column; gap: 10px; }
.region-editor .zone-map { height: min(46vh, 380px); }
.region-editor .where {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
  font-family: ui-monospace, Menlo, monospace;
}
.region-editor menu {
  display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 0;
}
.zone-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.zone-side { display: flex; flex-direction: column; gap: 16px; }
.zone-side .card { margin-bottom: 0; }

/* The corner grabs.  A square reads as "drag me" against the round report
   markers, and the ring keeps it visible over both pale and dark tiles. */
.zone-handle {
  background: var(--accent);
  border: 2px solid var(--map-stroke);
  border-radius: 3px;
  box-shadow: 0 1px 3px var(--backdrop);
  cursor: pointer;
}
.zone-handle:hover { background: var(--accent-2); }

.leaflet-container .zone-shape { color: var(--accent); }
/* A zone that is not the one being edited borrows the watch colour on
   purpose: it is the only map ink left that is neither a status nor --zone,
   and reusing it says "context, not the subject" without a fourth hue. */
.leaflet-container .zone-other { color: var(--watch); }

.zone-links { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.zone-link { display: flex; gap: 6px; align-items: center; }
.zone-link input { margin-top: 0; }
.zone-link input:first-child { flex: 0 0 34%; }
.zone-link input:nth-child(2) { flex: 1 1 auto; }

.zone-mods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px 16px;
  margin-bottom: 12px;
}
.zone-mods label.check { margin: 4px 0; }

/* --------------------------------------------------------------- the list */
table.zone-table td.row { gap: 6px; }
table.zone-table td .pill { vertical-align: middle; }

/* ------------------------------------------------------- the contact panel */
.region-contact.unlocked { border-color: var(--ok); }
.region-contact-rows { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.region-contact .region-call { background: var(--ok); color: var(--accent-ink); }
.region-contact-links li { border-bottom: 0; padding: 4px 0; }
.region-contact .region-where { margin: 4px 0 12px; }
/* The per-region note, kept in this browser rather than sent anywhere --
   styled like the rest of a form on a card rather than boxed off as
   something separate, since typing into it is as ordinary an act as filing
   the reprise below it. */
.region-contact-note { margin: 4px 0 12px; }
.region-contact-note label { display: block; margin-bottom: 4px; }
.region-contact-note textarea { width: 100%; box-sizing: border-box; }
/* The 311 form's description, to be copied rather than edited: the same
   full width as the note above it, so a long template reads as a paragraph. */
.region-311 { margin: 12px 0; }
.region-311-text { width: 100%; box-sizing: border-box; }
/* The PublicStuff form: its own labels stacked full width like the reprise
   form's, and what a dry run would have sent shown as sent, line by line. */
.ps311 label, .ps311-login label { display: block; margin: 8px 0 0; }
.ps311 input:not([type=checkbox]), .ps311 select { width: 100%; box-sizing: border-box; }
.ps311-field { margin: 8px 0; }
.ps311-field .check { display: flex; gap: 6px; align-items: center; margin: 4px 0 0; }
.ps311-preview { white-space: pre-wrap; word-break: break-word; font-size: 12px;
  background: var(--panel-2, rgba(127,127,127,.08)); padding: 8px; border-radius: 6px; }
.ps311-login { margin-top: 12px; }
.region-reprise { margin-top: 12px; }
.region-reprise .row-form { margin-bottom: 4px; }
.region-reprise label { margin: 10px 0 0; }

@media (max-width: 900px) {
  .zone-editor { grid-template-columns: 1fr; }
  .zone-map { height: 55vh; }
}

/* ------------------------------------------------- the Courses card's map */
/* Sat inline in a card rather than filling a dialog or a page of its own, so
   the tall default height above would leave little of the rest of the
   Courses card on screen at once -- everything but the height is still
   .zone-map's. */
.waypoint-map { height: min(40vh, 320px); }
.waypoint-list {
  display: flex; flex-direction: column; gap: 6px;
  margin: 8px 0 0; padding: 0; list-style: none;
}
.waypoint-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line-soft);
}
