/* Editor poll dashboard: tab strip, poll list, audit log.
   Sits inside the existing .web-page shell, so it inherits the site's
   colour and type; only the layout is new. */

/* Same hazard as `.pdash-panel`: `display: flex` defeats `[hidden]`, and this
   strip must stay invisible to non-editors. */
.pdash-tabs[hidden] {
  display: none;
}

/* The tab strip is a segmented control, matching the variant / rarity switches
   on values: one shallow trough with 2px of inset, not a row of chips. */
.pdash-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 14px;
  padding: 2px;
  height: var(--ctl-h, 32px);
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  width: fit-content;
}

/* `web.v1.css` pins `.pdash-tab` to the full control height, which is right for
   a standalone button but wrong for a segment filling a 32px trough. Follow the
   `.segmented button` rule: fill the group minus its 2px inset and border. */
.pdash-tabs .pdash-tab {
  height: calc(var(--ctl-h, 32px) - 6px);
  box-sizing: border-box;
}

.pdash-tab {
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9aa3b4;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.pdash-tab:hover {
  /* Segments have no border of their own; the glass hover shadow would draw
     one around an otherwise flat strip. */
  border-color: transparent;
  box-shadow: none;
  color: #e6e9f0;
}

.pdash-tab[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  color: #fff;
}

.pdash-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* `display: flex` above beats the browser's built-in `[hidden]` rule, so a
   hidden panel would still render. Restore the attribute's meaning explicitly;
   without this every tab's content appears at once. */
.pdash-panel[hidden] {
  display: none;
}

/* Tab switching should not resize the page. Short tabs (Polls, Discussers) used
   to collapse to their content while Audit ran to thousands of pixels, so every
   click changed the document height and scrolled the page under the cursor. A
   floor on the panel keeps the three editor tabs the same size. */
.pdash-panel {
  min-height: 420px;
}

/* The hero heading and subtitle are shared by every tab, and they are the first
   thing the pointer lands on — but the subtitle is one line on most tabs and
   two on Audit, which pushed the tab strip (and everything below it) 20px down
   on that one click. Reserving two lines pins the strip in place. */
#dashboard-subtitle {
  min-height: 40px;
}

/* `hidden` on the Refresh button: `.web-btn` is `display: inline-flex`, which
   otherwise wins and keeps the button on screen. */
#refresh[hidden],
.web-hero .web-btn[hidden] {
  display: none;
}

/* Reserve the scrollbar's gutter so switching to the very tall Audit tab does
   not shift the centered page sideways. Overlay-scrollbar platforms ignore it. */
html {
  scrollbar-gutter: stable;
}

/* The per-tab filter bar. The glass layer gives this element a border, fill and
   blur, so it needs its own inset and radius — without them the heading sat
   flush against a hard-edged rectangle. Sized like `.collection-toolbar`. */
.pdash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 48px;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 12px;
}

.pdash-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.4px;
}

.pdash-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Text-like controls only: this selector used to catch the "show polls with no
   votes" checkbox and blow it up to a 160px empty box. Height and radius now
   match the search / sort controls on values and eggs. */
.pdash-controls input:not([type="checkbox"]):not([type="radio"]),
.pdash-controls select {
  height: var(--ctl-h, 32px);
  box-sizing: border-box;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: #e6eaf2;
  font: inherit;
  font-size: 11px;
  min-width: 160px;
}

.pdash-controls select {
  padding-right: 24px;
}

.pdash-controls input:focus,
.pdash-controls select:focus {
  outline: 2px solid rgba(var(--ui-accent-rgb), 0.45);
  outline-offset: 1px;
}

.pdash-hint {
  margin: 0;
  color: #7f8899;
  font-size: 11px;
  line-height: 1.5;
}

.pdash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.pdash-stat {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.pdash-stat b {
  display: block;
  color: #f2f4f8;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.pdash-stat span {
  color: #7f8899;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* --- Poll list ---------------------------------------------------------- */

.pdash-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pdash-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease;
}

.pdash-row:hover {
  border-color: rgba(var(--ui-accent-rgb), 0.45);
  background: rgba(var(--ui-accent-rgb), 0.06);
}

.pdash-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdash-pet {
  color: #f2f4f8;
  font-size: 13px;
  font-weight: 600;
}

.pdash-slot {
  color: #8b96aa;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pdash-row-body {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #98a2b6;
  font-size: 11px;
}

.pdash-median {
  min-width: 2.5ch;
  color: #fff;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.pdash-median.is-empty {
  color: #5a6273;
}



.pdash-chip {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #9aa4b6;
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pdash-chip.is-warn {
  background: rgba(255, 191, 122, 0.14);
  color: #ffcf9b;
}

.pdash-chip.is-bad {
  background: rgba(255, 120, 120, 0.16);
  color: #ffb4b4;
}

.pdash-chip.is-focus {
  background: rgba(var(--ui-accent-rgb), 0.18);
  color: #c3cbff;
}

.pdash-count,
.pdash-age {
  color: #7f8899;
  font-variant-numeric: tabular-nums;
}

.pdash-empty {
  padding: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  color: #7f8899;
  font-size: 12px;
  text-align: center;
}

/* --- Audit -------------------------------------------------------------- */

.pdash-audit {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  /* Audit renders up to 150 rows, which made this tab ~6,200px tall against
     ~900px for the other three — switching tabs re-laid out the whole page and
     discarded the scroll position. Cap the pane and scroll inside it, so all
     four tabs stay roughly the same size and the filter bar stays visible. */
  max-height: min(68vh, 720px);
  overflow-y: auto;
  /* Overlay scrollbars leave no visible track, so the clipped last row would be
     the only hint that the pane scrolls. An inset shadow paints on the pane
     itself (it does not scroll with the rows), giving the bottom edge a fade. */
  box-shadow: inset 0 -26px 22px -18px rgba(0, 0, 0, 0.7);
}

/* A grid, not `space-between`: with free-flowing text every column landed
   wherever its content happened to end, so the kind, actor, target and score
   never lined up between rows. Fixed tracks make it a table that reads by
   column. */
.pdash-audit-row {
  display: grid;
  /* kind · actor · target (with thumbnail) · previous · score · time */
  grid-template-columns: 82px minmax(96px, 0.8fr) minmax(180px, 1.7fr) 58px 56px 112px;
  align-items: baseline;
  gap: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #b8c1d0;
  font-size: 11.5px;
}

.pdash-audit-row:last-child {
  border-bottom: 0;
}

.pdash-audit-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.015);
}

.pdash-audit-row time {
  color: #6f798a;
  font-size: 10.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pdash-audit-row b {
  color: #f2f4f8;
  font-variant-numeric: tabular-nums;
}

.pdash-k {
  display: inline-block;
  min-width: 52px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #9aa4b6;
  font-size: 9.5px;
  letter-spacing: 0.4px;
  text-align: center;
  text-transform: uppercase;
}

.pdash-k.is-ok {
  background: rgba(126, 226, 168, 0.15);
  color: #b6f5d0;
}

.pdash-k.is-warn {
  background: rgba(255, 120, 120, 0.14);
  color: #ffb4b4;
}

@media (max-width: 640px) {
  .pdash-head {
    align-items: stretch;
  }

  .pdash-controls input,
  .pdash-controls select {
    flex: 1 1 140px;
    min-width: 0;
  }

  .pdash-audit-row {
    flex-direction: column;
    gap: 4px;
  }
}

/* --- Discusser directory ------------------------------------------------ */

.pdash-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.pdash-person {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease;
}

.pdash-person:hover {
  border-color: rgba(var(--ui-accent-rgb), 0.45);
  background: rgba(var(--ui-accent-rgb), 0.06);
}

.pdash-person-name {
  color: #f2f4f8;
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdash-person-stats {
  color: #8b96aa;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.pdash-person-stats b {
  color: #dfe4f0;
}

.pdash-person-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* Same box as the select beside it: the checkbox label previously carried its
   own padding while the glass layer left it unfilled, so it read as a plain
   outline next to a filled control. */
.pdash-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: var(--ctl-h, 32px);
  box-sizing: border-box;
  padding: 0 11px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
  border-radius: 7px;
  background: var(--glass-fill, rgba(255, 255, 255, 0.04));
  color: #b8c1d0;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.pdash-toggle input {
  accent-color: #7c8cff;
  cursor: pointer;
}

.pdash-toggle:hover {
  border-color: rgba(var(--ui-accent-rgb), 0.5);
}

.pdash-who {
  color: #c3cbff;
  font-weight: 550;
}

/* Audit cells */
.pdash-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdash-target {
  color: #dfe4f0;
}

.pdash-target .pdash-slot {
  margin-left: 6px;
  color: #6f798a;
  font-size: 9.5px;
  letter-spacing: .4px;
}

.pdash-arrow {
  color: #5a6273;
  padding: 0 2px;
}

.pdash-score {
  color: #9aa4b6;
  font-variant-numeric: tabular-nums;
}

.pdash-score b {
  color: #f2f4f8;
}

@media (max-width: 780px) {
  .pdash-audit-row {
    grid-template-columns: 74px minmax(0, 1fr) auto;
    row-gap: 4px;
  }

  .pdash-audit-row .pdash-cell:nth-child(3) {
    grid-column: 1 / -1;
    order: 3;
  }

  .pdash-audit-row time {
    grid-column: 1 / -1;
    justify-self: end;
    white-space: normal;
  }
}

/* Profile polling history: three cells, not the audit log's five. */
.pdash-hist-row {
  display: grid;
  /* A *fixed* status column, not `auto`: it holds "OPEN" or "SETTLED 74" plus a
     Remove button, and sizing it to content shifted the timestamp left or right
     per row. The track is wide enough for the longest combination. */
  grid-template-columns: minmax(0, 1fr) 190px 118px;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #b8c1d0;
  font-size: 11.5px;
}

.pdash-hist-row:last-child {
  border-bottom: 0;
}

.pdash-hist-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.015);
}

.pdash-hist-pet {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status cell: chip + action on one line. */
.pdash-hist-row > span:nth-child(2) {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pdash-hist-row time {
  color: #6f798a;
  font-size: 10.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* --- Profile page ------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   Profile page
   ---------------------------------------------------------------------------
   Same rhythm as the rest of the site: a breadcrumb, a padded glass hero, a
   muted description panel, stat tiles, then the history card. The hero used to
   inherit the glass border/fill with zero padding, so the avatar and the Edit
   button sat on the card's edges, and the description carried a one-off purple
   accent bar that nothing else on the site uses. */

.profile-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #737d90;
  font-size: 10px;
}

.profile-crumbs a {
  color: #a8b1c2;
  text-decoration: none;
}

.profile-crumbs a:hover {
  color: #fff;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 14px;
}

.profile-hero[hidden] {
  display: none;
}

.profile-id {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.profile-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--ui-accent-rgb), 0.22), rgba(180, 90, 255, 0.12));
  color: #dfe4ff;
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hero h1 {
  margin: 2px 0 4px;
}

/* A quiet ghost button: the hero's content is the focus now that the bio sits
   in it, so the edit action stops competing with the name. */
.profile-edit {
  display: inline-flex;
  flex: none;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  height: 30px;
  margin-left: auto;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: transparent;
  color: #a8b1c2;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.profile-edit svg {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-edit:hover {
  border-color: var(--ui-accent-line);
  background: var(--ui-accent-soft);
  color: #fff;
}

/* `display: inline-flex` above beats the browser's `[hidden]` rule, which made
   every viewer see the owner-only Edit button. Both hero actions are hidden
   until their script decides they apply. */
.profile-edit[hidden] {
  display: none;
}

/* The hero's action cluster. One wrapper takes the auto margin so Collection
   and Edit sit together on the right instead of splitting the free space. */
.profile-actions {
  display: flex;
  flex: none;
  gap: 8px;
  align-self: flex-start;
  margin-left: auto;
}

.profile-actions .profile-edit {
  margin-left: 0;
}

/* The collection link is the positive action on someone else's profile; give
   it the accent edge while keeping Edit's quiet material. */
.profile-collection {
  border-color: rgba(var(--ui-accent-rgb), 0.35);
  color: #cfd3ff;
  /* It is an <a>, unlike the Edit <button> beside it. */
  text-decoration: none;
}

/* The description lives inside the hero now: no box of its own, just a hairline
   separating it from the identity block. */
.profile-bio {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 2px 0 2px 22px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: none;
  color: #b9c1cf;
  font-size: 12.5px;
  line-height: 1.65;
}

/* User-authored line breaks belong to the description text, not the wrapper:
   `pre-wrap` on the box also rendered the template's own indentation as blank
   lines, so a one-line description rendered ~130px tall. */
.profile-bio p {
  margin: 0;
  white-space: pre-wrap;
}

.profile-private {
  margin: 0 0 16px;
  padding: 22px 20px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #7f8899;
  font-size: 12px;
  text-align: center;
}

.profile-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(var(--ui-accent-rgb), 0.3);
  border-radius: 12px;
  background: rgba(var(--ui-accent-rgb), 0.05);
}

.profile-editor[hidden] {
  display: none;
}

.profile-editor > label {
  color: #8b96aa;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.profile-editor textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: #e6eaf2;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
}

.profile-editor textarea:focus {
  outline: 2px solid rgba(var(--ui-accent-rgb), 0.45);
  outline-offset: 1px;
}

.profile-editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* The two privacy switches stack on the left so they read as one group and
   leave the action row where it belongs: the right edge. */
.profile-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* Action row for the editor: the message on the left, buttons on the right.
   These rules were part of the profile block and are restated here in the
   site's control language (32px, 7px radius) rather than the browser default
   button, which is what rendered when they were missing. */
.profile-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-editor-actions button {
  height: var(--ctl-h, 32px);
  padding: 0 14px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.09));
  border-radius: 7px;
  background: var(--glass-fill, rgba(255, 255, 255, 0.06));
  color: #dce1ea;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.profile-editor-actions button:hover {
  border-color: var(--glass-border-hi, rgba(255, 255, 255, 0.13));
  background: rgba(255, 255, 255, 0.09);
}

.profile-editor-actions button.is-primary {
  border-color: rgba(var(--ui-accent-rgb), 0.55);
  background: rgba(var(--ui-accent-rgb), 0.2);
  color: #dfe4ff;
}

.profile-editor-actions button.is-primary:hover {
  border-color: rgba(var(--ui-accent-rgb), 0.7);
  background: rgba(var(--ui-accent-rgb), 0.3);
}

/* Save confirmation, sitting between the checkbox and the buttons. */
.profile-msg {
  margin-right: 4px;
  color: #8ee0b0;
  font-size: 11px;
}

.profile-msg:empty {
  display: none;
}

/* Stat tiles and the history card sit in the same stack as the rest of the
   page; without the gap they collided. */
#profile-stats {
  margin-bottom: 16px;
}

#profile-history-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* `display: flex` defeats `[hidden]` — the section starts hidden and only
   appears when the API allows it, so restore the attribute's meaning. */
#profile-history-section[hidden] {
  display: none;
}

.hist-remove {
  margin-left: 8px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 120, 120, 0.35);
  border-radius: 999px;
  background: rgba(255, 120, 120, 0.1);
  color: #ffb4b4;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .3px;
  cursor: pointer;
}

.hist-remove:hover {
  background: rgba(255, 120, 120, 0.2);
}

.hist-remove.is-done {
  border-color: rgba(126, 226, 168, 0.4);
  background: rgba(126, 226, 168, 0.12);
  color: #b6f5d0;
  cursor: default;
}

/* --- Poll breakdown page ------------------------------------------------ */

.poll-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.poll-detail-head h1 {
  margin: 2px 0 4px;
}

.poll-detail-pet {
  flex: 0 0 auto;
  padding: 8px 15px;
  border: 1px solid rgba(var(--ui-accent-rgb), 0.45);
  border-radius: 9px;
  background: rgba(var(--ui-accent-rgb), 0.12);
  color: #dfe4ff;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.poll-detail-pet:hover {
  background: rgba(var(--ui-accent-rgb), 0.24);
}

/* Distribution histogram: one column per score point. */
.poll-dist {
  margin-bottom: 20px;
  padding: 14px 16px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.poll-dist-bar {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 120px;
}

.dist-col {
  flex: 1 1 0;
  height: var(--h);
  min-height: 2px;
  border-radius: 1px 1px 0 0;
  background: rgba(var(--ui-accent-rgb), 0.65);
}

.dist-col.is-empty {
  background: rgba(255, 255, 255, 0.05);
}

/* Outliers use the same red as every other warning in this feature. */
.dist-col.is-outlier {
  background: #ff8f8f;
}

.poll-dist-legend {
  margin: 8px 0 0;
  color: #7f8899;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

/* One voter per row: who · score · age · flags · action. */
.poll-voter-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) 56px 52px minmax(120px, 1fr) 82px;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #b8c1d0;
  font-size: 11.5px;
}

.poll-voter-row:last-child {
  border-bottom: 0;
}

.poll-voter-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.015);
}

/* A flagged vote is tinted across the whole row, not just badged. */
.poll-voter-row.is-outlier {
  background: rgba(255, 120, 120, 0.07);
}

.poll-voter-row.is-inactive {
  opacity: 0.5;
}

.vote-who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.vote-who a {
  overflow: hidden;
  color: #dfe4f0;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vote-who a:hover {
  color: #fff;
  text-decoration: underline;
}

.vote-ava {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.vote-score {
  color: #f2f4f8;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.vote-age {
  color: #7f8899;
  font-variant-numeric: tabular-nums;
}

.vote-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.vote-actions {
  text-align: right;
}

.hist-remove.is-restore {
  border-color: rgba(126, 226, 168, 0.4);
  background: rgba(126, 226, 168, 0.1);
  color: #b6f5d0;
}

@media (max-width: 760px) {
  .poll-voter-row {
    grid-template-columns: minmax(0, 1fr) 48px auto;
    row-gap: 4px;
  }

  .vote-chips {
    grid-column: 1 / -1;
    order: 4;
  }
}

/* Breadcrumbs on the poll pages.
   These pages do not load `pet-detail.v1.css`, so `.pet-crumbs` had none of its
   own rules: `display` stayed `block` and the two anchors ran together as
   "← Demand pollsXL King Doggy". Style the bar here, in full. */
#poll-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #737d90;
  font-size: 11px;
}

#poll-crumbs a {
  color: #a8b1c2;
  text-decoration: none;
}

#poll-crumbs a:hover {
  color: #fff;
}

/* Separator between crumbs, not before the first. */
#poll-crumbs a + a::before {
  margin-right: 8px;
  color: #4d5565;
  content: "•";
}

/* A fixed 1..100 scale makes polls comparable, but the empty stretch needs
   axis hints or it reads as a rendering bug. */
.poll-dist-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: #4d5565;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

/* "on <user>" prefix in the audit target cell. */
.pdash-on {
  margin-right: 6px;
  color: #7f8899;
}

.pdash-target .pdash-slot {
  margin-left: 7px;
}

/* Numeric columns right-align so magnitudes line up: an audit score cell holds
   either "75" or a transition like "0 -> 73", and left alignment made their
   last digits wander. */
.pdash-audit-row .pdash-cell:nth-child(4),
.poll-voter-row .vote-score,
.poll-voter-row .vote-age {
  text-align: right;
}

.pdash-audit-row .pdash-cell:nth-child(4) .pdash-score {
  display: block;
}

.pdash-audit-row .pdash-cell:nth-child(5) {
  text-align: right;
}

/* Pet thumbnail in the target cell. */
.pdash-target {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pdash-target-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdash-thumb {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  object-fit: cover;
}

.pdash-thumb.is-empty {
  display: inline-block;
}

/* Previous-demand cell: a value, or an em dash when there was none. */
.pdash-prev {
  color: #8b96aa;
  font-variant-numeric: tabular-nums;
}

.pdash-none {
  color: #4d5565;
}

/* Numeric cells right-aligned, now shifted one column along. */
.pdash-audit-row .pdash-cell:nth-child(4),
.pdash-audit-row .pdash-cell:nth-child(5),
.pdash-audit-row .pdash-cell:nth-child(6) {
  text-align: right;
}

@media (max-width: 900px) {
  .pdash-audit-row {
    grid-template-columns: 74px minmax(80px, auto) minmax(0, 1fr) 52px 48px 96px;
    gap: 8px;
  }

  .pdash-thumb {
    width: 18px;
    height: 18px;
  }
}

/* --- Poll detail: type scale and centring -------------------------------- */

/* The stat boxes are wide, so centred content reads better than text hugging
   the left edge. Scoped to this page: the dashboard's stats stay left-aligned. */
#poll-stats .pdash-stat {
  text-align: center;
}

#poll-stats .pdash-stat b {
  font-size: 22px;
}

#poll-stats .pdash-stat span {
  font-size: 11px;
}

/* "not set" is an absence, not a number: do not render it at number size. */
#poll-stats .pdash-stat b.is-empty {
  color: #7f8899;
  font-size: 15px;
  font-weight: 600;
}

/* Larger, more readable vote rows. */
.poll-voter-row {
  font-size: 13px;
}

.poll-voter-row .vote-score {
  font-size: 16px;
}

.poll-voter-row .vote-age {
  font-size: 12px;
}

.poll-dist-legend {
  font-size: 11.5px;
}

.poll-voters-hint,
.pdash-hint {
  font-size: 12px;
}

.poll-detail-head h1 {
  font-size: 34px;
  line-height: 1.1;
}

.poll-detail-pet {
  font-size: 12px;
  padding: 8px 16px;
}

/* --- Settle panel -------------------------------------------------------- */

.poll-settle {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0 4px;
  padding: 14px 16px;
  /* A tinted hint, not an outlined box: the accent reads through the fill and
     the border stays near the soft hairline used everywhere else. */
  border: 1px solid rgba(var(--ui-accent-rgb), 0.16);
  border-radius: 12px;
  background: rgba(var(--ui-accent-rgb), 0.06);
}

.poll-settle-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.poll-settle-btn {
  height: var(--ctl-h, 32px);
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: #dce1ea;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.poll-settle-btn:hover:not(:disabled) {
  border-color: rgba(var(--ui-accent-rgb), 0.34);
  color: #fff;
}

.poll-settle-btn.is-primary {
  border-color: rgba(var(--ui-accent-rgb), 0.32);
  background: rgba(var(--ui-accent-rgb), 0.18);
  color: #e6e9ff;
}

.poll-settle-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.poll-settle-or {
  color: #7f8899;
  font-size: 11px;
}

.poll-settle-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #7f8899;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.poll-settle-field input {
  width: 74px;
  height: var(--ctl-h, 32px);
  box-sizing: border-box;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: #e6eaf2;
  font: inherit;
  font-size: 12px;
}

.poll-settle-note {
  margin: 0;
  min-height: 15px;
  color: #8b96aa;
  font-size: 11.5px;
}

.poll-settle-note[data-tone="ok"] {
  color: #7ee2a8;
}

.poll-settle-note[data-tone="warn"] {
  color: #f0c86a;
}

/* Section selector matches the current segmented-control language. */
.pdash-tab {
  padding: 0 12px;
  border-radius: 7px;
  color: #8b94a6;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
}

.pdash-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

#pdash-tabs .pdash-tab[aria-pressed="true"] {
  background-color: var(--ui-accent-soft);
  background-image: none;
  box-shadow: inset 0 0 0 1px var(--ui-accent-line);
  color: #fff;
}


@media (max-width: 760px) {
  .profile-hero {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }

  .profile-id {
    flex: 1 1 100%;
    gap: 12px;
  }

  .profile-hero h1 {
    overflow-wrap: anywhere;
    font-size: clamp(22px, 7vw, 30px);
    line-height: 1.1;
  }

  .profile-edit {
    margin-left: auto;
  }
}

/* Stack the hero: identity, then the edit action, then the description. */
@media (max-width: 720px) {
  .profile-hero {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
  }

  .profile-id {
    flex-basis: 100%;
  }

  .profile-edit {
    order: 2;
    align-self: center;
    margin-left: 0;
  }

  .profile-bio {
    order: 3;
    flex-basis: 100%;
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}
