/* カスタムスタイル */
body { font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif; background: #eef2f7; }
.page-header {
    background: linear-gradient(135deg, #ffffff 0%, #fdf5ff 100%);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 15px 40px rgba(32, 35, 64, 0.12);
}
.info-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4a5568;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}
.schedule-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(9, 14, 34, 0.08);
}
.schedule-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}
.schedule-container {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 1fr; /* 時間軸 + 3列 */
    border: 1px solid #000;
    background: #fff;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    position: relative;
    user-select: none; /* テキスト選択防止 */
    border-radius: 16px;
    box-shadow: 0 18px 35px rgba(17, 24, 39, 0.12);
}

/* ヘッダー */
.header-cell {
    background: #f0f0f0;
    border-bottom: 2px solid #000;
    border-right: 1px solid #000;
    font-weight: bold;
    padding: 5px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* 時間軸 */
.time-col {
    border-right: 2px solid #000;
    background: #fff;
}
.time-slot {
    height: 40px; /* 10分 = 40px, 5分 = 20px */
    border-bottom: 1px dotted #ccc;
    box-sizing: border-box;
    position: relative;
    font-size: 12px;
    padding-left: 2px;
}
.time-slot.hour-start {
    border-bottom: 1px solid #666;
}
.time-label {
    position: absolute;
    top: -6px;
    background: #fff;
    padding-right: 2px;
    font-weight: bold;
}
/* 5分刻みの補助線 */
.time-slot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px dotted #eee;
    z-index: 0;
}

/* メインカラム */
.menu-col {
    border-right: 1px solid #000;
    position: relative;
    background-image: linear-gradient(to bottom, transparent 19px, #eee 20px, transparent 20px), linear-gradient(to bottom, transparent 39px, #ccc 40px, transparent 40px);
    background-size: 100% 40px; /* 10分ごとにガイドライン */
}
.menu-col:last-child { border-right: none; }

/* 予約カード (Appointment) */
.appointment {
    position: absolute;
    width: 90%;
    left: 5%;
    border-radius: 4px;
    padding: 4px;
    font-size: 12px;
    overflow: hidden;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    cursor: move;
    z-index: 5;
    touch-action: none;
    box-sizing: border-box;
    border: 1px solid rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
/* メニューごとの色 */
.type-thai { background-color: #bee3f8; border-left: 4px solid #2b6cb0; }
.type-head { background-color: #fbd38d; border-left: 4px solid #c05621; }
.type-abhyanga { background-color: #d6f0c3; border-left: 4px solid #2f855a; }

.appointment strong { display: block; margin-bottom: 2px; }

/* 空きスペースをクリック可能に */
.click-area {
    height: 100%; 
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* モーダル */
#editModal {
    background-color: rgba(0, 0, 0, 0.5);
}
.modal-panel {
    width: 24rem;
    max-width: 90vw;
}
.legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #4a5568;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f7fafc;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.legend-dot.thai { background-color: #2b6cb0; }
.legend-dot.head { background-color: #c05621; }
.legend-dot.abhyanga { background-color: #2f855a; }

.table-wrapper {
    background: #f8fafc;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    width: 100%;
}
.reservation-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    min-width: 0;
}
.reservation-table th,
.reservation-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
}
.reservation-table thead {
    background: #f1f5f9;
    font-weight: 600;
    color: #334155;
}
.reservation-table tbody tr:hover {
    background: #f9fafc;
}
.reservation-table td { width: 25%; }
.reservation-table td:first-child { width: 25%; }
.table-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    body { padding: 12px; }
    .page-header { padding: 16px; border-radius: 16px; }
    .schedule-wrapper { margin: 0; padding: 0 0 16px; }
    .schedule-container {
        max-width: 100%;
        margin: 16px auto;
        border-radius: 12px;
    }
    .header-cell { font-size: 12px; padding: 6px 2px; }
    .appointment { font-size: 11px; padding: 3px; border-radius: 6px; }
    .schedule-toolbar { flex-direction: column; align-items: flex-start; }
    .modal-panel { width: calc(100% - 32px); }
    .table-wrapper { padding: 12px; border-radius: 14px; box-shadow: none; }
    .reservation-table { width: 100%; min-width: 0; }
}

@media (max-width: 480px) {
    .schedule-container {
        width: 100%;
        max-width: 100%;
        border-radius: 10px;
    }
    .time-slot { height: 32px; font-size: 11px; }
    .menu-col {
        background-image: linear-gradient(to bottom, transparent 15px, #eee 16px, transparent 16px), linear-gradient(to bottom, transparent 31px, #ccc 32px, transparent 32px);
        background-size: 100% 32px;
    }
    .appointment { font-size: 10px; }
    .reservation-table {
        width: 100%;
        min-width: 0;
    }
}

