/* Sprout — Capture page: one column, one question, a box that listens. */

.listen { max-width: 680px; margin: 0 auto; min-height: calc(100vh - 190px); display: flex; flex-direction: column; justify-content: flex-end; padding: 8px 0 4px; }
.listen.is-empty { justify-content: center; }
.listen-head { text-align: center; margin-bottom: 32px; }
.listen:not(.is-empty) .listen-head { display: none; }
.listen-greet { color: var(--muted); font-size: 16px; margin-bottom: 8px; }
.listen-q { font-size: 40px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.08; }

/* Conversation */
.listen-thread { list-style: none; margin: 0; padding: 0 0 24px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; flex-direction: column; scroll-margin-bottom: 160px; }
.msg.arriving { animation: msg-in var(--dur-3) var(--ease-out); }
@keyframes msg-in { from { opacity: 0; } }
.msg p { font-size: 16px; line-height: 1.55; max-width: 88%; }
.msg.you { align-items: flex-end; }
.msg.you p { background: color-mix(in srgb, var(--accent) 11%, var(--surface)); padding: 12px 16px; border-radius: 24px 24px 8px 24px; }
.msg.sprout { align-items: flex-start; }
.msg.sprout p { color: var(--text); padding: 2px 4px; }
.msg.is-undone p { color: var(--muted); }
.msg-dots { display: inline-flex; gap: 4px; padding: 12px 8px; }
.msg-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .35; animation: dot 1s ease-in-out infinite; }
.msg-dots i:nth-child(2) { animation-delay: .15s; }
.msg-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { opacity: .9; } }
.msg-links, .msg-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0 4px; }
.lchip {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 8px 12px; font-size: 13px; cursor: pointer; min-height: 32px; max-width: 100%;
  transition: border-color var(--dur-2) ease, color var(--dur-2) ease;
}
.lchip b { color: var(--text); font-weight: 600; }
.lchip:hover { border-color: var(--muted); color: var(--text); }
.lundo { border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 8px 8px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px; }
.lundo:hover { color: var(--text); }
.msg-ask button {
  border: 1.5px solid var(--accent); color: var(--accent); background: none; border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; min-height: 36px; transition: background var(--dur-2) ease, color var(--dur-2) ease, transform var(--dur-1) var(--ease-out);
}
.msg-ask button:hover { background: var(--accent); color: #fff; }
.msg-ask button:active, .lchip:active { transform: scale(.97); }
[data-theme="dark"] .msg-ask button { color: var(--accent-2); border-color: var(--accent-2); }
[data-theme="dark"] .msg-ask button:hover { background: var(--accent-2); color: var(--bg); }

/* The box */
.listen-box {
  position: sticky; bottom: 16px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 12px;
  background: var(--surface); border-radius: 24px; padding: 16px 16px 12px 24px; border: 1.5px solid transparent;
  box-shadow: 0 1px 2px rgba(15, 30, 22, .05), 0 24px 48px -28px rgba(15, 30, 22, .3);
  transition: border-color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}
.listen-box:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 5px var(--accent-soft), 0 24px 48px -28px rgba(15, 30, 22, .3); }
.listen-box textarea {
  border: 0; outline: 0; background: none; resize: none; font: inherit; font-size: 18px; line-height: 1.5; color: var(--text);
  padding: 8px 0; min-height: 44px; max-height: 40vh;
}
.listen-box textarea::placeholder { color: var(--muted); }
.listen-box textarea:focus-visible { outline: none; }
.listen-actions { display: flex; gap: 8px; padding-bottom: 2px; }
.listen-mic, .listen-send {
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  transition: background var(--dur-2) ease, color var(--dur-2) ease, opacity var(--dur-2) ease, transform var(--dur-1) var(--ease-out);
}
.listen-mic svg, .listen-send svg { width: 20px; height: 20px; }
.listen-mic { background: var(--surface-2); color: var(--text); }
.listen-mic:hover { background: var(--line); }
.listen-mic.on { background: var(--accent); color: #fff; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px var(--accent-soft); } }
.listen-send { background: var(--hero); color: #fff; opacity: .35; }
.listen-box.has-text .listen-send { opacity: 1; }
.listen-mic:active, .listen-send:active { transform: scale(.94); }
.listen-hint { grid-column: 1 / -1; min-height: 18px; color: var(--muted); font-size: 13px; padding-bottom: 2px; }

@media (max-width: 620px) {
  .listen { min-height: calc(100vh - 150px); }
  .listen-q { font-size: 34px; }
  .listen-box { border-radius: 24px; padding: 12px 12px 12px 16px; bottom: 10px; }
  .listen-box textarea { font-size: 16px; }
  .msg p { max-width: 94%; }
}
@media (prefers-reduced-motion: reduce) {
  .listen-mic.on { animation: none; box-shadow: 0 0 0 4px var(--accent-soft); }
  .msg-dots i { animation: none; opacity: .6; }
}

/* Answers: a short list under the reply; tick things off right here */
.msg-rows { list-style: none; margin: 12px 0 0; padding: 4px 0; width: min(100%, 560px); background: var(--surface); border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 30, 22, .05); }
.mrow { display: flex; align-items: center; gap: 12px; padding: 4px 12px; }
.mrow + .mrow { border-top: 1px solid var(--line); }
.mcheck {
  position: relative; width: 20px; height: 20px; flex: none; border-radius: 8px; border: 1.8px solid var(--muted); background: none; color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: background var(--dur-2) ease, border-color var(--dur-2) ease, transform var(--dur-1) var(--ease-out);
}
.mcheck::after { content: ""; position: absolute; inset: -12px; }
.mcheck:active { transform: scale(.92); }
.mcheck svg { width: 13px; height: 13px; }
.mcheck svg rect { display: none; }
.mrow.is-done .mcheck { background: var(--accent); border-color: var(--accent); }
.mdot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); margin: 0 8px; flex: none; }
.mopen { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border: 0; background: none; cursor: pointer; text-align: left; }
.mopen span { font-size: 16px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mopen small { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mopen:hover span { color: var(--accent); }
.mrow.is-late small { color: var(--danger); }
.mrow.is-done .mopen span { color: var(--muted); text-decoration: line-through; }
@media (max-width: 620px) { .mopen { flex-direction: column; gap: 2px; } }

/* On-device thinking */
.msg.sprout p { white-space: pre-line; }
.msg.is-streaming p::after { content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 4px; vertical-align: -2px; background: var(--accent); border-radius: 2px; animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.msg-note { font-size: 13px !important; color: var(--muted) !important; margin: 8px 0 0 4px; padding: 0 !important; }
.msg-plan { margin: 12px 0 0; padding: 12px 20px 12px 40px; background: var(--surface); border-radius: 16px; width: min(100%, 560px); box-shadow: 0 1px 2px rgba(15, 30, 22, .05); }
.msg-plan li { padding: 4px 0; font-size: 16px; }
.msg-plan li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.msg-ask button.quiet { border-color: var(--line); color: var(--muted); }
.msg-ask button.quiet:hover { background: var(--surface-2); color: var(--text); }
.ai-status { display: flex; justify-content: center; margin-bottom: 16px; }
.listen:not(.is-empty) .ai-status { position: sticky; top: 8px; z-index: 2; margin-bottom: 12px; }
.listen:not(.is-empty) .ai-offer { display: none; }
.ai-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 8px 12px; box-shadow: 0 1px 2px rgba(15, 30, 22, .05); }
.ai-pill svg { width: 14px; height: 14px; color: var(--accent); }
.ai-pill.is-error { color: var(--text); text-align: left; max-width: 100%; }
.ai-pill .ai-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: none; }
.ai-pill button { white-space: nowrap; flex: none; }
.ai-pill button { border: 0; background: none; color: var(--text); text-decoration: underline; cursor: pointer; font-size: 13px; }
.ai-bar { width: 90px; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ai-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width var(--dur-3) ease; }
.ai-offer { display: flex; align-items: center; gap: 16px; width: 100%; background: var(--surface); border-radius: 16px; padding: 16px 16px; box-shadow: 0 1px 2px rgba(15, 30, 22, .05); text-align: left; }
.ai-offer-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.ai-offer-ico svg { width: 20px; height: 20px; }
.ai-offer div { flex: 1; min-width: 0; }
.ai-offer strong { display: block; font-weight: 600; }
.ai-offer small { color: var(--muted); font-size: 13px; }
@media (max-width: 620px) { .ai-offer { flex-wrap: wrap; } .ai-offer .btn { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .msg.is-streaming p::after { animation: none; } }
