/* Distress by county (distress.html). Builds on search.css; theme.css swaps the colors. */
.link.current { color: var(--gold-lt); font-weight: 600; }
.link.small { font-size: 12px; padding: 2px 4px; }
.bad { color: var(--red); }
.good { color: var(--green-lt); }
[hidden] { display: none !important; }

.ds-page {
  max-width: 1360px; margin: 0 auto; padding: 22px 16px 110px;
  display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start;
}
.ds-side { display: flex; flex-direction: column; gap: 16px; }
.ds-step { padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.ds-step-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ds-step-title { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text); }
.ds-picked { font-size: 12px; color: var(--muted); }
.ds-help { margin: -4px 0 12px; font-size: 12.5px; color: var(--muted); }
.ds-subhead { margin: 14px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

.ds-state { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.ds-state select {
  font: inherit; font-size: 14px; color: var(--text); background: rgba(var(--tint), .04);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; outline: none;
}
.ds-state select:focus { border-color: var(--gold); }
.ds-counties { display: flex; flex-wrap: wrap; gap: 8px; }
.ds-county {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text); background: transparent;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer;
}
.ds-county span { color: var(--muted); font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }
.ds-county:hover { border-color: var(--gold); }
.ds-county[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.ds-county[aria-pressed="true"] span { color: var(--bg); opacity: .7; }
.ds-county-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ds-county-note:empty { display: none; }
.ds-county-note b { color: var(--text); }

.ds-signals { display: flex; flex-direction: column; gap: 8px; }
.ds-signal {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.ds-signal.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text) inset; }
.ds-signal input { margin: 3px 0 0; width: 17px; height: 17px; accent-color: var(--gold); }
.ds-signal-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ds-signal-text b { font-size: 14px; font-weight: 600; }
.ds-signal-text small { font-size: 12px; line-height: 1.35; color: var(--muted); }
.ds-signal-text small.ds-found { color: var(--text); opacity: .8; font-variant-numeric: tabular-nums; }
.ds-signal-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ds-n { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-signal.zero .ds-n { color: var(--muted); font-weight: 400; }
.ds-signal.off { cursor: default; opacity: .7; border-style: dashed; }
.ds-signal.off input { opacity: .4; }

/* Coverage badges (also used in the legend) */
.lg { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.lg.ok { color: #1f6b3b; background: #dcf2e3; }
.lg.part { color: #284f8f; background: #dfe8fa; }
.lg.paid { color: #8a5a00; background: #fbedc8; }
.lg.none { color: var(--muted); background: rgba(var(--tint), .07); }
.ds-legend { margin: 14px 0 0; font-size: 11.5px; color: var(--muted); line-height: 2; }
.ds-legend .lg { margin-left: 6px; }
.ds-legend .lg:first-child { margin-left: 0; }

.saved-list { display: flex; flex-direction: column; gap: 8px; }
.saved-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 6px 6px 6px 12px; background: rgba(var(--tint), .03);
}
.saved-item a { display: flex; flex-direction: column; color: var(--text); text-decoration: none; min-width: 0; }
.saved-item a:hover b { color: var(--gold-lt); }
.saved-item .sub { font-size: 11.5px; }

/* Results */
.ds-main { min-width: 0; }
.ds-empty { padding: 40px 28px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.ds-empty h1 { margin: 0 0 8px; color: var(--text); font-size: 26px; }
.ds-title { margin: 4px 0 4px; font-size: 26px; line-height: 1.25; }
.ds-sub { margin: 0 0 16px; color: var(--muted); }
.ds-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.ds-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(var(--tint), .07); }
.ds-tabs button {
  font: inherit; font-size: 13.5px; color: var(--muted); background: none; border: none; border-radius: 7px; padding: 8px 14px; cursor: pointer;
}
.ds-tabs button[aria-selected="true"] { background: var(--panel-solid); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.saved-status { display: block; min-height: 1.2em; margin: 0 0 8px; }
.save-form[hidden], .result-tools .btn[hidden] { display: none; }

.ds-table-wrap { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.ds-table-wrap .empty { border: none; }
.ds-table th { padding: 14px 12px; font-weight: 600; letter-spacing: 1px; }
.ds-table td { padding: 16px 12px; vertical-align: middle; }
.ds-table td:first-child, .ds-table th:first-child { padding-left: 18px; }
.ds-pick { width: 36px; }
.ds-pick input { width: 18px; height: 18px; accent-color: var(--gold); cursor: pointer; }
.ds-stack {
  display: inline-block; min-width: 54px; text-align: center; font-size: 17px; font-weight: 600;
  border-radius: 7px; padding: 4px 10px; color: #8a3c00; background: #fde3c4;
}
.ds-stack.s1 { color: var(--muted); background: rgba(var(--tint), .08); }
.ds-stack.s3, .ds-stack.s4 { color: #fff; background: #c2561a; }
.ds-hit { font-size: 12px; font-weight: 600; color: #8a3c00; background: #fbe1d2; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.ds-open-cell { text-align: right; }
.ds-open-cell .btn { padding: 9px 22px; }
.ds-more { display: flex; justify-content: center; margin-top: 14px; }

@media (max-width: 980px) {
  .ds-page { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .top { flex-wrap: wrap; }
  .ds-title { font-size: 21px; }
  .result-tools { width: 100%; }
  .ds-table-wrap { border: none; background: none; }
  .ds-table th:first-child, .ds-table td:first-child { padding-left: 0; }
  .ds-table td.ds-pick, .ds-table td.ds-stack-cell { display: inline-block; width: auto; margin-right: 8px; }
  .ds-table td.ds-pick::before, .ds-table td.ds-stack-cell::before { content: none; }
  .ds-open-cell { text-align: left; }
}
.ds-quick { margin-bottom: 14px; }
.ds-quick:empty { display: none; }
.ds-quick .ds-county { padding: 10px 14px; font-weight: 600; }

/* Recent search (Step 1) */
.ds-recent { position: relative; margin: -4px 0 14px; }
.ds-recent-list {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(320px, 100%);
  display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 12px;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.ds-recent-list[hidden] { display: none; }
.ds-recent-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left;
  font: inherit; color: var(--text); background: none; border: none; border-radius: 8px; padding: 8px 10px; cursor: pointer;
}
.ds-recent-item:hover, .ds-recent-item:focus-visible { background: rgba(var(--tint), .06); }
.ds-recent-item span { font-size: 12px; color: var(--muted); }
.ds-picked-note { margin: 4px 0 0; font-size: 12.5px; color: var(--gold-lt); }
.ds-picked-note:empty { display: none; }

/* Tier and score (step 2) */
.ds-top6 { margin: -4px 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ds-top6:empty { display: none; }
.ds-top6 b { color: var(--text); }
.ds-tier { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.ds-tier.t1 { color: #fff; background: #b42318; }
.ds-tier.t2 { color: #fff; background: #c2561a; }
.ds-tier.t3 { color: #8a3c00; background: #fbe1d2; }
.ds-tier.tw { color: var(--muted); background: rgba(var(--tint), .08); }
.ds-tier-cell { white-space: nowrap; }
.ds-tier-cell .sub { white-space: normal; max-width: 180px; }
.ds-tier-cell .ds-eq { font-size: 11px; color: var(--muted); font-style: italic; }
.ds-toolbar .sort select { padding: 7px 10px; }

/* Row buttons: Open, Research */
.ds-open-cell { white-space: nowrap; }
.ds-open-cell .ds-research { margin-left: 6px; padding: 9px 14px; }

/* Links in the county note and the probate note match the page's gold links */
.ds-county-note a, #probate-note a { color: var(--gold-lt); }

/* ---- Search by Distress: look-up box and the probate rows in the one list ---- */
.ds-lookup { display: flex; flex-direction: column; gap: 8px; }
.ds-lookup input { width: 100%; box-sizing: border-box; }
.ds-lookup-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ds-lookup-step .ds-help { margin-top: 10px; }
.ds-case-row td { background: rgba(var(--tint), .025); }
.ds-kind { display: inline-block; margin-bottom: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; }
.ds-kind.case { background: rgba(140, 110, 210, .18); color: #b9a4f0; }
:root[data-theme="light"] .ds-kind.case { color: #5b3fb0; }
.results .chips a.ds-hit:not(.btn), .results .chips a.ds-hit:not(.btn):visited { text-decoration: none; color: #8a3c00; font-size: 12px; }
.results .chips a.ds-hit:not(.btn):hover { text-decoration: underline; }
.ds-lookup input {
  font: inherit; font-size: 14px; color: var(--text); background: rgba(var(--tint), .04);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; outline: none;
}
.ds-lookup input:focus { border-color: var(--gold); }
