/* Shared header/footer, based on index-mobile.html. */
body.nsb-site { padding-top: 0; }
.nsb-header, .nsb-footer, .nsb-bottom-nav {
    --blue: #005ba9; --navy: #102f50; --ink: #203347; --muted: #536779;
    --line: #dce5ec; --pale: #eef5fa; --orange: #b94215;
    font-family: 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif;
    line-height: 1.8; text-align: left; letter-spacing: normal;
}
.nsb-header { color: var(--ink); }
.nsb-header *, .nsb-footer *, .nsb-bottom-nav * { box-sizing: border-box; }
.nsb-header a, .nsb-footer a, .nsb-bottom-nav a { color: inherit; text-decoration: none; }
.nsb-header a:hover, .nsb-footer a:hover, .nsb-bottom-nav a:hover { opacity: 1; }
.nsb-header a, .nsb-footer a, .nsb-bottom-nav a, .nsb-header summary, .nsb-footer summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.nsb-header a:focus-visible, .nsb-footer a:focus-visible, .nsb-bottom-nav a:focus-visible, .nsb-header summary:focus-visible, .nsb-footer summary:focus-visible { outline: 3px solid #d5650a; outline-offset: 4px; }
.nsb-header img { display: block; max-width: 100%; height: auto; }
.nsb-header p, .nsb-footer p, .nsb-footer h2 { margin: 0; padding: 0; }
.nsb-footer p { font-weight: 400; }
.nsb-header summary, .nsb-footer summary { cursor: pointer; }
.nsb-wrap { width: min(1120px, calc(100% - 48px)); margin: auto; }
        .nsb-header {
            position: sticky;
            top: 0;
            z-index: 30;
            background: #0a67cd;
            border-bottom: 1px solid var(--line)
        }

        .nsb-header-inner {
            display: flex;
            align-items: center;
            gap: 24px;
            min-height: 82px
        }

        .nsb-brand {
            margin-right: auto;
            min-width: 0
        }

        .nsb-brand img {
            width: 330px
        }

        .nsb-desktop-links {
            display: flex;
            gap: 24px;
            font-size: 14px;
            font-weight: bold;
            color: #fff
        }

        .nsb-desktop-links a {
            padding: 12px 0
        }

        .nsb-menu {
            flex-shrink: 0;
        }

        .nsb-menu>summary {
            color: #fff;
            white-space: nowrap;
            list-style: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            min-height: 48px;
            padding: 10px 16px;
            border: 1px solid var(--line);
            border-radius: 4px;
            font-size: 13px;
            font-weight: bold
        }

        .nsb-menu>summary::-webkit-details-marker {
            display: none
        }

        .nsb-menu-icon {
            width: 20px;
            height: 14px;
            border-top: 2px solid currentColor;
            border-bottom: 2px solid currentColor;
            position: relative
        }

        .nsb-menu-icon:after {
            content: "";
            position: absolute;
            top: 4px;
            width: 20px;
            border-top: 2px solid currentColor
        }

        .nsb-menu[open] .nsb-menu-icon {
            border: 0
        }

        .nsb-menu[open] .nsb-menu-icon:before,
        .nsb-menu[open] .nsb-menu-icon:after {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            width: 24px;
            height: 3px;
            border: 0;
            background: currentColor;
            transform: translate(-50%, -50%) rotate(45deg);
        }

        .nsb-menu[open] .nsb-menu-icon:after {
            transform: translate(-50%, -50%) rotate(-45deg);
        }

        .nsb-menu-panel {
            position: absolute;
            right: 0;
            top: 100%;
            width: min(520px, 100%);
            padding: 24px;
            background: white;
            border: 1px solid var(--line);
            box-shadow: 0 18px 32px #102f5026;
            max-height: calc(100dvh - 160px);
            overflow: auto;
            overscroll-behavior: contain
        }

        .nsb-menu-panel nav {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px
        }

        .nsb-menu-panel nav a {
            background: var(--pale);
            padding: 14px 12px;
            min-height: 48px;
            font-size: 14px;
            font-weight: bold
        }

        .nsb-menu-panel .nsb-menu-note {
            font-size: 12px;
            color: var(--muted);
            margin-top: 18px
        }

        .nsb-footer {
            background: #0a67cd;
            color: white;
            padding: 42px 0 24px
        }

        .nsb-footer-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 40px
        }

        .nsb-footer h2 {
            font-size: 20px;
            margin-bottom: 12px
        }

        .nsb-footer p {
            font-size: 13px
        }

        .nsb-footer a {
            text-decoration: underline;
            text-underline-offset: 4px
        }

        .nsb-phone {
            font-size: 13px;
            font-weight: 500;
            line-height: 1.5;
            display: inline-flex;
            align-items: center;
            min-height: 44px;
            padding: 6px 0
        }

        .nsb-footer details {
            margin-top: 12px
        }

        .nsb-footer summary {
            padding: 10px 0;
            font-size: 14px
        }

        .nsb-footer summary::marker {
            color: #fff
        }

        .nsb-contact-list {
            display: grid;
            gap: 4px
        }

        .nsb-contact-list a {
            padding: 10px 0;
            font-size: 13px
        }

        .nsb-footer .nsb-copyright {
            margin-top: 32px;
            padding-top: 20px;
            border-top: 1px solid #ffffff35;
            font-size: 11px !important;
            color: #c5d8e9
        }

        .nsb-bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 25;
            display: none;
            background: white;
            border-top: 1px solid var(--line);
            padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
            gap: 8px
        }

        .nsb-bottom-nav a {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 52px;
            font-size: 13px;
            font-weight: bold;
            border-radius: 4px
        }

        .nsb-bottom-nav .nsb-visit {
            background: var(--orange);
            color: white;
            flex: 1.3
        }

        .nsb-bottom-nav .nsb-request {
            background: var(--blue);
            color: white;
            flex: 1
        }

        .nsb-text-link {
            color: var(--blue);
            font-size: 14px;
            font-weight: bold;
            min-height: 48px;
            display: inline-flex;
            align-items: center;
            gap: 16px
        }
@media(max-width:1000px) { .nsb-desktop-links { display: none; } }
@media(max-width:760px) {
    body.nsb-site { padding-bottom: calc(69px + env(safe-area-inset-bottom)); }
    .nsb-wrap { width: calc(100% - 36px); }
    .nsb-header-inner { min-height: 70px; gap: 12px; }
    .nsb-brand img { width: 270px; }
    .nsb-menu > summary { padding: 8px; width: 64px; min-height: 50px; flex-direction: column; gap: 5px; font-size: 10px; line-height: 1.2; }
    .nsb-menu-panel { padding: 18px; }
    .nsb-footer { padding-top: 30px; }
    .nsb-footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .nsb-footer h2 { font-size: 17px; }
    .nsb-bottom-nav { display: flex; }
    .nsb-text-link { font-size: 12px; gap: 8px; }
}
/* Inline language selector shared with index-mobile.html. */
.nsb-language-bar { --line: #dce5ec; --navy: #102f50; --muted: #536779; font-family: 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif; line-height: 1.8; }
.nsb-language-bar * { box-sizing: border-box; }
.nsb-language-bar .gtranslate_wrapper { position: static; inset: auto; z-index: auto; display: block; }
        .nsb-language-bar {
            background: #eef5fa;
            border-bottom: 1px solid var(--line);
            padding: 8px 0;
        }

        .nsb-language-inner {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            flex-wrap: nowrap;
            gap: 8px 12px;
        }

        .nsb-language-label {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
            white-space: nowrap;
            font-size: 13px;
            font-weight: bold;
            color: var(--navy);
        }

        .nsb-language-bar .gtranslate_wrapper {
            min-width: 0;
            width: 170px;
            max-width: 100%;
        }

        .nsb-language-bar .gtranslate_wrapper select {
            width: 100%;
            min-height: 40px;
            padding: 6px 10px;
            border: 1px solid #9aafbf;
            border-radius: 4px;
            background: #fff;
            color: #102f50;
            font: inherit;
            font-size: 14px;
            cursor: pointer;
        }

        .nsb-language-bar .gtranslate_wrapper select:focus-visible {
            outline: 3px solid #d5650a;
            outline-offset: 2px;
        }

        .nsb-translation-status {
            font-size: 12px;
            color: var(--muted);
        }

        @media(max-width:760px) {
            .nsb-language-inner { justify-content: space-between; }
        }


.nsb-language-bar select { appearance: auto; -webkit-appearance: menulist; }

/* Match the hero and content widths in the current index.html. */
body.nsb-site {
    --nsb-content-width: 1120px;
    --nsb-content-gutter: 24px;
}

body.nsb-site #main {
    animation: none;
}

body.nsb-site #main > picture {
    position: relative;
    display: block;
    width: min(var(--nsb-content-width), calc(100% - 48px));
    margin-inline: auto;
}

body.nsb-site #main > picture::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #f25d42, #7c4fd2, #1bbe79);
    content: "";
    z-index: 1;
    pointer-events: none;
}

body.nsb-site #main > picture > img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

body.nsb-site .wrapper,
body.nsb-site .wrapper2,
body.nsb-site .request-selector,
body.nsb-site .request-form {
    box-sizing: border-box;
    width: calc(100% - var(--nsb-content-gutter) * 2);
    max-width: var(--nsb-content-width);
    margin-inline: auto;
}

body.nsb-site .wrapper,
body.nsb-site .wrapper2,
body.nsb-site .request-selector {
    padding-inline: 0;
}

/* Remove trailing margins that collapse outside the final background panel.
   Scoped to panels directly before the shared footer; override legacy ID rules. */
body.nsb-site > :is(.bg_access, .bg_about, .bg_guidelines, .bg_request, .guide_bg, .bg_recruitment, .bg_top):has(+ .nsb-footer) > :is(.wrapper, .request-form):last-child,
body.nsb-site > .bg_guidelines:has(+ .nsb-footer) > #request:last-child > .wrapper:last-child,
body.nsb-site > .request-form:has(+ .nsb-footer) {
    margin-bottom: 0 !important;
}

/* Nested forms use the available content width without a second gutter. */
body.nsb-site .wrapper .request-form,
body.nsb-site .wrapper2 .request-form {
    width: 100%;
}

@media (max-width: 760px) {
    body.nsb-site { --nsb-content-gutter: 18px; }
    body.nsb-site #main > picture { width: 100%; }
}
