/*
 * Published voter list (views/v3/voter-roll): canvas-painted table, watermark and the
 * anti-copy rules. Loaded only on those pages.
 */

/* No selecting, dragging or long-press menus on the protected pages (form fields excepted) */
.vr-protect { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.vr-protect input, .vr-protect textarea, .vr-protect select, .vr-protect .select2-container { -webkit-user-select: text; user-select: text; }
.vr-protect canvas, .vr-protect img { -webkit-user-drag: none; pointer-events: none; }

/*
 * This file loads before site.css (layout @stack('styles')), so table and filter rules use
 * ".rm-table.vr-table" / ".rm-filter.vr-filter" to win over site.css's ".rm-table td" etc.
 */
.rm-filter.vr-filter { grid-template-columns: 2fr 1fr auto; }
@media (max-width: 992px) { .rm-filter.vr-filter { grid-template-columns: 1fr 1fr; } }

.vr-area { position: relative; }
.vr-wrap { position: relative; }
.rm-table.vr-table { table-layout: fixed; min-width: 860px; }
.vr-w-serial { width: 7%; } .vr-w-reg { width: 9%; } .vr-w-receipt { width: 13%; } .vr-w-name { width: 23%; }
.vr-w-rel { width: 21%; } .vr-w-dist { width: 12%; } .vr-w-act { width: 15%; }
.rm-table.vr-table td { vertical-align: middle; }
.rm-table.vr-table canvas { display: block; max-width: 100%; }
.rm-table.vr-table .vr-c-act { text-align: right; }
.rm-table.vr-table .vr-c-act .rm-btn { pointer-events: auto; white-space: nowrap; }
.vr-sort { color: inherit; display: inline-flex; align-items: center; gap: 6px; }
.vr-sort i { opacity: .45; font-size: 11px; }
.vr-sort:hover, .vr-sort.is-active { color: var(--rm-indigo); }
.vr-sort.is-active i { opacity: 1; }
.vr-skel { display: block; height: 12px; border-radius: 6px; background: var(--rm-tint); width: 70%; }

/* Watermark tiles over the rows; clicks pass through to the buttons underneath */
.vr-wm { position: absolute; inset: 0; pointer-events: none; z-index: 2; background-repeat: repeat; }

/* Covers the list while the window is unfocused (snipping tools) or about to print */
.vr-shield { display: none; position: absolute; inset: 0; z-index: 3; background: rgba(246, 247, 251, .97); color: var(--rm-muted); font-weight: 600; text-align: center; padding: 40px 16px; border-radius: 16px; }
.vr-area.is-shielded .vr-shield { display: grid; place-items: center; }
.vr-area.is-shielded canvas { visibility: hidden; }

.vr-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--rm-ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1080; max-width: calc(100% - 32px); text-align: center; }
.vr-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.vr-print-msg { display: none; }
@media print {
  body.vr-protect > *:not(main), body.vr-protect main > * { display: none !important; }
  body.vr-protect main { display: block !important; }
  body.vr-protect .vr-print-msg { display: block !important; padding: 60px 20px; text-align: center; font: 600 20px var(--rm-body); color: #000; }
}

/* Correction page */
.vr-record-wrap { border: 1px solid var(--rm-line); border-radius: 14px; padding: 6px 16px; overflow: hidden; }
.vr-record { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; margin: 0; }
.vr-record > div { padding: 10px 0; border-bottom: 1px solid var(--rm-line); min-width: 0; }
.vr-record dt { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--rm-muted); margin-bottom: 4px; }
.vr-record dd { margin: 0; min-height: 22px; }
.vr-record canvas { display: block; max-width: 100%; }
.vr-correction .rm-card + .rm-card, .vr-correction .rm-alert + .rm-card { margin-top: 20px; }
.vr-subtitle { font-size: 16px; font-weight: 700; margin: 26px 0 4px; }
.vr-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
fieldset[disabled] .form-control, fieldset[disabled] .form-check { opacity: .6; }

/* Thank-you page after a correction request */
.vr-done { text-align: center; max-width: 640px; margin-inline: auto; }
.vr-done-icon { font-size: 56px; line-height: 1; color: var(--rm-ok); margin-bottom: 12px; }
.vr-done-title { font-size: 22px; font-weight: 700; margin: 0 0 18px; }
.vr-done-ref { display: inline-block; font: 700 26px/1.2 var(--rm-body); letter-spacing: .06em; color: var(--rm-indigo); background: var(--rm-tint); border: 1px dashed var(--rm-indigo-2); border-radius: 12px; padding: 10px 22px; margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.vr-done-summary { text-align: left; border: 1px solid var(--rm-line); border-radius: 14px; margin-top: 22px; }
.vr-done-summary > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; padding: 10px 16px; border-top: 1px solid var(--rm-line); }
.vr-done-summary > div:first-child { border-top: 0; }
.vr-done-summary span { color: var(--rm-muted); font-size: 14px; }
.vr-done-summary b { font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 700px) {
  .vr-record { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/*
 * Phones: each voter is a compact card
 *   नाम (bold)
 *   पिता / पति का नाम
 *   क्रम | पंजीयन | रसीद / ID
 *   जिला          [✎ सुधार]
 */
@media (max-width: 600px) {
  .rm-filter.vr-filter { grid-template-columns: minmax(0, 1fr); }

  .rm-table.vr-table { min-width: 0; table-layout: auto; font-size: 14px; }
  .rm-table.vr-table colgroup, .rm-table.vr-table thead { display: none; }
  .rm-table.vr-table, .rm-table.vr-table tbody { display: block; }
  .rm-table.vr-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr);
    grid-template-areas: "name name name" "rel rel rel" "serial reg receipt" "dist dist act";
    gap: 6px 12px; padding: 14px 16px; border-top: 1px solid var(--rm-line);
  }
  .rm-table.vr-table tr:first-child { border-top: 0; }
  .rm-table.vr-table tbody tr:hover { background: none; }
  .rm-table.vr-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .rm-table.vr-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--rm-muted); line-height: 1.3; }
  .rm-table.vr-table .vr-c-name { grid-area: name; font-size: 16.5px; }
  .rm-table.vr-table td.vr-c-name[data-label]::before { display: none; }
  .rm-table.vr-table .vr-c-rel { grid-area: rel; margin-top: -4px; }
  .rm-table.vr-table .vr-c-serial { grid-area: serial; }
  .rm-table.vr-table .vr-c-reg { grid-area: reg; }
  .rm-table.vr-table .vr-c-receipt { grid-area: receipt; }
  .rm-table.vr-table .vr-c-dist { grid-area: dist; }
  .rm-table.vr-table .vr-c-act { grid-area: act; align-self: end; text-align: right; }
  .rm-table.vr-table .vr-c-act .rm-btn { padding: 6px 10px; font-size: 13px; }
  .rm-table.vr-table .vr-act-more { display: none; }

  .vr-record { grid-template-columns: minmax(0, 1fr); }
}
