/* Sacralib V2.23 — targeted corrections for owner-only V2 article and patch notes.
   Keep genuine game data and background images, no global scale or app.js changes. */

/* A generated content-column can contain only an isolated item. Do not let its
   height equal the tallest item in the parent row. */
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body,
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .content-column {
  align-content:start!important;
  grid-auto-rows:max-content;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .content-columns:has(.quest-block),
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .content-columns:has(.quest-v2-card) {
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  align-items:start!important;
  gap:14px!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .content-columns:has(.quest-block) > .content-column,
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .content-columns:has(.quest-v2-card) > .content-column {
  align-self:start!important;height:auto!important;min-height:0!important;display:block!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .quest-block.quest-v2-block {
  margin:4px 0 12px!important;padding:clamp(12px,1.4vw,19px)!important;
  height:auto!important;min-height:0!important;align-self:start!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .quest-block.quest-v2-block > .quest-grid {
  grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:max-content!important;
  align-content:start!important;gap:12px!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .quest-v2-card {
  align-self:start!important;height:auto!important;min-height:0!important;
}

/* Images on combo cards use a background-image on an EMPTY div. V2.22 set
   height:auto, collapsing the background to a line. Reserve square dimensions. */
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .database-card-type-combo {
  grid-template-columns:64px minmax(0,1fr)!important;
  gap:9px!important;padding:11px!important;
  align-content:start!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .database-card-type-combo > .database-card-image {
  box-sizing:border-box!important;display:block!important;grid-column:1!important;grid-row:1!important;
  width:58px!important;height:58px!important;min-width:58px!important;min-height:58px!important;
  max-width:58px!important;max-height:58px!important;
  background-repeat:no-repeat!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .database-card-type-combo > .database-card-content {
  grid-column:2!important;grid-row:1!important;min-width:0!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .database-card-type-combo .database-card-lines {
  grid-column:1/-1!important;grid-row:auto!important;
}
/* A run of individually authored 3-item columns is collected by an isolated
   helper, so the rows contain two abilities rather than repeated 2+1 islands. */
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .sv223-ability-collection {
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px!important;min-width:0!important;max-width:100%!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .sv223-ability-collection > .content-columns {
  display:contents!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .sv223-ability-collection .content-column {
  display:block!important;width:auto!important;min-width:0!important;
  height:auto!important;align-self:start!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .sv223-ability-collection .database-card-type-abilities {
  height:auto!important;min-height:0!important;align-self:start!important;
}

/* Portrait cards. A narrow 150px portrait+text structure *inside each of two
   outer columns* was making a Russian word appear one character per line.
   Give detailed monster/Chaos dossiers a full row and a normal text column. */
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.bestiary-masonry,.bestiary-filter-results,.chaos-article-masonry,.content-columns:has(.database-card-monster),.content-columns:has(.database-card-type-monsters)) {
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  align-content:start!important;align-items:start!important;gap:14px!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.bestiary-masonry-item,.bestiary-filter-result,.content-column:has(.database-card-monster),.content-column:has(.database-card-type-monsters)) {
  min-width:0!important;max-width:100%!important;height:auto!important;align-self:start!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.database-card-monster,.database-card-type-monsters) {
  display:grid!important;grid-template-columns:minmax(120px,190px) minmax(0,1fr)!important;
  grid-auto-rows:max-content!important;align-content:start!important;
  min-width:0!important;width:100%!important;height:auto!important;gap:12px!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.database-card-monster,.database-card-type-monsters) > .database-card-image {
  grid-column:1!important;grid-row:1!important;
  width:100%!important;height:clamp(190px,27vw,315px)!important;
  max-height:315px!important;min-height:180px!important;
  background-position:center center!important;background-size:contain!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.database-card-monster,.database-card-type-monsters) > .database-card-content {
  grid-column:2!important;grid-row:1!important;min-width:0!important;
  width:100%!important;max-width:100%!important;overflow:visible!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.database-card-monster,.database-card-type-monsters) .database-card-lines {
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  min-width:0!important;width:100%!important;max-width:100%!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.database-card-monster,.database-card-type-monsters) .database-card-lines > div {
  box-sizing:border-box!important;display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;gap:2px!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
  overflow:visible!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.database-card-monster,.database-card-type-monsters) :is(.database-card-lines,.database-card-lines-side,.database-card-monster-bottom)
:is(b,span) {
  min-width:0!important;max-width:100%!important;white-space:normal!important;
  overflow-wrap:break-word!important;word-break:normal!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.database-card-monster,.database-card-type-monsters) > .database-card-monster-bottom {
  grid-column:1/-1!important;grid-row:auto!important;width:100%!important;
  min-width:0!important;max-width:100%!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.database-card-monster,.database-card-type-monsters) .database-card-lines-side {
  grid-template-columns:minmax(0,1fr)!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
:is(.database-card-monster,.database-card-type-monsters) .database-card-monster-bottom > div {
  box-sizing:border-box!important;grid-template-columns:minmax(0,1fr)!important;
  min-width:0!important;width:100%!important;
}

/* Appearance cards can remain two-up when wide enough, but the portrait must
   not push the metadata into a fixed narrow nested cell. */
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
.content-columns:has(.database-card-appearance) {
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,430px),1fr))!important;
  gap:13px!important;align-items:start!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
.database-card-appearance {
  display:grid!important;grid-template-columns:minmax(105px,145px) minmax(0,1fr)!important;
  gap:11px!important;width:100%!important;min-width:0!important;
  height:auto!important;align-self:start!important;align-content:start!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
.database-card-appearance > .database-card-image {
  grid-column:1!important;grid-row:1!important;width:100%!important;
  height:clamp(155px,20vw,270px)!important;background-size:contain!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
.database-card-appearance > .database-card-content {
  grid-column:2!important;grid-row:1!important;
  min-width:0!important;width:100%!important;max-width:100%!important;overflow:visible!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
.database-card-appearance .database-card-lines > div {
  box-sizing:border-box!important;display:block!important;width:100%!important;
  max-width:100%!important;min-width:0!important;overflow:visible!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body
.database-card-appearance .database-card-lines > div > :is(b,span) {
  display:block!important;min-width:0!important;max-width:100%!important;
  white-space:normal!important;overflow-wrap:break-word!important;word-break:normal!important;
}

/* FAQ: use available space for group headings and show full text (never ellipsis). */
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body:has(.faq-list)
:is(.content-callout,.faq-list,.faq-section,.faq-category,.content-columns:has(.faq-list)) {
  box-sizing:border-box!important;max-width:100%!important;width:100%!important;min-width:0!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body:has(.faq-list)
.content-columns:has(.faq-list) {grid-template-columns:minmax(0,1fr)!important;}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body:has(.faq-list)
:is(h2,h3,h4,.faq-item summary) {
  max-width:100%!important;min-width:0!important;overflow:visible!important;
  text-overflow:clip!important;white-space:normal!important;
  overflow-wrap:normal!important;word-break:normal!important;
}
body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body:has(.faq-list)
:is(.faq-section,.faq-category) > :is(h2,h3,h4) {
  box-sizing:border-box!important;width:100%!important;
  font-size:clamp(15px,1.2vw,21px)!important;
}

/* Patchnotes are rendered as a true 3-column article shell, NOT a full-width
   stretched feed. All existing search, filter and Telegram links stay alive. */
body.sv218-page-theme #patch-notesView.active .sv223-patch-layout {
  box-sizing:border-box!important;display:grid!important;
  grid-template-columns:minmax(188px,220px) minmax(0,1fr) minmax(195px,235px)!important;
  gap:12px!important;max-width:1540px!important;margin:0 auto!important;
  align-items:start!important;min-width:0!important;
}
body.sv218-page-theme #patch-notesView.active .sv223-patch-main,
body.sv218-page-theme #patch-notesView.active .sv223-patch-side {min-width:0!important;}
body.sv218-page-theme #patch-notesView.active .sv223-patch-side {
  padding:13px!important;border:1px solid #d2bfa4!important;
  background:linear-gradient(145deg,#fffaf1,#f3e9d7)!important;
  box-shadow:0 2px 9px #3a261412!important;
}
body.sv218-page-theme #patch-notesView.active .sv223-patch-side h3 {
  margin:0 0 11px!important;padding-bottom:9px!important;
  border-bottom:1px solid #decbb0!important;color:#4a3124!important;
  font:700 16px/1.3 Georgia,serif!important;
}
body.sv218-page-theme #patch-notesView.active .sv223-patch-side a {
  display:block!important;padding:7px 5px!important;border-bottom:1px solid #e3d4c0!important;
  text-decoration:none!important;color:#69472f!important;
  font:14px/1.3 Georgia,serif!important;overflow-wrap:break-word!important;
}
body.sv218-page-theme #patch-notesView.active .sv223-patch-main > .patch-notes-page {
  box-sizing:border-box!important;width:100%!important;max-width:100%!important;
  margin:0!important;padding:0!important;
}
body.sv218-page-theme #patch-notesView.active .sv223-patch-main .patch-note-card,
body.sv218-page-theme #patch-notesView.active .sv223-patch-main .patch-notes-hero,
body.sv218-page-theme #patch-notesView.active .sv223-patch-main .patch-notes-controls {
  border-radius:4px!important;border:1px solid #d1bfa3!important;
  background:linear-gradient(150deg,#fffaf2,#f4ebdc)!important;
}
body.sv218-page-theme #patch-notesView.active .sv223-patch-main .patch-note-point-number {
  border-radius:4px!important;background:#f5ebd9!important;
  border:1px solid #d2b68e!important;color:#7c352b!important;
}
body.sv218-page-theme #patch-notesView.active .sv223-patch-number-row {
  display:grid!important;grid-template-columns:29px minmax(0,1fr)!important;
  align-items:start!important;gap:9px!important;
  margin:0!important;padding:7px 0!important;border-bottom:1px solid #e6d9c5!important;
}
body.sv218-page-theme #patch-notesView.active .sv223-patch-number-row .patch-note-paragraph {
  margin:0!important;padding:0!important;min-width:0!important;
}
body.sv218-page-theme #patch-notesView.active .sv223-patch-number-row .sv223-patch-number {
  display:inline-grid;place-items:center;width:27px;height:27px;border-radius:4px;
  border:1px solid #c9a886;background:#f5ecdf;color:#763c30;
  font:600 12px/1 Georgia,serif;
}
@media(max-width:1250px){
 body.sv218-page-theme #patch-notesView.active .sv223-patch-layout {
   grid-template-columns:minmax(172px,205px) minmax(0,1fr)!important;
 }
 body.sv218-page-theme #patch-notesView.active .sv223-patch-right {grid-column:2!important;}
}
@media(max-width:820px){
 body.sv218-page-theme #patch-notesView.active .sv223-patch-layout {grid-template-columns:minmax(0,1fr)!important;}
 body.sv218-page-theme #patch-notesView.active .sv223-patch-main {grid-column:1!important;grid-row:1!important;}
 body.sv218-page-theme #patch-notesView.active :is(.sv223-patch-left,.sv223-patch-right) {grid-column:1!important;grid-row:auto!important;}
 body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .sv223-ability-collection {grid-template-columns:minmax(0,1fr)!important;}
 body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body :is(.database-card-monster,.database-card-type-monsters) {
   grid-template-columns:minmax(0,1fr)!important;
 }
 body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body :is(.database-card-monster,.database-card-type-monsters) > .database-card-image {
   grid-column:1!important;grid-row:1!important;width:min(100%,220px)!important;
 }
 body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body :is(.database-card-monster,.database-card-type-monsters) > .database-card-content {
   grid-column:1!important;grid-row:2!important;
 }
 body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .database-card-appearance {
   grid-template-columns:minmax(0,1fr)!important;
 }
 body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .database-card-appearance > .database-card-image {
   grid-column:1!important;grid-row:1!important;width:min(100%,180px)!important;
 }
 body.sv218-page-theme.codex-article-v2-active .cv2-layout .article-body .database-card-appearance > .database-card-content {
   grid-column:1!important;grid-row:2!important;
 }
}
