:root {
  --bg-1: #070b16;
  --bg-2: #0d1630;
  --panel: rgba(14, 22, 43, 0.72);
  --panel-border: rgba(125, 167, 255, 0.22);
  --text: #f5f7ff;
  --muted: #9aa8d6;
  --accent: #77a8ff;
  --accent-2: #7bf7d4;
  --danger: #ff6b81;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  /* Shared with .lead and .article-body--lead (news article HTML from CMS) */
  --prose-lead-color: var(--muted);
  --prose-lead-size: 18px;
  --prose-lead-line-height: 1.65;
  --prose-lead-measure: 74ch;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(119, 168, 255, 0.18), transparent 24%),
    radial-gradient(circle at 80% 30%, rgba(123, 247, 212, 0.1), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(98, 66, 255, 0.18), transparent 30%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.9));
}

body::after {
  background: linear-gradient(to top, rgba(8, 11, 22, 0.85), transparent 50%);
}

.stars,
.stars::before,
.stars::after {
  position: fixed;
  inset: 0;
  content: "";
  background-repeat: repeat;
  background-size: 280px 280px;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.stars {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(119, 168, 255, 0.75) 1px, transparent 1.5px);
  background-position: 0 0, 140px 90px;
  animation: drift 40s linear infinite;
}

.stars::before {
  background-image: radial-gradient(circle, rgba(123, 247, 212, 0.85) 1px, transparent 1.5px);
  background-position: 80px 40px;
  transform: scale(1.15);
  animation: drift 55s linear infinite reverse;
}

.stars::after {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.75) 1px, transparent 1.5px);
  background-position: 30px 150px;
  transform: scale(0.9);
  animation: drift 70s linear infinite;
}

@keyframes drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(36px);
  }
}

.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px clamp(16px, 4vw, 40px) 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.auth-shell {
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}

.site-header {
  margin-bottom: 28px;
  position: relative;
  z-index: 20;
}

/* Header panel only wraps the topbar; overflow:hidden on .panel would clip #account-menu */
.site-header .panel {
  overflow: visible;
}

/* Without overflow:hidden, ::before must be rounded or the gradient reads as a square over the card */
.site-header .panel::before {
  border-radius: inherit;
}

/*
 * Header panel is only the topbar: no inner section below it, so the generic
 * .topbar border-bottom + tint read as an extra line and band at the bottom.
 */
.site-header .topbar {
  border-radius: 27px;
  border-bottom: none;
  background: transparent;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(119, 168, 255, 0.12), transparent 32%, rgba(123, 247, 212, 0.08) 80%);
  pointer-events: none;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  z-index: 1;
}

/* [ logo + Lunia ] [ Home | News | Download ] — left cluster */
.topbar-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

/* Account block pinned to the right when there is room on one row */
.nav-account {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-account a {
  font-size: 13px;
  padding: 8px 14px;
}

/* Account dropdown (shown when .site-logged-in / localStorage luniaSiteLoggedIn) */
.account-dropdown {
  position: relative;
}

.account-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.account-dropdown-trigger:hover,
.account-dropdown.is-open .account-dropdown-trigger {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.account-dropdown-caret {
  font-size: 10px;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.account-dropdown.is-open .account-dropdown-caret {
  transform: rotate(-180deg);
}

.account-dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(12, 18, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.account-dropdown.is-open .account-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.account-dropdown-panel a,
.account-dropdown-panel button.account-dropdown-logout {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.account-dropdown-panel a:hover,
.account-dropdown-panel button.account-dropdown-logout:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.account-dropdown-panel button.account-dropdown-logout {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 10px 10px;
  color: #9aa8cc;
  font-size: 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #dfe8ff;
  text-decoration: none;
  flex-shrink: 0;
  padding: 4px 8px 4px 0;
  margin-right: 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.brand:hover {
  color: var(--text);
}

.brand.is-active {
  color: var(--accent-2);
}

.brand img {
  display: block;
  width: 35px;
  height: auto;
}

/* Main nav sits beside the brand in the same cluster */
.nav-main {
  gap: 4px;
}

/* Narrow: stack and center primary + account */
@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
  }

  .topbar-primary {
    justify-content: center;
  }

  .nav-account {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    justify-content: center;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .brand {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
  }
}

/* Very small: logo only next to links (wordmark hidden; img alt still describes the site) */
@media (max-width: 420px) {
  .brand-text {
    display: none;
  }

  .brand {
    padding: 4px;
  }
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 30px rgba(119, 168, 255, 0.45);
  display: grid;
  place-items: center;
  color: #08101f;
  font-size: 18px;
  font-weight: 900;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav a.is-active {
  color: var(--accent-2);
  background: rgba(123, 247, 212, 0.08);
  border-color: rgba(123, 247, 212, 0.2);
}

.main-inner {
  position: relative;
  z-index: 1;
  padding: clamp(28px, 5vw, 48px);
}

.site-footer {
  margin-top: auto;
  padding-top: 32px;
  color: #7283b8;
  font-size: 13px;
  text-align: center;
}

.site-footer a {
  color: #8a9bc8;
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-2), transparent);
  border-radius: 999px;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.02em;
}

.highlight {
  color: var(--accent);
  text-shadow: 0 0 24px rgba(119, 168, 255, 0.25);
}

.lead {
  margin: 0 0 28px;
  max-width: var(--prose-lead-measure);
  color: var(--prose-lead-color);
  font-size: var(--prose-lead-size);
  line-height: var(--prose-lead-line-height);
}

.section-copy {
  margin: 0 0 22px;
  max-width: 82ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button.primary {
  color: #07111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 40px rgba(119, 168, 255, 0.28);
}

.button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.button.ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.button:hover {
  transform: translateY(-2px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
}

.emblem {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 50% 50%, rgba(119, 168, 255, 0.28), transparent 34%),
    radial-gradient(circle at 50% 50%, rgba(123, 247, 212, 0.18), transparent 55%),
    rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.emblem::before,
.emblem::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 24px;
  border: 1px solid rgba(119, 168, 255, 0.24);
  transform: rotate(45deg);
}

.emblem::after {
  inset: 30%;
  border-color: rgba(123, 247, 212, 0.4);
  box-shadow: 0 0 40px rgba(123, 247, 212, 0.12);
}

.emblem-core {
  position: absolute;
  inset: 50%;
  width: 84px;
  height: 84px;
  margin: -42px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transform: rotate(45deg);
  box-shadow: 0 0 40px rgba(119, 168, 255, 0.35);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.meta-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 18px;
}

.meta-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.meta-value {
  font-size: 17px;
  font-weight: 700;
}

.section-block {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 22px;
  padding: 22px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  border-color: rgba(125, 167, 255, 0.35);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(119, 168, 255, 0.25), rgba(123, 247, 212, 0.15));
  border: 1px solid rgba(125, 167, 255, 0.25);
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  padding: 22px 24px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.news-item:hover {
  border-color: rgba(125, 167, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.news-date {
  min-width: 72px;
  text-align: center;
  padding: 12px 10px;
  border-radius: 16px;
  background: rgba(119, 168, 255, 0.12);
  border: 1px solid rgba(125, 167, 255, 0.22);
}

.news-date .d {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.news-date .m {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 4px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(123, 247, 212, 0.1);
  color: var(--accent-2);
  border: 1px solid rgba(123, 247, 212, 0.22);
  margin-bottom: 8px;
}

.tag.patch {
  background: rgba(119, 168, 255, 0.12);
  color: var(--accent);
  border-color: rgba(125, 167, 255, 0.25);
}

.tag.event {
  background: rgba(255, 107, 129, 0.1);
  color: var(--danger);
  border-color: rgba(255, 107, 129, 0.25);
}

.news-item h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.news-item p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

/* Home page: loading placeholders (mirrors .news-item layout) */
@keyframes news-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -20% 0;
  }
}

.news-item--skeleton {
  pointer-events: none;
  cursor: default;
}

.news-item--skeleton:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.news-skeleton-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 72px;
}

.news-skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.news-skeleton-line {
  display: block;
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.12) 45%,
    rgba(255, 255, 255, 0.05) 90%
  );
  background-size: 200% 100%;
  animation: news-shimmer 1.35s ease-in-out infinite;
}

.news-skeleton-line--day {
  width: 36px;
  height: 26px;
  border-radius: 10px;
}

.news-skeleton-line--month {
  width: 52px;
  height: 10px;
}

.news-skeleton-line--tag {
  width: 88px;
  height: 26px;
  border-radius: 999px;
  margin-bottom: 2px;
}

.news-skeleton-line--title {
  width: min(100%, 320px);
  height: 20px;
}

.news-skeleton-line--text {
  width: 100%;
  max-width: 100%;
}

.news-skeleton-line--text.short {
  width: 72%;
}

@media (prefers-reduced-motion: reduce) {
  .news-skeleton-line {
    animation: none;
    background: rgba(255, 255, 255, 0.08);
  }
}

.news-list--error {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 107, 129, 0.25);
  background: rgba(255, 80, 100, 0.08);
  color: #ffc9d2;
  font-size: 15px;
}

.news-list--error a {
  color: var(--accent-2);
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-back:hover {
  color: var(--accent-2);
}

.article-back::before {
  content: "←";
  font-size: 16px;
  color: var(--accent);
}

.article-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.article-top-row .article-back {
  margin-bottom: 0;
}

/* `hidden` must stay effective — do not set display:flex on the base class (it overrides [hidden]). */
.article-admin-tools:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.article-admin-tools .button {
  font-size: 13px;
  padding: 10px 16px;
  letter-spacing: 0.04em;
}

.article-page-loading {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16px;
}

.article-head {
  margin-bottom: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.article-head h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(154, 168, 214, 0.45);
}

.article-body {
  max-width: 82ch;
}

/*
 * Lead prose: default text uses muted “lead” color; real headings stay full white.
 * Base typography lives on .article-body--lead so divs, blockquotes, tables, etc. inherit it.
 */
.article-body--lead {
  max-width: var(--prose-lead-measure);
  color: var(--prose-lead-color);
  font-size: var(--prose-lead-size);
  line-height: var(--prose-lead-line-height);
}

/* Descendants (not >): CMS bodies are often <div><p>… not direct children of .article-body */
.article-body p {
  margin: 0 0 1.35em;
  font-size: 17px;
  line-height: 1.75;
  color: rgba(245, 247, 255, 0.9);
}

.article-body--lead p {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* In-article h1: CMS sometimes includes one; keep smaller than page title / global h1 */
.article-body h1 {
  margin: 0 0 0.65em;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
}

.article-body h2 {
  margin: 2.25em 0 0.65em;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.article-body > h2:first-child,
.article-body > *:first-child h2:first-child {
  margin-top: 0;
}

.article-body h3,
.article-body h4 {
  margin: 1.6em 0 0.5em;
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.article-body h5,
.article-body h6 {
  margin: 1.35em 0 0.45em;
  font-size: clamp(15px, 1.6vw, 17px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Lead articles: never inherit muted body color on headings */
.article-body--lead h1,
.article-body--lead h2,
.article-body--lead h3,
.article-body--lead h4,
.article-body--lead h5,
.article-body--lead h6 {
  color: var(--text);
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.35em;
  padding-left: 1.35em;
  font-size: 17px;
  line-height: 1.7;
  color: rgba(245, 247, 255, 0.88);
}

.article-body--lead ul,
.article-body--lead ol {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.article-body--lead li {
  color: inherit;
}

.article-body ul li + li,
.article-body ol li + li {
  margin-top: 0.5em;
}

.article-body a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: var(--accent-2);
}

.article-callout {
  margin: 2em 0;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(125, 167, 255, 0.22);
  background: rgba(119, 168, 255, 0.08);
}

.article-callout strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.article-body .article-callout p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.article-pullquote {
  margin: 2em 0;
  padding: 0 0 0 22px;
  border-left: 3px solid var(--accent-2);
  font-size: 19px;
  line-height: 1.55;
  font-style: italic;
  color: #c8d4f5;
}

.article-pullquote cite {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.article-foot {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  color: var(--muted);
  max-width: 82ch;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.store-card {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.store-card:hover {
  border-color: rgba(125, 167, 255, 0.35);
  transform: translateY(-3px);
}

.store-art {
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(circle at 30% 40%, rgba(119, 168, 255, 0.35), transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(123, 247, 212, 0.2), transparent 40%),
    linear-gradient(145deg, rgba(14, 22, 43, 0.9), rgba(7, 11, 22, 0.95));
  display: grid;
  place-items: center;
  font-size: 42px;
}

.store-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}

.store-body h3 {
  margin: 0;
  font-size: 18px;
}

.store-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  flex: 1;
}

.price {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-2);
  letter-spacing: -0.02em;
}

.price small {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.store-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.store-actions .button {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  font-size: 14px;
}

/* Store — Pay Pix & Pay International */
.store-auth-banner {
  margin-bottom: 28px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.08);
  color: var(--muted);
  font-size: 15px;
}

.store-auth-banner[hidden],
.store-auth-banner:empty {
  display: none !important;
}

.store-auth-banner a {
  color: var(--accent);
  font-weight: 600;
}

.store-pay-chooser {
  margin-bottom: 40px;
}

.store-pay-chooser-heading {
  margin: 0 0 18px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.store-pay-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.store-pay-choice {
  margin: 0;
  padding: 22px 22px 24px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: 22px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.store-pay-choice:hover {
  border-color: rgba(125, 167, 255, 0.45);
  transform: translateY(-2px);
}

.store-pay-choice:focus {
  outline: none;
  border-color: rgba(119, 168, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(119, 168, 255, 0.15), var(--shadow);
}

.store-pay-choice-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--accent-2);
}

.store-pay-choice-desc {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.store-pay-panel {
  margin-bottom: 40px;
}

.store-pay-panel-head {
  margin-bottom: 14px;
}

.store-pay-back {
  padding: 10px 16px;
  font-size: 14px;
}

.store-pay-card {
  border-radius: 22px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  padding: 22px 22px 24px;
  box-shadow: var(--shadow);
}

.store-pay-card--single {
  margin-top: 0;
}

.store-pay-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.store-pay-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 62ch;
}

.store-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.store-info-cell {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.store-info-cell--emphasis {
  border-color: rgba(123, 247, 212, 0.25);
}

.store-info-cell--bonus {
  border-color: rgba(119, 168, 255, 0.28);
}

.store-info-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.store-info-value {
  font-weight: 600;
  font-size: 15px;
}

.store-lcoin-promo-block {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.store-pay-form .store-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.store-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.store-req {
  color: var(--danger);
}

.store-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 11, 22, 0.65);
  color: var(--text);
  font-size: 15px;
}

.store-input:focus {
  outline: none;
  border-color: rgba(119, 168, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(119, 168, 255, 0.12);
}

.store-field-hint {
  font-size: 12px;
  color: var(--muted);
}

.store-exchange-foot {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--muted);
}

.store-hcaptcha-mount {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.store-pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.store-pay-actions--end {
  justify-content: flex-end;
  margin-top: 16px;
}

.store-intl-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.store-intl-state--error {
  color: var(--danger);
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.06);
  margin-bottom: 16px;
}

.store-package-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.store-package-col {
  flex: 1 1 240px;
  max-width: 100%;
}

.store-package-card {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.store-package-card:hover {
  border-color: rgba(125, 167, 255, 0.35);
}

.store-package-card.active {
  border-color: rgba(123, 247, 212, 0.55);
  box-shadow: 0 0 0 2px rgba(123, 247, 212, 0.15);
}

.store-package-card.best-value {
  border-color: rgba(119, 168, 255, 0.45);
}

.store-package-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.store-package-header h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.store-package-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-2);
}

.store-package-body {
  padding: 12px 16px 14px;
}

.store-package-desc {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.store-lcoin-info {
  font-size: 14px;
  color: var(--text);
}

.store-package-footer {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store-quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.store-qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.store-qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.store-quantity-display {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
}

.store-selection-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(123, 247, 212, 0.9);
  color: #06221a;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}

.store-cart-panel {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.store-cart-title {
  margin: 0 0 10px;
  font-size: 15px;
}

.store-cart-body {
  min-height: 48px;
  font-size: 14px;
  color: var(--muted);
}

.store-cart-has-items {
  color: var(--text);
}

.store-cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.store-cart-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.store-cart-totals {
  margin: 12px 0 0;
  font-size: 14px;
}

.store-cart-empty {
  margin: 0;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-main {
  padding: clamp(32px, 6vw, 44px);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 11, 22, 0.55);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder {
  color: rgba(154, 168, 214, 0.55);
}

.input:hover {
  border-color: rgba(125, 167, 255, 0.35);
}

.input:focus {
  outline: none;
  border-color: rgba(123, 247, 212, 0.45);
  box-shadow: 0 0 0 3px rgba(119, 168, 255, 0.15);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  user-select: none;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.link-muted {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.link-muted:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.auth-form .button.primary {
  width: 100%;
  justify-content: center;
  padding: 16px 20px;
}

.auth-footer {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}

.auth-footer a {
  color: var(--accent-2);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 20px;
}

.auth-alert-error {
  border: 1px solid rgba(255, 107, 129, 0.45);
  background: rgba(255, 80, 100, 0.12);
  color: #ffc9d2;
}

.flash-banner {
  margin: 6px 0 28px;
  padding: clamp(22px, 4vw, 30px);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 107, 129, 0.18), transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(123, 247, 212, 0.18), transparent 38%),
    linear-gradient(135deg, rgba(119, 168, 255, 0.15), rgba(14, 22, 43, 0.5));
  display: grid;
  gap: 14px;
}

.flash-banner h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
}

.flash-banner p {
  margin: 0;
  color: #d9e2ff;
  max-width: 66ch;
  line-height: 1.6;
}

.flash-banner .actions {
  margin: 0;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.ranking-table th,
.ranking-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.ranking-table th {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.02);
}

.ranking-table tbody tr:hover {
  background: rgba(125, 167, 255, 0.08);
}

.rank-cell {
  width: 56px;
  font-weight: 800;
  color: var(--accent-2);
}

.player-name {
  font-weight: 700;
}

.tier-pill {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(125, 167, 255, 0.28);
  background: rgba(119, 168, 255, 0.14);
  color: #bdd4ff;
}

.tier-pill.master {
  border-color: rgba(123, 247, 212, 0.34);
  background: rgba(123, 247, 212, 0.12);
  color: #baf8e6;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.help-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.help-card:hover {
  border-color: rgba(123, 247, 212, 0.32);
  transform: translateY(-2px);
}

.help-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.help-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.mini-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .emblem {
    max-width: 260px;
  }

  .meta-grid,
  .feature-grid,
  .help-grid {
    grid-template-columns: 1fr;
  }

  .news-item {
    grid-template-columns: 1fr;
  }

  .news-date {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: unset;
    width: fit-content;
  }

  .news-date .m {
    margin-top: 0;
  }
}

/* ——— News manage (/news/manage) ——— */
.page-wrap:has(.news-manage-main) {
  max-width: min(1320px, 100%);
}

.news-manage-main.panel {
  overflow: visible;
}

.news-manage-page {
  width: 100%;
  max-width: none;
}

.news-manage-alert {
  margin-bottom: 20px;
}

.news-manage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.news-manage-toolbar--editor {
  margin-bottom: 16px;
}

.news-manage-subhead {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.news-manage-panel--list .news-manage-subhead {
  margin-top: 4px;
}

.news-manage-table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 8, 18, 0.45);
}

.news-manage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.news-manage-table thead {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.news-manage-table th {
  padding: 14px 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  color: #9aa8cc;
  white-space: nowrap;
}

.news-manage-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
  color: var(--muted);
}

.news-manage-table tbody tr:last-child td {
  border-bottom: none;
}

.news-manage-table tbody tr:hover {
  background: rgba(119, 168, 255, 0.06);
}

.news-manage-td-title {
  color: var(--text);
  font-weight: 600;
  max-width: 320px;
}

.news-manage-td-date {
  white-space: nowrap;
  font-size: 13px;
  color: #8a9bc8;
}

.news-manage-th-actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.news-manage-td-actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.news-manage-td-actions .button,
.news-manage-td-actions .news-manage-view-btn {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-size: 12px;
  padding: 8px 12px;
  vertical-align: middle;
}

.news-manage-td-actions .news-manage-view-btn:first-child,
.news-manage-td-actions .button:first-child {
  margin-left: 0;
}

.news-manage-code {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #b8c5e8;
}

.news-manage-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.news-manage-pill--on {
  background: rgba(123, 247, 212, 0.15);
  color: #9cf0d8;
  border: 1px solid rgba(123, 247, 212, 0.28);
}

.news-manage-pill--off {
  background: rgba(255, 255, 255, 0.05);
  color: #7a869e;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.news-manage-panel--editor .news-manage-form {
  max-width: 920px;
}

.news-manage-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .news-manage-inline {
    grid-template-columns: 1fr;
  }
}

.news-manage-form.auth-form .button.primary,
.news-manage-form.auth-form .button.ghost {
  width: auto;
  min-width: 120px;
}

.news-manage-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.news-manage-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/*
 * Trix — dark toolbar & editor
 * Trix’s own CSS loads after styles.css; use .news-manage-trix-field + !important where defaults win.
 */
.news-manage-trix-field trix-toolbar {
  background: linear-gradient(180deg, rgba(16, 22, 42, 0.98), rgba(10, 14, 28, 0.99)) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 14px 14px 0 0;
  padding: 8px 10px 10px !important;
}

.news-manage-trix-field trix-toolbar .trix-button-row {
  gap: 8px;
}

.news-manage-trix-field trix-toolbar .trix-button-group {
  display: flex !important;
  margin-bottom: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-top-color: rgba(255, 255, 255, 0.16) !important;
  border-bottom-color: rgba(0, 0, 0, 0.35) !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.news-manage-trix-field trix-toolbar .trix-button {
  color: #c4d0ef !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}

.news-manage-trix-field trix-toolbar .trix-button:not(:first-child) {
  border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.news-manage-trix-field trix-toolbar .trix-button:hover:not(:disabled) {
  background: rgba(119, 168, 255, 0.14) !important;
  color: #eef2ff !important;
}

.news-manage-trix-field trix-toolbar .trix-button:focus-visible {
  outline: 2px solid rgba(123, 247, 212, 0.45);
  outline-offset: -2px;
  z-index: 1;
}

.news-manage-trix-field trix-toolbar .trix-button.trix-active {
  background: rgba(123, 247, 212, 0.18) !important;
  color: #b8f5e4 !important;
}

/* Icons are black PNG/SVG backgrounds — invert so they read on dark UI */
.news-manage-trix-field trix-toolbar .trix-button--icon::before {
  filter: invert(1) brightness(1.05) !important;
  opacity: 0.82 !important;
}

.news-manage-trix-field trix-toolbar .trix-button--icon:hover:not(:disabled)::before {
  opacity: 1 !important;
  filter: invert(1) brightness(1.15) !important;
}

.news-manage-trix-field trix-toolbar .trix-button--icon.trix-active::before {
  opacity: 1 !important;
  filter: invert(1) brightness(1.1) sepia(0.2) hue-rotate(110deg) saturate(0.9) !important;
}

.news-manage-trix-field trix-toolbar .trix-button:disabled {
  color: rgba(180, 195, 230, 0.22) !important;
  background: transparent !important;
}

.news-manage-trix-field trix-toolbar .trix-button--icon:disabled::before {
  opacity: 0.18 !important;
}

/* Link / attach dialogs */
.news-manage-trix-field .trix-dialog {
  background: linear-gradient(180deg, rgba(18, 24, 44, 0.99), rgba(12, 16, 32, 0.99)) !important;
  color: #dfe8ff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-top: 2px solid rgba(123, 247, 212, 0.35) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55) !important;
}

.news-manage-trix-field .trix-input--dialog {
  background: rgba(7, 11, 22, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: var(--text) !important;
  border-radius: 10px !important;
}

.news-manage-trix-field .trix-button--dialog {
  color: #c4d0ef !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
}

.news-manage-trix-field .trix-button--dialog:hover:not(:disabled) {
  background: rgba(119, 168, 255, 0.2) !important;
  color: #fff !important;
}

.news-manage-trix-field trix-editor {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: none;
  border-radius: 0 0 14px 14px;
  min-height: 280px;
  max-height: min(60vh, 520px);
  overflow-y: auto;
  background: rgba(7, 11, 22, 0.75);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  padding: 14px 16px;
}

.news-manage-trix-field trix-editor:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(123, 247, 212, 0.2);
}

.news-manage-trix-field trix-editor a {
  color: var(--accent);
}

.news-manage-trix-field trix-editor h1 {
  font-size: 1.5rem;
  margin: 0.5em 0;
}

.news-manage-trix-field trix-editor ul,
.news-manage-trix-field trix-editor ol {
  padding-left: 1.25em;
}

.trix-content pre {
  background-color: transparent;
  color: white;
}
/* ==========================================================================
   Community Board & Support — shared button/form primitives + CB-specific
   ========================================================================== */

/* ---- Shared buttons ------------------------------------------------------ */
.cb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.cb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cb-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #070b16;
  border-color: transparent;
}

.cb-btn-primary:hover:not(:disabled) {
  opacity: 0.88;
}

.cb-btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.12);
}

.cb-btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.cb-btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: rgba(119, 168, 255, 0.35);
}

.cb-btn-outline:hover:not(:disabled) {
  background: rgba(119, 168, 255, 0.08);
}

/* ---- Status badges ------------------------------------------------------- */
.cb-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.cb-status--open {
  background: rgba(154, 168, 214, 0.2);
  color: #d8deef;
  border-color: rgba(154, 168, 214, 0.42);
}

.cb-status--planned {
  background: rgba(154, 168, 214, 0.2);
  color: #d8deef;
  border-color: rgba(154, 168, 214, 0.3);
}

.cb-status--progress {
  background: transparent;
  color: #d9beff;
  border-color: rgba(171, 123, 247, 0.36);
}

.cb-status--implemented {
  background: transparent;
  color: var(--muted);
  border-color: rgba(154, 168, 214, 0.3);
}

.cb-status--closed {
  background: rgba(154, 168, 214, 0.2);
  color: var(--muted);
  border-color: rgba(154, 168, 214, 0.3);
}

.cb-status--other {
  background: rgba(119, 168, 255, 0.1);
  color: var(--accent);
  border-color: rgba(119, 168, 255, 0.22);
}

/* ---- Empty / error states ------------------------------------------------ */
.cb-empty {
  padding: 28px 0;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.cb-empty--error {
  color: var(--danger);
}

/* ---- Form primitives ----------------------------------------------------- */
.cb-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 16px;
}

.cb-new-form input[type="text"],
.cb-new-form textarea,
.cb-reply-form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(125, 167, 255, 0.18);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  transition: border-color 0.18s ease;
}

.cb-new-form input[type="text"]:focus,
.cb-new-form textarea:focus,
.cb-reply-form textarea:focus {
  border-color: rgba(119, 168, 255, 0.5);
}

.cb-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.cb-form-error {
  margin-top: 10px;
  font-size: 14px;
  color: var(--danger);
}

/* ---- Toolbar ------------------------------------------------------------- */
.cb-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.cb-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  flex: 1 1 420px;
  min-width: 260px;
}

.cb-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

#community-new-btn {
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.05em;
  line-height: 1;
  min-height: 0;
}

.cb-filter-chip {
  border: 1px solid rgba(125, 167, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.05em;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cb-filter-chip:hover {
  border-color: rgba(119, 168, 255, 0.4);
  color: var(--text);
}

.cb-filter-chip.is-active {
  background: rgba(119, 168, 255, 0.16);
  border-color: rgba(119, 168, 255, 0.42);
  color: var(--accent);
}

@media (max-width: 780px) {
  .cb-toolbar-actions {
    margin-left: 0;
  }
}

/* ---- New form area ------------------------------------------------------- */
.cb-new-form-area {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(125, 167, 255, 0.14);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 32px;
}

.cb-form-title {
  margin: 0 0 4px;
  font-size: 17px;
}

/* ---- Community Board compact table -------------------------------------- */
.cb-list {
  margin-bottom: 28px;
}

.cb-table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(119, 168, 255, 0.45) rgba(255, 255, 255, 0.06);
}

.cb-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.cb-table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.cb-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(119, 168, 255, 0.45);
  border-radius: 999px;
  border: 2px solid rgba(8, 18, 44, 0.65);
}

.cb-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(119, 168, 255, 0.62);
}

.cb-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  table-layout: auto;
}

.cb-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cb-table tbody td {
  padding: 11px 14px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.cb-table tbody tr:last-child td {
  border-bottom: none;
}

.cb-table-row:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Subtle row tinting by status for quick scanning. */
.cb-table-row.cb-row--open td {
  background: rgba(154, 168, 214, 0.05);
}

.cb-table-row.cb-row--planned td {
  background: rgba(154, 168, 214, 0.05);
}

.cb-table-row.cb-row--pending td {
  background: transparent;
}

.cb-table-row.cb-row--implemented td {
  background: rgba(154, 168, 214, 0.05);
  filter: opacity(0.5);
}

.cb-table-row.cb-row--closed td {
  background: rgba(154, 168, 214, 0.05);
  filter: opacity(0.5);
}

.cb-table-row.cb-row--implemented td,
.cb-table-row.cb-row--implemented td *,
.cb-table-row.cb-row--closed td,
.cb-table-row.cb-row--closed td * {
  text-decoration: line-through;
  color: var(--muted);
}

.cb-col-status {
  width: 1%;
  white-space: nowrap;
}
.cb-col-title { width: auto; }
.cb-col-author {
  width: 1%;
  white-space: nowrap;
  color: var(--muted);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-col-date {
  width: 1%;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cb-topic-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.cb-topic-link-text {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cb-topic-link:hover {
  color: var(--accent);
}

/* Keep card primitives for thread loading placeholders. */
.cb-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.cb-card-body {
  flex: 1;
  min-width: 0;
}

.cb-card-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ---- Skeleton shimmer ---------------------------------------------------- */
@keyframes cb-shimmer {
  0%   { background-position: 120% 0; }
  100% { background-position: -20% 0; }
}

.cb-skeleton {
  display: block;
  border-radius: 8px;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.1) 45%,
    rgba(255, 255, 255, 0.04) 90%
  );
  background-size: 200% 100%;
  animation: cb-shimmer 1.35s ease-in-out infinite;
}

.cb-skeleton--title  { height: 18px; width: 60%; margin-bottom: 10px; }
.cb-skeleton--meta   { height: 12px; width: 35%; }
.cb-skeleton--badge  { height: 28px; width: 52px; border-radius: 999px; }
.cb-skeleton--table-title { height: 14px; width: 90%; }
.cb-skeleton--table-sm { height: 12px; width: 70%; }
.cb-skeleton--table-xs { height: 12px; width: 28px; margin: 0 auto; }

.cb-card--skeleton { pointer-events: none; cursor: default; }
.cb-card--skeleton:hover { border-color: rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.03); }

@media (prefers-reduced-motion: reduce) {
  .cb-skeleton { animation: none; background: rgba(255, 255, 255, 0.07); }
}

/* ---- Pagination ---------------------------------------------------------- */
.cb-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 0 4px;
}

.cb-page-label {
  font-size: 13px;
  color: var(--muted);
  min-width: 56px;
  text-align: center;
}

/* ---- Breadcrumb ---------------------------------------------------------- */
.cb-breadcrumb {
  margin-bottom: 20px;
}

.cb-breadcrumb a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.cb-breadcrumb a:hover { color: var(--accent); }

/* ---- Thread header ------------------------------------------------------- */
.cb-thread-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cb-thread-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 10px;
  line-height: 1.25;
}

.cb-thread-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.cb-thread-author strong { color: var(--text); }

/* ---- Messages ------------------------------------------------------------ */
.cb-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 6px 20px 20px 2px;
  margin-right: -4px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(119, 168, 255, 0.42) rgba(255, 255, 255, 0.05);
}

.cb-messages::-webkit-scrollbar {
  width: 10px;
}

.cb-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.cb-messages::-webkit-scrollbar-thumb {
  background: rgba(119, 168, 255, 0.42);
  border-radius: 999px;
  border: 2px solid rgba(8, 18, 44, 0.65);
}

.cb-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(119, 168, 255, 0.62);
}

.cb-message {
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  width: calc(100%);
  max-width: calc(100%);
  box-sizing: border-box;
}

.cb-message--op {
  border-color: rgba(125, 167, 255, 0.2);
  background: rgba(119, 168, 255, 0.05);
}

.cb-message--other {
  align-self: flex-start;
  margin-right: 28px;
}

.cb-message--mine {
  align-self: flex-end;
  margin-left: 28px;
  background: rgba(119, 168, 255, 0.08);
  border-color: rgba(119, 168, 255, 0.22);
}

.cb-message-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.cb-message-author {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}

.cb-message-date {
  font-size: 12px;
  color: var(--muted);
}

.cb-message-body {
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- Reply form ---------------------------------------------------------- */
.cb-reply-form {
  margin-top: 8px;
}

.cb-reply-form textarea {
  min-height: 100px;
  margin-top: 0;
}

/* ---- Login prompt -------------------------------------------------------- */
.cb-login-prompt {
  font-size: 14px;
  color: var(--muted);
  padding: 14px 0;
}

.cb-login-prompt a {
  color: var(--accent);
  text-decoration: none;
}

.cb-login-prompt a:hover { text-decoration: underline; }

/* ---- Support tickets (reuse cb primitives) ------------------------------- */
.support-list { display: flex; flex-direction: column; gap: 10px; }

.support-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.support-list-item:hover {
  border-color: rgba(125, 167, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.support-item-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.status-open    { background: rgba(123, 247, 212, 0.1); color: var(--accent-2); border: 1px solid rgba(123, 247, 212, 0.25); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.status-progress{ background: rgba(255, 193, 100, 0.1); color: #ffc164; border: 1px solid rgba(255, 193, 100, 0.25); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.status-closed  { background: rgba(154, 168, 214, 0.08); color: var(--muted); border: 1px solid rgba(154, 168, 214, 0.18); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.status-other   { background: rgba(119, 168, 255, 0.1); color: var(--accent); border: 1px solid rgba(119, 168, 255, 0.22); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

.support-new-form input[type="text"],
.support-new-form textarea,
.support-reply-form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(125, 167, 255, 0.18);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  display: block;
  margin-bottom: 10px;
  transition: border-color 0.18s ease;
}

.support-new-form input[type="text"]:focus,
.support-new-form textarea:focus,
.support-reply-form textarea:focus {
  border-color: rgba(119, 168, 255, 0.5);
}

.support-toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.form-error {
  font-size: 14px;
  color: var(--danger);
  margin-top: 8px;
}

.loading-text { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }

.support-error { color: var(--danger); font-size: 15px; padding: 20px 0; }

.support-empty { color: var(--muted); font-size: 15px; padding: 20px 0; }

.breadcrumb { margin-bottom: 18px; }
.breadcrumb a { font-size: 14px; color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.support-thread-header { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.support-thread-title { font-size: 24px; font-weight: 800; margin: 0 0 8px; }
.support-thread-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 14px; color: var(--muted); }
.support-designee { font-size: 12px; color: var(--muted); background: rgba(255,255,255,0.05); border-radius: 8px; padding: 3px 9px; }

.support-messages { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

.support-message {
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.support-message--first {
  border-color: rgba(125,167,255,0.18);
  background: rgba(119,168,255,0.04);
}

.support-message-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; }
.support-message-meta strong { color: var(--accent); font-size: 14px; }
.support-message-date { font-size: 12px; color: var(--muted); }
.support-message-body { font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

.support-reply-form textarea { min-height: 90px; }

/* Responsive */
@media (max-width: 600px) {
  .cb-table thead th:nth-child(3),
  .cb-table tbody td:nth-child(3),
  .cb-table thead th:nth-child(4),
  .cb-table tbody td:nth-child(4) {
    display: none;
  }
  .cb-table thead th,
  .cb-table tbody td {
    padding: 10px 10px;
    font-size: 13px;
  }
  .cb-thread-title { font-size: 20px; }
}

/* ---- cb-label optional hint --------------------------------------------- */
.cb-label-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

/* ---- Ticket manage admin page -------------------------------------------- */
.tm-filter-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(125, 167, 255, 0.2);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 9px 14px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.18s ease;
}

.tm-filter-select:focus {
  border-color: rgba(119, 168, 255, 0.5);
}

.tm-filter-select option {
  background: #0d1630;
}

.tm-item {
  gap: 14px;
}

.tm-item-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 40px;
  flex-shrink: 0;
}

.tm-item-body {
  flex: 1;
  min-width: 0;
}

/* ── Trix editor — on-brand skin (community board & tickets) ─────────────── */

/* Outer wrapper: just provides the overall border + clip */
.cb-trix-field {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  overflow: hidden;
}

/* Toolbar gradient background + top rounding */
.cb-trix-field trix-toolbar {
  background: linear-gradient(180deg, rgba(16, 22, 42, 0.98), rgba(10, 14, 28, 0.99)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 8px 10px 10px !important;
}

/* Each button group becomes a pill */
.cb-trix-field trix-toolbar .trix-button-row {
  gap: 8px;
}

.cb-trix-field trix-toolbar .trix-button-group {
  display: flex !important;
  margin-bottom: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-top-color: rgba(255, 255, 255, 0.16) !important;
  border-bottom-color: rgba(0, 0, 0, 0.35) !important;
  border-radius: 10px !important;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cb-trix-field trix-toolbar .trix-button {
  color: #c4d0ef !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}

.cb-trix-field trix-toolbar .trix-button:not(:first-child) {
  border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.cb-trix-field trix-toolbar .trix-button:hover:not(:disabled) {
  background: rgba(119, 168, 255, 0.14) !important;
  color: #eef2ff !important;
}

.cb-trix-field trix-toolbar .trix-button:focus-visible {
  outline: 2px solid rgba(124, 140, 255, 0.45);
  outline-offset: -2px;
  z-index: 1;
}

.cb-trix-field trix-toolbar .trix-button.trix-active {
  background: rgba(124, 140, 255, 0.2) !important;
  color: #c5ccff !important;
}

/* Invert the black SVG icon masks so they read on dark background */
.cb-trix-field trix-toolbar .trix-button--icon::before {
  filter: invert(1) brightness(1.05) !important;
  opacity: 0.82 !important;
}

.cb-trix-field trix-toolbar .trix-button--icon:hover:not(:disabled)::before {
  opacity: 1 !important;
  filter: invert(1) brightness(1.15) !important;
}

.cb-trix-field trix-toolbar .trix-button--icon.trix-active::before {
  opacity: 1 !important;
  filter: invert(1) brightness(1.1) sepia(0.2) hue-rotate(215deg) saturate(1.2) !important;
}

.cb-trix-field trix-toolbar .trix-button:disabled {
  color: rgba(180, 195, 230, 0.22) !important;
  background: transparent !important;
}

.cb-trix-field trix-toolbar .trix-button--icon:disabled::before {
  opacity: 0.18 !important;
}

/* Link / attach dialogs */
.cb-trix-field .trix-dialog {
  background: linear-gradient(180deg, rgba(18, 24, 44, 0.99), rgba(12, 16, 32, 0.99)) !important;
  color: #dfe8ff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-top: 2px solid rgba(124, 140, 255, 0.35) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55) !important;
}

.cb-trix-field .trix-input--dialog {
  background: rgba(7, 11, 22, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: var(--text) !important;
  border-radius: 10px !important;
}

.cb-trix-field .trix-button--dialog {
  color: #c4d0ef !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
}

.cb-trix-field .trix-button--dialog:hover:not(:disabled) {
  background: rgba(119, 168, 255, 0.2) !important;
  color: #fff !important;
}

/* Editor area */
.cb-trix-field trix-editor {
  background: rgba(7, 11, 22, 0.75) !important;
  color: var(--text, #e8eaf2) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  padding: 12px 16px !important;
  min-height: 120px;
  border: none !important;
  border-radius: 0 !important;
  caret-color: var(--accent, #7c8cff);
  outline: none !important;
}

.cb-trix-field trix-editor:focus {
  background: rgba(5, 8, 18, 0.88) !important;
}

/* rendered message HTML (trix-content baseline) */
.cb-message-body.trix-content,
.support-message-body.trix-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text, #e8eaf2);
  word-break: break-word;
}
.cb-message-body.trix-content p,
.support-message-body.trix-content p { margin: 0 0 .5em; }
.cb-message-body.trix-content p:last-child,
.support-message-body.trix-content p:last-child { margin-bottom: 0; }
.cb-message-body.trix-content a,
.support-message-body.trix-content a {
  color: var(--accent, #7c8cff);
  text-decoration: underline;
}
.cb-message-body.trix-content pre,
.support-message-body.trix-content pre {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  font-size: 13px;
}
.cb-message-body.trix-content blockquote,
.support-message-body.trix-content blockquote {
  border-left: 3px solid var(--accent, #7c8cff);
  margin: 8px 0;
  padding-left: 12px;
  color: var(--muted, #8892b0);
}

/* ── Admin status panel (injected into thread views for administrators) ───── */
.cb-admin-panel {
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.cb-admin-panel-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(255, 160, 50, 0.06);
  border: 1px solid rgba(255, 160, 50, 0.2);
  border-radius: 10px;
  padding: 10px 14px;
}

.cb-admin-panel-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 180, 80, 0.85);
  flex-shrink: 0;
}

.cb-admin-panel-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted, #8892b0);
}

.cb-admin-status-select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: var(--text, #e8eaf2);
  font-size: 13px;
  padding: 4px 8px;
  cursor: pointer;
}

.cb-admin-status-select:focus {
  outline: none;
  border-color: rgba(255, 180, 80, 0.5);
}

.cb-btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.cb-admin-panel-msg {
  font-size: 12px;
}

.cb-admin-panel-msg--ok  { color: #6ee7b7; }
.cb-admin-panel-msg--err { color: #f87171; }

/* ---- Invoice manage admin page ------------------------------------------ */
.page-wrap:has(.invoices-panel) {
  max-width: min(1500px, calc(100vw - 24px));
}

.invoices-panel .main-inner {
  padding: clamp(20px, 3vw, 40px);
}

.im-table-wrap {
  margin-top: 14px;
  width: 100%;
  padding-bottom: 8px;
}

.im-table {
  min-width: 1240px;
  table-layout: fixed;
}

.im-table th,
.im-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.im-table th:first-child,
.im-table td:first-child {
  width: 40px;
  text-align: center;
}

.im-table th:nth-child(2),
.im-table td:nth-child(2) {
  width: 230px;
}

.im-table th:nth-child(3),
.im-table td:nth-child(3),
.im-table th:nth-child(4),
.im-table td:nth-child(4) {
  width: 130px;
}

.im-table th:nth-child(5),
.im-table td:nth-child(5) {
  width: 210px;
}

.im-table th:nth-child(6),
.im-table td:nth-child(6) {
  width: 125px;
}

.im-table th:nth-child(7),
.im-table td:nth-child(7) {
  width: 110px;
}

.im-table th:nth-child(8),
.im-table td:nth-child(8) {
  width: 110px;
}

.im-table th:nth-child(9),
.im-table td:nth-child(9) {
  width: 132px;
  text-align: right;
  position: sticky;
  right: 0;
  z-index: 1;
  background: rgba(14, 22, 43, 0.98);
  box-shadow: -12px 0 18px rgba(7, 11, 22, 0.28);
}

.im-table th:nth-child(9) {
  z-index: 2;
}

.im-table small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.im-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(125, 167, 255, 0.18);
  background: rgba(125, 167, 255, 0.1);
  color: #cfe0ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.im-status-none,
.im-status-processando,
.im-status-pending {
  background: rgba(125, 167, 255, 0.12);
  color: #bcd2ff;
}

.im-status-authorized {
  background: rgba(46, 213, 115, 0.14);
  border-color: rgba(46, 213, 115, 0.28);
  color: #8ff2b1;
}

.im-status-error,
.im-status-denied {
  background: rgba(255, 107, 129, 0.14);
  border-color: rgba(255, 107, 129, 0.28);
  color: #ff9dad;
}

.im-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.im-action-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #070b16;
}

.im-action-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}
