.news-richtext {
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.news-richtext > :first-child { margin-top: 0; }
.news-richtext > :last-child { margin-bottom: 0; }
.news-richtext :is(p, ul, ol, pre, blockquote, .news-table-scroll) { margin: 0 0 0.9rem; }
.news-richtext :is(ul, ol) { padding-left: 1.5rem; }
.news-richtext li > :is(ul, ol) { margin: 0.25rem 0; }
.news-richtext :is(h3, h4, h5, h6) {
  margin: 1.4rem 0 0.65rem;
  color: #e5edfc;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.4;
}
.news-richtext blockquote {
  padding: 0.65rem 1rem;
  border-left: 3px solid #87b5dc;
  background: rgba(135, 181, 220, 0.07);
  color: #c9d8ec;
}
.news-richtext blockquote > :last-child { margin-bottom: 0; }
.news-richtext pre {
  padding: 0.8rem 1rem;
  border: 1px solid rgba(158, 185, 221, 0.2);
  border-radius: 8px;
  background: #080f20;
  color: #d6e6fb;
  white-space: pre;
  overflow-x: auto;
}
.news-richtext code { color: #d6e6fb; }
.news-richtext :not(pre) > code {
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: rgba(158, 185, 221, 0.12);
}
.news-richtext a { color: #9bd5fa; text-underline-offset: 0.15em; }
.news-richtext a:hover { color: #fff; }
.news-richtext a[target="_blank"]::after { content: " ↗"; font-size: 0.8em; }
.news-table-scroll { overflow-x: auto; max-width: 100%; }
.news-richtext .wikitable { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.news-richtext .wikitable :is(th, td) {
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(158, 185, 221, 0.25);
  text-align: left;
  vertical-align: top;
  min-width: 6rem;
}
.news-richtext .wikitable th { background: rgba(135, 181, 220, 0.14); color: #e5edfc; }
.news-richtext .wikitable tr:nth-child(even) { background: rgba(135, 181, 220, 0.04); }
.news-richtext caption { caption-side: top; color: inherit; }

.news-wiki-editor {
  margin: 0.5rem 0 1.5rem;
  padding: clamp(0.8rem, 2vw, 1.25rem);
  border: 1px solid rgba(158, 185, 221, 0.2);
  border-radius: 12px;
  background: rgba(8, 19, 40, 0.5);
}
.news-wiki-toolbar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.news-wiki-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1rem;
}
.news-wiki-toolbar .btn { color: #c3d4ed; border-color: rgba(158, 185, 221, 0.4); }
.news-wiki-toolbar .btn:hover { color: #fff; background: rgba(135, 181, 220, 0.18); }
.news-wiki-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.news-wiki-columns > div { min-width: 0; }
.news-wiki-source {
  height: 30rem;
  min-height: 24rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.65;
  tab-size: 2;
}
.news-wiki-preview {
  height: 30rem;
  min-height: 24rem;
  max-height: 42rem;
  padding: 1rem;
  overflow: auto;
  border: 1px solid rgba(158, 185, 221, 0.2);
  border-radius: 6px;
  background: #0b1b3a;
  color: #bdcce3;
}
.news-wiki-help { margin-top: 0.8rem; color: #aabbd5; font-size: 0.9rem; }
.news-wiki-help summary { cursor: pointer; padding: 0.3rem 0; }
.news-wiki-help pre { margin: 0.75rem 0; white-space: pre-wrap; color: #cad8ec; }
.news-wiki-migration-hint { margin-bottom: 0.8rem; color: #b9d8f4; font-size: 0.9rem; }
.news-platform-picker { width: 100%; }
.js-news-platform[hidden] { display: none; }
.news-platform-toggle { display: flex; align-items: center; gap: 0.65rem; text-align: left; padding-right: 2.25rem; }
.news-platform-glyph { display: inline-flex; flex: 0 0 1.25rem; width: 1.25rem; align-items: center; justify-content: center; }
.news-platform-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-platform-menu { width: 100%; min-width: 0; max-height: min(22rem, 60vh); overflow-y: auto; padding: 0.35rem; border-color: rgba(158, 185, 221, 0.35); background: #0b1b3a; }
.news-platform-menu .dropdown-item { display: flex; align-items: center; gap: 0.65rem; min-height: 36px; padding: 0.5rem 0.65rem; border-radius: 4px; color: #c3d4ed; }
.news-platform-menu .dropdown-item:is(:hover, :focus, .active) { color: #fff; background: rgba(135, 181, 220, 0.2); }
.news-platform-toggle:focus-visible { outline: 2px solid #a7d8f5; outline-offset: 2px; }
@media (max-width: 1199px) {
  .news-wiki-columns { grid-template-columns: minmax(0, 1fr); }
  .news-wiki-source, .news-wiki-preview { height: 24rem; min-height: 16rem; }
}

.admin-news-overview { padding-bottom: 2rem; }
.admin-news-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.5rem 0 1.5rem; }
.admin-news-heading h1 { margin: 0 0 0.45rem; font-size: clamp(1.65rem, 3vw, 2rem); }
.admin-news-counts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; color: #acbdd6; font-size: 0.9rem; }
.admin-news-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 0.8rem; padding: 1rem; margin-bottom: 1.75rem; background: #0b172c; border: 1px solid rgba(158, 185, 221, 0.18); border-radius: 12px; }
.admin-news-filters[hidden], .admin-news-overview [hidden] { display: none; }
.admin-news-search { flex: 1 1 15rem; }
.admin-news-filters .form-label { font-size: 0.85rem; color: #b9c9df; }
.admin-news-month { margin-bottom: 1.75rem; }
.admin-news-month-heading { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.8rem; padding-bottom: 0.6rem; border-bottom: 1px solid rgba(158, 185, 221, 0.15); }
.admin-news-month-heading h2 { margin: 0; font-size: 1.15rem; color: #dae6f7; }
.admin-news-month-heading > span { color: #9cafc9; font-size: 0.8rem; }
.admin-news-cards { display: grid; gap: 0.85rem; }
.admin-news-card { min-width: 0; padding: 1.15rem 1.25rem; border: 1px solid rgba(158, 185, 221, 0.2); border-radius: 12px; background: #0b1b36; }
.admin-news-card-header { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr) auto; grid-template-areas: "meta title actions"; align-items: center; gap: 1.25rem; }
.admin-news-card-main { grid-area: title; min-width: 0; }
.admin-news-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; color: #aabdd8; font-size: 0.8rem; }
.admin-news-status { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.5rem; border-radius: 6px; }
.admin-news-status.is-visible { color: #a4e3cc; background: rgba(85, 185, 143, 0.12); }
.admin-news-status.is-hidden { color: #bac8dc; background: rgba(158, 185, 221, 0.1); }
.admin-news-language { font-size: 0.7rem; letter-spacing: 0.04em; color: #aabdd8; }
.admin-news-card-main h3 { margin: 0; font-size: 1.05rem; line-height: 1.5; overflow-wrap: anywhere; }
.admin-news-card-main h3 a { color: #e8effc; text-decoration: none; }
.admin-news-card-main h3 a:hover { color: #b7ddff; text-decoration: underline; }
.admin-news-actions { grid-area: actions; display: flex; gap: 0.45rem; align-items: center; }
.admin-news-actions form { margin: 0; }
.admin-news-actions .btn { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.admin-news-actions .admin-news-edit { background: rgba(125, 177, 232, 0.14); border: 1px solid rgba(125, 177, 232, 0.35); color: #c5e2ff; }
.admin-news-actions .btn-outline-secondary { color: #b7c9df; border-color: rgba(158, 185, 221, 0.3); }
.admin-news-actions .admin-news-delete { color: #e5a5ad; border: 1px solid rgba(220, 118, 134, 0.2); }
.admin-news-actions .admin-news-delete:hover { color: #fff; background: #823340; }
.admin-news-links { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.admin-news-links a { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: #a9c7e8; border: 1px solid rgba(158, 185, 221, 0.2); border-radius: 7px; }
.admin-news-preview { margin-top: 0.85rem; border-top: 1px solid rgba(158, 185, 221, 0.12); }
.admin-news-preview summary { display: flex; align-items: center; gap: 0.5rem; width: fit-content; padding-top: 0.8rem; color: #a6c9ec; cursor: pointer; font-size: 0.85rem; list-style: none; }
.admin-news-preview summary::-webkit-details-marker { display: none; }
.admin-news-preview summary :is(i, svg) { font-size: 0.65rem; transition: transform 0.2s ease; }
.admin-news-preview[open] summary :is(i, svg) { transform: rotate(90deg); }
.admin-news-preview .news-richtext { margin-top: 1rem; padding-top: 0.5rem; color: #bdcce3; }
.admin-news-no-text { margin: 0.8rem 0 0; font-size: 0.85rem; color: #aabdd8; }
.admin-news-empty { padding: 2rem 1.25rem; text-align: center; border: 1px dashed rgba(158, 185, 221, 0.25); border-radius: 12px; color: #b9c9df; }
.admin-news-empty p { margin: 0 0 0.4rem; }
.admin-news-overview :is(a, button, summary):focus-visible { outline: 2px solid #a7d8f5; outline-offset: 3px; }
@media (max-width: 767px) {
  .admin-news-card-header { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "meta actions" "title title"; gap: 0.8rem; }
}
@media (max-width: 575px) {
  .admin-news-card { padding: 1rem; }
  .admin-news-filters > div { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-news-preview summary :is(i, svg) { transition: none; }
}
