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

/* "Acting as" switcher in the top bar */
.demo-act-as {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: rgb(75 85 99);
}

.demo-act-as select {
    max-width: 18rem;
    padding: 0.3rem 2rem 0.3rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(209 213 219);
    background-color: white;
    font-size: 0.8125rem;
    color: rgb(17 24 39);
}

.dark .demo-act-as { color: rgb(156 163 175); }
.dark .demo-act-as select { background-color: rgb(17 24 39); border-color: rgb(55 65 81); color: rgb(243 244 246); }

.demo-act-as-current { display: none; }

@media (max-width: 640px) {
    .demo-act-as label { display: none; }
    /* Only the name shows; the real select is laid over it and opens the full list (name — position, department) */
    .demo-act-as { position: relative; }
    .demo-act-as-current { display: block; max-width: 9.5rem; padding: 0.3rem 1.75rem 0.3rem 0.6rem; border: 1px solid rgb(209 213 219); border-radius: 0.5rem; background: white url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 0.4rem center / 1.1rem; color: rgb(17 24 39); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .dark .demo-act-as-current { background-color: rgb(17 24 39); border-color: rgb(55 65 81); color: rgb(243 244 246); }
    .demo-act-as select { position: absolute; inset: 0; width: 100%; max-width: none; opacity: 0; }
    /* The demo's people switcher needs the room more than the search box on a phone */
    .fi-topbar .fi-global-search-field { display: none; }
}

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

/* 申請の画面：メールから答えるページへの案内 */
.demo-email-answer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: 0.75rem; background: color-mix(in oklab, var(--primary-500) 8%, transparent); border: 1px solid color-mix(in oklab, var(--primary-500) 25%, transparent); font-size: 0.875rem; }
.demo-email-answer-icon { width: 1.25rem; height: 1.25rem; color: var(--primary-600); flex-shrink: 0; }
.demo-email-answer a { font-weight: 600; color: var(--primary-600); white-space: nowrap; }

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

/* Above every page: what to try here and what happens */
.demo-page-tip { display: flex; gap: 0.75rem; margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: 0.75rem; font-size: 0.875rem; line-height: 1.5; color: rgb(55 65 81); background: rgb(254 252 232); border: 1px solid rgb(253 230 138); }
.demo-page-tip-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; margin-top: 0.1rem; color: rgb(202 138 4); }
.demo-page-tip strong { margin-inline-end: 0.35rem; color: rgb(17 24 39); }
/* A second and third line of a tip: each on its own line, so one tip does not run several things together */
.demo-page-tip-more { display: block; margin-top: 0.375rem; }
.dark .demo-page-tip { color: rgb(209 213 219); background: rgb(250 204 21 / 0.08); border-color: rgb(250 204 21 / 0.25); }
.dark .demo-page-tip strong { color: white; }

/* Phones: the page's own buttons (Approve, Return, Reject…) come first on full rows, then "View code" below them.
   Without this, "View code" sat beside the buttons and squeezed them into a narrow, ragged column. */
/* "View code" comes after the page's own buttons (Approve, Return, Reject…), not in front of them */
.fi-header-actions-ctn > .fi-ac { order: -1; }
/* The buttons line up with the page heading, also on pages with a long description under it (org chart) */
.fi-header { align-items: flex-start; }
@media (max-width: 639px) {
    .fi-header-actions-ctn { flex-wrap: wrap; }
    .fi-header-actions-ctn > .fi-ac { flex-basis: 100%; }
}

/* Japanese and Chinese break lines between phrases, not inside a word (「承認ルー/ト」) */
.demo-page-tip, .fi-header-subheading, .demo-phrase { word-break: auto-phrase; text-wrap: pretty; }

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