* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  background: #f7f1ef;
  color: #333;
}

.app-header {
  padding: 30px 20px;
  text-align: center;
  background: linear-gradient(135deg, #8b5a5d, #d8a7a7);
  color: #fff;
}

.app-header h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0.04em;
}

.app-header p {
  margin: 8px 0 0;
}

.app-layout {
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 16px 40px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.panel {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(80, 40, 40, 0.12);
}

button {
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  background: #9b6a6c;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  opacity: 0.88;
}

.sub-btn {
  background: #8f8f8f;
}

.danger-btn {
  background: #b84a4a;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.calendar-header h2 {
  margin: 0;
  color: #7b4d50;
}

.calendar-guide {
  margin: 12px 0;
  color: #7b4d50;
  font-size: 14px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays div {
  text-align: center;
  font-weight: bold;
  padding: 12px;
  color: #7b4d50;
}

.calendar-grid {
  gap: 8px;
}

.calendar-day {
  min-height: 145px;
  background: #fffafa;
  border: 1px solid #eadada;
  border-radius: 14px;
  padding: 8px;
  cursor: pointer;
  transition: 0.15s;
}

.calendar-day:hover {
  background: #fff3f3;
  transform: translateY(-1px);
}

.calendar-day.outside {
  opacity: 0.35;
}

.calendar-day.today {
  border: 2px solid #c97c7c;
  background: #fff1f1;
}

.day-number {
  font-weight: bold;
  margin-bottom: 6px;
  color: #633b3e;
}

.day-hint {
  color: #c39a9a;
  font-size: 11px;
}

.calendar-reservation {
  padding: 7px 8px;
  margin-top: 6px;
  border-radius: 10px;
  background: #f2e6e6;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.4;
}

.calendar-reservation:hover {
  background: #ead2d2;
}

.calendar-reservation strong {
  display: block;
  color: #633b3e;
}

.calendar-reservation .ai-mark,
.calendar-reservation .updated-mark {
  display: inline-block;
  margin-top: 4px;
  margin-right: 4px;
  font-size: 11px;
  color: #7b4d50;
  font-weight: bold;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30, 20, 20, 0.45);
  padding: 20px;
}

.modal.active {
  display: grid;
  place-items: center;
}

.modal-content {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.modal-content.large {
  width: min(720px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-header h2 {
  margin: 0 0 14px;
  color: #7b4d50;
}

.close-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #8f8f8f;
  font-size: 20px;
}

form,
.modal-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: bold;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
}

textarea {
  resize: vertical;
}

.form-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-text {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.detail-box {
  display: grid;
  gap: 10px;
  line-height: 1.8;
}

.detail-row {
  padding: 10px;
  background: #fffafa;
  border-radius: 12px;
}

.detail-row small {
  display: block;
  color: #777;
}

.ai-result {
  padding: 14px;
  background: #f2e6e6;
  border-radius: 14px;
  line-height: 1.8;
}

.ai-result strong {
  color: #7b4d50;
}

@media (max-width: 760px) {
  .calendar-weekdays {
    display: none;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: auto;
  }

  .calendar-day.outside {
    display: none;
  }

  .calendar-header {
    flex-direction: column;
  }
}