/* Mitigation and Markets (src/market/market-twin.js). Cards, tables, pills, tabs, pagers, the pop-up and the map controls are the shared
   .wqx-* classes (wq-twin.css) and the Conservation overview's .cnv-* classes (conserve-twin.css); only what this page adds is here.
   Colour comes from tokens only, one hue: the kind of a dot is carried by its shape, never by a hue. No new keyframes. */

/* The page replaces the hub's landing, so it hides while one of the hub's sub-pages is open, and the older tools fold with it. */
.market-fs-scroll:has(.hydro-sub:not([hidden])) > #market-twin,
.market-fs-scroll:has(.hydro-sub:not([hidden])) > #mkt-tools { display: none; }

/* the map: county outlines in one neutral tone, one mark per point of diversion */
.mkt-map { width: 100%; height: auto; display: block; max-height: 560px; }
.mkt-co { stroke: var(--guide-color-border-strong); stroke-width: 0.8; cursor: pointer; fill: var(--guide-color-bg-1); }
.mkt-co.is-sel { stroke: var(--guide-color-ink); stroke-width: 2.2; fill: var(--guide-color-paper); cursor: default; }
.mkt-co:hover { stroke: var(--guide-color-ink); stroke-width: 1.6; }
.mkt-co:focus-visible { outline: 2px solid var(--guide-color-signal); outline-offset: 1px; }
.mkt-dot { fill: var(--guide-color-lake); stroke: var(--guide-color-paper); stroke-width: 1.6; cursor: pointer; }
.mkt-dot--ring { fill: none; stroke: var(--guide-color-lake); stroke-width: 1.8; }
.mkt-dot.is-on, .mkt-dot:hover { stroke: var(--guide-color-signal); stroke-width: 2.4; }
.mkt-dot:focus-visible { outline: 2px solid var(--guide-color-signal); }
.mkt-shape { width: 16px; height: 16px; flex: none; vertical-align: -3px; margin-right: 6px; }
.mkt-shape .mkt-dot { cursor: default; stroke: none; }
.mkt-shape .mkt-dot--ring { stroke: var(--guide-color-lake); stroke-width: 1.8; }

/* the review-time range: the thin line is fastest to slowest, the box the middle half, the tick the median */
.mkt-range { stroke: var(--guide-color-ink-muted); stroke-width: 2; stroke-linecap: round; }
.mkt-iqr { fill: color-mix(in srgb, var(--guide-color-lake) 28%, var(--guide-color-paper)); stroke: var(--guide-color-lake); stroke-width: 1.2; }
.mkt-median { stroke: var(--guide-color-ink); stroke-width: 3; stroke-linecap: round; }

/* the table of what a market would need: a tag in words, no colour that says good or bad */
.mkt-gap td { vertical-align: top; }
.mkt-gap td:first-child { min-width: 14em; }
.mkt-gap small { display: block; margin-top: 3px; color: var(--guide-color-ink-muted); font-size: var(--guide-fs-xs); }
.mkt-tag { display: inline-block; margin: 0 8px 4px 0; padding: 2px 9px; border: 1px solid var(--guide-color-border-strong); border-radius: 999px; font-size: var(--guide-fs-xs); font-weight: 600; color: var(--guide-color-ink-soft); background: var(--guide-color-paper); }

/* the checklist, with real boxes to tick on paper */
.mkt-checklist { margin-top: 18px; }
.mkt-checklist > summary { cursor: pointer; padding: 10px 0; font-size: var(--guide-fs-md); }
.mkt-check { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; font-size: var(--guide-fs-sm); line-height: 1.5; }
.mkt-check li { display: flex; gap: 10px; align-items: flex-start; }
.mkt-check small { color: var(--guide-color-ink-muted); font-size: var(--guide-fs-xs); }
.mkt-box { flex: none; width: 14px; height: 14px; margin-top: 3px; border: 1.5px solid var(--guide-color-ink-soft); border-radius: 3px; }
.mkt-checklist h4 small { font-weight: 500; color: var(--guide-color-ink-muted); font-size: var(--guide-fs-xs); }

/* the 40-day lease ceiling */
.mkt-lease { margin-top: 20px; padding-top: 4px; border-top: 1px solid var(--guide-color-border-subtle); }
.mkt-lease .cnv-ctl { margin-bottom: 8px; }
.mkt-lease .cnv-sort input[type="number"] { min-width: 180px; }
.mkt-lease-out { margin-top: 8px; }

/* the closures list keeps its first column readable when a name is long */
.mkt .cnv-table td:first-child { min-width: 14em; }
.mkt .wqx-modal-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: var(--guide-fs-sm); line-height: 1.55; }

/* the older tools of the hub, one closed fold under the page */
.mkt-tools { margin: 24px 0 0; }
.mkt-tools > summary { cursor: pointer; padding: 12px 16px; border: 1px solid var(--guide-color-border-strong); border-radius: 12px; background: var(--guide-color-paper); font-size: var(--guide-fs-md); font-weight: 600; }
.mkt-tools[open] > summary { margin-bottom: 14px; }
.mkt-tools-note { max-width: 62em; margin: 0 0 14px; }

@media print {
  .mkt-tools, .mkt-lease form, .mkt .wqx-modal { display: none !important; }
  .mkt-print-one .mkt > *:not(#mkt-do) { display: none !important; }
  .mkt-print-one #mkt-do > *:not(.mkt-checklist) { display: none !important; }
  .mkt-print-one .mkt-checklist { margin-top: 0; }
  .mkt-print-one .mkt-checklist > summary { display: none; }
  .mkt-check li { break-inside: avoid; }
}
