/* ---------- RioCharts docs ---------- */

:root {
    --doc-bg: #fbfbfd;
    --doc-surface: #ffffff;
    --doc-surface-2: #f4f5f9;
    --doc-text: #14171c;
    --doc-muted: #5d6573;
    --doc-border: #e5e7ee;
    --doc-border-strong: #d4d8e2;
    --doc-accent: #3b5fc7;
    --doc-accent-soft: rgba(66, 105, 208, 0.1);
    --doc-amber: #efb118;
    --doc-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -12px rgba(16, 24, 40, 0.12);
    --doc-shadow-lg: 0 2px 6px rgba(16, 24, 40, 0.05), 0 30px 60px -24px rgba(30, 50, 110, 0.28);
    --doc-inline-code: #eef0f6;
    --doc-header: rgba(251, 251, 253, 0.78);
    --doc-sans: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    --doc-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
    --doc-radius: 14px;

    /* Code blocks are dark in both themes. */
    --code-bg: #0e1221;
    --code-bar: #151a2d;
    --code-border: #232a42;
    --code-text: #d6dcef;
    --code-muted: #7c86a6;
    color-scheme: light;
}

.dark {
    --doc-bg: #0a0c11;
    --doc-surface: #11141b;
    --doc-surface-2: #171b24;
    --doc-text: #e8eaf0;
    --doc-muted: #98a1b3;
    --doc-border: #222834;
    --doc-border-strong: #2f3646;
    --doc-accent: #86a6ff;
    --doc-accent-soft: rgba(134, 166, 255, 0.12);
    --doc-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --doc-shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3), 0 30px 70px -24px rgba(0, 0, 0, 0.8);
    --doc-inline-code: #1b202b;
    --doc-header: rgba(10, 12, 17, 0.75);
    --code-bg: #0c0f18;
    --code-bar: #121624;
    --code-border: #222838;
    color-scheme: dark;
}

html, body {
    margin: 0;
    font-family: var(--doc-sans);
    -webkit-font-smoothing: antialiased;
    background: #fbfbfd;
}

html.dark-boot, html.dark-boot body {
    background: #0a0c11;
    color: #e8eaf0;
}

* {
    box-sizing: border-box;
}

::selection {
    background: rgba(66, 105, 208, 0.25);
}

/* ----- Boot screen ----- */

.boot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 100vh;
    font-family: var(--doc-sans);
}

/* The loading logo repeats the hover turn (.rio-logo below), resting in profile between turns. It turns
   at once, since a cached load shows this screen for only about a second. */
.boot .rio-logo-side { animation: boot-logo-side 2.4s step-end infinite; }
.boot .rio-logo-quarter { animation: boot-logo-quarter 2.4s step-end infinite; }
.boot .rio-logo-front { animation: boot-logo-front 2.4s step-end infinite; }
.boot .rio-logo-eyes { animation: boot-logo-blink 2.4s ease-in-out infinite; }

@keyframes boot-logo-side {
    0% { opacity: 1; }
    4% { opacity: 0; }
    58%, 100% { opacity: 1; }
}

@keyframes boot-logo-quarter {
    0% { opacity: 0; }
    4% { opacity: 1; }
    8% { opacity: 0; }
    54% { opacity: 1; }
    58%, 100% { opacity: 0; }
}

@keyframes boot-logo-front {
    0% { opacity: 0; }
    8% { opacity: 1; }
    54%, 100% { opacity: 0; }
}

@keyframes boot-logo-blink {
    0%, 20%, 28%, 100% { transform: none; }
    24% { transform: scaleY(0.1); }
}

.boot-title {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.boot-bar {
    width: 180px;
    height: 4px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(127, 137, 160, 0.2);
}

.boot-bar span {
    display: block;
    width: var(--blazor-load-percentage, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4269d0, #efb118);
    transition: width 0.15s;
}

.loading-progress-text {
    color: #7c86a6;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Over a prerendered page the boot screen is gone: a thin bar at the top shows that the page is not
   interactive yet. Not with the boot screen (it has its own bar); fades out once Blazor has started. */
.boot-progress {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: 3px;
    pointer-events: none;
    transition: opacity 0.3s;
}

.boot-progress span {
    display: block;
    width: max(8%, var(--blazor-load-percentage, 0%));
    height: 100%;
    background: linear-gradient(90deg, #4269d0, #efb118);
    transition: width 0.15s;
}

body:has(.boot) .boot-progress { display: none; }
html.app-started .boot-progress { opacity: 0; }

/* ----- Shell ----- */

.site {
    min-height: 100vh;
    background: var(--doc-bg);
    color: var(--doc-text);
}

.site a {
    color: var(--doc-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 60px;
    padding: 0 20px;
    border-bottom: 1px solid var(--doc-border);
    background: var(--doc-header);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.site .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 4px;
    color: var(--doc-text);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand b {
    font-weight: 700;
}

.brand .rio-logo {
    border-radius: 8px;
}

.badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--doc-accent-soft);
    color: var(--doc-accent);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.site a.badge {
    color: var(--doc-accent);
    text-decoration: none;
}

.site a.badge:hover {
    text-decoration: underline;
}

.spacer {
    flex: 1;
}

.header-nav {
    display: flex;
    gap: 2px;
    margin-right: 6px;
}

.site .header-nav a {
    padding: 7px 12px;
    border-radius: 8px;
    color: var(--doc-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.site .header-nav a:hover {
    background: var(--doc-surface-2);
    color: var(--doc-text);
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.site .icon-button {
    color: var(--doc-muted);
}

.site .icon-button:hover {
    border-color: var(--doc-border);
    background: var(--doc-surface-2);
    color: var(--doc-text);
}

.site .menu {
    display: none;
}

/* ----- Buttons ----- */

.site .button, .site .doc button:not(.code-copy, .rio-chart button) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--doc-border-strong);
    border-radius: 9px;
    background: var(--doc-surface);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    color: var(--doc-text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.site .button:hover, .site .doc button:not(.code-copy, .rio-chart button):hover {
    border-color: var(--doc-accent);
    color: var(--doc-text);
}

.site .button {
    padding: 11px 20px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 600;
}

.site .button.primary {
    border-color: transparent;
    background: linear-gradient(180deg, #4f76e0, #3a5cc4);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 20px -8px rgba(58, 92, 196, 0.7);
    color: #fff;
}

.site .button.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 12px 26px -8px rgba(58, 92, 196, 0.8);
    color: #fff;
}

/* ----- Docs layout ----- */

.site-body {
    display: flex;
    max-width: 1320px;
    margin: 0 auto;
}

.sidebar {
    position: sticky;
    top: 60px;
    flex: none;
    width: 248px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 28px 14px 32px 20px;
}

.nav-group {
    margin: 22px 10px 6px;
    color: var(--doc-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.nav-group:first-child {
    margin-top: 0;
}

.site .sidebar a {
    position: relative;
    display: block;
    margin: 1px 0;
    padding: 6px 10px 6px 14px;
    border-radius: 8px;
    color: var(--doc-muted);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.12s, background 0.12s;
}

.site .sidebar a:hover {
    background: var(--doc-surface-2);
    color: var(--doc-text);
}

.site .sidebar a.active {
    background: var(--doc-accent-soft);
    color: var(--doc-accent);
    font-weight: 600;
}

.site .sidebar a.active::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 4px;
    width: 3px;
    border-radius: 3px;
    background: var(--doc-accent);
}

.scrim {
    display: none;
}

/* The home page has no sidebar; it shows the docs menu only on small screens (below). */
@media (min-width: 901px) {
    .is-home .sidebar {
        display: none;
    }
}

.content {
    flex: 1;
    min-width: 0;
    max-width: 960px;
    padding: 40px 48px 56px;
}

.doc {
    animation: page-in 0.35s ease-out;
}

@keyframes page-in {
    from { opacity: 0; transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .doc { animation: none; }
}

.doc h1 {
    margin: 0 0 12px;
    font-size: 38px;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.doc > p.lead {
    margin: 0 0 36px;
    color: var(--doc-muted);
    font-size: 18px;
    line-height: 1.6;
}

.doc > h2 {
    margin: 44px 0 12px;
    padding-top: 8px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.doc p, .doc li {
    line-height: 1.7;
}

.doc li::marker {
    color: var(--doc-muted);
}

.site code {
    padding: 2px 6px;
    border: 1px solid var(--doc-border);
    border-radius: 6px;
    background: var(--doc-inline-code);
    color: var(--doc-text);
    font-family: var(--doc-mono);
    font-size: 0.84em;
}

.site pre {
    margin: 0;
    padding: 16px 18px;
    overflow-x: auto;
    border: 1px solid var(--code-border);
    border-radius: 12px;
    background: var(--code-bg);
    color: var(--code-text);
    font-family: var(--doc-mono);
    font-size: 13px;
    font-variant-ligatures: none;
    line-height: 1.65;
}

.site pre code {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: inherit;
}

/* ----- Code blocks ----- */

.code-block {
    overflow: hidden;
    border: 1px solid var(--code-border);
    border-radius: 12px;
    background: var(--code-bg);
    box-shadow: var(--doc-shadow);
}

.doc > .code-block {
    margin: 16px 0 20px;
}

.code-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 6px 14px;
    border-bottom: 1px solid var(--code-border);
    background: var(--code-bar);
}

.code-lang {
    color: var(--code-muted);
    font-size: 12px;
    font-weight: 500;
}

.code-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: none;
    color: var(--code-muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.code-copy:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.site .code-block pre {
    border: 0;
    border-radius: 0;
}

.tok-comment { color: #6b7596; font-style: italic; }
.tok-tag { color: #7fb4ff; }
.tok-punct { color: #6f7aa0; }
.tok-attr { color: #c5a5ff; }
.tok-str { color: #a5e3a0; }
.tok-kw { color: #ff9bc0; }
.tok-num { color: #ffc56e; }
.tok-type { color: #6fe0d2; }
.tok-fn { color: #ffd98a; }

/* ----- Examples ----- */

.example {
    margin: 40px 0 48px;
    scroll-margin-top: 80px;
}

.example h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.site .example h2 .anchor {
    color: inherit;
    text-decoration: none;
}

.anchor-mark {
    margin-left: 8px;
    color: var(--doc-accent);
    opacity: 0;
    transition: opacity 0.15s;
}

.example h2:hover .anchor-mark {
    opacity: 0.7;
}

.example-text {
    margin-bottom: 16px;
    color: var(--doc-muted);
    font-size: 15px;
}

.example-text p {
    margin: 0 0 6px;
}

.example-card {
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    background: var(--doc-surface);
    box-shadow: var(--doc-shadow);
}

.example-live {
    padding: 20px 22px 16px;
}

.example-code {
    border-top: 1px solid var(--doc-border);
}

.example-code > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    color: var(--doc-muted);
    font-size: 13px;
    font-weight: 500;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.example-code > summary::-webkit-details-marker {
    display: none;
}

.example-code > summary:hover {
    color: var(--doc-text);
}

.chevron {
    transition: transform 0.15s;
}

.example-code[open] .chevron {
    transform: rotate(90deg);
}

.example-code .code-block {
    margin: 0 10px 10px;
    box-shadow: none;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 16px;
}

.note {
    margin: 10px 0 0;
    color: var(--doc-muted);
    font-size: 13px;
}

/* ----- Tables and callouts ----- */

table.docs {
    width: 100%;
    margin: 16px 0 28px;
    overflow: hidden;
    border: 1px solid var(--doc-border);
    border-spacing: 0;
    border-radius: 12px;
    background: var(--doc-surface);
    font-size: 14px;
}

table.docs th, table.docs td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--doc-border);
    text-align: left;
    vertical-align: top;
    line-height: 1.55;
}

table.docs th {
    background: var(--doc-surface-2);
    color: var(--doc-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

table.docs tr:last-child td {
    border-bottom: 0;
}

.callout {
    margin: 20px 0 28px;
    padding: 16px 18px 16px 20px;
    border: 1px solid var(--doc-border);
    border-left: 3px solid var(--doc-accent);
    border-radius: 12px;
    background: linear-gradient(90deg, var(--doc-accent-soft), transparent 70%), var(--doc-surface);
    font-size: 14.5px;
    line-height: 1.65;
}

/* ----- Pager and footer ----- */

.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 56px;
}

.site .pager-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    background: var(--doc-surface);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.site .pager-link:hover {
    border-color: var(--doc-accent);
    box-shadow: var(--doc-shadow);
}

.pager-link span {
    color: var(--doc-muted);
    font-size: 12px;
}

.pager-link b {
    color: var(--doc-text);
    font-size: 15px;
    font-weight: 600;
}

.pager-link.next {
    grid-column: 2;
    text-align: right;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    margin-top: 48px;
    padding: 16px 0;
    border-top: 1px solid var(--doc-border);
    color: var(--doc-muted);
    font-size: 13px;
}

.footer-meta {
    color: var(--doc-muted);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

/* ----- About ----- */

.about-intro {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0 0 36px;
    padding: 24px 28px;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    background:
        radial-gradient(420px 200px at 0% 0%, rgba(239, 177, 24, 0.16), transparent 70%),
        radial-gradient(420px 220px at 100% 100%, var(--doc-accent-soft), transparent 70%),
        var(--doc-surface);
    box-shadow: var(--doc-shadow);
}

.about-intro .lead {
    margin: 0;
    color: var(--doc-text);
    font-size: 18px;
    line-height: 1.6;
}

.about-logo {
    flex: none;
}

.about-logo .rio-logo {
    display: block;
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(239, 177, 24, 0.35);
}

/* Rio turns to greet the reader once when the page opens (the loading screen's turn, run once), and again on
   hover (the header's turn). The hover rule keeps the greeting first in its list, so leaving the logo does not
   replay the greeting. */
.about-logo .rio-logo-side { animation: boot-logo-side 2.4s step-end 0.5s; }
.about-logo .rio-logo-quarter { animation: boot-logo-quarter 2.4s step-end 0.5s; }
.about-logo .rio-logo-front { animation: boot-logo-front 2.4s step-end 0.5s; }
.about-logo .rio-logo-eyes { animation: boot-logo-blink 2.4s ease-in-out 0.5s; }

.about-logo:hover .rio-logo-side { animation: boot-logo-side 2.4s step-end 0.5s, rio-logo-side 1.5s step-end; }
.about-logo:hover .rio-logo-quarter { animation: boot-logo-quarter 2.4s step-end 0.5s, rio-logo-quarter 1.5s step-end; }
.about-logo:hover .rio-logo-front { animation: boot-logo-front 2.4s step-end 0.5s, rio-logo-front 1.5s step-end; }
.about-logo:hover .rio-logo-eyes { animation: boot-logo-blink 2.4s ease-in-out 0.5s, rio-logo-blink 1.5s ease-in-out; }

@media (prefers-reduced-motion: reduce) {
    .about-logo .rio-logo-side,
    .about-logo .rio-logo-quarter,
    .about-logo .rio-logo-front,
    .about-logo .rio-logo-eyes {
        animation: none;
    }

    .about-logo:hover .rio-logo-side { animation: none, rio-logo-side 1.5s step-end; }
    .about-logo:hover .rio-logo-quarter { animation: none, rio-logo-quarter 1.5s step-end; }
    .about-logo:hover .rio-logo-front { animation: none, rio-logo-front 1.5s step-end; }
    .about-logo:hover .rio-logo-eyes { animation: none, rio-logo-blink 1.5s ease-in-out; }
}

@media (max-width: 600px) {
    .about-intro {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .about-logo .rio-logo {
        width: 72px;
        height: 72px;
        border-radius: 16px;
    }
}

.site .footer-meta a {
    color: inherit;
    text-decoration: none;
}

.site .footer-meta a:hover {
    color: var(--doc-text);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--doc-text);
    font-weight: 600;
}

.footer-brand .rio-logo {
    border-radius: 5px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.site .footer-links a {
    color: var(--doc-muted);
    text-decoration: none;
}

.site .footer-links a:hover {
    color: var(--doc-text);
}

/* ----- Home ----- */

.home {
    overflow-x: clip;
}

.home .site-footer {
    width: calc(100% - 32px);
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 16px 0 24px;
}

.hero {
    position: relative;
    padding: 32px 24px 56px;
}

.hero-glow {
    position: absolute;
    inset: -60px 0 0;
    z-index: 0;
    background:
        radial-gradient(600px 340px at 18% 18%, rgba(66, 105, 208, 0.16), transparent 70%),
        radial-gradient(520px 320px at 82% 30%, rgba(239, 177, 24, 0.14), transparent 70%);
    pointer-events: none;
}

.hero-glow::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--doc-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--doc-border) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 20%, transparent 75%);
    opacity: 0.55;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    align-items: center;
    gap: 56px;
    max-width: 1200px;
    margin: 0 auto;
}

.site .pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 5px 12px 5px 10px;
    border: 1px solid var(--doc-border);
    border-radius: 999px;
    background: var(--doc-surface);
    box-shadow: var(--doc-shadow);
    color: var(--doc-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s;
}

.site .pill:hover {
    border-color: var(--doc-accent);
}

.pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--doc-amber);
    box-shadow: 0 0 0 3px rgba(239, 177, 24, 0.25);
}

/* FocusOnNavigate focuses the page's heading (for screen readers); it is not a control, so no focus ring. */
h1:focus {
    outline: none;
}

.hero h1 {
    margin: 0 0 20px;
    font-size: clamp(40px, 5.6vw, 64px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.04;
}

.gradient-text {
    background: linear-gradient(100deg, #4269d0 10%, #7a5af5 50%, #efb118 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dark .gradient-text {
    background-image: linear-gradient(100deg, #86a6ff 10%, #b39bff 50%, #ffc94a 95%);
}

.hero-lead {
    max-width: 520px;
    margin: 0 0 30px;
    color: var(--doc-muted);
    font-size: 18px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.code-block.install {
    max-width: 460px;
    margin-top: 28px;
}

.hero-visual {
    position: relative;
}

.hero-visual::before {
    content: "";
    position: absolute;
    inset: 8% -4% -6% 6%;
    z-index: -1;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(66, 105, 208, 0.35), rgba(239, 177, 24, 0.3));
    filter: blur(50px);
    opacity: 0.6;
}

.window {
    overflow: hidden;
    border: 1px solid var(--doc-border);
    border-radius: 16px;
    background: var(--doc-surface);
    box-shadow: var(--doc-shadow-lg);
}

.window-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--doc-border);
    background: var(--doc-surface-2);
}

.window-bar i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--doc-border-strong);
}

.window-bar span {
    margin-left: 8px;
    color: var(--doc-muted);
    font-family: var(--doc-mono);
    font-size: 12px;
}

.window-body {
    padding: 18px 18px 12px;
}

.hero-hint {
    margin: 14px 0 0;
    color: var(--doc-muted);
    font-size: 13px;
    text-align: center;
}

.band {
    padding: 56px 24px;
}

.band-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section-head {
    max-width: 640px;
    margin-bottom: 32px;
}

.section-head h2, .split-copy h2, .cta h2 {
    margin: 0 0 10px;
    font-size: clamp(28px, 3.2vw, 36px);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.section-head p, .split-copy p, .cta p {
    margin: 0;
    color: var(--doc-muted);
    font-size: 17px;
    line-height: 1.6;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.site .tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 16px 14px;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    background: var(--doc-surface);
    box-shadow: var(--doc-shadow);
    color: var(--doc-text);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.site .tile:hover {
    border-color: var(--doc-border-strong);
    box-shadow: var(--doc-shadow-lg);
    transform: translateY(-3px);
}

.tile .rio-chart {
    pointer-events: none;
}

.tile-label {
    font-size: 14px;
    font-weight: 600;
}

.tile-label span {
    display: inline-block;
    color: var(--doc-accent);
    transition: transform 0.2s;
}

.tile:hover .tile-label span {
    transform: translateX(3px);
}

/* The gallery page: three tiles a row in the narrower docs column. */
.chart-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 28px;
}

/* Gallery tiles show tooltips; a click still follows the tile's link. */
.chart-gallery .tile .rio-chart {
    pointer-events: auto;
}

.gallery-sparks {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 12px;
    height: 170px;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.site .feature {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    background: var(--doc-surface);
    color: var(--doc-muted);
    font-size: 14.5px;
    line-height: 1.6;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.site .feature:hover {
    border-color: var(--doc-border-strong);
    box-shadow: var(--doc-shadow);
}

.feature b {
    color: var(--doc-text);
    font-size: 16px;
    font-weight: 650;
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 6px;
    border-radius: 11px;
    background: var(--doc-accent-soft);
    color: var(--doc-accent);
}

.feature-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 56px;
}

.split-copy .button {
    margin-top: 8px;
}

.checks {
    margin: 22px 0 24px;
    padding: 0;
    list-style: none;
}

.checks li {
    position: relative;
    margin: 0 0 10px;
    padding-left: 30px;
    font-size: 15px;
}

.checks li::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--doc-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.5L14 7.5' fill='none' stroke='%234f76e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}

.split-code .code-block {
    box-shadow: var(--doc-shadow-lg);
}

.split-code pre {
    font-size: 14px;
}

/* The three outputs on the start page: Blazor, server, AI. */
.outputs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.output {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    background: var(--doc-surface);
}

.output h3 {
    margin: 0;
    font-size: 18px;
}

.output p {
    margin: 0;
    color: var(--doc-muted);
    font-size: 14px;
    line-height: 1.55;
}

.output .code-block {
    margin: 0;
}

.output .code-block pre {
    font-size: 12.5px;
}

.site .output-package {
    align-self: flex-start;
    text-decoration: none;
}

.output-package code {
    font-size: 13px;
}

.output > a {
    margin-top: auto;
    font-weight: 600;
    text-decoration: none;
}

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

.packages {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.package {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    background: var(--doc-surface);
    color: var(--doc-muted);
    font-size: 14px;
    line-height: 1.55;
}

.site a.package {
    color: var(--doc-muted);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.site a.package:hover {
    border-color: var(--doc-border-strong);
    box-shadow: var(--doc-shadow-lg);
    transform: translateY(-3px);
}

.site .package code {
    align-self: flex-start;
    border: 0;
    background: var(--doc-accent-soft);
    color: var(--doc-accent);
    font-weight: 500;
}

.cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 40px 44px;
    border: 1px solid var(--doc-border);
    border-radius: 22px;
    background:
        radial-gradient(400px 200px at 0% 0%, rgba(66, 105, 208, 0.14), transparent 70%),
        radial-gradient(400px 200px at 100% 100%, rgba(239, 177, 24, 0.14), transparent 70%),
        var(--doc-surface);
}

.cta p {
    max-width: 560px;
}

/* ----- Playground ----- */

.spec-editor {
    position: relative;
    display: grid;
    min-height: 260px;
    border: 1px solid var(--code-border);
    border-radius: 12px;
    background: var(--code-bg);
}

.spec-editor:focus-within {
    outline: 2px solid var(--doc-accent);
    outline-offset: 1px;
}

/* The pre and the textarea share one grid cell and identical text metrics. */
.site .spec-editor pre, .spec-editor textarea {
    grid-area: 1 / 1;
    margin: 0;
    padding: 14px 16px;
    border: 0;
    border-radius: 0;
    background: none;
    font: 13px/1.6 var(--doc-mono);
    font-variant-ligatures: none;
    letter-spacing: normal;
    tab-size: 2;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.site .spec-editor pre {
    overflow: hidden;
    color: var(--code-text);
    pointer-events: none;
}

.spec-editor textarea {
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: transparent;
    caret-color: #fff;
    outline: none;
    resize: none;
}

.spec-editor textarea::selection {
    background: rgba(134, 166, 255, 0.35);
    color: transparent;
}

.examples-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* The datasets the playground's definitions can read: a tab per dataset, what it is, a few rows. */
.spec-data {
    margin-bottom: 14px;
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    background: var(--doc-surface);
    overflow: hidden;
}

.spec-data-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--doc-border);
    background: var(--doc-surface-2);
}

.spec-data-label {
    margin-right: 4px;
    color: var(--doc-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.spec-data-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--doc-muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.spec-data-tabs button.active {
    border-color: var(--doc-border-strong);
    background: var(--doc-surface);
    color: var(--doc-text);
}

.spec-data-used {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--doc-accent-soft);
    color: var(--doc-accent);
    font-size: 11px;
    font-weight: 600;
}

.spec-data-about {
    margin: 0;
    padding: 10px 14px 6px;
    font-size: 13.5px;
    line-height: 1.55;
}

.spec-data-count {
    margin-left: 6px;
    color: var(--doc-muted);
    white-space: nowrap;
}

.spec-data-table {
    overflow-x: auto;
}

.spec-data-table table {
    width: 100%;
    border-spacing: 0;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.spec-data-table th, .spec-data-table td {
    padding: 6px 10px;
    border-top: 1px solid var(--doc-border);
    text-align: left;
    white-space: nowrap;
}

.spec-data-table th {
    font-weight: 400;
}

.spec-data-type {
    margin-left: 4px;
    color: var(--doc-muted);
    font-size: 11px;
}

.spec-data-more {
    margin: 0;
    padding: 6px 14px 8px;
    border-top: 1px solid var(--doc-border);
    color: var(--doc-muted);
    font-size: 12px;
}

.spec-messages {
    margin: 10px 0 0;
    padding-left: 20px;
    color: var(--doc-muted);
    font-size: 13px;
}

.spec-messages.errors {
    color: #e5484d;
}

.site select {
    padding: 6px 10px;
    border: 1px solid var(--doc-border-strong);
    border-radius: 8px;
    background: var(--doc-surface);
    color: var(--doc-text);
    font: inherit;
    font-size: 13px;
}

/* ----- Small screens ----- */

@media (max-width: 1080px) {
    .gallery, .packages {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .site .menu {
        display: inline-grid;
    }

    .header-nav, .badge {
        display: none;
    }

    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        z-index: 25;
        border-right: 1px solid var(--doc-border);
        background: var(--doc-surface);
        box-shadow: var(--doc-shadow-lg);
        transform: translateX(-105%);
        transition: transform 0.22s ease;
    }

    .sidebar.open {
        transform: none;
    }

    .scrim.open {
        position: fixed;
        inset: 60px 0 0;
        z-index: 24;
        display: block;
        background: rgba(10, 12, 17, 0.35);
    }

    .content {
        padding: 28px 16px 40px;
    }

    .doc h1 {
        font-size: 30px;
    }

    .hero {
        padding: 24px 16px 32px;
    }

    .hero-inner, .split {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .band {
        padding: 40px 16px;
    }

    .cta {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px 24px;
    }

    .site-header {
        padding: 0 12px;
    }
}

@media (max-width: 560px) {
    .gallery, .packages, .features {
        grid-template-columns: minmax(0, 1fr);
    }

    .pager {
        grid-template-columns: minmax(0, 1fr);
    }

    .pager-link.next {
        grid-column: 1;
    }

    .example-live {
        padding: 14px 12px 10px;
    }
}

.playground {
    padding: 18px;
}

.playground .example-live {
    padding: 4px 4px 0;
}

/* Try it: the JSON on the left, the chart and messages on the right; stacked on small screens. */
.try-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.try-output {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.playground > .example-code {
    margin-top: 14px;
}

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

/* Dashboards page: the editor preview, your own data and the page's data. */
.under-development {
    margin-top: 4px;
}

.your-data, .dashboard-data {
    margin-bottom: 12px;
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    background: var(--doc-surface);
}

.your-data > summary, .dashboard-data > summary {
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 500;
}

.dashboard-data > .spec-data {
    margin: 0;
    border: 0;
    border-top: 1px solid var(--doc-border);
    border-radius: 0 0 12px 12px;
}

.spec-upload {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--doc-border);
}

.spec-upload .spec-data-about {
    padding: 0;
}

.spec-upload summary {
    cursor: pointer;
    color: var(--doc-muted);
    font-size: 13px;
}

/* A drop zone for a file; the transparent file input covers it, so clicks, the keyboard and drops reach it. */
.file-drop {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2px 12px;
    padding: 14px 16px;
    border: 1.5px dashed var(--doc-border-strong);
    border-radius: 12px;
    background: var(--doc-bg);
    color: var(--doc-muted);
    transition: border-color 0.15s, background-color 0.15s;
}

.file-drop svg {
    grid-row: span 2;
    color: var(--doc-accent);
}

.file-drop-text {
    color: var(--doc-text);
    font-size: 14px;
}

.file-drop-text strong {
    color: var(--doc-accent);
    font-weight: 600;
}

.file-drop-text span {
    color: var(--doc-muted);
}

.file-drop-hint {
    font-size: 12px;
}

.file-drop:hover, .file-drop:focus-within {
    border-color: var(--doc-accent);
    background: var(--doc-accent-soft);
}

.file-drop:focus-within {
    outline: 2px solid var(--doc-accent);
    outline-offset: 2px;
}

.file-drop.has-file {
    border-style: solid;
}

.file-drop-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-drop-input::file-selector-button {
    cursor: pointer;
}

.spec-paste {
    display: block;
    width: 100%;
    min-height: 120px;
    margin: 8px 0;
    padding: 8px 10px;
    border: 1px solid var(--doc-border-strong);
    border-radius: 8px;
    background: var(--doc-bg);
    color: var(--doc-text);
    font: 12px/1.5 var(--doc-mono);
    box-sizing: border-box;
}

/* ----- Property editor (Editor/) ----- */

.pe {
    display: grid;
    gap: 2px;
    font-size: 13px;
}

.pe-search, .pe-input input, .pe-input select {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid var(--doc-border-strong);
    border-radius: 8px;
    background: var(--doc-surface);
    color: var(--doc-text);
    font: inherit;
    font-size: 13px;
}

.pe-search {
    margin-bottom: 6px;
}

.pe-heading {
    margin: 14px 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--doc-muted);
}

.pe-row {
    display: grid;
    grid-template-columns: minmax(90px, 2fr) minmax(0, 3fr);
    gap: 2px 10px;
    align-items: center;
    padding: 5px 6px;
    border-radius: 8px;
}

.pe-row:hover {
    background: var(--doc-accent-soft);
}

.pe-label {
    font-family: var(--doc-mono);
    font-size: 12px;
    color: var(--doc-muted);
    overflow-wrap: anywhere;
}

.pe-set .pe-label {
    color: var(--doc-accent);
    font-weight: 600;
}

.pe-description {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--doc-muted);
    font-size: 12px;
    line-height: 1.45;
}


.pe-section {
    margin: 4px 0;
    padding: 0 0 0 10px;
    border-left: 2px solid var(--doc-border);
}

.pe-section > summary {
    padding: 6px 0;
    cursor: pointer;
    font-weight: 600;
}

.pe-section > .pe-description {
    margin-bottom: 6px;
}

.pe-count {
    margin-left: 6px;
    color: var(--doc-muted);
    font-weight: 400;
    font-size: 12px;
}

.pe-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.site .doc .pe-tabs button {
    padding: 4px 10px;
    font-size: 13px;
}

.site .doc .pe-tabs button.active {
    border-color: var(--doc-accent);
    color: var(--doc-accent);
}

.pe-item {
    margin: 6px 0;
    padding: 6px;
    border: 1px solid var(--doc-border);
    border-radius: 8px;
}

.pe-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--doc-mono);
    font-size: 12px;
    color: var(--doc-muted);
}

.site .doc button.pe-link {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--doc-accent);
    font-size: 12px;
}

.site .doc button.pe-add {
    margin: 4px 0;
    padding: 4px 10px;
    font-size: 13px;
}

/* Logo hover: the parrot turns to face the viewer, blinks and turns back. The poses are
   swapped with step-end, never faded, so two heads never show at once. It plays even with
   prefers-reduced-motion: nothing moves across the screen, the poses just change. */
.rio-logo {
    flex: none;
}

.rio-logo-quarter,
.rio-logo-front {
    opacity: 0;
}

.rio-logo-eyes {
    transform-box: view-box;
    transform-origin: 148px 102px;
}

.brand:hover .rio-logo-side,
.footer-brand:hover .rio-logo-side {
    animation: rio-logo-side 1.5s step-end;
}

.brand:hover .rio-logo-quarter,
.footer-brand:hover .rio-logo-quarter {
    animation: rio-logo-quarter 1.5s step-end;
}

.brand:hover .rio-logo-front,
.footer-brand:hover .rio-logo-front {
    animation: rio-logo-front 1.5s step-end;
}

.brand:hover .rio-logo-eyes,
.footer-brand:hover .rio-logo-eyes {
    animation: rio-logo-blink 1.5s ease-in-out;
}

@keyframes rio-logo-side {
    0% { opacity: 1; }
    5% { opacity: 0; }
    89%, 100% { opacity: 1; }
}

@keyframes rio-logo-quarter {
    0% { opacity: 0; }
    5% { opacity: 1; }
    12% { opacity: 0; }
    82% { opacity: 1; }
    89%, 100% { opacity: 0; }
}

@keyframes rio-logo-front {
    0% { opacity: 0; }
    12% { opacity: 1; }
    82%, 100% { opacity: 0; }
}

@keyframes rio-logo-blink {
    0%, 40%, 52%, 100% { transform: none; }
    46% { transform: scaleY(0.1); }
}

.site .doc kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 1px 6px;
    border: 1px solid var(--doc-border-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--doc-surface);
    font: inherit;
    font-size: 0.85em;
    line-height: 1.5;
    text-align: center;
}


/* ----- Compact charts page ----- */

.compact-demo {
    display: grid;
    grid-template-columns: auto minmax(120px, 260px) auto;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}

.compact-demo > span, .compact-grid span {
    color: var(--doc-muted);
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    font-size: 13px;
}

.compact-grid span {
    display: block;
    margin-bottom: 4px;
}

.compact-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px 20px;
    font-size: 13px;
}

.compact-stats > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.compact-stats > div > :first-child {
    flex: none;
}

.compact-stats span {
    color: var(--doc-muted);
}

.compact-stats b {
    display: block;
    color: var(--doc-text);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

table.sparkline-table td {
    vertical-align: middle;
    padding-top: 6px;
    padding-bottom: 6px;
}

table.sparkline-table td.num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .compact-demo {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.table-scroll {
    overflow-x: auto;
}

.table-scroll > table.docs {
    margin: 0;
}


/* ----- Languages page ----- */

.language-picker {
    margin-bottom: 12px;
    font-size: 14px;
}

.language-picker select {
    margin-left: 8px;
}

.language-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .language-grid {
        grid-template-columns: 1fr;
    }
}

.language-grid > :first-child {
    grid-column: 1 / -1;
}

table.texts-table td:first-child {
    white-space: nowrap;
}


/* ----- Auto-compact example ----- */

.size-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}

.site .doc .size-picker button.active {
    border-color: var(--doc-accent);
    color: var(--doc-accent);
}

.size-stage {
    min-height: 300px;
}

.size-stage > div {
    outline: 1px dashed var(--doc-border);
    outline-offset: 2px;
}

/* Interaction: hovering a row shows that day's tooltip in the chart above. */
table.hover-table tbody tr {
    cursor: default;
}

table.hover-table tbody tr:hover td {
    background: var(--doc-accent-soft);
}

table.hover-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ----- Dashboards page: a grid of tiles from saved definitions ----- */

.dashboard-demo {
    padding: 16px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-tile {
    min-width: 0;
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    background: var(--doc-surface);
}

.dashboard-tile.editing {
    grid-column: 1 / -1;
    border-color: var(--doc-accent);
}

.dashboard-tile-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px 0 14px;
    font-weight: 600;
    font-size: 14px;
}

.dashboard-tile-head span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site .doc .dashboard-tile-head button {
    padding: 3px 10px;
    font-size: 12px;
}

.dashboard-tile-body {
    padding: 4px 8px 8px;
}

.dashboard-tile.editing .dashboard-tile-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.dashboard-tile-editor {
    padding: 10px;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
}

.dashboard-tile-chart {
    min-width: 0;
}

/* The fields picked make no chart: a quiet placeholder where the chart was. */
.dashboard-tile-empty {
    display: grid;
    place-items: center;
    min-height: 160px;
    margin: 0;
    padding: 16px;
    border: 1px dashed var(--doc-border-strong);
    border-radius: 10px;
    color: var(--doc-muted);
    font-size: 14px;
    text-align: center;
}

.dashboard-tile.editing .dashboard-tile-chart {
    position: sticky;
    top: 76px;
}

.dashboard-actions {
    margin: 12px 0 4px;
}

@media (max-width: 900px) {
    .dashboard-grid, .dashboard-tile.editing .dashboard-tile-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ----- Chart editor (Editor/DefinitionEditor): pick a chart, fill in its data, fine-tune ----- */

.ce {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    font-size: 14px;
}

.ce-step {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.ce-step:first-of-type {
    margin-top: 2px;
}

.ce-step span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--doc-accent-soft);
    color: var(--doc-accent);
    font-size: 12px;
}

.ce-goals {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 6px;
}

.site .doc button.ce-goal.ce-goal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-items: center;
    gap: 4px;
    padding: 10px 4px 8px;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
    background: var(--doc-surface);
    box-shadow: none;
    color: var(--doc-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
}

.ce-goal svg {
    flex: none;
    width: 22px;
    height: 22px;
}

.site .doc button.ce-goal.ce-goal.selected {
    border-color: var(--doc-accent);
    background: var(--doc-accent-soft);
    color: var(--doc-accent);
}

.ce-goal-hint {
    margin-top: 6px !important;
}

.ce-kinds {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.site .doc button.ce-kind {
    padding: 4px 12px;
    border: 1px solid var(--doc-border-strong);
    border-radius: 999px;
    background: var(--doc-surface);
    box-shadow: none;
    color: var(--doc-text);
    font-size: 13px;
    font-weight: 400;
}

.site .doc button.ce-kind.selected {
    border-color: var(--doc-accent);
    background: var(--doc-accent);
    color: var(--doc-surface);
}

/* Data first: the dataset's fields as chips to pick, then cards of the charts that fit them. */
.ce-fields-hint {
    margin: 10px 0 6px !important;
}

.ce-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* A field chip: a toggle button and, on a picked number, its aggregate as a small menu ("# sessions | Sum"). */
.ce-field {
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--doc-border-strong);
    border-radius: 8px;
    background: var(--doc-surface);
}

.site .doc .ce-field > button.ce-field-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--doc-text);
    font-size: 13px;
    font-weight: 400;
}

.ce-field-type {
    min-width: 20px;
    padding: 1px 4px;
    border-radius: 4px;
    background: var(--doc-surface-2);
    color: var(--doc-muted);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.ce-field.picked {
    border-color: var(--doc-accent);
    background: var(--doc-accent-soft);
}

.site .doc .ce-field.picked > button.ce-field-pick {
    color: var(--doc-accent);
    font-weight: 500;
}

.ce-field.picked .ce-field-type {
    background: var(--doc-accent);
    color: var(--doc-surface);
}

.site .doc .ce-field > select {
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0 22px 0 8px;
    border: 0;
    border-left: 1px solid var(--doc-accent);
    border-radius: 0;
    background-color: var(--doc-surface);
    background-position: right 6px center;
    color: var(--doc-accent);
    font-size: 12px;
    font-weight: 600;
}

.ce-counts {
    margin-top: 8px !important;
}

.ce-suggestions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.ce-suggestion {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
    background: var(--doc-surface);
}

.ce-suggestion:hover {
    border-color: var(--doc-border-strong);
}

.ce-suggestion.selected {
    border-color: var(--doc-accent);
    box-shadow: 0 0 0 1px var(--doc-accent);
}

.ce-suggestion-chart {
    height: 84px;
    padding: 6px 8px 0;
    pointer-events: none;
}

.site .doc .ce-suggestion button.ce-pick {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    width: 100%;
    padding: 6px 10px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--doc-text);
    font-size: 13px;
    font-weight: 400;
    text-align: left;
}

/* The whole card is the button. */
.site .doc .ce-suggestion button.ce-pick::after {
    content: "";
    position: absolute;
    inset: 0;
}

.ce-suggestion button strong {
    font-weight: 600;
}

.ce-suggestion.selected button strong {
    color: var(--doc-accent);
}

.ce-suggestion button span {
    overflow: hidden;
    max-width: 100%;
    color: var(--doc-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-more {
    align-items: center;
    margin-top: 8px;
}

.ce-all-charts {
    margin-top: 14px;
}

/* Charts (and goals) the data cannot draw: greyed, with what they need in the hint below. */
.site .doc button.ce-kind:disabled {
    border-style: dashed;
    border-color: var(--doc-border);
    color: var(--doc-muted);
    opacity: 0.6;
    cursor: not-allowed;
}

.site .doc button.ce-goal.ce-goal.unfit:not(.selected) {
    border-style: dashed;
    opacity: 0.55;
}

.ce-unfit {
    margin-top: 6px !important;
}

.ce-row {
    display: grid;
    grid-template-columns: minmax(96px, 2fr) minmax(0, 5fr);
    gap: 2px 12px;
    align-items: center;
    padding: 6px 0;
}

.ce-label {
    font-weight: 500;
}

.ce-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.ce-inputs > select, .ce-inputs > input[type=text], .ce-levels select, .ce-line input {
    flex: 1 1 120px;
    min-width: 0;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid var(--doc-border-strong);
    border-radius: 8px;
    background: var(--doc-surface);
    color: var(--doc-text);
    font: inherit;
    font-size: 13px;
}

.ce-inputs > select.ce-part {
    flex: 0 1 auto;
    background: var(--doc-bg);
}

.ce-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.ce-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--doc-muted);
    font-size: 13px;
}

.ce-hint {
    margin: 0;
    color: var(--doc-muted);
    font-size: 12px;
    line-height: 1.45;
}

.ce-row > .ce-hint {
    grid-column: 2;
}

.ce-warn {
    color: #c2410c;
}

.ce-note {
    margin: 10px 0 0;
    color: var(--doc-muted);
    font-size: 13px;
}

.site .doc button.ce-link {
    justify-self: start;
    padding: 2px 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--doc-accent);
    font-size: 13px;
    font-weight: 400;
}

.ce-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.site .doc .ce-tabs button {
    padding: 4px 10px;
    font-size: 13px;
}

.site .doc .ce-tabs button.active {
    border-color: var(--doc-accent);
    color: var(--doc-accent);
}

.ce-sections {
    border-top: 1px solid var(--doc-border);
}

.ce-section {
    border-bottom: 1px solid var(--doc-border);
}

.ce-section > summary {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 2px;
    cursor: pointer;
    list-style: none;
}

.ce-section > summary::-webkit-details-marker {
    display: none;
}

.ce-section > summary::before {
    content: "›";
    width: 10px;
    color: var(--doc-muted);
    transition: transform 0.15s;
}

.ce-section[open] > summary::before {
    transform: rotate(90deg);
}

.ce-section-label {
    font-weight: 500;
}

.ce-summary {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--doc-muted);
    font-size: 13px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-section-body {
    padding: 0 2px 10px 22px;
}

.ce-all {
    margin-top: 14px;
    border-top: 1px solid var(--doc-border);
}

.ce-all .ce-section-label {
    color: var(--doc-muted);
}

.ce-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    font-size: 13px;
}

.ce-line label {
    display: inline-flex;
    flex: 1 1 140px;
    align-items: center;
    gap: 6px;
    color: var(--doc-muted);
}

@media (max-width: 520px) {
    .ce-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .ce-row > .ce-hint {
        grid-column: 1;
    }
}

