body {
  font-family: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f0f0f0;
}

.ttl{
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.ttl img{
  display: block;
  width: 100%;
}

.controls {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

#calendar-container {
  background-color: white;
  padding: 20px 30px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  max-width: 1000px;
  margin: 0 auto;
}

#calendar-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

#header-logo {
  height: 45px;
  width: 98px;
  object-fit: contain;
}

#calendar-header h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

#calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid #ccc;
  border-left: 1px solid #ccc;
}

.dow-header {
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  text-align: center;
  padding: 10px 0;
  font-weight: 700;
  background-color: #fafafa;
}

.dow-header:first-child { color: #d32f2f; } /* Sunday */
.dow-header:last-child { color: #1976d2; } /* Saturday */

.day {
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  background-color: white;
  cursor: pointer;
  position: relative;
}

.day:hover {
  background-color: #f5f9ff;
}

.day.empty {
  background-color: #fafafa;
  cursor: default;
}

.day.empty:hover {
  background-color: #fafafa;
}

.day.closed {
  background-color: #eeeeee;
  color: #777;
}

.date-label {
  padding: 5px;
  font-size: 16px;
  font-weight: 700;
}

.day:nth-child(7n + 1) .date-label { color: #d32f2f; } /* Sunday */
.day:nth-child(7n) .date-label { color: #1976d2; } /* Saturday */
.day.holiday .date-label { color: #d32f2f; } /* Holiday */

.closed-label {
  text-align: center;
  font-weight: 700;
  margin-top: 20px;
  color: #777;
}

/* Cell Actions (Copy / Paste) */
.cell-actions {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  gap: 4px;
  z-index: 10;
}

.day:hover .cell-actions {
  display: flex;
}

.action-btn {
  font-size: 10px;
  padding: 3px 6px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  color: #333;
  font-family: inherit;
}

.action-btn:hover:not(:disabled) {
  background-color: #e0e0e0;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Event Bar */
.event-bar {
  position: relative;
  min-height: 24px;
  margin: 4px 0;
}

.event-bar .title {
  display: inline-block;
  position: relative;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.3;
  color: #333;
  z-index: 2;
  background-color: #ffffff;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.event-bar.start::after,
.event-bar.middle::after,
.event-bar.end::after {
  content: '';
  position: absolute;
  top: 9px;
  height: 6px;
  z-index: 1;
}

.event-bar.color-1::after { background-color: #f44336; } /* 赤 */
.event-bar.color-2::after { background-color: #ff9800; } /* オレンジ */
.event-bar.color-3::after { background-color: #8bc34a; } /* 黄緑 */
.event-bar.color-4::after { background-color: #03a9f4; } /* 水色 */
.event-bar.color-5::after { background-color: #9c27b0; } /* 紫色 */

.event-bar.start::after {
  left: 10px;
  right: -1px;
}

.event-bar.middle::after {
  left: -1px;
  right: -1px;
}

.event-bar.end::after {
  left: -1px;
  right: 10px;
}

.hours {
  padding: 0 5px;
  font-size: 11px;
  color: #666;
  margin-top: auto;
  margin-bottom: 5px;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  width: 450px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-content h3 {
  margin-top: 0;
}

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

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
  font-size: 14px;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-family: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
}

.form-group textarea {
  resize: vertical;
}

.checkbox-group {
  margin-top: 15px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  font-weight: 400;
  gap: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

button {
  padding: 8px 16px;
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
  font-family: inherit;
  font-weight: 700;
}

.primary-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
}

.primary-btn:hover {
  background-color: #45a049;
}
