/* 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%);
}

/* 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;
}

/* On a phone: the name, the links and the language menu only */
@media (max-width: 640px) {
    .demo-notice-text {
        display: none;
    }
}

/* Korean: wrap between words, never inside one (a word cut in two reads as a typo). */
html[lang^="ko"] body {
    word-break: keep-all;
    overflow-wrap: anywhere;
}

/* What an example shows and “Try it”, under the page title. Short, and “Try it” can be closed so the split keeps its height */
.demo-example { display: block; max-width: 54rem; font-size: 0.875rem; line-height: 1.45; }
.demo-example code { font-family: ui-monospace, monospace; font-size: 0.9em; font-variant-ligatures: none; overflow-wrap: anywhere; padding: 0 0.2em; border-radius: 0.25rem; background: rgb(3 7 18 / 0.05); }
.dark .demo-example code { background: rgb(255 255 255 / 0.08); }
.demo-example-what { display: block; }
.demo-example-try { display: flex; align-items: flex-start; gap: 0.5rem; margin-top: 0.375rem; }
.demo-example-toggle { flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.125rem 0.5rem; font-weight: 600; font-size: 0.8125rem; white-space: nowrap; color: var(--primary-700); background: color-mix(in oklab, var(--primary-500) 12%, transparent); border-radius: 0.375rem; cursor: pointer; }
.dark .demo-example-toggle { color: var(--primary-300); }
.demo-example-toggle::after { content: ''; width: 0.4rem; height: 0.4rem; margin-left: 0.125rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.demo-example-toggle[aria-expanded="true"]::after { transform: rotate(45deg) translate(-1px, -1px); }
.demo-example-steps { display: block; padding-top: 0.0625rem; color: rgb(55 65 81); }
.dark .demo-example-steps { color: rgb(209 213 219); }

/* The example's text may use the width next to the title (Filament keeps subheadings narrow) */
.fi-header-subheading:has(.demo-example) { max-width: 60rem; }

/* A numbered “Try it” (1. … 2. …): one step per line */
.demo-step { display: block; }

/* Narrow screens: the “Try it” button on top, the steps below it at full width */
@media (max-width: 640px) {
    .demo-example-try { flex-direction: column; align-items: flex-start; gap: 0.375rem; }
    .demo-example-steps { width: 100%; }
}

/* Long menu names (German…) wrap onto up to two lines in the sidebar instead of ending in “…” */
.fi-sidebar-item-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}

/* Keep PHP method arrows as two characters, including in labels and helpers. */
html { font-feature-settings: "calt" 0; }

.demo-guide { display: grid; gap: 2rem; color: rgb(17 24 39); }
.demo-guide h2 { margin-bottom: 1rem; font-weight: 600; }
.demo-guide ul { display: grid; gap: 1rem; list-style: none; }
.demo-guide a { color: var(--primary-700); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.demo-guide p { margin-top: 0.25rem; font-size: 0.875rem; line-height: 1.5; color: rgb(55 65 81); }
.dark .demo-guide { color: rgb(243 244 246); }
.dark .demo-guide a { color: var(--primary-300); }
.dark .demo-guide p { color: rgb(209 213 219); }
@media (min-width: 1024px) { .demo-guide { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.demo-page-space { padding: 2rem; border: 2px dashed #94a3b8; border-radius: .75rem; }
.demo-keys { width: 100%; max-width: 54rem; border-collapse: collapse; font-size: .875rem; }
.demo-keys caption { text-align: start; font-weight: 600; padding-bottom: .75rem; }
.demo-keys th, .demo-keys td { text-align: start; padding: .4rem .75rem; border-bottom: 1px solid #94a3b8; }
.demo-keys th { white-space: nowrap; }
.demo-clipboard { display: grid; gap: .75rem; max-width: 54rem; }
.demo-clipboard label { font-weight: 600; }
.demo-clipboard textarea { border: 1px solid #94a3b8; padding: .75rem; border-radius: .5rem; width: 100%; }
.demo-reset-help { margin-top: .5rem; font-size: .875rem; }
@media (max-width: 640px) { .demo-keys th { white-space: normal; } }

.demo-code-note { max-width: 60rem; font-size: .75rem; line-height: 1.4; color: rgb(107 114 128); }
.dark .demo-code-note { color: rgb(156 163 175); }
.demo-customer-link a { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 640px) {
    .fi-header > div:first-child { flex: 1; min-width: 0; }
    .fi-header.fi-header-has-subheading .fi-header-actions-ctn { align-self: flex-start; }
}
