/* ===========================================================
   Citizen wizard — Where → What → Results
   Senior-friendly: large hit targets, big type, clear sequence
   =========================================================== */

/* A−/A+ in header drives root font-size scale */
:root { --ts: 1; }
html { font-size: calc(13px * var(--ts)); }
body.ts-1 { --ts: 1; }
body.ts-2 { --ts: 1.12; }
body.ts-3 { --ts: 1.25; }

.text-size {
  display: flex;
  background: var(--gray-100);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.ts-btn {
  background: transparent; border: none;
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  color: var(--gray-600);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: flex; align-items: baseline; gap: 1px;
  min-width: 38px;
  justify-content: center;
}
.ts-btn:hover { background: var(--white); color: var(--blue); }
.ts-btn .ts-minus { font-size: 11px; }
.ts-btn .ts-plus  { font-size: 11px; }

/* ── CITIZEN bar (replaces hero search) ── */
.citizen-bar {
  flex: 1; max-width: 560px;
  display: flex; align-items: center; gap: 14px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 8px 10px 8px 18px;
  height: 50px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all .15s;
}
.citizen-bar:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0,56,147,.08), var(--shadow-md);
}
.cb-icon {
  width: 36px; height: 36px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.cb-text { flex: 1; min-width: 0; }
.cb-title {
  display: block;
  font-size: 14px; font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}
.cb-sub {
  display: block;
  font-size: 11.5px; color: var(--gray-500);
  margin-top: 2px;
}
.cb-arrow {
  color: var(--blue);
  font-size: 18px; font-weight: 700;
  padding-right: 12px;
  flex-shrink: 0;
}

/* ── Wizard overlay ── */
.wiz-scrim[hidden] { display: none !important; }
.wiz-scrim {
  position: fixed; inset: 0;
  z-index: 1100;
  background: rgba(15,22,38,.58);
  display: flex;
  align-items: center; justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
  animation: fade-in .2s ease;
}
@keyframes fade-in { from{opacity:0} }

.wiz-card {
  background: var(--white);
  border-radius: 20px;
  width: min(640px, 100%);
  max-height: 92vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: wiz-in .25s cubic-bezier(.2,.7,.3,1);
}
@keyframes wiz-in { from { transform: translateY(20px); opacity: 0 } }

.wiz-hd {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
}
.wiz-back, .wiz-close {
  background: var(--gray-50);
  border: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 18px; font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.wiz-back:hover, .wiz-close:hover { background: var(--gray-100); }
.wiz-back[hidden] { display: none; }

.wiz-progress {
  flex: 1;
  display: flex; align-items: center; gap: 6px;
  justify-content: center;
}
.wp-step {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid transparent;
}
.wp-step.active { background: var(--blue); color: var(--white); }
.wp-step.done   { background: var(--white); color: var(--blue); border-color: var(--blue); }
.wp-line {
  flex: 0 0 24px; height: 2px;
  background: var(--gray-200);
  border-radius: 1px;
}

/* Steps */
.wiz-step {
  display: none;
  padding: 22px 24px 18px;
  overflow-y: auto;
  flex: 1;
}
.wiz-step.active { display: block; }
.wiz-eyebrow {
  font-size: 11px; font-weight: 700;
  color: var(--blue);
  text-transform: uppercase; letter-spacing: .07em;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.wiz-edit {
  font-family: inherit;
  background: none; border: none;
  font-size: 11.5px; font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
}
.wiz-step h2 {
  font-size: 22px; font-weight: 700;
  color: var(--gray-900);
  margin-top: 6px;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.wiz-lede {
  font-size: 13.5px; color: var(--gray-600);
  margin-top: 6px;
  line-height: 1.5;
}

/* Mega button (GPS) */
.wiz-mega {
  width: 100%;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-top: 16px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background .15s;
}
.wiz-mega:hover { background: var(--blue-lt); }
.wm-glyph {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.18);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.wm-text { flex: 1; }
.wm-title { display: block; font-size: 16px; font-weight: 700; }
.wm-sub   { display: block; font-size: 12px; opacity: .85; margin-top: 2px; }

.wiz-or {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 8px;
  color: var(--gray-400);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
}
.wiz-or::before, .wiz-or::after {
  content: ''; flex: 1;
  border-top: 1px solid var(--gray-200);
}

/* Tile grid (provinces / topics) */
.wiz-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.province-grid { grid-template-columns: repeat(2, 1fr); }
.topic-grid    { grid-template-columns: repeat(4, 1fr); }

.wiz-tile {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 12px 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  transition: all .15s;
  min-height: 64px;
}
.wiz-tile:hover {
  border-color: var(--blue-lt);
  background: var(--blue-50);
}
.wiz-tile.active {
  border-color: var(--blue);
  background: var(--blue-50);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.wiz-tile.big { min-height: 96px; padding: 14px 8px; }
.wt-num {
  font-size: 10.5px; font-weight: 700;
  color: var(--gray-400);
  letter-spacing: .04em;
}
.wiz-tile.active .wt-num { color: var(--blue); }
.wt-name {
  font-size: 13px; font-weight: 700;
  color: var(--gray-900);
}
.wt-glyph { font-size: 28px; line-height: 1; }
.wt-ne {
  font-size: 11px; color: var(--gray-500);
  margin-top: 1px;
}

/* "More filters" details */
.wiz-more {
  margin-top: 16px;
  border-top: 1px solid var(--gray-100);
  padding-top: 16px;
}
.wiz-more summary {
  font-size: 13px; font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.wiz-more summary::before {
  content: '+'; font-size: 16px;
  width: 22px; height: 22px;
  background: var(--blue-50);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.wiz-more[open] summary::before { content: '−'; }
.wiz-filters {
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 14px;
}
.wf-label {
  font-size: 11px; font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 6px;
}
.wf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-chip {
  font-family: inherit;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: all .15s;
}
.wf-chip:hover { border-color: var(--blue-lt); }
.wf-chip.active { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* Footer */
.wiz-foot {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.wiz-foot-sticky {
  position: sticky; bottom: 0;
}
.wiz-next {
  width: 100%;
  background: var(--blue);
  color: var(--white);
  border: none; border-radius: var(--radius);
  padding: 14px;
  font-family: inherit;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.wiz-next:hover { background: var(--blue-lt); }
.wiz-secondary {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  color: var(--gray-800);
  border-radius: var(--radius);
  padding: 12px;
  font-family: inherit;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}
.wiz-secondary:hover { background: var(--gray-50); }

/* Sort chips */
.wiz-sort {
  display: flex; gap: 6px;
  margin: 12px 0 14px;
  flex-wrap: wrap;
}
.ws-chip {
  font-family: inherit;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px; font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
}
.ws-chip.active { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* Result postcards */
.wiz-results { display: flex; flex-direction: column; gap: 10px; }
.wr-card {
  display: flex; gap: 12px;
  padding: 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all .15s;
  background: var(--white);
}
.wr-card:hover {
  border-color: var(--blue-lt);
  background: var(--gray-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.wr-img {
  width: 56px; height: 56px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.wr-img.warn { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.wr-img.err  { background: linear-gradient(135deg, #fecaca, #fca5a5); }
.wr-info { flex: 1; min-width: 0; }
.wr-name {
  font-size: 14.5px; font-weight: 700;
  color: var(--gray-900);
  line-height: 1.25;
}
.wr-meta {
  font-size: 11.5px; color: var(--gray-500);
  margin-top: 4px;
  display: flex; gap: 6px; align-items: center;
  flex-wrap: wrap;
}
.wr-tag {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .03em;
}
.wr-tag.warn { background: var(--amber-50); color: var(--amber); }
.wr-tag.err  { background: var(--red-50); color: var(--red); }
.wr-tag.ok   { background: var(--green-50); color: var(--green); }
.wr-prog-row {
  margin-top: 8px;
  display: flex; align-items: center; gap: 8px;
}
.wr-prog-track {
  flex: 1; height: 5px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
}
.wr-prog-fill { height: 100%; border-radius: 999px; }
.wr-prog-pct {
  font-size: 11.5px; font-weight: 700;
  color: var(--gray-700);
  min-width: 36px; text-align: right;
}

/* ── Project detail drawer ── */
.pd-scrim[hidden] { display: none !important; }
.pd-scrim {
  position: fixed; inset: 0;
  z-index: 1200;
  background: rgba(15,22,38,.55);
  display: flex; justify-content: center;
  align-items: flex-end;
  padding: 0;
  backdrop-filter: blur(2px);
}
@media (min-width: 760px) {
  .pd-scrim { align-items: center; padding: 24px; }
}
.pd-card {
  background: var(--white);
  width: min(560px, 100%);
  max-height: 92vh;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pd-in .25s cubic-bezier(.2,.7,.3,1);
}
@media (min-width: 760px) { .pd-card { border-radius: 16px; } }
@keyframes pd-in { from { transform: translateY(40px); opacity: 0 } }

.pd-full-link {
  display: block;
  margin: 4px 16px 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #003893, #1a5abf);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.01em;
  transition: filter .15s, transform .05s;
}
.pd-full-link:hover { filter: brightness(1.08); }
.pd-full-link:active { transform: translateY(1px); }

.pd-hero {
  position: relative;
  height: 130px;
  background: linear-gradient(135deg, #1a5abf, #003893);
  display: flex; align-items: flex-end;
  padding: 16px;
  color: var(--white);
}
.pd-hero.warn { background: linear-gradient(135deg, #f59e0b, #92400e); }
.pd-hero.err  { background: linear-gradient(135deg, #ef4444, #7f0d1e); }
.pd-glyph {
  position: absolute; right: 18px; top: 18px;
  font-size: 56px; opacity: .35;
}
.pd-close {
  position: absolute; left: 14px; top: 14px;
  background: rgba(255,255,255,.2);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
}
.pd-eyebrow {
  font-size: 11px; font-weight: 600;
  opacity: .9;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.pd-name {
  font-size: 19px; font-weight: 700;
  line-height: 1.2;
  margin-top: 4px;
  max-width: 80%;
}

.pd-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.pd-status-row {
  display: flex; gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pd-stat-pill {
  font-size: 11.5px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
}
.pd-stat-pill.warn { background: var(--amber-50); color: var(--amber); }
.pd-stat-pill.err  { background: var(--red-50); color: var(--red); }
.pd-stat-pill.ok   { background: var(--green-50); color: var(--green); }

.pd-why {
  font-size: 13.5px; color: var(--gray-700);
  line-height: 1.5;
  padding: 12px;
  background: var(--gray-50);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.pd-section {
  margin-top: 18px;
}
.pd-section h4 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.pd-bars { display: flex; flex-direction: column; gap: 10px; }
.pd-bar-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: var(--gray-700);
  margin-bottom: 4px;
}
.pd-bar-row b {
  font-size: 14px; font-weight: 700;
  color: var(--gray-900);
}
.pd-bar-track {
  height: 8px; background: var(--gray-100);
  border-radius: 999px; overflow: hidden;
}
.pd-bar-fill { height: 100%; border-radius: 999px; }

/* Trust grid */
.pd-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pd-trust-tile {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.pd-trust-lbl {
  font-size: 10.5px; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .04em;
}
.pd-trust-val {
  font-size: 13.5px; font-weight: 700;
  color: var(--gray-900);
  margin-top: 3px;
  line-height: 1.3;
}
.pd-trust-sub { font-size: 11px; color: var(--gray-500); margin-top: 1px; }

/* Action grid: 6 actions, 3×2 */
.pd-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pd-act {
  font-family: inherit;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 8px;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  color: var(--gray-800);
  text-align: center;
  transition: all .15s;
}
.pd-act:hover {
  border-color: var(--blue);
  background: var(--blue-50);
  color: var(--blue);
}
.pd-act-glyph { font-size: 22px; }
.pd-act.primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.pd-act.primary:hover { background: #b91030; color: var(--white); border-color: #b91030; }

/* Mobile tweaks for wizard */
@media (max-width: 640px) {
  .wiz-scrim { padding: 0; }
  .wiz-card {
    width: 100%; max-height: 100vh;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
    height: 96vh;
  }
  .topic-grid { grid-template-columns: repeat(3, 1fr); }
  .province-grid { grid-template-columns: 1fr; }
  .citizen-bar { padding-left: 12px; gap: 10px; }
  .cb-icon { width: 32px; height: 32px; font-size: 14px; }
  .cb-sub { display: none; }
  .citizen-bar { height: 44px; }
}
