/* 全体ベース */
.mgm-wrapper { max-width: 900px; margin: 0 auto; font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif; color: #333; background: #fff; }

/* 1. カレンダーデザイン */
.mgm-cal-header { display: flex; justify-content: space-between; align-items: center; background: #292929; border: 1px solid #292929; padding: 10px 15px; }
.month-title { font-size: 1.1rem; font-weight: bold; color: #fff; }
.nav-btn { background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 5px 15px; cursor: pointer; color: #333; outline: none; }
.nav-btn:focus { outline: none; }

.mgm-cal-table { border: 1px solid #ddd; border-top: none; }
.mgm-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; border-bottom: 1px solid #ddd; font-size: 0.85rem; }
.mgm-weekdays div { padding: 12px 0; border-right: 1px solid #ddd; color: #333; background: #fff;}
.mgm-weekdays div:last-child { border-right: none; }

.mgm-weekdays .sun { background: #fff5f5; color: #d9534f; }
.mgm-weekdays .sat { background: #f0f8ff; color: #337ab7; }

.mgm-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid #ddd; }
.cell { 
    aspect-ratio: 1.2; 
    border-right: 1px solid #ddd; 
    border-bottom: 1px solid #ddd; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: #fff; 
    box-sizing: border-box; 
    position: relative;
}
.cell:nth-child(7n) { border-right: none; }
.cell.empty { background: #fafafa; }

.cell.sun { background: #fffafa; }
.cell.sat { background: #f9fcff; }

.cell .num { position: absolute; top: 5px; left: 6px; font-size: 0.85rem; color: #333; }

.cell .mark { font-size: 1.1rem; color: #ccc; font-weight: normal; }
.cell .mark.maru { color: #e36f6f; }
.cell .mark.sankaku { color: #e36f6f; }
.cell .mark.batsu { color: #ccc; }

.cell.active { cursor: pointer; }
.cell.active:hover { background: #f5f5f5; }

.mgm-legend { display: flex; gap: 15px; justify-content: flex-end; margin-top: 10px; font-size: 0.85rem; color: #666; }

/* 2. 時間選択デザイン */
/* ▼ ご指定のCSSを反映 */
.mgm-time-header {
    display: flex;
    align-items: center;
    background: #fff;
    margin-bottom: 1rem;
}
.time-date-title {
    font-size: 1.1rem;
    font-weight: bold;
    flex-grow: 1;
    text-align: left;
    color: #111;
}

.mgm-back-cal, .mgm-back-to-time { background: #fff; border: 1px solid #ccc; padding: 6px 15px; border-radius: 4px; cursor: pointer; font-size: 0.85rem; margin-right: 20px; color: #333; outline: none; }
.mgm-back-cal:focus, .mgm-back-to-time:focus { outline: none; }
.mgm-time-layout { display: flex; flex-direction: column; border: 1px solid #ddd; }
.mgm-time-list { flex-grow: 1; display: flex; flex-direction: column; }
.time-row { padding: 15px 0; text-align: center; border-bottom: 1px solid #ddd; cursor: pointer; font-size: 1.1rem; background: #fff; transition: background 0.2s; color: #111;}
.time-row:last-child { border-bottom: none; }
.time-row:hover { background: #f5f5f5; }

/* 3. フォームデザイン */
.mgm-form-row { display: flex; border-bottom: 1px solid #ddd; padding: 25px 0; }
.mgm-form-row:first-child { border-top: 1px solid #ddd; }
.mgm-form-label { width: 30%; font-weight: bold; font-size: 0.95rem; padding-right: 15px; box-sizing: border-box; color: #111;}
.mgm-form-label .req { font-size: 0.8rem; margin-left: 5px; color: #d9534f;}
.mgm-form-input { width: 70%; }
.mgm-form-input input[type="text"], .mgm-form-input input[type="email"], .mgm-form-input input[type="tel"], .mgm-form-input textarea, .mgm-form-input select { 
    width: 100%; padding: 12px; border: 1px solid #ccc; background: #fff; box-sizing: border-box; font-size: 0.95rem; color: #111;
}
.mgm-form-input input::placeholder, .mgm-form-input textarea::placeholder { color: #999; }
.mgm-checkbox-group label { display: inline-block; margin-right: 15px; margin-bottom: 10px; cursor: pointer; color: #111;}

.mgm-form-actions { text-align: center; margin-bottom: 40px; }
.submit-btn { background: #333; color: #fff; border: none; padding: 15px 60px; font-size: 1.1rem; cursor: pointer; border-radius: 4px; transition: background 0.3s; outline: none; }
.submit-btn:focus { outline: none; }
.submit-btn:hover { background: #111; }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* スマホ用レスポンシブ */
@media (max-width: 767px) {
    .cell { aspect-ratio: auto; height: 65px; }
    .cell .mark { font-size: 0.8rem; top: 6px; position: relative; }
    
    .mgm-form-row { flex-direction: column; padding: 15px 0; }
    .mgm-form-label { width: 100%; margin-bottom: 10px; }
    .mgm-form-input { width: 100%; }
    .mgm-time-header { flex-direction: column; gap: 10px; text-align: left; align-items: flex-start;}
    .mgm-back-cal, .mgm-back-to-time { margin-right: 0; align-self: flex-start; }
}