* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #f6efe5, #dce8f2);
  color: #1d2935;
}

.app {
  width: min(100%, 1380px);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 24px;
  margin: 0 auto;
}

.sidebar {
  padding: 24px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 18px 50px rgba(29, 41, 53, 0.1);
  backdrop-filter: blur(10px);
}

.panel {
  width: 100%;
  padding: 32px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 50px rgba(29, 41, 53, 0.15);
}

.screen[hidden] {
  display: none;
}

.menu {
  display: grid;
  gap: 10px;
}

.menu-item {
  width: 100%;
  border: 1px solid rgba(53, 80, 103, 0.16);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 600;
  text-align: left;
  color: #1d2935;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.menu-item.is-active {
  color: #fff;
  background: #1d5c4d;
  border-color: #1d5c4d;
}

.menu-item--date {
  pointer-events: none;
  cursor: default;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a5c2e;
}

.input-row {
  display: flex;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.field {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #355067;
}

.text-input {
  width: 100%;
  border: 1px solid rgba(53, 80, 103, 0.22);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.92);
}

textarea.text-input {
  min-height: 220px;
  resize: vertical;
}

.text-input:focus {
  outline: 2px solid rgba(29, 92, 77, 0.24);
  border-color: #1d5c4d;
}

.actions button {
  width: 200px;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: #1d5c4d;
}

.phrase-count {
  margin: 0 auto 0 0;
  font-weight: 700;
  color: #355067;
}

.phrase-text {
  margin: 0;
  min-height: 220px;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1.5;
  white-space: pre-wrap;
}

.phrase-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.secondary-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: #355067;
  cursor: pointer;
}

.secondary-button:last-child {
  background: #1d5c4d;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.result {
  margin: 6px 0 0;
  min-height: 1.4em;
  font-weight: 700;
}

.calendar {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(53, 80, 103, 0.14);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.calendar-month {
  font-size: 0.82rem;
  font-weight: 700;
  color: #355067;
  letter-spacing: 0.05em;
}

.calendar-nav {
  border: 0;
  background: none;
  padding: 2px 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #355067;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
}

.calendar-nav:hover {
  background: rgba(29, 92, 77, 0.1);
}

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

.calendar-dow {
  font-size: 0.68rem;
  font-weight: 700;
  color: #7a5c2e;
  text-align: center;
  padding: 4px 0;
}

.calendar-day {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.72rem;
  color: #1d2935;
  text-align: center;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}

.calendar-day:hover:not(.is-today):not(.is-selected) {
  background: rgba(29, 92, 77, 0.1);
}

.calendar-day.is-today {
  color: #fff;
  background: #1d5c4d;
  font-weight: 700;
}

.calendar-day.is-selected {
  color: #fff;
  background: #355067;
  font-weight: 700;
}

.calendar-day.is-empty {
  cursor: default;
  pointer-events: none;
}

@media (max-width: 640px) {
  .app {
    grid-template-columns: 1fr;
  }

  .input-row {
    flex-direction: column;
  }

  .phrase-actions {
    justify-content: stretch;
  }

  .secondary-button {
    flex: 1;
  }
}
