/* Experience: the chat app (a messenger-style interface marked data-ui) and the impact ledger. */

.chat-sec { background: var(--mist); padding-block: clamp(28px, 5vw, 80px); }

.wa {
  --wa-green: #00a884;
  --wa-green-ink: #008069;
  --wa-out: #d9fdd3;
  --wa-ink: #111b21;
  --wa-ink-2: #667781;
  --wa-line: #e9edef;
  --wa-panel: #f0f2f5;
  --wa-blue: #53bdeb;
  position: relative;
  display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  height: min(820px, calc(100vh - var(--nav-h) - 40px)); min-height: 580px;
  border-radius: 28px; overflow: hidden; background: #fff; color: var(--wa-ink);
  box-shadow: 0 50px 110px -50px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .05);
  font-size: 15px; letter-spacing: -.004em;
}
.wa.has-info { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) 340px; }

/* ---------- Sidebar ---------- */
.wa-side { display: flex; flex-direction: column; min-height: 0; background: #fff; border-right: 1px solid var(--wa-line); }
.wa-side-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 10px; }
.wa-me { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.wa-side-head h2 { font-size: 23px; font-weight: 700; letter-spacing: -.025em; }
.wa-unread { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--wa-green-ink); }
.wa-search { display: flex; align-items: center; gap: 10px; margin: 6px 16px 10px; padding: 0 12px; border-radius: 10px; background: var(--wa-panel); color: var(--wa-ink-2); }
.wa-search svg { width: 18px; height: 18px; flex: none; }
.wa-search input { flex: 1; min-width: 0; height: 38px; border: 0; background: none; outline: none; font-size: 15px; color: var(--wa-ink); }
.wa-search input::-webkit-search-cancel-button { filter: grayscale(1); }
.wa-search:focus-within { box-shadow: 0 0 0 2px var(--wa-green); }
.wa-filters { display: flex; gap: 8px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.wa-filters::-webkit-scrollbar { display: none; }
.wa-filters button {
  flex: none; border: 0; border-radius: 999px; padding: 6px 13px; background: var(--wa-panel); color: var(--wa-ink-2); font-size: 14px;
  transition: background-color .18s ease, color .18s ease, transform .14s var(--ease-out);
}
.wa-filters button:hover { background: #e4e7ea; }
.wa-filters button:active { transform: scale(.95); }
.wa-filters button[aria-pressed="true"] { background: var(--wa-out); color: var(--wa-green-ink); font-weight: 600; }
.wa-list { flex: 1; overflow-y: auto; margin: 0; padding: 0 0 8px; list-style: none; }
.wa-row {
  position: relative; display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 3px 14px; align-items: center;
  width: 100%; padding: 12px 18px; border: 0; background: none; text-align: left;
  transition: background-color .15s ease;
}
.wa-row:hover { background: #f5f6f6; }
.wa-row[aria-current="true"] { background: var(--wa-panel); }
.wa-row .wa-av { grid-row: span 2; }
.wa-row b { font-size: 16.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-row time { font-size: 12px; color: var(--wa-ink-2); justify-self: end; }
.wa-row.unread time { color: var(--wa-green-ink); font-weight: 600; }
.wa-prev { font-size: 14px; color: var(--wa-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-prev.typing { color: var(--wa-green-ink); }
.wa-badge { justify-self: end; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: #25d366; color: #fff; font-size: 12px; font-weight: 700; }
.wa-badge.pop { animation: pop .4s var(--ease-out); }
.wa-av { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: -.02em; flex: none; }
.wa-none { padding: 32px 20px; text-align: center; color: var(--wa-ink-2); font-size: 14px; }
.wa-foot { padding: 12px 20px 16px; font-size: 12.5px; color: var(--wa-ink-2); }
@keyframes pop { 50% { transform: scale(1.25); } }

/* ---------- Thread ---------- */
.wa-main {
  position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background-color: #efeae2; background-image: var(--doodle); background-size: 200px;
}
.wa-empty { flex: 1; display: grid; place-items: center; padding: 32px; background: #f8f9fa; text-align: center; color: var(--wa-ink-2); }
.wa-empty-in { max-width: 340px; }
.wa-empty-mark { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 20px; border-radius: 26px; background: var(--ink); color: #fff; font-size: 26px; font-weight: 800; letter-spacing: -.04em; }
.wa-empty-h { font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--wa-ink); margin-bottom: 6px; }
.wa-head { display: flex; align-items: center; gap: 4px; min-height: 64px; padding: 10px 12px; background: var(--wa-panel); }
.wa-who { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 4px 6px; border: 0; border-radius: 12px; background: none; text-align: left; transition: background-color .15s ease; }
.wa-who:hover { background: rgba(0, 0, 0, .04); }
.wa-who .wa-av { width: 42px; height: 42px; font-size: 13px; }
.wa-who-t { display: grid; min-width: 0; line-height: 1.25; }
.wa-who-t b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-who-t small { font-size: 13px; color: var(--wa-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-who-t small.typing { color: var(--wa-green-ink); }
.wa-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #54656f; transition: background-color .15s ease, transform .14s var(--ease-out); }
.wa-icon:hover { background: rgba(0, 0, 0, .06); }
.wa-icon:active { transform: scale(.92); }
.wa-icon svg { width: 22px; height: 22px; }
.wa-back { display: none; }
.wa-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 16px clamp(14px, 5%, 64px) 12px; overscroll-behavior: contain; }

/* messages */
.m { display: flex; max-width: min(80%, 560px); }
.m-in { align-self: flex-start; }
.m-out { align-self: flex-end; }
.m.tail { margin-top: 10px; }
.m-b {
  position: relative; padding: 6px 9px 8px; border-radius: 9px;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
  font-size: 15px; line-height: 1.42; overflow-wrap: anywhere;
}
.m-in .m-b { background: #fff; }
.m-out .m-b { background: var(--wa-out); }
.m-in.tail .m-b { border-top-left-radius: 0; }
.m-out.tail .m-b { border-top-right-radius: 0; }
.m-in.tail .m-b::before { content: ""; position: absolute; top: 0; left: -8px; width: 8px; height: 13px; background: inherit; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.m-out.tail .m-b::before { content: ""; position: absolute; top: 0; right: -8px; width: 8px; height: 13px; background: inherit; clip-path: polygon(0 0, 100% 0, 0 100%); }
.m-name { display: block; margin-bottom: 1px; font-size: 13px; font-weight: 600; color: #1f7aec; }
.m-pad { display: inline-block; width: 56px; height: 1px; }
.m-out .m-pad { width: 78px; }
.m-meta { position: absolute; right: 8px; bottom: 4px; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--wa-ink-2); white-space: nowrap; }
.m-meta svg { width: 16px; height: 11px; color: #8696a0; transition: color .35s ease; }
.m-meta svg.read { color: var(--wa-blue); }
.has-card .m-meta { position: static; display: flex; justify-content: flex-end; margin-top: 4px; }
.m-date, .m-sys { align-self: center; border-radius: 8px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); font-size: 12.5px; color: #54656f; text-align: center; }
.m-date { margin: 14px 0 6px; padding: 5px 12px; background: #fff; }
.m-sys { max-width: 88%; margin: 4px 0 6px; padding: 6px 12px; background: #ffeecd; }
.m-typing { display: flex; gap: 4px; padding: 13px 14px; }
.m-typing i { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: wdot 1.2s infinite; }
.m-typing i:nth-child(2) { animation-delay: .15s; }
.m-typing i:nth-child(3) { animation-delay: .3s; }
.m-enter { animation: m-in .38s var(--ease-out) both; }
.m-in.m-enter { transform-origin: left bottom; }
.m-out.m-enter { transform-origin: right bottom; }
@keyframes m-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes wdot { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }

/* cards inside messages */
.c { display: grid; gap: 8px; width: min(300px, 62vw); padding: 4px 1px 0; }
.c-title { font-size: 13px; font-weight: 600; color: var(--wa-ink-2); }
.c-stat b { display: block; font-size: 38px; font-weight: 700; letter-spacing: -.045em; line-height: 1; color: var(--wa-green-ink); }
.c-stat span { font-size: 14px; color: var(--wa-ink-2); }
.c-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 52px; gap: 10px; align-items: center; font-size: 13px; color: var(--wa-ink-2); }
.c-row b { color: var(--wa-ink); text-align: right; font-variant-numeric: tabular-nums; }
.c-track { height: 10px; border-radius: 5px; background: var(--wa-line); overflow: hidden; }
.c-track i { display: block; height: 100%; width: calc(var(--w) * 100%); border-radius: inherit; transform-origin: left; animation: c-grow 1.1s var(--ease-out) both .15s; }
.c-track i.slow { background: #ff453a; }
.c-track i.fast { background: var(--wa-green); }
.c-note { font-size: 14px; font-weight: 600; color: var(--wa-green-ink); }
.c-pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.c-pipe span { padding: 8px 2px; border-radius: 8px; background: var(--wa-line); color: var(--wa-ink-2); font-size: 12.5px; text-align: center; animation: pipe 2.8s infinite; animation-delay: calc(var(--i) * .32s); }
.c-mon { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 3px; }
.c-mon i { aspect-ratio: 1; border-radius: 3px; background: var(--wa-green); }
.c-mon i.warn { animation: warn 3.2s infinite; }
.c-spark { width: 100%; height: 46px; }
.c-spark path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.6s var(--ease-out) forwards .2s; }
.c-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.c-grid div { padding: 10px 12px; border-radius: 10px; background: var(--wa-panel); }
.c-grid b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.c-grid span { font-size: 12.5px; color: var(--wa-ink-2); }
.c-link { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--wa-panel); box-shadow: inset 4px 0 0 var(--wa-green); color: inherit; transition: background-color .15s ease; }
.c-link:hover { background: var(--wa-line); }
.c-link b { font-size: 14.5px; }
.c-link span { font-size: 13px; color: var(--wa-ink-2); }
.c-link small { font-size: 12px; color: var(--wa-green-ink); }
@keyframes c-grow { from { transform: scaleX(0); } }
@keyframes pipe { 0%, 100% { background: var(--wa-line); color: var(--wa-ink-2); } 18%, 64% { background: var(--wa-green); color: #fff; } }
@keyframes warn { 0%, 55%, 100% { background: var(--wa-green); } 62%, 80% { background: #ff9f0a; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* quick replies + composer */
.wa-quick { display: flex; gap: 8px; padding: 8px clamp(14px, 5%, 64px) 6px; overflow-x: auto; scrollbar-width: none; }
.wa-quick::-webkit-scrollbar { display: none; }
.wa-quick button, .wa-quick a {
  flex: none; border: 0; border-radius: 999px; padding: 8px 15px; background: #fff; color: var(--wa-green-ink);
  font-size: 14px; font-weight: 500; box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
  transition: background-color .15s ease, transform .14s var(--ease-out);
  animation: m-in .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms);
}
.wa-quick button:hover, .wa-quick a:hover { background: #f5f6f6; }
.wa-quick button:active, .wa-quick a:active { transform: scale(.95); }
.wa-quick button:disabled { opacity: .5; cursor: default; }
.wa-compose { display: flex; align-items: center; gap: 8px; padding: 10px 14px 12px; background: var(--wa-panel); }
.wa-compose input { flex: 1; min-width: 0; height: 44px; padding: 0 18px; border: 0; border-radius: 22px; background: #fff; font-size: 15px; outline: none; }
.wa-compose input:focus-visible { box-shadow: 0 0 0 2px var(--wa-green); }
.wa-send { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--wa-green); color: #fff; transition: transform .14s var(--ease-out), opacity .2s ease; }
.wa-send:hover { background: #06cf9c; }
.wa-send:active { transform: scale(.9); }
.wa-send:disabled { opacity: .45; cursor: default; }
.wa-send svg { width: 20px; height: 20px; }

/* ---------- Role details ---------- */
.wa-info { display: flex; flex-direction: column; min-height: 0; background: #fff; border-left: 1px solid var(--wa-line); }
.wa-info-head { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 10px 12px; background: var(--wa-panel); font-weight: 600; }
.wa-info-body { flex: 1; overflow-y: auto; padding: 28px 24px 32px; }
.wi-av { width: 96px; height: 96px; margin: 0 auto 14px; font-size: 28px; }
.wi-name { font-size: 21px; font-weight: 700; letter-spacing: -.022em; text-align: center; }
.wi-sub { margin-top: 2px; color: var(--wa-ink-2); text-align: center; }
.wi-sec { margin-top: 26px; }
.wi-sec h3 { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--wa-green-ink); }
.wi-sec ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; }
.wi-facts { display: grid; gap: 6px; font-size: 14px; }
.wi-facts div { display: flex; justify-content: space-between; gap: 16px; }
.wi-facts span { color: var(--wa-ink-2); }
.wi-facts b { font-weight: 500; text-align: right; }
.wi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wi-chips span { padding: 4px 10px; border-radius: 999px; background: var(--wa-panel); font-size: 13px; }

@media (max-width: 1120px) {
  .wa.has-info { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .wa-info { position: absolute; inset: 0 0 0 auto; z-index: 5; width: min(360px, 100%); box-shadow: -24px 0 60px -24px rgba(0, 0, 0, .3); }
}
@media (max-width: 820px) {
  .chat-sec { padding-block: 12px 40px; }
  .chat-sec .wrap-wide { width: calc(100% - 20px); }
  .wa, .wa.has-info { grid-template-columns: minmax(0, 1fr); height: calc(100svh - var(--nav-h) - 24px); min-height: 520px; border-radius: 22px; }
  .wa-main { display: none; }
  .wa.thread .wa-side { display: none; }
  .wa.thread .wa-main { display: flex; }
  .wa-back { display: grid; }
  .m { max-width: 88%; }
  .wa-info { width: 100%; }
}

/* ---------- Impact ledger ---------- */
.impact-lead { margin-top: 18px; font-weight: 400; }
.ledger { display: grid; gap: 12px; margin-top: clamp(48px, 6vw, 80px); }
.ledger li {
  display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto; gap: 6px 32px; align-items: center;
  padding: 28px 32px; border-radius: var(--r-lg); background: var(--mist);
}
.lg-n { font-size: clamp(44px, 5vw, 68px); font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.lg-t h3 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.lg-t p { margin-top: 2px; color: var(--ink-2); }
.lg-co { font-size: 14px; font-weight: 500; color: var(--ink-2); text-align: right; }
.lg-bar { grid-column: 2 / -1; height: 8px; border-radius: 4px; background: var(--mist-2); overflow: hidden; }
.lg-bar i { display: block; height: 100%; width: calc(var(--w) * 100%); border-radius: inherit; background: var(--blue); transform-origin: left; }
.lg-bar-count { background: none; }
.lg-bar-count i { width: min(100%, 600px); background: radial-gradient(circle at 4px 4px, var(--ok) 3.4px, transparent 4px) 0 0 / 12px 8px repeat-x; }
html.js .ledger .reveal .lg-bar i { transform: scaleX(0); transition: transform 1.3s var(--ease-out) .3s; }
html.js .ledger .reveal.in .lg-bar i { transform: none; }
@media (max-width: 720px) {
  .ledger li { grid-template-columns: minmax(0, 1fr); padding: 24px; }
  .lg-n { grid-row: auto; }
  .lg-co { text-align: left; }
  .lg-bar { grid-column: auto; }
}

.next-band .next .t-display span { color: var(--on-dark-2); }

.exp-static { display: grid; gap: 32px; padding: 32px; border-radius: var(--r-lg); background: #fff; }
.exp-static h2 { font-size: 21px; }
.exp-static p { color: var(--ink-2); }
