/* Permit Gopher components, built from web/design/design-system/DesignSystem.dc.html.
   Colours and fonts only through the --pg-* tokens in tokens.css. Phone first; 390 px must pass. */

* { box-sizing: border-box; }
body { margin: 0; background: var(--pg-white); color: var(--pg-ink); font: 400 16px/1.5 var(--pg-font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--pg-link); }
a:hover { color: var(--pg-steel); }
h1, h2, h3 { font-family: var(--pg-font-head); font-weight: 800; line-height: 1; margin: 0; }
p { margin: 0; }
ul { margin: 8px 0 0; padding-left: 20px; }
li { margin: 4px 0; }
img { max-width: 100%; }

.pg-stripe { height: 4px; background: var(--pg-safety); }
.pg-wrap { width: 100%; max-width: var(--pg-max); margin: 0 auto; padding-left: var(--pg-gutter); padding-right: var(--pg-gutter); }
.pg-main { padding-top: 20px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 40px; }
.pg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type helpers */
.pg-display { font-size: 40px; line-height: 0.95; }
.pg-h1 { font-size: 40px; line-height: 0.95; }
.pg-h2 { font-size: 32px; }
.pg-h3 { font-size: 28px; }
@media (min-width: 768px) {
  .pg-display { font-size: 64px; }
  .pg-h1 { font-size: 56px; }
  .pg-h2 { font-size: 36px; }
  .pg-h3 { font-size: 32px; }
}
section > h2, .pg-section-head h2 { font-size: 32px; }
.pg-lead { font-size: 18px; line-height: 1.55; color: var(--pg-ink-2); }
.pg-lead strong { color: var(--pg-ink); }
.pg-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pg-muted); }
.pg-mono { font-family: var(--pg-font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.pg-muted { color: var(--pg-muted); }
.pg-ink2 { color: var(--pg-ink-2); }
.pg-small { font-size: 14px; color: var(--pg-ink-2); }
.pg-caption { font-size: 13px; line-height: 1.5; color: var(--pg-muted); }
.pg-note { font-size: 14px; color: var(--pg-muted); }
.pg-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pg-muted); }
.pg-big { font-size: 20px; }
.pg-big2 { font-size: 18px; font-weight: 600; }
.pg-right { text-align: right; }
.pg-num { text-align: right; }
.pg-empty { padding: 16px; background: var(--pg-sand); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); color: var(--pg-ink-2); }

/* Header: brand, nav; nav folds into a 44 px menu button below 900 px (no JavaScript) */
.pg-header { border-bottom: 1px solid var(--pg-line); }
.pg-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.pg-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--pg-ink); }
.pg-brand svg { flex: none; }
.pg-brand-text { display: flex; flex-direction: column; }
.pg-wordmark { font-family: var(--pg-font-head); font-weight: 800; font-size: 26px; line-height: 1; }
.pg-descriptor { font-size: 12px; color: var(--pg-muted); }
.pg-menu summary { list-style: none; width: 44px; height: 44px; border: 2px solid var(--pg-ink); border-radius: var(--pg-radius); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pg-menu summary::-webkit-details-marker { display: none; }
.pg-menu-bars, .pg-menu-bars::before, .pg-menu-bars::after { display: block; width: 20px; height: 2px; background: var(--pg-ink); position: relative; }
.pg-menu-bars::before, .pg-menu-bars::after { content: ""; position: absolute; left: 0; }
.pg-menu-bars::before { top: -6px; }
.pg-menu-bars::after { top: 6px; }
.pg-nav a { color: var(--pg-ink); text-decoration: none; font-weight: 500; }
.pg-nav .pg-nav-signin { color: var(--pg-link); }
.pg-nav-wide { display: none; }
.pg-nav-phone { display: flex; flex-direction: column; position: absolute; right: var(--pg-gutter); left: var(--pg-gutter); margin-top: 8px; background: var(--pg-white); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); padding: 4px 16px; z-index: 10; }
.pg-nav-phone a { font-size: 16px; padding: 12px 0; min-height: 44px; border-bottom: 1px solid var(--pg-line); }
.pg-nav-phone a:last-child { border-bottom: 0; }
@media (min-width: 900px) {
  .pg-menu { display: none; }
  .pg-nav-wide { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 28px; font-size: 15px; }
  .pg-nav-wide a { padding: 12px 0; }
}

/* Buttons: rust is the only action colour; secondary is ink outline; 48 px tall */
.pg-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; border: 0; border-radius: var(--pg-radius); background: var(--pg-rust); color: var(--pg-white); text-decoration: none; font-family: var(--pg-font-head); font-weight: 700; font-size: 19px; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.pg-btn:hover { background: var(--pg-rust-dark); color: var(--pg-white); }
.pg-btn-secondary { background: var(--pg-white); color: var(--pg-ink); border: 2px solid var(--pg-ink); padding: 10px 20px; }
.pg-btn-secondary:hover { background: var(--pg-sand); color: var(--pg-ink); }
.pg-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Tags and status badges */
.pg-tag { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pg-ink); background: var(--pg-sand); border: 1px solid var(--pg-line); border-radius: var(--pg-radius-chip); padding: 2px 6px; white-space: nowrap; }
.pg-status { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: var(--pg-radius-chip); white-space: nowrap; }
.pg-status-issued { color: var(--pg-ok); background: var(--pg-ok-bg); }
.pg-status-in_review { color: var(--pg-warn); background: var(--pg-warn-bg); }
.pg-status-refused { color: var(--pg-bad); background: var(--pg-bad-bg); }
.pg-status-closed { color: var(--pg-closed); background: var(--pg-white); border: 1px solid var(--pg-line); }
/* development-permit stages (pg.dev_permits) */
.pg-status-approved { color: var(--pg-ok); background: var(--pg-ok-bg); }
.pg-status-appealed { color: var(--pg-warn); background: var(--pg-warn-bg); }
.pg-status-other { color: var(--pg-closed); background: var(--pg-white); border: 1px solid var(--pg-line); }

/* Cards, panels */
.pg-card { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--pg-line); border-radius: var(--pg-radius); background: var(--pg-white); padding: 16px; color: var(--pg-ink); text-decoration: none; }
.pg-panel { background: var(--pg-sand); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }

/* Home */
.pg-hero { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-start; }
.pg-hero-text { flex: 6 1 420px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pg-weekcard { flex: 5 1 380px; padding: 0; gap: 0; min-width: 0; overflow: hidden; }
.pg-weekcard-head { padding: 14px 16px; background: var(--pg-steel); color: var(--pg-white); display: flex; flex-direction: column; gap: 4px; }
.pg-weekcard-head h2 { font-size: 24px; }
.pg-weekcard-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--pg-line); }
.pg-weekcard-row a { font-weight: 600; color: var(--pg-ink); }
.pg-weekcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--pg-sand); }
.pg-weekcard-foot a { padding: 10px 0; }
.pg-doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.pg-door { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--pg-line); border-top: 4px solid var(--pg-rust); border-radius: var(--pg-radius); color: var(--pg-ink-2); text-decoration: none; }
.pg-door-title { font-family: var(--pg-font-head); font-weight: 800; font-size: 26px; color: var(--pg-ink); line-height: 1; }
.pg-door-link { color: var(--pg-link); font-weight: 600; margin-top: auto; padding-top: 8px; }
.pg-lookup { display: grid; gap: 16px; }
@media (min-width: 900px) { .pg-lookup { grid-template-columns: 1fr 1fr; align-items: end; } }
.pg-lookup h2 { font-size: 32px; }
.pg-lookup label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 6px; }
.pg-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.pg-inline input { flex: 1 1 220px; }
.pg-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pg-coverage { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 8px; }
.pg-two { display: grid; gap: 24px; }
@media (min-width: 900px) { .pg-two { grid-template-columns: 1fr 1fr; } }
.pg-two h3 { font-size: 24px; }
.pg-two p { color: var(--pg-ink-2); margin-top: 12px; }

/* Forms */
input[type=email], input[type=search], input[type=text], input[type=date], select { font: 400 16px var(--pg-font-body); padding: 11px 12px; border: 2px solid var(--pg-ink); border-radius: var(--pg-radius); min-height: 44px; background: var(--pg-white); color: var(--pg-ink); width: 100%; }
.pg-form { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--pg-line); border-top: 4px solid var(--pg-rust); border-radius: var(--pg-radius); }
.pg-form p { color: var(--pg-ink-2); font-size: 15px; }
.pg-form .pg-btn { align-self: flex-start; }
.pg-field { display: flex; flex-direction: column; gap: 6px; }
.pg-field label { font-size: 14px; font-weight: 600; }
.pg-casl { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--pg-sand); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); }
.pg-casl-row { display: flex; gap: 12px; align-items: flex-start; }
.pg-casl-row input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--pg-rust); }
.pg-casl-row label { font-size: 14px; line-height: 1.5; }
.pg-casl-who { font-size: 12px; line-height: 1.5; color: var(--pg-ink-2); padding-left: 34px; }

/* Address page */
.pg-crumbs { font-size: 14px; color: var(--pg-muted); margin-bottom: -16px; }
.pg-split { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-start; }
.pg-split-main { flex: 6 1 420px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pg-split-side { flex: 5 1 340px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pg-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--pg-line); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); overflow: hidden; }
.pg-facts > div { background: var(--pg-white); padding: 12px 14px; }
.pg-facts > div:first-child { grid-column: span 2; }
.pg-facts-even > div:first-child { grid-column: auto; }   /* address page census panel: an even grid */
@media (min-width: 900px) { .pg-facts-even { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* address page: "What this zoning allows" (zoning round one) */
.pg-zoning-uses { margin: 10px 0 0; }
.pg-zoning-uses .pg-label { display: block; margin-bottom: 2px; }
.pg-zoning-facts { margin: 14px 0 8px; font-size: 14px; }
.pg-zoning-facts .pg-label { margin-bottom: 4px; }
.pg-map { flex: 5 1 340px; margin: 0; border: 1px solid var(--pg-line); border-radius: var(--pg-radius); overflow: hidden; min-width: 0; }
.pg-map-frame { position: relative; background: #CFCBC4; aspect-ratio: 720 / 340; }
.pg-map-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pg-map-pin { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 4px solid var(--pg-rust); border-radius: 50%; background: rgba(181, 64, 15, 0.15); box-shadow: 0 0 0 2px var(--pg-white); }
/* The address chip over the map: never wider than the space left of the zoom buttons; a long address wraps.
   core/plan.py keeps Calgary's street names out of the box it covers on a phone (reserved()). */
.pg-map-label { position: absolute; left: 12px; top: 12px; max-width: calc(100% - 12px - 44px - 12px - 12px); border-radius: var(--pg-radius); padding: 6px 10px; }
.pg-map-addr { display: block; font-family: var(--pg-font-head); font-weight: 800; line-height: 1; letter-spacing: 0.02em; }
.pg-map-src { display: block; margin-top: 4px; line-height: 14px; }
.pg-map-label-aerial { background: rgba(22, 22, 22, 0.72); color: var(--pg-white); } /* --pg-ink #161616 at 72 %: photos are busy and mid-dark */
.pg-map-label-aerial .pg-map-addr { font-size: 24px; }
.pg-map-label-aerial .pg-map-src { color: var(--pg-white); opacity: 0.85; }
.pg-map-label-plan { background: var(--pg-white); border: 1px solid var(--pg-line); color: var(--pg-ink); }
.pg-map-label-plan .pg-map-addr { font-size: 20px; }
.pg-map-zoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; }
.pg-map-zoom button { width: 44px; height: 44px; background: var(--pg-white); border: 2px solid var(--pg-ink); border-radius: var(--pg-radius); font-size: 22px; font-weight: 600; cursor: pointer; color: var(--pg-ink); }
.pg-map figcaption { padding: 10px 14px; background: var(--pg-sand); border-top: 1px solid var(--pg-line); font-size: 12px; line-height: 1.5; color: var(--pg-muted); }
.pg-list { margin: 12px 0 0; padding: 0; list-style: none; border: 1px solid var(--pg-line); border-radius: var(--pg-radius); overflow: hidden; font-size: 14px; font-variant-numeric: tabular-nums; }
.pg-list > * { margin: 0; }
.pg-list > *:nth-child(even) { background: var(--pg-sand); }
.pg-permit { display: grid; grid-template-columns: 96px 1fr auto; gap: 4px 14px; padding: 11px 14px; border-bottom: 1px solid var(--pg-line); align-items: baseline; }
.pg-permit:last-child { border-bottom: 0; }
@media (max-width: 480px) {
  .pg-map-label-aerial .pg-map-addr { font-size: 20px; }
  .pg-map-label-plan .pg-map-addr { font-size: 18px; }
  .pg-permit { grid-template-columns: 1fr auto; }
  .pg-permit > span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}
.pg-permit strong { font-weight: 600; }
.pg-near { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--pg-line); }
.pg-near:last-child { border-bottom: 0; }
.pg-near a { color: var(--pg-ink); }
.pg-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; }
.pg-links a, .pg-weeknav a { padding: 12px 0; display: inline-block; }
/* Links inside list rows: a 44 px tap area without changing the row's layout */
.pg-near a, .pg-weekcard-row a, .pg-table td a, .pg-permit a { display: inline-block; padding: 12px 0; margin: -12px 0; }
.pg-results li { padding: 12px 14px; border-bottom: 1px solid var(--pg-line); }
.pg-results a { font-weight: 600; }

/* Digest */
.pg-weeknav { display: flex; gap: 12px 24px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: 15px; }
.pg-weeknav a { padding: 10px 0; }
.pg-chart { margin: 0; }
.pg-bars { width: 100%; border-collapse: collapse; font-size: 14px; }
.pg-bars th, .pg-bars td { padding: 6px 8px 6px 0; text-align: left; font-weight: 400; }
.pg-bars thead th { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pg-steel); border-bottom: 2px solid var(--pg-steel); }
.pg-bars tbody th { white-space: nowrap; }
.pg-bars td:nth-child(2) { width: 3em; text-align: right; padding-right: 12px; color: var(--pg-ink); }
.pg-bars td:last-child { width: 60%; }
.pg-bar { display: block; height: 16px; min-width: 2px; background: var(--pg-steel); }
.pg-tablebox { overflow-x: auto; border: 1px solid var(--pg-line); border-radius: var(--pg-radius); margin-top: 12px; }
.pg-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 720px; }
.pg-table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pg-steel); border-bottom: 2px solid var(--pg-steel); padding: 10px 12px; }
.pg-table td { padding: 10px 12px; border-bottom: 1px solid var(--pg-line); vertical-align: top; }
.pg-table tbody tr:nth-child(even) { background: var(--pg-sand); }
.pg-table .pg-num { text-align: right; }

/* Footer: attribution */
.pg-footer { border-top: 1px solid var(--pg-line); background: var(--pg-sand); }
.pg-footer .pg-wrap { padding-top: 24px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; line-height: 1.6; color: var(--pg-muted); }
.pg-footer-nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 14px; padding-bottom: 8px; }
.pg-footer-nav a { padding: 8px 0; }

/* Wide tables become cards below 760 px (builder rule 3) */
.pg-table td:first-child { white-space: nowrap; }
@media (max-width: 759px) {
  .pg-tablebox { overflow: visible; border: 0; }
  .pg-table { min-width: 0; }
  .pg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pg-table, .pg-table tbody, .pg-table tr, .pg-table td { display: block; }
  .pg-table tr { border: 1px solid var(--pg-line); border-radius: var(--pg-radius); padding: 8px 12px; margin-bottom: 8px; }
  .pg-table td { border: 0; padding: 4px 0; text-align: left; }
  .pg-table td.pg-num { text-align: left; }
  .pg-table td::before { content: attr(data-label); display: block; font: 600 11px var(--pg-font-body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--pg-muted); }
}

/* Marketing and legal pages (step 6) */
section > h2, article h2 { margin-bottom: 12px; }
.pg-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pg-steps li { margin: 0; padding: 20px; border: 1px solid var(--pg-line); border-radius: var(--pg-radius); display: flex; flex-direction: column; gap: 8px; }
.pg-steps h3, .pg-grid3 h3, .pg-grid4 h3 { font-size: 24px; }
.pg-steps p, .pg-grid3 p, .pg-grid4 p { color: var(--pg-ink-2); }
.pg-step-n { width: 36px; height: 36px; border-radius: var(--pg-radius); background: var(--pg-steel); color: var(--pg-white); font: 800 22px var(--pg-font-head); display: flex; align-items: center; justify-content: center; }
.pg-grid3, .pg-grid4 { display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pg-grid3 > div, .pg-grid4 > div { display: flex; flex-direction: column; gap: 8px; }
.pg-notes { margin-top: 16px; padding: 16px; background: var(--pg-sand); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); font-size: 14px; color: var(--pg-ink-2); }
.pg-pricebox { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--pg-line); border-radius: var(--pg-radius); }
.pg-pricebox-main { border-top: 4px solid var(--pg-rust); }
.pg-pricebox ul { color: var(--pg-ink-2); }
.pg-pricebox .pg-btn { align-self: flex-start; margin-top: auto; }
.pg-price { font: 800 44px/1 var(--pg-font-head); }
.pg-email { border: 1px solid var(--pg-line); border-radius: var(--pg-radius); overflow: hidden; gap: 0; font-size: 14px; }
.pg-email-head { padding: 12px 14px; background: var(--pg-sand); display: flex; flex-direction: column; gap: 4px; }
.pg-email-bar { height: 4px; background: var(--pg-rust); }
.pg-email-body { padding: 8px 0; }
.pg-email-body .pg-caption { padding: 4px 14px; }
.pg-email-foot { padding: 12px 14px; border-top: 1px solid var(--pg-line); font-size: 12px; color: var(--pg-muted); }
.pg-fieldset { border: 0; padding: 0; margin: 0; }
.pg-fieldset legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.pg-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; }
.pg-check input { width: 22px; height: 22px; accent-color: var(--pg-rust); }
.pg-label-strong { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
.pg-schema { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-schema pre { margin: 0; padding: 16px 18px; background: var(--pg-sand); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); overflow-x: auto; font: 500 13px/1.7 var(--pg-font-mono); }
.pg-faq details { border-bottom: 1px solid var(--pg-line); }
.pg-faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; min-height: 44px; }
.pg-faq details p { padding-bottom: 14px; color: var(--pg-ink-2); }
.pg-prose { max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.pg-prose h2 { font-size: 28px; margin: 16px 0 0; }
.pg-prose p, .pg-prose li { color: var(--pg-ink-2); }
.pg-prose .pg-table { min-width: 0; }

/* Sign-in, feed, account (step 4) */
.pg-narrow { max-width: 560px; display: flex; flex-direction: column; gap: 16px; }
.pg-error { color: var(--pg-bad); background: var(--pg-bad-bg); padding: 10px 12px; border-radius: var(--pg-radius); font-weight: 600; }
.pg-code { font: 500 28px var(--pg-font-mono); letter-spacing: 0.3em; max-width: 220px; }
.pg-feedhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.pg-filters { display: flex; flex-direction: column; gap: 16px; padding: 16px; background: var(--pg-sand); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); }
.pg-filterrow { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pg-trades { display: flex; flex-wrap: wrap; gap: 0 16px; }
.pg-trades legend { width: 100%; }
.pg-tradecheck { min-height: 36px; font-size: 14px; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pg-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 12px; border: 1px solid var(--pg-line); border-radius: var(--pg-radius-chip); background: var(--pg-sand); color: var(--pg-ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.pg-chip-on { background: var(--pg-rust); border-color: var(--pg-rust); color: var(--pg-white); }
.pg-chip-on:hover { background: var(--pg-rust-dark); color: var(--pg-white); }
.pg-linkbtn { background: none; border: 0; padding: 12px 0; color: var(--pg-link); font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }

/* Feed: Table | Map toggle and the permit map (decision 29; static/js/feedmap.js). */
.pg-viewtoggle { display: inline-flex; align-self: flex-start; width: max-content; border: 2px solid var(--pg-ink); border-radius: var(--pg-radius); overflow: hidden; margin: 8px 0 12px; }
.pg-viewtoggle[hidden] { display: none; }
.pg-viewtoggle button { min-height: 44px; min-width: 88px; padding: 8px 18px; border: 0; background: var(--pg-white); color: var(--pg-ink); font-family: var(--pg-font-head); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.pg-viewtoggle button + button { border-left: 2px solid var(--pg-ink); }
.pg-viewtoggle button[aria-pressed="true"] { background: var(--pg-ink); color: var(--pg-white); }
.pg-feedmap-canvas { width: 100%; height: 360px; border: 1px solid var(--pg-line); border-radius: var(--pg-radius); background: #E9E6E0; }
@media (min-width: 768px) { .pg-feedmap-canvas { height: 70vh; min-height: 420px; } }
.pg-maplegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0; font-size: 13px; color: var(--pg-ink-2); }
.pg-maplegend-item { display: inline-flex; align-items: center; gap: 6px; }
.pg-maplegend-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--pg-white); box-shadow: 0 0 0 1px var(--pg-line); }
.pg-mapcredits div + div { margin-top: 2px; }
.pg-mappop { font-family: var(--pg-font-body); font-size: 14px; line-height: 1.4; color: var(--pg-ink); display: grid; gap: 4px; }
.pg-mappop-addr { font-size: 15px; }
.pg-mappop-work { color: var(--pg-ink-2); }
.pg-mappop-link { font-weight: 600; color: var(--pg-link); padding: 6px 0 2px; }

/* Help button and panel (decision 33): same place on every main page; native popover, so Esc and a click outside close it without JS */
.pg-helpbar { display: flex; justify-content: flex-end; margin: -8px 0 -32px; }
.pg-helpbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 8px; background: var(--pg-white); color: var(--pg-ink); border: 2px solid var(--pg-ink); border-radius: 22px; font: 600 15px/1 var(--pg-font-body); cursor: pointer; }
.pg-helpbtn:hover { background: var(--pg-sand); }
.pg-helpbtn-q { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--pg-steel); color: var(--pg-white); font-weight: 700; font-size: 14px; }
.pg-help { display: none; }
.pg-help:popover-open { display: flex; flex-direction: column; gap: 10px; width: min(640px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; margin: auto; padding: 20px; border: 1px solid var(--pg-line); border-radius: var(--pg-radius); background: var(--pg-white); color: var(--pg-ink); }
.pg-help::backdrop { background: color-mix(in srgb, var(--pg-ink) 45%, transparent); }
.pg-help-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pg-help-close { flex: none; width: 44px; height: 44px; margin: -10px -10px 0 0; background: none; border: 0; color: var(--pg-ink); font-size: 20px; cursor: pointer; }
.pg-help h3 { font-size: 22px; margin-top: 6px; }
.pg-help ol { margin: 0; padding-left: 22px; }
