/* リセットと基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to bottom, #FCAF17, #F58220);
    color: #333;
}

/* アプリコンテナ */
.app-container {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ログイン画面 */
#loginScreen {
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 390px;
    height: auto;
    margin-bottom: 16px;
}

.app-title {
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.app-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

/* ログインフォーム */
.login-form {
    background: #fff;
    padding: 32px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 360px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 8px;
}

.form-group label .icon {
    flex-shrink: 0;
    vertical-align: middle;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #F39C12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover .eye-icon {
    fill: #666;
}

/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    width: 100%;
    background: #F58220;
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 90, 135, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-logout {
    background: transparent;
    color: #fff;
    padding: 8px 16px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-clear {
    background: #F39C12;
    color: #fff;
}

.btn-clear:hover {
    background: #D68910;
}

/* エラーメッセージ */
.error-message {
    background: #fee;
    color: #c00;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    border-left: 4px solid #c00;
}

/* 情報テキスト */
.info-text {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #e8f4fd;
    border-radius: 8px;
    border-left: 4px solid #2d5a87;
}

.help-text {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* メイン画面 */
#mainScreen {
    background: #FFFCF7;
}

.app-header {
    background: linear-gradient(to right, #FCAF17 0%, #F58220 48%, #F58220 52%, #FCAF17 100%);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-left .btn-logout {
    margin-left: 4px;
}

.header-center {
    flex: 1;
    text-align: center;
}

.header-title {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.header-subtitle {
    font-weight: 400;
    font-size: 0.75rem;
    opacity: 0.85;
}

.header-right {
    width: 100px;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header-icon {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.welcome-company {
    color: #fff;
    font-size: 1.0rem;
    font-weight: 500;
    margin: 2px 0 0 0;
    opacity: 0.95;
}

.welcome-person {
    color: #fff;
    font-size: 1.0rem;
    font-weight: 600;
    margin: 2px 0 0 0;
}

.main-content {
    flex: 1;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* アップロードエリア */
.upload-form {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.upload-area {
    border: 2px dashed #2d5a87;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #2d5a87;
    background: #f0f5ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 0.85rem;
    color: #888;
}

/* プレビューグリッド */
.preview-container {
    margin-top: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #666;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-item .remove-btn:hover {
    background: rgba(200, 0, 0, 0.8);
}

/* 送信ボタン */
.btn-upload {
    margin-top: 24px;
}

/* 進捗表示 */
.progress-panel {
    background: #fff;
    padding: 32px 24px;
    border-radius: 16px;
    text-align: center;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.progress-panel h3 {
    color: #2d5a87;
    margin-bottom: 20px;
}

/* アップロード中警告 */
.upload-warning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    animation: pulse-warning 2s infinite;
}

.upload-warning .warning-icon {
    font-size: 1.2rem;
}

.upload-warning .warning-text {
    text-align: center;
}

@keyframes pulse-warning {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 16px rgba(255, 107, 107, 0.6);
    }
}

.progress-bar-container {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2d5a87, #4a90c2);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #666;
    font-size: 0.9rem;
}

/* 成功パネル */
.success-panel {
    background: #fff;
    padding: 40px 24px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.success-panel h3 {
    color: #28a745;
    margin-bottom: 8px;
}

.success-panel p {
    color: #666;
    margin-bottom: 24px;
}

/* レスポンシブ */
@media (max-width: 480px) {
    .app-title {
        font-size: 1.6rem;
    }
    
    .login-form {
        padding: 24px 20px;
    }
    
    .preview-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .upload-form {
        padding: 20px 16px;
    }
    
    /* ヘッダーのモバイル対応 */
    .app-header {
        padding: 8px 10px;
        gap: 6px;
    }
    
    .header-left {
        flex-shrink: 0;
        width: auto;
    }
    
    .header-title {
        font-size: 0.7rem;
        white-space: nowrap;
    }
    
    .header-subtitle {
        font-size: 0.6rem;
    }
    
    .welcome-company {
        font-size: 0.8rem;
        white-space: nowrap;
        margin: 1px 0 0 0;
    }
    
    .welcome-person {
        font-size: 0.8rem;
        white-space: nowrap;
        margin: 1px 0 0 0;
    }
    
    .header-right {
        width: 40px;
        flex-shrink: 0;
    }
    
    .header-icon {
        height: 28px;
    }
}

/* PWAインストールバナー */
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.install-banner p {
    flex: 1;
    font-size: 0.9rem;
    margin: 0;
    color: #ffffff;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    background: #F39C12;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.btn-small:hover {
    background: #D68910;
}

.btn-dismiss {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-dismiss:hover {
    color: white;
}

/* iOS用インストールバナー */
.ios-install-banner {
    flex-direction: row;
    align-items: flex-start;
    padding: 16px;
}

.ios-install-content {
    flex: 1;
}

.ios-install-content p {
    margin: 0;
    color: #ffffff;
    font-size: 0.9rem;
}

.ios-install-steps {
    margin-top: 6px !important;
    font-size: 0.85rem !important;
    opacity: 0.9;
}

.ios-share-icon {
    display: inline-block;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 0.75rem;
    vertical-align: middle;
    margin-right: 4px;
}

/* 更新通知バナー */
.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    color: white;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.update-banner p {
    flex: 1;
    font-size: 0.9rem;
    margin: 0;
    color: #ffffff;
}

.btn-update {
    background: #ffffff;
    color: #1565C0;
    font-weight: bold;
}

.btn-update:hover {
    background: #E3F2FD;
}

/* スタンドアロンモード（PWAとして起動時）の調整 */
@media all and (display-mode: standalone) {
    .install-banner {
        display: none !important;
    }
    .ios-install-banner {
        display: none !important;
    }
}

/* GPS警告パネル */
.gps-warning-panel {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.gps-warning-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #856404;
    font-size: 1.1rem;
}

.gps-warning-icon {
    font-size: 1.5rem;
}

.gps-warning-text {
    color: #856404;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.gps-warning-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    max-height: 150px;
    overflow-y: auto;
}

.gps-warning-list li {
    background: rgba(255, 193, 7, 0.2);
    padding: 6px 12px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #664d03;
}

.gps-warning-help {
    color: #664d03;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #4a90a4;
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-download:hover {
    background: #3a7a94;
}

/* 写真名入力フィールド */
.photo-prefix-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #F39C12;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.photo-prefix-input:focus {
    outline: none;
    border-color: #D68910;
}

.photo-prefix-input::placeholder {
    color: #999;
}

/* 送信履歴セクション */
.history-section {
    margin-top: 24px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #2d5a87;
}

.history-header h3 {
    margin: 0;
    color: #1a365d;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-header h3 .icon {
    flex-shrink: 0;
}

.history-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.history-content {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th,
.history-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.history-table th {
    background: #f5f7fa;
    color: #1a365d;
    font-weight: 600;
    white-space: nowrap;
}

.history-table tbody tr:hover {
    background: #f9fafb;
}

.history-table tfoot td {
    background: #FFEFC7;
    font-weight: 600;
    color: #1a365d;
    border-top: 2px solid #2d5a87;
}

.history-total td {
    padding: 12px;
}

.history-empty {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 0.95rem;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-excluded {
    background: #f8d7da;
    color: #721c24;
}

.status-not-delivered {
    background: #e2e3e5;
    color: #383d41;
}

/* 月別カウンター */
.monthly-counter-section {
    background: linear-gradient(135deg, #e8f4fd 0%, #d4e8f7 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 2px solid #2d5a87;
    display: none;
}

.monthly-counter-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.monthly-counter-month {
    background: #2d5a87;
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 6px 14px;
    border-radius: 20px;
}

.monthly-counter-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1a365d;
}

.monthly-counter-info {
    font-size: 0.85rem;
    color: #1a365d;
    font-weight: bold;
    padding-left: 4px;
}

/* 従量課金中表示 */
.billing-status {
    background: linear-gradient(135deg, #e0115f 0%, #c41049 100%);
    color: #fff;
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(224, 17, 95, 0.3);
}

/* 従量課金時のセクションスタイル */
.monthly-counter-section.billing-active {
    background: linear-gradient(135deg, #fde8ed 0%, #f5c6d0 100%);
    border-color: #e0115f;
}

/* 無料トライアル中のセクションスタイル */
.monthly-counter-section.trial-active {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #2e7d32;
}

.monthly-counter-section.trial-active .billing-status {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

/* トライアル上限到達時のセクションスタイル */
.monthly-counter-section.trial-limit-reached {
    background: linear-gradient(135deg, #fde8ed 0%, #f5c6d0 100%);
    border-color: #e0115f;
}

.monthly-counter-section.trial-limit-reached .billing-status {
    background: linear-gradient(135deg, #e0115f 0%, #c41049 100%);
    box-shadow: 0 2px 8px rgba(224, 17, 95, 0.3);
}

.monthly-counter-section.trial-limit-reached .monthly-counter-info {
    color: #c41049;
    font-weight: bold;
    line-height: 1.6;
}

/* 解約済みロック時のセクションスタイル */
.monthly-counter-section.cancellation-locked {
    background: #f5c6d0;
    border-color: #e0115f;
}

.monthly-counter-section.cancellation-locked .monthly-counter-header,
.monthly-counter-section.cancellation-locked .monthly-counter-count,
.monthly-counter-section.cancellation-locked .monthly-counter-info {
    display: none;
}

.cancellation-locked-message {
    color: #e0115f;
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    padding: 8px 0;
}

/* 上限到達時の「確認する」ボタン無効化 */
.btn-disabled-limit {
    background: #ccc !important;
    color: #888 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    box-shadow: none !important;
}

/* 計測場所選択モーダル */
.location-modal-content {
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
}

.location-modal-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 16px;
}

.location-select-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.location-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.location-select-item:hover {
    border-color: #4a90a4;
    background: #f0f7fa;
}

.location-select-item.selected {
    border-color: #2d5a87;
    background: #e8f0f8;
}

.location-select-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #2d5a87;
    flex-shrink: 0;
}

.location-select-item .location-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

/* 従量課金警告モーダル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.modal-content h3 {
    color: #1a365d;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.modal-content p {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: center;
}

.modal-buttons .btn {
    min-width: 120px;
    white-space: nowrap;
}

.delivery-date-text {
    color: #4caf50 !important;
    font-weight: bold;
    font-size: 1.15rem;
    margin-top: 12px !important;
}

.billing-alert {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fff0f3 0%, #ffe0e6 100%);
    border: 2px solid #e91e63;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 12px 0;
}

.billing-alert-icon {
    font-size: 1.8rem;
}

.billing-alert span:last-child {
    color: #e91e63;
    font-weight: bold;
    font-size: 1.08rem;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* ハンバーガーメニューボタン */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* サイドメニューオーバーレイ */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 999;
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* サイドメニュー */
.side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    transition: left 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.side-menu.active {
    left: 0;
}

.side-menu-header {
    background: #F58220;
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-menu-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* メニュー内SVGアイコン */
.menu-icon {
    flex-shrink: 0;
    vertical-align: middle;
}

.side-menu-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.side-menu-close:hover {
    opacity: 0.8;
}

.side-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.side-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.side-menu-item:hover {
    background: #f5f7fa;
}

.side-menu-item:active {
    background: #e8f4f8;
}

.side-menu-home {
    background: #FFF8E7;
    font-weight: 600;
}

.side-menu-home:hover {
    background: #FFEFCF;
}

.side-menu-logout {
    color: #dc3545;
    font-weight: 500;
}

.side-menu-logout:hover {
    background: #fff0f0;
    color: #c82333;
}

.side-menu-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 8px;
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    border-bottom: none;
}

.side-menu-subitem {
    padding-left: 36px;
    font-size: 0.95rem;
}

.side-menu-logout-area {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.side-menu-logout-area .side-menu-logout {
    display: block;
    padding: 12px 20px;
    color: #dc3545;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    background: #fff0f0;
}

.side-menu-logout-area .side-menu-logout:hover {
    background: #ffe0e0;
    color: #c82333;
}

.side-menu-cancel-area {
    display: none;
}

.side-menu-cancel-area .side-menu-cancel {
    display: none;
}

.side-menu-cancel-area .side-menu-cancel:hover {
    display: none;
}

.side-menu-footer-cancel {
    display: inline-block;
    margin-top: 8px;
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.side-menu-footer-cancel:hover {
    color: #a71d2a;
    text-decoration: underline;
}

/* 解約ページモーダル */
.cancel-page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.cancel-page-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.cancel-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #F58220;
    color: #fff;
}

.cancel-page-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.cancel-page-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
}

.cancel-page-body {
    padding: 0;
    text-align: left;
    max-height: 70vh;
    overflow-y: auto;
}

.cancel-page-body p {
    margin: 0 0 16px;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.6;
}

.cancel-terms {
    padding: 24px 20px;
}

.cancel-terms h4 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #333;
}

.cancel-terms ul {
    margin: 12px 0;
    padding-left: 20px;
}

.cancel-terms ul li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #444;
}

.cancel-agree-area {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.cancel-agree-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}

.cancel-agree-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #dc3545;
}

.cancel-agree-label input[type="checkbox"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cancel-submit-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 16px 20px 20px;
    padding: 14px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.cancel-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.cancel-submit-btn:not(:disabled):hover {
    background: #c82333;
}

.cancel-page-link {
    display: inline-block;
    padding: 12px 24px;
    background: #F58220;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    word-break: break-all;
}

.cancel-page-link:hover {
    background: #e0721a;
}

.side-menu-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
}

/* プライバシーポリシー同意チェックボックス */
.privacy-agreement {
    margin-top: 20px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #4a90a4;
}

.checkbox-text {
    color: #fff;
}

.privacy-link {
    color: #7dd3fc;
    text-decoration: underline;
}

.privacy-link:hover {
    color: #38bdf8;
}

/* 送信ボタン下のプライバシーリンク */
.privacy-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.privacy-footer-link {
    color: #666;
    font-size: 0.9rem;
    text-decoration: none;
}

.privacy-footer-link:hover {
    color: #4a90a4;
    text-decoration: underline;
}