:root {
  --bg: #ffffff;
  --border: #DDDDDD;
  --text: #222222;
  --muted: #666666;
  --accent: #E69487;
  --hover: #f5f5f5;
}

body {
  margin: 0;
  padding: 20px;
  background: var(--bg);
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  color: var(--text);
}

.calendar-wrapper {
  border: 1px solid var(--border);
  padding: 20px;
}

.calendar-title {
  font-family: "Comforter", cursive;
  font-size: 39px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 10px;
}

.top-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.primary-button {
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
}

.primary-button:hover {
  background: var(--hover);
}

.view-switcher {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 16px 0;
  flex-wrap: wrap;
}

.view-switcher button {
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.view-switcher button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.calendar-grid {
  width: 100%;
  border-collapse: collapse;
}

.calendar-grid th {
  border: 1px solid var(--border);
  padding: 6px;
  text-align: center;
  font-weight: 700;
}

.calendar-grid td {
  border: 1px solid var(--border);
  padding: 6px;
  vertical-align: top;
  height: 42px;
}

.time-col {
  width: 64px;
}

.time-label {
  width: 64px;
  text-align: right;
  padding-right: 8px;
  color: var(--muted);
  border: none;
}

.month-cell {
  height: 110px;
}

.month-day-number {
  font-weight: 700;
  margin-bottom: 4px;
}

.event-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px 0;
  cursor: pointer;
  line-height: 1.2;
  max-width: 100%;
}

.event-chip:hover {
  background: var(--hover);
}

.event-dot {
  width: 8px;
  height: 8px;
  border-radius: 2.5px;
  flex: 0 0 auto;
}

.event-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.all-day-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.all-day-week {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.all-day-week-label {
  font-weight: 700;
  color: var(--muted);
  text-align: right;
  padding-right: 8px;
  align-self: start;
}

.all-day-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.all-day-pill {
  padding: 4px 6px;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-all-day-pill {
  padding: 2px 4px;
  border-radius: 4px;
  color: #ffffff;
  font-weight: 700;
  font-size: 10px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.quarter-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.month-block {
  border: 1px solid var(--border);
  padding: 10px;
}

.month-block-title {
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 6px;
}

.multi-month {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.mini-month {
  width: 260px;
  border: 1px solid var(--border);
  padding: 10px;
}

.mini-month-title {
  font-weight: 700;
  text-align: center;
  color: var(--accent);
  margin-bottom: 6px;
}

.mini-grid {
  width: 100%;
  border-collapse: collapse;
}

.mini-grid th,
.mini-grid td {
  border: 1px solid var(--border);
  text-align: center;
  padding: 4px;
  font-size: 10px;
}

.mini-all-day-pill {
  padding: 1px 2px;
  border-radius: 2px;
  color: #ffffff;
  font-weight: 700;
  font-size: 7px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 1px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 560px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px;
  box-sizing: border-box;
}

.calendar-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.calendar-picker-title {
  font-weight: 700;
}

.calendar-picker-actions {
  display: flex;
  gap: 8px;
}

.calendar-picker-actions button {
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  cursor: pointer;
}

.calendar-picker-actions button:hover {
  background: var(--hover);
}

.calendar-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 55vh;
  overflow: auto;
  padding-right: 4px;
}

.calendar-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
}

.calendar-picker-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2.5px;
}

.calendar-picker-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
