/* /models in a browser: every model as a card (templates/models.html, static/js/models-page.js). */

.models-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem 1.1rem 5rem;
    color: #c9c9c9;
}

.models-head h1 {
    color: #fff;
    font-size: 2.3rem;
    line-height: 1.2;
    margin: 0 0 0.8rem;
}
.models-lede {
    max-width: 760px;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0 0 1.4rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Search and filters stay in reach while scrolling. */
.models-tools {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(6px);
    padding: 0.8rem 0 0.6rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
}
.models-search input {
    width: 100%;
    box-sizing: border-box;
    background: #0b0b0b;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    color: #eee;
    font: 1rem var(--sans);
    padding: 0.75rem 0.95rem;
    outline: none;
}
.models-search input:focus { border-color: var(--primary-color); }

.models-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}
.models-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid #2a2a2a;
    border-radius: 999px;
    color: #cfcfcf;
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
}
.models-chip span { color: #777; font-size: 0.8rem; }
.models-chip:hover { border-color: #3d3d3d; color: #fff; }
.models-chip--on {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 217, 126, 0.08);
}
.models-chip--on span { color: var(--primary-color); }
.models-count { margin: 0.6rem 0 0; font-size: 0.85rem; color: #777; min-height: 1.2em; }

.models-group { scroll-margin-top: 10rem; }
.models-group h2 {
    color: #fff;
    font-size: 1.3rem;
    margin: 2rem 0 0.9rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid rgba(0, 217, 126, 0.25);
}
.models-group-count { color: #666; font-size: 0.9rem; font-weight: normal; margin-left: 0.3rem; }

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 0.9rem;
}

.model-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem 1rem 0.85rem;
    background: #070707;
    border: 1px solid #1f1f1f;
    border-radius: 12px;
    transition: border-color 0.15s;
}
.model-card:hover { border-color: rgba(0, 217, 126, 0.45); }
.model-card--down { opacity: 0.65; }
.model-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.model-card h3 a { color: #fff; text-decoration: none; }
.model-card h3 a:hover { color: var(--primary-color); }
.model-card-id {
    margin: 0;
    font: 0.78rem var(--mono);
    color: #6f6f6f;
    overflow-wrap: anywhere;
}
.model-card-line { margin: 0.1rem 0 0; font-size: 0.93rem; line-height: 1.55; color: #bdbdbd; }

.model-card-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.15rem 0 0; padding: 0; }
.model-card-hosts { margin: 0 0 0.6rem; font-size: 0.82rem; color: #9a9a9a; line-height: 1.4; }
.model-card-hosts span { color: #6f6f6f; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em; margin-right: 0.3rem; }
.model-card-tags li {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #2c2c2c;
    color: #a8a8a8;
}
.model-card-tags .tag-free { border-color: rgba(0, 217, 126, 0.5); color: var(--primary-color); }
.model-card-tags .tag-uncensored { border-color: rgba(255, 110, 110, 0.5); color: #ff8a8a; }
.model-card-tags .tag-frontier { border-color: rgba(120, 170, 255, 0.5); color: #9dbdff; }
.model-card-tags .tag-zdr, .model-card-tags .tag-tee { border-color: rgba(0, 217, 126, 0.35); color: #4fe3a4; }
.model-card-tags .tag-down { border-color: rgba(255, 180, 60, 0.5); color: #ffbf5a; }

/* Price and context on the left, the buttons on the right (Chat last: bottom right). */
.model-card-foot {
    margin-top: auto;
    padding-top: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.6rem;
    border-top: 1px solid #161616;
}
.model-card-stats { display: flex; gap: 0.9rem; margin: 0; }
.model-card-stats div { display: flex; flex-direction: column; }
.model-card-stats dt { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: #666; }
.model-card-stats dd { margin: 0; font: 0.92rem var(--mono); color: #e6e6e6; }
.model-card-actions { display: flex; gap: 0.4rem; flex-shrink: 0; margin-left: auto; }
.model-card-actions a {
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
}
.model-card-more { color: #bbb; border: 1px solid #2a2a2a; }
.model-card-more:hover { color: #fff; border-color: #444; }
.model-card-chat { color: #000; background: var(--primary-color); font-weight: 600; }
.model-card-chat:hover { background: var(--accent-secondary); }

.models-empty { text-align: center; color: #888; padding: 3rem 0; }
.models-note { margin: 2.5rem 0 0; font-size: 0.92rem; line-height: 1.7; color: #9a9a9a; max-width: 820px; }
.models-note a, .models-faq a { color: var(--primary-color); }
.models-note code { background: #1a1d23; padding: 0.1rem 0.35rem; border-radius: 4px; }
.models-faq { max-width: 820px; line-height: 1.7; }
.models-faq h2 { color: #fff; font-size: 1.3rem; margin: 2.4rem 0 0.6rem; }
.models-faq h3 { color: #eee; font-size: 1.05rem; margin: 1.3rem 0 0.4rem; }

@media (max-width: 640px) {
    .models-head h1 { font-size: 1.8rem; }
    .models-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.2rem; }
    .models-chips::-webkit-scrollbar { display: none; }
    .models-grid { grid-template-columns: 1fr; }
}

/* `hidden` must win over the cards' and groups' own display. */
.model-card[hidden], .models-group[hidden] { display: none; }

/* What each plan pays and unlocks, above the list */
.models-plans { margin: 0 0 1.75rem; padding: 1.1rem 1.25rem; border: 1px solid #2a2f38; border-radius: 12px; background: #13161b; max-width: 920px; }
.models-plans h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.models-plans ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.45rem; }
.models-plans li { font-size: 0.93rem; line-height: 1.6; color: #c9c9c9; }
.models-plans strong { color: #ececec; }
.models-plans-tag { display: inline-block; padding: 0 0.45rem; border: 1px solid; border-radius: 999px; font-size: 0.8rem; line-height: 1.5; white-space: nowrap; }
.models-plans-tag.tag-free { border-color: rgba(0, 217, 126, 0.5); color: var(--primary-color); }
.models-plans-tag.tag-frontier { border-color: rgba(120, 170, 255, 0.5); color: #9dbdff; }
.models-plans-tag.tag-uncensored { border-color: rgba(255, 110, 110, 0.5); color: #ff8a8a; }
.models-plans-link { display: inline-block; margin-top: 0.75rem; color: var(--primary-color); font-size: 0.92rem; }
