* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
    position: relative;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
}

.admin-link {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    padding: 30px 40px;
    background: #f8f9fa;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 10px;
}

.step::before {
    content: attr(data-step);
    display: block;
    width: 40px;
    height: 40px;
    background: #ddd;
    color: #888;
    border-radius: 50%;
    margin: 0 auto 10px;
    line-height: 40px;
    font-weight: 600;
    transition: all 0.3s;
}

.step.active::before {
    background: #667eea;
    color: white;
}

.step.completed::before {
    background: #28a745;
    color: white;
    content: '✓';
}

.step-title {
    font-size: 0.9rem;
    color: #666;
}

.step.active .step-title {
    color: #667eea;
    font-weight: 600;
}

.content {
    padding: 40px;
}

.step-content {
    display: none;
}

#step1 {
    display: block;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.staff-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.staff-card {
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.staff-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.staff-card.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* v6.2.0: 担当者検索機能 */
.staff-search-container {
    margin-bottom: 25px;
}

.staff-search-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.staff-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* v6.2.0: 部署別タブ */
.department-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.department-tab {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    color: #333;  /* v6.4.0.19: 文字色を明示的に指定（背景色との同化を防止） */
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.95rem;
}

.department-tab:hover {
    border-color: #667eea;
    background: #f0f3ff;
}

.department-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* v6.2.0: 担当者カードの改善 - 既存の.staff-listと.staff-cardを上書き */
.staff-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.staff-card {
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.staff-card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 5px;
}

.staff-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.staff-card-department {
    font-size: 0.85rem;
    color: #777;
    padding: 4px 12px;
    background: #e8eaf6;
    border-radius: 12px;
}

.staff-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.staff-card:hover .staff-card-icon {
    transform: scale(1.1);
}

.staff-card.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.staff-card.selected .staff-card-name {
    color: white;
}

.staff-card.selected .staff-card-department {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.staff-card.selected .staff-card-icon {
    background: rgba(255, 255, 255, 0.3);
}

/* 検索結果がない場合 */
.no-staff-found {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
}

.no-staff-found p {
    margin: 0;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-weight: 500;
}

input[type="date"],
input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.time-slot {
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.time-slot:hover {
    border-color: #667eea;
    background: #e8ecff;
}

.time-slot.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.booking-summary {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.booking-summary h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.booking-summary p {
    margin-bottom: 10px;
    color: #555;
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    /* v6.4.4.5: モバイルタッチ対応 */
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

button:hover {
    background: #5568d3;
}

button:active {
    transform: scale(0.98);
}

button.secondary {
    background: #6c757d;
}

button.secondary:hover {
    background: #5a6268;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .progress-bar {
        padding: 20px;
    }
    
    .step-title {
        font-size: 0.75rem;
    }
    
    .content {
        padding: 20px;
    }
    
    /* v6.2.0: モバイルで担当者カードを2列表示 */
    .staff-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .staff-card {
        padding: 20px 15px;
    }
    
    .staff-card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .staff-card-name {
        font-size: 0.95rem;
    }
    
    .staff-card-department {
        font-size: 0.75rem;
    }
    
    .department-tabs {
        gap: 8px;
    }
    
    .department-tab {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .admin-link {
        position: static;
        display: inline-block;
        margin-top: 10px;
    }
}

/* v6.2.0: 小型スマホ対応 (375px以下) */
@media (max-width: 375px) {
    .staff-list {
        grid-template-columns: 1fr;
    }
    
    .staff-search-input {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/* ==========  繰り返し予約セクション ========== */
.recurring-section {
    border: 2px dashed #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.recurring-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.recurring-header input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.recurring-header label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    margin: 0;
}

.recurring-options {
    padding-left: 30px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#intervalHint {
    display: block;
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 5px;
}

#recurringPattern,
#intervalValue,
#recurringEndDate,
#occurrenceCount {
    width: 100%;
}



/* ============================================
   ローディング表示スタイル
   ============================================ */
.loading-spinner {
    text-align: center;
    padding: 30px;
    font-size: 18px;
    color: #667eea;
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 送信中ボタンのスタイル */
button:disabled {
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    background: #9ca3af !important;
}

/* v6.4.1.42: ミーティング形式選択 */
.meeting-type-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.radio-option input[type="radio"]:checked + .radio-label {
    font-weight: 600;
    color: #667eea;
}

.radio-option:has(input:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

.radio-label {
    font-size: 1rem;
}

/* ========================================
   v6.4.1.42: レスポンシブ強化
   ======================================== */

/* タブレット以下 (768px以下) - 既存を補完 */
@media (max-width: 768px) {
    body {
        padding: 15px 10px;
    }
    
    .container {
        border-radius: 12px;
    }
    
    header {
        padding: 25px 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .content {
        padding: 15px;
    }
    
    /* 日付入力フィールドの調整 */
    input[type="date"] {
        font-size: 16px; /* iOS拡大防止 */
        padding: 14px 12px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"] {
        font-size: 16px; /* iOS拡大防止 */
        padding: 14px 12px;
    }
    
    select {
        font-size: 16px;
        padding: 14px 12px;
    }
    
    textarea {
        font-size: 16px;
        padding: 14px 12px;
    }
    
    /* ボタンのタップ領域拡大 */
    button {
        min-height: 48px;
        font-size: 1rem;
    }
    
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .button-group button {
        width: 100%;
    }
    
    /* フォームグループ */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    
    /* 時間スロット */
    .time-slots {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .time-slot {
        padding: 10px 8px;
        font-size: 0.85rem;
        min-height: 44px;
    }
    
    /* 繰り返し予約セクション */
    .recurring-section {
        padding: 15px;
    }
    
    .recurring-options {
        padding-left: 0;
    }
}

/* スマホ (480px以下) */
@media (max-width: 480px) {
    body {
        padding: 10px 5px;
    }
    
    .container {
        border-radius: 8px;
    }
    
    header {
        padding: 20px 12px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .content {
        padding: 12px;
    }
    
    /* プログレスバー */
    .progress-bar {
        padding: 15px 10px;
    }
    
    .step-title {
        font-size: 0.65rem;
    }
    
    .step::before {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    /* 時間スロット - 2列 */
    .time-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .time-slot {
        padding: 12px 6px;
        font-size: 0.9rem;
    }
    
    /* 担当者カード - 1列 */
    .staff-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .staff-card {
        padding: 15px;
    }
    
    /* 部署タブ */
    .department-tabs {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .department-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    /* ミーティング形式ラジオボタン */
    .meeting-type-options {
        flex-direction: column;
        gap: 8px;
    }
    
    .meeting-type-options label {
        padding: 12px;
    }
    
    /* 管理者リンク */
    .admin-link {
        position: static;
        display: block;
        text-align: center;
        margin-top: 15px;
    }
}

/* 小型スマホ (360px以下) */
@media (max-width: 360px) {
    body {
        padding: 5px;
    }
    
    .content {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.1rem;
    }
    
    h2 {
        font-size: 1rem;
    }
    
    input[type="date"],
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        padding: 12px 10px;
    }
    
    .time-slots {
        grid-template-columns: 1fr 1fr;
    }
    
    .step-title {
        font-size: 0.6rem;
    }
}

/* PC向け（1024px以上）- より広く使う */
@media (min-width: 1024px) {
    body {
        padding: 50px 30px;
    }
    
    .container {
        max-width: 900px;
    }
    
    header {
        padding: 50px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .content {
        padding: 40px 50px;
    }
    
    /* 時間スロット - 5列 */
    .time-slots {
        grid-template-columns: repeat(5, 1fr);
    }
    
    /* 担当者カード - 3列 */
    .staff-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 大画面PC（1400px以上） */
@media (min-width: 1400px) {
    .container {
        max-width: 1000px;
    }
    
    .content {
        padding: 50px 60px;
    }
    
    /* 時間スロット - 6列 */
    .time-slots {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ========================================
   v6.4.1.42: 情報ボックス（営業時間案内等）
   ======================================== */
.info-box {
    background: #f0f7ff;
    border: 1px solid #c3dafe;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
    font-size: 0.95rem;
}

.info-box p {
    margin: 5px 0;
    color: #333;
}

.info-box .info-note {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
}

.info-box.info-warning {
    background: #fff8e6;
    border-color: #f5a623;
    border-left-color: #f5a623;
}

.info-box.info-warning p {
    color: #8a6d3b;
}

.info-box .info-list {
    margin: 8px 0 8px 20px;
    padding: 0;
    font-size: 0.85rem;
    color: #666;
}

.info-box .info-list li {
    margin: 4px 0;
}

/* スマホ対応 */
@media (max-width: 480px) {
    .info-box {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .info-box .info-note,
    .info-box .info-list {
        font-size: 0.8rem;
    }
}

/* ============================================
   v6.4.4.3: 予約フォーム モバイル対応修正
   ============================================ */

/* スマホでcontainerのoverflow問題を修正 */
@media (max-width: 768px) {
    .container {
        overflow: visible;
    }
    
    /* ボタングループの調整 */
    .button-group {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
        padding-bottom: 20px;
    }
    
    .button-group button {
        width: 100%;
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    /* 確定ボタンを目立たせる */
    #submitBooking {
        order: -1; /* 上に表示 */
    }
}

@media (max-width: 480px) {
    /* コンテナの高さを自動に */
    .container {
        overflow: visible;
        min-height: auto;
    }
    
    /* コンテンツエリアのパディング確保 */
    .content {
        padding-bottom: 30px;
    }
    
    /* ステップ4（情報入力）のフォーム調整 */
    #step4 .form-group {
        margin-bottom: 15px;
    }
    
    #step4 input {
        padding: 14px 12px;
        font-size: 16px; /* iOSズーム防止 */
    }
    
    /* ミーティング形式オプション */
    .meeting-type-options {
        gap: 8px;
    }
    
    .meeting-type-options label {
        padding: 12px 15px;
    }
    
    /* ボタングループ */
    .button-group {
        flex-direction: column;
        gap: 12px;
        margin-top: 25px;
        padding-bottom: 20px;
    }
    
    .button-group button {
        width: 100%;
        padding: 16px 20px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .button-group button.secondary {
        order: 1; /* 戻るボタンを下に */
    }
    
    #submitBooking {
        order: 0; /* 確定ボタンを上に */
        font-weight: 600;
    }
    
    /* 予約内容サマリー */
    .booking-summary {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .booking-summary h3 {
        font-size: 1rem;
    }
}
