/* Agentic (prefix ag-) */
.ag-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ag-stack { display: flex; flex-direction: column; gap: 20px; }
.ag-card { padding: 0; overflow: hidden; }
.ag-empty { padding: 28px; }

/* ---------- card head ---------- */
.ag-head { padding: 24px 28px 18px; }
.ag-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-title h3 { margin: 0; font-size: 22px; font-weight: 620; letter-spacing: -.02em; line-height: 1.25; }
.ag-intro { margin: 8px 0 0; max-width: 900px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.ag-sortbar { display: none; }

/* ---------- table ---------- */
.ag-frame { position: relative; border-top: 1px solid var(--line); }
.ag-frame::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 48px; pointer-events: none; opacity: 0; z-index: 4;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, .96)); transition: opacity .2s; }
.ag-frame.ag-shade-r::after { opacity: 1; }
.ag-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.ag-scroll[hidden] { display: none; }
.ag-scroll:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ag-none { padding: 28px; text-align: center; color: var(--faint); font-size: 14px; }
.ag-none[hidden] { display: none; }

.ag-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; color: var(--ink-2); }
.ag-table th, .ag-table td { text-align: left; white-space: nowrap; background: #fff; }
.ag-table thead th { padding: 0; vertical-align: bottom; font-weight: 600; background: #f7f8fa; border-bottom: 1px solid var(--line); }
.ag-table thead th.ag-c-model { position: sticky; left: 0; z-index: 2; }
.ag-sort { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 5px; width: 100%; min-height: 62px;
  padding: 14px 12px 11px; cursor: pointer; }
.ag-table thead th:first-child .ag-sort { padding-left: 28px; }
.ag-table thead th:last-child .ag-sort { padding-right: 28px; }
.ag-sort:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; border-radius: 8px; }
.ag-th { display: inline-flex; align-items: flex-end; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2;
  white-space: pre; }
.ag-th svg { margin-bottom: 2px; }
.ag-chev { flex: none; color: var(--faint); }
.ag-arrow { flex: none; display: none; color: var(--ink); transition: transform .15s; }
.ag-sort:hover .ag-chev { color: var(--ink-2); }
th.ag-on .ag-chev { display: none; }
th.ag-on .ag-arrow { display: block; }
th.ag-on.ag-asc .ag-arrow { transform: rotate(180deg); }
.ag-unit { font-size: 11px; font-weight: 400; line-height: 1.2; color: var(--faint); white-space: nowrap; }

.ag-table tbody th, .ag-table tbody td { height: 58px; padding: 0 12px; border-bottom: 1px solid var(--line-2); font-weight: 400;
  font-variant-numeric: tabular-nums; }
.ag-table tbody tr:last-child > * { border-bottom: 0; }
.ag-table tbody td:last-child { padding-right: 28px; }
.ag-table tbody th.ag-c-model { position: sticky; left: 0; z-index: 1; min-width: 236px; padding-left: 28px; }
.ag-c-model::after { content: ""; position: absolute; top: 0; bottom: -1px; right: -10px; width: 10px; pointer-events: none; opacity: 0;
  background: linear-gradient(to right, rgba(16, 24, 40, .07), rgba(16, 24, 40, 0)); transition: opacity .2s; }
.ag-shade-l .ag-c-model::after { opacity: 1; }
.ag-vbar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.ag-vbar-ref { width: 0; background: none; border-left: 3px dashed; }

.ag-row { cursor: pointer; }
.ag-row:hover > * { background: #f8f9fb; }
.ag-row.ag-pick > * { background: #f9fee9; }
.ag-row.ag-pick:hover > * { background: #f3fcd6; }

.ag-model { display: flex; align-items: center; gap: 10px; }
.ag-model-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ag-name { all: unset; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 550; line-height: 1.3; color: var(--ink);
  border-radius: 4px; cursor: pointer; }
.ag-name:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ag-row:hover .ag-name > span:first-child { text-decoration: underline; text-decoration-color: #c4cad3; text-underline-offset: 3px; }
.ag-star { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; background: var(--lime); color: var(--ink);
  font-size: 10.5px; line-height: 1; }
.ag-cloud { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; padding: 0 6px 0 5px; border: 1px solid var(--ink); border-radius: 6px;
  font-size: 10.5px; font-weight: 550; line-height: 15px; color: var(--ink); background: #fff; vertical-align: 1px; }
.ag-variant { max-width: 210px; font-size: 12px; line-height: 1.3; color: var(--muted); white-space: normal; }

.ag-rate { display: flex; align-items: baseline; gap: 6px; }
.ag-rate b { font-size: 14.5px; font-weight: 650; color: var(--ink); }
.ag-rate small { font-size: 11px; color: var(--faint); }
.ag-mini { position: relative; display: block; width: 64px; height: 4px; margin-top: 5px; border-radius: 2px; background: var(--track); overflow: hidden; }
.ag-mini i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; }
.ag-ref .ag-mini i { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .6) 0 2px, transparent 2px 4px); }
.ag-runs { margin-left: 4px; font-size: 11.5px; color: var(--faint); }
.ag-na { color: #b4bbc6; }
td.ag-zero { color: #b4bbc6; }
td.ag-hot { color: #b45309; font-weight: 650; }

/* ---------- tight: a wide table that would otherwise scroll sideways ---------- */
.ag-tight .ag-sort { padding-left: 8px; padding-right: 8px; }
.ag-tight tbody td { padding-left: 8px; padding-right: 8px; }
.ag-tight thead th:first-child .ag-sort, .ag-tight tbody th.ag-c-model { padding-left: 24px; }
.ag-tight thead th:last-child .ag-sort, .ag-tight tbody td:last-child { padding-right: 24px; }
.ag-tight tbody th.ag-c-model { min-width: 0; padding-right: 8px; }
.ag-tight .ag-variant { max-width: 172px; }
.ag-tight .ag-th { gap: 3px; font-size: 12.5px; }
.ag-tight .ag-unit { font-size: 10.5px; }

/* ---------- foot ---------- */
.ag-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 24px; flex-wrap: wrap; padding: 13px 28px 16px;
  border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.ag-def { display: flex; align-items: flex-start; gap: 8px; flex: 1 1 520px; max-width: 900px; margin: 0; line-height: 1.5; }
.ag-def svg { flex: none; margin-top: 2px; color: var(--faint); }
.ag-count { white-space: nowrap; }

/* ---------- phones: every row becomes a card ---------- */
@media (max-width: 640px) {
  .ag-head { padding: 20px 18px 16px; }
  .ag-title h3 { font-size: 20px; }
  .ag-intro { font-size: 13.5px; }
  .ag-sortbar { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--muted); }
  .ag-sortbar .lb-select { flex: 1 1 auto; min-width: 0; }
  .ag-sortbar .lb-select select { width: 100%; min-width: 0; height: 40px; padding-top: 0; padding-bottom: 0; }
  .ag-sortlbl { white-space: nowrap; }
  .ag-dir { all: unset; box-sizing: border-box; display: grid; place-items: center; flex: none; width: 40px; height: 40px;
    border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; }
  .ag-dir:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .ag-dir .ag-arrow { display: block; }
  .ag-dir.ag-up .ag-arrow { transform: rotate(180deg); }

  .ag-scroll { overflow: visible; }
  .ag-frame::after, .ag-c-model::after { display: none; }
  .ag-table, .ag-table tbody { display: block; width: auto; }
  .ag-table thead { display: none; }
  .ag-table tbody tr { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 12px;
    padding: 15px 18px 16px; border-bottom: 1px solid var(--line-2); }
  .ag-table tbody tr:last-child { border-bottom: 0; }
  .ag-table tbody th, .ag-table tbody td { display: block; height: auto; min-width: 0; padding: 0; border: 0; background: transparent;
    white-space: normal; }
  .ag-table tbody th.ag-c-model { position: static; grid-column: 1 / 3; min-width: 0; padding: 0; }
  .ag-table tbody td:last-child { padding-right: 0; }
  .ag-table tbody td.ag-main { grid-column: 3; justify-self: end; text-align: right; }
  .ag-table tbody td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 11px; font-weight: 400; line-height: 1.3;
    color: var(--faint); }
  .ag-table tbody td.ag-main::before { content: none; }
  .ag-main .ag-rate { justify-content: flex-end; }
  .ag-main .ag-rate b { font-size: 20px; letter-spacing: -.02em; }
  .ag-main .ag-mini { margin-left: auto; }
  .ag-row:hover > *, .ag-row.ag-pick > *, .ag-row.ag-pick:hover > * { background: transparent; }
  .ag-row:hover { background: #f8f9fb; }
  .ag-row.ag-pick { background: #f9fee9; }
  .ag-name { white-space: normal; flex-wrap: wrap; }
  .ag-foot { padding: 12px 18px 14px; }
  .ag-def { flex-basis: 100%; }
}
