:root {
    --sidebar-width: 150px;
    --header-height: 50px;
    --cell-width: 150px;
    --cell-height: 150px;
}
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    padding: 20px;
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
    overflow: hidden;
}
h1 {
    text-align: center;
    color: #2c3e50;
    margin: 5px 0 15px;
}
#calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
}
#header-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f1f3f5;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}
#header-toolbar button {
    background-color: #007bff;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}
#header-toolbar button:hover { background-color: #0056b3; }
#current-week-range {
    font-size: 1.5em;
    font-weight: 600;
    color: #343a40;
}
#calendar-layout-container {
    flex-grow: 1;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    border-top: 1px solid #dee2e6;
    overflow: hidden;
}
#corner-header {
    grid-area: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    font-weight: bold;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    z-index: 3;
}
#date-header-wrapper {
    grid-area: 1 / 2;
    overflow: hidden;
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    z-index: 2;
}
#date-time-header {
    display: flex;
    height: var(--header-height);
    will-change: transform;
}
.date-column-header {
    width: var(--cell-width);
    min-width: var(--cell-width);
    flex-shrink: 0;
    border-left: 1px solid #dee2e6;
    text-align: center;
    line-height: var(--header-height);
    font-weight: bold;
    box-sizing: border-box;
}
#room-sidebar-wrapper {
    grid-area: 2 / 1;
    overflow: hidden;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    z-index: 2;
}
#room-names-container { will-change: transform; }
.room-name {
    height: var(--cell-height);
    width: var(--sidebar-width);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding-left: 10px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 500;
}
#reservation-grid-wrapper {
    grid-area: 2 / 2;
    overflow: auto;
    z-index: 1;
}
#reservation-grid {
    display: grid;
    grid-auto-rows: var(--cell-height);
    grid-template-columns: repeat(7, var(--cell-width));
    position: relative;
}
.grid-cell {
    width: var(--cell-width);
    height: var(--cell-height);
    border-bottom: 1px solid #e0e0e0;
    border-left: 1px solid #e0e0e0;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    /* Flexboxの設定を削除し、相対配置に戻す */
}
.reservation-block {
    position: absolute; /* 絶対配置に戻す */
    left: 1px;
    right: 1px;
    background-color: #007bff;
    color: white;
    padding: 2px 2px;
    border-radius: 4px;
    font-size: 1.0em;
        font-weight: bold;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    line-height: 1.2;
    box-sizing: border-box;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.reservation-block.all-day {
    background-color: #dc3545;
    height: calc(100% - 4px) !important;
    top: 2px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.0em;
}
.reservation-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
.reservation-purpose {
    font-weight: 500;
    margin-bottom: 2px;
    word-break: break-all;
    line-height: 1.1;
}
.reservation-time {
    font-size: 1.0em;
    opacity: 0.9;
    line-height: 1.1;
}
.reservation-block:hover { 
    opacity: 0.85; 
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
@media (max-width: 768px) {
    :root {
        --sidebar-width: 120px;
        --cell-width: 120px;
    }
    .reservation-block {
        font-size: 0.65em;
        padding: 3px 3px;
    }
}