/**
 * Figma フレーム対応
 * - frame-home: ページ外周（PC は左右 #fff、中央にスマホ幅カラム）
 * - frame-body: Body フレーム（背景 #FFFDFB、TopBar + スクロール + BottomNav）
 * - frame-azure-shift: 勤怠確認 (Azure Shift)（背景 #F8F6F5）
 */

:root {
    --frame-max: 390px;
    --frame-bg-body: #fffdfb;
    --frame-bg-azure: #f8f6f5;
    --frame-bg-page: #ffffff;
    --frame-main: #e17713;
    --frame-text: #191c21;
    --frame-text-sub: #424752;
    --frame-surface: #ffffff;
    --frame-sub1: #fdf2e7;
    --frame-sub2: #efefef;
    --frame-gray: #c1c1c1;
    --frame-shadow-main: 0 4px 4px rgba(0, 0, 0, 0.04);
    --frame-shadow-bar: 0 1px 2px rgba(0, 0, 0, 0.05);
    --frame-shadow-nav: 0 -8px 24px rgba(225, 119, 19, 0.08);
    --frame-font-display: "Plus Jakarta Sans", "Noto Sans JP", sans-serif;
    --frame-top-h: 64px;
    --frame-bottom-h: 88px;
    --frame-safe-top: env(safe-area-inset-top, 0px);
}

/* --- ページ全体（Home の外周） ---
 * frame-page はラッパー div に付くため、body 直下のベースは body に適用する */
body {
    margin: 0;
    background: var(--frame-bg-page);
    padding-bottom: 0;
    font-family: "Noto Sans JP", sans-serif;
    color: var(--frame-text);
    -webkit-font-smoothing: antialiased;
}

.frame-home {
    max-width: var(--frame-max);
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    box-sizing: border-box;
}

/* Home 内の Azure シフト（二重 max-width を防ぐ） */
.frame-home>.frame-azure-shift {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.frame-azure-shift {
    max-width: var(--frame-max);
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    background: var(--frame-bg-azure);
}

/* --- Body フレーム（ポータル home） --- */
.frame-body {
    min-height: 100vh;
    background: var(--frame-bg-body);
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

/* ログイン等：ボトムナビ無し */
.frame-body--solo {
    padding-bottom: 0;
}

/* メインスクロール領域（固定ヘッダー・フッター分） */
.frame-body__main {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    padding: calc(var(--frame-top-h) + 8px + var(--frame-safe-top)) 20px 24px;
    padding-bottom: calc(var(--frame-bottom-h) + 16px);
}

.frame-page--login .frame-body__main,
.frame-body--solo .frame-body__main {
    padding-bottom: 32px;
}

/* --- 勤怠確認メイン --- */
.frame-azure-shift__main {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    padding: calc(var(--frame-top-h) + 8px + var(--frame-safe-top)) 20px 24px;
    padding-bottom: calc(var(--frame-bottom-h) + 16px);
}

/* --- Top App Bar（Header - TopAppBar） --- */
.app-top-bar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: min(100%, var(--frame-max));
    min-height: var(--frame-top-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(10px + var(--frame-safe-top)) 16px 10px 12px;
    box-sizing: border-box;
    background: var(--frame-surface);
    border-bottom: 1px solid var(--frame-sub2);
    box-shadow: var(--frame-shadow-bar);
    backdrop-filter: blur(24px);
}

.app-top-bar__start {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.app-top-bar__logo {
    display: block;
    width: 44px;
    height: auto;
}

.app-top-bar__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--frame-main);
    text-decoration: none;
    transition: background 0.15s ease;
}

.app-top-bar__back:hover {
    background: var(--frame-sub1);
}

.app-top-bar__back .bi {
    font-size: 1.35rem;
    line-height: 1;
}

.app-top-bar__back--menu .bi {
    font-size: 1.5rem;
}

.app-top-bar__title {
    flex: 1;
    min-width: 0;
    font-family: var(--frame-font-display);
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--frame-text);
}

.app-top-bar__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.app-top-bar__link {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--frame-main);
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-top-bar__link:hover {
    background: var(--frame-sub1);
    color: #c9690f;
}

.app-top-bar__end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 0;
    min-width: 0;
}

/* Figma「Header - TopAppBar」: 左＝アバター＋ベル、右＝リンク集 */
.app-top-bar--figma {
    justify-content: space-between;
    gap: 8px;
}

.app-top-bar--figma .app-top-bar__start {
    gap: 6px;
}

.app-top-bar__links-trigger {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 52px;
    padding: 4px 8px;
    margin: 0;
    border: none;
    border-radius: 16px 16px 0 0;
    background: transparent;
    color: var(--frame-main);
    font-family: inherit;
    font-size: 0.625rem;
    font-weight: 400;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.app-top-bar__links-trigger:hover {
    background: rgba(253, 242, 231, 0.65);
}

.app-top-bar__links-trigger .bi {
    font-size: 1.25rem;
    line-height: 1;
}

.app-top-bar__links-trigger-label {
    white-space: nowrap;
}

.app-modal__panel--links {
    width: min(100%, 360px);
}

.app-links-modal__stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.app-links-modal__card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 14px 14px 12px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(25, 28, 33, 0.06);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.05s ease;
}

.app-links-modal__card:hover {
    box-shadow: 0 14px 36px rgba(25, 28, 33, 0.1);
}

.app-links-modal__card:active {
    transform: scale(0.99);
}

.app-links-modal__icon-wrap {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--frame-sub1);
    color: var(--frame-main);
    font-size: 1.35rem;
}

.app-links-modal__icon-wrap--google-photos {
    background: transparent;
    overflow: hidden;
}

.app-links-modal__icon-img {
    width: 48px;
    height: 48px;
    display: block;
    border-radius: 12px;
    object-fit: cover;
}

.app-links-modal__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.app-links-modal__card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--frame-text);
}

.app-links-modal__card-desc {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--frame-text-sub, #424752);
}

.attendance-soon-page {
    width: 100%;
    box-sizing: border-box;
}

.attendance-soon {
    text-align: center;
    padding: 2rem 1rem 3rem;
}

.attendance-soon__eyebrow {
    margin: 0 0 8px;
    font-family: var(--frame-font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--frame-main);
}

.attendance-soon__title {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--frame-text);
}

.attendance-soon__lead {
    margin: 0 0 8px;
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--frame-text-sub);
}

.attendance-soon__hint {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--frame-text-sub);
}

.app-top-bar__news {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--frame-main);
    text-decoration: none;
    transition: background 0.15s ease;
}

.app-top-bar__news:hover {
    background: var(--frame-sub1);
}

.app-top-bar__news .bi {
    font-size: 1.25rem;
    line-height: 1;
}

.app-top-bar__news-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.625rem;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: #dc2626;
    border-radius: 999px;
    box-sizing: border-box;
}

.app-top-bar__news-badge[hidden] {
    display: none !important;
}

.app-top-bar__user-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.app-top-bar__user-btn:focus-visible {
    outline: 2px solid var(--frame-main);
    outline-offset: 2px;
}

.app-modal[hidden] {
    display: none !important;
}

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0));
    box-sizing: border-box;
}

@media (min-width: 400px) {
    .app-modal {
        align-items: center;
    }
}

.app-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(25, 28, 33, 0.45);
    backdrop-filter: blur(4px);
}

.app-modal__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 340px);
    margin: 0 auto;
    padding: 24px 22px 20px;
    background: var(--frame-surface);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
}

.app-modal__title {
    margin: 0 0 20px;
    font-family: var(--frame-font-display);
    font-size: 1.0625rem;
    font-weight: 700;
    text-align: center;
    color: var(--frame-text);
}

.app-modal__actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: stretch;
}

.app-modal__btn {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-modal__btn--ghost {
    background: var(--frame-sub2);
    color: var(--frame-text);
}

.app-modal__btn--ghost:hover {
    background: #e5e5e5;
}

.app-modal__btn--primary {
    background: var(--frame-main);
    color: #fff;
}

.app-modal__btn--primary:hover {
    background: #c9690f;
    color: #fff;
}

.app-modal__actions--stack {
    flex-direction: column;
    align-items: stretch;
}

.app-modal__btn--block {
    flex: none;
    width: 100%;
}

/* --- Account (/profile) --- */
.frame-profile-page {
    padding-bottom: 2rem;
}

.frame-account-simple {
    max-width: 420px;
    margin: 0 auto;
}

.frame-account-simple__email {
    font-size: 1rem;
    font-weight: 700;
    word-break: break-all;
    margin: 0 0 1rem;
    color: var(--frame-text);
}

.frame-account-simple__note {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--frame-text-sub, #5c5c5c);
    margin: 0;
}

/* --- Bottom Navigation --- */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: min(100%, var(--frame-max));
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0));
    background: var(--frame-surface);
    border-radius: 24px 24px 0 0;
    box-shadow: var(--frame-shadow-nav);
    backdrop-filter: blur(40px);
}

.app-bottom-nav__item {
    flex: 1 1 0;
    min-width: 0;
    max-width: 76px;
    min-height: 46px;
    padding: 4px 4px;
    border: none;
    border-radius: 16px 16px 0 0;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--frame-gray);
    font-family: "Noto Sans JP", sans-serif;
    font-size: 0.625rem;
    font-weight: 400;
    line-height: 1.2;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-bottom-nav__item .bi {
    font-size: 1.15rem;
    line-height: 1;
}

.app-bottom-nav__item:hover {
    color: var(--frame-main);
}

.app-bottom-nav__item--active {
    background: radial-gradient(circle at 50% 50%,
            rgba(255, 251, 223, 1) 40%,
            rgba(255, 255, 255, 1) 100%);
    color: var(--frame-main);
    font-weight: 700;
}

.app-bottom-nav__item--disabled {
    cursor: default;
    opacity: 0.75;
}

.app-bottom-nav__item--disabled:hover {
    color: var(--frame-gray);
}

.app-bottom-nav__icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-bottom-nav__nav-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    pointer-events: none;
}