* { box-sizing: border-box; margin:0; padding:0; }

body {
  font-family: sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1vh;
  min-height: 100vh;
}

.calendar {
  width: 100%;
  max-width: 480px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5em;
}

.nav h2 {
  font-weight: normal;
  letter-spacing: 1px;
  font-size: clamp(1rem, 4vw, 1.4rem);
}

.nav button {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.3em 0.8em;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  cursor: pointer;
  color: #333;
  line-height: 1;
}

.nav button:hover { background: #f4f4f4; }
.nav button:active { background: #eee; }

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

th {
  color: #999;
  font-weight: normal;
  font-size: clamp(0.65rem, 2.5vw, 0.8rem);
  padding-bottom: 0.6em;
  text-align: center;
}

td {
  text-align: center;
  font-size: clamp(0.8rem, 3vw, 1rem);
  padding: 0;
}

td span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(28px, 8vw, 42px);
  height: clamp(28px, 8vw, 42px);
  border-radius: 50%;
}

td.today span { border: 1px solid #222; }
td.muted span { color: #ccc; }

@media (prefers-color-scheme: dark) {
  body {
    background-color: #222;
    color: #ddd;
  }
  .nav button {
    border: 1px solid #333;
    color: #bbb;
  }
  .nav button:hover { background: #333; }
  .nav button:active { background: #444; }
  th { color: #999; }
  td.today span { border: 1px solid #bbb; }
  td.muted span { color: #555; }
}
