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

[x-cloak] { display: none !important; }

/*
 * 見本のページ：左に説明（.demo-guide-col）、右に電話の枠（.demo-phone-col）。
 * lg（1024px）以上：枠は画面の右に固定（top は JS が上のバーの下に合わせる）、説明はその分だけ右を空ける。
 * sm〜lg：枠は説明の下。sm 未満（スマホ）：枠の代わりに「アプリを開く」の箱。
 */
.demo-split { display: grid; gap: 2rem; }
.demo-guide-col { display: grid; gap: 1.5rem; align-content: start; min-width: 0; }

@media (min-width: 1024px) {
    /* ページ全体（見出しと View code も）を、右に固定した枠の分だけ空ける */
    .fi-page:has(.demo-phone-col) { padding-right: calc(390px + 20px + 2rem); }
    .demo-phone-col { position: fixed; right: 1.5rem; top: 6rem; z-index: 10; }
}

.demo-intro { font-size: 1rem; line-height: 1.6; color: rgb(55 65 81); max-width: 48rem; }
.dark .demo-intro { color: rgb(209 213 219); }

.demo-example { display: grid; gap: 0.75rem; padding: 1.25rem; border-radius: 0.75rem; background: white; box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); outline: 1px solid rgb(3 7 18 / 0.05); scroll-margin-top: 6rem; }
.dark .demo-example { background: rgb(24 24 27); outline-color: rgb(255 255 255 / 0.1); }
.demo-example-title { display: flex; align-items: center; gap: 0.625rem; font-size: 1.0625rem; font-weight: 600; }
.demo-example-number { flex-shrink: 0; width: 1.625rem; height: 1.625rem; 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-example-what { font-size: 0.9375rem; color: rgb(75 85 99); }
.dark .demo-example-what { color: rgb(156 163 175); }
.demo-example-box { padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.9375rem; line-height: 1.6; }
.demo-example-box h3 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.25rem; }
.demo-example-try { background: rgb(240 249 255); }
.demo-example-try h3 { color: rgb(3 105 161); }
.dark .demo-example-try { background: rgb(12 74 110 / 0.35); }
.dark .demo-example-try h3 { color: rgb(125 211 252); }
.demo-example-try ol { list-style: decimal; padding-left: 1.25rem; display: grid; gap: 0.25rem; }
.demo-example-result { background: rgb(240 253 244); }
.demo-example-result h3 { color: rgb(21 128 61); }
.dark .demo-example-result { background: rgb(20 83 45 / 0.35); }
.dark .demo-example-result h3 { color: rgb(134 239 172); }
.demo-example-note { margin-top: 0.5rem; font-size: 0.875rem; color: rgb(75 85 99); }
.dark .demo-example-note { color: rgb(156 163 175); }
.demo-example-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.demo-example-code summary { cursor: pointer; font-size: 0.875rem; font-weight: 600; color: var(--primary-600); }
.demo-example-code pre { margin-top: 0.5rem; padding: 0.875rem 1rem; overflow-x: auto; border-radius: 0.5rem; font-size: 0.8125rem; line-height: 1.55; color: rgb(243 244 246); background: rgb(17 24 39); font-variant-ligatures: none; }

/* Overview */
.demo-overview-list { list-style: disc; padding-left: 1.25rem; display: grid; gap: 0.375rem; font-size: 0.9375rem; line-height: 1.6; }
.demo-overview-pages { display: grid; gap: 0.75rem; }
.demo-overview-pages li { display: flex; gap: 0.75rem; align-items: flex-start; }
.demo-overview-pages p { font-size: 0.875rem; color: rgb(75 85 99); }
.dark .demo-overview-pages p { color: rgb(156 163 175); }
.demo-overview-page-title { font-weight: 600; color: var(--primary-600); }
.demo-overview-page-title:hover { text-decoration: underline; }
.demo-overview-phone { grid-template-columns: 9rem 1fr; align-items: center; gap: 1.25rem; }
.demo-overview-phone p { font-size: 0.9375rem; margin-top: 0.375rem; }
.demo-overview-qr svg { width: 9rem; height: 9rem; border-radius: 0.5rem; }
.demo-overview-url { font-family: ui-monospace, monospace; font-size: 0.8125rem; color: var(--primary-600); overflow-wrap: anywhere; }

/* 電話の枠 */
.demo-phone-col { display: grid; gap: 0.5rem; justify-items: center; width: calc(390px + 20px); }
.demo-phone-toolbar { display: flex; gap: 0.5rem; }
.demo-phone-widths { display: inline-flex; padding: 0.1875rem; border-radius: 0.5rem; background: rgb(243 244 246); }
.dark .demo-phone-widths { background: rgb(39 39 42); }
.demo-phone-widths button { padding: 0.25rem 0.625rem; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 500; color: rgb(75 85 99); }
.dark .demo-phone-widths button { color: rgb(161 161 170); }
.demo-phone-widths button[aria-pressed="true"] { color: rgb(17 24 39); background: white; box-shadow: 0 1px 2px rgb(0 0 0 / 0.1); }
.dark .demo-phone-widths button[aria-pressed="true"] { color: white; background: rgb(63 63 70); }
.demo-phone-stage { padding: 10px; border-radius: 3rem; background: rgb(17 24 39); box-shadow: 0 0 0 1px rgb(55 65 81), 0 20px 40px -12px rgb(0 0 0 / 0.35); box-sizing: content-box; }
.dark .demo-phone-stage { background: rgb(0 0 0); box-shadow: 0 0 0 1px rgb(82 82 91), 0 20px 40px -12px rgb(0 0 0 / 0.6); }
.demo-phone { position: relative; overflow: hidden; border-radius: 2.4rem; background: white; }
.demo-phone.is-wide { border-radius: 0.75rem; }
.demo-phone iframe { display: block; border: 0; transform-origin: 0 0; background: white; }
.demo-phone-hint { max-width: 390px; text-align: center; font-size: 0.75rem; line-height: 1.4; color: rgb(107 114 128); }
.dark .demo-phone-hint { color: rgb(161 161 170); }

.demo-phone-instead { display: none; }

@media (max-width: 639.98px) {
    .demo-phone-col { display: none; }
    .demo-phone-instead { display: grid; gap: 0.5rem; padding: 1.25rem; border-radius: 0.75rem; background: rgb(240 249 255); font-size: 0.9375rem; }
    .dark .demo-phone-instead { background: rgb(12 74 110 / 0.35); }
    .demo-phone-instead-title { font-weight: 600; }
    .demo-phone-instead-button { display: block; margin-top: 0.25rem; padding: 0.875rem 1rem; border-radius: 0.75rem; text-align: center; font-size: 1.0625rem; font-weight: 600; color: white; background: var(--primary-600); }
    /* スマホでは「アプリを開く」を説明より先に */
    .demo-split { display: flex; flex-direction: column-reverse; }
}

/* 案内のパネルの左のメニュー：長い名前（ドイツ語など）を「…」で切らず、折り返す */
.fi-sidebar-item-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* The card "Buy…" that appears after a few actions sits at the bottom right, where the guide's phone frame has its tab bar:
   it covered the tabs the visitor was trying out. On a wide screen it goes to the bottom left, under the menu. */
@media (min-width: 1024px) {
    .warp-buy-nudge { right: auto; left: 1rem; }
}

/* On a phone, the first thing to see is the button that opens the app (the guide has no phone frame there): the code box
   would push it three screens down. The code is on the wide-screen page and in the README. */
@media (max-width: 767px) {
    .cc { display: none; }
}

/* The guide's page has the phone frame at the right, so the content column is narrow (about 600px): the code box and the picture
   side by side left the code 190px wide and cut it. One under the other, the code has the whole column. */
.cc .cc-cols { grid-template-columns: 1fr; }

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