/* Notice bar above the panel */
.demo-notice {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem 1.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.8125rem;
    color: white;
    background: rgb(17 24 39);
}

.demo-notice a {
    color: rgb(253 186 116);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.demo-notice-links {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1rem;
}

/* On a phone the links wrap between links, not inside one */
.demo-notice-links a {
    white-space: nowrap;
}

.demo-notice a.demo-notice-buy {
    color: white;
    font-weight: 600;
}

.demo-notice-lang select {
    padding: 0.1rem 1.6rem 0.1rem 0.5rem;
    font-size: 0.8125rem;
    color: white;
    background-color: rgb(31 41 55);
    border: 1px solid rgb(75 85 99);
    border-radius: 0.375rem;
}

.demo-notice-lang .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

/* Start page guide */
.demo-guide { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.demo-guide li { display: flex; gap: 0.75rem; padding: 1rem; border-radius: 0.75rem; outline: 1px solid rgb(3 7 18 / 0.08); }
.dark .demo-guide li { outline-color: rgb(255 255 255 / 0.1); }
.demo-guide-number { flex-shrink: 0; width: 1.75rem; height: 1.75rem; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8125rem; font-weight: 600; color: white; background: var(--primary-600); }
.demo-guide p { margin-top: 0.25rem; font-size: 0.875rem; color: rgb(75 85 99); }
.dark .demo-guide p { color: rgb(156 163 175); }
.demo-guide a { display: inline-block; margin-top: 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--primary-600); }

/* Japanese headings wrap between phrases, not in the middle of a word (Chrome and Edge; other browsers keep the usual wrap) */
html:lang(ja) :is(h1, h2, h3) {
    word-break: auto-phrase;
}

/* The request meter of the large tree: how long each request took and how much came back */
.demo-meter { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; padding: 0.625rem 0.875rem; border-radius: 0.5rem; font-size: 0.875rem; font-variant-numeric: tabular-nums; background: rgb(3 7 18 / 0.04); }
.dark .demo-meter { background: rgb(255 255 255 / 0.06); }
.demo-meter-waiting, .demo-meter-request { color: rgb(107 114 128); }
.dark .demo-meter-waiting, .dark .demo-meter-request { color: rgb(156 163 175); }
.demo-meter .demo-meter-latest { font-weight: 600; color: var(--primary-600); }

/* The large tree at the top of the start page */
.demo-hero-figures { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin-bottom: 1rem; }
.demo-hero-figures div { display: flex; flex-direction: column; }
.demo-hero-figures strong { font-size: 1.75rem; line-height: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary-600); }
.demo-hero-figures span { font-size: 0.875rem; color: rgb(75 85 99); }
.dark .demo-hero-figures span { color: rgb(156 163 175); }
.demo-hero-try { margin: 1rem 0 0.75rem; font-size: 0.875rem; }
.demo-hero-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1rem; font-size: 0.875rem; font-weight: 600; }
.demo-hero-links a { color: var(--primary-600); }
/* On the large-tree pages the meter stays in the corner while you scroll */
.demo-meter-floating { position: fixed; z-index: 30; right: 1rem; bottom: 1rem; max-width: calc(100vw - 2rem); box-shadow: 0 4px 16px rgb(3 7 18 / 0.12); background: white; outline: 1px solid rgb(3 7 18 / 0.08); }
.dark .demo-meter-floating { background: rgb(24 24 27); outline-color: rgb(255 255 255 / 0.1); }
/* Room at the bottom of the page, so that the meter in the corner doesn't cover the last section */
.fi-main:has(.demo-meter-floating) { padding-bottom: 5rem; }

/* Korean wraps between words, not in the middle of one */
html:lang(ko) { word-break: keep-all; }

@media (max-width: 639px) {
    /* The three figures one under another on a phone */
    .demo-hero-figures { flex-direction: column; gap: 0.5rem; }
    /* The meter in the corner stays one line and appears only once there is a request to show */
    .demo-meter-floating { left: 1rem; right: 1rem; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
    .demo-meter-floating:not(:has([data-meter-request])) { display: none; }
    .demo-meter-floating .demo-meter-request:not(.demo-meter-latest) { display: none; }
}

/* Wide screen: the notice bar stays on one line in every language. A long text is cut with … (the links and the language menu keep their size). */
@media (min-width: 1100px) {
    body .demo-notice {
        flex-wrap: nowrap;
    }

    body .demo-notice > :first-child {
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body .demo-notice-links {
        flex-wrap: nowrap;
        flex-shrink: 0;
    }

    body .demo-notice-lang {
        flex-shrink: 0;
    }
}
