/* Coin chat: a tape of every trade over the thread, the wallets in the chat beside it.
   In the thread one wallet's run of messages is one card; a published trade opens a card of its
   own, glowing in its side's colour (design-refs/coin-chat-five 3 + coin-chat-deal-five 3, 2026-11-03).
   Loaded after every other coin-page sheet. */

html body #detailView.dv-c3.dv-spot #dvChatTabBody{
  --chat-ink:var(--c3-ink);--chat-mute:var(--c3-mute);--chat-rim:rgba(255,255,255,.4);
  --chat-bub:#1A1A1A;--chat-field:#070707;--chat-send:#EDEDE6;--chat-send-ink:#0F0F10;--chat-focus:#EDEDE6;--chat-hover:rgba(255,255,255,.05);
  --chat-up:var(--c3-upT);--chat-dn:var(--c3-dnT);--chat-dev:var(--ut-dev-ring);--chat-trk:var(--ut-trk-ring);--chat-you:#4DB8FF;
  --chat-card:#1C1C1F;--chat-own-card:#0F2336;
  --chat-buy-base:#101A15;--chat-sell-base:#1C1113;--chat-tone-when:#D3DDD7;
  --chat-buy-glow:radial-gradient(120% 160% at 100% 0%,rgba(34,194,122,.45),rgba(34,194,122,.1) 50%,transparent 72%);
  --chat-sell-glow:radial-gradient(120% 160% at 100% 0%,rgba(240,80,110,.42),rgba(240,80,110,.1) 50%,transparent 72%);
  --chat-h:458px;
  display:grid;grid-template-columns:252px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;column-gap:16px;padding-top:6px;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif;color:var(--chat-ink);
}
/* light theme: no white, the panel's own blues */
html:not([data-theme="dark"]):not([data-scheme="dark"]):not([data-theme="voidtype"]) body #detailView.dv-c3.dv-spot #dvChatTabBody{
  --chat-ink:#0A2540;--chat-mute:#3B5670;--chat-rim:#4A7BA6;
  --chat-bub:rgba(192,221,249,.92);--chat-field:var(--lb-field);--chat-send:#0067B3;--chat-send-ink:#fff;--chat-focus:#0067B3;--chat-hover:rgba(0,103,179,.08);
  --chat-up:#0A5F31;--chat-dn:#8A1428;--chat-dev:#084F26;--chat-trk:#034E7A;--chat-you:#004A85;
  --chat-card:#E3F0FC;--chat-own-card:#C6DEF6;
  --chat-buy-base:#D3ECDF;--chat-sell-base:#F4DCE2;--chat-tone-when:#24405A;
  --chat-buy-glow:radial-gradient(120% 160% at 100% 0%,rgba(22,163,74,.38),rgba(22,163,74,.08) 50%,transparent 72%);
  --chat-sell-glow:radial-gradient(120% 160% at 100% 0%,rgba(229,72,77,.34),rgba(229,72,77,.07) 50%,transparent 72%);
}
html[data-glass] body #detailView.dv-c3.dv-spot #dvChatTabBody{--chat-bub:var(--g-cell);--chat-field:var(--g-cell);--chat-card:var(--g-cell)}
/* no one has written yet: no empty panel, the thread takes the whole width */
html body #detailView.dv-c3.dv-spot #dvChatTabBody:has(.chat-people:empty){display:flex;flex-direction:column}

/* ── wallets in the chat ──────────────────────────────────────────────────── */
html body #detailView.dv-c3.dv-spot .chat-people{grid-row:1 / 3;display:flex;flex-direction:column;min-height:0;max-height:calc(var(--chat-h) + 60px);padding:12px 8px 8px;border-radius:18px;background:var(--chat-bub)}
html body #detailView.dv-c3.dv-spot .chat-people:empty{display:none}
html body #detailView.dv-c3.dv-spot .chat-people-head{display:flex;justify-content:space-between;margin:0;padding:0 8px 8px;font-size:13px;font-weight:700;color:var(--chat-ink)}
html body #detailView.dv-c3.dv-spot .chat-people-head span{color:var(--chat-mute);font-weight:600;font-variant-numeric:tabular-nums}
html body #detailView.dv-c3.dv-spot .chat-people-list{flex:1;min-height:0;display:flex;flex-direction:column;gap:1px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain}
/* styled so it stays visible: macOS hides plain scrollbars and the list would look cut off */
@media(min-width:861px){
  html body #detailView.dv-c3.dv-spot .chat-people-list::-webkit-scrollbar{width:6px}
  html body #detailView.dv-c3.dv-spot .chat-people-list::-webkit-scrollbar-thumb{border-radius:3px;background:var(--c3-line2)}
  html body #detailView.dv-c3.dv-spot .chat-people-list::-webkit-scrollbar-track{background:transparent}
}
html body #detailView.dv-c3.dv-spot .chat-person{flex:none;display:flex;align-items:center;gap:9px;width:100%;min-height:44px;padding:5px 8px;border:0;border-radius:11px;background:none;color:var(--chat-ink);font-family:inherit;font-size:14px;font-weight:600;line-height:1.2;text-align:left;cursor:pointer}
html body #detailView.dv-c3.dv-spot .chat-person img{flex:none;width:30px;height:30px;border-radius:50%;object-fit:cover}
html body #detailView.dv-c3.dv-spot .chat-person[data-role="dev"] img{outline:2px solid var(--chat-dev);outline-offset:-2px}
html body #detailView.dv-c3.dv-spot .chat-person[data-role="tracked"] img{outline:2px solid var(--chat-trk);outline-offset:-2px}
html body #detailView.dv-c3.dv-spot .chat-person[data-own] .chat-person-name{color:var(--chat-you)}
html body #detailView.dv-c3.dv-spot .chat-person-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body #detailView.dv-c3.dv-spot .chat-person-pct{margin-left:auto;font-size:13.5px;font-weight:750;font-variant-numeric:tabular-nums}
@media(hover:hover){html body #detailView.dv-c3.dv-spot .chat-person:hover{background:var(--chat-hover)}}

/* ── tape ─────────────────────────────────────────────────────────────────── */
html body #detailView.dv-c3.dv-spot .chat-main{grid-column:2;grid-row:1;position:relative;min-width:0;min-height:0}
html body #detailView.dv-c3.dv-spot .chat-tape{display:flex;gap:6px;height:38px;margin-bottom:6px;overflow:hidden;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent)}
html body #detailView.dv-c3.dv-spot .chat-tape:empty{display:none}
html body #detailView.dv-c3.dv-spot .chat-pill{flex:none;display:inline-flex;align-items:center;gap:4px;height:34px;margin-top:2px;padding:0 12px 0 4px;border:0;border-radius:17px;font-family:inherit;font-size:14px;line-height:1;font-variant-numeric:tabular-nums;cursor:pointer}
html body #detailView.dv-c3.dv-spot .chat-pill b{font-weight:700}
html body #detailView.dv-c3.dv-spot .chat-pill[data-side="buy"]{background:color-mix(in srgb,var(--c3-up) 13%,transparent);color:var(--chat-up)}
html body #detailView.dv-c3.dv-spot .chat-pill[data-side="sell"]{background:color-mix(in srgb,var(--c3-dn) 13%,transparent);color:var(--chat-dn)}
html body #detailView.dv-c3.dv-spot .chat-pill img:first-child{width:26px;height:26px;border-radius:50%;object-fit:cover}
html body #detailView.dv-c3.dv-spot .chat-gem{flex:none;width:16px;height:16px}

/* ── thread ───────────────────────────────────────────────────────────────── */
html body #detailView.dv-c3.dv-spot .chat-list{display:flex;flex-direction:column;height:calc(var(--chat-h) - 44px);padding:0 0 6px;overflow:hidden auto;scrollbar-width:thin;scrollbar-color:var(--c3-line2) transparent;outline:0}
html body #detailView.dv-c3.dv-spot .chat-main:has(.chat-tape:empty) .chat-list{height:var(--chat-h)}
html body #detailView.dv-c3.dv-spot .chat-list > :first-child{margin-top:auto}
html body #detailView.dv-c3.dv-spot .chat-list:focus-visible{border-radius:12px;box-shadow:inset 0 0 0 2px var(--chat-focus)}
html body #detailView.dv-c3.dv-spot .chat-card{flex:none;display:flex;flex-direction:column;gap:6px;min-width:0;padding:12px 14px 12px 8px;border-radius:16px;background:var(--chat-card)}
html body #detailView.dv-c3.dv-spot .chat-list > .chat-card:not(:first-child){margin-top:8px}
html body #detailView.dv-c3.dv-spot .chat-card[data-own]{background:var(--chat-own-card)}
html body #detailView.dv-c3.dv-spot .chat-row{display:flex;align-items:flex-start;gap:10px;min-width:0}
html body #detailView.dv-c3.dv-spot .chat-gut{flex:none;width:52px;display:flex;flex-direction:column;align-items:center;gap:4px}
html body #detailView.dv-c3.dv-spot .chat-gut .chat-tag{height:15px;padding:0 4px;border-radius:4px;font-size:9px;letter-spacing:.01em}
html body #detailView.dv-c3.dv-spot .chat-av{display:block;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer}
html body #detailView.dv-c3.dv-spot .chat-av img{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover}
html body #detailView.dv-c3.dv-spot .chat-row[data-role="dev"] .chat-av img{outline:2px solid var(--chat-dev);outline-offset:-2px}
html body #detailView.dv-c3.dv-spot .chat-row[data-role="tracked"] .chat-av img{outline:2px solid var(--chat-trk);outline-offset:-2px}
html body #detailView.dv-c3.dv-spot .chat-body{flex:1;min-width:0}
html body #detailView.dv-c3.dv-spot .chat-head{display:flex;align-items:baseline;gap:8px;min-width:0;margin-bottom:4px}
html body #detailView.dv-c3.dv-spot .chat-name{min-width:0;overflow:hidden;padding:0;border:0;background:none;color:var(--chat-ink);font-family:inherit;font-size:14px;font-weight:700;line-height:1.3;text-align:left;text-overflow:ellipsis;cursor:pointer;white-space:nowrap}
html body #detailView.dv-c3.dv-spot .chat-row[data-role="dev"] .chat-name{color:var(--chat-dev)}
html body #detailView.dv-c3.dv-spot .chat-row[data-role="tracked"] .chat-name{color:var(--chat-trk)}
html body #detailView.dv-c3.dv-spot .chat-row[data-own] .chat-name{color:var(--chat-you)}
html body #detailView.dv-c3.dv-spot .chat-when{flex:none;margin-left:auto;font-size:12px;font-weight:500;color:var(--chat-mute);font-variant-numeric:tabular-nums}
html body #detailView.dv-c3.dv-spot .chat-tag{flex:none;display:inline-flex;align-items:center;height:16px;padding:0 5px;border-radius:5px;font-size:10px;font-weight:800;letter-spacing:.03em;line-height:1;text-transform:uppercase}
html body #detailView.dv-c3.dv-spot .chat-tag-dev{background:var(--ut-dev-bg);color:var(--ut-dev-fg)}
html body #detailView.dv-c3.dv-spot .chat-tag-tracked{background:var(--ut-trk-bg);color:var(--ut-trk-fg)}
html body #detailView.dv-c3.dv-spot .chat-text{font-size:15.5px;line-height:1.4;color:var(--chat-ink);white-space:pre-wrap;overflow-wrap:anywhere}
html body #detailView.dv-c3.dv-spot .chat-row[data-emoji] .chat-text{font-size:28px;line-height:1.2}

/* a published trade's card: its side's colour, glowing from the top corner */
html body #detailView.dv-c3.dv-spot .chat-card[data-tone="buy"]{--chat-tone:var(--chat-up);background:var(--chat-buy-glow),var(--chat-buy-base)}
html body #detailView.dv-c3.dv-spot .chat-card[data-tone="sell"]{--chat-tone:var(--chat-dn);background:var(--chat-sell-glow),var(--chat-sell-base)}
html body #detailView.dv-c3.dv-spot .chat-card[data-tone] :is(.chat-when,.chat-trade-late){color:var(--chat-tone-when)}
html body #detailView.dv-c3.dv-spot .chat-trade{display:flex;flex-direction:column;align-items:flex-start;gap:3px;margin:2px 0 4px;color:var(--chat-tone);font-variant-numeric:tabular-nums}
html body #detailView.dv-c3.dv-spot .chat-trade-kind{font-size:12px;font-weight:800;letter-spacing:.07em;line-height:1.3;text-transform:uppercase}
html body #detailView.dv-c3.dv-spot .chat-trade-sum{display:inline-flex;align-items:center;gap:6px}
html body #detailView.dv-c3.dv-spot .chat-trade-sum b{font-size:34px;font-weight:850;letter-spacing:-.025em;line-height:1.05}
/* GRAM's coin beside the amount, 40 px (design-refs/gram-size-five 2, user 2026-11-03) */
html body #detailView.dv-c3.dv-spot .chat-trade-gem{flex:none;display:block;width:40px;height:40px;object-fit:contain}
html body #detailView.dv-c3.dv-spot .chat-trade-late{font-size:12.5px;font-weight:500}
html body #detailView.dv-c3.dv-spot .chat-empty{margin:auto;display:flex;flex-direction:column;gap:4px;font-size:14px;color:var(--chat-mute);text-align:center}
html body #detailView.dv-c3.dv-spot .chat-empty b{font-size:16px;color:var(--chat-ink)}
html body #detailView.dv-c3.dv-spot .chat-jump{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);height:34px;padding:0 14px;border:0;border-radius:17px;background:var(--chat-send);color:var(--chat-send-ink);font-family:inherit;font-size:13px;font-weight:700;line-height:1;cursor:pointer;white-space:nowrap}
html body #detailView.dv-c3.dv-spot .chat-jump[hidden]{display:none}

/* trades */
html body #detailView.dv-c3.dv-spot .chat-deal{display:inline-flex;align-items:center;flex-wrap:wrap;gap:0 5px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
html body #detailView.dv-c3.dv-spot .chat-deal[data-side="buy"]{color:var(--chat-up)}
html body #detailView.dv-c3.dv-spot .chat-deal[data-side="sell"]{color:var(--chat-dn)}
html body #detailView.dv-c3.dv-spot .chat-deal-arrow{font-size:.7em;line-height:1}
html body #detailView.dv-c3.dv-spot .chat-deal-ago{margin-left:3px;font-weight:400;color:var(--chat-mute)}

/* ── footer: every state keeps the field's height, so switching never moves the thread ── */
html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-footer{grid-column:2;grid-row:2;flex-shrink:0;padding:8px 0 2px;border:0;background:none;box-shadow:none}
html body #detailView.dv-c3.dv-spot .chat-input-row{display:flex;align-items:flex-end;gap:8px}
html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-input{flex:1;min-width:0;min-height:46px;max-height:110px;padding:12px 14px;border:0!important;border-radius:12px;background:var(--chat-field)!important;box-shadow:inset 0 0 0 1px var(--chat-rim)!important;
  color:var(--chat-ink);font-family:inherit;font-size:15px;font-weight:400;line-height:22px;resize:none;outline:0;overflow:hidden auto;overflow-wrap:break-word;white-space:pre-wrap;transition:box-shadow .15s ease}
html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-input::placeholder{color:var(--chat-mute);opacity:1}
html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-input:focus{box-shadow:inset 0 0 0 2px var(--chat-focus)!important}
html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-send-btn{flex:none;display:flex;align-items:center;justify-content:center;width:46px;height:46px;border:0;border-radius:12px;background:var(--chat-send);color:var(--chat-send-ink);box-shadow:none;cursor:pointer;transition:transform .12s ease,opacity .15s ease}
html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-send-btn:active{transform:scale(.96)}
html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-send-btn:disabled{opacity:.3;cursor:not-allowed}
html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-input:placeholder-shown + .chat-send-btn{opacity:.55}
html body #detailView.dv-c3.dv-spot #dvChatTabBody :is(.chat-lock,.chat-connect-hint,.chat-gate){display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:46px;padding:6px 6px 6px 14px;border:0;border-radius:12px;background:var(--chat-field);box-shadow:inset 0 0 0 1px var(--chat-rim);
  color:var(--chat-ink);font-size:14px;font-weight:500;text-align:left}
html body #detailView.dv-c3.dv-spot #dvChatTabBody :is(.chat-lock,.chat-connect-hint,.chat-gate)[style*="none"]{display:none}
html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-lock-text{flex:1;min-width:0;color:var(--chat-ink);font-size:14px;font-weight:500}
html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-lock-text strong{color:var(--chat-ink);font-weight:750}
html body #detailView.dv-c3.dv-spot .chat-gate-text{flex:1;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:0 10px}
html body #detailView.dv-c3.dv-spot .chat-action{flex:none;height:34px;padding:0 14px;border:0;border-radius:9px;background:var(--chat-send);color:var(--chat-send-ink);font-family:inherit;font-size:13.5px;font-weight:700;line-height:1;cursor:pointer;white-space:nowrap}
html body #detailView.dv-c3.dv-spot .chat-action:disabled{opacity:.6;cursor:default}
html body #detailView.dv-c3.dv-spot #dvChatTabBody :is(.chat-av,.chat-name,.chat-jump,.chat-action,.chat-person,.chat-send-btn):focus-visible{outline:2px solid var(--chat-focus);outline-offset:2px}

/* ── phones ───────────────────────────────────────────────────────────────── */
@media(max-width:860px){
  html body #detailView.dv-c3.dv-spot #dvChatTabBody{--chat-h:min(52vh,400px);display:flex;flex-direction:column;padding-top:4px}
  html body #detailView.dv-c3.dv-spot .chat-people{flex-direction:row;align-items:center;max-height:none;margin-bottom:6px;padding:0;border-radius:0;background:none}
  html body #detailView.dv-c3.dv-spot .chat-people-head,html body #detailView.dv-c3.dv-spot .chat-person-name{display:none}
  html body #detailView.dv-c3.dv-spot .chat-people-list{flex-direction:row;gap:10px;padding:2px 2px 6px;overflow:auto hidden;scrollbar-width:none}
  html body #detailView.dv-c3.dv-spot .chat-people-list::-webkit-scrollbar{display:none}
  html body #detailView.dv-c3.dv-spot .chat-person{flex-direction:column;gap:3px;width:auto;min-width:50px;min-height:0;padding:2px;border-radius:10px}
  html body #detailView.dv-c3.dv-spot .chat-person img{width:36px;height:36px}
  html body #detailView.dv-c3.dv-spot .chat-person-pct{margin:0;font-size:12px}
}
@media(max-width:760px){
  html body #detailView.dv-c3.dv-spot .chat-card{padding-right:12px;padding-left:2px}
  html body #detailView.dv-c3.dv-spot .chat-row{gap:6px}
  html body #detailView.dv-c3.dv-spot .chat-gut{width:50px}
  html body #detailView.dv-c3.dv-spot .chat-text{font-size:15px}
  html body #detailView.dv-c3.dv-spot .chat-trade-sum b{font-size:30px}
  html body #detailView.dv-c3.dv-spot #dvChatTabBody .chat-input{font-size:16px}  /* under 16px iOS zooms the page on focus */
}
@media(max-width:480px){html body #detailView.dv-c3.dv-spot .chat-gate-label{display:none}}
