/* Ads (app/views/app/ads/index.view.php): each campaign, then its ads as cards that show what people see (the
   picture, text, headline and button) above the three figures that matter, the rest under More. */
.adx-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 720px; }
.adx-camp { margin: 0 0 28px; }
.adx-camp-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; }
.adx-camp-h h2 { margin: 0; font: 600 20px/1.2 var(--f-head); min-width: 0; overflow-wrap: anywhere; }
.adx-camp-n { margin-left: auto; color: var(--n700); font-size: 13px; white-space: nowrap; }
.adx-set { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; padding: 8px 12px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); font-size: 13.5px; }
.adx-set-nm { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.adx-set .pill, .adx-set .adx-bud, .adx-set form { flex: none; }
.adx-set form, .adx-name form { margin: 0; }
.adx-bud { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 14px; background: var(--card); color: var(--ink); font: 500 13px var(--f-body); white-space: nowrap; }
button.adx-bud { cursor: pointer; }
button.adx-bud:hover { border-color: var(--ink); }

.adx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 0 0 14px; }
.adx { display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.adx-img { position: relative; aspect-ratio: 1 / 1; background: var(--bg); }
.adx-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.adx-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--n300, #c7c7cc); }
.adx-noimg .i { width: 48px; height: 48px; }
.adx-kind { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; }
.adx-copy { padding: 10px 12px 0; min-width: 0; }
.adx-text { margin: 0 0 8px; font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.adx-line { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; padding: 8px 10px; background: var(--bg); border-radius: var(--radius-sm, 6px); min-width: 0; }
.adx-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adx-cta { flex: none; padding: 3px 9px; border: 1px solid var(--rule); border-radius: 6px; background: var(--card); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.adx-foot { margin-top: auto; padding: 10px 12px 12px; }
.adx-name { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 12.5px; color: var(--n700); min-width: 0; }
.adx-name > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adx-note { margin: -4px 0 8px; font-size: 12.5px; color: var(--bad, #b42318); }
.adx-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding-top: 8px; border-top: 1px solid var(--rule); }
.adx-nums div { min-width: 0; }
.adx-nums dt { color: var(--n700); font-size: 11.5px; white-space: nowrap; }
.adx-nums dd { margin: 0; font: 600 18px/1.2 var(--f-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adx-more { margin-top: 8px; font-size: 12.5px; }
.adx-more summary { cursor: pointer; color: var(--n700); list-style: none; }
.adx-more summary::-webkit-details-marker { display: none; }
.adx-more summary:hover { color: var(--ink); }
.adx-more dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 8px 0 0; }
.adx-more dl div { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.adx-more dt { color: var(--n700); white-space: nowrap; }
.adx-more dd { margin: 0; font-weight: 600; white-space: nowrap; }
.adx-more .adx-url { grid-column: 1 / -1; }
.adx-more .adx-url dd { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.adx-tog { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: var(--card); color: var(--ink); cursor: pointer; }
.adx-tog.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.adx-drafts-h { margin: 8px 0 10px; font: 600 18px var(--f-head); }
@media (max-width: 640px) {
  /* the dates in one row of equal parts, not two lines */
  .ads-bar nav[aria-label="Dates"] { display: flex; flex-wrap: nowrap; width: 100%; gap: 2px; }
  .ads-bar nav[aria-label="Dates"] a { flex: 1 1 auto; min-width: 0; padding: 0 4px; font-size: 12.5px; text-align: center; white-space: nowrap; }
  .adx-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .adx-tiles .tile { padding: 10px; }
  .adx-tiles .tile b { font-size: 22px; }
  .adx-camp-n { margin-left: 0; }
  .adx-grid { grid-template-columns: minmax(0, 1fr); }
}

/* each ad's links: the real ad on Facebook and Instagram, and Edit */
.adx-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.adx-links a { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 14px; color: var(--ink); font-size: 12.5px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.adx-links a:hover { border-color: var(--ink); }
.adx-links .adx-ed { margin-left: auto; }

/* Edit (ads/edit) and Boost (ads/boost) */
.adx-h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adx-edit { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.adx-edit .card h2, .adx-boost .card h2 { margin: 0 0 12px; }
.adx-edit > .card ~ .card { margin-top: 0; }
.adx-pic .adx-img { border-radius: var(--radius-sm, 6px); overflow: hidden; margin: 0 0 10px; }
.adx-pic input[type=file] { flex: 1; min-width: 0; }
.adx-setname { display: flex; align-items: center; gap: 6px; margin: -6px 0 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adx-ages { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0 12px; }
.adx-ages select, .adx-ages input { width: 100%; }
.adx-chips, .adx-places { display: flex; flex-wrap: wrap; gap: 6px; }
.adx-places:not(:empty) { margin: 0 0 8px; }
.adx-place { display: inline-flex; align-items: center; gap: 4px; }
.adx-place select { height: 32px; width: auto; padding: 0 6px; font-size: 13px; }
.adx-chip { display: inline-flex; margin: 0; cursor: pointer; }
.adx-chip input { position: absolute; opacity: 0; pointer-events: none; }
.adx-chip > span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 16px; background: var(--card); color: var(--n700); font-size: 13px; white-space: nowrap; }
.adx-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.adx-chip input:focus-visible + span { outline: 2px solid var(--p700); outline-offset: 2px; }
.adx-place .adx-chip input:not(:checked) + span { text-decoration: line-through; }
.adx-find { position: relative; display: flex; gap: 6px; }
.adx-find input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); font: inherit; }
.adx-find select { flex: none; width: auto; }
.adx-found { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 8px 20px rgba(0, 0, 0, .12); }
.adx-found button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 14px var(--f-body); text-align: left; cursor: pointer; }
.adx-found button:hover, .adx-found button:focus { background: var(--soft); }
.adx-found small { color: var(--n700); white-space: nowrap; }
.adx-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.adx-post { position: relative; display: flex; flex-direction: column; margin: 0; background: var(--card); border: 2px solid var(--rule); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.adx-post input { position: absolute; opacity: 0; pointer-events: none; }
.adx-post:has(input:checked) { border-color: var(--ink); }
.adx-post.no { opacity: .45; cursor: not-allowed; }
.adx-post-t { margin: 8px 10px; padding: 0; font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .adx-edit { grid-template-columns: minmax(0, 1fr); }
  .adx-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
