/* TSM Dialogue Homepage v1 — presentation-only composition of the existing Wall.
 * No additional feed store, fabricated game events, hidden wallet writes, or altered
 * social permissions. /social.html keeps the established classic Wall layout.
 */
body.tsm-dialogue-home{
  --tsm-dialogue-gold:#f6c933;
  /* Share the Profile's canvas, rhythm, radii and structural style. */
  --tsm-dialogue-surface:#100e08;
  --tsm-dialogue-line:var(--tsm-section,#f6c933);
}
body.tsm-dialogue-home main.ns-page{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:clamp(12px,2vw,22px)!important;
}
body.tsm-dialogue-home main.ns-page > .tsm-dialogue-intro{
  order:0;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  margin:0 auto!important;
  padding:clamp(17px,3vw,28px)!important;
  border:2px solid var(--tsm-dialogue-gold)!important;
  border-radius:16px!important;
  background:linear-gradient(140deg,#211b08 0%,#141108 56%,#080808 100%)!important;
  box-shadow:0 14px 34px #0005!important;
  text-align:left!important;
}
body.tsm-dialogue-home .tsm-dialogue-eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#f5d56b;
  font-size:clamp(10px,1vw,12px);
  letter-spacing:.15em;
  text-transform:uppercase;
  font-weight:900;
}
body.tsm-dialogue-home .tsm-dialogue-eyebrow:before{
  content:"";
  width:9px;height:9px;border-radius:50%;
  background:#38cb8c;box-shadow:0 0 12px #38cb8c8f;
}
body.tsm-dialogue-home .tsm-dialogue-intro h2{
  margin:10px 0 8px!important;
  font-size:clamp(23px,4vw,36px)!important;
  line-height:1.12!important;
  font-weight:900!important;
  color:#fff!important;
  text-align:left!important;
  letter-spacing:.005em!important;
}
body.tsm-dialogue-home .tsm-dialogue-intro p{
  margin:0!important;
  max-width:58ch;
  font-size:clamp(13px,1.5vw,16px)!important;
  line-height:1.55!important;
  color:#c9c4b7!important;
  text-align:left!important;
}
body.tsm-dialogue-home .tsm-dialogue-intro .tsm-dialogue-paths{
  display:flex;flex-wrap:wrap;gap:8px;
  margin-top:18px;
}
body.tsm-dialogue-home .tsm-dialogue-paths a{
  padding:9px 12px;
  border:1px solid #a8872a;
  border-radius:9px;
  background:#211b08;
  color:#f4f6fa;
  font-size:12px;
  letter-spacing:.04em;
  font-weight:800;
  text-decoration:none;
}
body.tsm-dialogue-home .tsm-dialogue-paths a:focus-visible{
  outline:2px solid #fff;
  outline-offset:3px;
}
body.tsm-dialogue-home main.ns-page > :is(.wall-presence-group,.wall-social-tabs,[data-social-panel]){
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin-left:auto!important;
  margin-right:auto!important;
  box-sizing:border-box!important;
}
body.tsm-dialogue-home main.ns-page [data-social-panel="wall"]{
  display:flex;
  flex-direction:column;
  gap:12px;
}
body.tsm-dialogue-home main.ns-page [data-social-panel="wall"][hidden]{display:none!important}
body.tsm-dialogue-home main.ns-page [data-social-panel="wall"]>.tsm-dialogue-stream-title{
  color:#f4d56c;
  background:#211b08;
  border:1px solid #aa892c;
  border-radius:11px;
  padding:12px 16px;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.12em;
  text-align:left;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed]{
  display:flex!important;
  flex-direction:column!important;
  gap:20px!important;
  padding-bottom:calc(105px + env(safe-area-inset-bottom,0px))!important;
  min-width:0!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed]>.ns-post-group{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  gap:9px!important;
  padding:0!important;
  margin:0!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-group>.ns-post{
  /* User-approved Wall 2:1 rectangle; only the middle row scrolls. */
  aspect-ratio:2/1!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:clamp(44px,12%,64px) minmax(0,1fr) clamp(44px,12%,64px)!important;
  overflow:hidden!important;
  padding:clamp(8px,1.7vw,14px)!important;
  border:3px solid var(--tsm-dialogue-line)!important;
  border-radius:18px!important;
  background:linear-gradient(145deg,#211b08 0%,#080808 80%)!important;
  box-shadow:0 8px 24px #0004!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-head{
  grid-row:1!important;
  min-height:0!important;
  height:100%!important;
  padding:0 0 6px!important;
  border-bottom:1px solid #ffffff24!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-content-scroll{
  grid-row:2!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable!important;
  margin:6px 0!important;
  text-align:left!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-content-inner{
  margin:0!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  text-align:left!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-copy,
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-comments{
  text-align:left!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-copy{
  padding:12px 14px!important;
  border:1px solid #715b29!important;
  border-radius:4px 14px 14px 14px!important;
  background:#261f0e!important;
  color:#f4f6fa!important;
  font-size:clamp(14px,1.4vw,17px)!important;
  line-height:1.5!important;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-reaction-rail{
  position:relative!important;
  grid-row:3!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  border-top:1px solid #ffffff24!important;
  padding-top:8px!important;
}
/* Distinct event colours require verified provenance via data-event-category.
   Never infer category from player-controlled activity text. */
body.tsm-dialogue-home main.ns-page .wall-social-tabs>button,
body.tsm-dialogue-home main.ns-page .tsm-wall-feed-modes>button{
  font-size:clamp(13px,1.4vw,17px)!important;
  font-weight:850!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-text]{
  font-size:clamp(14px,1.4vw,17px)!important;
  line-height:1.5!important;
}
body.tsm-dialogue-home main.ns-page .wall-post-submit-panel{
  font-size:clamp(17px,1.6vw,23px)!important;
}
/* Home composer remains an established 4:1 action, with vertically
   stacked label and status rather than competing inline text. */
body.tsm-dialogue-home main.ns-page .wall-post-submit-panel{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px!important;
  aspect-ratio:4/1!important;
  height:auto!important;
  min-height:0!important;
  padding:8px 12px!important;
}
body.tsm-dialogue-home main.ns-page .wall-post-submit-panel>span{
  font-size:clamp(16px,3.8vw,25px)!important;
  line-height:1.1!important;
}
body.tsm-dialogue-home main.ns-page .wall-post-submit-panel>.ns-status{
  font-size:clamp(10px,2.2vw,13px)!important;
  line-height:1.25!important;
  font-weight:750!important;
}
/* Keep all of the original Wall reply buttons, reaction sliders and thread
 * identifiers; only the homepage's post display proportions are adaptive. */
@media(max-width:600px){
  body.tsm-dialogue-home main.ns-page>.tsm-dialogue-intro{padding:15px!important}
  body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-group>.ns-post{padding:10px!important}
  body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-copy{padding:10px!important}
  body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-content-scroll{max-height:none!important}
}

/* Provenance and event colours come exclusively from existing published
 * admin-authored SYSTEM records, never from player-controlled post text. */
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post[data-event-category="game"]{
  --tsm-dialogue-line:#3498ff;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post[data-event-category="player"]{
  --tsm-dialogue-line:#31d783;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post[data-event-category="site"]{
  --tsm-dialogue-line:#ef676e;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post[data-event-category="game"] .ns-meta:before{
  content:"GAME EVENT · ";color:#79b8ff;font-weight:900;letter-spacing:.04em;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post[data-event-category="player"] .ns-meta:before{
  content:"PLAYER EVENT · ";color:#83e7b5;font-weight:900;letter-spacing:.04em;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post[data-event-category="site"] .ns-meta:before{
  content:"TSM UPDATE · ";color:#ff9a9d;font-weight:900;letter-spacing:.04em;
}

/* Profile-reference composition: the same measured canvas, 16px rhythm,
   18px radius and restrained structural frame; section yellow remains unique.
   The Profile page itself and other pages are not modified by this rule. */
/* The shared Panel layout owns the page canvas; dialogue owns content rhythm. */
body.tsm-dialogue-home main.ns-page{
  gap:var(--tsm-panel-gap,16px)!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed]{
  gap:var(--tsm-panel-gap,16px)!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed]>.ns-post-group{
  gap:var(--tsm-panel-gap,16px)!important;
}
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-group>.ns-post{
  width:100%!important;
  max-width:100%!important;
  aspect-ratio:2/1!important;
  height:auto!important;
  min-height:0!important;
  border-radius:var(--tsm-panel-radius,18px)!important;
}
/* Preserve the current comment/reply and reaction controllers; never resize
   the post because its contents or threads have expanded. */
body.tsm-dialogue-home main.ns-page [data-wall-feed] .ns-post-content-scroll{
  min-height:0!important;
  max-height:100%!important;
  overflow-y:auto!important;
}

/* Homepage title alignment: share the exact content-width contract with the
   Dialogue card, without changing global panels or the page's vertical rhythm. */
body.tsm-dialogue-home main.ns-page > .tsm-section-heading[data-panel-id="social-title"]{
  box-sizing:border-box!important;
  flex:0 0 auto!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin-left:auto!important;
  margin-right:auto!important;
  align-self:stretch!important;
  aspect-ratio:4/1!important;
  height:auto!important;
  text-align:center!important;
  justify-content:center!important;
  align-items:center!important;
}
