/* Task emails' pages (TW #3150): the answer choices, the thank-you with its
   confetti, and the talk about a task. The thread is shared with the admin
   task page, so colours fall back when the member page's tokens are absent. */
.task-from { margin-bottom: .25rem; }
.task-page-notes p, .test-expected p { margin: 0 0 .5rem; } /* Markdown (TW #3333) */
.task-page-due { font-size: 1.1rem; }

.task-choices { display: grid; gap: 12px; margin: 1.5rem 0 1rem; }
a.member-button.task-choice { padding: 12px 16px; text-align: center; line-height: 1.25; color: var(--m-on-accent); }
a.member-button.secondary.task-choice { color: var(--m-accent); }
.task-choice-small { font-size: 1rem; margin-top: .25rem; }
.task-answer { margin-top: 1.5rem; }
.task-answer-picked { font-size: 1.3rem; font-weight: 800; }
.task-textarea, .task-date {
  box-sizing: border-box; width: 100%; font: inherit; font-size: 1.1rem; padding: 12px 14px; margin-bottom: 14px;
  border: 2px solid var(--m-line, #ced4da); border-radius: 12px; background: var(--m-card, #fff); color: var(--m-fg, #212529);
}
.task-textarea:focus, .task-date:focus { outline: 3px solid var(--m-accent, #0b5cad); outline-offset: 1px; }

.task-thanks { position: relative; margin: 0 0 1.5rem; padding: 18px 20px; border-radius: 14px; background: #e8f3ec; color: #1f5c38; font-size: 1.2rem; font-weight: 700; text-align: center; }
.task-thanks p { margin: 0; position: relative; z-index: 1; animation: task-pop .5s ease-out both; }
.confetti { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: visible; }
.confetti span { position: absolute; top: 50%; left: 50%; width: 8px; height: 14px; border-radius: 2px; opacity: 0; animation: task-confetti 1.3s ease-out forwards; }
.confetti span:nth-child(3n) { background: #f2b51c; }
.confetti span:nth-child(3n+1) { background: #0b5cad; }
.confetti span:nth-child(3n+2) { background: #2f9e5f; }
.confetti span:nth-child(1) { --x: -150px; --y: -90px; --r: 200deg; }
.confetti span:nth-child(2) { --x: 140px; --y: -100px; --r: -160deg; }
.confetti span:nth-child(3) { --x: -90px; --y: -130px; --r: 120deg; }
.confetti span:nth-child(4) { --x: 100px; --y: -140px; --r: 300deg; }
.confetti span:nth-child(5) { --x: -180px; --y: -40px; --r: -240deg; }
.confetti span:nth-child(6) { --x: 180px; --y: -50px; --r: 180deg; }
.confetti span:nth-child(7) { --x: -40px; --y: -150px; --r: 90deg; }
.confetti span:nth-child(8) { --x: 40px; --y: -160px; --r: -90deg; }
.confetti span:nth-child(9) { --x: -120px; --y: 60px; --r: 260deg; }
.confetti span:nth-child(10) { --x: 120px; --y: 70px; --r: -200deg; }
.confetti span:nth-child(11) { --x: -60px; --y: 90px; --r: 140deg; }
.confetti span:nth-child(12) { --x: 70px; --y: 80px; --r: -120deg; }
.confetti span:nth-child(13) { --x: -200px; --y: 20px; --r: 320deg; }
.confetti span:nth-child(14) { --x: 200px; --y: 10px; --r: -300deg; }
@keyframes task-confetti {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 60px)) rotate(var(--r)); }
}
@keyframes task-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .task-thanks p, .task-thanks h2 { animation: none; }
}

/* All done (TW #3167): the big green button, first; the "or" before the
   answers; the thank-you; and the quiet undo. */
.task-all-done { margin: 1.5rem 0 0; }
.task-all-done form { margin: 0; }
.task-all-done.is-ready { padding: 14px; border: 2px solid var(--m-go, #1f7a45); border-radius: 16px; }
.task-all-done-prompt { font-weight: 700; text-align: center; margin: 0 0 .6rem; }
.member-button.task-done-button { background: var(--m-go, #1f7a45); color: var(--m-on-go, #fff); font-size: 1.4rem; }
.member-button.task-done-button:focus-visible { outline: 3px solid var(--m-go, #1f7a45); outline-offset: 3px; }
.task-or { text-align: center; color: var(--m-muted); font-size: .95rem; margin: .75rem 0 0; }
.task-or + .task-choices { margin-top: .75rem; }
.task-thanks.is-done h2 { position: relative; z-index: 1; margin: 0; border: 0; padding: 0; color: inherit; font-size: 1.45rem; line-height: 1.25; animation: task-pop .5s ease-out both; }
.task-thanks-big { display: block; font-size: 2.4rem; line-height: 1; margin-bottom: .35rem; }
.task-thanks.is-done p { margin-top: .35rem; font-size: 1.05rem; font-weight: 600; animation: none; }
.task-undo-form { text-align: center; margin: 0 0 1rem; }
.task-undo { font: inherit; font-size: 1rem; font-weight: 600; padding: 8px 16px; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--m-muted); border: 2px solid var(--m-line); }

.task-thread h2 { font-size: 1.3rem; margin: 2rem 0 .75rem; }
.task-messages { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.task-message { display: flex; flex-direction: column; gap: 4px; max-width: 88%; padding: 10px 14px; border-radius: 14px;
  background: var(--m-card, #fff); border: 2px solid var(--m-line, #dee2e6); }
.task-message.is-mine { align-self: flex-end; border-color: var(--m-accent, #0b5cad); }
.task-message.is-system { align-self: center; max-width: 100%; background: transparent; border: 0; color: var(--m-muted, #6c757d); font-size: .95rem; text-align: center; }
.task-message-who { font-size: .85rem; color: var(--m-muted, #6c757d); }
.task-message-body { white-space: pre-line; overflow-wrap: anywhere; }
.task-proposal.is-agreed, .task-proposal.is-declined { color: var(--m-muted, #6c757d); }
.task-proposal-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.task-proposal-buttons form { margin: 0; }
.task-settle, .task-send { font: inherit; font-size: 1rem; font-weight: 700; padding: 8px 16px; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--m-accent, #0b5cad); background: transparent; color: var(--m-accent, #0b5cad); }
.task-settle.is-agree, .task-send { background: var(--m-accent, #0b5cad); color: var(--m-on-accent, #fff); }
.task-write-back label { display: block; font-weight: 700; margin-bottom: .4rem; }
.task-thread-empty { color: var(--m-muted, #6c757d); }

/* Testing tasks (TW #3316): what they should see, and how easy it was. The words always sit with
   the face, so the scale reads without the emoji. Five faces in a row (Steve's pick). */
.member-page .test-task h2 { font-size: 1.1rem; margin: 1.5rem 0 .4rem; }
/* A mission's Start (TW #3335): the email's green, above the steps. */
.member-button.test-start { margin-bottom: 1rem; background: #1f7a45; color: #fff; }
.test-your-rating { padding: 12px 14px; border-radius: 12px; background: var(--m-card, #fff); border: 2px solid var(--m-line, #e6e2d8); }
.test-rating fieldset { border: 0; padding: 0; margin: 1.25rem 0 1rem; }
.test-rating legend { font-size: 1.3rem; font-weight: 800; margin-bottom: .6rem; }
/* Five faces side by side, the words under each. .test-rating raises these over .member-page label { display: block } */
.test-rating .test-faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.test-rating .test-face-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0;
  padding: 12px 2px; min-height: 96px; text-align: center; font-size: .8rem; font-weight: 700; cursor: pointer;
  border: 2px solid var(--m-line, #e6e2d8); border-radius: 14px; background: var(--m-card, #fff); }
.test-face-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* Tap-to-save buttons (TW #3388): the saved answer shows pressed; the email's face is only a hint. */
.test-rating button.test-face-choice, .test-rating button.test-worked-choice { font: inherit; color: inherit; width: 100%; text-align: inherit; }
.test-rating button.test-face-choice { text-align: center; font-size: .8rem; font-weight: 700; }
.test-face-choice[aria-pressed=true], .test-worked-choice[aria-pressed=true] { border-color: var(--m-accent, #0b5cad); box-shadow: 0 0 0 3px var(--m-accent, #0b5cad); }
.test-face-choice.is-hint { border-style: dashed; border-color: var(--m-accent, #0b5cad); }
.test-saved { min-height: 1.4em; font-weight: 700; color: var(--m-accent, #0b5cad); margin: .25rem 0 0; }
.test-tap-hint { margin-top: 0; }
/* One question at a time (TW #3481): a step not reached yet is hidden, whatever its form's own display. */
.test-conversation [data-feedback-step][hidden] { display: none !important; }
.test-conversation .test-said { margin-bottom: 1.25rem; }
/* Send off until a face and a Yes or No are saved (TW #3420): plainly greyed, the hint right under it. */
.member-button[data-tap-first]:disabled, .task-send[data-tap-first]:disabled { opacity: .4; cursor: not-allowed; }
.test-send-hint { margin: .4rem 0 0; }
/* What you did (TW #3388): the steps, folded away with a tap on a phone. */
.test-did summary { cursor: pointer; list-style: revert; }
.test-did summary h2 { display: inline; }
.test-face-choice:has(input:checked) { border-color: var(--m-accent, #0b5cad); box-shadow: 0 0 0 3px var(--m-accent, #0b5cad); }
.test-face-choice:has(input:focus-visible) { outline: 3px solid var(--m-accent, #0b5cad); outline-offset: 2px; }
.test-face { font-size: 2.2rem; line-height: 1; }
/* Did it work the way the mission said? (TW #3319). No opens What happened? */
.member-page .test-rating .test-worked legend { font-size: 1.3rem; font-weight: 800; }
.test-worked-choices { display: grid; gap: 8px; }
.member-page .test-rating .test-worked-choice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 52px; margin: 0;
  border: 2px solid var(--m-line, #e6e2d8); border-radius: 12px; background: var(--m-card, #fff); font-weight: 700; cursor: pointer; }
.test-worked-choice:has(input:checked) { border-color: var(--m-accent, #0b5cad); box-shadow: 0 0 0 3px var(--m-accent, #0b5cad); }
.test-worked-choice input { width: 1.2rem; height: 1.2rem; }
.test-what-happened { display: none; margin-top: 12px; }
.test-what-happened[hidden] { display: none !important; }
.test-what-happened.is-open, .test-worked:has(input[value=no]:checked) .test-what-happened { display: block; }
.test-worked:has(input[value=yes]:checked) .test-what-happened { display: none; }

/* Mission Accomplished (TW #3398): a bold full-width banner in Kiwanis blue and gold, the Test Mission under it,
   then the prize. */
.mission-accomplished { margin: 0 0 1.5rem; text-align: center; }
.mission-accomplished-banner { display: block; padding: 16px 12px; border-radius: 14px; background: #003f87; color: #f6d77a;
  font-size: 1.7rem; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; border-bottom: 5px solid #d4a62a; }
.mission-accomplished-what { margin: .6rem 0 0; font-weight: 700; }

/* The prize pops up (TW #3480): a native <dialog>. Look B, Steve's pick: night sky, a deep blue radial with faint
   stars, the banner and Close in gold. The markup is the same for every look, so another look is CSS only. The
   page behind doesn't scroll while it's up. */
body:has(dialog.prize-modal[open]) { overflow: hidden; }
.prize-modal { position: fixed; width: min(100% - 28px, 420px); max-height: calc(100dvh - 28px); margin: auto; padding: 18px 16px 14px; overflow-y: auto;
  border: 0; border-radius: 16px; color: #fff; text-align: center; box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  background: radial-gradient(circle at 30% 20%, #1f4f8a 0, #0d2240 60%, #081528 100%); }
.prize-modal::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .4;
  background-image: radial-gradient(#fff 1px, transparent 1.5px), radial-gradient(#fff .8px, transparent 1.2px);
  background-size: 84px 84px, 53px 53px; background-position: 10px 8px, 31px 37px; }
.prize-modal > * { position: relative; }
.prize-modal::backdrop { background: rgba(8, 21, 40, .6); }
.prize-modal .mission-accomplished { margin: 0; }
.prize-modal .mission-accomplished-banner { padding: 0; border: 0; border-radius: 0; background: none; color: #f0b429; font-size: 1.15rem; font-weight: 800; letter-spacing: .04em; }
.prize-modal .mission-accomplished-what { margin: .3rem 0 0; font-size: .95rem; font-weight: 600; opacity: .85; }
.prize-modal .prize { margin: .6rem auto .4rem; }
.prize-modal .prize-replay { color: #f0b429; }
.prize-modal-actions { margin: .5rem 0 0; }
.prize-modal-close { display: block; width: 100%; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 999px;
  background: #f0b429; color: #1d1d1b; font: inherit; font-weight: 700; cursor: pointer; }
.prize-modal-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (min-width: 600px) { .prize-modal-close { display: inline-block; width: auto; min-width: 160px; } }

/* A mission done at once in the chat (TW #4472, Steve's pick A): the prize, then the feedback taps under it in the
   same dialog, in the night sky's white and gold. The prize a little smaller, so Yes and No show on a phone. */
.mission-won .prize { max-width: 250px; margin: .4rem auto .2rem; }
.mission-won-ask { margin: .9rem 0 0; padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .25); font-weight: 700; color: #f0b429; }
.mission-won .test-conversation { text-align: left; }
.mission-won .test-rating fieldset { margin: .6rem 0 .5rem; }
.member-page .mission-won .test-rating legend { color: #fff; font-size: 1.15rem; }
.member-page .mission-won .test-rating .test-worked-choice,
.mission-won .test-rating .test-face-choice { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4); color: #fff; }
.mission-won .test-face-choice[aria-pressed=true], .mission-won .test-worked-choice[aria-pressed=true] { border-color: #f0b429; box-shadow: 0 0 0 3px #f0b429; }
.mission-won .test-worked-choice:focus-visible, .mission-won .test-face-choice:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.mission-won .test-saved { color: #f0b429; }
.mission-won .test-saved:empty { display: none; }
.mission-won .task-textarea { background: #fff; color: #1d1d1b; }
.mission-won label { color: #fff; }
