/* --- 認証バー --- */
.auth-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 14px;
}

.auth-bar .user-info-btn {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    color: #333;
}

.auth-bar .user-info-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.auth-bar .user-info-btn::after {
    content: '✎';
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 2px;
}

.auth-bar .user-info-btn:hover::after {
    opacity: 0.7;
}

/* アカウント設定モーダル */
.account-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.account-modal-overlay.show {
    display: flex;
}

.account-modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 20px;
    width: 320px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    animation: modal-slide-in 0.25s ease;
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.account-modal h3 {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.account-modal .account-field {
    margin-bottom: 16px;
}

.account-modal .account-field + #account-avatar-section {
    margin-top: 0;
}

.account-modal .account-field label {
    display: block;
    font-size: 11px;
    color: #999;
    font-weight: 500;
    margin-bottom: 5px;
}

.account-modal .account-field .account-value {
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    font-family: 'Noto Sans JP', sans-serif;
}

.account-modal .account-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.account-modal .account-field input:focus {
    border-color: #c9a96e;
}

.account-delete-section {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.btn-account-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.btn-account-delete:hover {
    color: #e74c3c;
}

.account-modal .account-modal-buttons {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    justify-content: flex-end;
}

.account-modal .btn-account-cancel {
    padding: 8px 18px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.account-modal .btn-account-cancel:hover {
    background: #e0e0e0;
}

.account-modal .btn-account-ok {
    padding: 8px 22px;
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.account-modal .btn-account-ok:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(168, 133, 50, 0.35);
}

.home-screen-guide-modal {
    max-width: 420px;
    padding: 22px;
    max-height: min(
        90vh,
        calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px)
    );
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.home-screen-guide-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.home-screen-guide-kicker {
    color: #165e83;
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 4px;
}

.home-screen-guide-modal h3 {
    text-align: left;
    margin: 0;
}

.home-screen-guide-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.06);
    color: #666;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-screen-guide-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.home-screen-guide-message {
    margin: 0 0 16px;
    color: #3b4548;
    font-size: 14px;
    line-height: 1.7;
}

.home-screen-guide-steps {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.home-screen-guide-step {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border-radius: 8px;
    background: #f7f3eb;
    border: 1px solid rgba(139, 105, 20, 0.1);
}

.home-screen-guide-step span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #c9a96e;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-screen-guide-step p {
    margin: 2px 0 0;
    color: #333;
    font-size: 13px;
    line-height: 1.6;
}

.home-screen-install-btn {
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #165e83, #0f4c6b);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(22, 94, 131, 0.24);
}

.home-screen-install-btn:hover {
    transform: translateY(-1px);
}

.home-screen-guide-note {
    min-height: 18px;
    margin: 12px 0 0;
    color: #667277;
    font-size: 12px;
    line-height: 1.6;
}

.auth-bar .user-info-btn .role-badge {
    background: #c9a96e;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 700;
}

.auth-bar .role-badge.admin {
    background: #e74c3c;
}

.auth-bar .role-badge.premium {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.auth-btn {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.auth-btn.logout {
    font-size: 12px;
    padding: 6px 12px;
    color: #888;
}

/* --- 認証モーダル --- */
.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.auth-modal-overlay.show {
    display: flex;
}

.auth-modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    width: 340px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.auth-modal h3 {
    margin: 0 0 18px;
    text-align: center;
    font-size: 18px;
}

.auth-modal .form-group {
    margin-bottom: 14px;
}

.auth-modal .form-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.auth-modal .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
}

.auth-modal .divider {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin: 14px 0;
    position: relative;
}

.auth-modal .divider::before,
.auth-modal .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}

.auth-modal .divider::before {
    left: 0;
}

.auth-modal .divider::after {
    right: 0;
}

.google-btn-wrapper {
    padding: 20px 0;
}

.google-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.google-btn:hover {
    background: #f5f5f5;
}

.auth-tabs {
    display: flex;
    margin-bottom: 16px;
    border-bottom: 2px solid #eee;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: none;
    font-family: 'Noto Sans JP', sans-serif;
    color: #999;
    transition: all 0.2s;
}

.auth-tab.active {
    color: #333;
    border-bottom: 2px solid #c9a96e;
    margin-bottom: -2px;
}

.auth-error {
    color: #e74c3c;
    font-size: 12px;
    text-align: center;
    margin-top: 8px;
    min-height: 16px;
}

/* --- パスワードリセット・変更 --- */
.forgot-password-link {
    text-align: right;
    margin-top: -4px;
    margin-bottom: 4px;
}

.forgot-password-link a {
    color: #999;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link a:hover {
    color: #c9a96e;
    text-decoration: underline;
}

.btn-change-password {
    width: 100%;
    padding: 8px 14px;
    background: #f5f5f5;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
    text-align: left;
}

.btn-change-password:hover {
    border-color: #c9a96e;
    color: #333;
    background: #fdf8ef;
}

.auth-checkbox-group,
.account-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.auth-checkbox-group input[type='checkbox'],
.account-checkbox-group input[type='checkbox'] {
    width: 16px;
    height: 16px;
    accent-color: #c9a96e;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-checkbox-group label,
.account-checkbox-group label {
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
}
