/* Unified page layout for both shortcodes */
.ath-page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}
.ath-section-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 2.5rem 0 1.2rem 0;
  text-align: left;
}
.ath-wrap, .ath-bonuses-wrap {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.ath-bonuses-table, .ath-matrix {
  width: 100%;
  margin: 0;
}
.ath-toolbar-row {
  max-width: 100%;
}
.ath-wrap{font:inherit;max-width:1200px}
.ath-toolbar{margin-bottom:.75rem}
.ath-toolbar-row{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;max-width:1200px}
.ath-toolbar .ath-filter-bank,
.ath-toolbar .ath-filter-search,
.ath-toolbar .ath-filter-reset{display:flex;align-items:center}
.ath-toolbar .ath-filter-search{flex:1 1 420px;min-width:220px;max-width:600px}
.ath-toolbar .ath-filter-search .ath-search{flex:1 1 auto;width:100%}
#ath-search{width:100%;padding:.4rem .6rem}
#ath-bank,#ath-reset{height:38px;padding:.4rem .6rem}
#ath-reset{padding:0 .9rem}
.ath-results{min-height:2rem}
.ath-table{width:100%;border-collapse:collapse}
.ath-table th,.ath-table td{padding:.5rem;border-bottom:1px solid #eee;text-align:left}
.ath-table thead th{position:sticky;top:0;background:#fafafa;z-index:1}
.ath-chip{position:relative;display:inline-flex;align-items:center;gap:.5rem;padding:.3rem .65rem;border:1px solid #e3e8f1;border-radius:999px;background:#fff;cursor:pointer;user-select:none;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}
.ath-chip input[type="checkbox"]{position:absolute;opacity:0;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);pointer-events:none}
.ath-alliances .ath-chip{display:inline-flex;align-items:center;gap:.4rem;padding:.25rem .5rem;border:1px solid #e3e8f1;border-radius:999px;background:#fff;cursor:pointer}
.ath-alliances .alli-logo{height:24px;width:auto;display:inline-block}
.ath-chip .alli-logo{height:24px;width:auto;display:inline-block;opacity:.7;filter:grayscale(.35)}
.ath-chip span{line-height:1.2;font-size:.9rem;color:#1f2937}
.ath-chip:hover{background:#f7fafc}
.ath-chip.is-active{background:#e7efff;border-color:#2563eb;box-shadow:0 0 0 1px rgba(37,99,235,.18)}
.ath-chip.is-active .alli-logo{opacity:1;filter:none}
.ath-chip.is-active span{font-weight:600}
.ath-tag{display:inline-block;padding:.15rem .4rem;margin:.1rem;border-radius:12px;background:#f3f4f6;font-size:.85em}
.ath-group{margin:1rem 0}
.ath-group-title{margin:.25rem 0 .5rem 0}
@media (max-width:768px){
  .ath-toolbar .ath-search{flex-basis:100%}
  .ath-table thead{display:none}
  .ath-table tr{display:block;border-bottom:1px solid #eee}
  .ath-table td{display:block;padding:.4rem .2rem}
  .ath-table td::before{content:attr(data-label);font-weight:600;margin-right:.35rem}
}

/* Matrix styles */
.ath-matrix{width:auto;max-width:1200px;border-collapse:collapse;font-family:inherit;table-layout:fixed;font-size:1rem}
.ath-matrix thead th{position:sticky;top:0;padding:.45rem .35rem;border:1px solid #e6e6e6;text-align:center;font-size:.95rem;font-weight:600}
.ath-matrix tbody td{padding:.4rem .3rem;border:1px solid #eee;vertical-align:top;text-align:center}
.ath-matrix tbody td:first-child{text-align:left;width:300px;max-width:300px;padding:.4rem .35rem;position:relative}
.ath-matrix thead th:first-child{width:300px;text-align:left}
.ath-matrix thead th:not(:first-child){width:140px}
.ath-matrix tbody td:not(:first-child){width:140px}
.partner-cell{display:flex;align-items:center;gap:.5rem;text-align:left;min-width:0;width:100%}
.ath-partner-cell{display:flex;align-items:center;gap:.5rem;min-width:0;width:100%}
.ath-partner-logo{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.ath-partner-text{display:flex;flex-direction:column;gap:.12rem;min-width:0;flex:1;overflow:hidden}
.ath-partner-link{display:block;flex:1 1 auto;min-width:0;width:100%;color:inherit;text-decoration:none}
.ath-partner-link:hover,
.ath-partner-link:focus{color:inherit;text-decoration:underline}
.partner-cell .partner-logo{height:28px;width:auto;flex-shrink:0;padding:2px;border-radius:4px;background:#fff;margin-right:.5rem}
.partner-cell .partner-info{display:flex;flex-direction:column;gap:.12rem;min-width:0;flex:1;overflow:hidden}
.partner-cell .partner-name{font-weight:600;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;font-size:.95rem}
.partner-cell .partner-program{font-size:.8rem;color:#6b7280;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.partner-cell--table{align-items:center}
.partner-cell--table .partner-logo{height:32px}
.ath-alliance-chip{display:inline-flex;align-items:center;margin-left:0;padding:.18rem .4rem;border-radius:999px;background:rgba(37,99,235,.08);gap:.3rem;flex-shrink:0;margin-right:.7rem}
.partner-cell .ath-alliance-chip{margin-top:0;margin-left:0;margin-right:0;order:unset}
.ath-alliance-chip .alliance-logo{height:24px;width:auto;display:block;opacity:.97;flex-shrink:0}
.ath-alliances{display:flex;flex-wrap:wrap;gap:.75rem}
.ath-matrix{margin-top:.5rem}
.ath-cell{display:flex;flex-direction:column;gap:.3rem;align-items:center;justify-content:center;min-height:55px;text-align:center}
.ath-cell-topline{display:flex;align-items:center;justify-content:center;gap:.4rem;flex-wrap:wrap}
.ath-cell-ratio{font-weight:600;font-size:1.05rem;line-height:1}
.ath-cell-bonus{display:inline-flex;align-items:center;gap:.18rem;padding:.12rem .5rem;border-radius:999px;background:#0f9d74;color:#fff;font-weight:600;font-size:.85rem;line-height:1;white-space:nowrap}
.ath-cell-time{font-size:.9rem;color:#4b5563}

.ath-bonuses-wrap{margin-top:.5rem}
.ath-bonuses-table{width:auto;max-width:900px;border-collapse:collapse;font-size:.9rem;background:#fff;border-radius:10px;overflow:hidden;table-layout:auto}
.ath-bonuses-table thead th{position:sticky;top:0;background:#f7f9fb;text-align:left;font-weight:600;padding:.4rem .55rem;border-bottom:1px solid #e0e6ef;z-index:1;box-shadow:0 1px 0 rgba(0,0,0,.03);letter-spacing:.01em}
.ath-bonuses-table tbody td{padding:.35rem .55rem;border-bottom:1px solid #e6ecf4;vertical-align:middle;line-height:1.25}
.ath-bonuses-table tbody tr:nth-child(odd){background:#fbfdff}
.ath-bonuses-table tbody tr:nth-child(even){background:#f3f7fc}
.ath-bonuses-table tbody tr:hover{background:#edf3ff}
.ath-bonuses-table .entity{display:inline-flex;align-items:center;gap:.4rem;min-width:0;max-width:280px}
.ath-bonuses-table .entity .logo{height:16px;width:auto;display:inline-block;max-width:90px}
.ath-bonuses-table .entity .name{line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ath-bonuses-table td:nth-child(1){width:300px;max-width:300px;padding:.35rem .65rem}
.ath-bonuses-table td:nth-child(2){width:200px;max-width:200px;padding:.35rem .65rem}
.ath-bonuses-table td:nth-child(3),
.ath-bonuses-table td.ath-bonus-cell{text-align:right;white-space:nowrap;width:150px;max-width:220px;min-width:130px;padding:.35rem .75rem}
.ath-bonuses-table td:nth-child(4){white-space:nowrap;color:#4b5563;font-weight:500;width:160px;max-width:160px;padding:.35rem .65rem}
.ath-bonuses-table .pct{display:inline-flex;align-items:center;justify-content:flex-end;font-weight:700;font-size:1rem}
.ath-section-title{margin-bottom:.5rem}
.ath-empty{margin:.75rem 0;color:#556}

[data-bonus-notes]{cursor:help;position:relative}
.ath-bonus-tooltip{position:absolute;display:none;background:#111827;color:#f9fafb;font-size:.85rem;line-height:1.4;padding:.65rem .8rem;border-radius:.6rem;box-shadow:0 18px 35px rgba(15,23,42,.25);max-width:320px;width:max-content;pointer-events:none}
.ath-bonus-tooltip .ath-bonus-tooltip-inner{margin:0;padding:0}
.ath-bonus-tooltip p{margin:0}
.ath-bonus-tooltip ul{margin:.25rem 0 0 1rem;padding:0;list-style:disc}
.ath-bonus-tooltip li{margin:.15rem 0}

.ath-partners.ath-hide-bank .ath-filter-bank{display:none!important}
.ath-partners.ath-hide-pills .ath-filter-pills{display:none!important}
.ath-partners.ath-hide-pills .ath-toolbar-row.row-2{display:none!important}
.ath-partners.ath-hide-reset .ath-filter-reset{display:none!important}
.ath-partners.ath-hide-search .ath-filter-search{display:none!important}

@media (max-width:768px){
  .ath-matrix thead{display:none}
  .ath-matrix tbody tr{display:block;border:1px solid #e6e6e6;border-radius:8px;margin-bottom:1rem;padding:.6rem}
  .ath-matrix tbody td{display:block;border:none;padding:.25rem 0;text-align:left}
  .ath-matrix tbody td::before{content:attr(data-label);font-weight:600;display:inline-block;width:110px}
  .ath-matrix tbody td.partner-cell{display:flex;align-items:flex-start;gap:.6rem;padding:.35rem 0}
  .ath-matrix tbody td.partner-cell::before{display:none;content:none}
  .partner-cell .partner-logo{height:24px}
  .ath-cell{align-items:flex-start;text-align:left;min-height:0}
  .ath-bonuses-table{font-size:.88rem}
  .ath-bonuses-table thead th,.ath-bonuses-table tbody td{padding:.3rem .45rem}
  .ath-bonuses-table .entity .logo{height:14px}
}

/* Additional context-sensitive spacing and layout rules (idempotent append) */
.ath-partners.ath-hide-bank .ath-filter-search { margin-left: 0; }
.ath-partners .ath-filter-bar { display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; }

/* Pills row behaves well when present */
.ath-filter-pills { display:flex; gap:.5rem; flex-wrap:wrap; }

/* Keep table header from “jumping” when filters are gone */
.ath-partners.ath-hide-bank.ath-hide-pills .ath-filter-bar { margin-bottom:.5rem; }

/* Make the RESET btn consistent across breakpoints */
.ath-filter-reset .ath-btn-reset { padding:.5rem .9rem; border-radius:.5rem; }

/* Slightly tighter cells for compact single-partner view */
.ath-partners.ath-hide-bank.ath-hide-pills .ath-table td,
.ath-partners.ath-hide-bank.ath-hide-pills .ath-table th { padding:.65rem .6rem; }

/* Prevent logo squish at narrow widths */
.ath-partners .ath-bank-logo img,
.ath-partners .ath-partner-logo img { max-height:28px; height:auto; width:auto; }
@media (max-width: 640px) {
  .ath-partners .ath-bank-logo img,
  .ath-partners .ath-partner-logo img { max-height:24px; }
}

/* Default: show matrix, hide cards */
.ath-cards { display: none; }

/* Small phones: switch to cards, hide the matrix */
@media (max-width: 480px) {
  .ath-matrix { display: none !important; }
  .ath-cards { display: block; }
  .ath-card { display:block; border:1px solid #eee; border-radius:12px; padding:.75rem; margin:.6rem 0; background:#fff; box-shadow:0 2px 4px rgba(0,0,0,.05); }
  .ath-card-partner .ath-card-header { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
  .ath-card-partner .ath-card-title { display:flex; align-items:center; gap:.5rem; min-width:0; }
  .ath-card-partner .ath-card-title .ath-partner-link { display:inline-flex; align-items:center; gap:.5rem; text-decoration:none; color:inherit; min-width:0; }
  .ath-card-partner .ath-partner-logo { display:flex; align-items:center; flex-shrink:0; }
  .ath-card-partner .ath-partner-logo img { max-height:28px; height:auto; width:auto; }
  .ath-card-partner .ath-partner-name { font-weight:600; font-size:1.02rem; line-height:1.05; color:#111; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ath-card-partner .ath-card-alliance { margin-left:auto; display:flex; align-items:center; gap:.25rem; }
  .ath-card-partner .ath-card-alliance img { height:18px; width:auto; display:block; }
  .ath-card-partner .ath-program-name { font-size:.9rem; color:#5b6470; margin-top:.2rem; }
  .ath-card-partner .ath-card-banks { display:flex; flex-direction:column; }
  .ath-card-partner .ath-card-bank-row { display:flex; justify-content:space-between; align-items:center; padding:.4rem 0; }
  .ath-card-partner .ath-card-bank-row + .ath-card-bank-row { border-top:1px solid #f1f5f9; }
  .ath-cards .ath-bank-left { display:flex; align-items:center; gap:.5rem; flex-shrink:0; }
  .ath-cards .ath-bank-left .ath-bank-logo { display:inline-flex; align-items:center; }
  .ath-cards .ath-bank-left .ath-bank-logo img { height:20px; width:auto; display:block; }
  .ath-cards .ath-bank-left .ath-bank-name { font-weight:600; color:#1f2937; font-size:.92rem; }
  .ath-cards .ath-bank-meta { display:inline-flex; justify-content:flex-end; align-items:center; gap:.35rem; margin-left:auto; white-space:nowrap; text-align:right; }
  .ath-cards .ath-bonus { font-weight:700; background:#EAF7EE; color:#1B8733; border-radius:12px; padding:0 .4rem; font-size:.85rem; }
  .ath-cards .ath-rate, .ath-cards .ath-speed { font-weight:600; font-size:.9rem; }
}

/* Tablet/desktop logos slightly smaller than phones (keeps header tight) */
@media (min-width: 768px) {
  .ath-partner-logo img { max-height:22px; }
  .ath-bank-logo img { max-height:20px; }
}

/* Desktop/Tablet header logo sizing */
.ath-partners .ath-bank-logo img {
  height: auto;
  width: auto;
  max-height: 28px;
  object-fit: contain;
}

/* Slightly smaller on mid tablets */
@media (min-width: 640px) and (max-width: 1023.98px) {
  .ath-partners .ath-bank-logo img { max-height: 26px; }
}

/* Matrix header bank logo sizing (desktop/tablet only) */
.ath-partners .ath-matrix thead th > .ath-bank-logo img {
  max-height: 22px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  vertical-align: middle;
  display: inline-block;
}
/* Mid tablets a touch smaller */
@media (min-width: 640px) and (max-width: 1023.98px) {
  .ath-partners .ath-matrix thead th > .ath-bank-logo img {
    max-height: 20px !important;
  }
}

/* Citi: white chip behind the bank logo (header + cells) */
.ath-partners .bank-slug-citi .ath-bank-logo,
.ath-cards .bank-slug-citi .ath-bank-logo {
  background: #fff;
  padding: 2px 4px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.05) inset;
}
/* Keep header cells compact */
.ath-partners .ath-matrix thead th {
  padding-top: 8px;
  padding-bottom: 8px;
  line-height: 1.1;
}