:root {
  color-scheme: light;
  --bg: #eee8dc;
  --paper: #fbf7ee;
  --paper-soft: #f5efe4;
  --paper-deep: #ebe1d2;
  --line: #d8cebf;
  --line-strong: #c7bbab;
  --text: #202522;
  --heading: #182321;
  --muted: #6f756f;
  --faint: #8e918b;
  --navy: #27384b;
  --slate: #6f8494;
  --forest: #4d6f5d;
  --lamp: #c99b61;
  --rust: #9a655a;
  --shadow: 0 18px 42px rgba(50, 40, 28, 0.13), 0 1px 0 rgba(255, 255, 255, 0.75) inset;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 248, 229, 0.92), rgba(238, 232, 220, 0) 34rem),
    linear-gradient(180deg, #f3eee4 0%, var(--bg) 46%, #e8dfd1 100%);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(30px, env(safe-area-inset-bottom));
  display: grid;
  gap: 18px;
}

.hero {
  padding: 8px 10px 0;
  display: grid;
}

.eyebrow {
  color: var(--forest);
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--heading);
  font-size: clamp(28px, 7.2vw, 36px);
  line-height: 1.02;
  letter-spacing: 0;
  max-width: 11ch;
}

h2 {
  color: var(--heading);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 850;
}

h3 {
  font-size: 14px;
  color: var(--navy);
  font-weight: 850;
}

.panel,
.setup {
  background: color-mix(in srgb, var(--paper) 94%, white 6%);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.ghost-button,
.secondary-button,
.tab {
  border: 1px solid var(--line);
  background: rgba(255, 252, 244, 0.6);
  color: var(--text);
  border-radius: 999px;
  min-height: 38px;
  padding: 0 13px;
  cursor: pointer;
}

.ghost-button {
  color: var(--forest);
  font-size: 13px;
  font-weight: 800;
}

.picker {
  display: grid;
  gap: 12px;
  padding: 12px 0;
}

.picker-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.picker-header span {
  color: var(--muted);
  font-size: 13px;
  min-width: 84px;
  text-align: right;
}

.options {
  display: grid;
  grid-template-columns: repeat(var(--option-count, 4), minmax(52px, 1fr));
  gap: 10px;
}

.choice {
  appearance: none;
  border: 1px solid rgba(80, 71, 59, 0.12);
  background: rgba(255, 252, 244, 0.58);
  color: color-mix(in srgb, var(--choice) 74%, var(--text) 26%);
  border-radius: 18px;
  min-height: 92px;
  padding: 11px 5px 10px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 9px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.choice[aria-pressed="true"] {
  background: var(--choice-bg);
  border-color: color-mix(in srgb, var(--choice) 70%, var(--line-strong) 30%);
  box-shadow: 0 10px 24px rgba(45, 37, 26, 0.12);
  transform: translateY(-1px);
}

.icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--choice) 14%, white 86%);
  border: 1px solid color-mix(in srgb, var(--choice) 38%, white 62%);
  color: color-mix(in srgb, var(--choice) 68%, var(--text) 32%);
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 900;
}

.choice-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.1;
}

.reflection {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 106px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 252, 244, 0.74);
  color: var(--text);
  padding: 16px 17px;
  outline: none;
  line-height: 1.45;
}

textarea::placeholder {
  color: var(--faint);
}

.primary-button,
.secondary-button {
  width: 100%;
  margin-top: 16px;
  font-weight: 900;
}

.primary-button {
  min-height: 64px;
  border: 0;
  border-radius: 18px;
  background: var(--navy);
  color: #fffaf0;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(39, 56, 75, 0.22);
}

.primary-button:disabled {
  background: #d7cebf;
  color: #8a8377;
  box-shadow: none;
  cursor: default;
}

.status-line {
  min-height: 20px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 7px;
}

.tab {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
}

.tab.active {
  border-color: color-mix(in srgb, var(--forest) 45%, var(--line) 55%);
  color: var(--forest);
  background: rgba(77, 111, 93, 0.1);
}

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

.entry {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.64);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.entry-meta {
  color: var(--muted);
  font-size: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(77, 111, 93, 0.1);
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
}

.entry-text,
.empty,
.setup p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.setup {
  display: none;
}

.setup.visible {
  display: grid;
  gap: 8px;
}

code {
  color: var(--forest);
}

@media (max-width: 360px) {
  .app {
    padding-left: 12px;
    padding-right: 12px;
  }

  .options {
    gap: 6px;
  }

  .choice {
    min-height: 78px;
  }

  .icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  textarea {
    min-height: 82px;
  }
}
