:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #242d2a;
  background: #f5f6f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-weight: 400;

  --ink: #242d2a;
  --muted: #898f89;
  --green: #2f6250;
  --green-dark: #234b3d;
  --line: #eceee9;
  --accent-soft: #edf4ef;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -30%, #e8eee8 0, transparent 56%),
    #f5f6f2;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(100% - 48px, 880px);
  margin: 0 auto;
  padding: 38px 0 56px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 24px;
  font-weight: 800;
}

.brand-name,
.brand-subtitle,
.privacy-note,
.eyebrow,
.month-summary,
.calendar-footer,
.details-summary {
  margin: 0;
}

.brand-name {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #777f78;
  font-size: 12px;
}

.privacy-note span {
  color: #70a887;
  font-size: 9px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logout-button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #5d665f;
  font-size: 13px;
  cursor: pointer;
}

.logout-button:hover {
  background: var(--accent-soft);
}

.login-card {
  max-width: 420px;
  margin: 40px auto;
  padding: 28px;
  border: 1px solid #e9ece7;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 55px rgb(34 54 44 / 7%);
}

.login-card h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.login-card p {
  margin: 0 0 12px;
}

.login-card .storage-notice {
  margin: 14px 0 0;
}

.import-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -10px 0 20px;
  padding: 12px 14px;
  border: 1px solid #cfe0d5;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 13px;
}

.import-banner p {
  margin: 0;
}

.import-actions {
  display: flex;
  gap: 8px;
}

.calendar-card {
  overflow: hidden;
  padding: 36px 40px 22px;
  border: 1px solid #e9ece7;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 55px rgb(34 54 44 / 7%);
}

.calendar-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 29px;
}

.eyebrow {
  color: #819087;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.35px;
}

.month-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 7px 0 3px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(18px, 2.8vw, 23px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  text-transform: capitalize;
}

.month-picker-select,
.month-picker-year {
  height: 42px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.month-picker-select {
  min-width: 0;
  max-width: min(52vw, 240px);
  padding: 0 26px 0 2px;
  cursor: pointer;
}

.month-picker-year {
  width: 100px;
  min-width: 100px;
  flex: 0 0 100px;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}

.month-picker-select:hover,
.month-picker-year:hover {
  border-color: #e8ebe6;
  background: #fbfcfa;
}

.month-picker-select:focus-visible,
.month-picker-year:focus-visible {
  border-color: #91b29d;
  outline: 3px solid rgb(67 124 93 / 24%);
  outline-offset: 2px;
}

.month-picker-year::-webkit-inner-spin-button,
.month-picker-year::-webkit-outer-spin-button {
  margin-left: 2px;
}

.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.month-summary {
  color: var(--muted);
  font-size: 13px;
}

.month-controls {
  display: flex;
  gap: 8px;
  padding-bottom: 3px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid #e8ebe6;
  border-radius: 12px;
  background: #fff;
  color: #526259;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: #c9d8ce;
  background: #f6f9f6;
  color: var(--green);
}

.icon-button:focus-visible,
.day-number:focus-visible,
.add-button:focus-visible,
.delete-button:focus-visible,
.entry-input:focus-visible {
  outline: 3px solid rgb(67 124 93 / 24%);
  outline-offset: 2px;
}

.storage-notice {
  margin: -10px 0 20px;
  padding: 11px 14px;
  border: 1px solid #edd9b8;
  border-radius: 10px;
  background: #fff9ee;
  color: #745a30;
  font-size: 13px;
  line-height: 1.5;
}

.weekday-row,
.week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  padding-bottom: 12px;
  color: #989e98;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
}

.week-row {
  border-top: 1px solid var(--line);
  align-items: stretch;
}

.day-cell {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 72px;
  align-items: flex-start;
  justify-content: center;
  padding: 13px 4px 10px;
  border-right: 1px solid var(--line);
  transition: background 160ms ease;
}

.day-cell:first-child {
  border-left: 1px solid var(--line);
}

.day-cell.is-selected {
  background: #f3f7f3;
}

.day-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #37433c;
  cursor: pointer;
  font-size: 13px;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.day-number:hover {
  transform: scale(1.06);
  background: var(--accent-soft);
  color: var(--green-dark);
}

.is-outside-month .day-number {
  color: #b7bcb7;
}

.is-today .day-number {
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.is-today .day-number:hover,
.is-selected .day-number {
  background: var(--green-dark);
  color: #fff;
}

.today-label {
  position: absolute;
  top: 50px;
  color: var(--green);
  font-size: 9px;
  font-weight: 600;
}

.entry-count {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  padding: 0 4px;
  border-radius: 9px;
  background: #f6f0dc;
  color: #806b2f;
  font-size: 10px;
  font-weight: 700;
}

.is-outside-month .entry-count {
  color: #8c805e;
}

.day-details {
  grid-column: 1 / -1;
  overflow: hidden;
  max-height: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fbfcfa;
  transition:
    max-height 280ms cubic-bezier(0.2, 0.65, 0.3, 1),
    opacity 220ms ease;
}

.day-details:not(.is-closing) {
  border-bottom: 1px solid var(--line);
}

.day-details.is-closing {
  opacity: 0;
  pointer-events: none;
}

.details-content {
  padding: 23px 26px 18px;
}

.details-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.details-heading h3 {
  margin: 5px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 17px;
  font-weight: 700;
  text-transform: capitalize;
}

.details-heading .icon-button {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 21px;
}

.empty-state {
  margin: 20px 0 15px;
  color: #858e86;
  font-size: 13px;
}

.entry-list {
  display: grid;
  gap: 7px;
  margin: 17px 0;
  padding-left: 24px;
}

.entry-item {
  padding-left: 3px;
  color: #78827a;
}

.entry-item::marker {
  color: #7c9f87;
  font-size: 12px;
  font-weight: 700;
}

.entry-text {
  display: inline-block;
  max-width: calc(100% - 100px);
  color: #39463e;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.delete-button {
  margin-left: 12px;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9a7773;
  cursor: pointer;
  font-size: 11px;
  opacity: 0;
  transition:
    background 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

.entry-item:hover .delete-button,
.delete-button:focus-visible {
  opacity: 1;
}

.delete-button:hover {
  background: #fbefed;
  color: #a44f47;
}

.entry-form {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.entry-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid #e5e9e3;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: border-color 150ms ease;
}

.entry-input::placeholder {
  color: #a7ada7;
}

.entry-input:focus {
  border-color: #91b29d;
  outline: none;
}

.add-button {
  display: inline-flex;
  min-width: 106px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.add-button:hover {
  transform: translateY(-1px);
  background: var(--green-dark);
}

.add-button span {
  font-size: 18px;
  font-weight: 400;
  line-height: 0;
}

.details-summary {
  margin-top: 14px;
  color: #a1a7a1;
  font-size: 10px;
}

.calendar-footer {
  padding-top: 17px;
  color: #9da39d;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 28px, 500px);
    padding-top: 24px;
  }

  .page-header {
    margin-bottom: 20px;
  }

  .privacy-note {
    max-width: 145px;
    font-size: 10px;
    line-height: 1.4;
  }

  .calendar-card {
    padding: 25px 16px 18px;
    border-radius: 18px;
  }

  .calendar-heading {
    margin-bottom: 23px;
  }

  .month-picker {
    font-size: 20px;
  }

  .day-cell {
    min-height: 59px;
    padding-top: 10px;
  }

  .day-number {
    width: 31px;
    height: 31px;
    font-size: 12px;
  }

  .today-label {
    top: 42px;
    font-size: 8px;
  }

  .entry-count {
    top: 5px;
    right: 4px;
    min-width: 15px;
    height: 15px;
    font-size: 9px;
  }

  .details-content {
    padding: 19px 14px 16px;
  }

  .entry-form {
    gap: 7px;
  }

  .add-button {
    min-width: 90px;
    padding: 0 10px;
  }

  .delete-button {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
