/* App pages: community, admin login, admin panel. Builds on base.css tokens. */

.page { padding-block: 40px 96px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px;
  padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: var(--step-3); text-transform: uppercase; }
.page-head p { color: var(--muted); max-width: 60ch; margin-top: 10px; }
.meter { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); }
.meter div { padding: 10px 16px; border-left: 1px solid var(--line); display: grid; gap: 2px; }
.meter div:first-child { border-left: 0; }
.meter b { font: 600 1.1rem/1 var(--mono); }
.meter span { font: 500 .66rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

.back { display: inline-flex; gap: 8px; margin-bottom: 20px; color: var(--muted); font: 500 .8rem/1 var(--mono); text-decoration: none; }
.back:hover { color: var(--text); }
.empty { padding: 40px 0; color: var(--dim); }
.muted { color: var(--muted); }
.who { font-size: .9rem; color: var(--muted); }
.who b { color: var(--text); font-weight: 600; }

/* ---- community: filters rail + list ---- */
.board { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.rail { position: sticky; top: 88px; display: grid; gap: 22px; }
.rail-group { display: grid; gap: 8px; }
.rail-group > span { font: 500 .7rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.kinds { display: grid; border: 1px solid var(--line); }
.kinds button { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; background: none; border: 0; border-top: 1px solid var(--line);
  color: var(--muted); font: 500 .92rem/1.2 var(--sans); cursor: pointer; text-align: left; }
.kinds button:first-child { border-top: 0; }
.kinds button:hover { color: var(--text); background: var(--ink-2); }
.kinds button[aria-pressed="true"] { color: var(--text); background: var(--panel); box-shadow: inset 3px 0 0 var(--cyan); }
.kinds em { font: 400 .8rem/1.2 var(--mono); font-style: normal; color: var(--dim); }

.list-head { display: flex; gap: 10px; margin-bottom: 14px; }
.list-head .control { flex: 1; }

.posts { border-top: 1px solid var(--line-2); }
.post { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 6px 20px; padding: 18px 4px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none; }
.post:hover { background: var(--ink-2); color: var(--text); }
.post:hover h3 { color: var(--cyan); }
.post .chip { align-self: start; justify-self: start; }
.post h3 { font: 600 1.05rem/1.3 var(--sans); text-transform: none; letter-spacing: 0; }
.post p { color: var(--muted); font-size: .9rem; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-by { grid-column: 2; font-size: .82rem; color: var(--dim); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.post-by b { color: var(--muted); font-weight: 500; }
.counts { grid-row: 1 / span 2; grid-column: 3; display: grid; grid-auto-flow: column; gap: 18px; align-self: center; }
.counts span { display: grid; justify-items: end; font: 500 .95rem/1.1 var(--mono); }
.counts small { font: 500 .62rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.hashtags { display: inline-flex; flex-wrap: wrap; gap: 8px; font: 400 .78rem/1.3 var(--mono); color: var(--dim); }

.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.pager button { min-width: 38px; height: 38px; background: none; border: 1px solid var(--line-2); color: var(--muted); font: 500 .85rem/1 var(--mono); cursor: pointer; }
.pager button[aria-current="page"] { background: var(--cyan); border-color: var(--cyan); color: var(--cyan-ink); }

/* ---- community: post detail ---- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.detail h1 { font-size: var(--step-2); text-transform: uppercase; margin: 10px 0 14px; }
.detail-desc { max-width: 70ch; margin-bottom: 24px; }
.source { border: 1px solid var(--line-2); background: var(--ink); }
.source-bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line);
  font: 400 .76rem/1.4 var(--mono); color: var(--dim); }
.source pre { max-height: 560px; overflow: auto; padding: 16px; font: 400 .82rem/1.6 var(--mono); color: #C9D3E6; tab-size: 2; }

.side { display: grid; gap: 16px; position: sticky; top: 88px; }
.side-box { border: 1px solid var(--line-2); background: var(--panel); }
.side-box .btn { width: 100%; }
.side-actions { display: grid; gap: 8px; padding: 16px; }
.side-actions .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.facts-list { display: grid; border-top: 1px solid var(--line); }
.facts-list div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.facts-list div:last-child { border-bottom: 0; }
.facts-list dt { color: var(--dim); }
.facts-list dd { text-align: right; }
.side-note { padding: 14px 16px; font-size: .82rem; color: var(--muted); border: 1px solid var(--line); }
.btn.on { border-color: var(--hp); color: var(--hp); }

.comments { margin-top: 48px; display: grid; gap: 16px; max-width: 760px; }
.comments h2 { font-size: var(--step-1); text-transform: uppercase; }
.comment { padding: 14px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.comment header { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: .82rem; color: var(--dim); }
.comment header b { color: var(--text); font-weight: 600; }
.comment p { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { display: grid; gap: 10px; justify-items: start; }
.comment-form textarea { min-height: 90px; }

/* ---- community: profile ---- */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.sub-head, .side-head { font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.sub-head { margin-bottom: 12px; }
.side-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.side-foot { padding: 10px 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: .78rem; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; }
.servers { list-style: none; }
.servers li { padding: 12px 16px; border-bottom: 1px dashed var(--line); display: grid; gap: 4px; }
.servers li:last-child { border-bottom: 0; }
.servers b { font: 600 .95rem/1.2 var(--mono); }
.servers span { color: var(--muted); font-size: .84rem; }
.servers small { color: var(--dim); font: 400 .74rem/1.3 var(--mono); }
a.person { color: inherit; text-decoration: none; }
a.person:hover b { color: var(--cyan); }
a.who { text-decoration: none; }

/* ---- community: editor ---- */
.editor { display: grid; gap: 18px; max-width: 860px; }
.editor h1 { font-size: var(--step-3); text-transform: uppercase; }
.editor .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor .field > span a, .editor label.linklike { font: inherit; text-transform: none; letter-spacing: 0; }
.editor textarea.code { min-height: 360px; }
.editor .actions { display: flex; gap: 12px; align-items: center; }

/* ---- admin login ---- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-box { width: 100%; max-width: 380px; display: grid; gap: 20px; }
.gate-box img { height: 28px; width: auto; }
.gate-box h1 { font-size: var(--step-2); text-transform: uppercase; }
.gate-box form { display: grid; gap: 16px; padding: 24px; border: 1px solid var(--line-2); background: var(--panel); }
.gate-box .btn { width: 100%; }

/* ---- admin ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.console { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.console-side { border-right: 1px solid var(--line); background: var(--ink-2); padding: 20px 0; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
.console-side > a { padding: 0 20px; }
.console-side img { height: 22px; width: auto; }
.console-nav { display: grid; }
.console-nav button { padding: 11px 20px; background: none; border: 0; text-align: left; color: var(--muted); font: 500 .92rem/1.2 var(--sans); cursor: pointer; }
.console-nav button:hover { color: var(--text); }
.console-nav button[aria-current="page"] { color: var(--text); background: var(--panel); box-shadow: inset 3px 0 0 var(--cyan); }
.console-foot { margin-top: auto; padding: 0 20px; display: grid; gap: 8px; justify-items: start; }
.console-main { padding: 28px clamp(16px, 3vw, 40px) 64px; min-width: 0; }
.console-main .page-head { margin-bottom: 24px; }
.console-main .page-head h1 { font-size: var(--step-2); }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line-2); margin-bottom: 32px; }
.kpis div { padding: 18px 20px; border-left: 1px solid var(--line); display: grid; gap: 8px; }
.kpis div:first-child { border-left: 0; }
.kpis span { font: 500 .68rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.kpis b { font: 600 2rem/1 var(--mono); }
.block { display: grid; gap: 14px; }
.block h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
/* Site switches (admin, Servidores): one bordered row per option, native checkbox in cyan. */
.site-toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; }
.toggle:hover { border-color: var(--muted); }
.toggle input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--cyan); cursor: pointer; }
.toggle span { display: grid; gap: 4px; color: var(--muted); font-size: .88rem; }
.toggle b { color: var(--text); font: 700 .82rem/1.2 var(--display); font-stretch: 112%; letter-spacing: .04em; text-transform: uppercase; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters .control { width: auto; flex: 1 1 200px; }
.filters select.control { flex: 0 1 180px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: 10px 14px; font: 500 .68rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
  background: var(--ink-2); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--ink-2); }
td.name { font-weight: 600; }
td .dot { margin-right: 8px; vertical-align: 1px; }
td.mono { font-family: var(--mono); font-size: .82rem; color: var(--muted); }
td.row-actions { text-align: right; }
td.row-actions .btn + .btn { margin-left: 6px; }
td.wrap-cell { white-space: normal; min-width: 220px; color: var(--muted); font-size: .84rem; }
td.empty { padding: 28px 14px; color: var(--dim); white-space: normal; }

/* ---- narrow ---- */
@media (max-width: 900px) {
  .board, .detail, .profile { grid-template-columns: minmax(0, 1fr); }
  .rail, .side { position: static; }
  .rail { grid-template-columns: 1fr 1fr; }
  .rail-group:first-child { grid-column: 1 / -1; }
  .kinds { grid-auto-flow: column; }
  .kinds button { border-top: 0; border-left: 1px solid var(--line); justify-content: center; }
  .kinds button:first-child { border-left: 0; }
  .kinds em { display: none; }
  .console { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .console-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 12px; }
  .console-side > a { padding: 0; }
  .console-nav { grid-auto-flow: column; overflow-x: auto; order: 3; width: 100%; }
  .console-nav button { padding: 10px 14px; white-space: nowrap; }
  .console-foot { margin: 0 0 0 auto; padding: 0; grid-auto-flow: column; align-items: center; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis div:nth-child(odd) { border-left: 0; }
  .kpis div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-by, .counts { grid-column: 1; grid-row: auto; }
  .counts { justify-content: start; order: 4; }
  .counts span { justify-items: start; }
  .editor .row, .rail { grid-template-columns: minmax(0, 1fr); }
  .kinds button { padding: 10px 6px; font-size: .85rem; }
}

/* ==== forum ==================================================================================== */

.head-side { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; font: 500 .78rem/1.3 var(--mono); color: var(--dim); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.crumbs > span:last-child { color: var(--text); }
.hint { color: var(--dim); font-size: .8rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head .sub-head { margin: 0; }
.section-head .muted { font: 400 .78rem/1 var(--mono); }
.fsection + .fsection, .fsearch + .fsection { margin-top: 36px; }
textarea.control.tall { min-height: 220px; }

/* avatars and OT icons: initial on a name-derived colour, image on top when there is one */
.av, .ot-ico, .bico { --s: 40px; position: relative; flex: none; display: inline-grid; place-items: center; width: var(--s); height: var(--s);
  overflow: hidden; color: #fff; font: 800 calc(var(--s) * .44)/1 var(--display); font-stretch: 110%; user-select: none; }
.av img, .ot-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--panel-2); }
.ot-ico { border: 1px solid var(--line-2); }
.ot-ico img { object-fit: contain; padding: 12%; background: var(--ink-2); }
.bico { background: var(--ink-2); border: 1px solid var(--line-2); color: var(--cyan); }
.ot-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ot-row a { display: inline-flex; }
.strip-list a, .newest-item, .ot-row a, .ot-line, .nav-me { text-decoration: none; }
.ot-row a:hover .ot-ico { border-color: var(--cyan); }
.ot-row small { font: 500 .7rem/1 var(--mono); color: var(--dim); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* A whole row is clickable through its .hit link; other links inside stay on top of it. */
.row-link { position: relative; }
.row-link .hit { color: var(--text); text-decoration: none; }
.row-link .hit::after { content: ""; position: absolute; inset: 0; }
.row-link a:not(.hit), .row-link button { position: relative; z-index: 1; }
.row-link:hover .hit { color: var(--cyan); }

/* ---- index: hero with live numbers, category cards, OT cards, activity rail ---- */
.forum { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.forum-rail { display: grid; gap: 16px; position: sticky; top: 88px; }
.fhero { display: grid; gap: 20px; padding-bottom: 24px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.fhero-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 32px; }
.fhero h1 { font-size: var(--step-3); text-transform: uppercase; margin-top: 12px; }
.fhero p { color: var(--muted); max-width: 62ch; margin-top: 10px; }
.fstats { display: flex; flex-wrap: wrap; gap: 8px 28px; font: 500 .7rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.fstats > span { display: inline-flex; align-items: baseline; gap: 8px; }
.fstats b { color: var(--text); font: 600 1.15rem/1 var(--mono); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.fstats .dot { align-self: center; }
.fsearch { display: flex; gap: 8px; margin-bottom: 28px; }
.fhero .fsearch { margin: 0; max-width: 620px; }
.fsearch .control { flex: 1; }
.fsearch .btn { min-height: 42px; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.cat { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 10px 14px; padding: 18px;
  border: 1px solid var(--line-2); background: var(--panel); transition: border-color .15s; }
.cat:hover { border-color: rgba(35, 213, 255, .45); }
.cat-main { display: grid; gap: 4px; align-content: center; min-width: 0; }
.cat-name { font: 700 1.05rem/1.2 var(--display); font-stretch: 108%; }
.cat-nums { display: flex; flex-wrap: wrap; gap: 2px 14px; font: 500 .68rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.cat-nums b { color: var(--muted); font-size: .82rem; letter-spacing: 0; }
.cat-desc { grid-column: 1 / -1; color: var(--muted); font-size: .88rem; }
.cat-last { grid-column: 1 / -1; align-self: end; display: flex; gap: 10px; align-items: center; min-width: 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .84rem; }
.cat-last.muted { color: var(--dim); }
.cat-last > div { display: grid; min-width: 0; }
.cat-last-title { color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-last-title:hover { color: var(--cyan); }
.cat-last small { color: var(--dim); font-size: .76rem; }
.cat-last .person b, .trow-by .person b, .feed .person b { font-weight: 500; color: var(--muted); }
.cat-last .person:hover b, .trow-by .person:hover b { color: var(--cyan); }

.ots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.otc { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px 14px; align-content: start; padding: 16px; border: 1px solid var(--line-2); background: var(--panel); transition: border-color .15s; }
.otc:hover { border-color: rgba(35, 213, 255, .45); }
.otc-main { display: grid; gap: 2px; align-content: center; min-width: 0; }
.otc-title { display: flex; gap: 8px; align-items: center; font: 700 1.05rem/1.2 var(--display); font-stretch: 108%; }
.otc-host { font: 400 .76rem/1.3 var(--mono); color: var(--dim); overflow-wrap: anywhere; }
.otc-stats, .otc-worlds, .otc-last { grid-column: 1 / -1; }
.otc-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font: 500 .8rem/1.3 var(--mono); color: var(--muted); }
.otc-stats .dot { vertical-align: 1px; }
.otc-worlds { display: flex; flex-wrap: wrap; gap: 6px; }
.otc-last { font-size: .82rem; color: var(--dim); border-top: 1px dashed var(--line); padding-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.otc-last a { color: var(--muted); text-decoration: none; }
.otc-last a:hover { color: var(--cyan); }
/* Forum index for a visitor without a licence: boards other than Anúncios, and the notice above them. */
.cat.locked, .otc.locked { opacity: .55; }
.cat.locked .cat-nums, .otc.locked .otc-stats, .otc.locked .otc-worlds { filter: blur(4px); }
.licence-note { display: grid; gap: 10px; margin: 18px 0; padding: 18px; border: 1px solid rgba(35, 213, 255, .45); background: var(--panel); }
.licence-note p { color: var(--muted); }

.feed { list-style: none; display: grid; }
.feed li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 16px; border-bottom: 1px dashed var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed li:hover { background: var(--panel-2); }
.feed li > div { display: grid; gap: 2px; min-width: 0; }
.feed .hit { font-size: .86rem; font-weight: 500; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed small { color: var(--dim); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newest { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; padding: 16px; }
.newest-item { display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-size: .74rem; min-width: 0; }
.newest-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newest-item:hover { color: var(--cyan); }
.side-box .side-note { border: 0; }
.side-foot a { color: var(--muted); }
.ot-line { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.ot-line > span { display: grid; }
.ot-line:hover b { color: var(--cyan); }

/* ---- board ---- */
.bhead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px 24px; align-items: center;
  padding-bottom: 24px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.bhead h1 { font-size: var(--step-3); text-transform: uppercase; margin-top: 8px; }
.bhead-main { min-width: 0; }
.bhead-main p { color: var(--muted); max-width: 64ch; margin-top: 8px; white-space: pre-wrap; }
.bhead .otc-host { display: block; margin-top: 4px; font-size: .84rem; }
.bhead-infos { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; }
.bhead-info { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bhead-info > span:first-child { font: 500 .68rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-right: 4px; }
.strip { grid-column: 1 / -1; display: grid; gap: 10px; }
.strip .sub-head { margin: 0; }
.strip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.strip-list a { display: inline-flex; outline-offset: 2px; }
.strip-list a:hover .av { box-shadow: 0 0 0 2px var(--cyan); }

.btools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.btools .control { flex: 1 1 220px; width: auto; }
.btools select.control { flex: 0 1 180px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); }
.seg button { padding: 0 14px; min-height: 40px; background: none; border: 0; border-left: 1px solid var(--line-2); color: var(--muted); font: 500 .85rem/1 var(--sans); cursor: pointer; white-space: nowrap; }
.seg button:first-child { border-left: 0; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--cyan); }

/* Topic rows: author face | title, excerpt, meta | reply count | faces of who took part + last activity. */
.topics { border: 1px solid var(--line-2); background: var(--panel); }
.trow { display: grid; grid-template-columns: 40px minmax(0, 1fr) 76px 132px; gap: 16px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.trow:first-child { border-top: 0; }
.trow:hover { background: var(--panel-2); }
.trow.pinned { box-shadow: inset 3px 0 0 var(--cyan); }
.trow-main { min-width: 0; display: grid; gap: 4px; }
.trow-line { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.trow-title { font: 600 1rem/1.35 var(--sans); overflow-wrap: anywhere; }
.trow-ex { color: var(--muted); font-size: .86rem; min-width: 0; }
/* A Super Rich Text preview in a list: every block runs inline, two lines at most, no pictures or code. */
.rt-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; line-height: 1.5; overflow-wrap: anywhere; }
.rt-preview .rich, .rt-preview .rich * { display: inline; margin: 0; padding: 0; border: 0; background: none; font-size: inherit; line-height: inherit; white-space: normal; }
.rt-preview .rich > * + *::before, .rt-preview li + li::before { content: ' '; }
.rt-preview .rich :is(h1, h2, h3, h4, strong, b) { color: var(--text); font-weight: 600; }
.rt-preview .rich a { color: var(--cyan); }
.rt-preview .rich :is(img, figure, pre, table, hr, .rt-zoom, button) { display: none; }
.trow-by { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--dim); }
.trow-by .num { font-size: .74rem; }
.trow-board { color: var(--muted); text-decoration: none; font-family: var(--mono); font-size: .74rem; }
.trow-board:hover { color: var(--cyan); }
.trow-count { display: grid; justify-items: center; gap: 3px; padding: 8px 4px; border: 1px solid var(--line); background: var(--ink-2); }
.trow-count b { font: 600 1.1rem/1 var(--mono); }
.trow-count small { font: 500 .58rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.trow-count.hot { border-color: rgba(35, 213, 255, .4); }
.trow-count.hot b { color: var(--cyan); }
.trow-last { display: grid; justify-items: end; gap: 6px; min-width: 0; }
.trow-last small { color: var(--dim); font-size: .76rem; white-space: nowrap; }
.stack { display: inline-flex; }
.stack a { display: inline-flex; text-decoration: none; }
.stack a + a { margin-left: -8px; }
.stack .av { box-shadow: 0 0 0 2px var(--panel); }
.trow:hover .stack .av { box-shadow: 0 0 0 2px var(--panel-2); }
.stack a:hover .av { box-shadow: 0 0 0 2px var(--cyan); }
.pager .gap { align-self: center; padding: 0 4px; color: var(--dim); }

/* ---- topic: header, post cards with a compact author header, sticky reply ---- */
.thead { display: grid; gap: 12px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.thead-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.thead h1 { font-size: var(--step-2); line-height: 1.12; overflow-wrap: anywhere; }
.bchip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--line-2); color: var(--muted); text-decoration: none; font: 500 .74rem/1 var(--mono); letter-spacing: .04em; }
.bchip .bico { --s: 20px; border: 0; }
.bchip:hover { color: var(--cyan); border-color: rgba(35, 213, 255, .45); }
.thead-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: var(--dim); font-size: .86rem; }
.thead-meta .person { display: inline-flex; gap: 8px; align-items: center; }
.thead-meta .person b { color: var(--text); font-weight: 600; }
.thead-meta .num { font-size: .8rem; }
.modbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border: 1px dashed var(--line-2); background: var(--ink-2); }
.modbar .sub-head { margin: 0 8px 0 0; }
.modbar .control { width: auto; min-height: 34px; padding-block: 4px; font-size: .85rem; }
.modfield { display: inline-flex; gap: 8px; align-items: center; font: 500 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }

.thread { display: grid; gap: 14px; margin-block: 16px; }
.tpost { display: grid; border: 1px solid var(--line-2); background: var(--panel); scroll-margin-top: 90px; min-width: 0; }
.tpost.op { border-top: 2px solid var(--cyan); }
.phead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.phead > a:first-child { display: inline-flex; text-decoration: none; }
.phead-who { display: grid; gap: 3px; min-width: 0; }
.phead-name { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.phead-user { color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.phead-user:hover { color: var(--cyan); }
.phead-who > small { color: var(--dim); font: 400 .74rem/1.3 var(--mono); }
.pnum { align-self: start; color: var(--dim); font-size: .74rem; }
.pbody { display: grid; grid-template-rows: 1fr auto; gap: 14px; padding: 16px 18px; min-width: 0; }
/* Zero height: it takes no room in the flow, the button hangs above its bottom edge. */
.reply-dock { position: sticky; bottom: 16px; z-index: 5; height: 0; display: flex; justify-content: flex-end; align-items: flex-end; pointer-events: none; transition: opacity .2s; }
.reply-dock .btn { pointer-events: auto; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
.reply-dock.away { opacity: 0; }
.reply-dock.away .btn { pointer-events: none; }
/* Rich text (js/rich.js): posts, replies and docs share these. */
.rich { display: grid; gap: 12px; align-content: start; overflow-wrap: anywhere; line-height: 1.65; min-width: 0; }
.rich > *, .rt-body > *, .rich li > * { margin: 0; min-width: 0; }
.rich p { white-space: pre-wrap; }
.rich .embed { border: 1px solid var(--line-2); background: var(--ink); overflow: hidden; }
.rich .embed > * { border: 0; }
/* Cards in a row join into one list: the grid gap closes and the two borders overlap. */
.rich .embed + .embed { margin-top: -13px; }
.rich .embed .post { padding: 14px 16px; text-decoration: none; color: inherit; }
.rich .embed .trow-last { display: none; }
@media (min-width: 701px) { .rich .embed .trow { grid-template-columns: 40px minmax(0, 1fr) 76px; } }
.rich blockquote { display: grid; gap: 8px; margin: 0; padding: 8px 14px; border-left: 3px solid var(--line-2); background: var(--ink-2); color: var(--muted); font-size: .94rem; }
.rich .mention { font-weight: 600; text-decoration: none; }
.rich strong { color: var(--text); font-weight: 600; }
.rich s { color: var(--dim); }
.rich :not(pre) > code { padding: 1px 5px; background: var(--ink-2); border: 1px solid var(--line); font: .86em var(--mono); }
.rich kbd { display: inline-block; padding: 0 6px; min-width: 1.6em; text-align: center; background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px; font: 500 .8em/1.6 var(--mono); color: var(--text); }
.rich .rt-hp { color: var(--hp); font-weight: 600; }
.rich .rt-mana { color: #6F93FF; font-weight: 600; }
.rich hr { width: 100%; border: 0; border-top: 1px solid var(--line); }
.rt-h { position: relative; font-family: var(--display); line-height: 1.25; text-wrap: balance; scroll-margin-top: 90px; }
h2.rt-h { font-size: var(--step-1); padding-top: 10px; }
h3.rt-h { font-size: 1.08rem; }
h4.rt-h { font-size: .95rem; color: var(--muted); }
.rt-anchor { margin-left: 8px; color: var(--dim); text-decoration: none; opacity: 0; font-family: var(--mono); font-weight: 400; }
.rt-h:hover .rt-anchor, .rt-anchor:focus-visible { opacity: 1; }
.rich ul, .rich ol { display: grid; gap: 4px; padding-left: 22px; }
.rich li { padding-left: 2px; }
.rich li > ul, .rich li > ol { margin-top: 4px; }
.rich ol > li::marker { font: .86em var(--mono); color: var(--muted); }
.rich ul.rt-tasks { list-style: none; padding-left: 0; }
.rt-tasks li { display: flex; gap: 10px; align-items: baseline; }
.rt-tasks li.done { color: var(--muted); }
.rt-check { flex: none; width: 13px; height: 13px; border: 1px solid var(--line-2); transform: translateY(2px); }
.rt-check.on { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--ink); }
.rt-table { overflow-x: auto; border: 1px solid var(--line); }
.rt-table table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.rt-table th, .rt-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.rt-table th { background: var(--ink-2); color: var(--muted); font: 500 .72rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.rt-table tr:last-child td { border-bottom: 0; }
.rt-code { border: 1px solid var(--line); background: var(--ink); min-width: 0; }
.rt-code-bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 4px 12px; border-bottom: 1px solid var(--line); color: var(--dim); font: 500 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.rt-copy { padding: 6px 10px; background: none; border: 1px solid transparent; color: var(--muted); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.rt-copy:hover { color: var(--cyan); border-color: var(--line-2); }
.rt-code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: .84rem/1.6 var(--mono); color: var(--text); tab-size: 2; }
.tk-k { color: #C792EA; } .tk-s { color: #9CD68A; } .tk-n { color: var(--warn); } .tk-c { color: var(--dim); font-style: italic; }
.tk-f { color: var(--cyan); } .tk-p { color: #82AAFF; }
.rt-figure { display: grid; gap: 6px; margin: 0; justify-items: start; }
.rt-zoom { display: block; padding: 0; background: none; border: 1px solid var(--line); cursor: zoom-in; max-width: 100%; }
.rt-zoom img { display: block; max-width: 100%; height: auto; }
.rt-figure figcaption { color: var(--dim); font: .74rem/1.4 var(--mono); }
.rt-inline-img { max-height: 1.6em; vertical-align: middle; }
.rt-lightbox { padding: 0; border: 1px solid var(--line-2); background: var(--ink); max-width: 94vw; max-height: 92vh; cursor: zoom-out; }
.rt-lightbox::backdrop { background: rgb(4 7 13 / .85); }
.rt-lightbox img { display: block; max-width: 94vw; max-height: 92vh; }
.rt-callout { --c: var(--cyan); display: grid; gap: 6px; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 6%, var(--panel)); }
.rt-callout.tip { --c: var(--ok); } .rt-callout.solved { --c: var(--ok); border-width: 1px 1px 1px 4px; border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); border-left-color: var(--ok); } .rt-callout.warn { --c: var(--warn); } .rt-callout.danger { --c: var(--hp); }
.rt-callout-title { color: var(--c); font: 600 .72rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.rt-body { display: grid; gap: 10px; min-width: 0; }
.rt-steps { display: grid; counter-reset: none; }
.rt-step { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding-bottom: 18px; position: relative; }
.rt-step:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; border-left: 1px solid var(--line-2); }
.rt-step-n { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--cyan); color: var(--cyan); background: var(--ink); font: 600 .82rem/1 var(--mono); }
.rt-step-title { padding-top: 4px; font-weight: 600; color: var(--text); }
.rt-tabs { border: 1px solid var(--line); min-width: 0; }
.rt-tabbar { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--ink-2); }
.rt-tabbar button { flex: none; padding: 10px 14px; background: none; border: 0; color: var(--muted); font: 500 .74rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.rt-tabbar button:hover { color: var(--text); }
.rt-tabbar button[aria-selected="true"] { color: var(--cyan); box-shadow: inset 0 -2px var(--cyan); }
.rt-tabpanel { display: grid; gap: 12px; padding: 14px 16px; }
.rt-tabpanel[hidden] { display: none; }
.rt-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.rt-col { display: grid; gap: 10px; align-content: start; min-width: 0; }
.rt-details { border: 1px solid var(--line); }
.rt-details summary { padding: 10px 14px; cursor: pointer; font-weight: 600; list-style-position: inside; }
.rt-details summary:hover { color: var(--cyan); }
.rt-details > .rt-body { padding: 0 14px 14px; }
.rt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.rt-gallery .rt-zoom img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.rt-box { display: grid; gap: 10px; }

/* Post editor (js/editor.js): toolbar + write/preview panes around the form's own textarea. */
.ed { display: grid; border: 1px solid var(--line-2); background: var(--ink); min-width: 0; }
.ed:focus-within { border-color: color-mix(in srgb, var(--cyan) 55%, var(--line-2)); }
.ed.drop { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.ed-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: stretch; border-bottom: 1px solid var(--line); background: var(--ink-2); }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; }
.ed-tool { min-width: 32px; height: 30px; padding: 0 8px; background: none; border: 1px solid transparent; color: var(--muted); font: 500 .8rem/1 var(--mono); cursor: pointer; }
.ed-tool:hover, .ed-tool:focus-visible { color: var(--text); border-color: var(--line-2); background: var(--panel); outline: none; }
.ed-bold { font-weight: 700; } .ed-italic { font-style: italic; } .ed-strike { text-decoration: line-through; }
.ed-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line-2); }
.ed-tabs { display: flex; }
.ed-tab { padding: 0 14px; background: none; border: 0; border-left: 1px solid var(--line); color: var(--dim); font: 500 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.ed-tab:hover { color: var(--text); }
.ed-tab[aria-pressed="true"] { color: var(--cyan); box-shadow: inset 0 -2px var(--cyan); }
.ed-panes { position: relative; display: grid; min-width: 0; }
.ed .ed-area { border: 0; min-height: 200px; font: 400 .9rem/1.6 var(--mono); background: var(--ink); }
.replybox .ed .ed-area { min-height: 140px; }
.ed-preview { padding: 12px 16px; min-height: 200px; max-height: 70vh; overflow: auto; background: var(--panel); }
.ed-empty { color: var(--dim); }
.ed[data-mode="write"] .ed-preview, .ed[data-mode="preview"] .ed-area { display: none; }
.ed[data-mode="split"] .ed-panes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ed[data-mode="split"] .ed-preview { border-left: 1px solid var(--line); max-height: none; }
.ed-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 6px 10px; border-top: 1px solid var(--line); color: var(--dim); font: .7rem/1.3 var(--mono); }
.ed-note { flex: 1; } .ed-note.error { color: var(--hp); }
.ed-guide { color: var(--muted); }
.ed-count { font-variant-numeric: tabular-nums; } .ed-count.warn { color: var(--warn); }
.ed-menu { position: absolute; z-index: 20; display: grid; width: 240px; max-height: 280px; overflow-y: auto; padding: 4px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 12px 32px rgb(0 0 0 / .45); }
.ed-dropwrap { position: relative; }
.ed-drop { top: calc(100% + 4px); left: 0; }
.ed-opt { display: flex; justify-content: space-between; gap: 10px; padding: 7px 9px; background: none; border: 0; color: var(--text); font: .84rem/1.2 var(--sans); text-align: left; cursor: pointer; }
.ed-opt code { color: var(--dim); font: .72rem var(--mono); }
.ed-opt:hover, .ed-opt[aria-selected="true"] { background: var(--line); }
.ed-opt[aria-selected="true"] code { color: var(--cyan); }
@media (max-width: 720px) {
  .ed-tab[data-mode="split"] { display: none; }
  .ed[data-mode="split"] .ed-panes { grid-template-columns: minmax(0, 1fr); }
}
.pactions { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.pact { padding: 7px 10px; background: none; border: 1px solid transparent; color: var(--muted); font: 500 .76rem/1 var(--mono); letter-spacing: .03em; cursor: pointer; }
.pact:hover { color: var(--text); border-color: var(--line-2); }
.pact.on { color: var(--hp); }
.pact.danger { margin-left: auto; }
.pact.danger:hover { color: var(--hp); border-color: rgba(224, 70, 59, .45); }
.pedit { display: grid; gap: 10px; }
.pedit .actions, .replybox .actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.replybox { display: grid; gap: 12px; margin-top: 24px; padding: 18px; border: 1px solid var(--line-2); background: var(--panel); }
.replybox.guest { color: var(--muted); }
.replybox.guest .linklike { color: var(--cyan); }
.replybox-head { display: flex; gap: 10px; align-items: center; font-size: .86rem; color: var(--muted); }
.replybox-head b { color: var(--text); }
.replybox textarea { min-height: 130px; }

/* ---- members ---- */
/* Cover colours a member picks (profile "Capa"): a fixed palette, never a free colour. */
[data-banner] { --banner: var(--line-2); }
[data-banner="cyan"] { --banner: var(--cyan); }
[data-banner="violet"] { --banner: var(--violet); }
[data-banner="mana"] { --banner: var(--mana); }
[data-banner="ok"] { --banner: var(--ok); }
[data-banner="warn"] { --banner: var(--warn); }
[data-banner="hp"] { --banner: var(--hp); }
[data-banner="slate"] { --banner: var(--dim); }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 12px; }
.mcard { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 16px; border: 1px solid var(--line-2); border-top: 2px solid var(--banner); background: var(--panel); transition: border-color .15s; }
.mcard:hover { border-color: rgba(35, 213, 255, .45); border-top-color: var(--banner); }
.mcard-main { display: grid; gap: 4px; align-content: start; min-width: 0; }
.mcard-name { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.mcard-name .hit { font-weight: 600; overflow-wrap: anywhere; }
.mcard-game { font: 500 .78rem/1.3 var(--mono); color: var(--muted); }
.mcard small { color: var(--dim); font-size: .78rem; }
.mcard .ot-row { margin-top: 4px; }

/* ---- profile: cover band, face over it, stats strip, tabs ---- */
.phero { display: grid; border: 1px solid var(--line-2); background: var(--panel); margin-bottom: 24px; }
.phero-cover { height: 96px; border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in srgb, var(--banner) 14%, transparent) 11px 12px),
    linear-gradient(90deg, color-mix(in srgb, var(--banner) 42%, var(--panel)), color-mix(in srgb, var(--banner) 12%, var(--panel))); }
.phero-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 24px; align-items: start; padding: 0 24px 22px; margin-top: -48px; }
.phero-body > .av { border: 3px solid var(--panel); box-sizing: content-box; }
.phero-main, .phero-body > .btn { margin-top: 58px; }
.phero-main { min-width: 0; display: grid; gap: 8px; }
.phero-name { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.phero-name h1 { font-size: var(--step-3); text-transform: uppercase; overflow-wrap: anywhere; }
.phero-game { font: 500 .86rem/1.4 var(--mono); color: var(--muted); }
.phero-game b { color: var(--text); font-weight: 600; }
.phero-bio { max-width: 64ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.pstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 50%), 1fr)); border-top: 1px solid var(--line); }
.pstats div { display: grid; gap: 6px; padding: 14px 20px; border-left: 1px solid var(--line); }
.pstats div:first-child { border-left: 0; }
.pstats dt { font: 500 .64rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.pstats dd { font: 600 1.25rem/1 var(--mono); }
.profile-main { min-width: 0; display: grid; gap: 20px; align-content: start; }
.profile .forum-rail { position: static; }
.ptabs small { margin-left: 8px; color: var(--dim); }
.rlist { border: 1px solid var(--line-2); background: var(--panel); }
.ritem { display: grid; gap: 3px; padding: 12px 16px; border-top: 1px solid var(--line); }
.ritem:first-child { border-top: 0; }
.ritem:hover { background: var(--panel-2); }
.ritem .hit { font-weight: 600; }
.ritem p { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ritem small { color: var(--dim); font-size: .76rem; }
.facts-list dd a { overflow-wrap: anywhere; }

/* Own profile, "Editar perfil": settings groups (title and help on the left, fields on the right), sticky save bar. */
.settings { display: grid; border: 1px solid var(--line-2); background: var(--panel); }
.sgroup { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px 28px; padding: 22px; border-top: 1px solid var(--line); }
.sgroup:first-child { border-top: 0; }
.sgroup-head h2 { font: 700 .86rem/1.2 var(--display); font-stretch: 112%; letter-spacing: .04em; text-transform: uppercase; }
.sgroup-head p { margin-top: 6px; color: var(--dim); font-size: .82rem; }
.sgroup-body { display: grid; gap: 14px; min-width: 0; }
.srow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sfield { display: grid; gap: 6px; min-width: 0; }
.sfield > label { font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sfield textarea.control { min-height: 110px; }
.sfield-foot { display: flex; justify-content: space-between; gap: 12px; min-height: 1.2em; }
.sfield-msg { color: var(--dim); font-size: .76rem; }
.sfield-msg.bad { color: var(--hp); }
.sfield .count { color: var(--dim); font-size: .72rem; margin-left: auto; }
.sfield .count.warn { color: var(--warn); }
.control[aria-invalid="true"] { border-color: var(--hp); }
.savatar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.savatar-actions { display: grid; gap: 8px; }
.savatar .pair { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: grid; justify-items: center; gap: 6px; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { width: 44px; height: 30px; border: 1px solid var(--line-2);
  background: linear-gradient(90deg, color-mix(in srgb, var(--banner) 55%, var(--panel)), color-mix(in srgb, var(--banner) 18%, var(--panel))); }
.swatch small { font: 500 .64rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.swatch:hover span { border-color: var(--muted); }
.swatch input:checked + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.swatch input:checked ~ small { color: var(--text); }
.swatch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.sbar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: flex-end;
  padding: 14px 22px; border-top: 1px solid var(--line-2); background: var(--panel-2); }
.sbar .error { margin-right: auto; min-height: 0; }

/* ---- nav: member, bell, notifications ---- */
.nav-me { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; margin-right: 12px; }
.nav-me b { color: var(--text); font-weight: 600; font-size: .9rem; }
.nav-me:hover b { color: var(--cyan); }
.nav-tools { position: relative; display: flex; align-items: center; }
.bell { position: relative; width: 38px; height: 38px; display: grid; place-items: center; background: none; border: 1px solid var(--line-2); color: var(--muted); cursor: pointer; }
.bell:hover, .bell[aria-expanded="true"] { color: var(--text); border-color: var(--text); }
.bell-n { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; background: var(--hp); color: #fff; font: 600 .64rem/18px var(--mono); text-align: center; }
.notifs { position: absolute; top: calc(100% + 12px); right: 0; z-index: 60; width: 380px; max-height: min(70vh, 560px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 18px 48px rgba(0, 0, 0, .55); }
.notifs header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: .9rem; }
.notifs header .linklike { font-size: .78rem; }
.notifs .empty { padding: 24px 14px; }
.nitem { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; width: 100%; padding: 12px 14px; text-align: left; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--muted); font: 400 .86rem/1.4 var(--sans); }
.nitem:hover { background: var(--panel-2); }
.nitem.unread { background: var(--ink-2); color: var(--text); box-shadow: inset 3px 0 0 var(--cyan); }
.nitem b { color: var(--text); font-weight: 600; }
.nitem q { color: var(--text); }
.nitem small { display: block; margin-top: 3px; color: var(--dim); font-size: .74rem; }

/* ---- admin: OT boards ---- */
.block + .block { margin-top: 36px; }
.icon-edit { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--muted); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--cyan); }
td .ot-ico { vertical-align: middle; margin-right: 10px; }
td select.control { width: auto; min-height: 34px; padding-block: 4px; font-size: .85rem; }
td a { text-decoration: none; }

@media (max-width: 1080px) {
  .trow { grid-template-columns: 40px minmax(0, 1fr) 76px; }
  .trow-last { display: none; }
  .sgroup { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 900px) {
  .forum { grid-template-columns: minmax(0, 1fr); }
  .forum-rail { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .bhead { grid-template-columns: auto minmax(0, 1fr); }
  .bhead > .meter { grid-column: 1 / -1; justify-self: start; }
  .phero-body { grid-template-columns: auto minmax(0, 1fr); }
  .phero-body > .btn { grid-column: 1 / -1; justify-self: start; margin-top: 0; }
}
@media (max-width: 880px) {
  .nav-tools { margin-left: auto; }
  .nav-tools:not([hidden]) + .nav-menu { margin-left: 0; }
  .nav .wrap { gap: 12px; }
  .nav-me { padding: 14px 0; }
  .notifs { position: fixed; top: 72px; left: 16px; right: 16px; width: auto; }
}
@media (max-width: 700px) {
  .trow { grid-template-columns: 36px minmax(0, 1fr); gap: 8px 12px; padding: 12px; }
  .trow > .av { --s: 36px !important; }
  .trow-count { grid-column: 2; justify-self: start; display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 8px; }
  .trow-count b { font-size: .9rem; }
  .phead { padding: 12px 14px; }
  .pbody { padding: 14px; }
  .bhead h1, .phero-name h1 { font-size: var(--step-2); }
  .phero-cover { height: 72px; }
  .phero-body { padding: 0 16px 18px; margin-top: -36px; gap: 12px 16px; }
  .phero-body > .av { --s: 72px !important; }
  .phero-main { margin-top: 42px; }
  .pstats div { padding: 12px 14px; }
  .pstats div:nth-child(odd) { border-left: 0; }
  .pstats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pstats div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .phero-name h1 { font-size: clamp(1.35rem, 7vw, var(--step-2)); }
  .trow { align-items: start; }
  .sgroup { padding: 18px 16px; }
  .srow { grid-template-columns: minmax(0, 1fr); }
  .sbar { padding: 12px 16px; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 0 8px; }
  .fsearch .btn { display: none; }
}

/* Own profile: tabs and the licence card (comunidade.js licencePanel). */
.ptabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.ptabs a { padding: 10px 14px; color: var(--muted); font: 500 .74rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.ptabs a:hover { color: var(--text); }
.ptabs a[aria-current="page"] { color: var(--cyan); box-shadow: inset 0 -2px var(--cyan); }
.licence-card { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line-2); background: var(--panel); }
.licence-plan { display: flex; gap: 8px; }
.licence-left { display: grid; gap: 4px; }
.licence-left small { color: var(--dim); font: 500 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.countdown { font: 600 var(--step-2)/1.1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.countdown.warn { color: var(--warn); } .countdown.bad { color: var(--hp); }
.licence .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Docs (#docs): menu | page | "Nesta página". Sticky side columns, one column on phones. */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 40px; align-items: start; }
.docs-side, .docs-toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.docs-search { min-height: 38px; font-size: .86rem; }
.docs-menu { display: grid; gap: 18px; }
.docs-group ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; border-left: 1px solid var(--line); }
.docs-section { color: var(--dim); font: 600 .68rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.docs-menu li a { display: block; padding: 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); font-size: .88rem; text-decoration: none; }
.docs-menu li a:hover { color: var(--text); }
.docs-menu li a[aria-current="page"] { color: var(--cyan); border-left-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 6%, transparent); }
.docs-menu li small { display: block; padding: 0 12px 6px; color: var(--dim); font-size: .74rem; line-height: 1.4; }
.docs-main { display: grid; gap: 18px; min-width: 0; max-width: 780px; }
.docs-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: start; }
.docs-head h1 { font-size: var(--step-3); line-height: 1.1; text-wrap: balance; }
.docs-body { font-size: 1rem; gap: 16px; }
.docs-body h2.rt-h { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.docs-pending { padding: 8px 12px; border: 1px solid var(--line-2); border-left: 3px solid var(--warn); color: var(--muted); font-size: .86rem; }
.docs-meta { color: var(--dim); font: .74rem var(--mono); }
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.docs-pn { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.docs-pn:hover { border-color: var(--cyan); }
.docs-pn small { color: var(--dim); font: 500 .68rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.docs-pn.next { text-align: right; }
.docs-comments { display: grid; gap: 14px; padding-top: 24px; border-top: 1px solid var(--line); }
.docs-toc { gap: 2px; }
.docs-toc .docs-section { margin-bottom: 8px; }
.docs-toc a { padding: 4px 0 4px 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.35; text-decoration: none; }
.docs-toc a.lv3 { padding-left: 24px; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a[aria-current="true"] { color: var(--cyan); border-left-color: var(--cyan); }
.docs-drawer { display: none; }
.docs-editor .ptabs button { padding: 10px 14px; background: none; border: 0; color: var(--muted); font: 500 .74rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.docs-editor .ptabs button[aria-current="page"] { color: var(--cyan); box-shadow: inset 0 -2px var(--cyan); }
@media (max-width: 1180px) {
  .docs { grid-template-columns: 220px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .docs-drawer { display: inline-flex; justify-self: start; }
  .docs-side { display: none; position: static; max-height: none; padding: 14px; border: 1px solid var(--line-2); background: var(--panel); }
  .docs-side.open { display: grid; }
  .docs-pager { grid-template-columns: minmax(0, 1fr); }
}

/* Checkout (/checkout, js/checkout.js). */
.checkout { max-width: 1040px; }
.co { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px 32px; align-items: start; }
.co-head, .co-step { grid-column: 1; }
.co-head { display: grid; gap: 10px; }
.co-head h1 { font-size: var(--step-3); text-transform: uppercase; }
.co-head p { color: var(--muted); max-width: 60ch; }
.co-step { display: grid; gap: 12px; margin: 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.co-step legend { float: left; width: 100%; display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font: 600 .74rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.co-step legend .num { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--cyan); color: var(--cyan); }
.co-plans, .co-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.co-periods { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 8px; }
.co-plan, .co-period { position: relative; display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; }
.co-plan input, .co-period input { position: absolute; opacity: 0; pointer-events: none; }
.co-plan span { color: var(--muted); font-size: .86rem; }
.co-plan .tag { justify-self: start; font-size: .68rem; }
.co-plan:has(input:disabled) { cursor: default; opacity: .6; }
.co-plan:has(input:checked), .co-period:has(input:checked) { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.co-plan:has(input:focus-visible), .co-period:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.co-tag { justify-self: start; color: var(--ok); font: 500 .68rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.co-price { color: var(--text); font: 500 .9rem var(--mono); }
.co-addon b { display: flex; gap: 8px; align-items: center; }
.co-addon::after { content: ''; position: absolute; top: 14px; right: 16px; width: 18px; height: 18px; border: 1px solid var(--line-2); }
.co-addon:has(input:checked)::after { content: '✓'; display: grid; place-items: center; border-color: var(--cyan); background: var(--cyan); color: var(--ink); font-weight: 700; }
.co-login { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.co-sum { grid-column: 2; grid-row: 1 / span 5; position: sticky; top: 84px; display: grid; gap: 8px; padding: 20px; border: 1px solid var(--line-2); background: var(--panel); }
.co-sum-label { color: var(--dim); font: 500 .7rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.co-sum b { font: 600 var(--step-2)/1.1 var(--mono); }
.co-sum #totalNote, .co-sum small { color: var(--muted); font-size: .8rem; }
.co-lines { display: grid; gap: 6px; margin: 0 0 6px; padding: 0 0 12px; list-style: none; border-bottom: 1px solid var(--line-2); }
.co-lines li { display: flex; justify-content: space-between; gap: 12px; font-size: .86rem; color: var(--muted); }
.co-lines li span:last-child { color: var(--text); font-family: var(--mono); white-space: nowrap; }
.co-result { display: grid; gap: 14px; max-width: 640px; padding: 28px; border: 1px solid var(--line-2); background: var(--panel); }
.co-result h1 { font-size: var(--step-2); }
.co-result p { color: var(--muted); }
.co-result .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.co-bar { height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), transparent) 0 0 / 40% 100% no-repeat, var(--line); animation: co-sweep 1.4s linear infinite; }
@keyframes co-sweep { from { background-position: -40% 0, 0 0; } to { background-position: 140% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .co-bar { animation: none; } }
@media (max-width: 860px) {
  .co { grid-template-columns: minmax(0, 1fr); }
  .co-sum { grid-column: 1; grid-row: auto; position: static; }
  .co-login { grid-template-columns: minmax(0, 1fr); }
}

/* Loja: price chip on list rows, the locked box on a paid file, the seller how-to */
.post h3 .price { margin-left: 8px; vertical-align: middle; }
.locked { display: grid; gap: 8px; padding: 22px; border: 1px dashed var(--line-2); background: var(--panel); }
.locked b { font-size: 1.6rem; }
.locked p { color: var(--muted); }
.sell-steps { display: grid; gap: 8px; padding-left: 20px; color: var(--muted); }
.sell-how { margin-bottom: 24px; padding: 16px 20px; border: 1px dashed var(--line-2); background: var(--panel); }
.sell-how summary { cursor: pointer; font-weight: 600; }
.sell-how .sell-steps { margin: 12px 0; }

/* Loja: seller shops. Index cards, the shop page's banner strip (scroll-snap, no script), the banner editor */
.shops-box { margin-bottom: 24px; }
.shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.shop-card { display: grid; gap: 4px; padding: 0 0 12px; border: 1px solid var(--line-2); background: var(--panel); color: inherit; text-decoration: none; transition: border-color .15s; }
.shop-card:hover { border-color: rgba(35, 213, 255, .45); }
.shop-card > img, .shop-card-blank { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; display: grid; place-items: center; background: var(--ink-2); margin-bottom: 8px; }
.shop-card > b, .shop-card > small, .shop-card > .num { padding: 0 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-card > small { color: var(--muted); }
.shop-card > .num { font: 500 .76rem/1.4 var(--mono); color: var(--dim); }
.banners { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin-bottom: 20px; }
.banner { position: relative; flex: 0 0 min(100%, 720px); scroll-snap-align: start; border: 1px solid var(--line-2); background: var(--ink-2); color: inherit; text-decoration: none; }
.banner:only-child { flex-basis: 100%; }
.banner img { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; }
.banner span { position: absolute; inset: auto 0 0 0; padding: 10px 14px; font-weight: 600; background: rgba(0, 0, 0, .6); }
a.banner:hover { border-color: rgba(35, 213, 255, .45); }
.banner-edit { display: grid; gap: 8px; }
.banner-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.banner-row img { width: 120px; aspect-ratio: 3 / 1; object-fit: cover; border: 1px solid var(--line); }
.files-kind { margin: 18px 0 8px; }
@media (max-width: 700px) { .banner-row { grid-template-columns: 120px minmax(0, 1fr); } }

/* Checkout auto-renew toggle (checkout.js renewField) */
.co-renew { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14px; color: var(--muted); cursor: pointer; }
.co-renew[hidden] { display: none; }
.co-renew b { color: var(--text); }
.co-renew input { margin-top: 3px; accent-color: var(--cyan); }

/* Seller plans (a pass to every paid file of a shop): the cards, the editor rows, and the storefront (loja.js) */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; margin-top: 12px; }
.plan-card { display: grid; gap: 8px; align-content: start; padding: 18px; border: 1px solid var(--line-2); background: var(--panel); }
.plan-card > .num { font: 600 var(--step-2)/1.1 var(--mono); }
.plan-card > .num small { font: 500 .8rem var(--mono); color: var(--muted); }
.plan-card p { color: var(--muted); font-size: .9rem; }
.plan-card .btn { justify-self: start; }
.plan-edit { display: grid; gap: 8px; }
.plan-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 110px 120px auto auto auto; gap: 8px; align-items: center; }
.plan-item { display: grid; gap: 6px; }
.plan-files-edit { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .86rem; }
.plan-files { margin: 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }
.plan-card .plan-all { font-size: .86rem; }
.plan-on { display: flex; gap: 6px; align-items: center; font-size: .86rem; white-space: nowrap; }
@media (max-width: 900px) { .plan-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 8px; border-bottom: 1px solid var(--line); } }
.shop-card a.num { text-decoration: underline; }
div.post:hover h3 { color: inherit; }
.post .buy { grid-row: 1 / span 2; grid-column: 3; align-self: center; }
@media (max-width: 600px) { .post .buy { grid-column: 1; grid-row: auto; justify-self: start; } }
.shop-login { display: grid; gap: 12px; max-width: 420px; }
