/* Compact technique grade banners: emblem, title, description, divider. */
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
  padding: 18px 22px !important;
}
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading > .col:first-child {
  flex: 0 0 clamp(86px, 13vw, 150px);
  max-width: none !important;
}
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading > .col:last-child {
  flex: 1 1 0;
  min-width: 0;
  max-width: none !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid #b8b8b84d;
}
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading img {
  width: 100% !important;
  height: auto !important;
  border: 0 !important;
}
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading h2 {
  margin: 0 !important;
  font-size: clamp(25px, 3.1vw, 40px) !important;
  text-align: left !important;
  line-height: 1.15;
  white-space: normal !important;
}
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading p {
  margin: 3px 0 0 !important;
  padding: 0 !important;
  font-size: 15px !important;
  line-height: 1.45;
  text-align: left !important;
}
/* Keep the name and smaller grey cost together, with just one rule below. */
body.pm-layout-ready .pm-technique-column .pm-compact-choice > .d-column > .w-100 > h3::after {
  display: none;
}
body.pm-layout-ready .pm-technique-column .pm-compact-choice > .d-column > .w-100 > h3 {
  padding-bottom: 0 !important;
  border-bottom: 0 !important;
}
body.pm-layout-ready .pm-technique-column .pm-compact-choice > .d-column > .w-100 > .row:has(.pm-cost-display) {
  margin-top: 4px !important;
}
body.pm-layout-ready .pm-technique-column .pm-cost-display,
body.pm-layout-ready .pm-technique-column .pm-cost-display * {
  font-size: 16px !important;
  line-height: 1.3;
  color: #aaa !important;
}
body.pm-layout-ready .pm-technique-column .pm-choice-cost-end::after {
  margin-top: 9px;
  margin-bottom: 9px;
}
/* Individual explanatory panels retain their source images and wording. */
body.pm-layout-ready .choice-ltov.pm-compact-choice.pm-decorative-frame {
  padding: 0 !important;
  border: 0 !important;
  border-image: none !important;
  background: transparent !important;
}
body.pm-layout-ready .choice-ltov > .d-column > .d-column > .text-center {
  margin-bottom: 10px;
  padding: 20px;
  background: #000;
  border: 3px solid transparent;
  border-image: none 20 / 20px / 0 stretch;
}
body.pm-layout-ready .choice-ltov > .d-column > .d-column > .text-center:last-child {
  margin-bottom: 0;
}
body.pm-layout-ready .choice-ltov > .d-column > .d-column > .text-center > .row {
  align-items: flex-start;
  gap: 16px;
}
body.pm-layout-ready .choice-ltov .text-center > .row > .col:has(> img) {
  flex: 0 0 38%;
  max-width: 38% !important;
}
body.pm-layout-ready .choice-ltov .text-center > .row > .col:has(> h2) {
  flex: 1 1 0;
  max-width: none !important;
  min-width: 0;
}
body.pm-layout-ready .choice-ltov .text-center > .row > .col > img,
body.pm-layout-ready .choice-ltov .text-center > span > img {
  width: 100% !important;
  margin: 0 !important;
}
body.pm-layout-ready .choice-ltov :is(h2, h3) {
  font-size: 24px !important;
  line-height: 1.3;
  text-align: left !important;
  padding: 0 0 8px;
  margin: 0 0 10px !important;
  border-bottom: 1px solid #b8b8b84d;
}
body.pm-layout-ready .choice-ltov :is(h2, h3) > br:first-child { display: none; }
body.pm-layout-ready .choice-ltov .text-center > .row > .col > p,
body.pm-layout-ready .choice-ltov .text-center > span > p {
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
  line-height: 1.55;
  font-size: 16px !important;
  overflow-wrap: break-word;
  word-break: normal;
}
/* The legacy renderer uses a single column wrapper on smaller screens. */
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading > .col-12 {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
}
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading > .col-12 > img {
  grid-column: 1;
  grid-row: 1 / 3;
}
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading > .col-12 > h2 {
  grid-column: 2;
  align-self: end;
}
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading > .col-12 > p {
  grid-column: 2;
  align-self: start;
  padding-bottom: 8px !important;
  border-bottom: 1px solid #b8b8b84d;
}
body.pm-layout-ready .choice-ltov .text-center > span > img { margin-bottom: 14px !important; }
@media (max-width: 600px) {
  body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading {
    padding: 16px !important;
    gap: 10px;
    margin-inline: 10px !important;
  }
  body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading > .col:first-child { flex-basis: 72px; }
  body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading p { font-size: 13px !important; }
  body.pm-layout-ready .choice-ltov > .d-column > .d-column > .text-center { padding: 18px; }
  body.pm-layout-ready .choice-ltov .text-center > .row > .col:has(> img),
  body.pm-layout-ready .choice-ltov .text-center > .row > .col:has(> h2) { flex: 0 0 100%; max-width: 100% !important; }
  body.pm-layout-ready .choice-ltov .text-center > .row > .col:has(> img) { order: -1; }
  body.pm-layout-ready .choice-ltov :is(h2, h3) { font-size: 22px !important; }
  body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading > .col-12 { grid-template-columns: 64px minmax(0, 1fr); gap: 0 10px; }
}

/* Align the rumor banner with its technique cards. */
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading {
  margin-inline: 10px !important;
}

/* Give every technique grade banner the same extra space below the shared guide. */
body.pm-layout-ready :is(.row-e0by-bg, .row-dgh6-bg, .row-pc9y-bg, .row-iaq6-bg, .row-svhc-bg, .row-atpu-bg, .row-thr8-bg) {
  margin-top: calc(var(--pm-row-gap-top, 12px) + 16px) !important;
}

/* Rumor keyword buttons sit inside the grade frame, with open space at right. */
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading {
  display: grid;
  grid-template-columns: clamp(86px, 11vw, 120px) minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 0;
}
body.pm-layout-ready .pm-technique-keyword-heading > .col:first-child {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
}
body.pm-layout-ready .pm-technique-keyword-heading > .pm-technique-header-copy {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: none !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid #b8b8b84d;
}
body.pm-layout-ready .pm-technique-keyword-heading > .col-12 {
  grid-column: 1 / -1;
  grid-row: 1;
}
body.pm-layout-ready .pm-technique-keyword-heading > .pm-technique-keywords {
  grid-column: 2;
  grid-row: 2;
  width: min(620px, 70%);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.pm-layout-ready .pm-technique-keyword-heading .pm-technique-keyword-buttons {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  justify-content: start;
  gap: 8px;
}
body.pm-layout-ready .pm-technique-keyword-heading .pm-technique-keyword-buttons button {
  min-width: 0;
  padding-inline: 6px;
  white-space: nowrap;
}
@media (max-width: 900px) {
  body.pm-layout-ready .pm-technique-keyword-heading > .pm-technique-keywords {
    grid-column: 1 / -1;
    width: calc(100% - clamp(72px, 25%, 180px));
    margin-top: 8px;
  }
  body.pm-layout-ready .pm-technique-keyword-heading .pm-technique-keyword-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
}

/* Center the emblem across the expanded banner and leave room below the buttons. */
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading {
  grid-template-rows: auto auto;
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .col:first-child {
  grid-row: 1 / 3;
  align-self: center;
}
@media (max-width: 900px) {
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading {
    grid-template-columns: 90px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 12px;
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .col-12 {
    display: contents;
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .col-12 > img {
    grid-column: 1;
    grid-row: 1 / 4;
    align-self: center;
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .col-12 > h2 {
    grid-column: 2;
    grid-row: 1;
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .col-12 > p {
    grid-column: 2;
    grid-row: 2;
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .pm-technique-keywords {
    grid-column: 2;
    grid-row: 3;
    width: calc(100% - max(40px, 25%));
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons {
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  }
}
@media (max-width: 600px) {
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading {
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 10px;
    padding-bottom: 16px !important;
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons button {
    padding-inline: 4px;
  }
}

body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading {
  margin-inline: 30px !important;
}

body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .col:first-child,
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .col-12 > img {
  transform: none;
}
@media (max-width: 600px) {
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .pm-technique-keywords {
    width: calc(100% - 48px);
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons {
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
    gap: 4px;
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons button {
    padding-inline: 3px;
  }
}


/* A separate, compact framed control beside the rumor introduction. */
body.pm-layout-ready .pm-technique-controls-layout {
  display: grid;
  --pm-technique-card-share: 25%;
  grid-template-columns: minmax(0, 1fr) calc(var(--pm-technique-card-share) - 30px);
  column-gap: 16px;
  align-items: center;
}
body.pm-layout-ready .pm-technique-controls-layout:has(.pm-technique-column.col-6) {
  --pm-technique-card-share: 50%;
}
body.pm-layout-ready .pm-technique-controls-layout:has(.pm-technique-column.col-12) {
  --pm-technique-card-share: 100%;
}
body.pm-layout-ready .pm-technique-controls-layout > .pm-technique-primary-heading.pm-section-heading {
  grid-column: 1;
  grid-row: 1;
  margin-right: 0 !important;
}
body.pm-layout-ready .pm-technique-controls-layout > .row:not(.pm-section-heading) {
  grid-column: 1 / -1;
  grid-row: 2;
}
body.pm-layout-ready .pm-technique-controls-layout > .pm-technique-formula-toggle {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: stretch;
  width: calc(100% - 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  white-space: nowrap;
  min-height: 64px;
  margin-right: 30px;
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 0;
  border-image: none 20 / 14px / 0 stretch;
  background: #000;
  color: #fff;
  font-family: HYSinMyeongJo, serif;
  font-size: 16px;
  line-height: 1.3;
  text-align: center;
  word-break: keep-all;
  cursor: pointer;
}
body.pm-layout-ready .pm-technique-formula-toggle:focus-visible {
  outline: 2px solid #fff0cc;
  outline-offset: 3px;
}
body.pm-technique-formulas-hidden .pm-technique-column .pm-coin-formula {
  display: none !important;
}
/* Keyword controls scale their width, spacing and underline with the label text. */
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .pm-technique-keywords {
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
}
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: .4em .5em;
  background: transparent;
  font-size: 14px;
}
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons > button {
  position: relative;
  flex: 0 0 auto;
  width: auto;
  min-height: 2em;
  padding: .2em .5em .3em;
  border: 0;
  border-radius: 0;
  border-image: none;
  background: transparent;
  box-shadow: none;
  font-size: inherit;
  line-height: 1.3;
}
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons > button::after {
  content: "";
  position: absolute;
  left: .5em;
  right: .5em;
  bottom: 0;
  height: 1px;
  background: #d8b16e;
  opacity: 0;
  pointer-events: none;
}
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons > button[aria-pressed="true"]::after {
  opacity: 1;
}
@media (max-width: 1100px) {
  body.pm-layout-ready .pm-technique-controls-layout {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 12px;
  }
  body.pm-layout-ready .pm-technique-controls-layout > .pm-technique-primary-heading.pm-section-heading {
    margin-right: 30px !important;
  }
  body.pm-layout-ready .pm-technique-controls-layout > .pm-technique-formula-toggle {
    grid-column: 1;
    grid-row: 2;
  }
  body.pm-layout-ready .pm-technique-controls-layout > .row:not(.pm-section-heading) {
    grid-row: 3;
  }
}

/* Separators belong only to the embedded rumor keyword tabs. */
body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons {
  overflow: hidden;
}

body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons > button + button::before {
  content: "";
  position: absolute;
  left: -.25em;
  top: calc(50% - .5em);
  width: 1px;
  height: 1em;
  background: rgba(191, 169, 132, .55);
  pointer-events: none;
}

body.pm-layout-ready .pm-technique-primary-heading.pm-technique-keyword-heading .pm-technique-keyword-buttons > button[data-technique-keyword="all"] {
  font-weight: 700;
}

/* Compact rumor title and keyword controls without the introductory sentence. */
body.pm-layout-ready .pm-technique-primary-heading.pm-technique-keyword-heading .pm-technique-header-copy > p,
body.pm-layout-ready .pm-technique-primary-heading.pm-technique-keyword-heading > .col-12 > p {
  display: none !important;
}
@media (max-width: 900px) {
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading {
    grid-template-rows: auto auto;
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .col-12 > img {
    grid-row: 1 / 3;
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .col-12 > h2 {
    padding-bottom: 8px !important;
    border-bottom: 1px solid #b8b8b84d;
  }
  body.pm-layout-ready .pm-technique-primary-heading.pm-section-heading.pm-technique-keyword-heading > .pm-technique-keywords {
    grid-row: 2;
  }
}

body.pm-layout-ready .pm-technique-formula-toggle > .pm-technique-formula-icon {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  object-fit: contain;
  opacity: 1;
  filter: brightness(1.15);
  pointer-events: none;
}
body.pm-layout-ready .pm-technique-formula-toggle::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 1;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .68) 0%, rgba(0, 0, 0, .38) 45%, transparent 78%);
  pointer-events: none;
}
body.pm-layout-ready .pm-technique-formula-toggle > .pm-technique-formula-label {
  position: relative;
  z-index: 2;
  text-shadow: 0 0 1px #000, 0 0 2px #000, 0 0 3px #000, 0 0 3px #000, 0 0 6px #000, 0 0 6px #000, 0 0 9px #000;
}
@media (max-width: 1100px) {
  body.pm-layout-ready .pm-technique-controls-layout > .pm-technique-formula-toggle {
    width: calc(var(--pm-technique-card-share) - 60px);
  }
}

/* Multi-row grades keep one stable flex line for the banner and formula control. */
body.pm-layout-ready .pm-technique-controls-flat > .pm-technique-primary-heading.pm-section-heading {
  order: -3;
  flex: 0 0 calc(100% - var(--pm-technique-card-share) - 16px);
  width: calc(100% - var(--pm-technique-card-share) - 16px);
  align-self: stretch;
  margin-right: 0 !important;
  margin-top: calc(var(--pm-row-gap-top, 12px) + 16px) !important;
}
body.pm-layout-ready .pm-technique-controls-flat > .pm-technique-formula-toggle {
  order: -3;
  flex: 0 0 calc(var(--pm-technique-card-share) - 60px);
  width: calc(var(--pm-technique-card-share) - 60px);
  margin-left: 16px;
  margin-top: calc(var(--pm-row-gap-top, 12px) + 16px);
}
@media (max-width: 1100px) {
  body.pm-layout-ready .pm-technique-controls-flat > .pm-technique-primary-heading.pm-section-heading {
    margin-right: 30px !important;
    flex-basis: calc(100% - 60px);
    width: calc(100% - 60px);
  }
  body.pm-layout-ready .pm-technique-controls-flat > .pm-technique-formula-toggle {
    flex-basis: calc(var(--pm-technique-card-share) - 60px);
    margin-left: calc(100% - var(--pm-technique-card-share) + 30px);
    margin-top: 12px;
    margin-bottom: 12px;
  }
}

/* Explanation panels only: retain the existing muted line, fading its right end. */
body.pm-layout-ready :is(.choice-w0iw, .choice-ltov) .pm-explanation-guide-title {
  /* Keep the rule beside floated guide illustrations rather than behind them. */
  display: flow-root;
  padding-bottom: 8px;
  margin: 0 0 10px !important;
  border-bottom: 1px solid #b8b8b84d;
  border-image: linear-gradient(to right, #b8b8b84d 0%, #b8b8b84d 80%, transparent 100%) 1;
}
