/*
 * HiHippo — "the persistent hippo"
 * Warm cream paper, near-black ink, one grape accent, and coral reserved for nagging.
 * Chunky display type, hard offset shadows on the things you type into.
 */

:root {
  --cream: #fbf7f1;
  --paper: #ffffff;
  --ink: #1c1530;
  --muted: #6f6880;
  --faint: #a59fb0;
  --line: #ebe4da;
  --line-soft: #f3eee7;
  --grape: #6a4cf5;
  --grape-deep: #4b2fd6;
  --grape-wash: #efeaff;
  --nag: #ff5a4e;
  --nag-deep: #d63a2f;
  --nag-wash: #ffe9e6;
  --sun: #fff7c2;
  --sun-ink: #7a5d00;
  --bubble: #ebe8f0;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 22px;
  --shadow-hard: 4px 4px 0 var(--ink);
  color-scheme: light;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
  min-width: 0;
  margin: 0;
  overflow-x: clip;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
button, input[type="submit"], summary { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--grape); }
img { max-width: 100%; }
::selection { background: var(--grape-wash); color: var(--grape-deep); }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--grape);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  font: 800 clamp(2.1rem, 5vw, 3.6rem)/0.98 var(--display);
  letter-spacing: -0.04em;
}

/* ---------- Wordmark & headers ---------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font: 800 1.3rem/1 var(--display);
  letter-spacing: -0.035em;
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.wordmark__mark { width: 44px; height: auto; transform: scaleX(-1); transition: transform 200ms ease; }
.wordmark:hover .wordmark__mark { transform: scaleX(-1) rotate(-8deg); }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(calc(100% - 32px), 760px);
  min-height: 72px;
  margin-inline: auto;
}

.site-header nav { display: flex; align-items: center; gap: 2px; }
.site-header form { margin: 0; }

.nav-link {
  display: inline-block;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.nav-link:hover { background: var(--paper); color: var(--ink); }
.nav-link--button { border: 1.5px solid var(--line); }
.nav-link--button:hover { border-color: var(--ink); }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 700 0.95rem/1.1 var(--display);
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.button:hover { color: inherit; }
.button--primary { border-color: var(--ink); background: var(--grape); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.button--primary:hover { background: var(--grape-deep); color: #fff; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.button--primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.button--quiet { border-color: var(--line); background: var(--paper); color: var(--ink); }
.button--quiet:hover { border-color: var(--ink); }
.button--small { min-height: 34px; padding: 6px 14px; font-size: 0.82rem; }

.text-button {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--grape);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The signature input: a pill with a hard ink shadow. */
.pill-form {
  display: flex;
  gap: 8px;
  max-width: 470px;
  padding: 6px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-hard);
  transition: box-shadow 140ms ease, transform 140ms ease;
}
.pill-form:focus-within { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); }
.pill-form input[type="tel"], .pill-form input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 0 16px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 500;
}
.pill-form input::placeholder { color: var(--faint); }
.pill-form input[type="submit"] {
  flex: none;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--grape);
  color: #fff;
  font: 700 1rem var(--display);
  transition: background 140ms ease;
}
.pill-form input[type="submit"]:hover { background: var(--grape-deep); }
.pill-form input[type="submit"]:disabled { opacity: 0.6; cursor: progress; }

/* ---------- Flash ---------- */

.flash-region {
  position: fixed;
  z-index: 30;
  top: 16px;
  left: 50%;
  width: min(calc(100% - 32px), 440px);
  transform: translateX(-50%);
  pointer-events: none;
}
.flash {
  margin: 0 0 8px;
  padding: 12px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-hard);
  font-size: 0.92rem;
  font-weight: 500;
  pointer-events: auto;
  animation: flash-in 260ms cubic-bezier(.2, .9, .3, 1.3);
}
.flash--notice::before { content: "🦛 "; }
.flash--alert { background: var(--nag-wash); color: var(--nag-deep); border-color: var(--nag-deep); box-shadow: 4px 4px 0 var(--nag-deep); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Landing ---------- */

.landing { width: min(calc(100% - 32px), 1120px); margin-inline: auto; }

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.landing-nav__signin {
  padding: 9px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.landing-nav__signin:hover { background: var(--ink); color: #fff; }

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
  padding: 36px 0 96px;
}

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.hero__kicker span {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--nag);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font: 800 clamp(2.9rem, 7vw, 5.6rem)/0.92 var(--display);
  letter-spacing: -0.045em;
}
.hero h1 em { position: relative; z-index: 0; color: var(--grape); font-style: normal; white-space: nowrap; }
.hero h1 em::after {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: 0.02em;
  left: 0;
  height: 0.14em;
  border-radius: 99px;
  background: var(--nag);
  content: "";
  opacity: 0.85;
  transform: rotate(-1.2deg);
}

.hero__lede { max-width: 32ch; margin: 26px 0 34px; color: var(--muted); font-size: 1.2rem; }

.hero__signup-title { margin: 0 0 12px; font: 700 1.05rem var(--display); letter-spacing: -0.01em; }
.hero__signup-note { max-width: 46ch; margin: -4px 0 14px; color: var(--muted); font-size: 0.95rem; }
.hero__fine { margin: 14px 0 0 8px; color: var(--muted); font-size: 0.86rem; }
.hero__fine a { font-weight: 600; white-space: nowrap; }

/* The phone mock — a conversation that plays out. */
.phone {
  position: relative;
  width: min(100%, 360px);
  margin-inline: auto;
  padding: 14px;
  border-radius: 48px;
  background: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(40, 20, 90, 0.45);
  transform: rotate(2deg);
}
.phone__screen { overflow: hidden; border-radius: 36px; background: var(--paper); }
.phone__contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 18px 0 10px;
  border-bottom: 1px solid #f0edf3;
  color: var(--muted);
  font-size: 0.72rem;
}
.phone__contact strong { color: var(--ink); font-size: 0.82rem; }
.phone__avatar, .assistant-panel__avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: var(--grape-wash);
}
.phone__avatar img, .assistant-panel__avatar img { width: 34px; height: auto; transform: scaleX(-1); }
.phone__thread {
  display: flex;
  min-height: 470px;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px 18px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.bubble {
  max-width: 78%;
  margin: 0;
  padding: 8px 13px;
  border-radius: 19px 19px 19px 6px;
  align-self: flex-start;
  background: var(--bubble);
}
.bubble--me { align-self: flex-end; border-radius: 19px 19px 6px 19px; background: var(--grape); color: #fff; }
.bubble--nag { background: var(--nag); color: #fff; }
.phone .bubble, .phone .stamp {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  animation: bubble-in 360ms cubic-bezier(.2, .9, .3, 1.3) forwards;
  animation-delay: calc(var(--d) * 0.8s - 0.4s);
}
@keyframes bubble-in { to { opacity: 1; transform: none; } }

.stamp { align-self: center; margin: 8px 0 2px; color: var(--faint); font-size: 0.68rem; }
.stamp b { color: var(--muted); font-weight: 600; }

.phone__sticker {
  position: absolute;
  top: 110px;
  right: -26px;
  padding: 10px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--sun);
  box-shadow: 3px 3px 0 var(--ink);
  font: 700 0.85rem/1.2 var(--display);
  transform: rotate(-6deg);
}

/* Marquee of things you can text. */
.marquee {
  overflow: hidden;
  margin-inline: calc(50% - 50vw);
  padding: 26px 0;
  border-block: 1.5px solid var(--ink);
  background: var(--paper);
}
.marquee__track { display: flex; width: max-content; gap: 12px; animation: marquee 44s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.chip {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--grape-wash);
  color: var(--grape-deep);
  font-weight: 600;
  white-space: nowrap;
}
.chip:nth-child(3n) { background: var(--nag-wash); color: var(--nag-deep); }
.chip:nth-child(4n) { background: var(--sun); color: var(--sun-ink); }
@keyframes marquee { to { transform: translateX(calc(-50% - 6px)); } }

.steps-section { padding: 110px 0 90px; }
.steps-section .section-title { max-width: 16ch; margin-bottom: 48px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.steps li { padding: 28px; border: 1px solid var(--line); border-radius: 28px; background: var(--paper); }
.steps__number { display: block; margin-bottom: 40px; color: var(--grape); font: 800 3.6rem/1 var(--display); letter-spacing: -0.05em; }
.steps h3 { margin: 0 0 6px; font: 700 1.3rem var(--display); letter-spacing: -0.02em; }
.steps p { margin: 0; color: var(--muted); }

.cta-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  padding: clamp(36px, 7vw, 80px);
  border-radius: 40px;
  background: var(--ink);
  color: #fff;
}
.cta-band .section-title { max-width: 14ch; }
.cta-band__action { text-align: center; }
.cta-band__button {
  display: inline-block;
  padding: 18px 28px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 800 1.45rem var(--display);
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: transform 140ms ease;
}
.cta-band__button:hover { color: var(--grape-deep); transform: rotate(-2deg) scale(1.03); }
.cta-band__action p { margin: 12px 0 0; color: #b9b2c8; font-size: 0.9rem; }

.about { max-width: 68ch; padding: 80px 0 40px; color: var(--muted); }
.about h2 { margin: 0 0 12px; color: var(--ink); font: 700 1.3rem var(--display); letter-spacing: -0.02em; }
.about p { margin: 0 0 12px; }
.about strong { color: var(--ink); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 28px 0 50px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }
.site-footer__privacy { max-width: 62ch; }
.site-footer__privacy strong { color: var(--ink); }

/* ---------- Sign-in code ---------- */

.auth-page {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 40px 16px;
}
.auth-card {
  width: min(100%, 460px);
  padding: clamp(28px, 6vw, 44px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--paper);
  text-align: center;
}
.auth-card .bubble { display: inline-block; margin-bottom: 22px; font-size: 0.9rem; }
.auth-card .bubble b { letter-spacing: 0.1em; }
.auth-card h1 { margin: 0; font: 800 clamp(2.2rem, 7vw, 2.8rem)/1 var(--display); letter-spacing: -0.04em; }
.auth-card__lede { margin: 12px 0 26px; color: var(--muted); }
.pill-form--code { margin-inline: auto; text-align: left; }
.pill-form--code input[type="text"] { padding: 0 8px; font: 700 1.3rem var(--display); letter-spacing: 0.22em; text-align: center; }
.pill-form--code input[type="text"]::placeholder { letter-spacing: 0.22em; }
.auth-card__links { margin: 22px 0 0; color: var(--muted); font-size: 0.88rem; }

/* ---------- App pages ---------- */

.page { width: min(calc(100% - 32px), 760px); margin: 0 auto; padding: 28px 0 80px; }
.page--narrow { max-width: 640px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-heading__date { margin: 0 0 6px; color: var(--muted); font-weight: 500; }
.page-heading h1 { margin: 0; font: 800 clamp(2.3rem, 7vw, 3.4rem)/1 var(--display); letter-spacing: -0.045em; }
.page-heading h1 span { color: var(--grape); }

.status-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
a.status-pill:hover { border-color: var(--ink); color: var(--ink); }
.status-pill--on span, .connection-state .status-pill span { color: #1fa463; }

/* Assistant: an iMessage-style card. */
.assistant-panel {
  margin-bottom: 36px;
  border: 1.5px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}
.assistant-panel__heading { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.assistant-panel__heading h2 { margin: 0; font: 700 1.05rem/1.2 var(--display); letter-spacing: -0.01em; }
.assistant-panel__heading p { margin: 0; color: var(--muted); font-size: 0.8rem; }
.assistant-panel__avatar { width: 40px; height: 40px; }
.assistant-panel__avatar img { width: 30px; }

.assistant-thread {
  display: flex;
  max-height: 340px;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 16px 18px;
  overscroll-behavior: contain;
}
.assistant-empty { margin: 0; color: var(--faint); font-size: 0.92rem; }
.assistant-message {
  max-width: 82%;
  padding: 8px 14px;
  border-radius: 19px 19px 19px 6px;
  align-self: flex-start;
  background: var(--bubble);
  font-size: 0.95rem;
  line-height: 1.4;
}
.assistant-message div + div { margin-top: 6px; }
.assistant-message--user { align-self: flex-end; border-radius: 19px 19px 6px 19px; background: var(--grape); color: #fff; }
.assistant-pending { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.assistant-pending span { display: inline-flex; gap: 3px; padding: 10px 12px; border-radius: 16px; background: var(--bubble); }
.assistant-pending i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: typing 1s infinite ease-in-out; }
.assistant-pending i:nth-child(2) { animation-delay: 0.15s; }
.assistant-pending i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 50% { transform: translateY(-3px); opacity: 0.5; } }
.assistant-error { margin: 12px 18px 0; padding: 10px 14px; border-radius: 14px; background: var(--nag-wash); color: var(--nag-deep); font-size: 0.9rem; }

.assistant-composer { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 16px; border: 1px solid var(--line); border-radius: 26px; background: var(--cream); }
.assistant-composer:focus-within { border-color: var(--grape); background: var(--paper); }
.assistant-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 160px;
  padding: 9px 0;
  border: 0;
  outline: none;
  background: transparent;
  resize: none;
  field-sizing: content;
}
.assistant-composer textarea::placeholder { color: var(--faint); }
.assistant-composer__send {
  display: grid;
  flex: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--grape);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
}
.assistant-composer__send:hover { background: var(--grape-deep); }
.assistant-disclaimer { margin: 8px 0 12px; color: var(--faint); font-size: 0.74rem; text-align: center; }

/* Task list */
.task-board { display: grid; gap: 26px; }
.task-board__summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.stat { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 0.85rem; font-weight: 600; }
.stat b { margin-right: 2px; font-family: var(--display); }
.stat--hot { border-color: var(--nag); background: var(--nag); color: #fff; }

.task-section h2, .archive-section summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.task-section h2 span, .archive-section summary span { color: var(--faint); }
.task-section--overdue h2 { color: var(--nag-deep); }
.task-section--reminders h2 { color: var(--grape); }

.task-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.task-list--continuation { margin-top: 10px; }
.task-frame { display: block; min-width: 0; }
.task-frame + .task-frame .task-row { border-top: 1px solid var(--line-soft); }

.task-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 28px;
  gap: 12px;
  align-items: center;
  padding: 13px 14px 13px 16px;
  transition: background 120ms ease;
}
.task-row:hover { background: #fdfbf8; }
.task-row form { margin: 0; }
.task-row__check { display: grid; place-items: center; }
.task-row__content { min-width: 0; }
.task-row__title { color: var(--ink); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
a.task-row__title:hover { color: var(--grape); text-decoration: underline; }
.task-row__content p { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.task-row__meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: center; color: var(--muted); font-size: 0.82rem; }
.task-section--overdue .task-row__meta > span:not(.tag) { color: var(--nag-deep); font-weight: 600; }
.task-row--completed .task-row__title { color: var(--faint); text-decoration: line-through; }
.task-row--deleted { grid-template-columns: minmax(0, 1fr) auto auto; padding-left: 18px; }
.task-row--deleted .task-row__check { display: none; }
.task-row--deleted .task-row__title { color: var(--muted); }

.check-button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 2px solid #cfc7da;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.check-button:hover { border-color: var(--grape); background: var(--grape-wash); transform: scale(1.1); }
.task-section--overdue .check-button { border-color: #ffb3ad; }
.check-button--checked { border-color: var(--grape); background: var(--grape); }
.check-button--checked:hover { background: var(--grape-deep); }
.check-button--reminder { border-color: var(--grape); color: var(--grape); cursor: default; }
.check-button--reminder:hover { background: transparent; transform: none; }

.icon-button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-size: 0;
}
.icon-button::after { color: var(--faint); content: "×"; font-size: 1.3rem; line-height: 1; }
.icon-button:hover { background: var(--nag-wash); }
.icon-button:hover::after { color: var(--nag-deep); }
.task-row__actions { opacity: 0.55; transition: opacity 120ms ease; }
.task-row:hover .task-row__actions, .task-row__actions:focus-within { opacity: 1; }

.tag { padding: 3px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; }
.tag--high { background: var(--nag-wash); color: var(--nag-deep); }
.tag--medium { background: var(--sun); color: var(--sun-ink); }
.tag--low, .tag--reminder { background: var(--grape-wash); color: var(--grape-deep); }

.task-section__more { margin-top: 10px; }
.task-section__more summary { width: fit-content; margin-left: 6px; color: var(--grape); font-size: 0.86rem; font-weight: 600; list-style: none; }
.task-section__more summary::-webkit-details-marker { display: none; }
.task-section__more-open { display: none; }
.task-section__more[open] .task-section__more-closed { display: none; }
.task-section__more[open] .task-section__more-open { display: inline; }

.task-board__archive { display: grid; gap: 14px; }
.archive-section summary { width: fit-content; margin-bottom: 0; list-style: none; }
.archive-section summary::-webkit-details-marker { display: none; }
.archive-section summary::before { content: "+"; font-size: 1rem; line-height: 1; transition: transform 160ms ease; }
.archive-section[open] summary::before { transform: rotate(45deg); }
.archive-section[open] summary { margin-bottom: 10px; }

.empty-state { padding: 44px 24px; border: 1.5px dashed var(--line); border-radius: 28px; text-align: center; }
.empty-state__mark { width: 96px; height: auto; transform: scaleX(-1); animation: bob 3s ease-in-out infinite; }
.empty-state h2 { margin: 10px 0 4px; font: 800 1.6rem var(--display); letter-spacing: -0.03em; }
.empty-state p { margin: 0; color: var(--muted); }
@keyframes bob { 50% { transform: scaleX(-1) translateY(-6px); } }

.undo-bar { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 0.9rem; }
.undo-bar form { margin: 0; }

/* ---------- Forms ---------- */

.field { margin-bottom: 18px; }
.field label, fieldset legend { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; }
.field input, .field select, .field textarea, .settings-card input[type="time"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .settings-card input[type="time"]:focus {
  border-color: var(--grape);
  outline: none;
  box-shadow: 0 0 0 4px var(--grape-wash);
}
.field--compact { max-width: 300px; }
.form-hint { margin: 6px 0 0; color: var(--muted); font-size: 0.82rem; }
.field-error { margin: 0 0 16px; padding: 10px 14px; border-radius: 14px; background: var(--nag-wash); color: var(--nag-deep); font-size: 0.9rem; font-weight: 500; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.form-actions form { margin: 0; }
fieldset { margin: 26px 0 0; padding: 22px 0 0; border: 0; border-top: 1px solid var(--line-soft); }
fieldset legend { float: left; width: 100%; margin-bottom: 14px; font: 700 1rem var(--display); }
fieldset legend + * { clear: both; }
.toggle-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-weight: 500; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--grape); }

/* Settings & connections */
.settings-heading { margin-bottom: 28px; }
.settings-heading h1 { margin: 0; font: 800 clamp(2.2rem, 7vw, 3rem)/1 var(--display); letter-spacing: -0.045em; }
.settings-heading > p:last-child { max-width: 52ch; margin: 12px 0 0; color: var(--muted); }

.settings-card {
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
}
.settings-card .eyebrow { margin-bottom: 4px; }
.messaging-settings-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.messaging-settings-card h2, .connection-card h2 { margin: 0; font: 700 1.25rem var(--display); letter-spacing: -0.02em; }
.messaging-settings-card p { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }
.messaging-settings-card .eyebrow { margin: 0 0 4px; font-size: 0.7rem; }
.connection-state { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.connection-state p { margin: 2px 0 0; color: var(--muted); }
.connection-help { margin: 8px 0 18px; color: var(--muted); }
.connection-card form { margin: 0; }

.pairing-code {
  margin: 0 0 14px;
  padding: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  background: var(--sun);
  box-shadow: var(--shadow-hard);
  text-align: center;
}
.pairing-code__label { margin: 0 0 6px; color: var(--sun-ink); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.pairing-code strong { display: block; font: 800 clamp(1.6rem, 6vw, 2.2rem) var(--display); letter-spacing: 0.02em; }
.pairing-code p:last-child { margin: 6px 0 0; color: var(--sun-ink); font-size: 0.85rem; }

.settings-back { margin-top: 24px; font-size: 0.92rem; font-weight: 500; }
.settings-back a { color: var(--muted); text-decoration: none; }
.settings-back a:hover { color: var(--ink); }

/* Task edit card (shown inline on the dashboard) */
#todo-detail:not(:empty) { display: block; margin-top: 32px; }
.todo-detail { scroll-margin-top: 90px; }
.edit-card {
  padding: clamp(20px, 5vw, 30px);
  border: 1.5px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow-hard);
}
.edit-card__heading { margin-bottom: 22px; }
.edit-card__heading .eyebrow { margin-bottom: 4px; }
.edit-card__heading h2 { margin: 0; font: 800 1.8rem/1.05 var(--display); letter-spacing: -0.035em; }
.edit-card__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.edit-card .form-hint { margin: 0 0 20px; }
.edit-card--deleted { text-align: center; }
.edit-card--deleted .edit-card__heading { margin-bottom: 10px; }

/* ---------- Legal ---------- */

.legal-page { width: min(calc(100% - 32px), 1120px); margin-inline: auto; }
.legal { max-width: 68ch; margin: 0 auto; padding: 36px 0 80px; }
.legal__heading { margin-bottom: 36px; }
.legal__heading h1 { margin: 0; font: 800 clamp(2.4rem, 7vw, 3.6rem)/1 var(--display); letter-spacing: -0.045em; }
.legal__date { margin: 12px 0 0; color: var(--muted); }
.legal__body { font-size: 1.02rem; line-height: 1.7; }
.legal__body h2 { margin: 40px 0 10px; font: 700 1.35rem var(--display); letter-spacing: -0.02em; }
.legal__body ul { margin: 8px 0 14px; padding-left: 1.3em; }
.legal__body li { margin: 6px 0; }
.legal__body li::marker { color: var(--grape); }
.legal__body a { color: var(--grape); font-weight: 500; }

/* ---------- Admin (owner only) ---------- */

.admin-page { width: min(calc(100% - 32px), 1040px); margin: 0 auto; padding: 28px 0 80px; font-size: 0.95rem; }
.admin-heading { margin-bottom: 28px; }
.admin-heading p:first-child { margin: 0 0 6px; color: var(--grape); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-heading h1 { margin: 0 0 8px; font: 800 clamp(2rem, 6vw, 2.8rem)/1 var(--display); letter-spacing: -0.04em; }
.admin-heading p { max-width: 68ch; margin: 0; color: var(--muted); }
.admin-page section { margin: 0 0 20px; padding: 22px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); }
.admin-columns section { margin: 0; }
.admin-page h2 { margin: 0 0 14px; font: 700 1.2rem var(--display); letter-spacing: -0.02em; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; white-space: nowrap; }
.admin-table thead th { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.admin-table small { color: var(--muted); }
.admin-metrics td { font: 800 1.3rem var(--display); }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.admin-funnel { margin: 0 0 12px; padding: 0; list-style: none; }
.admin-funnel li, .admin-health div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.admin-funnel strong { color: var(--grape); font-family: var(--display); }
.admin-health { margin: 0; }
.admin-health dt, .admin-health dd { margin: 0; }
.admin-health dd { color: #1fa463; font-weight: 700; }
.admin-health .admin-bad { color: var(--nag-deep); }
.admin-chart { display: grid; height: 180px; grid-template-columns: repeat(14, minmax(18px, 1fr)); gap: 6px; align-items: end; padding: 14px 4px 0; border-bottom: 1px solid var(--line); }
.admin-chart__day { display: grid; height: 100%; grid-template-rows: 1fr auto; text-align: center; }
.admin-chart__bars { display: flex; min-height: 1px; align-items: end; justify-content: center; gap: 2px; }
.admin-chart__bar { display: block; width: min(10px, 45%); min-height: 1px; border-radius: 4px 4px 0 0; }
.admin-chart__bar--signup { background: var(--grape); }
.admin-chart__bar--activation { background: var(--nag); }
.admin-chart__day small { padding: 6px 0; color: var(--muted); font-size: 0.6rem; }
.admin-legend { color: var(--muted); font-size: 0.8rem; }
.admin-legend span:first-child { color: var(--grape); }
.admin-legend span:last-child { margin-left: 12px; color: var(--nag-deep); }
.admin-page input:not([type="submit"]), .admin-page select { min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 0.85rem; }
.admin-page input[type="submit"], .admin-page button { padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: 0.82rem; font-weight: 600; }
.admin-page input[type="submit"]:hover, .admin-page button:hover { background: var(--ink); color: #fff; }
.admin-inline-form { display: grid; min-width: 150px; gap: 4px; }
.admin-details { margin-top: 14px; }
.admin-details summary { color: var(--grape); font-weight: 600; }
.admin-line-form { display: grid; max-width: 520px; grid-template-columns: 170px 1fr; gap: 8px 12px; align-items: center; margin-top: 14px; }
.admin-line-form input[type="submit"] { grid-column: 2; justify-self: start; }
.admin-batch-form { display: flex; gap: 8px; margin: 0 0 12px; }
.admin-batch-form input[type="number"] { width: 80px; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 56px; padding-top: 16px; }
  .steps { grid-template-columns: 1fr; }
  .steps__number { margin-bottom: 14px; }
  .cta-band { grid-template-columns: 1fr; }
  .phone__sticker { right: 0; }
  .admin-columns { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .pill-form:not(.pill-form--code) { flex-direction: column; border-radius: 26px; }
  .pill-form:not(.pill-form--code) input[type="tel"] { padding: 12px 14px; }
  .pill-form--code input[type="submit"] { padding-inline: 16px; font-size: 0.92rem; }
  .pill-form--code input[type="text"] { font-size: 1.1rem; letter-spacing: 0.14em; }
  .steps-section { padding: 80px 0 64px; }
  .cta-band { border-radius: 30px; }
  .cta-band__button { font-size: 1.2rem; }
  .about { padding-top: 60px; }

  .site-header__inner { min-height: 64px; }
  .site-header .wordmark > span { display: none; }
  .nav-link { padding: 8px 10px; font-size: 0.85rem; }

  .page-heading { flex-direction: column; align-items: flex-start; }
  .task-row { grid-template-columns: 28px minmax(0, 1fr) 28px; row-gap: 4px; }
  .task-row__meta { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .task-row__actions { grid-column: 3; grid-row: 1; opacity: 1; }
  .task-row--deleted { grid-template-columns: minmax(0, 1fr) auto; }
  .task-row--deleted .task-row__meta { grid-column: 1; }
  .task-row--deleted .task-row__actions { grid-column: 2; grid-row: 1 / span 2; }
  .messaging-settings-card { align-items: flex-start; flex-direction: column; }
  .edit-card__grid { grid-template-columns: 1fr; }
  .undo-bar { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .phone .bubble, .phone .stamp { opacity: 1; transform: none; animation: none; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; padding-inline: 16px; }
  .marquee__track [aria-hidden] { display: none; }
}
