/* ============================================================================
   LCD — model page
   ========================================================================= */

/* model.html renders the header block in its own .main_div, then the content
   in a second one; collapse the seam between them. */
.main_div + .main_div {
    padding-top: 0;
}

/* ------------------------------------------------------------ title block */

/* Iframe "mini" card: no page chrome, so the body carries the padding. */
body.lcd-mini {
    padding: 20px 24px;
}

.lcd-modelhead__title--sm {
    font-size: var(--fs-h2) !important;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.lcd-modelhead__sep {
    color: var(--lcd-fg-faint);
    font-weight: 400;
}

.lcd-modelhead {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px 22px;
    margin-bottom: 6px;
}

.lcd-modelhead__id {
    min-width: 0;
}

.lcd-modelhead__title {
    font-size: var(--fs-title) !important;
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -.01em;
    margin: 0;
    text-wrap: balance;
}

.lcd-modelhead__meta {
    font-family: var(--lcd-font-data);
    font-size: var(--fs-key);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--lcd-fg-faint);
    margin-top: 8px;
}

.lcd-modelhead__meta a {
    color: var(--lcd-link);
}

.lcd-modelhead__keys {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.lcd-modelhead__share {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.lcd-modelhead__share .lcd-label {
    margin-right: 4px;
}

.lcd-modelhead__bluf {
    font-size: var(--fs-body);
    line-height: 1.55;
    color: var(--lcd-fg-dim);
    max-width: 860px;
    text-wrap: pretty;
    margin: 14px 0 16px;
}

#copied_ok {
    color: var(--lcd-ok);
}

/* .lcd-tagrow lives in lcd-components.css — shared with the agent pages. */

/* ------------------------------------------------------ benchmarks panel */
/* model.php wraps the stat tiles (and, on the full page, the radar chart)
   in an .lcd-panel so the section reads as one framed unit. */

.lcd-benchpanel__body {
    padding: 14px 16px;
}

.lcd-benchpanel__body .benchmarks {
    margin: 0;
}

.lcd-benchpanel__body--radar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 22px;
    align-items: start;
}

@media (max-width: 991px) {
    .lcd-benchpanel__body--radar {
        grid-template-columns: minmax(0, 1fr);
    }
}

.lcd-benchpanel__radar .canvas-container-radar {
    margin: 0;
    max-width: 100%;
}

/* ---------------------------------------------------------- stat tiles */
/* generate_benchmark_card() in common.php emits .lcd-stat. The container is
   .benchmarks, which model.php wraps in a Bootstrap column. */

.benchmarks,
.benchm_container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 0 0 12px;
}

.benchm_container {
    display: contents;
}

/* llm.css:987 pins the average card to 495px with a translucent lilac fill,
   both !important. The grid sizes these now and the fill has no place in the
   LCD palette; this is the one tile that reads as "summary", so it keeps the
   panel surface rather than the sunken well. */
.benchm_card_avg,
.lcd-stat.benchm_card_avg {
    width: auto !important;
    background: var(--lcd-panel) !important;
}

.lcd-stat {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 5px;
    min-width: 0;
    padding: 12px 14px;
    background: var(--lcd-well);
    border: 1px solid var(--lcd-border);
    box-shadow: var(--lcd-inset);
    color: var(--lcd-fg);
    text-decoration: none !important;
}

.lcd-stat:hover {
    color: var(--lcd-fg);
    border-color: var(--lcd-link);
}

.lcd-stat__label {
    font-family: var(--lcd-font-data);
    font-size: var(--fs-micro);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--lcd-fg-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lcd-stat__value {
    display: block;
}

.lcd-stat__sub {
    font-family: var(--lcd-font-data);
    font-size: var(--fs-micro);
    letter-spacing: .04em;
    color: var(--lcd-fg-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lcd-stat__sub b {
    font-weight: 500;
    color: var(--lcd-fg);
}

/* -------------------------------------------------------- two-column body */
/* Both columns stretch to the same height, and the last side panel absorbs
   the leftover space, so the two columns close on one shared bottom edge. */

.lcd-modelgrid {
    display: grid;
    grid-template-columns: minmax(0, 54fr) minmax(0, 46fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 32px;
}

@media (max-width: 1100px) {
    .lcd-modelgrid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.lcd-modelgrid__side {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.lcd-modelgrid__side > .lcd-panel:last-child {
    flex: 1 1 auto;
}

/* The left panel carries .model_segment's 40px legacy margin; inside the grid
   that margin would hang its border 40px short of the side column's. */
.lcd-modelgrid__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lcd-modelgrid__main > .lcd-panel {
    flex: 1 1 auto;
    margin: 0;
}

.lcd-panel__body {
    padding: 0;
}

.lcd-panel__body > .table {
    margin-bottom: 0;
}

.lcd-panel__head {
    font-weight: 500 !important;
    font-size: var(--fs-micro) !important;
    margin: 0;
}

.lcd-panel__note {
    padding: 14px 16px 6px;
    margin: 0;
    font-size: var(--fs-ui);
    color: var(--lcd-fg-dim);
}

/* The model description block sits inside the panel now. */
.lcd-panel__body .model_description {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 14px 16px;
    margin: 0;
}

/* --------------------------------------------------------- spec rows */

/* The spec table nests up to four levels of sub-tables and holds long model
   ids and URLs, so it sizes to content and overflows narrow viewports unless
   the layout is fixed and long tokens are allowed to break. */
.model_descr_table,
.model_descr_table table {
    table-layout: fixed;
    width: 100% !important;
    max-width: 100%;
}

.model_descr_table td {
    font-family: var(--lcd-font-data);
    font-size: var(--fs-data-lg);
    padding: 8px 16px;
    overflow-wrap: anywhere;
    word-break: break-word;
    /* Group labels (Use Cases, Additional Notes) anchor to the top of their
       group instead of floating mid-height. */
    vertical-align: top;
}

/* Nested tables carry .model_descr_table too, so this styles every label
   column. white-space:nowrap overflowed long labels straight into the value
   column under table-layout:fixed — labels wrap instead. */
.model_descr_table > tbody > tr > td:first-child {
    font-size: var(--fs-key);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--lcd-fg-faint);
    white-space: normal;
}

/* ---------------------------------------------- nested description data */
/* model_descr_render() emits scalar values as single-cell tables and objects
   as nested .model_descr_table tables up to four levels deep. llm.css turns
   each level into a tinted, border-spaced box and Bootstrap's striping bleeds
   into the nested tbodies. Flatten all of it: aligned rows, no boxes. */

.model_descr_table .model_descr_wrap,
.model_descr_table table.level_1,
.model_descr_table table.level_2,
.model_descr_table table.level_3,
.model_descr_table table.level_4 {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin: 0 !important;
}

.model_descr_table .model_descr_wrap td,
.model_descr_table table.level_1 td,
.model_descr_table table.level_2 td,
.model_descr_table table.level_3 td,
.model_descr_table table.level_4 td {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 3px 10px 3px 0 !important;
}

/* Bootstrap's .table-striped / .table-hover reach nested tbodies through
   descendant selectors; inner rows must stay flat. */
.model_descr_table table tr,
.model_descr_table table tr:hover,
.model_descr_table table tr:hover > td {
    background: transparent !important;
}

/* One consistent label column at every depth (llm.css mixes 30% and 50%). */
.model_descr_table table.level_1 > tbody > tr > td:first-child,
.model_descr_table table.level_2 > tbody > tr > td:first-child,
.model_descr_table table.level_3 > tbody > tr > td:first-child,
.model_descr_table table.level_4 > tbody > tr > td:first-child {
    width: 36% !important;
    padding-right: 14px !important;
}

/* A quiet left rule marks each nested key/value group. Scalar values reuse
   the same wrapper div, so the rule keys off the inner table's class. */
.model_descr_table .model_descr_wrap:has(> table.model_descr_table) {
    border-left: 2px solid var(--lcd-border) !important;
    padding-left: 12px !important;
    margin: 2px 0 !important;
}

/* ---------------------------------------------------- capability ratings */
/* Four vote keys plus a name and a rating live in the narrow side column, so
   the keys are icon-only here rather than the full padded key. The table's
   hardcoded td widths (300/110/110) have to be released for that to fit. */

.lcd-caps {
    width: 100%;
    table-layout: auto;
}

.lcd-caps td {
    padding: 8px 10px;
    width: auto !important;
}

.lcd-caps td:first-child {
    font-family: var(--lcd-font-data);
    font-size: var(--fs-key);
    letter-spacing: .04em;
    color: var(--lcd-fg-dim);
    white-space: normal;
}

.lcd-caps td:last-child {
    white-space: nowrap;
    text-align: right;
}

.lcd-caps .reaction_button {
    padding: 3px 6px !important;
    margin-right: 2px !important;
    gap: 1px;
    box-shadow: none !important;
    border-color: var(--lcd-hair) !important;
}

.lcd-caps .reaction_button:hover {
    box-shadow: var(--lcd-key-shadow) !important;
    border-color: var(--lcd-line) !important;
}

.lcd-caps .stars,
.lcd-caps .stars_disabled {
    font-size: 13px;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* The footnote that follows the stat tiles is a sibling in the same grid;
   without this it lands in the next column and overlaps a tile. */
.benchmarks > .font_smaller,
.benchmarks > div:not(.benchm_container):not(.lcd-stat) {
    grid-column: 1 / -1;
    color: var(--lcd-fg-faint);
    font-family: var(--lcd-font-data);
    font-size: var(--fs-micro);
    line-height: 1.7;
}

/* llm.css styles #copy_url as a bordered tan pill; it is a key now. */
#copy_url {
    top: 0;
    border: 1.5px solid var(--lcd-line) !important;
    box-shadow: var(--lcd-key-shadow) !important;
    color: var(--lcd-fg) !important;
    padding: 6px 12px !important;
    font-size: var(--fs-key) !important;
}

#copy_url:hover {
    background: var(--lcd-panel) !important;
    color: var(--lcd-fg) !important;
    box-shadow: var(--lcd-key-shadow-hover) !important;
}

/* ------------------------------------------------------- radar chart */

.canvas-container-radar {
    width: 100%;
    max-width: 460px;
    margin: 0 0 20px;
}

.canvas-container {
    margin: 0 0 20px;
}

/* --------------------------------------------- alternatives / quantized */

.similar_models {
    padding: 0 !important;
    margin: 0 0 28px !important;
    font-size: var(--fs-data-lg) !important;
    background: var(--lcd-panel) !important;
}

.similar_models th,
.similar_models td {
    font-size: var(--fs-data) !important;
}

.rank_table_width {
    width: auto;
}
