:root {
  --background: #f2f5ef;
  --surface: #fffefa;
  --surface-soft: #e9f0e7;
  --ink: #25352f;
  --muted: #65736d;
  --sage: #718b79;
  --sage-dark: #4d6958;
  --sage-pale: #dbe7dc;
  --peach: #f2d3bb;
  --line: #dce4dc;
  --danger: #a34f4f;
  --shadow: 0 18px 45px rgba(50, 71, 58, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(242, 211, 187, 0.35), transparent 25rem),
    radial-gradient(circle at 95% 25%, rgba(196, 216, 199, 0.45), transparent 28rem),
    var(--background);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 64px 0 44px;
}

.page-header {
  max-width: 600px;
  margin: 0 auto 40px;
  text-align: center;
}

.brand-mark {
  position: relative;
  width: 58px;
  height: 42px;
  margin: 0 auto 24px;
}

.brand-mark span {
  position: absolute;
  bottom: 0;
  width: 23px;
  height: 37px;
  border-radius: 100% 0 100% 0;
  background: var(--sage);
  transform-origin: bottom right;
}

.brand-mark span:first-child {
  left: 6px;
  transform: rotate(-36deg);
  background: #91a895;
}

.brand-mark span:nth-child(2) {
  left: 18px;
  height: 42px;
  transform: rotate(-7deg);
}

.brand-mark span:last-child {
  right: 3px;
  height: 32px;
  transform: scaleX(-1) rotate(-32deg);
  background: var(--peach);
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  color: var(--sage-dark);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.15;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.35rem, 8vw, 4rem);
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 5vw, 2rem);
  letter-spacing: -0.025em;
}

.intro {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.privacy-banner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 20px 22px;
  border: 1px solid #c7d7c9;
  border-radius: 18px;
  background: rgba(229, 240, 228, 0.82);
}

.privacy-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--sage-dark);
  background: rgba(255, 255, 255, 0.75);
}

.privacy-banner h2 {
  margin-bottom: 5px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: 0;
}

.privacy-banner p {
  margin-bottom: 0;
  color: #53665a;
  font-size: 0.88rem;
}

.card {
  border: 1px solid rgba(113, 139, 121, 0.16);
  border-radius: 24px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: var(--shadow);
}

.form-card {
  padding: clamp(24px, 6vw, 48px);
}

.section-heading {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 38px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.step-number {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: var(--sage-dark);
  background: var(--sage-pale);
  font-size: 0.8rem;
  font-weight: 750;
}

.form-group {
  margin: 0 0 30px;
  padding: 0;
  border: 0;
}

label,
legend {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 700;
}

.helper-text {
  margin: -5px 0 15px;
  color: var(--muted);
  font-size: 0.88rem;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fbfcf8;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="text"] {
  height: 50px;
  padding: 0 15px;
}

textarea {
  min-height: 92px;
  padding: 13px 15px;
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(113, 139, 121, 0.13);
}

::placeholder {
  color: #98a29e;
}

.emotion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.emotion-chip {
  margin: 0;
  cursor: pointer;
}

.emotion-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.emotion-chip span {
  display: flex;
  min-height: 48px;
  align-items: center;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcf8;
  font-size: 0.93rem;
  font-weight: 600;
  transition: all 160ms ease;
}

.emotion-chip input:checked + span {
  border-color: var(--sage);
  color: var(--sage-dark);
  background: var(--sage-pale);
  box-shadow: inset 0 0 0 1px var(--sage);
}

.emotion-chip input:focus-visible + span {
  outline: 3px solid rgba(113, 139, 121, 0.3);
  outline-offset: 2px;
}

.field-error {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label-row output {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--sage-dark);
  font-weight: 750;
}

input[type="range"] {
  width: 100%;
  height: 7px;
  border-radius: 99px;
  outline: none;
  background: var(--sage-pale);
  accent-color: var(--sage-dark);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.75rem;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--sage-dark);
  box-shadow: 0 10px 24px rgba(77, 105, 88, 0.22);
  font-weight: 750;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.primary-button:hover {
  background: #3f5c4a;
  transform: translateY(-1px);
}

.primary-button:focus-visible {
  outline: 3px solid rgba(77, 105, 88, 0.35);
  outline-offset: 3px;
}

.privacy-note {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.grounding-message {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #b9d0bc;
  border-radius: 18px;
  background: #e5f0e4;
  animation: settle-in 400ms ease both;
}

.grounding-message[hidden] {
  display: none;
}

.grounding-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--sage-dark);
  background: rgba(255, 255, 255, 0.65);
}

.grounding-message h2 {
  margin-bottom: 7px;
  font-size: 1.25rem;
}

.grounding-message p {
  margin-bottom: 0;
  color: #53665a;
  font-size: 0.91rem;
}

.history-section {
  margin-top: 56px;
}

.history-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.entry-count {
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-state {
  padding: 42px 20px;
  border: 1px dashed #c4d0c5;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
}

.empty-icon {
  margin-bottom: 10px;
  color: var(--sage);
  font-size: 2rem;
}

.check-in-list {
  display: grid;
  gap: 14px;
}

.history-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 254, 250, 0.8);
}

.history-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.history-date {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.history-emotions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.history-emotions span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--sage-dark);
  background: var(--sage-pale);
  font-size: 0.77rem;
  font-weight: 700;
}

.intensity-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 9px;
  color: var(--sage-dark);
  background: var(--surface-soft);
  font-size: 0.78rem;
  font-weight: 750;
}

.history-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.history-details div {
  display: grid;
  grid-template-columns: 95px 1fr;
  gap: 10px;
}

.history-details dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.history-details dd {
  margin: 0;
  color: #43534c;
  font-size: 0.88rem;
  white-space: pre-wrap;
}

footer {
  padding: 0 20px 35px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  text-align: center;
}

@keyframes settle-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 580px) {
  .emotion-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .page-shell {
    width: min(100% - 24px, 720px);
    padding-top: 42px;
  }

  .form-card {
    border-radius: 20px;
  }

  .privacy-banner {
    padding: 17px;
  }

  .emotion-grid {
    gap: 8px;
  }

  .emotion-chip span {
    padding: 9px 10px;
    font-size: 0.86rem;
  }

  .history-details div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
