/* ==========================================================================
   Forerunner AI Model Leaderboard v2 — Styles
   Theme-agnostic base inheriting the active theme's typography.
   ========================================================================== */

:root {
    --aiml-accent: #020D28;
    --aiml-accent-light: #1a3a6b;
    --aiml-accent-bg: #e8edf5;
    --aiml-success: #020D28;
    --aiml-warning: #f59e0b;
    --aiml-danger: #ef4444;
    --aiml-muted: #64748b;
    --aiml-border: #e2e8f0;
    --aiml-bg-subtle: #f8fafc;
    --aiml-radius: 10px;
    --aiml-radius-sm: 6px;
    --aiml-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --aiml-shadow-lg: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --aiml-highlight-bg: linear-gradient(135deg, #f0f4f8, #e8edf5);
    --aiml-highlight-border: var(--aiml-accent);
}

/* ==========================================================================
   Font inheritance reset — browsers force system-ui on form elements by
   default; this ensures everything inside the plugin uses the theme font.
   ========================================================================== */
.aiml-leaderboard-wrap,
.aiml-model-detail,
.aiml-compare-wrap,
.aiml-calculator-wrap,
.aiml-archive-wrap {
    font-family: inherit;
}

.aiml-leaderboard-wrap input,
.aiml-leaderboard-wrap select,
.aiml-leaderboard-wrap button,
.aiml-leaderboard-wrap textarea,
.aiml-model-detail input,
.aiml-model-detail select,
.aiml-model-detail button,
.aiml-model-detail textarea,
.aiml-compare-wrap input,
.aiml-compare-wrap select,
.aiml-compare-wrap button,
.aiml-compare-wrap textarea,
.aiml-calculator-wrap input,
.aiml-calculator-wrap select,
.aiml-calculator-wrap button,
.aiml-calculator-wrap textarea,
.aiml-archive-wrap input,
.aiml-archive-wrap select,
.aiml-archive-wrap button,
.aiml-archive-wrap textarea {
    font-family: inherit;
}

/* ==========================================================================
   Leaderboard Table
   ========================================================================== */

.aiml-leaderboard-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5em 0;
}

.aiml-leaderboard-desc {
    color: var(--aiml-muted);
    margin-bottom: 1em;
    font-size: .95em;
}

/* Toolbar: search + filters */
.aiml-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75em;
    align-items: center;
    margin-bottom: 1em;
}

.aiml-search-wrap {
    position: relative;
    flex: 1 1 260px;
    max-width: 360px;
}

.aiml-search-wrap svg {
    position: absolute;
    left: .75em;
    top: 50%;
    transform: translateY(-50%);
    color: var(--aiml-muted);
    pointer-events: none;
}

.aiml-search {
    width: 100%;
    padding: .55em .75em .55em 2.2em;
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius);
    font-size: .9em;
    background: #fff;
    transition: border-color .15s;
}

.aiml-search:focus {
    outline: none;
    border-color: var(--aiml-accent);
    box-shadow: 0 0 0 3px var(--aiml-accent-bg);
}

.aiml-filters {
    display: flex;
    gap: .5em;
    flex-wrap: wrap;
}

.aiml-filter {
    padding: .45em .75em;
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius);
    font-size: .85em;
    background: #fff;
    cursor: pointer;
}

.aiml-filter:focus {
    outline: none;
    border-color: var(--aiml-accent);
}

/* Table — shared style for shortcode + archive */
.aiml-leaderboard,
.aiml-archive-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: .88em;
    line-height: 1.5;
}

.aiml-leaderboard thead,
.aiml-archive-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.aiml-leaderboard th,
.aiml-archive-table th {
    padding: .65em .75em;
    text-align: left;
    font-size: .78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    user-select: none;
}

.aiml-leaderboard th.aiml-sortable { cursor: pointer; transition: color .15s; }
.aiml-leaderboard th.aiml-sortable:hover { color: var(--aiml-accent); }
.aiml-leaderboard th.aiml-sort-asc .aiml-sort-icon,
.aiml-leaderboard th.aiml-sort-desc .aiml-sort-icon { color: var(--aiml-accent); }

.aiml-sort-icon { vertical-align: middle; margin-left: .25em; opacity: .4; transition: opacity .15s; }
.aiml-leaderboard th:hover .aiml-sort-icon,
.aiml-leaderboard th.aiml-sort-asc .aiml-sort-icon,
.aiml-leaderboard th.aiml-sort-desc .aiml-sort-icon { opacity: 1; }

.aiml-leaderboard td,
.aiml-archive-table td {
    padding: .6em .75em;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.aiml-leaderboard tbody tr:last-child td { border-bottom: none; }
.aiml-leaderboard tbody tr { transition: background .1s; }
.aiml-leaderboard tbody tr:hover { background: #f8fafc; }
.aiml-leaderboard tbody tr.aiml-hidden { display: none; }

.aiml-row--highlighted { background: #f8fafb !important; border-left: 3px solid var(--aiml-accent); }
.aiml-row--highlighted:hover { background: #eef2f7 !important; }

/* Footer */
.aiml-leaderboard-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5em;
    padding: .75em 0;
    font-size: .8em;
    color: var(--aiml-muted);
}

.aiml-leaderboard-updated,
.aiml-leaderboard-source {
    display: inline-flex;
    align-items: center;
    gap: .3em;
}

/* ==========================================================================
   Cell Components
   ========================================================================== */

.aiml-rank,
.aiml-archive-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f1f5f9;
    font-weight: 700;
    font-size: .85em;
    color: #475569;
}

.aiml-row--highlighted .aiml-rank { background: var(--aiml-accent); color: #fff; }

.aiml-logo,
.aiml-archive-logo {
    display: block;
    border-radius: 6px;
    object-fit: contain;
    background: #f8fafc;
    padding: 2px;
}

.aiml-model-link,
.aiml-archive-model-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.aiml-model-link:hover .aiml-model-name,
.aiml-archive-model-link:hover .aiml-archive-model-name { color: var(--aiml-accent); }

.aiml-model-name,
.aiml-archive-model-name { display: block; font-weight: 700; color: var(--aiml-accent); transition: color .15s; }
.aiml-model-provider,
.aiml-archive-model-provider { display: block; font-size: .8em; color: #94a3b8; }

/* New / Updated badges */
.aiml-badge-new,
.aiml-badge-updated {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    padding: .3em .7em .3em .55em;
    border-radius: 999px;
    font-size: .7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    vertical-align: middle;
    margin-left: .45em;
    line-height: 1;
    white-space: nowrap;
}

.aiml-badge-new {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #3730a3;
    border: 1px solid #a5b4fc;
    box-shadow: 0 1px 3px rgba(99,102,241,.15);
}
.aiml-badge-new::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6366f1;
    flex-shrink: 0;
}

.aiml-badge-updated {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #334155;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(100,116,139,.12);
}
.aiml-badge-updated::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
    flex-shrink: 0;
}

/* Score pill */
.aiml-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: .2em .5em;
    border-radius: 6px;
    font-weight: 700;
    font-size: .9em;
    background: #f1f5f9;
    color: #475569;
}

.aiml-score--high { background: #eef2ff; color: #3730a3; }
.aiml-score--mid  { background: #f1f5f9; color: #475569; }
.aiml-score--low  { background: #fef2f2; color: #991b1b; }

/* Speed */
.aiml-speed {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: .85em;
    font-variant-numeric: tabular-nums;
}

.aiml-speed small { color: var(--aiml-muted); font-size: .8em; }
.aiml-speed-ttft { color: var(--aiml-muted); font-size: .85em; }

/* Pricing */
.aiml-pricing {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: .85em;
    font-variant-numeric: tabular-nums;
}

.aiml-pricing__in,
.aiml-pricing__out {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.aiml-pricing__in svg  { color: var(--aiml-success); }
.aiml-pricing__out svg { color: var(--aiml-accent); }

/* Capability badges (leaderboard table) */
.aiml-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: .2em .5em;
    border-radius: var(--aiml-radius-sm);
    font-size: .78em;
    font-weight: 600;
    white-space: nowrap;
}

.aiml-badge--tool    { background: #ede9fe; color: #5b21b6; }
.aiml-badge--fn      { background: #e0f2fe; color: #075985; }
.aiml-badge--vision  { background: #fce7f3; color: #9d174d; }
.aiml-badge--open    { background: #f0fdf4; color: #15803d; }
.aiml-badge--license { background: var(--aiml-bg-subtle); color: var(--aiml-muted); }
.aiml-badge--inactive { display: none; }

/* Detail page capability chips — only active caps are rendered */
.aiml-cap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .4em .85em;
    border-radius: 999px;
    font-size: .82em;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.aiml-cap svg { flex-shrink: 0; opacity: .75; }

.aiml-cap--tool     { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.aiml-cap--fn       { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.aiml-cap--vision   { background: #fce7f3; color: #9d174d; border-color: #fbcfe8; }
.aiml-cap--open     { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.aiml-cap--license  { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

.aiml-highlight-badge {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    padding: .3em .7em .3em .55em;
    border-radius: 999px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #e0e7ff;
    border: 1px solid #4338ca;
    box-shadow: 0 1px 4px rgba(67,56,202,.25);
    font-size: .7em;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: .03em;
    line-height: 1;
    vertical-align: middle;
    margin-left: .45em;
}
.aiml-highlight-badge::before {
    content: '★';
    font-size: 1.1em;
    line-height: 1;
    flex-shrink: 0;
}

.aiml-dfo-badge {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    padding: .3em .7em .3em .55em;
    border-radius: 999px;
    background: #020D28;
    color: #fff;
    border: 1.5px solid #020D28;
    font-size: .7em;
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.3;
}
.aiml-dfo-badge svg {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    opacity: .85;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.aiml-muted { color: var(--aiml-muted); }

.aiml-empty { text-align: center; padding: 2em; color: var(--aiml-muted); font-style: italic; }

/* ==========================================================================
   Single Model Detail Page — Corporate Modern
   ========================================================================== */

.aiml-model-detail {
    max-width: 860px;
    margin: 0 auto;
    font-size: .95em;
    line-height: 1.6;
    color: #1e293b;
}

/* ── Header ── */
.aiml-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25em;
    margin-bottom: 1em;
    padding-bottom: 0;
    border-bottom: none;
}

.aiml-detail-header__left {
    display: flex;
    align-items: flex-start;
    gap: 1em;
    flex: 1;
    min-width: 0;
}

.aiml-detail-logo {
    border-radius: 12px;
    object-fit: contain;
    flex-shrink: 0;
    background: #f8fafc;
    padding: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.aiml-detail-header__text { min-width: 0; }

.aiml-detail-title {
    margin: 0 0 .2em;
    font-size: 1.7em;
    font-weight: 800;
    line-height: 1.2;
    color: var(--aiml-accent);
    letter-spacing: -.02em;
}

.aiml-detail-meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4em;
    font-size: .88em;
    color: var(--aiml-muted);
}
.aiml-detail-meta-line .aiml-dfo-badge {
    font-size: .85em;
    padding: .35em .8em .35em .65em;
}

.aiml-detail-provider { font-weight: 700; color: var(--aiml-accent); opacity: .7; }
.aiml-detail-sep { color: #cbd5e1; }
.aiml-detail-released { color: var(--aiml-muted); }

/* Score ring */
.aiml-detail-score-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35em;
    flex-shrink: 0;
}

.aiml-score-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    background: #fff;
}

.aiml-score-ring__value {
    font-size: 1.7em;
    font-weight: 800;
    line-height: 1;
    color: var(--aiml-accent);
    letter-spacing: -.02em;
}

.aiml-detail-score-label {
    font-size: .7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--aiml-accent);
    opacity: .55;
}

/* ── Share Bar ── */
.aiml-share-bar {
    display: flex;
    align-items: center;
    gap: .5em;
    flex-wrap: wrap;
    margin: .75em 0 1.25em;
}

.aiml-share-btn {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    padding: .4em .7em;
    font-size: .8em;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    line-height: 1;
    white-space: nowrap;
}
.aiml-share-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
    text-decoration: none;
}
.aiml-share-btn svg {
    flex-shrink: 0;
}
.aiml-share-btn--native {
    background: var(--aiml-accent, #020D28);
    color: #fff;
    border-color: var(--aiml-accent, #020D28);
}
.aiml-share-btn--native:hover {
    opacity: .88;
    color: #fff;
}
.aiml-share-btn--copy span {
    transition: none;
}

@media (max-width: 640px) {
    .aiml-share-bar {
        gap: .4em;
    }
    .aiml-share-btn span {
        display: none;
    }
    .aiml-share-btn--native span,
    .aiml-share-btn--copy span {
        display: inline;
    }
}

/* ── Description ── */
.aiml-detail-description {
    margin-bottom: 2em;
    padding: 0;
    background: transparent;
    border-left: none;
    border-radius: 0;
    line-height: 1.75;
    color: #374151;
    font-size: .95em;
}

.aiml-detail-description a {
    color: var(--aiml-accent);
    text-decoration: none;
    font-weight: 600;
    opacity: .7;
    transition: opacity .15s;
}
.aiml-detail-description a:hover { text-decoration: underline; opacity: 1; }

.aiml-detail-description p { margin: 0 0 .85em; }
.aiml-detail-description p:last-child { margin-bottom: 0; }

/* ── Primary stat cards (pricing, context, max output) ── */
.aiml-stats-primary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75em;
    margin-bottom: 1em;
}
@media (max-width: 640px) {
    .aiml-stats-primary { grid-template-columns: repeat(2, 1fr); }
}

.aiml-stat-primary {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25em 1em 1.1em;
    background: #fff;
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius);
    transition: border-color .15s ease;
}
.aiml-stat-primary:hover {
    border-color: #cbd5e1;
}

.aiml-stat-primary__icon {
    color: var(--aiml-muted);
    opacity: .45;
    margin-bottom: .55em;
}
.aiml-stat-primary__icon svg { width: 20px; height: 20px; }

.aiml-stat-primary__body {
    display: flex;
    align-items: baseline;
    gap: .3em;
    margin-bottom: .25em;
}

.aiml-stat-primary__num {
    font-size: 1.55em;
    font-weight: 800;
    color: var(--aiml-accent);
    letter-spacing: -.02em;
    line-height: 1;
}

.aiml-stat-primary__unit {
    font-size: .82em;
    font-weight: 500;
    color: var(--aiml-muted);
}

.aiml-stat-primary__label {
    font-size: .7em;
    font-weight: 600;
    color: var(--aiml-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Secondary stats (speed, latency, params) ── */
.aiml-stats-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: .5em;
    margin-bottom: 2.25em;
}

.aiml-stat-secondary {
    display: flex;
    align-items: center;
    gap: .4em;
    padding: .55em .9em;
    background: #f8fafc;
    border: 1px solid var(--aiml-border);
    border-radius: 6px;
    font-size: .85em;
    transition: border-color .15s ease;
}
.aiml-stat-secondary:hover { border-color: #cbd5e1; }

.aiml-stat-secondary__icon {
    color: var(--aiml-muted);
    opacity: .5;
    display: flex;
}
.aiml-stat-secondary__icon svg { width: 14px; height: 14px; }

.aiml-stat-secondary__value {
    font-weight: 700;
    color: var(--aiml-accent);
    white-space: nowrap;
}

.aiml-stat-secondary__label {
    font-weight: 500;
    color: var(--aiml-muted);
    white-space: nowrap;
}

/* ── Sections ── */
.aiml-detail-section {
    margin-bottom: 2.75em;
}

.aiml-detail-section h2 {
    display: flex;
    align-items: center;
    gap: .45em;
    font-size: 1.1em;
    font-weight: 800;
    color: var(--aiml-accent);
    margin: 0 0 1em;
    padding-bottom: .65em;
    border-bottom: 2px solid #e2e8f0;
}

.aiml-detail-section h2 svg { color: var(--aiml-accent); opacity: .5; }

.aiml-detail-caps {
    display: flex;
    flex-wrap: wrap;
    gap: .5em;
}

/* ── Table card (wraps info tables) ── */
.aiml-detail-table-card {
    background: #fff;
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .03);
}

/* ── Info tables ── */
.aiml-detail-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9em;
    margin: -1px;
    width: calc(100% + 2px);
}

.aiml-detail-info-table th,
.aiml-detail-info-table td {
    padding: .7em 1.1em;
    border-bottom: 1px solid var(--aiml-border);
    text-align: left;
    vertical-align: middle;
}

.aiml-detail-info-table tr:last-child th,
.aiml-detail-info-table tr:last-child td { border-bottom: none; }

.aiml-info-key {
    font-weight: 700;
    color: var(--aiml-muted);
    width: 170px;
    white-space: nowrap;
}

.aiml-detail-info-table code {
    font-size: .88em;
    padding: .15em .4em;
    background: #f1f5f9;
    border-radius: 4px;
    color: #334155;
}

/* ── Benchmarks ── */
.aiml-detail-benchmarks {
    display: flex;
    flex-direction: column;
    gap: .6em;
    padding: .5em 0;
}

.aiml-bench-item {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    align-items: center;
    gap: .75em;
}

.aiml-bench-item__label { font-weight: 700; font-size: .85em; color: var(--aiml-accent); }
.aiml-bench-item__value { font-weight: 800; font-size: .88em; text-align: right; color: var(--aiml-accent); }

.aiml-bench-item__bar-wrap {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.aiml-bench-item__bar {
    height: 100%;
    background: var(--aiml-accent);
    border-radius: 3px;
    transition: width .4s ease;
}

/* ── Artificial Analysis Index Cards ── */
.aiml-aa-indices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75em;
}
.aiml-aa-index-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3em;
    padding: 1.25em 1em;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--aiml-border);
    text-align: center;
    transition: border-color .15s ease;
}
.aiml-aa-index-card:hover {
    border-color: #cbd5e1;
}
.aiml-aa-index-card__value {
    font-size: 2em;
    font-weight: 800;
    line-height: 1.1;
    color: var(--aiml-accent);
}
.aiml-aa-index-card__label {
    font-size: .72em;
    font-weight: 600;
    color: var(--aiml-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── New Model Notice ── */
.aiml-new-model-notice {
    display: flex;
    align-items: flex-start;
    gap: .6em;
    margin-top: 1em;
    padding: .75em 1em;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--aiml-radius-sm);
    color: #92400e;
    font-size: .85em;
    line-height: 1.5;
}
.aiml-new-model-notice svg {
    flex-shrink: 0;
    margin-top: .1em;
    opacity: .75;
}
.aiml-new-model-notice p {
    margin: 0;
}

/* ── Benchmark Grid (AA + HF side by side) ── */
.aiml-bench-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5em;
}
@media (max-width: 768px) {
    .aiml-bench-grid { grid-template-columns: 1fr; }
}
.aiml-bench-group {
    display: flex;
    flex-direction: column;
    gap: .75em;
    padding: 1.1em 1.25em;
    background: #fff;
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .03);
}
.aiml-bench-group__title {
    margin: 0 0 .4em;
    font-size: .92em;
    font-weight: 800;
    color: var(--aiml-accent);
}
.aiml-bench-row {
    display: flex;
    flex-direction: column;
    gap: .15em;
}
.aiml-bench-row__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.aiml-bench-row__label {
    font-weight: 700;
    font-size: .88em;
    color: var(--aiml-accent);
}
.aiml-bench-row__value {
    font-weight: 800;
    font-size: .88em;
    color: var(--aiml-accent);
}
.aiml-bench-row__desc {
    font-size: .73em;
    color: #94a3b8;
    line-height: 1.3;
    font-style: italic;
}
.aiml-bench-row__bar-wrap {
    height: 7px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: .2em;
}
.aiml-bench-row__bar {
    height: 100%;
    border-radius: 4px;
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
    background: linear-gradient(90deg, #94a3b8, #64748b);
}

/* ── Dimension-grouped benchmark cards ── */
.aiml-benchdim {
    margin-bottom: 1.75em;
}
.aiml-benchdim:last-of-type {
    margin-bottom: .75em;
}
.aiml-benchdim__header {
    display: flex;
    align-items: center;
    gap: .45em;
    margin-bottom: .65em;
}
.aiml-benchdim__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.aiml-benchdim__title {
    margin: 0;
    font-size: .72em;
    font-weight: 700;
    color: var(--aiml-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
}

.aiml-benchcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: .75em;
}
@media (max-width: 480px) {
    .aiml-benchcard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.aiml-benchcard {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 1.15em 1.2em 1em;
    background: #fff;
    border: 1px solid var(--aiml-border);
    border-radius: 8px;
    transition: border-color .15s ease;
}
.aiml-benchcard:hover {
    border-color: #cbd5e1;
}

.aiml-benchcard__name {
    font-size: .78em;
    font-weight: 600;
    color: var(--aiml-muted);
    line-height: 1.2;
    margin-bottom: .45em;
}

.aiml-benchcard__score {
    font-size: 2.1em;
    font-weight: 800;
    line-height: 1;
    color: var(--aiml-accent);
    letter-spacing: -.03em;
    margin-bottom: .35em;
}

.aiml-benchcard__bar {
    display: block;
    width: 100%;
    height: 5px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: .5em;
}
.aiml-benchcard__bar > span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--bench-color, #64748b);
}

.aiml-benchcard__desc {
    font-size: .7em;
    color: #94a3b8;
    line-height: 1.35;
}

.aiml-detail-source {
    font-size: .78em;
    color: var(--aiml-muted);
    margin-top: .75em;
}
.aiml-detail-source a {
    color: var(--aiml-accent);
    text-decoration: underline;
    opacity: .6;
    transition: opacity .15s;
}
.aiml-detail-source a:hover { opacity: 1; }

/* ── Live Performance ── */
.aiml-detail-section-note {
    font-size: .8em !important;
    color: #94a3b8 !important;
    margin: -.25em 0 .75em !important;
}
.aiml-perf-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: .75em !important;
}
@media (max-width: 600px) {
    .aiml-perf-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
.aiml-perf-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .25em !important;
    padding: 1.1em .75em !important;
    background: #fff !important;
    border: 1px solid var(--aiml-border) !important;
    border-radius: var(--aiml-radius) !important;
    text-align: center !important;
    min-height: 0 !important;
    transition: border-color .15s ease !important;
}
.aiml-perf-card:hover {
    border-color: #cbd5e1 !important;
}
.aiml-perf-card__icon {
    color: var(--aiml-accent) !important;
    margin-bottom: .1em !important;
    line-height: 1 !important;
    opacity: .45;
}
.aiml-perf-card__icon svg {
    display: block !important;
}
.aiml-perf-card__value {
    font-size: 1.35em !important;
    font-weight: 800 !important;
    color: var(--aiml-accent) !important;
    line-height: 1.2 !important;
    letter-spacing: -.02em !important;
}
.aiml-perf-card__value.aiml-perf--good { color: #059669 !important; }
.aiml-perf-card__value.aiml-perf--ok   { color: #d97706 !important; }
.aiml-perf-card__value.aiml-perf--poor { color: #dc2626 !important; }
.aiml-perf-card__label {
    font-size: .7em !important;
    color: var(--aiml-muted) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
}
.aiml-perf-providers {
    margin-top: .75em;
    padding: .6em .85em;
    font-size: .8em;
    color: var(--aiml-muted);
    line-height: 1.5;
    background: var(--aiml-bg-subtle);
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius-sm);
}
.aiml-perf-providers__label {
    font-weight: 700;
    color: var(--aiml-accent);
    opacity: .6;
    margin-right: .25em;
}
.aiml-perf-providers__more {
    color: #94a3b8;
    font-style: italic;
}

/* ── Tags ── */
.aiml-detail-tags { display: flex; flex-wrap: wrap; gap: .5em; }

.aiml-detail-tag {
    display: inline-block;
    padding: .35em .85em;
    border-radius: 999px;
    background: #fff;
    color: var(--aiml-accent);
    font-size: .82em;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--aiml-border);
    transition: all .2s ease;
}

.aiml-detail-tag:hover { background: var(--aiml-accent); color: #fff; border-color: var(--aiml-accent); box-shadow: 0 2px 8px rgba(2, 13, 40, .1); }

/* ── Status pill ── */
.aiml-status-pill {
    display: inline-block;
    padding: .2em .65em;
    border-radius: 999px;
    font-size: .8em;
    font-weight: 600;
    text-transform: capitalize;
}

.aiml-status--active { background: var(--aiml-accent-bg); color: var(--aiml-accent); }
.aiml-status--archived { background: #f3f4f6; color: #6b7280; }
.aiml-status--deprecated { background: #fef2f2; color: #991b1b; }

/* ── External link inline ── */
.aiml-detail-ext-link {
    display: inline-flex;
    align-items: center;
    margin-left: .5em;
    color: var(--aiml-accent);
    vertical-align: middle;
    opacity: .6;
    transition: opacity .15s;
}

.aiml-detail-ext-link:hover { opacity: 1; }

/* ── External links section ── */
.aiml-detail-ext-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .75em;
}

.aiml-ext-link-card {
    display: flex;
    align-items: center;
    gap: .75em;
    padding: 1em 1.15em;
    background: #fff;
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease;
}

.aiml-ext-link-card:hover {
    border-color: var(--aiml-accent);
}

.aiml-ext-link-card svg { color: var(--aiml-accent); flex-shrink: 0; opacity: .5; }

.aiml-ext-link-card div { display: flex; flex-direction: column; }
.aiml-ext-link-card strong { font-size: .88em; color: var(--aiml-accent); }
.aiml-ext-link-card span { font-size: .76em; color: var(--aiml-muted); margin-top: 2px; }

/* ── Pricing table ── */
.aiml-pricing-table thead th {
    background: var(--aiml-bg-subtle);
    font-weight: 700;
    font-size: .75em;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--aiml-muted);
}

.aiml-pricing-note {
    display: flex;
    align-items: center;
    gap: .5em;
    margin-top: .75em;
    padding: .6em 1em;
    background: var(--aiml-accent-bg);
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius-sm);
    font-size: .85em;
    font-weight: 600;
    color: var(--aiml-accent);
}

.aiml-pricing-note svg { color: var(--aiml-accent); flex-shrink: 0; opacity: .5; }

/* ── Ranking Reasoning Card ── */
.aiml-reasoning-card {
    margin: 0 0 1.75em;
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .03);
}

.aiml-reasoning-card .aiml-reasoning-toggle {
    display: flex;
    align-items: center;
    gap: .55em;
    width: 100%;
    padding: .85em 1.1em;
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    box-shadow: none !important;
    cursor: pointer;
    font: inherit;
    font-size: .88em;
    font-weight: 600;
    color: #1e293b !important;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.5;
    transition: background .15s ease;
}

.aiml-reasoning-card .aiml-reasoning-toggle:hover,
.aiml-reasoning-card .aiml-reasoning-toggle:focus,
.aiml-reasoning-card .aiml-reasoning-toggle:active {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    outline: none;
}

.aiml-reasoning-toggle__icon { display: flex; color: var(--aiml-accent) !important; flex-shrink: 0; opacity: .6; }
.aiml-reasoning-toggle__text { flex: 1; color: #1e293b !important; }

.aiml-reasoning-toggle__chevron {
    display: flex;
    color: #94a3b8;
    transition: transform .2s ease;
}

.aiml-reasoning-toggle[aria-expanded="true"] .aiml-reasoning-toggle__chevron {
    transform: rotate(180deg);
}

.aiml-reasoning-body {
    padding: 0 1.1em 1.1em;
}

.aiml-reasoning-text {
    font-size: .87em;
    line-height: 1.65;
    color: #334155;
    margin: 0 0 .75em;
}

.aiml-reasoning-date {
    font-size: .78em;
    color: #94a3b8;
    margin: 0 0 .6em;
}

.aiml-reasoning-disclaimer {
    font-size: .78em;
    color: #94a3b8;
    margin: 0;
    padding-top: .6em;
    border-top: 1px solid var(--aiml-border);
}

.aiml-reasoning-disclaimer a {
    color: var(--aiml-accent);
    text-decoration: none;
    font-weight: 600;
    opacity: .7;
}

.aiml-reasoning-disclaimer a:hover { text-decoration: underline; opacity: 1; }

/* ── Footer ── */
.aiml-detail-footer {
    margin-top: 2.5em;
    padding-top: 1.5em;
    border-top: 2px solid #e2e8f0;
    font-size: .8em;
    color: var(--aiml-muted);
}

.aiml-detail-attribution,
.aiml-detail-updated,
.aiml-detail-contact {
    display: flex;
    align-items: center;
    gap: .4em;
    margin: .3em 0;
}

.aiml-detail-attribution svg,
.aiml-detail-updated svg,
.aiml-detail-contact svg { opacity: .5; }

.aiml-detail-contact a {
    color: var(--aiml-accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .4em;
    opacity: .7;
    transition: opacity .15s;
}
.aiml-detail-contact a:hover { opacity: 1; }


/* ==========================================================================
   Comparison Tool
   ========================================================================== */

.aiml-compare-wrap {
    max-width: 960px;
    width: 100%;
    margin: 1em auto;
    padding-top: 1.25em;
    box-sizing: border-box;
}

.aiml-compare-picker {
    padding: 1.25em 1.5em;
    background: #fff;
    color: #1e293b;
    border: 1px solid var(--aiml-border);
    border-radius: 12px;
    margin-bottom: 1em;
    box-shadow: var(--aiml-shadow);
    box-sizing: border-box;
    max-width: 100%;
}

.aiml-compare-picker h3 {
    display: flex;
    align-items: center;
    gap: .4em;
    margin: 0 0 .15em;
    font-size: 1.05em;
}

.aiml-compare-picker h3 svg { color: var(--aiml-accent); width: 18px; height: 18px; }
.aiml-compare-picker__desc { color: var(--aiml-muted); margin-bottom: .85em; font-size: .84em; }

.aiml-compare-slots {
    display: flex;
    flex-wrap: wrap;
    gap: .65em;
    margin-bottom: 1em;
}

.aiml-compare-slot {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .5em .85em;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    font-size: .88em;
    font-weight: 600;
    color: #1e1b4b;
}

.aiml-compare-slot img { width: 24px; height: 24px; border-radius: 6px; background: #fff; }
.aiml-compare-slot__remove {
    cursor: pointer;
    color: #6366f1;
    font-size: 1.2em;
    font-weight: 700;
    margin-left: .15em;
    opacity: .6;
    transition: opacity .15s;
}
.aiml-compare-slot__remove:hover { opacity: 1; }

.aiml-compare-add {
    display: inline-flex !important;
    align-items: center;
    gap: .4em;
    padding: .55em 1.1em !important;
    background: var(--aiml-accent, #6366f1) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: .85em !important;
    cursor: pointer;
    transition: background .15s;
}
.aiml-compare-add:hover { background: #4f46e5 !important; }

/* Searchable model picker */
.aiml-compare-search-wrap {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.aiml-compare-search {
    width: 100%;
    padding: .6em .85em;
    border: 2px solid var(--aiml-accent, #6366f1);
    border-radius: 10px;
    box-sizing: border-box;
    font-size: .9em;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.aiml-compare-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--aiml-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 100;
    margin-top: 4px;
}

.aiml-compare-dropdown__item {
    display: flex;
    align-items: center;
    gap: .6em;
    padding: .55em .85em;
    cursor: pointer;
    transition: background .1s;
}
.aiml-compare-dropdown__item:hover { background: #f1f5f9; }
.aiml-compare-dropdown__item img { width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0; }
.aiml-compare-dropdown__name { display: block; font-weight: 600; font-size: .88em; color: #0f172a; }
.aiml-compare-dropdown__prov { display: block; font-size: .75em; color: #64748b; }
.aiml-compare-dropdown__empty { padding: .85em; font-size: .85em; color: #94a3b8; text-align: center; }

/* Empty state */
.aiml-compare-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5em;
    padding: 1.5em 1em;
    color: #94a3b8;
    text-align: center;
}
.aiml-compare-empty svg { opacity: .3; width: 28px; height: 28px; }
.aiml-compare-empty p { margin: 0; font-size: .84em; max-width: 300px; }

/* Comparison table scroll wrapper */
.aiml-compare-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border: 1px solid var(--aiml-border);
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
}

/* Comparison grid table */
.aiml-compare-grid {
    width: 100%;
    min-width: 600px;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
    border: none;
    box-shadow: none;
    color: #1e293b;
}

.aiml-compare-grid th,
.aiml-compare-grid td {
    text-align: center;
    padding: .5em .75em;
    border-bottom: 1px solid #f1f5f9;
    font-size: .84em;
    color: #334155;
    overflow-wrap: break-word;
    word-break: break-word;
}
.aiml-compare-grid th:first-child,
.aiml-compare-grid td:first-child { text-align: left; font-size: .82em; color: #64748b; width: 150px; }

.aiml-compare-grid thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: .75em;
    vertical-align: bottom;
}

.aiml-compare-section-row td {
    font-weight: 700;
    font-size: .72em !important;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--aiml-accent, #6366f1) !important;
    background: #fafbff;
    padding: .5em .75em !important;
    text-align: left !important;
    border-bottom: 1px solid #e2e8f0;
}

.aiml-compare-best {
    background: rgba(99, 102, 241, .06);
    font-weight: 700;
}

.aiml-compare-header a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35em;
    text-decoration: none;
    color: inherit;
}

.aiml-compare-header a:hover .aiml-compare-header__name { color: var(--aiml-accent); }
.aiml-compare-header__name {
    font-weight: 700;
    font-size: .82em;
    line-height: 1.25;
    color: #0f172a;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: center;
}
.aiml-compare-header__prov { font-size: .72em; color: #64748b; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; }
.aiml-compare-header .aiml-logo { border-radius: 8px; background: #f1f5f9; }

.aiml-compare-hint { color: var(--aiml-muted); font-size: .88em; text-align: center; padding: 2em 1em; }

/* ==========================================================================
   Price Calculator
   ========================================================================== */

.aiml-calculator-wrap {
    max-width: 860px;
    width: 100%;
    margin: 1em auto;
    padding: 1.25em 1.5em;
    background: #fff;
    color: #1e293b;
    border: 1px solid var(--aiml-border);
    border-radius: 12px;
    box-shadow: var(--aiml-shadow);
    box-sizing: border-box;
}

.aiml-calculator-header h3 {
    display: flex;
    align-items: center;
    gap: .4em;
    margin: 0 0 .15em;
    font-size: 1.05em;
}

.aiml-calculator-header h3 svg { color: var(--aiml-accent); width: 20px; height: 20px; }
.aiml-calculator-desc { color: var(--aiml-muted); margin-bottom: 1em; font-size: .84em; }

.aiml-calculator-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 1.25em;
    padding-bottom: 1em;
    border-bottom: 1px solid #e2e8f0;
}

.aiml-calculator-field { flex: 1 1 200px; }

.aiml-calculator-field label {
    display: flex;
    align-items: center;
    gap: .3em;
    font-size: .82em;
    font-weight: 600;
    color: var(--aiml-muted);
    margin-bottom: .4em;
}

.aiml-calc-input {
    width: 100%;
    padding: .65em .85em;
    border: 2px solid var(--aiml-border);
    border-radius: 10px;
    font-size: 1.15em;
    font-weight: 700;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}

.aiml-calc-input:focus {
    outline: none;
    border-color: var(--aiml-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.aiml-calculator-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .65em;
    counter-reset: calc-rank;
}

.aiml-calc-card {
    display: flex;
    align-items: center;
    gap: .75em;
    padding: .75em 1em;
    border: 1px solid var(--aiml-border);
    border-radius: 10px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    counter-increment: calc-rank;
    position: relative;
    min-width: 0;
    box-sizing: border-box;
}

.aiml-calc-card:hover {
    border-color: var(--aiml-accent, #6366f1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, .1);
}

.aiml-calc-card:nth-child(-n+3) { border-color: rgba(99, 102, 241, .25); background: #fafbff; }

.aiml-calc-card img { width: 30px; height: 30px; border-radius: 6px; background: #f8fafc; }

.aiml-calc-card__info { flex: 1; min-width: 0; }
.aiml-calc-card__name { font-weight: 700; font-size: .88em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aiml-calc-card__name a { color: inherit; text-decoration: none; }
.aiml-calc-card__name a:hover { color: var(--aiml-accent); }
.aiml-calc-card__provider { font-size: .76em; color: var(--aiml-muted); }
.aiml-calc-card__price { font-weight: 800; font-size: 1.15em; color: var(--aiml-accent); white-space: nowrap; flex-shrink: 0; min-width: 0; }
.aiml-calc-card__rank { font-size: 1.2em; flex-shrink: 0; }

/* Tablet */
@media (max-width: 768px) {
    .aiml-compare-wrap { padding: 1.25em .75em 0; }
    .aiml-compare-grid { min-width: 520px; }
    .aiml-compare-grid th:first-child,
    .aiml-compare-grid td:first-child { width: 120px; }
    .aiml-compare-header__name { font-size: .82em; }
    .aiml-compare-grid thead th { padding: .6em .5em; }
    .aiml-compare-grid th,
    .aiml-compare-grid td { padding: .5em .5em; font-size: .86em; }
    .aiml-compare-header .aiml-logo { width: 30px; height: 30px; }

    .aiml-calculator-wrap { padding: 1.25em 1em; }
    .aiml-calculator-results { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

    .aiml-detail-nav { gap: .5em; }
    .aiml-detail-nav__link { padding: .5em .9em; font-size: .82em; }
}

/* Mobile */
@media (max-width: 600px) {
    .aiml-compare-wrap { padding: 1em .5em 0; }
    .aiml-compare-picker { padding: 1em; }
    .aiml-compare-picker h3 { font-size: 1em; }
    .aiml-compare-picker__desc { font-size: .84em; }
    .aiml-compare-slots { gap: .4em; }
    .aiml-compare-slot { font-size: .84em; padding: .4em .6em; }
    .aiml-compare-slot img { width: 22px; height: 22px; }
    .aiml-compare-search-wrap { max-width: 100%; }
    .aiml-compare-grid { min-width: 480px; }
    .aiml-compare-grid th:first-child,
    .aiml-compare-grid td:first-child { width: 110px; font-size: .84em; }
    .aiml-compare-header__name { font-size: .8em; }
    .aiml-compare-header__prov { font-size: .72em; }
    .aiml-compare-header .aiml-logo { width: 26px; height: 26px; }
    .aiml-compare-grid th,
    .aiml-compare-grid td { padding: .45em .4em; font-size: .84em; }
    .aiml-compare-section-row td { font-size: .74em !important; padding: .45em .5em !important; }

    .aiml-calculator-wrap { padding: 1em .75em; border-radius: 8px; }
    .aiml-calculator-header h3 { font-size: .95em; }
    .aiml-calculator-desc { font-size: .82em; }
    .aiml-calculator-inputs { gap: .75em; }
    .aiml-calculator-field { flex: 1 1 100%; }
    .aiml-calculator-field label { font-size: .8em; }
    .aiml-calc-input { font-size: 1em; padding: .55em .75em; }
    .aiml-calculator-results { grid-template-columns: 1fr; gap: .5em; }
    .aiml-calc-card { padding: .6em .75em; gap: .5em; flex-wrap: wrap; }
    .aiml-calc-card img { width: 26px; height: 26px; }
    .aiml-calc-card__info { flex: 1 1 0; min-width: 100px; }
    .aiml-calc-card__name { font-size: .84em; }
    .aiml-calc-card__provider { font-size: .74em; }
    .aiml-calc-card__price { font-size: .95em; margin-left: auto; }

    .aiml-detail-nav { gap: .4em; padding: .7em 0; }
    .aiml-detail-nav__link { padding: .45em .8em; font-size: .8em; }
    .aiml-detail-nav__link svg { width: 14px; height: 14px; }
}

/* ==========================================================================
   Methodology
   ========================================================================== */

.aiml-methodology { max-width: 800px; }

.aiml-methodology-section {
    margin-bottom: 2em;
}

.aiml-methodology-section h3 {
    display: flex;
    align-items: center;
    gap: .4em;
    font-size: 1.15em;
    margin-bottom: .5em;
}

.aiml-methodology-section h3 svg { color: var(--aiml-accent); }

.aiml-methodology-dl { margin: 0; padding: 0; }
.aiml-methodology-dl dt { font-weight: 700; margin-top: .75em; color: var(--aiml-accent); }
.aiml-methodology-dl dd { margin: .2em 0 0 0; color: var(--aiml-muted); }

.aiml-methodology-section ul {
    padding-left: 1.25em;
}

.aiml-methodology-section li {
    margin-bottom: .4em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .aiml-leaderboard:not(.aiml-compare-grid) thead { display: none; }

    .aiml-leaderboard:not(.aiml-compare-grid),
    .aiml-leaderboard:not(.aiml-compare-grid) tbody,
    .aiml-leaderboard:not(.aiml-compare-grid) tr,
    .aiml-leaderboard:not(.aiml-compare-grid) td { display: block; width: 100%; }

    .aiml-leaderboard:not(.aiml-compare-grid) tr {
        margin-bottom: .75em;
        border: 1px solid var(--aiml-border);
        border-radius: var(--aiml-radius);
        overflow: hidden;
    }

    .aiml-leaderboard:not(.aiml-compare-grid) td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: .5em 1em;
        border-bottom: 1px solid var(--aiml-border);
        text-align: right;
    }

    .aiml-leaderboard:not(.aiml-compare-grid) td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        margin-right: 1em;
        font-size: .82em;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--aiml-muted);
    }

    .aiml-leaderboard:not(.aiml-compare-grid) td:last-child { border-bottom: none; }
    .aiml-col-logo { justify-content: center; }
    .aiml-col-logo::before { display: none; }
    .aiml-col-model { flex-direction: column; align-items: flex-start; text-align: left; }
    .aiml-col-model::before { display: none; }

    .aiml-detail-header { flex-direction: column; }
    .aiml-detail-header__left { flex-direction: column; }
    .aiml-detail-score-wrap { align-self: flex-start; flex-direction: row; gap: .5em; align-items: center; }
    .aiml-score-ring { width: 44px; height: 44px; }
    .aiml-score-ring__value { font-size: 1.1em; }

    .aiml-stats-primary { grid-template-columns: repeat(2, 1fr); }

    .aiml-bench-item { grid-template-columns: 80px 1fr 40px; }
    .aiml-aa-indices { grid-template-columns: repeat(3, 1fr); }

    .aiml-detail-ext-links { grid-template-columns: 1fr; }

    .aiml-info-key { width: 110px; }
}

/* ==========================================================================
   Admin Styles
   ========================================================================== */

.aiml-admin-wrap { max-width: 1200px; }

.aiml-admin-title {
    display: flex;
    align-items: center;
    gap: .4em;
    margin-bottom: 1em;
}

.aiml-admin-title svg { color: var(--aiml-accent); }

.aiml-admin-toolbar {
    display: flex;
    gap: .5em;
    margin-bottom: 1em;
}

.aiml-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1em;
    margin-bottom: 1.5em;
}

.aiml-card {
    background: #fff;
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius);
    padding: 1.5em;
    box-shadow: var(--aiml-shadow);
}

.aiml-card--stat { display: flex; align-items: center; gap: 1em; }
.aiml-card--wide { margin-top: 1.5em; }

.aiml-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--aiml-radius);
    background: var(--aiml-accent-bg);
    color: var(--aiml-accent);
    flex-shrink: 0;
}

.aiml-card__body { display: flex; flex-direction: column; }
.aiml-card__number { font-size: 1.8em; font-weight: 700; line-height: 1.1; color: #1e293b; }
.aiml-card__number--small { font-size: 1em; }
.aiml-card__label { font-size: .85em; color: var(--aiml-muted); margin-top: .15em; }

.aiml-card__heading {
    display: flex;
    align-items: center;
    gap: .4em;
    margin: 0 0 1em;
    padding: 0;
    font-size: 1.15em;
}

.aiml-card__heading svg { color: var(--aiml-accent); }
.aiml-card__desc { color: var(--aiml-muted); margin-bottom: 1em; }

.aiml-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5em;
}

.aiml-sync-log { margin-top: 1em; padding-top: 1em; border-top: 1px solid var(--aiml-border); }
.aiml-sync-log h3 { font-size: .95em; margin-bottom: .5em; }
.aiml-sync-log ul { margin: 0; padding-left: 1.2em; font-size: .9em; }
.aiml-sync-errors { color: var(--aiml-danger); }

.aiml-btn-sync { display: inline-flex !important; align-items: center; gap: .4em; }
.aiml-form-table th { padding-top: 1.2em; }

.aiml-shortcode-ref > code {
    display: inline-block;
    padding: .5em 1em;
    margin-bottom: 1em;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: var(--aiml-radius-sm);
    font-size: .95em;
}

.aiml-models-table-wrap { overflow-x: auto; }
.aiml-models-table .aiml-multi-select { min-width: 150px; min-height: 70px; }
.aiml-models-table .small-text { width: 70px; }

.aiml-status-select { font-size: .85em; }

.aiml-col-tags { display: flex; flex-wrap: wrap; gap: .3em; margin-top: .5em; }
.aiml-col-tags code { font-size: .8em; padding: .2em .4em; background: var(--aiml-bg-subtle); border-radius: 3px; }

.aiml-metabox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5em;
}

.aiml-metabox-section h3 {
    margin-top: 0;
    padding-bottom: .5em;
    border-bottom: 1px solid var(--aiml-border);
    color: var(--aiml-accent);
}

/* ═══════════════════════════════════════════════════════════════
   ARCHIVE PAGE — /ai-models/
   ═══════════════════════════════════════════════════════════════ */

.aiml-archive-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2em 1.25em 4em;
    font-family: inherit;
    color: #1e293b;
    line-height: 1.55;
    box-sizing: border-box;
    overflow-x: hidden;
}

.aiml-archive-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1em;
    margin-bottom: 1.5em;
    padding-bottom: 1.25em;
    border-bottom: 1px solid var(--aiml-border, #e2e8f0);
}
.aiml-archive-title {
    margin: 0 0 .15em;
    font-size: 1.85em;
    font-weight: 800;
    color: var(--aiml-accent);
    letter-spacing: -.02em;
}
.aiml-archive-subtitle {
    margin: 0;
    font-size: .95em;
    color: #64748b;
}
.aiml-archive-synced {
    font-size: .8em;
    color: #94a3b8;
    white-space: nowrap;
}

/* --- Toolbar --- */
.aiml-archive-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75em;
    margin-bottom: 1em;
}
.aiml-archive-search-wrap { flex: 1; min-width: 200px; }
.aiml-archive-search {
    width: 100%;
    padding: .6em 1em;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: .9em;
    background: #f8fafc;
    transition: border-color .15s, box-shadow .15s;
}
.aiml-archive-search:focus {
    outline: none;
    border-color: var(--aiml-accent, #6366f1);
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.aiml-archive-filters {
    display: flex;
    align-items: center;
    gap: .5em;
}
.aiml-archive-filter {
    padding: .5em .75em;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: .85em;
    background: #fff;
    color: #334155;
    cursor: pointer;
}

/* --- View toggle --- */
.aiml-archive-view-toggle {
    display: flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
}
.aiml-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.aiml-view-btn--active,
.aiml-view-btn:hover {
    background: #fff;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* --- Sort tabs --- */
.aiml-archive-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .35em;
    margin-bottom: 1.25em;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}
.aiml-tab {
    padding: .5em 1.1em;
    border: 1px solid transparent;
    background: transparent;
    font-size: .8em;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 7px;
    transition: all .15s ease;
    letter-spacing: .01em;
    line-height: 1.4;
}
.aiml-tab:hover {
    color: #1e293b;
    background: rgba(255,255,255,.55);
}
.aiml-tab--active {
    color: #1e293b;
    background: #fff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* --- Views --- */
.aiml-archive-view { display: none; }
.aiml-archive-view--active { display: block; }

/* --- TABLE VIEW --- */
.aiml-archive-row { transition: background .1s; }
.aiml-archive-row:hover { background: #f8fafc; }
.aiml-archive-row--highlight { background: #f8fafb; border-left: 3px solid var(--aiml-accent); }
.aiml-archive-row--highlight:hover { background: #eef2f7; }
.aiml-archive-row--preferred td:first-child { border-left: 2px solid #a5b4fc; border-radius: 6px 0 0 6px; }
.aiml-archive-row--preferred td:last-child { border-right: 2px solid #a5b4fc; border-radius: 0 6px 6px 0; }
.aiml-archive-row--preferred td { border-top: 1.5px solid #a5b4fc; border-bottom: 1.5px solid #a5b4fc; background: rgba(99,102,241,.02); }
.aiml-archive-row--preferred:hover td { background: rgba(99,102,241,.04); }

.aiml-archive-logo {
    padding: 2px;
}

.aiml-archive-model-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.aiml-archive-model-name {
    font-weight: 700;
    color: var(--aiml-accent);
    line-height: 1.3;
}
.aiml-archive-model-link:hover .aiml-archive-model-name {
    color: var(--aiml-accent, #6366f1);
}
.aiml-archive-model-provider {
    font-size: .8em;
    color: #94a3b8;
}

.aiml-archive-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: .2em .5em;
    border-radius: 6px;
    font-weight: 700;
    font-size: .9em;
}
.aiml-archive-score--na   { color: #cbd5e1; }

.aiml-col-rank  { width: 40px; text-align: center; padding-left: .3em; padding-right: .3em; }
.aiml-col-icon  { width: 52px; }
.aiml-col-score { width: 60px; text-align: center; }
.aiml-col-aa    { width: 70px; text-align: center; }
.aiml-col-context { white-space: nowrap; }
.aiml-col-price { white-space: nowrap; }
.aiml-col-caps  { white-space: nowrap; text-align: center; }

.aiml-archive-aa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: .2em .5em;
    border-radius: 6px;
    font-weight: 700;
    font-size: .85em;
    background: #f1f5f9;
    color: #475569;
}
.aiml-archive-aa--high { background: #eef2ff; color: #3730a3; }
.aiml-archive-aa--mid  { background: #f1f5f9; color: #334155; }
.aiml-archive-aa--low  { background: #f8fafc; color: #64748b; }

.aiml-mini-cap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .15em .45em;
    border-radius: 4px;
    font-size: .75em;
    font-weight: 700;
    background: #ede9fe;
    color: #6d28d9;
    margin-right: 2px;
}
.aiml-mini-cap--os { background: #f0fdf4; color: #15803d; }

/* --- CARD VIEW --- */
.aiml-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 1em;
}

.aiml-model-card {
    display: flex;
    flex-direction: column;
    gap: .5em;
    padding: 1em 1.15em;
    background: #fff;
    border: 1px solid var(--aiml-border);
    border-radius: var(--aiml-radius);
    text-decoration: none;
    color: var(--aiml-accent);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    position: relative;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
}
a.aiml-model-card,
a.aiml-model-card:hover,
a.aiml-model-card:focus,
a.aiml-model-card:active,
a.aiml-model-card:visited {
    text-decoration: none !important;
    color: var(--aiml-accent) !important;
}
.aiml-model-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    cursor: pointer;
}
.aiml-model-card:hover {
    border-color: var(--aiml-accent, #6366f1);
    box-shadow: 0 4px 12px rgba(99,102,241,.08);
    transform: translateY(-1px);
}
.aiml-model-card--highlight {
    border-color: var(--aiml-accent);
    background: var(--aiml-accent-bg);
    box-shadow: 0 2px 8px rgba(2, 13, 40, .08);
}
.aiml-model-card--standalone {
    margin: 1.25em 0;
    max-width: 100%;
    padding: 1em 1.25em;
    gap: .6em;
}
.aiml-sc-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
}
.aiml-sc-left {
    display: flex;
    align-items: center;
    gap: .75em;
    min-width: 0;
}
.aiml-sc-left .aiml-model-card__info {
    min-width: 0;
}
.aiml-sc-left .aiml-model-card__name {
    font-size: 1.05em;
    white-space: normal;
    line-height: 1.3;
}
.aiml-sc-right {
    display: flex;
    align-items: center;
    gap: .5em;
    flex-shrink: 0;
}
.aiml-sc-right .aiml-model-card__rank {
    font-size: .85em;
    margin-right: 0;
}
.aiml-sc-right .aiml-model-card__score {
    font-size: .95em;
    min-width: 36px;
    padding: .2em .5em;
}
.aiml-sc-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4em;
}
.aiml-sc-badges .aiml-badge-new,
.aiml-sc-badges .aiml-badge-updated,
.aiml-sc-badges .aiml-highlight-badge,
.aiml-sc-badges .aiml-dfo-badge {
    font-size: .7em;
    padding: .25em .55em;
    position: static;
}
.aiml-sc-badges .aiml-model-card__stat {
    font-size: .8em;
    padding: .2em .55em;
}
.aiml-sc-badges .aiml-mini-cap {
    font-size: .78em;
    padding: .2em .5em;
}
.aiml-sc-trophy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.aiml-sc-trophy--1 { color: #d97706; }
.aiml-sc-trophy--2 { color: #94a3b8; }
.aiml-sc-trophy--3 { color: #b45309; }

.aiml-sc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75em;
    border-top: 1px solid #e2e8f0;
    margin-top: .25em;
    padding-top: .65em;
}
.aiml-sc-footer__note {
    font-size: .72em;
    color: #94a3b8;
    line-height: 1.35;
}
.aiml-sc-footer__cta {
    font-size: .75em;
    font-weight: 700;
    color: var(--aiml-accent) !important;
    text-decoration: none !important;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}
.aiml-sc-footer__cta:hover {
    color: #4f46e5 !important;
    text-decoration: underline !important;
}
.aiml-model-card .aiml-badge-new,
.aiml-model-card .aiml-badge-updated,
.aiml-model-card .aiml-highlight-badge,
.aiml-model-card .aiml-dfo-badge {
    font-size: .6em;
    padding: .3em .6em .3em .45em;
    position: static;
    order: 0;
}

.aiml-model-card__header {
    display: flex;
    align-items: center;
    gap: .4em;
    flex-wrap: wrap;
}
.aiml-model-card__rank {
    font-size: .75em;
    font-weight: 700;
    color: var(--aiml-accent);
    margin-right: auto;
    opacity: .6;
}
.aiml-model-card__score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: .15em .4em;
    border-radius: 6px;
    font-weight: 700;
    font-size: .85em;
}

.aiml-model-card__body {
    display: flex;
    align-items: center;
    gap: .65em;
    min-width: 0;
}
.aiml-model-card__logo {
    border-radius: 8px;
    background: #f8fafc;
    padding: 4px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.aiml-model-card__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.aiml-model-card__name {
    font-weight: 700;
    font-size: .95em;
    color: var(--aiml-accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aiml-model-card__provider {
    font-size: .8em;
    color: #94a3b8;
}

.aiml-model-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5em;
}
.aiml-model-card__stat {
    font-size: .78em;
    color: #64748b;
    background: #f1f5f9;
    padding: .15em .5em;
    border-radius: 4px;
}
.aiml-model-card__stat--aa {
    background: #ede9fe;
    color: #6d28d9;
    font-weight: 600;
}
.aiml-model-card__caps {
    display: flex;
    flex-wrap: wrap;
    gap: .3em;
}

/* --- Footer --- */
.aiml-archive-footer {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: .82em;
    color: #94a3b8;
}

/* ── Archive loading overlay ── */
.aiml-archive-loading {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2em 0;
    color: var(--aiml-accent, #6366f1);
}
@keyframes aiml-spin { to { transform: rotate(360deg); } }
.aiml-archive-spinner {
    animation: aiml-spin .8s linear infinite;
    opacity: .7;
}

/* ── Archive WP pagination ── */
.aiml-pagination {
    margin: 1.75em 0 .5em;
    display: flex;
    justify-content: center;
}
.aiml-pagination .page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: .35em;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}
.aiml-pagination .page-numbers li { margin: 0; padding: 0; }
.aiml-pagination .page-numbers a,
.aiml-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2em;
    height: 2.2em;
    padding: 0 .6em;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .85em;
    font-weight: 500;
    color: #475569;
    background: #fff;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.aiml-pagination .page-numbers a:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}
.aiml-pagination .page-numbers .current {
    background: var(--aiml-accent, #6366f1);
    border-color: var(--aiml-accent, #6366f1);
    color: #fff;
}
.aiml-pagination .page-numbers .dots {
    border: none;
    background: none;
    color: #94a3b8;
}

/* ── Shortcode JS pagination ── */
.aiml-sc-pagination {
    margin-top: 1em;
}
.aiml-sc-pagination__inner {
    display: flex;
    flex-wrap: wrap;
    gap: .35em;
    align-items: center;
    justify-content: center;
}
.aiml-sc-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1em;
    height: 2.1em;
    padding: 0 .55em;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .84em;
    font-weight: 500;
    color: #475569;
    background: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.aiml-sc-page-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}
.aiml-sc-page-btn--active {
    background: var(--aiml-accent, #6366f1);
    border-color: var(--aiml-accent, #6366f1);
    color: #fff;
}
.aiml-sc-page-btn:disabled {
    opacity: .4;
    cursor: default;
}
.aiml-sc-page-ellipsis {
    font-size: .84em;
    color: #94a3b8;
    padding: 0 .2em;
}
.aiml-sc-pagination__count {
    font-size: .8em;
    color: #94a3b8;
    margin-left: .5em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .aiml-archive-header { flex-direction: column; align-items: flex-start; }
    .aiml-archive-toolbar { flex-direction: column; }
    .aiml-archive-search-wrap { width: 100%; }
    .aiml-archive-filters { width: 100%; justify-content: space-between; }

    /* Switch to auto layout so hidden col widths don't steal space from
       visible columns — with table-layout:fixed the colgroup inline widths
       are applied even to display:none columns, collapsing the model name. */
    .aiml-archive-table {
        font-size: .82em;
        table-layout: auto;
    }
    .aiml-archive-table col { width: auto !important; }

    /* Hide Context / Input / Output / Caps on ≤768 px */
    .aiml-archive-table th:nth-child(n+6),
    .aiml-archive-table td:nth-child(n+6) { display: none; }

    .aiml-archive-grid { grid-template-columns: 1fr; }
    .aiml-model-card { max-width: 100%; }
    .aiml-model-card__header { gap: .3em; }
    .aiml-model-card__meta { gap: .35em; }
}

/* On very narrow screens also hide the AI Index column (col 5) */
@media (max-width: 480px) {
    .aiml-archive-table th:nth-child(5),
    .aiml-archive-table td:nth-child(5) { display: none; }
}

/* ==========================================================================
   Tier Badges
   ========================================================================== */

.aiml-tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: .75em;
    font-weight: 700;
    letter-spacing: .02em;
    background: color-mix(in srgb, var(--tier-color, #94a3b8) 12%, transparent);
    color: var(--tier-color, #94a3b8);
    border: 1px solid color-mix(in srgb, var(--tier-color, #94a3b8) 25%, transparent);
}

/* ==========================================================================
   Score — Pending / Awaiting Review state
   ========================================================================== */

.aiml-score-ring--pending {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.aiml-score--pending {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #64748b;
}

.aiml-score--pending .aiml-score-tier-label {
    font-size: .72em;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Tier label under the numeric score on leaderboard */
.aiml-score-tier {
    display: block;
    font-size: .65em;
    font-weight: 600;
    margin-top: 1px;
    letter-spacing: .02em;
}

/* ==========================================================================
   Dimension Radar Chart & Bars (Single Model Page)
   ========================================================================== */

.aiml-dims-section {
    margin-top: 1.5em;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.aiml-dims-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2.25em;
    align-items: center;
    margin-top: 1em;
}

@media (max-width: 640px) {
    .aiml-dims-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }
}

.aiml-radar-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 260px;
    min-width: 0;
}

@media (max-width: 640px) {
    .aiml-radar-wrap {
        width: 220px;
    }
}

.aiml-radar-chart {
    width: 100%;
    height: auto;
}

/* Dimension bar rows */
.aiml-dims-bars {
    display: flex;
    flex-direction: column;
    gap: 1em;
    width: 100%;
}

.aiml-dim-row__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.aiml-dim-row__label {
    font-weight: 600;
    font-size: .92em;
    color: var(--aiml-accent);
}

.aiml-dim-row__value {
    font-weight: 800;
    font-size: 1.05em;
    color: var(--aiml-accent);
}

.aiml-dim-row__max {
    font-weight: 400;
    font-size: .72em;
    color: var(--aiml-muted);
    margin-left: 1px;
}

.aiml-dim-row__bar-wrap {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.aiml-dim-row__bar {
    height: 100%;
    border-radius: 5px;
    transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

.aiml-dim--intelligence { background: linear-gradient(90deg, #818cf8, #6366f1); }
.aiml-dim--technical    { background: linear-gradient(90deg, #22d3ee, #0891b2); }
.aiml-dim--content      { background: linear-gradient(90deg, #34d399, #059669); }
.aiml-dim--value        { background: linear-gradient(90deg, #fbbf24, #d97706); }

/* ==========================================================================
   Explore Navigation Bar (Single Model)
   ========================================================================== */

.aiml-detail-nav {
    display: flex;
    gap: .75em;
    flex-wrap: wrap;
    padding: .85em 0;
    margin: .25em 0 1em;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.aiml-detail-nav__link {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    padding: .55em 1.1em;
    border-radius: 8px;
    font-size: .85em;
    font-weight: 600;
    color: var(--aiml-accent, #6366f1);
    background: #f0f0ff;
    border: 1.5px solid rgba(99,102,241,.3);
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}

.aiml-detail-nav__link:hover,
.aiml-detail-nav__link:focus-visible {
    background: var(--aiml-accent, #6366f1);
    border-color: var(--aiml-accent, #6366f1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,.25);
}

.aiml-detail-nav__link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.aiml-compare-wrap .aiml-detail-nav,
.aiml-calculator-wrap .aiml-detail-nav {
    border-top: none;
    margin-top: 0;
}

.aiml-archive-wrap .aiml-detail-nav {
    border-top: none;
    margin-top: -.25em;
    margin-bottom: .5em;
}

/* ==========================================================================
   Tools Banner (Archive + Model pages)
   ========================================================================== */

.aiml-tools-banner {
    margin: 1.5em 0;
}

.aiml-tools-banner__cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: .75em;
}

.aiml-tools-banner__card {
    display: flex;
    align-items: flex-start;
    gap: .75em;
    padding: 1em 1.25em;
    background: linear-gradient(135deg, #f8f7ff, #eef2ff);
    border: 1.5px solid rgba(99,102,241,.2);
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.aiml-tools-banner__card:hover {
    border-color: var(--aiml-accent, #6366f1);
    box-shadow: 0 4px 16px rgba(99,102,241,.15);
    transform: translateY(-1px);
}

.aiml-tools-banner__card svg {
    flex-shrink: 0;
    color: var(--aiml-accent, #6366f1);
    margin-top: .1em;
}

.aiml-tools-banner__card strong {
    display: block;
    font-size: .92em;
    font-weight: 700;
    color: var(--aiml-accent, #6366f1);
    margin-bottom: .2em;
}

.aiml-tools-banner__card span {
    display: block;
    font-size: .82em;
    color: #64748b;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .aiml-tools-banner__cards { grid-template-columns: 1fr; }
    .aiml-tools-banner__card { padding: .85em 1em; gap: .6em; }
    .aiml-tools-banner__card svg { width: 18px; height: 18px; }
    .aiml-tools-banner__card strong { font-size: .86em; }
    .aiml-tools-banner__card span { font-size: .78em; }
}

/* ==========================================================================
   Quick Actions (After Description)
   ========================================================================== */

.aiml-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6em;
    margin: .75em 0 1.25em;
}

.aiml-quick-actions__link {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    padding: .4em .9em;
    font-size: .82em;
    font-weight: 600;
    color: var(--aiml-accent, #6366f1);
    background: transparent;
    border: 1.5px dashed rgba(99,102,241,.35);
    border-radius: 8px;
    text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
}

.aiml-quick-actions__link:hover {
    background: #f0f0ff;
    border-color: var(--aiml-accent, #6366f1);
    border-style: solid;
}

.aiml-quick-actions__link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .aiml-quick-actions__link { font-size: .78em; padding: .35em .7em; }
    .aiml-quick-actions__link svg { width: 13px; height: 13px; }
}

/* ==========================================================================
   Table of Contents (Single Model)
   ========================================================================== */

.aiml-toc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .85em 1.15em;
    margin-bottom: 1.5em;
}

.aiml-toc__title {
    display: flex;
    align-items: center;
    gap: .35em;
    font-size: .78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    margin-bottom: .5em;
    cursor: pointer;
    user-select: none;
}

.aiml-toc__chevron {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    transition: transform .2s;
}

.aiml-toc--open .aiml-toc__chevron {
    transform: rotate(-135deg);
}

.aiml-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .15em .35em;
}

.aiml-toc__link {
    display: inline-block;
    font-size: .8em;
    color: #64748b;
    text-decoration: none;
    padding: .2em .45em;
    border-radius: 5px;
    transition: color .15s, background .15s;
}

.aiml-toc__link:hover,
.aiml-toc__link--active {
    color: var(--aiml-accent, #6366f1);
    background: rgba(99, 102, 241, .08);
}

@media (max-width: 768px) {
    .aiml-toc__list {
        display: none;
        flex-direction: column;
        gap: .1em;
    }
    .aiml-toc--open .aiml-toc__list {
        display: flex;
    }
}

@media (min-width: 769px) {
    .aiml-toc__chevron { display: none; }
    .aiml-toc__title { cursor: default; }
}

/* ==========================================================================
   Compare CTA Banner (Single Model)
   ========================================================================== */

.aiml-compare-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    padding: 1.15em 1.4em;
    margin: 1.5em 0;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
}

.aiml-compare-cta__text {
    flex: 1;
    min-width: 0;
}

.aiml-compare-cta__title {
    font-size: .95em;
    font-weight: 700;
    color: #1e1b4b;
    margin: 0 0 .2em;
}

.aiml-compare-cta__desc {
    font-size: .82em;
    color: #4338ca;
    margin: 0;
}

.aiml-compare-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    padding: .55em 1.15em;
    background: var(--aiml-accent, #6366f1);
    color: #fff;
    border-radius: 8px;
    font-size: .84em;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}

.aiml-compare-cta__btn:hover {
    background: #4f46e5;
    color: #fff;
}

.aiml-compare-cta__btn svg {
    width: 15px;
    height: 15px;
}

@media (max-width: 640px) {
    .aiml-compare-cta {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Related Models Grid (Single Model)
   ========================================================================== */

.aiml-related-section {
    margin-top: 2em;
}

.aiml-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .85em;
    margin-top: 1em;
}

.aiml-related-card {
    display: flex;
    flex-direction: column;
    padding: .9em 1em;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.aiml-related-card:hover {
    border-color: var(--aiml-accent, #6366f1);
    box-shadow: 0 2px 10px rgba(99, 102, 241, .12);
}

.aiml-related-card__header {
    display: flex;
    align-items: center;
    gap: .6em;
    margin-bottom: .65em;
}

.aiml-related-card__header img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    background: #f8fafc;
}

.aiml-related-card__name {
    display: block;
    font-weight: 700;
    font-size: .88em;
    color: #0f172a;
    line-height: 1.25;
}

.aiml-related-card__provider {
    display: block;
    font-size: .76em;
    color: #64748b;
}

.aiml-related-card__footer {
    display: flex;
    align-items: center;
    gap: .45em;
    margin-top: auto;
    padding-top: .5em;
    border-top: 1px solid #f1f5f9;
}

.aiml-related-card__score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--aiml-accent, #6366f1);
    font-size: .75em;
    font-weight: 800;
    color: var(--aiml-accent, #6366f1);
    flex-shrink: 0;
}

.aiml-related-card__tag {
    display: inline-block;
    font-size: .7em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    margin-left: auto;
    white-space: nowrap;
}

/* ==========================================================================
   Auto-linked Model Names & Info Table Links
   ========================================================================== */

.aiml-autolink {
    color: var(--aiml-accent, #6366f1);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

.aiml-autolink:hover {
    text-decoration-style: solid;
}

.aiml-info-link {
    color: var(--aiml-accent, #6366f1);
    text-decoration: none;
    font-weight: 500;
}

.aiml-info-link:hover {
    text-decoration: underline;
}
