/* /deputies/, /deputies/<slug>/, /vote/<id>/ — builds on committees.css (cm-kpis, cm-bar, cm-pill, cm-how…). */
:root { --v1: var(--good); --v2: var(--bad); --v3: var(--lv1); --v4: color-mix(in srgb, var(--muted) 45%, var(--lv0)); --v0: var(--lv0); }

.cm-kpis .good b { color: var(--good); }
.cm-kpis .mid b { color: var(--warn); }
.dp-kpis span { margin-top: 2px; }

/* list toolbar */
.dp-tools { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.dp-search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; }
.dp-search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.dp-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--fg); padding: 12px 0; outline: none; }
.dp-tools select { min-width: 0; font: inherit; font-size: 15px; color: var(--fg); background: var(--card); border: 1px solid var(--line);
                   border-radius: 14px; padding: 12px 36px 12px 14px; appearance: none; -webkit-appearance: none; cursor: pointer;
                   background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
                   background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.dp-search:focus-within, .dp-tools select:focus-visible { border-color: color-mix(in srgb, var(--fg) 40%, var(--line)); outline: none; }
.dp-sort { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 14px; font-size: 13.5px; }
.dp-sort .muted { margin-right: 2px; }
.dp-sort button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.dp-sort button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ink-fg); }

/* list */
.dp-table { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.dp-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 190px 64px 104px; align-items: center; gap: 14px;
          padding: 10px 18px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.dp-row[hidden] { display: none; }
.dp-head { white-space: nowrap; border-top: 0; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-block: 12px; }
.dp-head + .dp-row { border-top: 1px solid var(--line); }
a.dp-row:hover { background: var(--tint); }
.dp-row .ph, .dp-hero .ph { border-radius: 50%; overflow: hidden; background: var(--tint); display: grid; place-items: center;
                            color: var(--muted); font-size: 13px; font-weight: 600; }
.dp-row .ph { width: 40px; height: 40px; }
.dp-row .ph img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.dp-row .nm { min-width: 0; }
.dp-row .nm b { display: block; font-weight: 500; font-size: 15px; line-height: 1.3; }
.dp-row .nm small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-row .att { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 10px; align-items: center; }
.dp-row .att b { font-weight: 600; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.dp-row .num { text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; }
.dp-row .rec.good { color: var(--good); } .dp-row .rec.mid { color: var(--warn); } .dp-row .rec.bad { color: var(--bad); }
.dp-row.former { opacity: .72; }
.dp-empty { margin: 0; padding: 18px; color: var(--muted); font-size: 14.5px; border-top: 1px solid var(--line); }
.dp-former { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; }
.dp-former[aria-expanded="true"] svg { transform: rotate(180deg); }

/* deputy page */
.dp-page { padding-top: 28px; }
.dp-back { margin-bottom: 20px; }
.dp-hero { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; align-items: center; }
.dp-hero .ph { width: 120px; height: 150px; border-radius: 22px; font-size: 32px; }
.dp-hero .ph img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.dp-hero .date, .dp-vote-intro .date { font-size: 15px; color: var(--muted); margin: 0 0 6px; }
.dp-hero h1 { font-weight: 400; font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -.04em; margin: 0 0 12px; }
.dp-meta { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin: 0; font-size: 15px; color: var(--muted); }
.dp-meta a { color: var(--fg); }
.dp-fpill { background: var(--accent-soft); color: var(--accent); }
.dp-src { margin: 10px 0 0; font-size: 14px; }
.dp-src a { color: var(--muted); }
.dp-page .sect { padding-top: 48px; }
.dp-page .cm-kpis { margin-top: 28px; }

.dp-dist { display: flex; height: 18px; border-radius: 9px; overflow: hidden; gap: 2px; background: var(--card); position: relative; }
.dp-dist i { display: block; min-width: 3px; }
.v1 { --c: var(--v1); } .v2 { --c: var(--v2); } .v3 { --c: var(--v3); } .v4 { --c: var(--v4); } .v0 { --c: var(--v0); }
.dp-dist i, .dp-legend i { background: var(--c); }
.dp-legend { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14.5px; }
.dp-legend li { display: flex; align-items: center; gap: 7px; }
.dp-legend i { width: 11px; height: 11px; border-radius: 3px; }
.dp-legend b { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 2px; }

.dp-votes { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.dp-votes li + li { border-top: 1px solid var(--line); }
.dp-votes a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; color: inherit; text-decoration: none; }
.dp-votes a:hover { background: var(--tint); }
.dp-votes .t { font-size: 15px; line-height: 1.4; }
.dp-fold:not(.open) li.extra { display: none; }
.dp-votes .tt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dp-votes small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.dp-val { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap;
          background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.dp-val.v4, .dp-val.v0 { color: var(--muted); background: var(--tint); }
.dp-val.v3 { color: var(--warn); background: var(--warn-soft); }

.dp-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dp-hist li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--tint); border-radius: 14px; padding: 12px 16px; font-size: 15px; }
.dp-hist b { font-weight: 500; }
.dp-foot { margin-top: 40px; }

/* vote page */
.dp-vote-intro { padding-block: 0 8px; }
.dp-vote-intro h1 { font-size: clamp(26px, 3.2vw, 40px); }
.dp-dist-vote { margin-top: 16px; height: 22px; }
.dp-dist-vote .need { position: absolute; top: -4px; bottom: -4px; left: calc(226 / 450 * 100%); width: 2px; background: var(--fg); border-radius: 1px; }
.dp-fac { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.dp-fac-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, 58px); gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 15px; }
.dp-fac-row.dp-head { white-space: nowrap; border-top: 0; }
.dp-fac-row .nm b { display: block; font-weight: 500; margin-bottom: 6px; }
.dp-fac-row .nm .cm-bar { height: 6px; max-width: 260px; }
.dp-fac-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.dp-fac-row .num.y { font-weight: 600; color: var(--good); }
.dp-names { background: var(--card); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 10px; }
.dp-names summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; list-style: none; }
.dp-names summary::-webkit-details-marker { display: none; }
.dp-names summary b { font-variant-numeric: tabular-nums; }
.dp-names summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.dp-names[open] summary::after { transform: rotate(-135deg); }
.dp-names ul { list-style: none; margin: 0; padding: 0 18px 16px; columns: 3 220px; column-gap: 24px; font-size: 14.5px; }
.dp-names li { break-inside: avoid; padding: 3px 0; line-height: 1.35; }
.dp-names li a { color: inherit; }
.dp-names li small { display: block; font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .dp-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dp-search { grid-column: 1 / -1; }
  .dp-row { grid-template-columns: 40px minmax(0, 1fr) 130px 56px 64px; }
}
@media (max-width: 640px) {
  .dp-list-sect .cm-sect-h { margin-inline: 4px; }
  .dp-tools select { font-size: 14.5px; padding-block: 11px; }
  .dp-sort { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px; scrollbar-width: none; }
  .dp-sort::-webkit-scrollbar { display: none; }
  .dp-sort button { flex: none; }
  .dp-row { grid-template-columns: 40px minmax(0, 1fr) 48px 48px; gap: 10px; padding: 10px 14px; }
  .dp-row .att .cm-bar { display: none; }
  .dp-row .att { grid-template-columns: 1fr; }
  .dp-row > .num:not(.rec) { display: none; }
  .dp-head > span:nth-child(3) { font-size: 0; }
  .dp-head > span:nth-child(3)::after { content: "Участь"; font-size: 11px; }
  .dp-page { padding-top: 4px; }
  .dp-back { display: none; }
  .dp-hero { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; align-items: start; }
  .dp-hero .ph { width: 84px; height: 106px; border-radius: 18px; }
  .dp-hero h1 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; margin-bottom: 8px; }
  .dp-hero .date { font-size: 13px; }
  .dp-meta { font-size: 14px; }
  .dp-page .sect { padding-top: 36px; }
  .dp-votes a { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 14px; }
  .dp-votes .dp-val, .dp-votes .cm-pill { justify-self: start; }
  .dp-fac-row { grid-template-columns: minmax(0, 1fr) repeat(5, 34px); gap: 4px; padding: 10px 12px; font-size: 13.5px; }
  .dp-fac-row.dp-head { font-size: 10px; letter-spacing: .02em; }
  .dp-vote-intro h1 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
  .dp-names ul { columns: 1; }
}
