:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  background: #fff;
  color: #000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #fff;
}

main {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(32px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

h1 {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.15;
}

.byline {
  margin: 0 0 24px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

input[type="text"],
input[type="tel"] {
  width: 100%;
  min-height: 48px;
  margin: 0 0 28px;
  padding: 10px 12px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 16px;
  appearance: none;
}

.vote-toggle {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 44px;
  margin: -12px 0 18px;
  gap: 9px;
  font-weight: 600;
  touch-action: manipulation;
}

.vote-toggle input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: #000;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid #000;
  outline-offset: 2px;
}

.month + .month {
  margin-top: 30px;
}

h2 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.2;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.weekday {
  padding: 0 0 6px;
  text-align: center;
  color: #555;
  font-size: 12px;
}

.empty,
.past,
.day {
  min-width: 0;
  height: 48px;
}

.past {
  display: grid;
  place-items: center;
  color: #aaa;
  font-size: 15px;
}

.day {
  position: relative;
  border: 1px solid #888;
  border-radius: 0;
  padding: 5px;
  background: #fff;
  color: #000;
  font: inherit;
  text-align: left;
  touch-action: manipulation;
  appearance: none;
}

.day[aria-pressed="true"] {
  border-color: #000;
  background: #000;
  color: #fff;
}

.day-number {
  position: absolute;
  top: 5px;
  left: 6px;
}

.count {
  display: none;
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 12px;
}

.show-votes .count {
  display: block;
}

.show-votes .day.rank-first {
  border-color: #6f956f;
  background: #d9edd9;
  color: #000;
}

.show-votes .day.rank-second {
  border-color: #ae983f;
  background: #f7edbd;
  color: #000;
}

.show-votes .day.rank-first[aria-pressed="true"],
.show-votes .day.rank-second[aria-pressed="true"] {
  border-color: #000;
  box-shadow: inset 0 0 0 3px #000;
}

#save {
  width: 100%;
  min-height: 50px;
  margin-top: 30px;
  border: 1px solid #000;
  border-radius: 0;
  background: #000;
  color: #fff;
  font: inherit;
  font-weight: 700;
  touch-action: manipulation;
  appearance: none;
}

#save:disabled:not(.complete) {
  opacity: 0.55;
}

#save.complete {
  border-color: #6f956f;
  background: #d9edd9;
  color: #000;
  opacity: 1;
}

#status {
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 14px;
}

@media (hover: hover) {
  .day:hover {
    border-color: #000;
  }
}
