/* ═══════════════════════════════════════════════════════════

   GUIDE MONTANA — Water Rights Module

   Bulk download wizard, water rights search panel

   ═══════════════════════════════════════════════════════════ */



/* ═══════════════════════════════════════════════════════════
   Bulk Download Wizard (bw-*)
   ═══════════════════════════════════════════════════════════ */

/* ── Stepper indicator ── */
.bw-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  padding: 0 16px;
}
.bw-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
}
.bw-step > span {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.06em;
  font-weight: 600;
  transition: color 0.25s;
}
.bw-step.active > span { color: var(--text-primary); }
.bw-step.done > span { color: #22c55e; }
.bw-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  font-weight: 700;
  background: var(--bg-3);
  color: var(--text-muted);
  border: 2px solid var(--border-default);
  transition: background 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out),
    color 0.3s var(--ease-out);
}
.bw-dot.active {
  background: var(--guide-color-action);
  color: var(--guide-color-text-on-accent, #fff);
  border-color: var(--guide-color-action);
  box-shadow: 0 0 12px color-mix(in srgb, var(--guide-color-action) 35%, transparent);
}
.bw-dot.done {
  background: var(--guide-color-status-ok);
  color: var(--guide-color-text-on-accent, #fff);
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34,197,94,0.3);
}
.bw-line {
  flex: 1;
  height: 2px;
  background: var(--border-default);
  margin: 0 4px;
  margin-bottom: 18px;
  transition: background 0.3s;
}
.bw-line.done { background: #22c55e; }

/* ── Step panels ── */
.bw-panel {
  display: none;
  animation: fadeSlideIn 0.35s var(--ease-out);
}
.bw-panel.active { display: block; }
.bw-title {
  font-size: var(--guide-fs-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* ── Selection / format cards ── */
.bw-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.bw-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  text-align: left;
  background: var(--bg-3);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}
.bw-card:hover {
  background: var(--bg-3);
  border-color: var(--guide-color-border-default, rgba(0,0,0,0.10));
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.bw-card.selected {
  border-color: var(--guide-color-action);
  background: color-mix(in srgb, var(--guide-color-action) 8%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--guide-color-action) 30%, transparent), 0 4px 16px color-mix(in srgb, var(--guide-color-action) 12%, transparent);
}
.bw-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(var(--guide-wash-rgb, 0, 0, 0), 0.04);
  transition: all 0.25s;
}
.bw-card-icon > i, .bw-card-icon > svg { width: 20px; height: 20px; }
.bw-card-icon--blue { color: var(--guide-color-ink); background: var(--guide-color-paper-2); }
.bw-card-icon--teal { color: #2dd4bf; background: rgba(20,184,166,0.1); }
.bw-card-icon--green { color: #4ade80; background: rgba(34,197,94,0.1); }
.bw-card-icon--amber { color: #D97706; background: rgba(245,158,11,0.1); }
.bw-card-icon--purple { color: var(--guide-color-ink); background: var(--guide-color-paper-2); }
.bw-card.selected .bw-card-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 6px currentColor);
}
.bw-card-body { flex: 1; }
.bw-card-body strong {
  display: block;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.bw-card-body span {
  display: block;
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Radio indicator */
.bw-card-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}
.bw-card.selected .bw-card-radio {
  border-color: var(--guide-color-action);
}
.bw-card.selected .bw-card-radio::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--guide-color-action);
}

/* Checkbox indicator */
.bw-card-check {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--border-default);
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bw-card.selected .bw-card-check {
  border-color: var(--guide-color-action);
  background: var(--guide-color-action);
}
.bw-card.selected .bw-card-check::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* ── Count display ── */
.bw-count-box {
  text-align: center;
  padding: 20px;
  margin-bottom: 16px;
  background: var(--bg-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
}
.bw-count-num {
  font-size: var(--guide-fs-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.bw-count-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.08em;
  font-weight: 600;
}
.bw-count-hint {
  font-size: var(--text-xxs);
  color: var(--text-muted);
  margin-top: 6px;
}
.bw-count-box .spinner { margin: 8px auto; }

/* ── KPI preview grid ── */
.bw-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.bw-kpi {
  background: var(--bg-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}
.bw-kpi-val {
  font-size: var(--guide-fs-2xl);
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.bw-kpi-label {
  font-size: var(--guide-fs-2xs);
  color: var(--text-muted);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Warnings ── */
.bw-warn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: var(--text-sm);
  line-height: 1.4;
}
.bw-warn--amber {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  color: #D97706;
}
.bw-warn--red {
  background: color-mix(in srgb, var(--guide-color-brick) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--guide-color-brick) 30%, transparent);
  color: var(--guide-color-status-crit);
}
.bw-warn > i, .bw-warn > svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Preview table ── */
.bw-preview-wrap { margin-bottom: 16px; }
.bw-preview-wrap h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: none;
  letter-spacing: 0.05em;
}
.bw-preview-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
}
.bw-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--guide-fs-xs);
}
.bw-preview-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
}
.bw-preview-table td {
  padding: 7px 10px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(var(--guide-wash-rgb, 0, 0, 0), 0.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.bw-preview-table tr:last-child td { border-bottom: none; }

/* ── Progress section ── */
.bw-progress-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.bw-progress-bar-wrap {
  flex: 1;
  height: 10px;
  background: var(--bg-3);
  border-radius: 5px;
  overflow: hidden;
}
.bw-progress-bar {
  height: 100%;
  border-radius: 5px;
  background: var(--guide-color-action);
  transition: width 0.3s var(--ease-out);
  position: relative;
}
.bw-progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(var(--guide-wash-rgb, 0, 0, 0), 0.12), transparent);
  animation: bw-shimmer 1.5s ease-in-out infinite;
}
.bw-progress-pct {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Task rows ── */
.bw-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}
.bw-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--guide-fs-sm);
  color: var(--text-secondary);
  background: var(--bg-3);
  transition: background 0.2s,
    color 0.2s;
}
.bw-task.active {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--guide-color-action) 6%, transparent);
}
.bw-task.done {
  color: #22c55e;
  background: rgba(34,197,94,0.06);
}
.bw-task.error { color: var(--guide-color-status-crit); }
.bw-task-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bw-task-icon .spinner { width: 16px; height: 16px; border-width: 2px; }
.bw-task-detail {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bw-task-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: var(--text-xxs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Error log ── */
.bw-errors {
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--guide-color-brick) 20%, transparent);
  background: color-mix(in srgb, var(--guide-color-brick) 4%, transparent);
  font-size: var(--text-sm);
}
.bw-errors summary {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--guide-color-status-crit);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.bw-errors summary > i, .bw-errors summary > svg { width: 14px; height: 14px; }
.bw-error-log {
  max-height: 120px;
  overflow-y: auto;
  padding: 8px 12px;
  font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
  font-size: var(--guide-fs-2xs);
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid color-mix(in srgb, var(--guide-color-brick) 15%, transparent);
}

/* ── Navigation buttons ── */
.bw-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
  margin-top: 8px;
}
.bw-btn-start {
  background: var(--guide-color-action) !important;
  border-color: #22c55e !important;
}
.bw-btn-start:hover {
  box-shadow: 0 0 16px rgba(34,197,94,0.4) !important;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .bw-kpi-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .bw-kpi { padding: 10px; }
  .bw-kpi-val { font-size: var(--guide-fs-lg); }
  .bw-count-num { font-size: var(--text-2xl); }
  .bw-stepper { padding: 0 4px; }
  .bw-step > span { font-size: var(--guide-fs-2xs); }
  .bw-dot { width: 26px; height: 26px; font-size: var(--text-xxs); }
}

/* ── Gage Wizard additions (gw-*) ── */
.gw-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
}
.gw-filter-row .fi-sm {
  flex: 1;
  min-width: 100px;
  max-width: 180px;
  padding: 6px 8px;
  font-size: var(--guide-fs-xs);
}
.gw-date-range {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(6,182,212,0.06);
  border: 1px solid rgba(6,182,212,0.2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.gw-date-range label { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.gw-date-range .fi-sm { max-width: 150px; }

/* ═══════════════════════════════════════════════════════════════════════
   WATER RIGHTS COMMAND CENTER (.wrh-*)
   ═══════════════════════════════════════════════════════════════════════ */
.wrh-root {
  padding: 0 0 8px;
}

/* ── KPI Strip ── */
.wrh-conditions {
  margin-bottom: 12px;
}
.wrh-conditions-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.8px;
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.wrh-conditions-title i { width: 14px; height: 14px; }
.wrh-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.wrh-kpi {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  border-radius: var(--radius-lg);
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wrh-kpi:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.wrh-kpi-icon { flex-shrink: 0; }
.wrh-kpi-icon i { width: 16px; height: 16px; }
.wrh-kpi-data { min-width: 0; }
.wrh-kpi-val {
  font-size: var(--guide-fs-md);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.wrh-kpi-label {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Quick Presets ── */
.wrh-presets {
  margin-bottom: 12px;
}
.wrh-presets-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.wrh-presets-title i { width: 13px; height: 13px; color: #F59E0B; }
.wrh-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.wrh-preset {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle, var(--guide-color-border-subtle, rgba(0,0,0,0.06)));
  background: var(--bg-3);
  cursor: pointer;
  transition: background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
  text-align: left;
}
.wrh-preset:hover {
  border-color: var(--preset-color, #6366F1);
  background: color-mix(in srgb, var(--preset-color, #6366F1) 6%, var(--bg-3, #F7F5F0));
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.wrh-preset-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--preset-color, #6366F1) 12%, transparent);
  color: var(--preset-color, #6366F1);
  flex-shrink: 0;
}
.wrh-preset-icon i { width: 16px; height: 16px; }
.wrh-preset-body { min-width: 0; }
.wrh-preset-label {
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  color: var(--text-primary, #1A1A1F);
  line-height: 1.2;
}
.wrh-preset-sub {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #8A8A95);
  line-height: 1.3;
}

/* ── AI + Alerts Row ── */
.wrh-intel-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.wrh-ai-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--guide-color-line-strong);
  background: var(--guide-color-raised);
  color: var(--guide-color-action);
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
  white-space: nowrap;
}
.wrh-ai-btn:hover {
  background: var(--guide-color-raised);
  border-color: var(--guide-color-ink-soft);
}
.wrh-ai-btn i { width: 14px; height: 14px; }
.wrh-alerts-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.wrh-alert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
}
.wrh-alert i { width: 13px; height: 13px; flex-shrink: 0; }
.wrh-alert--critical {
  background: color-mix(in srgb, var(--guide-color-status-crit) 10%, transparent);
  color: var(--guide-color-status-crit);
  border: 1px solid color-mix(in srgb, var(--guide-color-status-crit) 20%, transparent);
}
.wrh-alert--warn {
  background: rgba(217, 119, 6, 0.1);
  color: #92400E;
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.wrh-alert--ok {
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
  border: 1px solid rgba(22, 163, 74, 0.15);
}

/* ── Recent Searches ── */
.wrh-recent {
  margin-bottom: 10px;
}
.wrh-recent-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  color: var(--text-tertiary, #8A8A95);
  margin-bottom: 5px;
}
.wrh-recent-title i { width: 12px; height: 12px; }
.wrh-recent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.wrh-recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--guide-color-line-strong);
  background: var(--guide-color-raised);
  color: var(--guide-color-ink-soft);
  font-size: var(--guide-fs-2xs);
  cursor: pointer;
  transition: background 0.15s ease,
    border-color 0.15s ease;
}
.wrh-recent-chip:hover {
  background: var(--surface-alt, rgba(0,0,0,0.04));
  border-color: var(--text-secondary);
}
.wrh-recent-chip i { width: 10px; height: 10px; }

/* ── Insight Cards ── */
.wrh-insights {
  margin-bottom: 10px;
}
.wrh-insights-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-secondary, #4A4A52);
  margin-bottom: 8px;
}
.wrh-insights-title i { width: 14px; height: 14px; color: #F59E0B; }
.wrh-insight {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  margin-bottom: 6px;
  transition: transform 0.15s ease;
}
.wrh-insight:hover { transform: translateX(2px); }
.wrh-insight--info {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.12);
}
.wrh-insight--warn {
  background: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.12);
}
.wrh-insight--critical {
  background: color-mix(in srgb, var(--guide-color-status-crit) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--guide-color-status-crit) 12%, transparent);
}
.wrh-insight-icon { flex-shrink: 0; padding-top: 2px; }
.wrh-insight-icon i { width: 16px; height: 16px; }
.wrh-insight--info .wrh-insight-icon { color: #3B82F6; }
.wrh-insight--warn .wrh-insight-icon { color: #D97706; }
.wrh-insight--critical .wrh-insight-icon { color: var(--guide-color-status-crit); }
.wrh-insight-body { flex: 1; min-width: 0; }
.wrh-insight-title {
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 2px;
}
.wrh-insight-desc {
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary, #4A4A52);
  line-height: 1.4;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .wrh-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .wrh-preset-grid { grid-template-columns: 1fr; }
  .wrh-intel-row { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════════════════
   RESERVATION TRACKER (.rt-*)
   ═══════════════════════════════════════════════════════════════════════ */
.rt-root { display: flex; flex-direction: column; gap: 14px; padding: 4px; font-size: var(--text-md); }
.rt-header h2.rt-title { display: flex; align-items: center; gap: 8px; font-size: var(--guide-fs-lg); font-weight: 800; color: var(--text-primary, #1A1A1F); margin: 0 0 2px; }
.rt-header h2.rt-title i { width: 18px; height: 18px; }
.rt-subtitle { font-size: var(--text-sm); color: var(--text-secondary, #4A4A52); margin: 0; }

.rt-loading { display: flex; align-items: center; gap: 8px; padding: 24px; color: var(--text-muted, #6B6B73); font-size: var(--text-md); }
.rt-spinning { animation: rt-spin 1s linear infinite; width: 16px; height: 16px; }

.rt-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px; color: var(--text-muted, #6B6B73); text-align: center; background: var(--bg-1, #f5f0e8); border-radius: 10px; }
.rt-empty i { width: 28px; height: 28px; opacity: 0.5; }
.rt-btn-link { background: none; border: none; color: var(--guide-color-action); cursor: pointer; font-size: var(--text-sm); font-weight: 600; padding: 4px 8px; }
.rt-btn-link:hover { text-decoration: underline; }

/* KPI strip */
.rt-kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rt-kpi { background: var(--bg-1, #FFFFFF); border: 1px solid var(--border-subtle, rgba(0,0,0,0.08)); border-radius: 8px; padding: 10px 12px; text-align: center; }
.rt-kpi-val { font-size: var(--guide-fs-lg); font-weight: 800; color: var(--text-primary, #1A1A1F); line-height: 1.1; }
.rt-kpi-lbl { font-size: var(--text-xs); color: var(--text-muted, #6B6B73); margin-top: 2px; text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.4px; font-weight: 600; }

/* Filter bar */
.rt-filter-bar { background: var(--bg-1, #FFFFFF); border: 1px solid var(--border-subtle, rgba(0,0,0,0.08)); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.rt-filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rt-filter-label { font-size: var(--text-xs); text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.5px; font-weight: 700; color: var(--text-muted, #6B6B73); margin-right: 4px; display: inline-flex; align-items: center; gap: 6px; }
.rt-filter-group--selects { gap: 14px; }
.rt-filter-chip { font-size: var(--guide-fs-xs); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--guide-color-line-strong); background: var(--guide-color-raised); color: var(--guide-color-ink-soft); cursor: pointer; transition: border-color 0.12s,
    color 0.12s; font-weight: 600; }
.rt-filter-chip:hover { border-color: var(--guide-color-ink-soft); color: var(--guide-color-ink); }
.rt-filter-chip--active { border-color: var(--guide-color-action); box-shadow: inset 0 0 0 1px var(--guide-color-action); color: var(--guide-color-ink); }
.rt-select { font-size: var(--text-xxs); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border-subtle, rgba(0,0,0,0.12)); background: var(--bg-0, #FFFFFF); color: var(--text-primary, #1A1A1F); }
.rt-filter-summary { font-size: var(--text-xxs); color: var(--text-muted, #6B6B73); align-self: flex-end; font-weight: 600; }

/* Body layout — grid + drawer */
.rt-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.rt-aside { position: sticky; top: 12px; }

/* Card */
.rt-card { background: var(--bg-1, #FFFFFF); border: 1px solid var(--border-subtle, rgba(0,0,0,0.08)); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; display: flex; flex-direction: column; gap: 6px; }
.rt-card:hover, .rt-card:focus { outline: none; box-shadow: 0 4px 14px rgba(0,0,0,0.08);}
.rt-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rt-card-entity { font-size: var(--text-md); font-weight: 700; color: var(--text-primary, #1A1A1F); line-height: 1.25; }
.rt-card-source { font-size: var(--guide-fs-xs); color: var(--text-secondary, #4A4A52); display: flex; align-items: center; gap: 4px; }
.rt-card-source .rt-icon { width: 12px; height: 12px; opacity: 0.7; }
.rt-card-county { color: var(--text-muted, #6B6B73); }
.rt-card-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rt-card-volumes { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; border-top: 1px dashed var(--border-subtle, rgba(0,0,0,0.08)); }
.rt-vol { display: flex; flex-direction: column; line-height: 1.1; }
.rt-vol-num { font-size: var(--text-base); font-weight: 800; color: var(--text-primary, #1A1A1F); }
.rt-vol-unit { font-size: var(--guide-fs-2xs); color: var(--text-muted, #6B6B73); text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.4px; font-weight: 600; }
.rt-vol--remaining .rt-vol-num { color: #16A34A; }
.rt-card-progress-row { display: flex; align-items: center; gap: 8px; }
.rt-progress { flex: 1; height: 8px; background: var(--bg-2, #E8E1D2); border-radius: 4px; overflow: hidden; }
.rt-progress-bar { height: 100%; border-radius: 4px; transition: width 0.3s ease-out; }
.rt-progress-label { font-size: var(--text-xxs); font-weight: 700; min-width: 76px; text-align: right; }
.rt-card-foot { display: flex; align-items: center; justify-content: space-between; font-size: var(--guide-fs-2xs); color: var(--text-muted, #6B6B73); padding-top: 4px; }
.rt-card-cta { font-weight: 600; color: var(--guide-color-action); }
.rt-card-conditions { font-style: italic; }

/* Chips */
.rt-chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); padding: 2px 8px; border-radius: 999px; border: 1px solid; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.rt-meta-pill { font-size: var(--text-xs); padding: 2px 8px; border-radius: 999px; background: var(--bg-2, #E8E1D2); color: var(--text-secondary, #4A4A52); font-weight: 600; }
.rt-mca-chip { display: inline-flex; align-items: center; font-size: var(--text-xs); padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--guide-color-action) 8%, transparent); color: var(--guide-color-action); font-weight: 700; text-decoration: none; border: 1px solid var(--guide-color-border-accent, color-mix(in srgb, var(--guide-color-action) 25%, transparent)); }
.rt-mca-chip:hover { background: color-mix(in srgb, var(--guide-color-action) 16%, transparent); text-decoration: underline; }

/* Drawer */
.rt-drawer { background: var(--bg-1, #FFFFFF); border: 1px solid var(--border-subtle, rgba(0,0,0,0.08)); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 100px); overflow-y: auto; }
.rt-drawer--empty { color: var(--text-muted, #6B6B73); font-style: italic; padding: 20px 14px; }
.rt-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rt-drawer-title { font-size: var(--text-base); font-weight: 800; color: var(--text-primary, #1A1A1F); line-height: 1.2; }
.rt-drawer-sub { font-size: var(--text-xxs); color: var(--text-secondary, #4A4A52); margin-top: 2px; }
.rt-drawer-close { background: none; border: none; font-size: var(--guide-fs-2xl); line-height: 1; color: var(--text-muted, #6B6B73); cursor: pointer; padding: 0 4px; }
.rt-drawer-close:hover { color: var(--guide-color-action); }
.rt-drawer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px; background: var(--bg-2, #f5f0e8); border-radius: 8px; }
.rt-stat { display: flex; flex-direction: column; }
.rt-stat-lbl { font-size: var(--guide-fs-2xs); color: var(--text-muted, #6B6B73); text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.4px; font-weight: 700; }
.rt-stat-val { font-size: var(--guide-fs-sm); color: var(--text-primary, #1A1A1F); font-weight: 700; }
.rt-drawer-progress .rt-progress { height: 10px; }
.rt-drawer-section h4 { font-size: var(--text-xxs); text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.5px; color: var(--text-muted, #6B6B73); margin: 0 0 4px; font-weight: 700; }
.rt-conditions { margin: 0; padding-left: 18px; font-size: var(--guide-fs-xs); color: var(--text-secondary, #4A4A52); line-height: 1.45; }
.rt-conditions li { margin-bottom: 3px; }
.rt-muted { color: var(--text-muted, #6B6B73); font-style: italic; list-style: none; margin-left: -16px; }
.rt-cite-row { display: flex; flex-wrap: wrap; gap: 4px; }
.rt-notes { font-size: var(--guide-fs-xs); color: var(--text-secondary, #4A4A52); line-height: 1.5; margin: 0; }
.rt-drawer-mini { min-height: 0; }
.rt-drawer-mini:not(:empty) { margin-top: 6px; border-radius: 8px; overflow: hidden; background: var(--bg-2, #f5f0e8); }

/* References footer */
.rt-references { background: var(--bg-1, #FFFFFF); border: 1px solid var(--border-subtle, rgba(0,0,0,0.08)); border-radius: 10px; padding: 12px 14px; }
.rt-references-title { font-size: var(--text-xxs); text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.6px; color: var(--text-muted, #6B6B73); font-weight: 700; margin-bottom: 8px; }
.rt-references-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.rt-ref-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: var(--bg-2, #f5f0e8); border-radius: 8px; text-decoration: none; color: inherit; border: 1px solid var(--border-subtle, rgba(0,0,0,0.08)); transition: border-color 0.15s, transform 0.15s; }
.rt-ref-card:hover { border-color: var(--guide-color-action);}
.rt-ref-cite { font-size: var(--text-xxs); font-weight: 800; color: var(--guide-color-ink); letter-spacing: 0.3px; }
.rt-ref-label { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary, #1A1A1F); line-height: 1.2; }
.rt-ref-summary { font-size: var(--text-xxs); color: var(--text-secondary, #4A4A52); line-height: 1.4; }

/* WR Hub fullscreen wrapper — reuses .dash-fs / body.map-fs chrome hiding */

/* Source banner */
.rt-source-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--guide-color-paper-2); border: 1px solid var(--border-subtle, rgba(0,0,0,0.08)); border-radius: 10px; }
.rt-source-info { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.rt-source-stat { font-size: var(--text-xxs); color: var(--text-secondary, #4A4A52); font-weight: 600; }
.rt-source-stat strong { color: var(--text-primary, #1A1A1F); font-size: var(--text-base); font-weight: 800; margin-right: 3px; }
.rt-source-total strong { color: var(--guide-color-ink); }
.rt-source-stamp { font-size: var(--text-xs); color: var(--text-muted, #6B6B73); font-style: italic; }
.rt-source-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rt-source-loading { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xxs); color: var(--text-muted, #6B6B73); font-weight: 600; }
.rt-source-loading i { width: 14px; height: 14px; }
.rt-source-error { font-size: var(--text-xxs); color: var(--guide-color-status-crit); font-weight: 600; }
.rt-btn-primary { background: var(--guide-color-action); color: var(--guide-color-text-on-accent, #fff); border: none; padding: 7px 14px; border-radius: 6px; font-size: var(--text-xxs); font-weight: 700; cursor: pointer; transition: filter 0.15s; letter-spacing: 0.3px; }
.rt-btn-primary:hover { filter: brightness(1.1); }
.rt-source-filter { gap: 4px; }
.rt-source-caveat { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; background: rgba(217, 119, 6, 0.08); border-radius: 6px; font-size: var(--guide-fs-xs); color: #78350F; line-height: 1.5; }
.rt-source-caveat i { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; opacity: 0.8; }

/* Responsive */
@media (max-width: 1024px) {
  .rt-body { grid-template-columns: 1fr; }
  .rt-aside { position: static; }
}
@media (max-width: 768px) {
  .rt-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .rt-grid { grid-template-columns: 1fr; }
  .rt-drawer-grid { grid-template-columns: repeat(2, 1fr); }
  .rt-references-grid { grid-template-columns: 1fr; }
}

/* ─── Dark theme overrides ─────────────────────────────────────────── */
[data-theme="dark"] .bw-card-icon--amber { color: var(--guide-color-status-watch); background: color-mix(in srgb, var(--guide-color-ochre-fill) 12%, transparent); }
[data-theme="dark"] .bw-warn--amber { background: color-mix(in srgb, var(--guide-color-ochre-fill) 10%, transparent); border-color: color-mix(in srgb, var(--guide-color-ochre-fill) 30%, transparent); color: var(--guide-color-status-watch); }
[data-theme="dark"] .wrh-insight--warn .wrh-insight-icon { color: var(--guide-color-status-watch); }

/* ═══════════════════════════════════════════════════════════════════════════
   Rights search — the form (#wr-form), the results (src/rights/wr-search-view.js)
   and the detail card (src/rights/wr-detail-view.js).
   Lake is the only interactive colour. Moss, ochre and brick appear once, on the
   status dot. Purpose is words. A row is two lines and never wraps.
   ═══════════════════════════════════════════════════════════════════════════ */
/* The search surface (2026-11-23): the shared hero band is its header and this form its body, ONE navy slab. hero-band.css
   made the band solid sky-navy and fully rounded with a gap under it; the form was still the old ink block with a square
   top, so the two read as two different darks with a seam. The band's bottom corners and gap close here, the form takes the
   same ground and the other two corners, and everything on it is a FIXED on-navy colour: the ground is the same in both
   themes, so a flipping token (paper, ink) would put dark text on navy in the dark theme. The one action is lake, as the
   header of this section says; the gold button went. */
#main-content #rights-new > .tu-story-card.hero-band {
  margin-bottom: 0; padding-bottom: var(--guide-sp-5); border-bottom: 0;
  border-radius: var(--guide-radius-xl) var(--guide-radius-xl) 0 0;
}
.wrs-form {
  display: grid;
  gap: var(--guide-sp-3);
  margin: 0 0 var(--guide-sp-5);
  padding: 0 var(--guide-sp-6) var(--guide-sp-5);
  background: var(--guide-color-sky-navy);
  color: var(--guide-color-on-dark);
  border: 1px solid var(--guide-color-border-default); border-top: 0;
  border-radius: 0 0 var(--guide-radius-xl) var(--guide-radius-xl);
}
.wrs-find { display: flex; gap: var(--guide-sp-3); align-items: stretch; }
.wrs-field { position: relative; flex: 1; min-width: 0; }
.wrs-field > i, .wrs-field > svg {
  position: absolute; left: 16px; top: 50%; width: 20px; height: 20px;
  transform: translateY(-50%); color: color-mix(in srgb, var(--guide-color-sky-navy) 68%, var(--guide-color-white)); pointer-events: none;
}
.wrs-input {
  width: 100%; height: 56px; box-sizing: border-box;
  padding: 0 var(--guide-sp-4) 0 48px;
  font: inherit; font-size: var(--guide-fs-lg);
  color: var(--guide-color-sky-navy); background: var(--guide-color-white);
  border: 2px solid transparent; border-radius: var(--guide-radius-md, 8px);
}
.wrs-input:focus-visible {
  outline: none; border-color: var(--guide-color-action);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--guide-color-action) 45%, transparent);
}
.wrs-input::placeholder { color: color-mix(in srgb, var(--guide-color-sky-navy) 68%, var(--guide-color-white)); }
.wrs-go.btn {
  flex: none; height: 56px; padding: 0 var(--guide-sp-6);
  font-size: var(--guide-fs-lg); font-weight: 800;
  color: var(--guide-color-on-action); background: var(--guide-color-action);
  border: 0; border-radius: var(--guide-radius-md);
}
.wrs-go.btn:hover { background: color-mix(in srgb, var(--guide-color-action) 88%, var(--guide-color-white)); }
.wrs-go.btn:focus-visible { outline: 3px solid var(--guide-color-white); outline-offset: 3px; }

.wrs-moref > summary {
  display: inline-flex; align-items: center; gap: var(--guide-sp-2); cursor: pointer;
  font-size: var(--guide-fs-sm, 13px); font-weight: 600; color: var(--guide-color-on-dark);
}
.wrs-moref > summary { list-style: none; }
.wrs-moref > summary::-webkit-details-marker { display: none; }
.wrs-moref > summary::before { content: "\203A"; display: inline-block; width: 8px; font-size: 1.3em; line-height: 1; }
.wrs-moref[open] > summary::before { transform: rotate(90deg); }
.wrs-moref-n {
  min-width: 18px; padding: 0 5px; text-align: center; border-radius: var(--guide-radius-pill);
  font-size: var(--guide-fs-2xs, 11px); font-variant-numeric: var(--guide-numeric);
  background: var(--guide-color-white); color: var(--guide-color-sky-navy);
}
.wrs-moref-body { display: grid; gap: var(--guide-sp-3); margin-top: var(--guide-sp-3); }
.wrs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--guide-sp-2) var(--guide-sp-3); }
.wrs-grid .form-group { margin: 0; }
.wrs-grid label, .wrs-purpose legend {
  font-size: var(--guide-fs-xs, 12px); font-weight: 600; color: var(--guide-color-on-dark-2);
}
.wrs-purpose { margin: 0; padding: 0; border: 0; min-width: 0; }
.wrs-purpose legend { padding: 0; margin-bottom: var(--guide-sp-1); }
/* Purpose pills: a responsive grid that fills the width, as many across as fit, not a column. */
.wrs-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: var(--guide-sp-2); }
.wrs-chip {
  padding: 8px 14px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: inherit; font-size: var(--guide-fs-sm, 13px); cursor: pointer;
  color: var(--guide-color-on-dark); background: transparent;
  border: 1px solid color-mix(in srgb, var(--guide-color-white) 40%, transparent); border-radius: var(--guide-radius-pill);
}
.wrs-chip:hover { border-color: var(--guide-color-white); background: color-mix(in srgb, var(--guide-color-white) 14%, transparent); }
.wrs-chip[aria-pressed="true"] {
  background: var(--guide-color-white); border-color: var(--guide-color-white); color: var(--guide-color-sky-navy);
}
.wrs-chip:focus-visible, .wrs-link:focus-visible, .wrs-row:focus-visible, .wrs-act:focus-visible {
  outline: 2px solid var(--guide-color-action); outline-offset: 2px;
}
.wrs-form .wrs-chip:focus-visible, .wrs-form .wrs-link:focus-visible { outline-color: var(--guide-color-white); }
.wrs-form .wrs-check { display: flex; gap: var(--guide-sp-2); align-items: center; font-size: var(--guide-fs-sm, 13px); font-weight: 500; text-transform: none; letter-spacing: normal; color: var(--guide-color-on-dark); }
.wrs-aux { display: flex; gap: var(--guide-sp-4); }
.wrs-link {
  padding: 0; border: 0; background: none; font: inherit; font-size: var(--guide-fs-sm, 13px);
  color: var(--guide-color-on-dark); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}

/* The filter controls sit on the fixed navy ground in both themes, so they are fixed white fields like the search box: the
   dark theme had made the selects dark with a repeating chevron and the other fields a different dark again. */
.wrs-form :is(input:not([type="checkbox"]):not([type="search"]), select),
[data-theme="dark"] .wrs-form :is(input:not([type="checkbox"]):not([type="search"]), select) {
  background-color: var(--guide-color-white); color: var(--guide-color-sky-navy);
  border: 1px solid transparent; border-radius: var(--guide-radius-md, 8px);
}
.wrs-form select, [data-theme="dark"] .wrs-form select { appearance: auto; background-image: none; color-scheme: light; }   /* the browser's own arrow, drawn dark on the white field in both themes */
.wrs-form :is(input, select)::placeholder { color: color-mix(in srgb, var(--guide-color-sky-navy) 68%, var(--guide-color-white)); }
.wrs-form :is(input, select):focus-visible { outline: 2px solid var(--guide-color-action); outline-offset: 1px; }
/* On a phone the field gets the whole row and the button takes the next one, so the placeholder is readable. */
@media (max-width: 520px) {
  .wrs-find { flex-direction: column; }
  .wrs-go.btn { width: 100%; }
}

.wrs-results { margin-top: var(--guide-sp-2); }
.wrs-head { display: grid; gap: var(--guide-sp-2); padding-bottom: var(--guide-sp-3); }
.wrs-count {
  margin: 0; font-family: var(--guide-font-display); font-weight: 600;
  font-size: var(--guide-fs-xl, 20px); line-height: 1.2; color: var(--guide-color-ink);
  font-variant-numeric: var(--guide-numeric);
}
.wrs-query { margin: 0; font-size: var(--guide-fs-sm, 13px); color: var(--guide-color-ink-soft); line-height: 1.5; }
.wrs-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--guide-sp-2); }
.wrs-tools[hidden], .wrs-legend[hidden] { display: none; }
.wrs-sort { display: inline-flex; align-items: center; gap: var(--guide-sp-2); font-size: var(--guide-fs-xs, 12px); color: var(--guide-color-ink-soft); min-width: 0; }
.wrs-sort select { min-width: 0; }
.wrs-export { display: inline-flex; gap: var(--guide-sp-1); }
.wrs-legend { margin: 0; font-size: var(--guide-fs-xs, 12px); color: var(--guide-color-ink-muted); }

.wrs-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--guide-color-line); }
.wrs-li { margin: 0; border-bottom: 1px solid var(--guide-color-line); }
.wrs-row {
  display: grid; column-gap: var(--guide-sp-3); row-gap: 2px;
  width: 100%; padding: var(--guide-sp-2) var(--guide-sp-2); text-align: left; cursor: pointer;
  font: inherit; color: var(--guide-color-ink); background: transparent; border: 0;
}
.wrs-row:hover { background: var(--guide-color-paper-2); }
.wrs-row[aria-current="true"] {
  background: color-mix(in srgb, var(--guide-color-action) 9%, var(--guide-color-raised));
  box-shadow: inset 0 0 0 1px var(--guide-color-action);
}
.wrs-num { font-size: var(--guide-fs-sm, 13px); font-weight: 600; font-variant-numeric: var(--guide-numeric); white-space: nowrap; }
.wrs-owner { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--guide-fs-sm, 13px); color: var(--guide-color-ink-soft); }
.wrs-more { color: var(--guide-color-ink-muted); }
.wrs-st {
  display: inline-flex; align-items: center; gap: 5px; font-size: var(--guide-fs-xs, 12px);
  color: var(--guide-color-ink-soft); white-space: nowrap;
}
.wrs-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--guide-color-ink-muted); }
.wrs-st--ok::before { background: var(--guide-color-moss); }
.wrs-st--watch::before { background: var(--guide-color-ochre); }
.wrs-st--crit::before { background: var(--guide-color-brick); }
/* line two: priority date, source, purpose, flow. The source gives up room first. */
.wrs-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.wrs-meta {
  grid-column: 1 / -1; display: flex; gap: var(--guide-sp-3); min-width: 0; overflow: hidden;
  font-size: var(--guide-fs-xs, 12px); color: var(--guide-color-ink-soft); font-variant-numeric: var(--guide-numeric); white-space: nowrap;
}
.wrs-meta > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wrs-date, .wrs-flow { flex: none; }
.wrs-src { flex: 0 4 auto; }
.wrs-meta .wrs-purpose { flex: 0 1 auto; max-width: 9em; }   /* the results row's purpose word; the form's fieldset shares the class name */
.wrs-meta > * + *::before { content: "\00B7"; margin-right: var(--guide-sp-2); color: var(--guide-color-ink-muted); }
.wrs-listwrap { container-type: inline-size; }
/* A narrow panel (a phone, or the 340px rail on a laptop) gives the source its own line
   rather than cutting it to two letters. */
@container (max-width: 519px) {
  .wrs-meta { flex-wrap: wrap; gap: 1px var(--guide-sp-2); }
  .wrs-src { order: 3; flex: 1 0 100%; }
  .wrs-src::before { content: none; }
  .wrs-meta .wrs-purpose { max-width: 8.5em; }
}
.wrs-age { margin-left: 5px; color: var(--guide-color-ink-muted); }
.wrs-none { color: var(--guide-color-ink-muted); font-style: italic; }
.wrs-skel { display: block; height: 44px; margin: var(--guide-sp-2) 0; background: var(--guide-color-paper-2); border-radius: var(--guide-radius-sm, 6px); }

.wrs-state { padding: var(--guide-sp-4) 0; }
.wrs-state h4 { margin: 0 0 var(--guide-sp-2); font-family: var(--guide-font-display); font-size: var(--guide-fs-lg, 17px); color: var(--guide-color-ink); }
.wrs-state p { margin: 0 0 var(--guide-sp-3); font-size: var(--guide-fs-sm, 13px); color: var(--guide-color-ink-soft); line-height: 1.5; }
.wrs-state--error { border: 1px solid var(--guide-color-line-strong); border-radius: var(--guide-radius-md, 8px); padding: var(--guide-sp-4); background: var(--guide-color-raised); }
.wrs-state--error h4 { color: var(--guide-color-brick); }
.wrs-tips { margin: 0; padding-left: var(--guide-sp-4); font-size: var(--guide-fs-sm, 13px); color: var(--guide-color-ink-soft); line-height: 1.6; }
.wrs-pag { padding: var(--guide-sp-3) 0 0; }
.wrs-morebtn { width: 100%; }
.wrs-note { margin: 0; font-size: var(--guide-fs-sm, 13px); color: var(--guide-color-ink-soft); }
.wrs-prov { margin: var(--guide-sp-3) 0 0; font-size: var(--guide-fs-xs, 12px); color: var(--guide-color-ink-muted); line-height: 1.5; }

/* ── the detail card ─────────────────────────────────────────────────────── */
.wrd { display: grid; gap: var(--guide-sp-4); padding: var(--guide-sp-4); }
.wrd-headrow { display: flex; justify-content: space-between; align-items: baseline; gap: var(--guide-sp-3); }
.wrd-num { margin: 0; font-family: var(--guide-font-display); font-size: var(--guide-fs-xl, 20px); font-weight: 600; font-variant-numeric: var(--guide-numeric); color: var(--guide-color-ink); white-space: nowrap; }
.wrd-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--guide-fs-sm, 13px); font-weight: 600; color: var(--guide-color-ink-soft); }
.wrd-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--guide-color-ink-muted); }
.wrd-status--ok::before { background: var(--guide-color-moss); }
.wrd-status--watch::before { background: var(--guide-color-ochre); }
.wrd-status--crit::before { background: var(--guide-color-brick); }
.wrd-owner { margin: var(--guide-sp-1) 0 0; font-size: var(--guide-fs-base, 15px); color: var(--guide-color-ink); }
.wrd-more { color: var(--guide-color-ink-muted); }
.wrd-type { margin: var(--guide-sp-1) 0 0; font-size: var(--guide-fs-xs, 12px); color: var(--guide-color-ink-muted); }
.wrd-sec { display: grid; gap: var(--guide-sp-2); }
.wrd-h { margin: 0; font-size: var(--guide-fs-xs, 12px); font-weight: 600; letter-spacing: 0.04em; text-transform: var(--guide-label-case, uppercase); color: var(--guide-color-ink-muted); }
.wrd-lead { margin: 0; font-family: var(--guide-font-display); font-size: var(--guide-fs-lg, 17px); line-height: 1.45; color: var(--guide-color-ink); }
.wrd-lead--missing { font-family: inherit; font-size: var(--guide-fs-md, 14px); color: var(--guide-color-ink-soft); font-style: italic; }
.wrd-note { margin: 0; font-size: var(--guide-fs-sm, 13px); line-height: 1.55; color: var(--guide-color-ink-soft); }
.wrd-date { margin: 0; display: flex; align-items: baseline; gap: var(--guide-sp-3); }
.wrd-iso { font-family: var(--guide-font-display); font-size: var(--guide-fs-xl, 20px); font-weight: 600; font-variant-numeric: var(--guide-numeric); color: var(--guide-color-ink); }
.wrd-age { font-size: var(--guide-fs-sm, 13px); color: var(--guide-color-ink-soft); }
.wrd-act {
  justify-self: start; padding: var(--guide-sp-2) var(--guide-sp-3); font: inherit; font-size: var(--guide-fs-sm, 13px); font-weight: 600; cursor: pointer;
  color: var(--guide-color-action); background: transparent; border: 1px solid var(--guide-color-action); border-radius: var(--guide-radius-md, 8px);
}
.wrd-act:hover { background: color-mix(in srgb, var(--guide-color-action) 9%, transparent); }
.wrd-decree { margin: 0; font-size: var(--guide-fs-sm, 13px); color: var(--guide-color-ink-soft); line-height: 1.5; }
.wrd-decree-k { font-weight: 600; color: var(--guide-color-ink); }
.wrd-owners { font-size: var(--guide-fs-sm, 13px); color: var(--guide-color-ink); }
.wrd-owners > summary { cursor: pointer; font-weight: 600; color: var(--guide-color-action); }
.wrd-owners ul { margin: var(--guide-sp-2) 0 0; padding-left: var(--guide-sp-4); line-height: 1.6; }
.wrd-facts { margin: 0; display: grid; }
.wrd-fact { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: var(--guide-sp-3); padding: 6px 0; border-bottom: 1px solid var(--guide-color-line); font-size: var(--guide-fs-sm, 13px); }
.wrd-fact dt { color: var(--guide-color-ink-muted); }
.wrd-fact dd { margin: 0; color: var(--guide-color-ink); font-variant-numeric: var(--guide-numeric); overflow-wrap: anywhere; }
.wrd-missing { color: var(--guide-color-ink-muted); font-style: italic; }
.wrd-prov { margin: 0; font-size: var(--guide-fs-xs, 12px); line-height: 1.5; color: var(--guide-color-ink-muted); }
