/* explore.css — live signed-out queries on the marketing pages: the landing
   page's hero card (js/landing-live.js) and the /datasets/ pages, both
   rendered by js/explore.js. Tokens come from style.css, loaded first. Used
   by those pages only, so nothing here can reach Studio. */

/* --- Results shared by the hero card and dataset pages ----------------- */
.xq-bars {
    display: block;
    width: 100%;
    height: auto;
}
.xq-bar-rects rect {
    fill: var(--opteryx-teal);
    opacity: 0.78;
}
.xq-bar-rects .xq-peak {
    fill: var(--opteryx-orange);
    opacity: 1;
}
.xq-bar-labels text,
.xq-bar-values text {
    font-family: var(--font-mono);
    font-size: 14px;
    fill: var(--muted);
}
.xq-bar-labels text {
    text-anchor: end;
    fill: var(--muted-2);
}
.xq-table-wrap {
    overflow-x: auto;
}
.xq-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-deep);
}
.xq-table th,
.xq-table td {
    padding: 5px 10px 5px 0;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--muted-border);
}
.xq-table th {
    font-weight: 600;
    color: var(--muted);
}
.xq-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.xq-table tr:last-child td {
    border-bottom: 0;
}
.xq-error {
    margin: 0;
    padding: 12px 0;
    font-size: 14px;
    color: var(--danger);
}

/* --- Landing hero card, live -------------------------------------------- */
.hq-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    white-space: nowrap;
}
.hq-live i {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--success);
}
.hq-live[hidden],
.hq-picks[hidden] {
    display: none;
}
.hq-picks {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--muted-border);
    scrollbar-width: none;
}
.hq-picks::-webkit-scrollbar {
    display: none;
}
.hq-pick {
    flex: none;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    font: 500 12.5px/1.4 var(--font-body);
    color: var(--muted);
    cursor: pointer;
}
.hq-pick:hover {
    color: var(--text-deep);
    border-color: var(--border-2);
}
.hq-pick[aria-pressed="true"] {
    background: var(--opteryx-navy);
    border-color: var(--opteryx-navy);
    color: var(--on-accent);
}
.hq-pick:focus-visible {
    outline: 2px solid var(--accent-soft-3);
    outline-offset: 2px;
}
/* Room for ten rows either way, so switching between a chart and a table
   doesn't shove the hero around. */
[data-live-card] [data-lq-result] {
    min-height: 236px;
    transition: opacity 0.15s;
}
[data-live-card] [data-lq-result].is-running {
    opacity: 0.45;
}
[data-live-card] .xq-table {
    font-size: 12px;
}
.hq-foot {
    align-items: center;
}
.hq-open {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    color: var(--opteryx-orange);
    text-decoration: none;
}
.hq-open:hover {
    text-decoration: underline;
}
.hq-running {
    color: var(--muted);
}
@media (max-width: 480px) {
    .xq-bar-labels text,
    .xq-bar-values text {
        font-size: 20px;
    }
    [data-live-card] [data-lq-result] {
        min-height: 180px;
    }
}
/* Long text (KEV product names) truncates rather than pushing the last
   column out of the card. */
[data-live-card] .xq-table td {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- /datasets/ pages (scripts/build_dataset_pages.py) ------------------ */
.ds-hero {
    padding-bottom: 40px;
}
.ds-hero h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 44px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--text-deep);
    margin: 8px 0 14px;
    text-wrap: balance;
}
.ds-summary {
    max-width: 720px;
    font-size: 18px;
    line-height: 1.55;
    color: var(--text);
    margin: 0 0 24px;
}
.ds-crumbs {
    font-size: 14px;
    color: var(--muted);
}
.ds-crumbs a {
    color: var(--opteryx-teal);
    text-decoration: none;
}
.ds-crumbs a:hover {
    text-decoration: underline;
}
.ds-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 36px;
    margin: 0 0 28px;
}
.ds-facts div[hidden] {
    display: none;
}
.ds-facts dt {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}
.ds-facts dd {
    margin: 0;
    font-size: 15px;
    color: var(--text-deep);
}
.ds-facts a {
    color: var(--opteryx-teal);
}
.ds-section .section-head {
    margin-bottom: 24px;
}
.ds-sql {
    border: 1px solid var(--muted-border);
    border-radius: var(--r-lg, 10px);
}
.ds-result {
    margin-top: 14px;
}
.ds-result:empty {
    display: none;
}
.ds-result .xq-bars {
    max-width: 760px;
}
.ds-noscript {
    color: var(--muted);
}
.ds-examples {
    display: grid;
    gap: 20px;
}
.ds-example {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-xl, 14px);
    padding: 20px 22px;
    min-width: 0;
}
.ds-example h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    color: var(--text-deep);
    margin: 0 0 12px;
}
.ds-example-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-top: 12px;
}
.ds-example-actions .hq-open {
    margin-left: 0;
}
.ds-run[hidden] {
    display: none;
}
.ds-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}
.ds-columns-wrap {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}
.ds-columns td:first-child {
    font-weight: 600;
}
.ds-related h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-deep);
    margin: 0 0 12px;
}
.ds-related ul {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: grid;
    gap: 8px;
}
.ds-related a {
    color: var(--opteryx-teal);
    text-decoration: none;
}
.ds-related a:hover {
    text-decoration: underline;
}
.ds-cards {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.ds-cards a {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    padding: 18px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-xl, 14px);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ds-cards a:hover {
    border-color: var(--border-2);
    box-shadow: var(--shadow-m, 0 4px 14px rgba(31, 46, 97, 0.08));
}
.ds-card-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-deep);
}
.ds-card-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}
.ds-card-fqn {
    margin-top: auto;
    font-size: 12px;
    color: var(--muted);
}
@media (max-width: 860px) {
    .ds-columns-wrap {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
    .ds-hero h1 {
        font-size: 32px;
    }
    .ds-summary {
        font-size: 16px;
    }
    .ds-example {
        padding: 16px;
    }
}
/* The hero grid's visual column would otherwise grow to its content's
   min-content width (the picks row, the SQL <pre>, a wide table) and push
   the card past a phone's edge; its scrolling children handle overflow. */
.hero-visual,
.hq-stack,
[data-live-card] {
    min-width: 0;
}

/* Dataset pages: Excel / Power BI / Google Sheets (spreadsheet section). */
.ds-sheets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.ds-sheet {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-xl, 12px);
    min-width: 0;
}
.ds-sheet h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-deep);
}
.ds-sheet p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}
.ds-copy {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: auto;
}
.ds-copy input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--muted-surface);
    font: 12px/1.4 var(--font-mono);
    color: var(--text-deep);
}
.ds-sheet .btn-navy {
    margin-top: auto;
}
@media (max-width: 860px) {
    .ds-sheets {
        grid-template-columns: minmax(0, 1fr);
    }
}
