:root {
  color-scheme: light dark;
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-soft: #eeede7;
  --text: #181a17;
  --muted: #656b62;
  --line: #deded7;
  --accent: #2f7d4a;
  --accent-strong: #226138;
  --accent-soft: #e2f2e7;
  --danger: #a13d38;
  --shadow: 0 14px 36px rgba(28, 35, 26, 0.08);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 80% 0%, rgba(74, 154, 99, .12), transparent 32rem),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { width: min(100%, 620px); margin: 0 auto; min-height: 100vh; padding: env(safe-area-inset-top) 18px calc(28px + env(safe-area-inset-bottom)); }
.brand { padding: 22px 2px 18px; }
.brand-button { display: flex; flex-direction: column; align-items: flex-start; border: 0; padding: 0; color: inherit; background: transparent; cursor: pointer; }
.brand-name { font-weight: 790; font-size: 25px; line-height: 1; letter-spacing: -.8px; }
.brand-check { color: var(--accent); }
.brand-by { margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.7px; }

h1 { margin: 0; font-size: clamp(30px, 8vw, 42px); line-height: 1.06; letter-spacing: -1.6px; }
h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.5px; }
p { line-height: 1.5; }
.lead { margin: 12px 0 28px; color: var(--muted); font-size: 17px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.hero { padding: 38px 4px 16px; }
.primary-button, .secondary-button, .danger-button, .text-button {
  width: 100%; min-height: 56px; border-radius: 17px; border: 1px solid transparent;
  padding: 14px 18px; font-weight: 750; cursor: pointer; transition: transform .12s ease, background .12s ease;
}
.primary-button { background: var(--accent); color: white; box-shadow: 0 10px 24px rgba(47, 125, 74, .22); }
.primary-button:hover { background: var(--accent-strong); }
.secondary-button { background: var(--surface); color: var(--text); border-color: var(--line); }
.danger-button { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 42%, transparent); }
.text-button { min-height: 44px; color: var(--muted); background: transparent; }
button:active { transform: scale(.985); }
button:disabled { opacity: .55; cursor: default; transform: none; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: grid; gap: 12px; }
.create-main { margin-top: 6px; min-height: 68px; font-size: 18px; }

.card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card-flat { padding: 18px; background: var(--surface-soft); border-radius: 18px; }

.form { display: grid; gap: 17px; padding-bottom: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 700; }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 13px 15px; border: 1px solid var(--line);
  border-radius: 15px; outline: none; background: var(--surface); color: var(--text);
}
.field textarea { min-height: 104px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-help { margin: 0; font-size: 12px; color: var(--muted); }
.required { color: var(--accent); }
.error-box { display: none; padding: 13px 15px; border-radius: 14px; color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); font-size: 14px; }
.error-box.visible { display: block; }

.ready { text-align: center; }
.ready-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 14px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 34px; font-weight: 900; }
.qr-wrap { width: min(76vw, 290px); margin: 24px auto; padding: 15px; border-radius: 22px; background: white; border: 1px solid #e8e8e4; }
.qr-wrap svg { display: block; width: 100%; height: auto; color: #121411; }
.share-note { margin: 12px 8px 0; color: var(--muted); font-size: 12px; }

.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 13px; font-weight: 750; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.task-title { margin-top: 12px; word-break: break-word; }
.task-description { margin: 12px 0 0; white-space: pre-wrap; color: var(--muted); }
.facts { display: grid; margin-top: 20px; border-top: 1px solid var(--line); }
.fact { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.fact-label { color: var(--muted); font-size: 13px; }
.fact-value { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.recipient-actions { position: sticky; bottom: 0; margin: 18px -18px -28px; padding: 15px 18px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 16%, var(--bg)); }
.name-box { margin-top: 20px; }
.decision-success { text-align: center; padding: 34px 12px; }
.decision-icon { font-size: 44px; }

.recent { margin-top: 34px; }
.recent-title { margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.task-row { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 18px; padding: 17px; color: inherit; background: var(--surface); cursor: pointer; }
.task-row + .task-row { margin-top: 9px; }
.task-row-title { display: block; font-weight: 750; }
.task-row-meta { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.participant-list { display: grid; gap: 8px; margin-top: 16px; }
.participant { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); }
.participant-name { font-weight: 750; }
.participant-state { color: var(--accent); font-size: 13px; font-weight: 700; }
.participant.declined { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.participant.declined .participant-state { color: var(--danger); }
.empty-participants { margin-top: 16px; padding: 18px; border-radius: 16px; background: var(--surface-soft); color: var(--muted); text-align: center; font-size: 14px; }

.center-state { display: grid; place-items: center; align-content: center; min-height: 55vh; color: var(--muted); text-align: center; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 10; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); width: min(calc(100% - 36px), 500px); padding: 13px 16px; border-radius: 14px; color: white; background: #242821; opacity: 0; pointer-events: none; transition: .2s ease; text-align: center; font-size: 14px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 390px) {
  .field-grid, .button-row { grid-template-columns: 1fr; }
  .hero { padding-top: 24px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121311;
    --surface: #1c1e1a;
    --surface-soft: #242720;
    --text: #f2f3ed;
    --muted: #a7aca2;
    --line: #34382f;
    --accent: #68bc80;
    --accent-strong: #55a86d;
    --accent-soft: #1d3b27;
    --danger: #ee8179;
    --shadow: 0 18px 36px rgba(0, 0, 0, .18);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
