/* The DNRC Toolkit page (src/dnrc/dnrc-twin.js). Cards, tables, pills, tabs, pagers and the pop-up are the shared .wqx-*
   classes in wq-twin.css; only what this page adds is here. Colour comes from tokens only; no gradients, no blur, no
   coloured edge stripes, no keyframes (styles/motion.css owns those). The worksheets (.dn-ws) keep the legacy .dnrc-card
   markup that src/form-wizards.js listens for; they are restyled here as flat rows. */

/* ── fullscreen mode ────────────────────────────────────────────────
   The DNRC Toolkit is a wide page, not a side panel: hide the layer column, map and right drawer and give the left panel the
   whole viewport, as the enforcement and exempt-well hubs do (the class comes from MODE_MAP in src/app-navigation.js). */
#main-content.commissioner-mode > #layer-column,
#main-content.commissioner-mode > #map-area,
#main-content.commissioner-mode > #right-drawer { display: none; }
#main-content.commissioner-mode > #left-panel { width: 100%; max-width: none; flex: 1 1 auto; border-right: none; background: var(--bg-0); overflow: hidden; }
#main-content.commissioner-mode > #left-panel > .lp-head,
#main-content.commissioner-mode > #left-panel > .lp-expand-btn,
#main-content.commissioner-mode > #left-panel > .lp-collapse-btn { display: none; }
#main-content.commissioner-mode #panel-scroll { background: var(--bg-0); padding: 0; }
#main-content.commissioner-mode #cat-commissioner { padding: var(--guide-sp-6, 24px) var(--guide-sp-8, 32px); max-width: 1600px; margin: 0 auto; width: 100%; box-sizing: border-box; }
@media (max-width: 640px) { #main-content.commissioner-mode #cat-commissioner { padding: var(--guide-sp-4, 16px); } }

.dn { display: grid; gap: 18px; }
.dn-trust { margin: 0 0 10px; font-size: var(--guide-fs-sm); line-height: 1.5; color: var(--guide-color-ink-soft); max-width: 62em; }
.dn-lede { margin: 0 0 8px; font-size: var(--guide-fs-md); line-height: 1.5; font-weight: 600; }
.dn-steps { margin: 10px 0; padding-left: 22px; display: grid; gap: 12px; font-size: var(--guide-fs-md); line-height: 1.5; max-width: 62em; }
.dn-steps li > span { display: block; }
.dn-forms { margin-top: 4px; font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }
.dn-lawrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dn-clock { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--guide-color-border-default); border-radius: 10px; background: var(--guide-color-bg-1); font-size: var(--guide-fs-sm); line-height: 1.5; max-width: 62em; }
.dn-office { margin: 10px 0; font-size: var(--guide-fs-sm); line-height: 1.6; }
.dn-status { font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }

/* the five paths: a grid of plain buttons, one on at a time */
.dn-doors { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.dn-door { width: 100%; height: 100%; text-align: left; display: grid; gap: 3px; padding: 12px 14px; font: inherit; color: var(--guide-color-ink); background: var(--guide-color-paper); border: 1px solid var(--guide-color-border-strong); border-radius: 10px; cursor: pointer; min-height: 44px; }
.dn-door b { font-size: var(--guide-fs-md); line-height: 1.35; }
.dn-door span { font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); line-height: 1.4; }
.dn-door:hover { border-color: var(--guide-color-ink); }
.dn-door.is-on { background: var(--guide-color-bg-2); border-color: var(--guide-color-ink); border-width: 2px; padding: 11px 13px; }
.dn-door:focus-visible { outline: 2px solid var(--guide-color-signal); outline-offset: 2px; }
.dn-door-panel { scroll-margin-top: 80px; background: var(--guide-color-bg-1); border-color: var(--guide-color-border-strong); }

/* the statements you can paste */
.dn-stmts { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; max-width: 52em; }
.dn-stmt p { margin: 0 0 2px; font-size: clamp(16px, 2.6vw, 20px); line-height: 1.45; }
.dn-stmt small { display: block; color: var(--guide-color-ink-muted); font-size: var(--guide-fs-xs); line-height: 1.4; }
.dn-stamp { margin-top: 10px; }
.dn-facts { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: var(--guide-fs-sm); line-height: 1.5; max-width: 62em; }

/* the map: counties shaded one hue in five steps */
.dn-mapwrap { max-width: 900px; }
.dn-map { width: 100%; height: auto; display: block; }
.dn-co.dn-s0 { fill: color-mix(in srgb, var(--guide-color-lake) 8%, var(--guide-color-paper)); }
.dn-co.dn-s1 { fill: color-mix(in srgb, var(--guide-color-lake) 20%, var(--guide-color-paper)); }
.dn-co.dn-s2 { fill: color-mix(in srgb, var(--guide-color-lake) 34%, var(--guide-color-paper)); }
.dn-co.dn-s3 { fill: color-mix(in srgb, var(--guide-color-lake) 50%, var(--guide-color-paper)); }
.dn-co.dn-s4 { fill: color-mix(in srgb, var(--guide-color-lake) 66%, var(--guide-color-paper)); }
.dn-key.dn-s0 { background: color-mix(in srgb, var(--guide-color-lake) 8%, var(--guide-color-paper)); }
.dn-key.dn-s1 { background: color-mix(in srgb, var(--guide-color-lake) 20%, var(--guide-color-paper)); }
.dn-key.dn-s2 { background: color-mix(in srgb, var(--guide-color-lake) 34%, var(--guide-color-paper)); }
.dn-key.dn-s3 { background: color-mix(in srgb, var(--guide-color-lake) 50%, var(--guide-color-paper)); }
.dn-key.dn-s4 { background: color-mix(in srgb, var(--guide-color-lake) 66%, var(--guide-color-paper)); }
.dn-co { fill: var(--guide-color-bg-1); stroke: var(--guide-color-border-strong); stroke-width: 0.8; cursor: pointer; }
.dn-co.is-sel { stroke: var(--guide-color-ink); stroke-width: 2.2; }
.dn-co:hover { stroke: var(--guide-color-ink); stroke-width: 1.6; }
.dn-co:focus-visible { outline: 2px solid var(--guide-color-signal); outline-offset: 1px; }
.dn-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--guide-color-bg-1); border: 1px solid var(--guide-color-border-strong); margin-right: 6px; vertical-align: -1px; }

/* the range chart: the dot is the median, the bar the middle half, the thin line the whole spread */
.dn-range .dn-whisk { stroke: var(--guide-color-ink-muted); stroke-width: 1.5; }
.dn-range .dn-med { fill: var(--guide-color-paper); stroke: var(--guide-color-ink); stroke-width: 2; }
.dn-range g:focus-visible { outline: 2px solid var(--guide-color-signal); }

/* status pills: the label is always written; colour only repeats it. A long label wraps instead of widening a phone's table. */
.dn-pill { white-space: normal; display: inline-block; max-width: 100%; }
.dn-pill.dn-pending { background: color-mix(in srgb, var(--guide-color-mt-amber) 22%, var(--guide-color-paper)); }
.dn-pill.dn-decided { background: color-mix(in srgb, var(--guide-color-moss) 16%, var(--guide-color-paper)); }
.dn-pill.dn-ended { background: var(--guide-color-bg-2); }
.dn-pill.dn-listed { background: var(--guide-color-paper); border: 1px solid var(--guide-color-border-strong); }
.dn-open { background: var(--guide-color-bg-2); border: 1px solid var(--guide-color-ink); white-space: normal; }

/* the lists */
.dn-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 10px; }
.dn-filters label { display: grid; gap: 3px; font-size: var(--guide-fs-xs); color: var(--guide-color-ink-soft); }
.dn-filters select, .dn-filters input { min-height: 40px; max-width: 100%; font: inherit; font-size: var(--guide-fs-sm); color: var(--guide-color-ink); background: var(--guide-color-paper); border: 1px solid var(--guide-color-border-strong); border-radius: 8px; padding: 0 10px; }
.dn-rowbtn { text-align: left; }
.dn-rowbtn small, .dn-sub { color: var(--guide-color-ink-muted); font-size: var(--guide-fs-xs); }
.dn-sub { display: block; margin-top: 2px; }
.dn-table td, .dn-table th { vertical-align: top; }
.dn-formact { display: grid; gap: 6px; justify-items: start; }
.dn-fees th, .dn-fees td { vertical-align: top; }

/* one record */
.dn-record { scroll-margin-top: 80px; border-color: var(--guide-color-border-strong); background: var(--guide-color-bg-1); }
.dn-record h3 small { color: var(--guide-color-ink-muted); font-size: var(--guide-fs-sm); font-weight: 500; }
.dn-lines { margin: 8px 0; padding-left: 20px; display: grid; gap: 6px; font-size: var(--guide-fs-md); line-height: 1.5; max-width: 62em; }
.dn-facts-table th { width: 38%; font-weight: 600; }
.dn-facts-table small { color: var(--guide-color-ink-muted); font-size: var(--guide-fs-xs); }
.dn-links { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--guide-fs-sm); }

/* the worksheets: legacy cards as flat rows, one hue, no icons' colour, no edge stripes */
.dn-ws-group { margin: 12px 0 0; }
.dn-ws-group h4 { margin: 0 0 2px; font-size: var(--guide-fs-md); }
.dn-ws-note { margin: 0 0 6px; font-size: var(--guide-fs-xs); color: var(--guide-color-ink-muted); line-height: 1.5; max-width: 62em; }
.dn-ws .dnrc-cards { display: grid; gap: 0; border: 1px solid var(--guide-color-border-default); border-radius: 10px; overflow: hidden; }
.dn-ws .dnrc-card { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; width: 100%; padding: 10px 12px; font: inherit; color: var(--guide-color-ink); background: var(--guide-color-paper); border: 0; border-top: 1px solid var(--guide-color-border-subtle); border-radius: 0; cursor: pointer; min-height: 44px; box-shadow: none; overflow: visible; }
.dn-ws .dnrc-card::before { content: none; }
.dn-ws .dnrc-card:first-child { border-top: 0; }
.dn-ws .dnrc-card:hover { background: var(--guide-color-bg-1); }
.dn-ws .dnrc-card--active { background: var(--guide-color-bg-2); }
.dn-ws .dnrc-card i { color: var(--guide-color-ink-soft); }
.dn-ws .dnrc-card strong { display: block; font-size: var(--guide-fs-sm); }
.dn-ws .dnrc-card span { display: block; font-size: var(--guide-fs-xs); color: var(--guide-color-ink-soft); line-height: 1.4; }
.dn-ws .dnrc-calc-panel { padding: 10px 12px 14px; background: var(--guide-color-bg-1); border-top: 1px solid var(--guide-color-border-subtle); }

@media (max-width: 640px) {
  .dn-table th:nth-child(2), .dn-table td:nth-child(2) { display: none; }
  .dn-forms-table th:nth-child(3), .dn-forms-table td:nth-child(3) { display: none; }
  .dn-filters label { flex: 1 1 140px; }
  .dn-filters select, .dn-filters input { width: 100%; }
  .dn-doors { grid-template-columns: minmax(0, 1fr); }
}

/* the printed page: the finder, filters, buttons, pagers, worksheets and pop-up are left off; every card is kept whole */
@media print {
  .dn-finder, .dn-door-panel, .dn .wqx-actions, .dn .wqx-tabs, .dn-filters, .dn .wqx-pager, #dn-ws, #dn-forms { display: none !important; }
  .dn { gap: 10px; }
  .dn-record, .dn-stmt { break-inside: avoid; }
  .dn-map { max-height: 300px; }
}
