/* Each story keeps its own server-backed appreciation and message space. */
.story-tablist { gap: 6px; }
.story-tab { min-width: 0; padding-inline: 11px; }
.story-achievements > h3 { font-size: 14px; color: var(--deep); }

.story-impact { margin: 2px 48px 34px; padding: 29px 31px 31px; background: #fbf3e7; border: 1px solid #eadcca; border-radius: 16px; position: relative; }
.story-impact::before { content: ''; position: absolute; top: -1px; left: 31px; width: 52px; height: 4px; border-radius: 0 0 4px 4px; background: var(--orange); }
.impact-heading { margin-bottom: 21px; }
.impact-heading .eyebrow { color: #7a4b77; font-size: 9px; letter-spacing: .13em; }
.impact-heading h3 { color: var(--deep); font-family: var(--serif); font-size: clamp(27px, 3vw, 35px); font-weight: 400; letter-spacing: -.035em; line-height: 1.2; margin-top: 9px; }
.impact-body { display: grid; gap: 25px; }
.has-impact-photo .impact-body { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: start; }
.impact-copy { min-width: 0; }
.impact-copy p, .impact-outcomes li { color: #665364; font-size: 14px; line-height: 1.75; }
.impact-copy > p + p { margin-top: 12px; }
.impact-copy h4 { color: #684462; font-size: 10px; line-height: 1.5; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 7px; }
.impact-collaborators, .impact-outcomes, .impact-legacy { margin-top: 21px; }
.impact-outcomes ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.impact-outcomes li { position: relative; padding-left: 19px; }
.impact-outcomes li::before { content: ''; position: absolute; top: .65em; left: 1px; width: 6px; height: 6px; border-radius: 50%; background: #e68a18; }
.impact-legacy { padding-top: 18px; border-top: 1px solid #e5d4c3; }
.impact-photo { margin: 0; min-width: 0; }
.impact-photo button { display: block; width: 100%; padding: 6px; border: 1px solid #e4d7cd; border-radius: 8px; background: #fffdf9; text-align: left; }
.impact-photo img { width: 100%; height: auto; max-height: 300px; object-fit: contain; border-radius: 4px; display: block; }
.impact-photo button > span { display: block; font-size: 10px; font-weight: 650; color: #774771; padding: 10px 7px 5px; text-decoration: underline; text-underline-offset: 3px; }
.impact-photo figcaption { font-size: 11px; line-height: 1.6; color: #806a79; margin-top: 9px; }

.fellow-engagement { padding: 22px 48px 23px; background: #fffaf3; border-top: 1px solid #eee2d6; border-bottom: 1px solid #eee2d6; }
.engagement-kicker { font-family: var(--serif); font-style: italic; font-size: 19px; color: #76516d; margin-bottom: 13px; line-height: 1.3; }
.engagement-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.engagement-actions button { min-height: 42px; padding: 9px 14px; border: 1px solid #ded0dd; border-radius: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #67435f; font-size: 12px; font-weight: 650; background: #fffdfa; transition: background .16s ease, border-color .16s ease; }
.engagement-actions button:hover:not(:disabled) { background: #f5e9f0; border-color: #bd9ab7; }
.engagement-actions button:disabled { cursor: wait; opacity: .6; }
.engagement-actions .engagement-reaction[aria-pressed=true] { color: var(--deep); background: #f3e6fd; border-color: #aa78cf; box-shadow: inset 0 0 0 1px #aa78cf; }
.engagement-actions .reaction-love[aria-pressed=true] { background: #fbe9e9; border-color: #cb8d98; box-shadow: inset 0 0 0 1px #cb8d98; }
.engagement-icon { font-style: normal; font-size: 18px; line-height: 1; display: inline-block; }
.reaction-count { font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 3px 6px; font-size: 10px; line-height: 1.25; background: #eee3ed; border-radius: 20px; color: #74586e; }
.engagement-actions .engagement-share { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.engagement-actions .engagement-message-link { margin-left: auto; background: #301047; border-color: #301047; color: #fff9ef; }
.engagement-actions .engagement-message-link:hover { background: #4d235b; border-color: #4d235b; }
.engagement-message-link .reaction-count { background: #ffffff21; color: #f9e9f7; }
.engagement-bar-status, .engagement-action-status, .engagement-share-status { font-size: 12px; line-height: 1.6; color: #6e5269; margin-top: 12px; max-width: 720px; }
.engagement-action-status { border-left: 3px solid #c98c2f; padding-left: 11px; }
.engagement-bar-status.is-error, .engagement-action-status.is-error, .engagement-share-status.is-error { color: #873c45; }
.engagement-manual-share { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 15px; max-width: 700px; }
.engagement-manual-share label { grid-column: 1 / -1; font-size: 12px; font-weight: 650; color: var(--deep); }
.engagement-manual-share input { min-width: 0; width: 100%; border: 1px solid #d4bed0; border-radius: 8px; padding: 11px 12px; background: white; font: inherit; font-size: 12px; color: var(--deep); }
.engagement-manual-share > p { grid-column: 1 / -1; font-size: 11px; line-height: 1.5; color: #806c7c; }

.engagement-panel { max-width: 850px; margin: 0 auto; padding: 34px 48px 20px; }
.messages-intro .eyebrow { font-size: 9px; letter-spacing: .13em; color: #86577c; }
.messages-intro h3 { font-family: var(--serif); font-weight: 400; color: var(--deep); letter-spacing: -.04em; font-size: 38px; line-height: 1.15; margin-top: 11px; }
.messages-intro > p:last-child { font-size: 14px; line-height: 1.7; color: #80677c; max-width: 540px; margin-top: 12px; }
.message-form { display: flex; flex-direction: column; margin-top: 25px; background: #fbf6ee; border: 1px solid #ebdfd8; border-radius: 15px; padding: 25px; }
.message-form > label { font-size: 12px; font-weight: 700; color: #63405f; line-height: 1.45; margin-bottom: 8px; }
.message-form > input, .message-form > textarea { display: block; width: 100%; font: inherit; font-size: 15px; line-height: 1.6; border: 1px solid #d7c5d2; background: #fffefd; border-radius: 8px; padding: 11px 13px; color: #38223d; min-width: 0; scroll-margin-top: 190px; }
.message-form > input { margin-bottom: 21px; min-height: 46px; }
.message-form > textarea { resize: vertical; min-height: 145px; max-height: 500px; }
.message-form > input::placeholder, .message-form > textarea::placeholder { color: #9a8394; opacity: 1; }
.message-form > input:disabled, .message-form > textarea:disabled { background: #f1e9ed; color: #7a6675; }
.message-form [aria-invalid=true] { border-color: #ab4e5e; }
.message-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.message-emojis { display: flex; gap: 4px; }
.message-emoji { display: inline-flex; width: 37px; height: 37px; align-items: center; justify-content: center; border-radius: 9px; font-size: 20px; transition: background .16s ease; }
.message-emoji:hover:not(:disabled) { background: #efdfeb; }
.message-emoji:disabled { opacity: .5; cursor: wait; }
.message-character-count { color: #937b8d; font-size: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.message-policy { font-size: 11px; line-height: 1.65; color: #81687a; max-width: 500px; margin-top: 11px; }
.message-submit { margin-top: 19px; align-self: flex-start; font-size: 12px; min-height: 44px; padding: 12px 23px; }
.message-submit:disabled { opacity: .55; cursor: wait; }
.message-form-status { background: #f0e8f5; border: 1px solid #dbcae6; border-radius: 9px; padding: 12px 14px; font-size: 12px; line-height: 1.7; color: #5c366a; margin-top: 17px; }
.message-form-status.is-error { background: #fff0ec; border-color: #e9c4bf; color: #893f48; }
.engagement-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.messages-wall { margin-top: 35px; }
.messages-wall-heading { display: flex; flex-wrap: wrap; gap: 9px 15px; align-items: baseline; padding-bottom: 15px; border-bottom: 1px solid #e9dfe6; }
.messages-wall-heading h4 { color: var(--deep); font-size: 18px; font-weight: 650; letter-spacing: -.025em; line-height: 1.4; }
.messages-total { font-size: 11px; line-height: 1.5; color: #977a8f; font-variant-numeric: tabular-nums; }
.message-refresh { margin-left: auto; padding: 6px 0; font-size: 11px; }
.message-refresh:disabled { opacity: .5; cursor: wait; }
.engagement-loading { margin-top: 20px; color: #8b7082; font-size: 13px; line-height: 1.65; }
.engagement-load-error { margin-top: 20px; padding: 19px 20px; border: 1px solid #e5c7bd; border-radius: 12px; background: #fff6ef; color: #834744; }
.engagement-load-error strong { font-size: 14px; }
.engagement-load-error p { font-size: 12px; line-height: 1.7; margin-top: 7px; }
.engagement-retry { border: 1px solid #b897ad; border-radius: 25px; color: #70446b; padding: 9px 15px; font-size: 11px; font-weight: 650; min-height: 38px; background: #fffdf9; }
.engagement-load-error .engagement-retry { margin-top: 13px; }
.engagement-retry:disabled { opacity: .5; cursor: wait; }
.messages-empty { background: #fbf6ee; border: 1px dashed #d9c5d0; border-radius: 13px; padding: 28px 22px; text-align: center; margin-top: 20px; }
.messages-empty .engagement-icon { font-size: 27px; margin-bottom: 13px; }
.messages-empty p { color: #6b4664; font-size: 15px; font-weight: 600; line-height: 1.5; }
.messages-empty > span:last-child { display: block; color: #987a90; font-size: 12px; line-height: 1.6; margin-top: 7px; }
.messages-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.message-card { padding: 20px; border: 1px solid #e7dce5; border-radius: 13px; background: #fffcf8; min-width: 0; scroll-margin-top: 190px; }
.message-card-head { display: flex; gap: 11px; align-items: center; }
.message-avatar { width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #79576f; font-size: 11px; font-weight: 700; background: #eee0e9; }
.message-byline { min-width: 0; }
.message-name { color: #5d3858; font-size: 13px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.message-date { display: block; color: #a18497; font-size: 10px; margin-top: 2px; }
.message-text { font-size: 14px; line-height: 1.8; color: #735e6c; margin-top: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-more { margin-top: 20px; min-height: 43px; font-size: 12px; }
.engagement-moderation { margin-top: 35px; padding: 24px; border-radius: 13px; background: #f4edf7; border: 1px solid #dfcfe8; }
.engagement-moderation > h4 { color: #593268; font-size: 18px; line-height: 1.4; scroll-margin-top: 190px; }
.message-review-note, .message-review-empty { font-size: 12px; line-height: 1.6; color: #8b7296; margin-top: 7px; }
.engagement-moderation > .messages-total { margin-top: 12px; }
.message-pending-label { margin-left: auto; color: #8b6b31; font-size: 9px; background: #fbefd7; border: 1px solid #edd9aa; padding: 4px 7px; border-radius: 20px; white-space: nowrap; }
.message-review-actions { display: flex; gap: 9px; padding-top: 14px; margin-top: 15px; border-top: 1px solid #eee1e8; }
.message-review-actions button { border: 1px solid #c3a6ce; border-radius: 25px; padding: 8px 13px; min-height: 35px; font-size: 11px; color: #74417f; font-weight: 650; }
.message-review-actions .message-approve { color: #fff; background: #653975; border-color: #653975; }
.message-review-actions button:disabled { opacity: .5; cursor: wait; }
.message-review-status { font-size: 12px; line-height: 1.7; color: #694270; margin-top: 14px; }
.message-review-status.is-error { color: #893f48; }
.fellow-engagement button:focus-visible, .fellow-engagement input:focus-visible, .engagement-panel button:focus-visible, .engagement-panel input:focus-visible, .engagement-panel textarea:focus-visible, .impact-photo button:focus-visible { outline: 3px solid #ffad46; outline-offset: 3px; }

@media (max-width: 900px) {
  .fellow-engagement { padding: 22px 32px; }
  .story-impact { margin-inline: 32px; padding: 25px; }
  .has-impact-photo .impact-body { grid-template-columns: 1fr; }
  .impact-photo { max-width: 460px; }
  .engagement-panel { padding-inline: 32px; }
}

@media (max-width: 650px) {
  .story-tablist { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding-inline: 10px; }
  .story-tab { padding: 9px 4px; font-size: 10px; min-height: 43px; white-space: normal; }
  .story-achievements > h3 { font-size: 12px; }
  .story-impact { margin: 2px 18px 25px; padding: 23px 21px; border-radius: 12px; }
  .story-impact::before { left: 21px; }
  .impact-heading .eyebrow { font-size: 8px; }
  .impact-heading h3 { font-size: 28px; }
  .impact-copy p, .impact-outcomes li { font-size: 13px; line-height: 1.8; }
  .impact-copy h4 { font-size: 9px; }
  .fellow-engagement { padding: 20px 22px; }
  .engagement-kicker { font-size: 18px; margin-bottom: 12px; }
  .engagement-actions { gap: 7px; }
  .engagement-actions button { min-height: 42px; font-size: 11px; padding: 9px 12px; gap: 7px; }
  .engagement-actions .engagement-message-link { margin-left: 0; flex-basis: 100%; justify-content: center; margin-top: 3px; }
  .engagement-actions .engagement-share { margin-left: auto; }
  .engagement-bar-status, .engagement-action-status, .engagement-share-status { font-size: 11px; }
  .engagement-panel { padding: 27px 21px 15px; }
  .messages-intro h3 { font-size: 33px; }
  .messages-intro > p:last-child { font-size: 13px; }
  .message-form { padding: 20px 16px; margin-top: 21px; border-radius: 12px; }
  .message-form > input, .message-form > textarea { font-size: 16px; padding: 11px; scroll-margin-top: 185px; }
  .message-form > label { font-size: 11px; }
  .message-form > textarea { min-height: 165px; }
  .message-policy { font-size: 10px; }
  .message-submit { width: 100%; min-height: 44px; font-size: 12px; }
  .message-character-count { font-size: 9px; }
  .message-emoji { width: 34px; height: 36px; font-size: 19px; }
  .messages-wall-heading { gap: 7px 12px; }
  .messages-wall-heading h4 { flex-basis: 100%; font-size: 17px; }
  .messages-total { font-size: 10px; }
  .message-card { padding: 17px; }
  .message-text { font-size: 13px; }
  .message-name { font-size: 12px; }
  .message-date { font-size: 9px; }
  .engagement-moderation { padding: 20px 15px; }
  .engagement-moderation > h4 { font-size: 17px; }
  .message-pending-label { max-width: 75px; white-space: normal; font-size: 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .engagement-actions button, .message-emoji { transition: none; }
}

@media print {
  .fellow-engagement, .story-panel-messages, .story-panel-messages[hidden] { display: none !important; }
  .story-impact { break-inside: avoid; border-color: #ddd; background: white; }
  .impact-photo button > span { display: none; }
}
