:root {
  color-scheme: light;
  --background: #f5f6f2;
  --paper: #fff;
  --ink: #202c24;
  --muted: #7e887f;
  --line: #e8ebe4;
  --green: #577a60;
  --green-dark: #3f6248;
  --green-soft: #eaf0e8;
  --coral: #cb765f;
  --danger: #a94438;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 8% 2%, rgba(218, 228, 211, 0.55), transparent 32rem),
    var(--background);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.page-shell {
  min-height: 100vh;
  padding: 54px 24px 30px;
}

.container {
  width: min(100%, 1120px);
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 44px;
  margin-bottom: 48px;
}

.hero-copy,
.clock-panel,
.calendar-cell {
  opacity: 1;
}

.eyebrow,
.section-kicker,
.clock-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.eyebrow {
  margin-bottom: 14px;
}

.eyebrow-dot,
.clock-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
}

.hero h1 {
  margin: 0;
  font-family: "Manrope", "DM Sans", sans-serif;
  font-size: clamp(2.8rem, 5.5vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 1.07;
}

.hero h1 span {
  color: var(--green);
}

.hero-description {
  max-width: 470px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.month-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.progress-number {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #dce5d9;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-family: "Manrope", sans-serif;
  font-size: 19px;
  font-weight: 700;
}

.progress-copy,
.progress-copy strong,
.progress-copy span {
  display: block;
}

.progress-copy strong {
  font-size: 12px;
  font-weight: 700;
}

.progress-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.clock-panel {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 25px;
  border-radius: 22px;
  background: #263a2d;
  box-shadow: 0 18px 44px rgba(40, 60, 43, 0.13);
  color: #fff;
}

.clock-label {
  position: relative;
  z-index: 1;
  color: #c4d2c3;
  font-size: 9px;
}

.clock-indicator {
  width: 6px;
  height: 6px;
  background: #b2d091;
  box-shadow: 0 0 12px rgba(178, 208, 145, 0.75);
}

.today-number {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
  font-family: "Manrope", sans-serif;
  font-size: 64px;
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.today-month {
  color: #c4d2c3;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.clock-date {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: #c4d2c3;
  font-size: 12px;
}

.clock-decoration {
  position: absolute;
  right: -54px;
  bottom: -116px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(217, 231, 210, 0.11);
  border-radius: 50%;
}

.clock-decoration::before,
.clock-decoration::after {
  position: absolute;
  border: 1px solid rgba(217, 231, 210, 0.1);
  border-radius: 50%;
  content: "";
}

.clock-decoration::before {
  inset: 22px;
}

.clock-decoration::after {
  inset: 44px;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -26px 0 24px;
  padding: 13px 16px;
  border: 1px solid #efd1ca;
  border-radius: 13px;
  background: #fff5f2;
  color: var(--danger);
  font-size: 12px;
}

.calendar-section {
  padding: 27px;
  border: 1px solid rgba(224, 228, 219, 0.85);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 54px rgba(56, 67, 52, 0.045);
}

.calendar-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.month-heading h2 {
  margin: 5px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.calendar-controls,
.month-arrows {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-arrows {
  gap: 4px;
  margin-left: 4px;
}

.btn,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:active:not(:disabled),
.icon-button:active:not(:disabled) {
  transform: scale(0.96);
}

.btn:disabled,
.icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-today {
  min-height: 34px;
  padding: 7px 12px;
  border-color: var(--line);
  border-radius: 9px;
  background: var(--paper);
  font-size: 11px;
  font-weight: 700;
}

.btn-today:hover:not(:disabled) {
  border-color: #cbd9c7;
  background: #f7faf5;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-color: var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--green-dark);
  font-size: 23px;
  line-height: 1;
}

.icon-button:hover:not(:disabled) {
  border-color: #cbd9c7;
  background: var(--green-soft);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--line);
  gap: 1px;
}

.weekday {
  display: grid;
  min-width: 0;
  min-height: 39px;
  place-items: center;
  background: #f7f8f5;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.weekday-short {
  display: none;
}

.calendar-cell {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 120px;
  flex-direction: column;
  padding: 9px;
  background: var(--paper);
  transition: background 150ms ease;
}

.calendar-cell:not(.is-empty):hover {
  background: #fbfcfa;
}

.calendar-cell.is-empty {
  background: #f8f9f7;
}

.calendar-cell.is-today {
  background: #f1f6ef;
}

.cell-top {
  display: flex;
  min-height: 23px;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}

.date-number {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #485449;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.today-number-badge {
  background: var(--green);
  color: #fff;
}

.add-task-button {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #879187;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms ease, background 140ms ease, color 140ms ease;
}

.calendar-cell:hover .add-task-button,
.add-task-button:focus-visible {
  opacity: 1;
}

.add-task-button:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}

.cell-tasks {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin-top: 6px;
}

.task-chip,
.dialog-task {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  border-radius: 6px;
  background: #edf3eb;
}

.task-chip {
  min-height: 22px;
  padding: 2px 3px 2px 5px;
}

.task-chip.is-done,
.dialog-task.is-done {
  background: #f2f3f0;
}

.task-toggle {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  text-align: left;
  cursor: pointer;
}

.task-check {
  display: grid;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #9db59b;
  border-radius: 4px;
  background: #fff;
  font-size: 9px;
  line-height: 1;
}

.is-done .task-check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.task-title {
  display: block;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.is-done .task-title {
  color: #91998f;
  text-decoration: line-through;
}

.task-delete {
  display: grid;
  width: 17px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8f998e;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}

.task-chip:hover .task-delete,
.task-delete:focus-visible {
  opacity: 1;
}

.task-delete:hover {
  background: #fbe8e3;
  color: var(--danger);
}

.more-tasks {
  overflow: hidden;
  padding: 1px 3px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-error {
  color: var(--danger);
  font-size: 9px;
}

.loading-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 16px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-today {
  background: var(--green);
}

.legend-task {
  background: #a9c2a6;
}

.legend-hint {
  margin-left: auto;
  color: #929b91;
  font-size: 10px;
}

.footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 10px;
}

.footer-sparkle {
  color: var(--coral);
  font-size: 13px;
}

.dialog-backdrop {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  overflow-y: auto;
  place-items: center;
  padding: 20px;
  background: rgba(25, 36, 28, 0.42);
  backdrop-filter: blur(4px);
}

.task-dialog {
  position: relative;
  width: min(100%, 430px);
  padding: 29px;
  border: 1px solid rgba(224, 228, 219, 0.9);
  border-radius: 21px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(25, 36, 28, 0.2);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 17px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.task-dialog h2 {
  margin: 5px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.dialog-description {
  margin: 6px 0 19px;
  color: var(--muted);
  font-size: 12px;
}

.dialog-task-list {
  display: grid;
  gap: 7px;
  max-height: 170px;
  overflow-y: auto;
  margin-bottom: 19px;
}

.dialog-task-list h3 {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.dialog-task {
  min-height: 34px;
  padding: 5px 7px;
}

.dialog-task .task-check {
  width: 15px;
  height: 15px;
}

.dialog-task .task-title {
  font-size: 12px;
}

.dialog-task-delete {
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--danger);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.dialog-task-delete:hover {
  background: #fff0ec;
}

.task-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #fafbf9;
  color: var(--ink);
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.task-input:focus {
  border-color: #9eb69b;
  box-shadow: 0 0 0 3px rgba(103, 139, 105, 0.1);
}

.task-input::placeholder {
  color: #a3aaa1;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.input-counter {
  color: var(--muted);
  font-size: 10px;
}

.btn-save {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.btn-save:hover:not(:disabled) {
  background: var(--green-dark);
}

.btn-retry {
  min-height: 32px;
  padding: 6px 10px;
  border-color: #e5b9ae;
  border-radius: 8px;
  background: transparent;
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
}

.dialog-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 11px;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.no-js {
  width: min(calc(100% - 32px), 640px);
  margin: 30px auto;
  padding: 16px;
  border: 1px solid #e7d5a2;
  border-radius: 12px;
  background: #fff8e5;
}

.btn:focus-visible,
.icon-button:focus-visible,
.add-task-button:focus-visible,
.task-toggle:focus-visible,
.task-delete:focus-visible,
.dialog-task-delete:focus-visible,
.dialog-close:focus-visible,
.task-input:focus-visible {
  outline: 3px solid rgba(87, 122, 96, 0.3);
  outline-offset: 2px;
}

@media (max-width: 800px) {
  .page-shell {
    padding: 38px 18px 26px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 24px;
    margin-bottom: 36px;
  }

  .clock-panel {
    min-height: 175px;
    padding: 22px;
  }

  .today-number {
    font-size: 56px;
  }

  .calendar-section {
    padding: 20px;
  }

  .calendar-cell {
    min-height: 104px;
    padding: 7px;
  }

  .calendar-legend {
    flex-wrap: wrap;
    gap: 10px 16px;
  }
}

@media (max-width: 600px) {
  .page-shell {
    padding: 27px 12px 22px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 19px;
    margin-bottom: 25px;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 12vw, 3.8rem);
  }

  .hero-description {
    max-width: 410px;
    margin-top: 12px;
    font-size: 12px;
  }

  .month-progress {
    margin-top: 15px;
  }

  .clock-panel {
    min-height: auto;
    padding: 17px 20px;
    border-radius: 17px;
  }

  .today-number {
    gap: 9px;
    margin-top: 8px;
    font-size: 46px;
  }

  .clock-date {
    margin-top: 4px;
    font-size: 11px;
  }

  .calendar-section {
    padding: 14px 9px;
    border-radius: 18px;
  }

  .calendar-toolbar {
    align-items: center;
    gap: 5px;
    margin: 0 3px 12px;
  }

  .section-kicker {
    font-size: 8px;
  }

  .month-heading h2 {
    font-size: 17px;
  }

  .calendar-controls {
    gap: 4px;
  }

  .month-arrows {
    gap: 3px;
    margin-left: 0;
  }

  .btn-today {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 9px;
  }

  .icon-button {
    width: 30px;
    height: 30px;
  }

  .calendar-grid {
    border-radius: 10px;
  }

  .weekday {
    min-height: 31px;
    font-size: 9px;
  }

  .weekday-full {
    display: none;
  }

  .weekday-short {
    display: inline;
  }

  .calendar-cell {
    min-height: 82px;
    padding: 3px 2px;
  }

  .cell-top {
    min-height: 20px;
    justify-content: center;
  }

  .date-number {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .add-task-button {
    position: absolute;
    z-index: 1;
    top: 2px;
    right: 1px;
    width: 15px;
    height: 15px;
    border-radius: 4px;
    font-size: 13px;
    opacity: 1;
  }

  .cell-tasks {
    gap: 3px;
    margin-top: 3px;
  }

  .task-chip {
    min-height: 16px;
    gap: 2px;
    padding: 1px 2px;
    border-radius: 4px;
  }

  .task-toggle {
    gap: 2px;
  }

  .task-check {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    font-size: 6px;
  }

  .task-title {
    font-size: 8px;
    line-height: 1.2;
  }

  .task-delete {
    display: none;
  }

  .more-tasks {
    padding-inline: 1px;
    font-size: 7px;
  }

  .cell-error {
    font-size: 7px;
  }

  .legend-item,
  .legend-hint {
    font-size: 8px;
  }

  .calendar-legend {
    gap: 8px 12px;
    margin: 12px 3px 0;
  }

  .legend-hint {
    flex-basis: 100%;
    margin-left: 0;
  }

  .footer-note {
    margin-top: 18px;
    font-size: 9px;
    text-align: center;
  }

  .task-dialog {
    padding: 25px 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
