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

/* 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 order preview of the “Your own preview” example (App\Livewire\OrderPreview) */
.demo-order-preview { padding: 1rem; }
.demo-order-lines { width: 100%; font-size: 0.875rem; border-collapse: collapse; }
.demo-order-lines th, .demo-order-lines td { padding: 0.375rem 0.5rem; text-align: left; border-bottom: 1px solid rgb(3 7 18 / 0.08); }
.dark .demo-order-lines th, .dark .demo-order-lines td { border-color: rgb(255 255 255 / 0.1); }
.demo-order-lines thead th { font-weight: 500; color: rgb(107 114 128); }
.demo-order-lines tfoot th { font-weight: 600; border-bottom: 0; }
.demo-order-lines .demo-number { text-align: right; font-variant-numeric: tabular-nums; }
.demo-order-ship { margin-top: 1rem; }

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

/* “Show at phone width” on the Phones and narrow windows example (ListStackBelowTickets): the split at 390 px */
.demo-phone-width-toggle { display: block; margin-top: 0.5rem; }
.demo-phone-width-button { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600; color: white; background: var(--primary-600, rgb(79 70 229)); }
.demo-phone-width-button:hover { background: var(--primary-500, rgb(99 102 241)); }
.demo-phone-width-button[aria-pressed="true"] { color: var(--primary-700, rgb(67 56 202)); background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.dark .demo-phone-width-button[aria-pressed="true"] { color: var(--primary-400, rgb(129 140 248)); }
body.demo-phone-width .fi-warp-splitview { max-width: 390px; margin-inline: auto; border-radius: 1.5rem; box-shadow: 0 0 0 8px rgb(17 24 39), 0 10px 30px rgb(0 0 0 / 0.25); overflow: hidden; }
@media (max-width: 40rem) { .demo-phone-width-toggle { 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;
    }
}
