/* The Agency Directory page (src/agency/agency-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). */

.ag { display: grid; gap: 18px; }
.ag-trust { margin: 0 0 10px; font-size: var(--guide-fs-sm); line-height: 1.5; color: var(--guide-color-ink-soft); max-width: 62em; }

/* the nine "what do you need to do" cards */
.ag-needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ag-need { width: 100%; height: 100%; display: grid; gap: 4px; align-content: start; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--guide-color-border-default); background: var(--guide-color-paper); color: var(--guide-color-ink); font: inherit; cursor: pointer; }
.ag-need b { font-size: var(--guide-fs-md); line-height: 1.3; }
.ag-need span { font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }
.ag-need-go { font-style: normal; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: var(--guide-fs-sm); font-weight: 600; color: var(--guide-color-lake); }
.ag-need-go svg { width: 14px; height: 14px; }
.ag-need:hover { border-color: var(--guide-color-border-strong); background: var(--guide-color-bg-1); }
.ag-need:focus-visible { outline: 2px solid var(--guide-color-signal); outline-offset: 2px; }

/* the memo sentence */
.ag-big { max-width: 46em; font-size: clamp(18px, 3.2vw, 24px); }
.ag-srcs { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: var(--guide-fs-sm); }
.ag-status { font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }

/* county: map beside the office */
.ag-county-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .ag-county-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.ag-map { width: 100%; height: auto; display: block; }
.ag-co { fill: var(--guide-color-bg-1); stroke: var(--guide-color-border-strong); stroke-width: 0.8; cursor: pointer; }
.ag-co.is-office { fill: color-mix(in srgb, var(--guide-color-lake) 28%, var(--guide-color-paper)); }
.ag-co.is-sel { fill: color-mix(in srgb, var(--guide-color-lake) 55%, var(--guide-color-paper)); stroke: var(--guide-color-ink); stroke-width: 2; }
.ag-co:hover { stroke: var(--guide-color-ink); stroke-width: 1.6; }
.ag-co:focus-visible { outline: 2px solid var(--guide-color-signal); outline-offset: 1px; }
.ag-office { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--guide-color-border-default); background: var(--guide-color-paper); }
.ag-office h4 { margin: 0 0 6px; font-size: var(--guide-fs-md); }
.ag-lines { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--guide-fs-sm); line-height: 1.45; }
.ag-lines li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ag-lines svg { width: 14px; height: 14px; flex: none; align-self: center; color: var(--guide-color-ink-muted); }
.ag-lines small { color: var(--guide-color-ink-muted); font-size: var(--guide-fs-xs); }
.ag-facts { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: var(--guide-fs-sm); line-height: 1.5; }
.ag-facts small { display: block; color: var(--guide-color-ink-muted); font-size: var(--guide-fs-xs); }
.ag-open { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.ag-open li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--guide-color-border-default); font-size: var(--guide-fs-sm); overflow-wrap: anywhere; }
.ag-open li > .wqx-link { justify-self: start; text-align: left; }
.ag-open span { color: var(--guide-color-ink-soft); font-size: var(--guide-fs-xs); }
.ag-others { margin-top: 14px; }
.ag-others-list { margin: 8px 0 0; padding-left: 20px; columns: 2 240px; font-size: var(--guide-fs-sm); line-height: 1.7; }

/* desks */
.ag-decides { margin: 0 0 10px; font-size: var(--guide-fs-sm); line-height: 1.5; color: var(--guide-color-ink-soft); }
.ag-desk .wqx-links, .wqx-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: var(--guide-fs-sm); }
.ag-readings { margin-top: 10px; }
.wqx-tile b span { font-size: var(--guide-fs-xs); font-weight: 500; color: var(--guide-color-ink-soft); }

/* decree record */
.ag-rowbtn { text-align: left; }
.ag-rowbtn small { color: var(--guide-color-ink-muted); }
.ag-record { margin-top: 16px; padding: 14px; border-radius: 12px; border: 1px solid var(--guide-color-border-strong); background: var(--guide-color-bg-1); scroll-margin-top: 80px; }
.ag-record h4 { margin: 0 0 6px; font-size: var(--guide-fs-lg); }
.ag-timeline { width: 100%; height: auto; display: block; margin: 8px 0; }
.ag-axis { stroke: var(--guide-color-border-strong); stroke-width: 1.5; }
.ag-today { stroke: var(--guide-color-ink-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.ag-dot { fill: var(--guide-color-paper); stroke: var(--guide-color-ink); stroke-width: 2; }
.ag-dot.is-ahead { fill: var(--guide-color-lake); stroke: var(--guide-color-paper); }
.ag-dot-lbl { font-size: 12px; fill: var(--guide-color-ink); }
.ag-dot-date { font-size: 12px; fill: var(--guide-color-ink-soft); }

/* steps and roles (cards and the roles panel) */
.ag-steps { margin: 10px 0; padding-left: 22px; display: grid; gap: 8px; font-size: var(--guide-fs-md); line-height: 1.5; }
.ag-lede { margin: 0 0 8px; font-size: var(--guide-fs-md); line-height: 1.5; }

.wqx-modal-card h4 { margin: 14px 0 4px; font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }

@media (max-width: 640px) {
  .ag-needs { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ag-need { padding: 10px 12px; }
  .ag-need-go { display: none; }
  .ag-decrees th:nth-child(2), .ag-decrees td:nth-child(2), .ag-decrees th:nth-child(3), .ag-decrees td:nth-child(3) { display: none; }
}

/* the printed county sheet: the finder, tabs, buttons and pop-up are left off; every card is kept whole */
@media print {
  .ag-finder, .ag-needs, .ag .wqx-actions, .ag .wqx-tabs, .ag-others-list { display: none !important; }
  .ag { gap: 10px; }
  .ag-record, .ag-office, .ag-open li { break-inside: avoid; }
  .ag-map { max-height: 260px; }
}
