:root {
  color-scheme: light;
  --ink: #233b35;
  --muted: #596c65;
  --green: #aee0b3;
  --red: #edaaa1;
  --accent: #275b45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f5ef;
  color: var(--ink);
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px max(20px, calc((100% - 1120px) / 2));
  border-bottom: 1px solid #dbe2d8;
  background: #fff;
}

.brand {
  font-weight: 750;
  text-decoration: none;
  color: var(--ink);
}

.brand span {
  display: block;
  font-size: .8rem;
  font-weight: 400;
  color: var(--muted);
}

main {
  max-width: 1160px;
  margin: 40px auto;
  padding: 0 20px;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.15;
  margin: 8px 0 16px;
}

h2 {
  font-size: 1.2rem;
  margin: 0 0 16px;
}

p {
  margin: 12px 0 20px;
}

.eyebrow {
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.card {
  background: #fff;
  border: 1px solid #dbe2d8;
  border-radius: 14px;
  padding: 24px;
}

.login {
  max-width: 440px;
  margin: 80px auto;
}

.login input {
  margin-bottom: 20px;
}

.login button {
  width: 100%;
}

label {
  display: block;
  font-size: .85rem;
  font-weight: 650;
  margin-bottom: 6px;
}

input, select, button, .button {
  font: inherit;
  border-radius: 7px;
  min-height: 44px;
}

input, select {
  display: block;
  width: 100%;
  padding: 10px;
  color: var(--ink);
  border: 1px solid #b9c8bf;
  background: #fff;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

button:hover, .button:hover {
  filter: brightness(.93);
}

.secondary {
  background: #eef3ed;
  color: var(--ink);
  border-color: #dbe2d8;
}

:focus-visible {
  outline: 3px solid #215da6;
  outline-offset: 3px;
}

.notice {
  padding: 12px 16px;
  border: 1px solid #8ac79c;
  background: #e1f2e5;
  border-radius: 8px;
}

.error {
  border-color: #d5938a;
  background: #fae6e1;
}

.toolbar, .toolbar nav, .month-form {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar {
  justify-content: space-between;
  margin-top: 28px;
}

.toolbar h2 {
  margin: 0;
  min-width: 160px;
  text-align: center;
}

.month-form label {
  margin: 0;
}

.month-form input {
  width: auto;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #0002;
}

.status-0 {
  background: var(--green);
}

.status-1 {
  background: var(--red);
}

.status-2 {
  background: linear-gradient(135deg, var(--green) 50%, var(--red) 50%);
}

.status-3 {
  background: linear-gradient(135deg, var(--red) 50%, var(--green) 50%);
}

.calendars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.calendar table {
  width: 100%;
  table-layout: fixed;
  border-spacing: 5px;
}

.calendar th {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  padding-bottom: 12px;
}

.calendar td {
  padding: 0;
}

.day {
  color: #19372c;
  width: 100%;
  min-height: 44px;
  padding: 4px;
  aspect-ratio: 1.15;
}

.day span {
  background: #ffffffb8;
  border-radius: 4px;
  min-width: 25px;
  padding: 1px 3px;
}

.day[aria-pressed="true"] {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.editor {
  margin-top: 24px;
}

.editor form {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  align-items: end;
  gap: 16px;
}

.muted {
  font-size: .85rem;
  color: var(--muted);
}

.editor .muted {
  margin-bottom: 0;
}

footer {
  text-align: center;
  padding: 24px;
  font-size: .8rem;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 800px) {
  .calendars {
    grid-template-columns: 1fr;
  }

  .editor form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 480px) {
  main {
    margin-top: 24px;
    padding: 0 12px;
  }

  .card {
    padding: 16px;
  }

  .header {
    padding: 16px 12px;
  }

  .header button {
    font-size: .8rem;
    padding: 8px;
  }

  .toolbar {
    gap: 20px;
  }

  .toolbar nav {
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

  .month-form {
    gap: 8px;
  }

  .month-form label {
    width: 100%;
  }

  .calendar table {
    border-spacing: 3px;
  }

  .day {
    min-height: 36px;
  }

  .editor form {
    grid-template-columns: 1fr;
  }

  .login {
    margin: 40px auto;
  }

}
