/* WUA Remix Phase 5 — tribal compacts, federal reserved rights, scenario simulator, recycled water, transboundary. */

.tch-summary, .frh-summary, .tb-summary {
  padding: 10px 12px; background: rgba(15,118,110,0.06);
 border-radius: 4px;
  font-size: var(--guide-fs-sm); margin-bottom: 14px;
}
.tch-role-pill {
  display: inline-block; margin-left: 8px;
  background: var(--guide-color-action); color: var(--guide-color-text-on-accent, #fff); padding: 2px 10px;
  border-radius: 999px; font-size: var(--guide-fs-2xs); font-weight: 600;
}
.tch-card-head h4 { margin: 0; font-size: var(--guide-fs-md); }
.tch-allocs td { padding: 3px 6px; border-top: 1px solid rgba(var(--guide-wash-rgb, 0, 0, 0), 0.05); }
.tch-allocs td:last-child { text-align: right; }
.tch-allocs tr.tch-total td { background: rgba(15,118,110,0.05); padding-top: 6px; padding-bottom: 6px; }
/* The two rows that replaced the invented per-use allocation table: a compact
   with no quantity read yet, and the provenance line under the ones that have.
   Both are prose in a numeric table, so they drop the right-alignment. */
.tch-allocs td.tch-noqty, .tch-allocs td.tch-verified {
  text-align: left; font-size: var(--guide-fs-2xs); line-height: 1.45;
  color: var(--text-muted, rgba(0, 0, 0, 0.62)); padding: 8px 6px;
}
.tch-allocs td.tch-verified { background: rgba(15, 118, 110, 0.05); }
.tch-instream summary { font-size: var(--guide-fs-xs); color: var(--text-muted, rgba(0,0,0,0.6)); cursor: pointer; }
.tch-instream ul { margin: 4px 0 0 18px; padding: 0; font-size: var(--guide-fs-2xs); }
.tch-footer { font-size: var(--guide-fs-2xs); color: var(--text-muted, rgba(0,0,0,0.55)); margin-top: 12px; }
.frh-table th {
  text-align: left; padding: 6px 8px;
  text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.04em;
  font-size: var(--guide-fs-2xs); color: var(--text-muted, rgba(0,0,0,0.55));
  border-bottom: 1px solid var(--guide-color-border-default, rgba(0,0,0,0.1));
}
.frh-table td { padding: 5px 8px; border-top: 1px solid rgba(var(--guide-wash-rgb, 0, 0, 0), 0.05); }
.frh-status { font-size: var(--guide-fs-2xs); color: var(--text-muted, rgba(0,0,0,0.65)); }
.frh-footer { font-size: var(--guide-fs-2xs); color: var(--text-muted, rgba(0,0,0,0.55)); margin-top: 12px; }

/* ── Scenario simulator ────────────────────────────────────────────────── */
.ss-form fieldset, .rw-form fieldset, .tb-form fieldset {
  border: 1px solid var(--guide-color-border-default, rgba(0,0,0,0.1)); border-radius: 8px;
  padding: 12px 14px 6px; margin-bottom: 14px;
}
.ss-form legend, .rw-form legend, .tb-form legend {
  font-size: var(--guide-fs-2xs); text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.05em;
  color: var(--text-muted, rgba(0,0,0,0.6)); font-weight: 600; padding: 0 6px;
}
.ss-form label, .rw-form label, .tb-form label {
  display: block; font-size: var(--guide-fs-xs); font-weight: 600;
  color: var(--text-muted, rgba(0,0,0,0.7)); margin-bottom: 10px;
}
.ss-form input, .ss-form select, .rw-form input, .rw-form select, .tb-form select {
  display: block; width: 100%; margin-top: 4px; padding: 7px 10px;
  border: 1px solid rgba(var(--guide-wash-rgb, 0, 0, 0), 0.15); border-radius: 5px;
  font-size: var(--guide-fs-sm);
}
.ss-row, .rw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ss-intro, .rw-intro, .tb-intro {
  font-size: var(--guide-fs-xs); color: var(--text-muted, rgba(0,0,0,0.6));
  line-height: 1.5; margin: 0 0 12px;
  padding: 10px 12px; background: rgba(15,118,110,0.05);
 border-radius: 4px;
}
.ss-actions, .rw-actions, .tb-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap;
}
.ss-results h4, .rw-results h4 {
  font-size: var(--guide-fs-2xs); text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.05em;
  color: var(--text-muted, rgba(0,0,0,0.55));
  margin: 14px 0 4px;
}
.ss-block, .rw-verdict {
  padding: 8px 12px; background: rgba(var(--guide-wash-rgb, 0, 0, 0), 0.03);
 border-radius: 4px;
  font-size: var(--guide-fs-xs); margin-bottom: 4px;
}
.ss-pending, .rw-pending, .tb-pending {
  padding: 10px 12px; background: rgba(15,118,110,0.05);
 border-radius: 4px;
  color: #0f766e; font-size: var(--guide-fs-sm);
}

/* ── Recycled water ────────────────────────────────────────────────────── */
.rw-verdict {  background: color-mix(in srgb, var(--guide-color-moss) 6%, transparent); color: #166534; }
.rw-table { width: 100%; border-collapse: collapse; font-size: var(--guide-fs-sm); }
.rw-table td { padding: 5px 10px; border-top: 1px solid rgba(var(--guide-wash-rgb, 0, 0, 0), 0.05); }
.rw-table td:first-child { color: rgba(0,0,0,0.65); }
.rw-uses, .rw-caveats { margin: 4px 0 0 18px; font-size: var(--guide-fs-xs); line-height: 1.5; }
.rw-reg { font-size: var(--guide-fs-xs); color: rgba(0,0,0,0.65); }
.rw-authority { color: var(--text-muted, rgba(0,0,0,0.55)); margin-top: 10px; }
.rw-error, .tb-error { padding: 10px 12px; background: color-mix(in srgb, var(--guide-color-status-crit) 8%, transparent); border: 1px solid var(--guide-color-line); border-radius: 4px; color: var(--guide-color-status-crit); }

/* ── Transboundary table ───────────────────────────────────────────────── */
.tb-table { width: 100%; border-collapse: collapse; font-size: var(--guide-fs-xs); margin-top: 8px; }
.tb-table th {
  text-align: left; padding: 6px 8px;
  text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.04em;
  font-size: var(--guide-fs-2xs); color: var(--text-muted, rgba(0,0,0,0.55));
  border-bottom: 1px solid var(--guide-color-border-default, rgba(0,0,0,0.1));
}
.tb-table td { padding: 5px 8px; border-top: 1px solid rgba(var(--guide-wash-rgb, 0, 0, 0), 0.05); }
.tb-row--err { background: color-mix(in srgb, var(--guide-color-status-crit) 6%, transparent); }
.tb-row--warn { background: color-mix(in srgb, var(--guide-color-ochre) 6%, transparent); }
.tb-row--ok { background: color-mix(in srgb, var(--guide-color-moss) 4%, transparent); }
.tb-sep { border: 0; border-top: 1px dashed var(--guide-color-border-default, rgba(0,0,0,0.1)); margin: 14px 0; }

@media (max-width: 640px) {
  .ss-row, .rw-row { grid-template-columns: 1fr; }
}

/* ── Dark-theme overrides ── */
[data-theme="dark"] .tch-card {
  background: var(--bg-2, #1E2229);
  border-color: rgba(255,255,255,0.10);
}
[data-theme="dark"] .tch-mca { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .tch-allocs td { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .frh-table th { border-bottom-color: rgba(255,255,255,0.10); }
[data-theme="dark"] .frh-table td { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .ss-form fieldset, [data-theme="dark"] .rw-form fieldset,
[data-theme="dark"] .tb-form fieldset { border-color: rgba(255,255,255,0.10); }
[data-theme="dark"] .ss-form input, [data-theme="dark"] .ss-form select,
[data-theme="dark"] .rw-form input, [data-theme="dark"] .rw-form select,
[data-theme="dark"] .tb-form select { border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .ss-block { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .rw-verdict { color: #4ADE80; }
[data-theme="dark"] .rw-table td { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .rw-table td:first-child { color: var(--text-secondary, #A8A8B3); }
[data-theme="dark"] .rw-reg { color: var(--text-secondary, #A8A8B3); }
[data-theme="dark"] .rw-error, [data-theme="dark"] .tb-error { color: #F87171; }
[data-theme="dark"] .tb-table th { border-bottom-color: rgba(255,255,255,0.10); }
[data-theme="dark"] .tb-table td { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .tb-sep { border-top-color: rgba(255,255,255,0.10); }
