:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dde5;
  --panel: #ffffff;
  --bg: #f5f7fb;
  --accent: #0f766e;
  --accent-dark: #0b5f58;
  --danger: #b42318;
  --success: #15803d;
  --today: #fff7cc;
  --added-reservation: #fff1f1;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 700;
}

button[type="submit"]:hover {
  background: var(--accent-dark);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  letter-spacing: 0;
}

#monthLabel {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar button {
  min-width: 42px;
}

.user-badge {
  color: var(--muted);
  font-size: 14px;
  min-width: 0;
}

.calendar-shell {
  min-height: calc(100vh - 78px);
  padding: 14px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  min-height: calc(100vh - 106px);
  border: 1px solid var(--line);
  background: var(--line);
}

.weekday {
  background: #eef2f6;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
  min-height: 30px;
  padding: 8px;
  text-align: center;
}

.calendar-grid {
  display: contents;
}

.day {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 118px;
  padding: 8px;
  overflow: hidden;
  background: var(--panel);
  border: 0;
  border-radius: 0;
  text-align: left;
}

.day:hover {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.day.outside {
  background: #f8fafc;
  color: #98a2b3;
}

.day.today {
  background: var(--today);
}

.day.has-added-reservations {
  background: var(--added-reservation);
}

.day-number {
  font-weight: 800;
  font-size: 15px;
}

.reservation-line {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.availability-line {
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
  margin-top: auto;
}

.modal {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(460px, calc(100vw - 28px));
  box-shadow: 0 22px 70px rgb(15 23 42 / 24%);
}

.modal::backdrop {
  background: rgb(15 23 42 / 45%);
}

.modal-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

.modal-header h2 {
  font-size: 20px;
}

.icon-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: white;
}

input:focus {
  outline: 2px solid rgb(15 118 110 / 22%);
  border-color: var(--accent);
}

.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.error {
  min-height: 20px;
  color: var(--danger);
  font-size: 14px;
}

.danger {
  color: white;
  background: var(--danger);
  border-color: var(--danger);
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .calendar-shell {
    overflow-x: auto;
    padding: 8px;
  }

  .calendar {
    min-width: 760px;
  }
}
