/* Master Runes forum (D41) - forum.php. Brand tokens: brand-tokens.css. Mobile-first, dark, no external resources.
   Global rules in site.css style every button/input with !important; the forum overrides them inside .tpf. */
.tpf { display: grid; gap: 18px; color: var(--brand-text-soft); font-size: 14px; line-height: 1.55; min-width: 0; }
.tpf *, .tpf *::before, .tpf *::after { box-sizing: border-box; }
.tpf h1, .tpf h2, .tpf h3 { margin: 0; padding: 0; border: 0; }
#content .tpf h1 { font-family: var(--brand-font-display); font-size: clamp(21px, 5vw, 28px); color: var(--brand-accent); letter-spacing: .03em; line-height: 1.2; border: 0; padding: 0; margin: 0; overflow-wrap: anywhere; }
#content .tpf p { margin: 0; }
.tpf a { color: var(--brand-info); }
.tpf a:hover { color: var(--brand-accent-hover); text-decoration: underline; }
.tpf :focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.tpf-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
.tpf-muted { color: var(--brand-text-muted); font-size: 12.5px; }
#content .tpf .tpf-h2, .tpf .tpf-h2 { font-family: var(--brand-font-display); font-size: 16px; font-weight: 700; color: var(--brand-text); letter-spacing: .04em; margin: 0 0 10px; display: flex; gap: 8px; align-items: center; }
.tpf-section { min-width: 0; }
.tpf-note { padding: 10px 14px; border-radius: var(--brand-radius-md); background: rgb(var(--brand-info-rgb) / .08); border: 1px solid rgb(var(--brand-info-rgb) / .3); color: var(--brand-text-soft); font-size: 13px; }
.tpf-empty { padding: 26px 16px; text-align: center; color: var(--brand-text-muted); border: 1px dashed var(--brand-border-strong); border-radius: var(--brand-radius-lg); background: rgb(var(--brand-surface-rgb) / .5); }
.tpf-empty--big { display: grid; gap: 12px; justify-items: center; }
.tpf-card { background: var(--brand-gradient-surface); border: 1px solid var(--brand-border); border-radius: var(--brand-radius-lg); padding: 16px; box-shadow: var(--brand-shadow-sm), var(--brand-shadow-inset); }

/* ---------- buttons (override the global gold `button` rule) ---------- */
.tpf .tpf-btn, .tpf button.tpf-btn, .tpf summary.tpf-btn {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 6px; min-height: 38px; width: auto !important;
  padding: 8px 14px !important; border-radius: var(--brand-radius-md) !important; font: 700 13px/1.2 var(--brand-font-sans) !important;
  background: var(--brand-surface-3) !important; color: var(--brand-text) !important; border: 1px solid var(--brand-border-strong) !important;
  box-shadow: none !important; text-transform: none; letter-spacing: normal; text-decoration: none !important; cursor: pointer; margin: 0 !important; filter: none;
}
.tpf .tpf-btn:hover { border-color: var(--brand-accent-strong) !important; color: var(--brand-text) !important; }
.tpf .tpf-btn--primary, .tpf button.tpf-btn--primary {
  background: var(--brand-gradient-gold) !important; color: var(--brand-accent-contrast) !important; border-color: var(--brand-accent-strong) !important;
  box-shadow: 0 2px 10px rgb(var(--brand-accent-rgb) / .22), inset 0 1px 0 rgb(255 255 255 / .3) !important;
}
.tpf .tpf-btn--primary:hover { color: var(--brand-accent-contrast) !important; filter: brightness(1.06); }
.tpf .tpf-btn--ghost, .tpf button.tpf-btn--ghost, .tpf summary.tpf-btn--ghost { background: transparent !important; border-color: transparent !important; color: var(--brand-text-muted) !important; }
.tpf .tpf-btn--ghost:hover { color: var(--brand-text) !important; border-color: var(--brand-border) !important; }
.tpf .tpf-btn--danger, .tpf button.tpf-btn--danger { color: var(--brand-danger-text) !important; border-color: rgb(var(--brand-danger-rgb) / .45) !important; background: rgb(var(--brand-danger-rgb) / .08) !important; }
.tpf .tpf-btn--ghost.tpf-btn--danger { border-color: transparent !important; background: transparent !important; }
.tpf .tpf-btn--sm, .tpf button.tpf-btn--sm, .tpf summary.tpf-btn--sm { min-height: 32px; padding: 5px 10px !important; font-size: 12.5px !important; }
.tpf button[disabled] { opacity: .55; cursor: default; }
.tpf-inline { display: inline; margin: 0; }
.tpf summary { list-style: none; }
.tpf summary::-webkit-details-marker { display: none; }

/* ---------- form controls ---------- */
.tpf input[type="text"], .tpf input[type="search"], .tpf select, .tpf textarea {
  margin: 0 !important; font-size: 14px !important; min-height: 40px; background-color: var(--brand-bg-deep) !important;
}
.tpf .tpf-field input[type="text"], .tpf .tpf-search input[type="search"] { max-width: none; }
.tpf .tpf-field select { max-width: 420px; }
.tpf textarea { font: 14px/1.55 var(--brand-font-sans) !important; resize: vertical; min-height: 120px; }
.tpf input[type="color"] { width: 64px; height: 40px; padding: 2px; border: 1px solid var(--brand-border-strong); border-radius: var(--brand-radius-md); background: var(--brand-bg-deep); }
.tpf label { font-size: 12.5px; font-weight: 700; color: var(--brand-text); }
.tpf-field { display: grid; gap: 5px; min-width: 0; }
.tpf-field--inline { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.tpf-field--row { display: flex; gap: 12px; flex-wrap: wrap; }
.tpf-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400 !important; color: var(--brand-text-soft) !important; }
.tpf-check input { margin-top: 3px; }
.tpf-form-grid { display: grid; gap: 12px; }
.tpf-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- header / hero / crumbs ---------- */
.tpf-hero { display: grid; gap: 14px; padding: 18px; border-radius: var(--brand-radius-lg); border: 1px solid var(--brand-border); border-top: 2px solid var(--brand-accent-strong);
  background: radial-gradient(120% 140% at 0% 0%, rgb(var(--brand-accent-rgb) / .12), transparent 55%), var(--brand-gradient-surface); box-shadow: var(--brand-shadow-md), var(--brand-shadow-inset); }
.tpf-hero p { color: var(--brand-text-soft) !important; margin-top: 4px !important; }
.tpf-hero--slim { padding: 14px 16px; }
.tpf-search { display: flex; gap: 8px; min-width: 0; margin: 0; }
.tpf-search input { flex: 1; min-width: 0; }
.tpf-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; font-size: 12.5px; color: var(--brand-text-muted); }
.tpf-crumbs li { display: inline-flex; gap: 4px; min-width: 0; }
.tpf-crumbs li + li::before { content: "›"; color: var(--brand-border-strong); }
.tpf-crumbs [aria-current] { color: var(--brand-text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.tpf-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; align-items: center; padding: 16px; border-radius: var(--brand-radius-lg);
  background: linear-gradient(90deg, color-mix(in srgb, var(--tpf-c, #e0b249) 14%, transparent), transparent 70%), var(--brand-gradient-surface);
  border: 1px solid var(--brand-border); border-left: 4px solid var(--tpf-c, var(--brand-accent)); }
.tpf-head > .tpf-btn { grid-column: 1 / -1; justify-self: start; }
.tpf-head__icon { font-size: 30px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--tpf-c, #e0b249) 16%, var(--brand-bg-deep)); border: 1px solid color-mix(in srgb, var(--tpf-c, #e0b249) 45%, transparent); }
.tpf-head__text { display: grid; gap: 4px; min-width: 0; }
.tpf-thead { display: grid; gap: 6px; }

/* ---------- badges ---------- */
.tpf-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.tpf-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--brand-radius-pill); font-size: 11px; font-weight: 700; line-height: 18px; white-space: nowrap;
  background: var(--brand-surface-3); color: var(--brand-text-soft); border: 1px solid var(--brand-border-strong); }
.tpf-badge--staff { background: rgb(var(--brand-accent-rgb) / .12); color: var(--brand-accent); border-color: rgb(var(--brand-accent-rgb) / .4); }
.tpf-badge--pin { background: rgb(var(--brand-info-rgb) / .1); color: var(--brand-info); border-color: rgb(var(--brand-info-rgb) / .35); }
.tpf-badge--lock { background: rgb(255 255 255 / .04); color: var(--brand-text-muted); }
.tpf-badge--hot { background: rgb(var(--brand-premium-rgb) / .14); color: var(--brand-warning-text); border-color: rgb(var(--brand-premium-rgb) / .4); }
.tpf-badge--new { background: rgb(var(--brand-success-rgb) / .3); color: var(--brand-success-text); border-color: rgb(var(--brand-success-text-rgb) / .45); }
.tpf-badge--danger { background: rgb(var(--brand-danger-rgb) / .12); color: var(--brand-danger-text); border-color: rgb(var(--brand-danger-rgb) / .4); }
.tpf-count-pill { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand-danger-strong); color: #fff; font-size: 11px; text-align: center; }

/* ---------- flash / rule ---------- */
.tpf-flash { padding: 10px 14px; border-radius: var(--brand-radius-md); font-size: 13.5px; border: 1px solid; }
.tpf-flash--ok { background: rgb(var(--brand-success-rgb) / .25); border-color: rgb(var(--brand-success-text-rgb) / .45); color: var(--brand-success-text); }
.tpf-flash--error { background: rgb(var(--brand-danger-rgb) / .12); border-color: rgb(var(--brand-danger-rgb) / .45); color: var(--brand-danger-text); }
.tpf-toasts { position: fixed; z-index: 1000; left: 12px; right: 12px; bottom: 12px; display: grid; gap: 8px; }
.tpf-toasts .tpf-flash { background: var(--brand-surface-2); box-shadow: var(--brand-shadow-lg); }
.tpf-rule { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--brand-radius-lg); background: rgb(var(--brand-accent-rgb) / .07); border: 1px solid var(--brand-accent-strong); }
.tpf-rule__ico { font-size: 22px; line-height: 1; }
#content .tpf .tpf-rule__title { color: var(--brand-accent); font-weight: 700; margin-bottom: 2px; }
.tpf-rule p { font-size: 13px; }

/* ---------- staff nav / modbar ---------- */
.tpf-modnav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--brand-radius-md); background: rgb(var(--brand-accent-rgb) / .05); border: 1px dashed rgb(var(--brand-accent-rgb) / .35); }
.tpf-modnav ul, .tpf-filters ul, .tpf-pages ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.tpf-modnav a, .tpf-filters a { display: inline-block; padding: 5px 10px; border-radius: var(--brand-radius-pill); font-size: 12.5px; font-weight: 700; color: var(--brand-text-soft) !important; text-decoration: none !important; border: 1px solid transparent; }
.tpf-modnav a:hover, .tpf-filters a:hover { border-color: var(--brand-border-strong); }
.tpf-modnav a[aria-current], .tpf-filters a[aria-current] { background: rgb(var(--brand-accent-rgb) / .14); color: var(--brand-accent) !important; border-color: rgb(var(--brand-accent-rgb) / .4); }
.tpf-modbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-radius: var(--brand-radius-md); background: rgb(var(--brand-accent-rgb) / .05); border: 1px dashed rgb(var(--brand-accent-rgb) / .35); }
.tpf-move { display: inline-flex; gap: 6px; align-items: center; }
.tpf-move select { width: auto !important; min-width: 150px; max-width: 220px; min-height: 32px; padding: 4px 8px !important; font-size: 12.5px !important; }

/* ---------- categories ---------- */
.tpf-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tpf-cat { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 14px; border-radius: var(--brand-radius-lg);
  background: var(--brand-gradient-surface); border: 1px solid var(--brand-border); border-left: 4px solid var(--tpf-c, var(--brand-accent)); box-shadow: var(--brand-shadow-sm), var(--brand-shadow-inset); transition: border-color .15s, transform .15s; }
.tpf-cat:hover { border-color: var(--brand-border-strong); border-left-color: var(--tpf-c, var(--brand-accent)); }
.tpf-cat__icon { grid-row: span 2; width: 46px; height: 46px; display: grid; place-items: center; font-size: 24px; border-radius: 12px;
  background: color-mix(in srgb, var(--tpf-c, #e0b249) 16%, var(--brand-bg-deep)); border: 1px solid color-mix(in srgb, var(--tpf-c, #e0b249) 45%, transparent); }
.tpf-cat__icon--sm { width: 32px; height: 32px; font-size: 17px; border-radius: 9px; grid-row: auto; }
.tpf-cat__body { display: grid; gap: 4px; min-width: 0; }
.tpf-cat__name { font-size: 16px !important; font-weight: 700; font-family: var(--brand-font-sans) !important; letter-spacing: 0 !important; }
.tpf-cat__name a { color: var(--brand-text) !important; }
.tpf-cat__name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tpf-cat__name a:hover { color: var(--tpf-c, var(--brand-accent)) !important; text-decoration: none !important; }
.tpf-cat__desc { font-size: 13px; color: var(--brand-text-muted) !important; }
.tpf-cat__stats { display: flex; gap: 16px; margin: 0; }
.tpf-cat__stats div, .tpf-thread__stats div { display: grid; }
.tpf-cat__stats dt, .tpf-thread__stats dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-text-muted); }
.tpf-cat__stats dd, .tpf-thread__stats dd { margin: 0; font-weight: 700; color: var(--brand-text); font-size: 15px; }
.tpf-cat__last { grid-column: 1 / -1; display: grid; gap: 1px; padding-top: 8px; border-top: 1px solid var(--brand-border); min-width: 0; font-size: 13px; }
.tpf-cat__last a, .tpf-cat__lasttitle { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- strips ---------- */
.tpf-strip { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tpf-strip__item { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--brand-radius-md); background: rgb(var(--brand-bg-rgb) / .55); border: 1px solid var(--brand-border); border-left: 3px solid var(--tpf-c, var(--brand-border-strong)); min-width: 0; }
.tpf-strip__icon { font-size: 18px; flex: none; }
.tpf-strip__body { display: grid; min-width: 0; }
.tpf-strip__body > a { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpf-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tpf-results li { padding: 10px 12px; border-radius: var(--brand-radius-md); background: rgb(var(--brand-bg-rgb) / .55); border: 1px solid var(--brand-border); display: grid; gap: 3px; overflow-wrap: anywhere; }
.tpf-results a { font-weight: 700; }

/* ---------- thread list ---------- */
.tpf-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tpf-threads { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tpf-thread { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 12px 14px; border-radius: var(--brand-radius-md); background: var(--brand-gradient-surface); border: 1px solid var(--brand-border); }
.tpf-thread.is-pinned { border-color: rgb(var(--brand-info-rgb) / .35); background: linear-gradient(90deg, rgb(var(--brand-info-rgb) / .07), transparent 60%), var(--brand-gradient-surface); }
.tpf-thread.is-deleted { opacity: .65; border-style: dashed; }
.tpf-thread__main { display: grid; gap: 3px; min-width: 0; grid-column: 1 / -1; }
.tpf-thread__main .tpf-badges:empty { display: none; }
#content .tpf .tpf-thread__title { font-size: 15px; font-weight: 700; margin: 0; line-height: 1.35; font-family: var(--brand-font-sans); color: var(--brand-text); overflow-wrap: anywhere; }
.tpf-thread__title a { color: var(--brand-text) !important; }
.tpf-thread__title a:hover { color: var(--brand-accent-hover) !important; }
.tpf-thread__stats { display: flex; gap: 14px; margin: 0; }
.tpf-thread__last { font-size: 12.5px; text-align: right; align-self: center; min-width: 0; }

/* ---------- pagination ---------- */
.tpf-pages ul { justify-content: center; }
.tpf-pages a, .tpf-pages span[aria-current], .tpf-pages__gap { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: var(--brand-radius-md); font-weight: 700; font-size: 13px; }
.tpf-pages a { border: 1px solid var(--brand-border-strong); color: var(--brand-text-soft) !important; background: var(--brand-surface-2); text-decoration: none !important; }
.tpf-pages a:hover { border-color: var(--brand-accent-strong); }
.tpf-pages span[aria-current] { background: var(--brand-gradient-gold); color: var(--brand-accent-contrast); }
.tpf-pages__gap { color: var(--brand-text-muted); min-width: 20px; }

/* ---------- posts ---------- */
.tpf-posts { display: grid; gap: 12px; }
.tpf-post { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: var(--brand-radius-lg); background: var(--brand-gradient-surface); border: 1px solid var(--brand-border); box-shadow: var(--brand-shadow-sm), var(--brand-shadow-inset); scroll-margin-top: 90px; overflow: hidden; }
.tpf-post:target { border-color: var(--brand-accent-strong); box-shadow: var(--brand-shadow-glow); }
.tpf-post.is-deleted { border-style: dashed; }
.tpf-post.is-deleted > p { padding: 10px 14px; }
.tpf-post.is-deleted .tpf-body { opacity: .6; }
.tpf-author { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: rgb(var(--brand-bg-rgb) / .5); border-bottom: 1px solid var(--brand-border); min-width: 0; }
.tpf-author__outfit { width: 56px; height: 56px; image-rendering: pixelated; flex: none; border-radius: 12px; background: radial-gradient(circle at 50% 60%, var(--brand-surface-3), var(--brand-bg-deep)); border: 1px solid var(--brand-border-strong); }
.tpf-author__ghost { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--brand-bg-deep); border: 1px dashed var(--brand-border-strong); color: var(--brand-text-muted); font-size: 22px; }
.tpf-author__id { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-width: 0; }
.tpf-author__line { display: inline-flex; gap: 4px; align-items: center; min-width: 0; }
.tpf-author__name { font-weight: 700; font-size: 15px; color: var(--brand-accent) !important; overflow-wrap: anywhere; }
.tpf-author__sub { font-size: 12.5px; color: var(--brand-text-muted); }
.tpf-author__guild { font-size: 12.5px; }
.tpf-crown { font-size: 14px; filter: drop-shadow(0 0 4px rgb(var(--brand-premium-rgb) / .6)); }
.tpf-post__main { display: grid; min-width: 0; }
.tpf-post__head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 14px 0; font-size: 12.5px; color: var(--brand-text-muted); }
.tpf-permalink { font-weight: 700; color: var(--brand-text-muted) !important; }
.tpf-post__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px 10px 14px; border-top: 1px solid rgb(var(--brand-border-rgb, 46 38 56) / .6); }
.tpf-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-left: auto; }
.tpf-report { position: relative; }
.tpf-report[open] > summary { color: var(--brand-text) !important; }
.tpf-report__form { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; width: min(320px, 80vw); display: grid; gap: 8px; padding: 12px;
  background: var(--brand-surface-2); border: 1px solid var(--brand-border-strong); border-radius: var(--brand-radius-md); box-shadow: var(--brand-shadow-lg); }
.tpf-report__form textarea { min-height: 80px; }

/* ---------- post body (rendered BBCode) ---------- */
.tpf-body { padding: 8px 14px 12px; color: var(--brand-text); font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.tpf-body a { text-decoration: underline; text-underline-offset: 2px; }
.tpf-body strong { color: var(--brand-text); }
.tpf-list { margin: 6px 0; padding-left: 22px; }
.tpf-list li { margin: 2px 0; }
.tpf-quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--brand-accent-strong); background: rgb(var(--brand-bg-rgb) / .6); border-radius: 0 var(--brand-radius-md) var(--brand-radius-md) 0; color: var(--brand-text-soft); font-size: 13.5px; }
.tpf-quote cite { display: block; font-style: normal; font-weight: 700; font-size: 12px; color: var(--brand-accent); margin-bottom: 2px; }
.tpf-spoiler { margin: 8px 0; border: 1px dashed var(--brand-border-strong); border-radius: var(--brand-radius-md); background: rgb(var(--brand-bg-rgb) / .5); }
.tpf-spoiler > summary { cursor: pointer; padding: 6px 10px; font-weight: 700; font-size: 12.5px; color: var(--brand-text-muted); }
.tpf-spoiler > summary::before { content: "▸ "; }
.tpf-spoiler[open] > summary::before { content: "▾ "; }
.tpf-spoiler > div { padding: 0 10px 8px; }
.tpf-code { margin: 8px 0; padding: 10px 12px; background: var(--brand-bg-deep); border: 1px solid var(--brand-border); border-radius: var(--brand-radius-md); overflow-x: auto; max-height: 480px; white-space: pre; word-break: normal; overflow-wrap: normal; }
.tpf-code code { font: 13px/1.5 var(--brand-font-mono); color: var(--brand-text-soft); }

/* ---------- reactions ---------- */
.tpf-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.tpf .tpf-react, .tpf button.tpf-react {
  display: inline-flex !important; align-items: center; gap: 4px; min-height: 30px; min-width: 38px; padding: 2px 9px !important; margin: 0 !important;
  border-radius: var(--brand-radius-pill) !important; background: rgb(var(--brand-bg-rgb) / .6) !important; border: 1px solid var(--brand-border) !important;
  color: var(--brand-text-soft) !important; font: 700 12.5px/1 var(--brand-font-sans) !important; box-shadow: none !important; cursor: pointer; filter: none;
}
.tpf button.tpf-react:hover { border-color: var(--brand-border-strong) !important; color: var(--brand-text) !important; }
.tpf button.tpf-react.is-on { background: rgb(var(--brand-accent-rgb) / .14) !important; border-color: rgb(var(--brand-accent-rgb) / .55) !important; color: var(--brand-accent) !important; }
.tpf .tpf-react.is-static { cursor: default; }
.tpf-react__n:empty { display: none; }

/* ---------- composer ---------- */
.tpf-composer { display: grid; gap: 12px; padding: 14px; border-radius: var(--brand-radius-lg); background: var(--brand-gradient-surface); border: 1px solid var(--brand-border); margin: 0; }
.tpf-editor { display: grid; border: 1px solid var(--brand-border-strong); border-radius: var(--brand-radius-md); overflow: hidden; background: var(--brand-bg-deep); }
.tpf-editor textarea { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.tpf-editor__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; padding: 4px; background: var(--brand-surface-2); border-bottom: 1px solid var(--brand-border); }
.tpf-toolbar, .tpf-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tpf .tpf-tool, .tpf .tpf-tab, .tpf button.tpf-tool, .tpf button.tpf-tab {
  min-width: 36px; min-height: 34px; padding: 4px 9px !important; margin: 0 !important; display: inline-grid !important; place-items: center;
  background: transparent !important; border: 1px solid transparent !important; border-radius: var(--brand-radius-sm) !important;
  color: var(--brand-text-soft) !important; font: 600 13px/1 var(--brand-font-sans) !important; box-shadow: none !important; cursor: pointer; filter: none;
}
.tpf button.tpf-tool:hover, .tpf button.tpf-tab:hover { background: var(--brand-surface-3) !important; color: var(--brand-text) !important; }
.tpf button.tpf-tab[aria-selected="true"] { background: var(--brand-surface-3) !important; border-color: var(--brand-border-strong) !important; color: var(--brand-accent) !important; }
.tpf-preview { min-height: 120px; background: var(--brand-bg-deep); }
.tpf-composer__foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.tpf-hint { font-size: 11.5px !important; font-family: var(--brand-font-mono); overflow-wrap: anywhere; flex: 1 1 260px; }

/* ---------- moderation pages ---------- */
.tpf-modlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tpf-modcard { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--brand-radius-md); background: var(--brand-gradient-surface); border: 1px solid var(--brand-border); border-left: 3px solid var(--tpf-c, var(--brand-border-strong)); overflow-wrap: anywhere; }
.tpf-modcard.is-open { border-left-color: var(--brand-premium); }
.tpf-modcard__head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tpf-modcard__head .tpf-actions { margin-left: auto; }
.tpf-catedit > summary { justify-self: start; }
.tpf-catedit[open] { display: grid; gap: 10px; }
.tpf-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.tpf-log li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; padding: 6px 10px; border-radius: var(--brand-radius-sm); background: rgb(var(--brand-bg-rgb) / .5); overflow-wrap: anywhere; }
.tpf-log__time { color: var(--brand-text-muted); font-size: 12px; }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .tpf-hero { grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); align-items: center; padding: 22px 24px; }
  .tpf-hero--slim { grid-template-columns: auto minmax(0, 1fr); }
  .tpf-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .tpf-head > .tpf-btn { grid-column: auto; justify-self: end; }
  .tpf-cat { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
  .tpf-cat__icon { grid-row: auto; }
  .tpf-cat__last { grid-column: 2 / -1; }
  .tpf-thread { grid-template-columns: minmax(0, 1fr) auto 150px; align-items: center; }
  .tpf-thread__main { grid-column: auto; }
  .tpf-toasts { left: auto; right: 20px; width: 360px; }
}
@media (min-width: 760px) {
  .tpf-post { grid-template-columns: 150px minmax(0, 1fr); }
  .tpf-author { flex-direction: column; align-items: center; text-align: center; padding: 14px 10px; border-bottom: 0; border-right: 1px solid var(--brand-border); }
  .tpf-author__outfit, .tpf-author__ghost { width: 64px; height: 64px; }
  .tpf-author__id { flex-direction: column; gap: 3px; justify-content: center; }
  .tpf-cat { grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 190px); }
  .tpf-cat__last { grid-column: auto; border-top: 0; padding-top: 0; padding-left: 12px; border-left: 1px solid var(--brand-border); align-self: stretch; align-content: center; text-align: right; }
  .tpf-cats { gap: 8px; }
}
@media (max-width: 420px) {
  .tpf-thread__last { text-align: left; grid-column: 1 / -1; }
  .tpf-search .tpf-btn { padding: 8px 10px !important; }
}
@media (prefers-reduced-motion: reduce) { .tpf * { transition: none !important; scroll-behavior: auto !important; } }
