/* アプリケーション共通枠、ヘッダー、本文、フッターの配置を定義する。 */
#app {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    color: #fff;
    background: var(--color-ink);
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(215, 221, 230, 0.9);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.app-header__inner {
    width: min(calc(100% - 2rem), var(--content-width));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
}

.brand img {
    display: block;
    width: auto;
    height: 38px;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-main {
    width: min(calc(100% - 2rem), var(--content-width));
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3.5rem) 0 4rem;
}

.app-main:focus { outline: 0; }

.app-footer {
    padding: 2rem 1rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    background: #fff;
    text-align: center;
}

.app-footer p {
    margin: 1rem 0 0;
    font-size: 0.86rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 1.25rem;
}

.footer-nav a,
.footer-nav button {
    padding: 0.35rem 0;
    border: 0;
    color: var(--color-muted);
    background: transparent;
    cursor: pointer;
    text-decoration: none;
}

.footer-nav a:hover,
.footer-nav button:hover {
    color: var(--color-primary-strong);
    text-decoration: underline;
}

.boot-mask {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--color-muted);
    background: #fff;
}

.boot-mask__logo { width: min(360px, 78vw); }

.boot-mask__spinner,
.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--color-primary-soft);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
    .app-header__inner,
    .app-main {
        width: min(calc(100% - 1.25rem), var(--content-width));
    }

    .app-header__inner { min-height: 60px; }
    .brand img { height: 30px; }
    .app-nav .button { min-height: 40px; padding: 0.45rem 0.65rem; }
}
