:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1f2430;
  --muted: #8a919e;
  --accent: #2f6fed;
  --accent-soft: #e7f0ff;
  --weekend: #d94b4b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
}

.calendar {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.titles {
  text-align: center;
}

.titles h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.titles p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  direction: ltr;
}

.nav {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
}

.nav:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.today-btn {
  display: block;
  margin: 14px auto 4px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
}

.today-btn:hover {
  background: var(--accent-soft);
}

.weekdays,
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.weekdays {
  margin: 16px 0 6px;
}

.weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}

.weekdays .short {
  display: none;
}

.cell {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
}

.cell.blank {
  border: none;
  background: transparent;
}

.cell .jalali {
  font-size: 26px;
  font-weight: 700;
}

.cell .gregorian {
  align-self: flex-start;
  direction: ltr;
  font-size: 11px;
  color: var(--muted);
}

.cell .gregorian .mon {
  font-weight: 600;
}

.cell.weekend .jalali {
  color: var(--weekend);
}

.cell.today {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cell.today .jalali {
  color: var(--accent);
}

@media (max-width: 480px) {
  body {
    padding: 12px 6px;
  }

  .calendar {
    padding: 12px;
    border-radius: 12px;
  }

  .titles h1 {
    font-size: 19px;
  }

  .weekdays,
  .grid {
    gap: 3px;
  }

  .weekdays .full {
    display: none;
  }

  .weekdays .short {
    display: inline;
  }

  .cell {
    padding: 3px 4px;
    border-radius: 7px;
  }

  .cell .jalali {
    font-size: 15px;
  }

  .cell .gregorian {
    font-size: 9px;
  }
}
