* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #222;
  background: #f7f5f0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.6;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #ddd7cc;
  padding: 14px 18px;
}

.site-header div {
  display: flex;
  gap: 12px;
  align-items: baseline;
  max-width: 980px;
  margin: 0 auto;
}

.site-header span {
  color: #666;
  font-size: 14px;
}

.container {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 20px 14px 48px;
}

.panel {
  background: #fff;
  border: 1px solid #ddd7cc;
  border-radius: 8px;
  padding: 18px;
  margin: 0 0 16px;
}

.reservation-form-panel {
  width: min(520px, 100%);
  margin-left: auto;
  margin-right: auto;
}

h1, h2 {
  line-height: 1.3;
  margin: 0 0 16px;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

label {
  display: block;
  font-weight: 700;
  margin: 14px 0 6px;
}

input, select, textarea, button {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #365f49;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary, button.secondary {
  color: #24352d;
  background: #e7e1d6;
}

.button.danger, button.danger {
  background: #9e3e35;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.actions > * {
  flex: 1 1 180px;
}

.errors, .flash {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.errors {
  color: #7d2018;
  background: #fff0ed;
  border: 1px solid #efb8ae;
}

.flash {
  color: #234330;
  background: #edf7f0;
  border: 1px solid #b7ddc2;
}

.required {
  color: #9e3e35;
  font-size: 12px;
  margin-left: 4px;
}

.summary {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 10px;
}

.summary dt {
  color: #666;
  font-weight: 700;
}

.summary dd {
  margin: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.nav a {
  color: #24352d;
  background: #e7e1d6;
  border-radius: 6px;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid #e4ded3;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.slot {
  border-top: 2px solid #ddd7cc;
  padding-top: 16px;
  margin-top: 20px;
}

.muted {
  color: #666;
}

.rakuan-date-picker {
  display: block;
  border: 1px solid #e4ded3;
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf7;
}

.rakuan-selected-date {
  min-height: 42px;
  border: 1px solid #cfc7ba;
  border-radius: 6px;
  padding: 9px 12px;
  background: #fff;
  font-weight: 700;
}

.rakuan-date-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 12px 0;
  color: #555;
  font-size: 13px;
}

.rakuan-date-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rakuan-date-legend b {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
  font-style: normal;
}

.rakuan-date-legend .open {
  color: #23663f;
  background: #eaf6ee;
}

.rakuan-date-legend .limited {
  color: #8a5a00;
  background: #fff5d8;
}

.rakuan-date-legend .full {
  color: #777;
  background: #eee;
}

.rakuan-month {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e4ded3;
}

.rakuan-month h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.rakuan-weekdays,
.rakuan-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.rakuan-weekdays {
  margin-bottom: 4px;
  color: #666;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.rakuan-day {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1px;
  min-height: 62px;
  border: 1px solid #d4ccbf;
  border-radius: 6px;
  padding: 5px 2px;
  color: #222;
  background: #fff;
}

.rakuan-day.blank {
  border: 0;
  background: transparent;
}

.rakuan-day strong {
  font-size: 15px;
  line-height: 1;
}

.rakuan-day em {
  font-size: 17px;
  font-style: normal;
  line-height: 1;
}

.rakuan-day small {
  max-width: 100%;
  color: #555;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.rakuan-day.open {
  border-color: #8dc49d;
  background: #f3fbf5;
}

.rakuan-day.limited {
  border-color: #e1c46b;
  background: #fff9e7;
}

.rakuan-day.full,
.rakuan-day.closed {
  color: #777;
  background: #f0f0f0;
}

.rakuan-day.selected {
  color: #fff;
  border-color: #365f49;
  background: #365f49;
}

.rakuan-day.selected small {
  color: #fff;
}

.rakuan-day:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

@media (max-width: 640px) {
  .site-header div {
    display: block;
  }

  .panel {
    padding: 14px;
  }

  .reservation-form-panel {
    width: min(420px, 100%);
  }

  .summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  table, thead, tbody, tr, th, td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid #ddd7cc;
    padding: 10px 0;
  }

  td {
    border: 0;
    padding: 4px 0;
  }

  .rakuan-date-picker {
    padding: 10px;
  }

  .rakuan-weekdays,
  .rakuan-days {
    gap: 3px;
  }

  .rakuan-day {
    min-height: 54px;
    padding: 4px 1px;
  }

  .rakuan-day strong {
    font-size: 14px;
  }

  .rakuan-day em {
    font-size: 15px;
  }

  .rakuan-day small {
    font-size: 9px;
  }
}
