/* Styles for the audience screens: lists, list members, segments (shared components stay in components.css). */

.row.center { justify-content: center; }
.empty .row.center svg { margin-bottom: 0; color: inherit; } /* the empty state's icon rule must not reach the buttons */
.tabs .tabcount { color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.plainlist { margin: 8px 0 0; padding-left: 18px; }
.plainlist li + li { margin-top: 2px; }

/* A member taken out of the list stays on the row, struck through, until the page is left. */
tr.gone td:not(.act) { opacity: .45; text-decoration: line-through; }
tr.gone td.act { opacity: 1; }

/* The list's three numbers: one compact row each on a phone. */
@media (max-width: 700px) {
  .stats.tight { grid-template-columns: 1fr; gap: 8px; }
  .stats.tight .stat { display: grid; grid-template-columns: 5.5rem 1fr; column-gap: 8px; align-items: baseline; padding: 10px 14px; }
  .stats.tight .stat b { grid-row: span 2; }
  .stats.tight .stat small { margin-top: 0; }
}

/* Add contacts dialog: search results and the two bulk ways. */
.row.search > .search { flex: 1 1 12rem; }
dialog h3 { margin-bottom: 8px; }
.picks { margin-top: 10px; min-height: 3rem; }
.picks > p { margin: 8px 0; }
.pickrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.pickrow:first-child { border-top: 0; }
.pickwho { min-width: 0; }
.pickwho b, .pickwho small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.alt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); }
.alt:hover { background: var(--surface-2); border-color: var(--line-strong); text-decoration: none; }
.alt svg { flex: none; margin-top: 2px; color: var(--accent); }
.alt b, .alt small { display: block; }
@media (max-width: 700px) { .alts { grid-template-columns: 1fr; } }

/* Segment builder: "Dove / e / oppure" lead words come from the combination. */
.rule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 560; }
.rule select { width: auto; font-weight: 500; }
.conds { display: flex; flex-direction: column; gap: 10px; }
.cond { display: grid; grid-template-columns: 3.6rem minmax(10rem, 1fr) minmax(9rem, .8fr) minmax(12rem, 1.5fr) auto; gap: 8px; align-items: start; }
.cond .lead { padding-top: 9px; color: var(--ink-3); font-size: .85rem; text-align: right; }
.cond:first-child .lead::before { content: "Dove"; }
.conds[data-mode="and"] .cond:not(:first-child) .lead::before { content: "e"; }
.conds[data-mode="or"] .cond:not(:first-child) .lead::before { content: "oppure"; }
.cond .vals { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.cond .vals > * { flex: 1 1 0; min-width: 0; }
.cond .chip { height: auto; min-height: 28px; padding-block: 3px; border-radius: 14px; line-height: 1.3; }
.cond-idle { padding: 16px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--ink-2); }
.cond-idle p { margin-bottom: 10px; }
.addrow { margin-top: 14px; }
@media (max-width: 900px) {
  .cond { grid-template-columns: minmax(0, 1fr) auto; }
  .cond .lead { grid-column: 1 / -1; text-align: left; padding-top: 0; }
  .cond select, .cond .vals { grid-column: 1; }
  .cond > button { grid-column: 2; grid-row: 2; }
}

/* The count and what to do with it stay in view while the conditions are edited. */
.resultbar {
  position: sticky; bottom: 16px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 20px; margin: 16px 0 22px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
}
.resultbar .big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.resultbar .big b { font-size: 1.7rem; line-height: 1.1; font-weight: 650; font-variant-numeric: tabular-nums; }
.resultbar .big small { flex-basis: 100%; }
.resultbar small.bad { color: var(--bad); }
.resultbar.busy .big { opacity: .45; }
.resultbar.busy > button { pointer-events: none; opacity: .5; }
.agents { margin-top: 18px; color: var(--ink-3); }
.agents summary { cursor: pointer; font-size: .85rem; }
.agents pre { margin-top: 8px; }

/* Coupon campaigns: the offers each holder sees. */
.coupons { margin-top: 14px; }
.coupons .chips { margin: 8px 0 12px; }
.coupons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.coupons-grid figure { margin: 0; }
.coupons-grid img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: block; }
.coupons-grid figcaption { font-size: .82rem; margin-top: 6px; }
.coupons-grid figcaption b, .coupons-grid figcaption small { display: block; }
