:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f6f6;
  color: #222;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f6f6;
  color: #222;
}

.app {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 90px;
  background: #f6f6f6;
}

.topbar {
  height: 84px;
  padding: 20px 14px 10px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: end;
  background: #f6f6f6;
  border-bottom: 1px solid #e8e8e8;
}

.month-title {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 28px;
  padding: 0;
}

.calendar-panel {
  padding: 8px 8px 0;
}

.calendar {
  min-height: 440px;
}

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

.calendar-head {
  margin-bottom: 12px;
  padding: 0 4px;
}

.calendar-weekday {
  text-align: center;
  color: #b3b3b3;
  font-size: 14px;
  line-height: 1;
}

.calendar-day {
  border: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #202020;
  position: relative;
  line-height: 1;
}

.calendar-day .day-text {
  font-size: 15px;
  position: relative;
  z-index: 2;
}

.calendar-day.muted {
  color: #d4d4d4;
}

.calendar-day.period {
  color: #fff;
  background: #f55e9b;
}

.calendar-day.predicted {
  color: #fff;
  background: #efb3cf;
}

.calendar-day.ovulation {
  color: #fff;
  background: #c9b6ef;
}

.calendar-day.today {
  outline: 6px solid #b8e2f8;
  outline-offset: 2px;
}

.calendar-day.start::after {
  content: "◔";
  position: absolute;
  bottom: -12px;
  font-size: 14px;
  color: #f55e9b;
}

.legend-bar {
  margin-top: 14px;
  padding: 12px 10px;
  background: #ececec;
  border-top: 1px solid #e2e2e2;
  border-bottom: 1px solid #e2e2e2;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  color: #555;
  white-space: nowrap;
  overflow-x: auto;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: -1px;
}

.dot.period {
  background: #f55e9b;
}

.dot.predicted {
  background: #efb3cf;
}

.dot.fertile {
  background: #c9b6ef;
}

.status-row {
  margin-top: 10px;
  padding: 16px 14px;
  background: #f1f1f1;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-text {
  margin: 0;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.status-text strong {
  color: #f55e9b;
  font-size: 30px;
  font-weight: 600;
}

.status-text span {
  color: #999;
  font-size: 14px;
}

.text-btn {
  background: transparent;
  border: 0;
  color: #f55e9b;
  font-size: 16px;
  padding: 0;
}


.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 76px;
  background: #fff;
  border-top: 1px solid #e8e8e8;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.nav-item {
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #888;
  padding-top: 8px;
}

.nav-item span {
  font-size: 14px;
  margin-top: 4px;
}

.nav-item.active {
  color: #f55e9b;
}

.card {
  margin: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 10px;
}

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

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

label {
  font-size: 14px;
  color: #666;
  display: block;
}

input,
select,
button {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

.card button {
  border: none;
  background: #f55e9b;
  color: #fff;
}

ul {
  margin: 0;
  padding-left: 18px;
}

.status {
  min-height: 20px;
  color: #3b82f6;
}

.status.error {
  color: #dc2626;
}

.hidden {
  display: none;
}

@media (max-width: 390px) {
  .month-title {
    font-size: 20px;
  }

  .status-text strong {
    font-size: 26px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .legend-bar {
    gap: 10px;
    font-size: 14px;
  }
}