/*
 * The token page's Comments tab (components/token/Comments.tsx) and the
 * chart's trader avatars tooltip (components/token/TradeChart.tsx). Built
 * from the design tokens of tokens.css, so both themes follow.
 *
 * Comments (redesign 2026-10-17): compact cards on the feed's surface, the author's identity and position up front
 * (name, Creator / holder badges, the holder's share and size), a quiet rail for replies, the composer with the
 * writer's avatar and a live character count, skeleton rows while loading and an empty state that invites the first
 * comment.
 */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ---------- composer ---------- */
.cmts{padding-top:2px}
.cmt-compose{display:flex;flex-direction:column;gap:8px;padding:12px 14px;margin:10px 0 8px;border:1px solid var(--line);
  border-radius:16px;background:var(--surface);transition:border-color .15s ease,box-shadow .15s ease}
.cmt-compose:not(.reply):not(.cmt-gate){display:grid;grid-template-columns:34px minmax(0,1fr);column-gap:12px;row-gap:8px}
.cmt-compose:not(.reply):not(.cmt-gate) > :not(.cmt-me){grid-column:2}
.cmt-me{grid-row:1 / span 2;line-height:0;padding-top:2px}
.cmt-compose.reply{margin:10px 0 2px;padding:10px 12px;border-radius:14px}
.cmt-compose textarea{width:100%;box-sizing:border-box;resize:none;min-height:44px;border:0;outline:0;background:transparent;
  color:var(--ink);font:inherit;font-size:14.5px;line-height:1.5;padding:6px 2px 2px}
.cmt-compose.reply textarea{min-height:34px;font-size:14px;padding-top:2px}
.cmt-compose textarea::placeholder{color:var(--muted)}
.cmt-compose:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-dim)}
.cmt-cbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-top:8px;border-top:1px solid var(--line-soft)}
.cmt-compose.reply .cmt-cbar{border-top:none;padding-top:0}
.cmt-attach{position:relative;display:inline-grid;place-items:center;width:34px;height:34px;border-radius:10px;color:var(--muted);cursor:pointer;flex:none}
.cmt-attach:hover,.cmt-attach:focus-within{color:var(--accent);background:var(--surface-2)}
.cmt-attach:focus-within{outline:2px solid var(--accent);outline-offset:1px}
.cmt-attach input{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.cmt-hint{flex:1 1 160px;min-width:0;font-size:12px;color:var(--muted)}
.cmt-hint.bad,.cmt-count.bad{color:var(--bad)}
.cmt-count{font-size:11.5px;color:var(--ink-2);font-variant-numeric:tabular-nums;padding:2px 7px;border-radius:999px;background:var(--surface-2)}
.cmt-count.near{color:var(--warn)}
.cmt-count.bad{background:color-mix(in srgb,var(--bad) 14%,transparent);font-weight:600}
.cmt-btn{flex:none;height:36px;padding:0 18px;border-radius:11px;background:var(--accent);color:var(--accent-ink);font-size:14px;font-weight:600;
  transition:filter .15s ease,opacity .15s ease}
.cmt-btn:hover:not(:disabled){filter:brightness(1.08)}
.cmt-btn:disabled{opacity:.45;cursor:not-allowed}
.cmt-cancel{margin:0}
.cmt-gate{flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 14px;font-size:13.5px;color:var(--ink-2)}
.cmt-gate span{flex:1 1 240px}
.cmt-err{color:var(--bad);font-size:12.5px;margin:0}
.cmt-err.small{font-size:12px}
.cmt-picprev{position:relative;width:96px;height:96px;border-radius:12px;overflow:hidden;background:var(--surface-2)}
.cmt-picprev img{width:100%;height:100%;object-fit:cover;display:block}
.cmt-picprev .skl{display:block;width:100%;height:100%}
.cmt-picprev .txx{position:absolute;top:4px;right:4px;width:24px;height:24px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;
  display:grid;place-items:center;font-size:16px;line-height:1}

/* ---------- the new-comments pill ---------- */
.cmt-pillrow{position:sticky;top:12px;z-index:5;display:flex;justify-content:center;height:0;overflow:visible}
.cmt-pill{transform:translateY(4px);padding:7px 16px;border-radius:999px;background:var(--accent);color:var(--accent-ink);font-size:13px;
  font-weight:600;box-shadow:0 6px 24px var(--glow);animation:cmtpill .25s ease-out}
@keyframes cmtpill{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(4px)}}

/* ---------- empty and loading ---------- */
.cmt-empty{display:flex;flex-direction:column;align-items:center;gap:4px;padding:40px 20px 36px}
.cmt-empty b{margin-bottom:2px}
.cmt-emptyicon{display:grid;place-items:center;width:48px;height:48px;margin-bottom:10px;border-radius:16px;background:var(--accent-dim);color:var(--accent)}
.cmt-emptyicon svg{width:24px;height:24px}
.cmt-empty .cmt-btn{margin-top:14px}
.cmt-btn.ghostbtn{background:transparent;color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.cmt-btn.ghostbtn:hover{background:var(--accent-dim);filter:none}
.cmt-sk .cmt-skhead{display:flex;gap:10px}
.cmt-sk .cmt-skhead .skl{display:inline-block}

/* ---------- the thread ---------- */
.cmt-list,.cmt-replies{list-style:none;margin:0;padding:0}
.cmt-list{overflow-anchor:auto}
.cmt{display:flex;gap:12px;padding:14px 6px;border-top:1px solid var(--line-soft);scroll-margin-top:90px;border-radius:0;transition:background .2s ease}
.cmt-list > .cmt:first-child{border-top:none}
.cmt-list > .cmt:hover{background:color-mix(in srgb,var(--surface) 60%,transparent)}
.cmt-replies{position:relative;margin-top:8px;padding-left:14px}
.cmt-replies::before{content:"";position:absolute;left:0;top:2px;bottom:8px;width:2px;border-radius:2px;background:var(--line)}
.cmt-replies .cmt{padding:8px 0 4px;border-top:none}
.cmt-replies .cmt:hover{background:transparent}
.cmt-av{flex:none;line-height:0;border-radius:50%;height:max-content}
.cmt-av .crav{box-shadow:0 0 0 1px var(--line)}
.cmt-main{flex:1;min-width:0}
.cmt-head{display:flex;align-items:center;flex-wrap:wrap;gap:4px 7px;font-size:13px;line-height:1.35}
.cmt-name{color:var(--ink);font-weight:600;text-decoration:none;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cmt-name:hover{color:var(--accent)}
.cmt-addr{color:var(--muted);font-size:11.5px}
.cmt-badge{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:600;padding:1px 7px;border-radius:999px;background:var(--surface-2);
  color:var(--ink-2);white-space:nowrap;line-height:1.6}
.cmt-badge.creator{background:var(--accent-dim);color:var(--accent)}
.cmt-badge.holder{color:var(--ink-2);font-variant-numeric:tabular-nums}
.cmt-badge.holder .cmt-pos{font-size:10.5px;font-weight:500;color:var(--ink-2);padding-left:5px;border-left:1px solid var(--line)}
.cmt-badge.holder.t2 .cmt-pos{color:inherit}
.cmt-badge.holder.t2{background:var(--buy-dim);color:var(--buy)}
.cmt-badge.holder.t3{background:var(--buy);color:var(--buy-ink)}
.cmt-badge.holder.t3 .cmt-pos{color:inherit;opacity:.8;border-left-color:currentColor}
.cmt-badge.kns{color:var(--muted);font-weight:500}
.cmt-badge.you{color:var(--muted);font-weight:500;background:transparent;box-shadow:inset 0 0 0 1px var(--line)}
.cmt-time{margin-left:auto;display:inline-flex;gap:8px;color:var(--muted);font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums}
.cmt-no{font-size:11px;opacity:.8}
.cmt-body{margin-top:4px;font-size:14.5px;line-height:1.55;color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;outline:none}
.cmt-replies .cmt-body{font-size:14px}
.cmt-quote{display:inline;padding:0 3px;border-radius:5px;color:var(--accent);font-size:.92em;background:var(--accent-dim);cursor:pointer}
.cmt-quote:hover{filter:brightness(1.12)}
.cmt-pic{display:block;margin-top:8px;padding:0;border:0;background:var(--surface-2);border-radius:12px;overflow:hidden;width:200px;max-width:100%;
  aspect-ratio:1;cursor:zoom-in}
.cmt-pic.big{width:420px;cursor:zoom-out}
.cmt-pic img{width:100%;height:100%;object-fit:cover;display:block}
.cmt-pic.none{display:inline-block;width:auto;aspect-ratio:auto;padding:6px 10px;font-size:12px;color:var(--muted);cursor:default}
.cmt-actions{display:flex;align-items:center;gap:2px;margin-top:4px;margin-left:-8px}
.cmt-actions button{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 9px;border-radius:9px;font-size:12.5px;color:var(--muted);
  transition:color .15s ease,background .15s ease}
.cmt-actions button:hover:not(:disabled){color:var(--ink);background:var(--surface-2)}
.cmt-like .mono{font-size:12px;min-width:1ch}
.cmt-like:hover:not(:disabled){color:var(--bad)!important}
.cmt-like.on{color:var(--bad)}
.cmt-like.on .cmt-heart{animation:cmtheart .3s cubic-bezier(.2,.9,.3,1.4)}
@keyframes cmtheart{from{transform:scale(.6)}to{transform:none}}
.cmt-like:disabled{opacity:.7;cursor:default}
.cmt-status{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:6px;font-size:12.5px;color:var(--muted)}
.cmt-status .back{margin:0}
.cmt.signing,.cmt.sending{opacity:.72}
.cmt.failed .cmt-body{color:var(--ink-2)}
.cmt-more .back{margin:2px 0 0;font-size:12.5px;color:var(--accent)}
.cmt.in{animation:cmtin .9s ease-out}
.cmt.flash{animation:cmtflash 1.6s ease-out}
@keyframes cmtin{from{background:var(--accent-dim)}to{background:transparent}}
@keyframes cmtflash{0%,30%{background:var(--accent-dim)}100%{background:transparent}}
@media (prefers-reduced-motion: reduce){
  .cmt.in,.cmt.flash,.cmt-pill,.cmt-like.on .cmt-heart{animation:none}
}
@media (max-width: 560px){
  .cmt{gap:10px;padding:12px 2px}
  .cmt-time{margin-left:0}
  .cmt-pic.big{width:100%}
  .cmt-hint{flex-basis:100%;order:3}
  .cmt-post{margin-left:auto}
  .cmt-compose:not(.reply):not(.cmt-gate){grid-template-columns:28px minmax(0,1fr);column-gap:10px}
  .cmt-me .crav{width:28px!important;height:28px!important}
  .cmt-replies{padding-left:12px}
  /* The name links to the profile (the address is its title): no room for the address itself on a phone. */
  .cmt-addr{display:none}
}

/* ---------- chart trader avatars ---------- */
.lwc-avtip{position:absolute;z-index:3;transform:translate(-50%, calc(-100% - 14px));pointer-events:auto;min-width:150px;max-width:240px;
  padding:9px 11px;border-radius:12px;background:var(--surface-3);color:var(--ink);border:1px solid var(--line);font-size:12px;line-height:1.45;
  box-shadow:0 8px 28px rgba(0,0,0,.28)}
.lwc-avtip a{color:var(--ink);font-weight:600;text-decoration:none}
.lwc-avtip a:hover{color:var(--accent)}
.lwc-avtip .side.buy{color:var(--ok);font-weight:600}
.lwc-avtip .side.sell{color:var(--bad);font-weight:600}
.lwc-avtip .m{color:var(--muted)}
.chartctl .avbtn[aria-pressed="true"]{color:var(--accent);border-color:var(--accent)}
.lwc-avlist{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
/* Commenter avatars sit near the top of the chart: their card opens below them there. */
.lwc-avtip.below{transform:translate(-50%, 14px)}
.lwc-avtip .c{color:var(--ink-2);white-space:normal;overflow-wrap:anywhere;margin:2px 0}

/* ---------- chart trade markers (My swaps) ---------- */
.lwc:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:10px}
.lwc-mkchip{position:absolute;z-index:3;left:8px;top:8px;display:inline-flex;align-items:center;gap:8px;padding:5px 10px;border-radius:999px;
  background:var(--surface-2);border:1px solid var(--line);font-size:12px;color:var(--muted);white-space:nowrap;max-width:calc(100% - 16px);overflow:hidden}
.lwc-mkchip button{color:var(--accent);font-weight:600;font-size:12px;padding:0}
.lwc-mkchip button::before{content:"·";color:var(--muted);margin-right:8px;font-weight:400}
.lwc-mkchip[data-state="error"]{color:var(--ink-2)}
.lwc-mktip{min-width:240px;max-width:340px}
.lwc-mktip .side.buy{color:var(--buy)}.lwc-mktip .side.sell{color:var(--sell)}
.lwc-mktip .mk-chip{display:inline-block;padding:2px 9px;border-radius:7px;font-size:12px;font-weight:600;line-height:1.5}
.lwc-mktip .mk-chip.buy{color:var(--buy);background:color-mix(in srgb,var(--buy) 16%,transparent)}
.lwc-mktip .mk-chip.sell{color:var(--sell);background:color-mix(in srgb,var(--sell) 16%,transparent)}
.lwc-mktip .mk-main{margin-top:8px;font-size:15px;font-weight:600;color:var(--ink);white-space:nowrap}
.lwc-mktip:not(.pinned){min-width:0}
.lwc-mktip .mk-h{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:0 12px;margin-bottom:2px}
.lwc-mktip .mono{font-size:11.5px}
.lwc-mktip .mk-status{color:var(--warn)}
.lwc-mktip[data-state="dropped"] .mk-status{color:var(--bad)}
.lwc-mktip .mk-list{list-style:none;margin:6px 0 0;padding:6px 0 0;border-top:1px solid var(--line);display:grid;gap:2px}
.lwc-mktip .mk-list li{display:flex;gap:8px;align-items:baseline;white-space:nowrap;font-size:11px}
.lwc-mktip .mk-list li a{margin-left:auto}
.lwc-mktip .mk-list a{color:var(--accent);font-weight:400}
.lwc-mktip .mk-f{display:flex;align-items:center;gap:10px;margin-top:6px}
.lwc-mktip .mk-f a{margin-left:auto;color:var(--accent);font-weight:500}
.lwc-mktip .mk-more{color:var(--accent);font-weight:600;font-size:12px;padding:0}
.lwc-mktip .mk-close{color:var(--muted);font-size:12px;padding:0 2px;line-height:1}
.lwc-mktip .mk-f .mk-more + a,.lwc-mktip .mk-f .mk-more{margin-left:auto}
/* Phones: the card is a sheet at the bottom of the screen, over the Buy/Sell bar (65), under the trade sheet (68+). */
@media(max-width:560px){
  .lwc-mktip,.lwc-mktip.below{position:fixed;left:0!important;right:0;top:auto!important;bottom:0;transform:none;z-index:66;min-width:0;max-width:none;max-height:70vh;overflow-y:auto;
    border-radius:16px 16px 0 0;padding:14px 16px calc(14px + env(safe-area-inset-bottom));font-size:13px;box-shadow:0 -10px 30px rgba(0,0,0,.3)}
  .lwc-mktip .mono{font-size:12.5px}
  .lwc-mktip .mk-close{font-size:15px;padding:2px 6px}
}
/* The Trades tab filtered to the wallet. */
.feedfilter{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:2px 0 8px;padding:7px 12px;border-radius:999px;
  background:var(--accent-dim);color:var(--ink);font-size:12.5px}
.feedfilter .back{color:var(--accent);font-weight:600;font-size:12.5px;padding:0}
