/* Enquetes (staff-enquetes.js). Reuses the push composer cards (.pcm-*) and
   the style.css tokens; only the list, the illustration picker, results and
   the app popup mockup live here. */
#enquetes-tab { max-width: var(--page-max, 1180px); }
#enquetes-tab .pcm-card label { margin-top: 0; }
.enq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.enq-head p { margin: 4px 0 0; max-width: 620px; }
.enq-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.enq-item {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left;
  color: var(--text); cursor: pointer; font: inherit; width: 100%; border-radius: 0;
}
.enq-item:last-child { border-bottom: 0; }
.enq-item:hover { background: var(--panel-2); }
.enq-thumb { width: 52px; height: 52px; object-fit: contain; }
.enq-item-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.enq-item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enq-item-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.enq-app { border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; color: var(--text-2); }
.enq-votes { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.enq-votes b { color: var(--text); font-weight: 600; }
.enq-status { font-size: 11.5px; border-radius: 999px; padding: 2px 9px; white-space: nowrap; border: 1px solid var(--border); color: var(--muted); }
.enq-status.st-live { background: var(--success-soft); color: var(--success); border-color: transparent; }
.enq-status.st-scheduled { background: var(--app-soft); color: var(--app-strong); border-color: transparent; }
.enq-empty { border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; }
.enq-error { color: var(--danger-strong); }
.enq-crumbs { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.enq-crumbs code { font-size: 11.5px; }

/* Illustration picker */
.enq-illus { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; max-height: 280px; overflow: auto; padding: 2px; }
.enq-illu-pick { aspect-ratio: 1; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; min-height: 0; }
.enq-illu-pick:hover { background: var(--panel-2); }
.enq-illu-pick.is-on { border-color: var(--app); box-shadow: 0 0 0 2px var(--app-soft); }
.enq-illu-pick img { width: 100%; height: 100%; object-fit: contain; }
:root[data-theme="dark"] .enq-illu-pick img, :root[data-theme="dark"] .enq-thumb { filter: invert(1); }

/* Question fields */
.enq-count { float: right; font-size: 11.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: normal; }
.enq-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.enq-opt { display: flex; gap: 8px; align-items: flex-end; }
.enq-opt label { flex: 1; margin: 0; }
.enq-langs .enq-lang { grid-template-columns: minmax(150px, 1.4fr) 104px 60px auto; }
.enq-apps { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.enq-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; text-transform: none; letter-spacing: normal; color: var(--text); font-weight: 500; }
.enq-check input { width: 16px; height: 16px; margin: 0; }
.enq-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.enq-pv-controls { align-items: center; margin-bottom: 10px; }
.enq-pv-controls > label { min-width: 150px; margin: 0; }
.enq-row { display: flex; gap: 10px; justify-content: flex-end; }
.enq-dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: var(--text); max-width: 440px; padding: 20px; }
.enq-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.enq-dialog h3 { margin: 0 0 8px; }

/* Results */
.enq-results { margin-bottom: 16px; }
.enq-total { font-size: 13px; color: var(--text-2); margin-left: auto; margin-right: 8px; }
.enq-total b { font-size: 20px; font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }
.enq-bar { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 96px; gap: 12px; align-items: center; margin: 8px 0; font-size: 13.5px; }
.enq-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enq-bar-track { height: 10px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.enq-bar-track > span { display: block; height: 100%; background: var(--app); border-radius: 999px; }
.enq-bar-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.enq-bar-n b { font-weight: 400; color: var(--text); }
.enq-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.enq-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.enq-table th, .enq-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: right; }
.enq-table th:first-child, .enq-table td:first-child { text-align: left; }
.enq-table th { color: var(--muted); font-weight: 600; }

/* Popup mockup: light/dark like the app (system background, glass rows). */
.enq-phone { --s-bg: #ffffff; --s-text: #1c1c1e; --s-sub: #6c6c70; --s-row: rgba(120, 120, 128, .10); --s-fill: rgba(37, 167, 222, .22); --s-line: rgba(60, 60, 67, .14);
  border-radius: 28px; padding: 14px 10px 0; background: linear-gradient(#d9d9de, #c7c7cc); overflow: hidden; }
.enq-phone.theme-dark { --s-bg: #1c1c1e; --s-text: #f2f2f7; --s-sub: #a1a1a6; --s-row: rgba(120, 120, 128, .24); --s-fill: rgba(37, 167, 222, .32); --s-line: rgba(255, 255, 255, .10);
  background: linear-gradient(#2c2c2e, #111); }
.enq-sheet { position: relative; background: var(--s-bg); color: var(--s-text); border-radius: 22px 22px 0 0; padding: 22px 20px 18px; text-align: center; }
.enq-grabber { position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--s-line); }
.enq-close { position: absolute; top: 12px; left: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--s-row); display: grid; place-items: center; font-size: 12px; color: var(--s-sub); }
.enq-pv-illu { width: 96px; height: 96px; object-fit: contain; margin: 4px auto 0; display: block; }
.theme-dark .enq-pv-illu { filter: invert(1); }
.enq-pv-title { font-size: 21px; font-weight: 700; line-height: 1.2; margin: 12px 0 0; }
.enq-pv-sub { font-size: 14.5px; color: var(--s-sub); line-height: 1.35; margin: 6px 0 0; }
.enq-pv-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.enq-pv-opt { position: relative; display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 24px; background: var(--s-row); text-align: left; font-size: 15px; overflow: hidden; }
.enq-pv-fill { position: absolute; inset: 0 auto 0 0; background: var(--s-fill); border-radius: 24px; }
.enq-pv-txt { position: relative; flex: 1; }
.enq-pv-check { color: var(--app); font-weight: 700; }
.enq-pv-pct { position: relative; font-weight: 300; font-variant-numeric: tabular-nums; color: var(--s-sub); }
.enq-pv-dismiss { min-height: 20px; margin: 14px 0 0; font-size: 15px; }
@media (max-width: 640px) {
  .enq-item { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .enq-item .enq-votes { display: none; }
  .enq-bar { grid-template-columns: minmax(0, 1fr) 80px; }
  .enq-bar-track { grid-column: 1 / -1; grid-row: 2; }
}
