:root {
  color-scheme: light;
  --bg: #e7efe8;
  --paper: #fbf8f2;
  --ink: #1c3128;
  --muted: #3e564b;
  --line: rgba(28, 49, 40, 0.12);
  --wash-a: rgba(168, 196, 176, 0.85);
  --wash-b: rgba(226, 208, 184, 0.72);
  --orb: rgba(143, 184, 163, 0.42);
  --sage: #2f5648;
  --on-sage: #f6f3ec;
  --cream: #f6f3ec;
  --cream-soft: #d5e3db;
  --after: #1e3c33;
  --after-glow: #3e6b5c;
  --focus: #1f4a3c;
  --shadow: 0 14px 36px rgba(28, 49, 40, 0.07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141e1a;
    --paper: #1c2923;
    --ink: #e8f1eb;
    --muted: #c5d5cb;
    --line: rgba(232, 241, 235, 0.14);
    --wash-a: rgba(46, 92, 76, 0.45);
    --wash-b: rgba(36, 58, 68, 0.5);
    --orb: rgba(90, 140, 118, 0.28);
    --sage: #c5ddd0;
    --on-sage: #163028;
    --cream: #f3efe6;
    --cream-soft: #c9ddd3;
    --after: #102823;
    --after-glow: #2c5548;
    --focus: #e4d3b4;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(90% 48% at 100% -8%, var(--wash-a), transparent 58%),
    radial-gradient(80% 42% at -10% 100%, var(--wash-b), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

::selection {
  background: #c9ddd2;
  color: #1c3128;
}

@media (prefers-color-scheme: dark) {
  ::selection {
    background: #3d5c50;
    color: #f6f3ec;
  }
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  transform: translateY(-150%);
  background: var(--sage);
  color: var(--on-sage);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  z-index: 5;
}

.skip:focus {
  transform: none;
}

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: min(40rem, 100%);
  margin: 0 auto;
  padding: calc(1.15rem + env(safe-area-inset-top)) 1.35rem 2.25rem;
  flex: 1;
}

.screen.has-dock .wrap {
  padding-bottom: 12rem;
}

#screen-after .wrap {
  padding-bottom: 16.5rem;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.kicker,
.say-label,
.section-label {
  margin: 0 0 0.65rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.wordmark {
  margin: 0 0 1.35rem;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--sage);
}

h1,
h2,
.line,
.after-more,
.row strong {
  font-family: var(--serif);
  font-weight: 500;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 8vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lede {
  margin: 1.05rem 0 0;
  max-width: 34rem;
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--ink);
}

.fine,
.row span,
.follow p,
.prose p,
.prose li,
.helpline small,
.note-card p,
.name-ask,
.status {
  color: var(--muted);
}

.fine {
  margin: 1.15rem 0 0;
  font-size: 0.98rem;
  line-height: 1.5;
}

#screen-home {
  overflow-x: clip;
}

#screen-home .wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: calc(1.6rem + env(safe-area-inset-top));
}

#screen-home .wrap::before {
  content: "";
  position: absolute;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  right: -5rem;
  top: 5.5rem;
  background: radial-gradient(circle, var(--orb), transparent 68%);
  pointer-events: none;
}

#screen-home .wrap > * {
  position: relative;
}

#screen-home .actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 2.5rem;
}

.btn,
.text-btn,
.row,
.helpline,
.chip {
  font-family: var(--sans);
}

.btn {
  appearance: none;
  border: 0;
  width: 100%;
  min-height: 3.5rem;
  border-radius: 999px;
  padding: 0.95rem 1.3rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--sage);
  color: var(--on-sage);
}

#screen-home .btn.primary {
  min-height: 5.25rem;
  padding: 1.2rem 1.45rem;
  font-size: 1.35rem;
}

.btn.ghost,
.text-btn {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.btn.ghost {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: var(--shadow);
}

.text-btn {
  border: 0;
  min-height: 2.75rem;
  padding: 0.45rem 0.15rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.22em;
}

.top .text-btn {
  padding: 0.45rem 0.7rem;
}

.top .text-btn:first-child {
  margin-left: -0.7rem;
}

button.link {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

#screen-support h1,
#screen-notes h1,
#screen-situations h1,
#screen-unwind h1,
#screen-letters h1,
#screen-profile h1 {
  font-size: clamp(2rem, 6.4vw, 2.75rem);
}

.prose h3 {
  margin: 1.35rem 0 0.3rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
}

fieldset.field {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

.row {
  width: 100%;
  text-align: left;
  background: var(--paper);
  color: inherit;
  border: 0;
  border-radius: 22px;
  padding: 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  cursor: pointer;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}

.row strong {
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.row span {
  font-size: 0.98rem;
  line-height: 1.45;
}

.line {
  margin: 0.35rem 0 1.5rem;
  font-size: clamp(1.75rem, 5.6vw, 2.4rem);
  line-height: 1.28;
  letter-spacing: -0.025em;
  user-select: text;
}

.safety {
  margin: 0 0 1.1rem;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: #f6e7da;
  color: #4a2c22;
  font-weight: 650;
  line-height: 1.45;
}

@media (prefers-color-scheme: dark) {
  .safety {
    background: #3a2a22;
    color: #f6e6dc;
  }
}

.follow {
  margin: 0 0 1.25rem;
  padding-top: 0.15rem;
}

.follow h2,
.prose h2 {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.follow p,
.prose p,
.prose li {
  margin: 0.45rem 0 0;
  font-size: 1.02rem;
  line-height: 1.55;
}

.prose h2 {
  margin-top: 2.15rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose ul,
.prose ol {
  margin: 0.55rem 0 0;
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.45rem;
}

.prose a {
  color: var(--sage);
  text-underline-offset: 0.18em;
}

.jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.15rem 0 0.5rem;
}

.jumps a {
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.helpline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 22px;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}

.helpline strong {
  display: block;
  font-size: 1.05rem;
  color: var(--ink);
}

.helpline small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

.helpline .num {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--sage);
}

.callout {
  margin-top: 0.95rem;
  padding: 1.15rem 1.15rem 1.2rem;
  border-radius: 22px;
  background: #243f36;
  color: var(--cream);
  box-shadow: var(--shadow);
}

.callout p,
.callout a,
.callout strong {
  color: var(--cream);
}

.callout p {
  margin: 0.4rem 0 0;
}

.callout a {
  font-weight: 650;
}

.dock {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 0.85rem 1.35rem calc(0.95rem + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 0;
  box-shadow: 0 -18px 28px rgba(28, 49, 40, 0.06);
}

.dock-inner {
  width: min(40rem, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#screen-after {
  background:
    radial-gradient(100% 58% at 50% -12%, var(--after-glow), transparent 62%),
    var(--after);
  color: var(--cream);
  --focus: #f0e2c8;
}

#screen-after .kicker,
#screen-after .fine,
#screen-after .name-ask,
#screen-after .name-line {
  color: var(--cream-soft);
}

#screen-after h1 {
  color: var(--cream);
  font-size: clamp(2.2rem, 7.4vw, 3.15rem);
}

.after-more {
  margin: 0.35rem 0 0;
  font-size: clamp(1.28rem, 4vw, 1.55rem);
  line-height: 1.45;
  color: var(--cream);
}

.name-line {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.3rem;
}

.minute {
  margin-top: 1.6rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(197, 217, 204, 0.65), transparent 58%),
    var(--paper);
  box-shadow: var(--shadow);
}

.minute h2 {
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--sage);
}

.minute p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

#screen-after .minute {
  background: rgba(246, 243, 236, 0.1);
  box-shadow: inset 0 0 0 1px rgba(246, 243, 236, 0.14);
}

#screen-after .minute h2 {
  color: var(--cream-soft);
}

#screen-after .minute p {
  color: var(--cream);
}

#screen-after .dock {
  background: var(--after);
  box-shadow: 0 -18px 28px rgba(8, 24, 20, 0.22);
}

#screen-after .btn.primary {
  background: var(--cream);
  color: #1e3c33;
}

#screen-after .btn.ghost,
#screen-after .text-btn {
  color: var(--cream);
}

#screen-after .btn.ghost {
  background: rgba(246, 243, 236, 0.12);
  box-shadow: none;
}

#screen-after input {
  background: rgba(251, 248, 242, 0.94);
  color: #1c3128;
  border-color: transparent;
}

#screen-after input::placeholder {
  color: #3e564b;
}

.name-ask {
  margin-top: 1.5rem;
}

.name-row {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.name-row .btn {
  width: auto;
  min-width: 5.75rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.15rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field > span,
.check {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

input[type="text"],
input[type="url"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.45 var(--sans);
  padding: 0.85rem 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 252, 247, 0.4);
}

textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.98rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip:has(input:checked) {
  background: var(--sage);
  color: var(--on-sage);
}

.chip:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-weight: 600;
}

.check input {
  margin-top: 0.25rem;
  width: 1.15rem;
  height: 1.15rem;
}

.note-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.note-card {
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}

.note-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
}

.note-card p {
  margin: 0.4rem 0 0;
  line-height: 1.5;
}

.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.private {
  margin-top: 0.75rem;
}

.private summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.status {
  min-height: 1.4rem;
  margin: 0.45rem 0 0;
}

.blank {
  white-space: pre-wrap;
  font-family: var(--sans);
  background: var(--paper);
  border: 0;
  border-radius: 18px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px var(--line);
}

details.sources {
  margin-top: 1.6rem;
}

details.sources summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.noscript {
  width: min(40rem, calc(100% - 2.5rem));
  margin: 1rem auto;
  padding: 1.1rem 1.15rem;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.article-card {
  margin-top: 1.15rem;
  padding: 1.05rem 1.1rem 1.15rem;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}

.article-card p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.article-card strong {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.article-card a {
  color: var(--sage);
}

.offers {
  padding-left: 1.15rem;
}

.offers li {
  margin: 0.75rem 0;
}

.offers a {
  font-weight: 650;
}

#letter-body {
  min-height: 18rem;
  line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .btn:active {
    transform: none;
  }
}

@media (min-width: 720px) {
  .helpline .num {
    font-size: 1.15rem;
  }
}
