/* Share the fade's extra height with the page's bottom scroll clearance. */
:root { --pm-cost-fade-rise: 88px; }

/* Keep the original cost bar geometry and text; only soften its backdrop. */
.pointBar {
  background: transparent !important;
  box-shadow: none;
  isolation: isolate;
}

.pointBar::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--pm-cost-fade-rise)) 0 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .96) 30%, rgba(0, 0, 0, .62) 60%, transparent 100%);
}

/* Supplemental build tabs leave the original build DOM intact. */
#backpackDialog[data-pm-build-tab="stats"] > :not(.pm-build-toolbar):not(.pm-build-stat-panel),
#backpackDialog[data-pm-build-tab="character"] > :not(.pm-build-toolbar):not(.pm-character-sheet),
#backpackDialog[data-pm-build-tab="techniques"] > :not(.pm-build-toolbar):not(.pm-build-techniques-panel),
.pm-build-legacy-actions,
.pm-build-stat-panel[hidden],
.pm-character-sheet[hidden],
.pm-character-sheet [hidden],
.pm-build-techniques-panel[hidden],
.pm-build-techniques-panel [hidden] {
  display: none !important;
}
.mdc-dialog__surface:has(#backpackDialog) {
  width: min(1040px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  height: 90dvh;
  max-height: calc(100dvh - 32px) !important;
  background: #0e0f10;
}
#backpackDialog { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
body:has(.mdc-dialog--open #backpackDialog) .pm-sidebar-toggle {
  visibility: hidden;
  pointer-events: none;
}

.pm-build-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px clamp(12px, 3vw, 32px) 0;
  background: #101111;
  border-bottom: 1px solid #5d503b;
}
.pm-build-tabs { display: flex; flex: 1; min-width: 0; gap: 4px; }
.pm-build-close {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin-bottom: 7px;
  padding: 0;
  border: 1px solid #74624477;
  border-radius: 5px;
  background: transparent;
  color: #cfc5b3;
  font: 28px/1 Arial, sans-serif;
  cursor: pointer;
}
.pm-build-close:hover { color: #fff2d5; background: #b99a5a1a; border-color: #c9ad78; }
.pm-build-close:focus-visible { outline: 2px solid #e0c68e; outline-offset: 2px; }

.pm-build-tabs button {
  flex: 1;
  max-width: 220px;
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #aaa69c;
  font: inherit;
  font-family: HYSinMyeongJo, Georgia, serif;
  font-size: 17px;
  word-break: keep-all;
  cursor: pointer;
}

.pm-build-tabs button[aria-selected="true"] {
  color: #f4e3bd;
  border-bottom-color: #d2b777;
  background: linear-gradient(0deg, #a98a4e24, transparent);
  text-shadow: 0 0 16px #d6b77455;
}

.pm-build-tabs button:hover { color: #fff2d5; }
.pm-build-tabs button:focus-visible { outline: 2px solid #e0c68e; outline-offset: -4px; }

.pm-build-stat-panel {
  box-sizing: border-box;
  width: 100%;
  padding: clamp(20px, 3vw, 36px);
  background: radial-gradient(ellipse at 50% 0%, #29241b88, transparent 60%), #0e0f10;
  color: #ddd6c9;
  text-align: left;
  font-family: HYSinMyeongJo, Georgia, serif;
}

.pm-build-stat-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.pm-build-stat-eyebrow { margin: 0 0 6px; color: #a18c66; font: 10px/1.5 Georgia, serif; letter-spacing: .22em; }
.pm-build-stat-heading h2 { margin: 0; color: #eee1c6; font-size: clamp(25px, 3vw, 34px); font-weight: 500; letter-spacing: .06em; }
.pm-build-stat-live { flex-shrink: 0; padding: 5px 9px; border: 1px solid #5f543c; color: #c7b581; font-size: 11px; }
.pm-build-stat-tables { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.pm-build-stat-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 15px; }
.pm-build-stat-table caption { padding: 0 0 12px; border-bottom: 1px solid #8d7650; color: #d5be91; text-align: left; caption-side: top; font-size: 18px; letter-spacing: .05em; }
.pm-build-stat-table th, .pm-build-stat-table td { padding: 10px 8px; border-bottom: 1px solid #343028; vertical-align: middle; }
.pm-build-stat-table thead th { color: #aca394; font-size: 11px; font-weight: normal; white-space: nowrap; }
.pm-build-stat-table th:first-child { width: 38%; text-align: left; }
.pm-build-stat-table th:not(:first-child), .pm-build-stat-table td { text-align: right; }
.pm-build-stat-table tbody th { color: #ded9ce; font-weight: normal; }
.pm-build-stat-table tbody tr:nth-child(even) { background: #b99a5a07; }
.pm-build-stat-table tbody tr:hover { background: #b99a5a12; }
.pm-build-stat-rank { display: inline-block; padding: 3px 8px; border: 1px solid #7772; border-radius: 2px; background: #ffffff04; color: #bebbb3; font-size: 13px; white-space: nowrap; }
.pm-build-stat-value { color: #f1e2bf; font-size: 22px; font-variant-numeric: tabular-nums; }
.pm-build-stat-conditional { display: block; color: #a6a6a6; font-size: 11px; line-height: 1.6; }
.pm-build-stat-conditional:empty, .pm-build-special-effects p:empty { display: none; }
.pm-build-special-effects { margin-top: 20px; color: #aaa79f; font-size: 13px; line-height: 1.8; }
.pm-build-conditional-note { color: #a6a6a6; }

/* User-written abilities stay plain text and never execute as markup or effects. */
.pm-custom-ability-content { box-sizing: border-box; width: calc(100% - 20px); max-width: calc(100% - 20px); margin: 14px 10px; padding-top: 12px; border-top: 1px solid #74624477; text-align: center; font-family: HYSinMyeongJo, Georgia, serif; }
.pm-custom-ability-content p { margin: 8px 0; color: #e3dbcb; font-size: 16px; line-height: 1.7; }
.pm-custom-ability-content p:empty { display: none; }
.pm-custom-ability-build-effect { white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }
.pm-custom-ability-build-name, .pm-custom-ability-saved-name { overflow-wrap: anywhere; }
.pm-custom-ability-notice { color: #cbb58d; }
.pm-custom-ability-edit, .pm-custom-ability-editor button { min-height: 40px; padding: 8px 16px; border: 1px solid #746244; border-radius: 4px; color: #eee1c6; background: #272219; font: inherit; cursor: pointer; }
.pm-custom-ability-edit:disabled { opacity: .5; cursor: default; }
.pm-custom-ability-editor { box-sizing: border-box; width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: clamp(18px, 4vw, 30px); overflow: auto; overscroll-behavior: contain; border: 1px solid #ae9666; border-radius: 12px 2px; color: #e3dbcb; background: #101111; font: 16px/1.7 HYSinMyeongJo, Georgia, serif; }
.pm-custom-ability-editor::backdrop { background: #000b; }
.pm-custom-ability-editor header, .pm-custom-ability-editor footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pm-custom-ability-editor h2 { margin: 0; color: #eee1c6; font-size: 25px; }
.pm-custom-ability-editor header button { padding: 0; width: 40px; font-size: 26px; }
.pm-custom-ability-editor label { display: block; margin: 15px 0 6px; }
.pm-custom-ability-editor input, .pm-custom-ability-editor textarea { box-sizing: border-box; width: 100%; padding: 10px 12px; border: 1px solid #695c45; border-radius: 3px; color: #eee8dc; background: #080909; font: inherit; }
.pm-custom-ability-editor textarea { resize: vertical; min-height: 150px; }
.pm-custom-ability-editor :is(input, textarea, button):focus-visible, .pm-custom-ability-edit:focus-visible { outline: 2px solid #d2b777; outline-offset: 2px; }
.pm-custom-ability-help { color: #aaa79f; font-size: 13px; }
.pm-custom-ability-editor footer { justify-content: flex-end; margin-top: 18px; }
.pm-build-stat-table[data-stat-group="values"] { grid-column: 1 / -1; max-width: 620px; justify-self: start; font-size: 14px; line-height: 22px; }
.pm-build-stat-table[data-stat-group="values"] caption { padding-bottom: 8px; font-size: 16px; }
.pm-build-stat-table[data-stat-group="values"] th, .pm-build-stat-table[data-stat-group="values"] td { padding: 6px 8px; }
.pm-build-stat-table[data-stat-group="values"] .pm-build-stat-rank { padding: 2px 7px; font-size: 12px; }
.pm-build-stat-table[data-stat-group="values"] .pm-build-stat-value { font-size: 18px; }
.pm-build-stat-caption { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.pm-build-choice-pool { color: #aaa394; font-size: 12px; letter-spacing: 0; white-space: nowrap; }
.pm-build-choice-remaining { margin-left: 7px; color: #f1e2bf; font-size: 21px; font-weight: normal; font-variant-numeric: tabular-nums; }
.pm-build-choice-notice { margin: 0 0 18px; color: #d6b88b; font-size: 13px; line-height: 1.7; }
.pm-build-choice-notice:empty { display: none; }
.pm-build-stat-table th:first-child { width: 32%; }
.pm-build-stat-table thead th:nth-child(2) { width: 46%; text-align: center; }
.pm-build-stat-table[data-stat-group="values"] th:first-child { width: 45%; }
.pm-build-stat-table[data-stat-group="values"] thead th:nth-child(2) { width: 35%; text-align: right; }
.pm-build-stat-adjust { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 128px; max-width: 100%; margin-inline: auto; }
.pm-build-stat-adjust button {
  flex: 0 0 28px;
  width: 28px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #74624477;
  border-radius: 4px;
  background: #b99a5a0b;
  color: #ead9b7;
  font: 20px/1 Arial, sans-serif;
  cursor: pointer;
}
.pm-build-stat-adjust button:hover:not(:disabled) { border-color: #c9ad78; background: #b99a5a25; }
.pm-build-stat-adjust button:focus-visible { outline: 2px solid #e0c68e; outline-offset: 2px; }
.pm-build-stat-adjust button:disabled { color: #655f55; border-color: #514a3f66; background: transparent; cursor: not-allowed; }

/* Character identity is intentionally independent of purchasing and combat. */
.pm-character-sheet, .pm-build-techniques-panel {
  box-sizing: border-box;
  width: 100%;
  padding: clamp(24px, 2.8vw, 36px);
  background: radial-gradient(ellipse at 0% 0%, #24272b55, transparent 65%), #0e0f10;
  color: #dadbdd;
  text-align: left;
  font-family: HYSinMyeongJo, Georgia, serif;
}
.pm-character-sheet *, .pm-character-sheet *::before, .pm-character-sheet *::after,
.pm-build-techniques-panel *, .pm-build-techniques-panel *::before, .pm-build-techniques-panel *::after { box-sizing: border-box; }
.pm-character-layout {
  max-width: 980px;
  margin: 0 auto;
}
.pm-character-profile { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(0, 1.6fr); gap: 28px; min-width: 0; min-height: clamp(480px, calc(90dvh - 128px), 800px); }
.pm-character-identity, .pm-character-details { min-width: 0; }
.pm-character-identity { display: flex; flex-direction: column; }
.pm-character-details { align-self: center; }
.pm-character-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  flex: 1 1 auto;
  min-height: 480px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid #666b72;
  border-radius: 14px 0 14px 0;
  background: linear-gradient(135deg, #090a0b 25%, #1b1c1b 49%, #0b0c0d 53%, #060708 90%);
  box-shadow: inset 0 0 0 5px #050606, inset 0 0 0 6px #62687044;
  color: #c3c6cb;
  font: inherit;
}
.pm-character-photo-button {
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.pm-character-portrait::after {
  content: "";
  position: absolute;
  inset: auto 8px 8px;
  height: 48%;
  z-index: 1;
  background: linear-gradient(to top, rgba(4, 5, 6, .94), rgba(4, 5, 6, .7) 36%, rgba(4, 5, 6, .25) 68%, transparent);
  pointer-events: none;
}
.pm-character-portrait:hover { border-color: #aeb4bd; }
.pm-character-photo-button:focus-visible, .pm-character-clear:focus-visible {
  outline: 2px solid #b8c3d1;
  outline-offset: 4px;
}
.pm-character-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.pm-character-placeholder { display: grid; gap: 10px; padding: 16px; text-align: center; font-size: 19px; line-height: 1.6; }
.pm-character-placeholder small { color: #858b94; font-size: 12px; }
.pm-character-image-actions { display: flex; justify-content: flex-end; }
.pm-character-image-actions:has(button:not([hidden])) { margin-top: 8px; }
.pm-character-clear {
  min-height: 28px;
  padding: 3px 0 3px 10px;
  border: 0;
  background: transparent;
  color: #969da8;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.pm-character-clear:hover { color: #e3e7ed; }
.pm-character-nameplate { position: absolute; z-index: 2; right: 22px; bottom: 24px; left: 22px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; text-shadow: 0 2px 9px #000; }
.pm-character-name {
  flex: 0 1 auto;
  min-width: 0;
  width: 100%;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #f0f1f3;
  font: inherit;
  font-size: clamp(21px, 2.2vw, 28px);
  line-height: 1.4;
  text-align: center;
  text-shadow: inherit;
}
.pm-character-name::placeholder { color: #bac0c8; font-size: 19px; }
.pm-character-name:hover { border-bottom-color: #616873; }
.pm-character-name:focus-visible { outline: 0; border-bottom-color: #bac8d9; }
.pm-character-title { flex: 0 1 auto; max-width: 100%; color: #c4ccd7; font-size: 14px; line-height: 1.5; letter-spacing: .06em; overflow-wrap: anywhere; }
.pm-character-title:empty { display: none; }
.pm-character-status { margin: 10px 0 0; color: #9da6b2; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.pm-character-status:empty { display: none; }
.pm-character-metrics, .pm-character-specialties, .pm-character-traits { margin: 0; padding: 0; }
.pm-character-metrics, .pm-character-specialties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
.pm-character-metrics > div, .pm-character-specialties > div, .pm-character-traits > div {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 13px 3px;
}
.pm-character-metrics > div::after, .pm-character-specialties > div::after, .pm-character-traits > div::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, #777f8c55, #777f8c22 80%, transparent);
  content: "";
}
.pm-character-metrics dt, .pm-character-specialties dt, .pm-character-traits dt { color: #a8afb9; font-weight: normal; }
.pm-character-metrics dd, .pm-character-specialties dd, .pm-character-traits dd { min-width: 0; margin: 0; color: #e8eaee; text-align: right; overflow-wrap: anywhere; }
.pm-character-metrics > div { flex-wrap: wrap; gap: 4px 10px; padding-top: 14px; padding-bottom: 17px; }
.pm-character-metrics dt { color: #c8cdd5; font-size: 19px; letter-spacing: .025em; }
.pm-character-metrics dd { margin-left: auto; color: #f2f3f5; font-size: 30px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.pm-character-specialties { margin-top: 10px; }
.pm-character-specialties > div { gap: 12px; padding-top: 14px; padding-bottom: 15px; }
.pm-character-specialties dt { flex-shrink: 0; font-size: 15px; line-height: 1.6; white-space: nowrap; }
.pm-character-specialties dd { font-size: 18px; line-height: 1.6; word-break: keep-all; }
.pm-character-primary-value { display: block; margin-top: 2px; color: #8e98a7; font-size: 12px; font-variant-numeric: tabular-nums; }
.pm-character-traits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; margin-top: 20px; }
.pm-character-traits > div { gap: 12px; padding-top: 15px; padding-bottom: 15px; }
.pm-character-traits dt { font-size: 14px; }
.pm-character-traits dd { font-size: 15px; line-height: 1.6; }
.pm-character-techniques { display: flex; flex-direction: column; min-width: 0; min-height: max(480px, calc(90dvh - 128px)); padding: 24px; border: 1px solid #70798644; background: #0a0c0f88; border-radius: 10px 0 10px 0; }
.pm-character-techniques header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid #70798655; }
.pm-character-techniques h3 { margin: 0; color: #e0e4eb; font: inherit; font-size: 21px; letter-spacing: .04em; }
.pm-character-technique-count { color: #8995a6; font-size: 16px; font-variant-numeric: tabular-nums; }
.pm-character-technique-empty { margin: auto 0; padding: 40px 0; color: #929ca9; font-size: 14px; text-align: center; line-height: 1.8; }
.pm-character-technique-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; min-height: 0; padding-top: 20px; }
.pm-character-technique-list:focus-visible { outline: 1px solid #a6b4c8; outline-offset: 4px; }
/* Match the original technique choice frame and typography. */
.pm-character-technique-card { min-width: 0; padding: 18px; border: 4px groove #d1bb9f; border-radius: 20px 0 20px 0; background: #000; filter: drop-shadow(2px 2px 2px #e6e03753); font-size: 16px; line-height: 1.5; }
.pm-character-technique-image { display: block; width: 100%; height: auto; border: 2px solid #b27340; }
.pm-character-technique-title { margin: 18px 0 16px; padding-bottom: 16px; border-bottom: 1px solid #d1bb9fb8; border-image: linear-gradient(to right, transparent, #d1bb9fb8 50%, transparent) 1; color: #fff; font-family: HYSinMyeongJo; font-size: 260%; font-weight: 500; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.pm-character-technique-image[hidden] + .pm-character-technique-title { margin-top: 0; }
.pm-character-technique-description { color: #a8a8a8; font-family: HYSinMyeongJo; font-size: 115%; font-weight: 400; line-height: 1.5; text-align: left; white-space: pre-line; overflow-wrap: anywhere; }
.pm-character-technique-description p { margin: 0 0 12px; }
.pm-character-technique-description p:last-child { margin-bottom: 0; }
@media (max-width: 720px) {
  .pm-character-technique-list { grid-template-columns: minmax(0, 1fr); }
  .pm-character-technique-card { padding: 14px; }
  .pm-character-profile { grid-template-columns: minmax(0, 1fr); gap: 24px; min-height: 0; }
  .pm-character-identity { width: min(100%, 280px); margin: 0 auto; }
  .pm-character-portrait { aspect-ratio: 3 / 5; min-height: 0; }
  .pm-character-sheet, .pm-build-techniques-panel { padding: 24px 18px 32px; }
  .pm-character-techniques { padding: 20px 16px; }
  .pm-character-name { font-size: 25px; }
  .pm-character-metrics, .pm-character-specialties { column-gap: 18px; }
  .pm-character-specialties { grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
  .pm-character-metrics dt { font-size: 18px; }
  .pm-character-metrics dd { font-size: 25px; }
  .pm-character-traits { column-gap: 18px; }
  .pm-character-traits > div { flex-wrap: wrap; gap: 4px 10px; }
  .pm-character-traits dd { flex: 1 1 auto; }
}
@media (max-width: 650px) {
  .pm-build-stat-tables { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .pm-build-stat-panel { padding: 22px 16px; }
  .pm-build-toolbar { gap: 6px; padding-right: 8px; padding-left: 8px; }
  .pm-build-tabs { gap: 0; }
  .pm-build-tabs button { min-width: 0; max-width: none; padding: 10px 5px; font-size: 14px; }
}

:root {
  --pm-sidebar-width: min(320px, calc(100vw - 52px));
  --pm-sidebar-gold: #d1bb9f;
  --pm-sidebar-gold-bright: #fff5c8;
  --pm-sidebar-panel: rgba(26, 26, 25, 0.98);
  --pm-sidebar-button: #050505;
}

body.pm-start-open {
  overflow: hidden;
  background: #000 !important;
}

.pm-start-screen[hidden] {
  display: none !important;
}

.pm-start-screen {
  position: fixed;
  z-index: 10000;
  inset: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(24px, 5vw, 72px);
  color: #f4f2ed;
  background: #000;
  opacity: 0;
  transition: opacity 520ms ease, filter 520ms ease;
  isolation: isolate;
  font-family: HYSinMyeongJo, Georgia, serif;
}

.pm-start-screen.is-visible {
  opacity: 1;
}

.pm-start-screen.is-leaving {
  pointer-events: none;
  /* Keep the black backing until the actual content reveal begins. */
  opacity: 1;
}

.pm-start-frame {
  position: relative;
  width: min(820px, 92vw);
  min-height: min(610px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(34px, 6vh, 74px) clamp(20px, 7vw, 86px);
  text-align: center;
  opacity: 0;
  transform: translateY(15px) scale(0.985);
  transition: opacity 760ms ease, transform 760ms cubic-bezier(0.22, 1, 0.36, 1), filter 520ms ease;
}

.pm-start-screen.is-visible .pm-start-frame {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.pm-start-screen.is-leaving .pm-start-frame {
  opacity: 0;
  transform: translateY(-6px);
  transition-duration: 220ms;
}

.pm-start-eyebrow {
  margin: 0 0 13px;
  color: rgba(255, 255, 255, 0.56);
  font: 12px/1.2 Georgia, serif;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
}

.pm-start-title {
  width: 100%;
  margin: 0;
  color: #f2f3f5;
  font-size: clamp(24px, 5.4vw, 64px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0;
  text-indent: 0;
  text-shadow: 0 0 18px rgba(230, 237, 255, 0.15);
}

.pm-start-title::after,
.pm-start-menu-view::after {
  content: "";
  display: block;
  width: 76%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(218, 224, 235, 0.4), transparent);
}

.pm-start-title::after { margin: 0.4em auto 0; }

.pm-start-menu-view::after {
  order: 1;
  flex-shrink: 0;
  margin: 6px auto 0;
}

.pm-start-menu-view > .pm-image-cache {
  order: 2;
  margin-top: 80px;
}

.pm-start-title-main,
.pm-start-title-sub {
  display: block;
  white-space: nowrap;
}

.pm-start-title-main {
  letter-spacing: 0.095em;
  text-indent: 0.095em;
}

.pm-start-title-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65em;
  margin-top: 0.48em;
  font-size: 0.62em;
}

.pm-start-title-cyoa {
  letter-spacing: 0.4em;
  margin-right: -0.4em;
}

.pm-start-title-remake {
  color: #b9bec7;
  font-size: inherit;
  letter-spacing: 0.24em;
  margin-right: -0.24em;
  text-shadow: none;
}

.pm-start-views {
  position: relative;
  width: min(100%, 450px);
  min-height: 210px;
  margin-top: 16px;
}

.pm-start-menu-view,
.pm-start-credits-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 260ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pm-start-menu-view {
  justify-content: flex-start;
  gap: 2px;
  opacity: 1;
  transform: translateX(0);
}

.pm-start-menu-view > .pm-start-choice {
  min-height: 44px;
  padding: 8px 26px;
  flex-shrink: 0;
}

.pm-start-credits-view {
  pointer-events: none;
  opacity: 0;
  transform: translateX(24px);
}

.pm-start-screen.is-showing-credits .pm-start-menu-view {
  pointer-events: none;
  opacity: 0;
  transform: translateX(-24px);
}

.pm-start-screen.is-showing-credits .pm-start-credits-view {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
}

.pm-start-choice {
  position: relative;
  width: min(290px, 78vw);
  min-height: 52px;
  padding: 10px 26px;
  border: 0;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  font: 19px/1.2 Georgia, serif;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  cursor: pointer;
  isolation: isolate;
  transition: color 160ms ease, letter-spacing 220ms ease, text-shadow 180ms ease, transform 180ms ease;
}

.pm-start-choice::before,
.pm-start-choice::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: inherit;
  content: attr(data-glow);
  font: inherit;
  letter-spacing: inherit;
  text-indent: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease, transform 180ms ease, filter 180ms ease;
}

.pm-start-choice:hover,
.pm-start-choice:focus-visible {
  color: #fff;
  letter-spacing: 0.41em;
  text-shadow:
    -1px 0 5px rgba(91, 169, 255, 0.38),
    1px 0 5px rgba(255, 112, 88, 0.3),
    0 0 15px rgba(255, 255, 255, 0.5);
  outline: 0;
}

.pm-start-choice:hover::before,
.pm-start-choice:focus-visible::before {
  color: rgba(98, 177, 255, 0.72);
  opacity: 0.22;
  transform: translateX(-1.5px);
  filter: blur(0.45px);
}

.pm-start-choice:hover::after,
.pm-start-choice:focus-visible::after {
  color: rgba(255, 116, 91, 0.68);
  opacity: 0.18;
  transform: translateX(1.5px);
  filter: blur(0.45px);
}

.pm-start-choice.is-activating {
  pointer-events: none;
  animation: pm-start-choice-bloom 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pm-start-choice.is-activating::before {
  color: #67b7ff;
  animation: pm-start-choice-blue 280ms ease-out both;
}

.pm-start-choice.is-activating::after {
  color: #ff705e;
  animation: pm-start-choice-red 280ms ease-out both;
}

@keyframes pm-start-choice-bloom {
  0% {
    color: #fff;
    transform: scale(1);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.28);
  }
  42% {
    color: #fff;
    transform: scale(1.055);
    text-shadow:
      -2px 0 8px rgba(83, 169, 255, 0.78),
      2px 0 8px rgba(255, 105, 84, 0.7),
      0 0 12px rgba(255, 255, 255, 0.96),
      0 0 34px rgba(255, 255, 255, 0.72);
  }
  100% {
    color: #fff;
    transform: scale(1.025);
    text-shadow:
      -1px 0 6px rgba(83, 169, 255, 0.48),
      1px 0 6px rgba(255, 105, 84, 0.44),
      0 0 19px rgba(255, 255, 255, 0.62);
  }
}

@keyframes pm-start-choice-blue {
  0% { opacity: 0; transform: translateX(0); filter: blur(0); }
  45% { opacity: 0.72; transform: translateX(-3px); filter: blur(0.8px); }
  100% { opacity: 0.25; transform: translateX(-1px); filter: blur(0.35px); }
}

@keyframes pm-start-choice-red {
  0% { opacity: 0; transform: translateX(0); filter: blur(0); }
  45% { opacity: 0.68; transform: translateX(3px); filter: blur(0.8px); }
  100% { opacity: 0.22; transform: translateX(1px); filter: blur(0.35px); }
}

.pm-start-choice:disabled {
  color: rgba(255, 255, 255, 0.34);
  cursor: wait;
}

.pm-start-choice:disabled::before,
.pm-start-choice:disabled::after {
  opacity: 0;
  animation: none;
}

.pm-image-cache {
  width: min(330px, 82vw);
  margin-top: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.pm-image-cache-track {
  position: relative;
  width: 100%;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.pm-image-cache-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.32);
  transition: width 180ms ease;
}

.pm-image-cache-status {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  word-break: keep-all;
}

.pm-image-cache.is-ready {
  color: rgba(255, 255, 255, 0.65);
}

.pm-image-cache.is-error {
  color: #e3c8a6;
}

.pm-image-cache-retry {
  min-height: 30px;
  margin-top: 4px;
  padding: 3px 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  font: 11px/1 Georgia, serif;
  letter-spacing: 0.2em;
  cursor: pointer;
}

.pm-image-cache-retry:hover,
.pm-image-cache-retry:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.75);
  outline: 0;
}

.pm-start-credits-view h2 {
  margin: 0 0 16px;
  color: #fff;
  font: 18px/1.2 Georgia, serif;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
}

.pm-start-credits-view dl {
  width: 100%;
  margin: 0;
}

.pm-start-credits-view dl > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 5px 0;
}

.pm-start-credits-view dt {
  color: rgba(255, 255, 255, 0.48);
  text-align: right;
  font: 11px/1.5 Georgia, serif;
  letter-spacing: 0.15em;
}

.pm-start-credits-view dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  font-size: 15px;
  line-height: 1.2;
}

.pm-start-credits-view p {
  max-width: 390px;
  margin: 15px auto 5px;
  color: rgba(255, 255, 255, 0.53);
  font-size: 13px;
  line-height: 1.7;
  word-break: keep-all;
}

.pm-start-back {
  min-height: 42px;
  margin-top: 3px;
  font-size: 13px;
}

.pm-start-status {
  min-height: 19px;
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.48);
  font: 11px/1.4 Georgia, serif;
  letter-spacing: 0.18em;
}

html.pm-sidebar-ui .s-main {
  padding-top: 0 !important;
  /* The original viewer already reserves the 56px cost bar outside .s-main. */
  padding-bottom: var(--pm-cost-fade-rise) !important;
}

html.pm-sidebar-ui .music-player {
  visibility: hidden;
}

body.pm-sidebar-open {
  overflow: hidden;
}

body.pm-layout-ready .pm-hidden-legacy-row,
body.pm-layout-ready .pm-hidden-pointbar-slot,
body.pm-layout-ready .pm-section-screen-hidden,
body.pm-layout-ready .pm-special-hidden-column,
body.pm-layout-ready .pm-drawback-hidden-column,
body.pm-layout-ready .pm-technique-hidden-column,
body.pm-layout-ready .pm-technique-empty-heading,
body.pm-layout-ready .pm-technique-sort-spacer,
body.pm-layout-ready .pm-subsection-choice-hidden {
  display: none !important;
}

#pm-hidden-screen {
  max-width: 1200px;
  margin: 24px auto 80px;
  padding: 28px 24px;
  color: #fff;
  text-align: center;
  font-family: HYSinMyeongJo, serif;
}

#pm-hidden-screen h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: normal;
}

#pm-hidden-screen h1::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 18px;
  background: linear-gradient(to right, transparent, var(--pm-sidebar-gold), transparent);
}

body.pm-layout-ready .pointbar-center--viewer {
  max-width: 96vw;
}

/* Keep ordinary A/B/C balances in view on phones. Exceptionally long values
   retain the native horizontal scrolling rather than being clipped. */
@media (max-width: 560px) {
  body.pm-layout-ready .pointbar-center--viewer > div {
    padding-inline: 0 !important;
  }
  body.pm-layout-ready .pointbar-center--viewer > div > div {
    padding-inline: 2px !important;
    font-size: clamp(14px, 4vw, 18px) !important;
    line-height: 1.5;
  }
}

/* Perk layout placeholders keep their horizontal span/line breaks, but no
   vertical space when their conditional neighbours are collapsed. */
body.pm-layout-ready .pm-perk-spacer-column {
  height: 0 !important;
  min-height: 0 !important;
  margin-block: 0 !important;
  padding-block: 0 !important;
}

body.pm-layout-ready .pm-perk-spacer-column > .fullHeight {
  display: none !important;
}

/* Main choice screens only: bounded vertical gaps; horizontal layout is retained. */
body.pm-layout-ready .pm-compact-row {
  margin-top: var(--pm-row-gap-top) !important;
  margin-bottom: var(--pm-row-gap-bottom) !important;
}

body.pm-layout-ready .pm-compact-choice {
  margin-top: var(--pm-choice-gap-top) !important;
  margin-bottom: var(--pm-choice-gap-bottom) !important;
}

/* These two grids have a legacy 100px margin on both sides of every card.
   Preserve that desktop spacing, but release it as the columns get narrower. */
body.pm-layout-ready :is(.row-z6os, .row-surp).pm-compact-choice {
  margin-inline: clamp(10px, calc(25vw - 140px), 100px) !important;
}

body.pm-layout-ready .pm-compact-choice.pm-compact-spacer {
  max-height: 8px !important;
  margin-block: 4px !important;
}

/* Give visible choices breathing room inside the frame, without widening the
   gaps between cards or restoring the original tall spacer choices. */
body.pm-layout-ready .pm-compact-choice:not(.pm-compact-spacer, .row-z0bb, .row-1xpv) {
  padding-block: 24px !important;
}

/* Native row introductions are not choice cards. Give their image/text the
   same inset, including the lower edge of side-by-side technique headings. */
body.pm-layout-ready .pm-section-heading {
  padding-block: 24px !important;
}

body.pm-layout-ready .pm-section-heading img {
  margin-block: 0 !important;
}

/* Only the seven technique grade banners contain a leading layout-only BR.
   Keep their authored wording, frame and emblem; remove the redundant line. */
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading :is(h2, h3) > br:first-child {
  display: none;
}

@media (max-width: 560px) {
  body.pm-layout-ready .pm-compact-choice:not(.pm-compact-spacer, .row-z0bb, .row-1xpv) {
    padding-block: 18px !important;
  }

  body.pm-layout-ready .pm-section-heading {
    padding-block: 18px !important;
  }

  body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-thr8).pm-section-heading :is(h2, h3) {
    margin-block: 12px 16px !important;
    font-size: clamp(28px, 8vw, 36px) !important;
    line-height: 1.3;
  }
}

/* Let ordinary cards end with their own content instead of stretching to the
   tallest neighbour. Ability controls keep their dedicated equal-height grid. */
body.pm-layout-ready .pm-fit-height {
  height: auto !important;
}

body.pm-layout-ready .pm-fit-content {
  height: auto !important;
  min-height: 0 !important;
  align-self: flex-start;
  padding-bottom: 6px;
}

body.pm-layout-ready .pm-fit-content > .d-column > .d-column:empty,
body.pm-layout-ready .pm-fit-content .pm-fit-empty {
  display: none !important;
}

body.pm-layout-ready .pm-fit-content p:not(.m-0) {
  margin-block: 0 6px;
  padding-block: 6px !important;
}

body.pm-layout-ready .pm-fit-content p:last-child {
  margin-bottom: 0;
}

body.pm-layout-ready .pm-fit-content > .d-column > img {
  margin-top: 12px !important;
  margin-bottom: 6px !important;
}

/* Purpose: remove only the empty desktop spacer columns between paired cards.
   Keep both card widths and their normal 18px side margins intact. */
body.pm-layout-ready .row-rwer-bg > .row > .col-xl-1:has(> .fullHeight > :is(.choice-026u, .choice-yw7s, .choice-ko67, .choice-9u34, .choice-mrhd, .choice-htq4, .choice-q28m, .choice-mzns, .choice-wcay, .choice-kmko, .choice-2252)) {
  display: none;
}

/* Purpose category and side-card titles; cost selector buttons stay intact. */
body.pm-layout-ready .row-rwer:is(.choice-tk1h, .choice-tdgk, .choice-xms2, .choice-r3sz, .choice-deb5, .choice-e4t4, .choice-gyxj, .choice-kc7j, .choice-wm92, .choice-520d, .choice-1zi4, .choice-382s, .choice-i5h4, .choice-etp2, .choice-f4gp, .choice-8ejm, .choice-tcra, .choice-lt9o, .choice-6ci6, .choice-jlli, .choice-vcec, .choice-clwr) > .d-column > .w-100 > h3 {
  width: calc(100% - 32px);
  margin: 0 auto 7px !important;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(209, 187, 159, 0.72);
  border-image: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.72) 50%, transparent) 1;
}

/* Perks: center the complete text column beside its image. Stacked mobile
   cards have no direct .col heading and keep their existing layout. */
body.pm-layout-ready :is(.row-on0r, .row-a6vd, .row-2je4) > .col:has(> h2) {
  align-self: center;
}

body.pm-layout-ready .pm-compact-choice.pm-stat-card {
  margin-block: 7px !important;
  min-height: calc(100% - 14px);
}

@media (max-width: 560px) {
  body.pm-layout-ready .pm-compact-choice.pm-stat-card {
    margin-block: 6px !important;
    min-height: calc(100% - 12px);
  }
}

body.pm-layout-ready .row-7ekb > .d-column > .w-100 > h3,
body.pm-layout-ready .choice-r69n > .d-column > .d-column > .text-center > .row > .col:last-of-type > h2,
body.pm-layout-ready .choice-r69n > .d-column > .d-column > .text-center > .m-0 > h3 {
  width: calc(100% - 32px);
  margin: 0 auto 7px !important;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(209, 187, 159, 0.72);
  border-image: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.72) 50%, transparent) 1;
}

/* Appearance subsection heading boxes only; keep their text and frame intact. */
body.pm-layout-ready :is(.row-ntsm-bg > .row-ntsm, .row-27ey-bg > .row-27ey, .row-m4v7-bg > .row-m4v7, .row-01g1-bg > .row-01g1, .row-usup-bg > .row-usup) {
  background-color: #000 !important;
}

/* Section introductions are explanatory, not a build selection. Keep their
   original geometry and behaviour, but use the normal unselected palette. */
body.pm-layout-ready :is(.choice-kem2, .choice-93yo, .choice-dv2w, .choice-l5bi, .choice-2s2v, .choice-eoav, .choice-67y8, .choice-ycc9, .choice-fj96, .choice-8w0q, .choice-y25b, .choice-6sa8, .choice-d3ej, .choice-2fpot, .choice-d02ag, .choice-2c30m, .choice-6g582) {
  background-color: #000 !important;
  border-color: #d1bb9f !important;
}

body.pm-layout-ready :is(.choice-kem2, .choice-93yo, .choice-dv2w, .choice-l5bi, .choice-2s2v, .choice-eoav, .choice-67y8, .choice-ycc9, .choice-fj96, .choice-8w0q, .choice-y25b, .choice-6sa8, .choice-d3ej, .choice-2fpot, .choice-d02ag, .choice-2c30m, .choice-6g582) > .d-column > .w-100 > p {
  color: #a8a8a8 !important;
}

/* Difficulty/radiance: separate rewards, the original quote, and addon text.
   Drawbacks share only the cost divider. Impurity uses formatted spans;
   Saint has no displayed cost to separate. */
body.pm-layout-ready .row-7ekb > .d-column > .w-100 > p::before,
body.pm-layout-ready .row-7ekb:not(.choice-r69n) > .d-column > .d-column > .text-center > .m-0 > p::before,
body.pm-layout-ready .row-1866 > .d-column > .w-100:has(> .row) > p::before,
body.pm-layout-ready .row-z6os > .d-column > .w-100 > .row:last-of-type::after,
body.pm-layout-ready .row-1866 > .d-column > .d-column > .text-center > .m-0 > p::before,
body.pm-layout-ready .choice-r69n > .d-column > .d-column > .text-center p > span:first-of-type > span:last-child::before,
body.pm-layout-ready .choice-r69n > .d-column > .d-column > .text-center p > span + span::before {
  content: "";
  display: block;
  width: calc(100% - 12px);
  height: 1px;
  margin: 8px auto 10px;
  background: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.72) 50%, transparent);
}

/* Keep a single divider below all displayed drawback costs, even without a quote. */
body.pm-layout-ready .row-z6os > .d-column > .w-100 > .row:last-of-type::after {
  flex: 0 0 calc(100% - 12px);
}

/* Drawbacks only: tighten text blocks, retaining their line height and the
   frame's separate 24px/18px padding. */
body.pm-layout-ready .row-z6os p:not(.m-0) {
  padding-block: 4px !important;
}

body.pm-layout-ready .row-z6os > .d-column > .w-100 > .row:last-of-type::after {
  margin-block: 6px;
}

/* Shared choice separators: the last displayed cost, then any leading
   prerequisite/exclusion block. Existing difficulty/radiance/drawback rules
   remain the sole cost separator on those cards. */
body.pm-layout-ready .pm-choice-cost-end::after,
body.pm-layout-ready .pm-choice-condition-end::after,
body.pm-layout-ready .pm-choice-condition-divider {
  content: "";
  display: block;
  width: calc(100% - 12px);
  height: 1px;
  margin: 8px auto 10px;
  background: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.72) 50%, transparent);
  font-size: 0;
  line-height: 0;
}

body.pm-layout-ready .pm-choice-cost-end::after {
  flex: 0 0 calc(100% - 12px);
}

/* Score labels use flex; a normal leading text-space alone collapses there. */
body.pm-layout-ready .pm-cost-currency {
  margin-inline-end: 0.22em;
}

/* Technique cards: native row selectors keep the title/cost separators and
   visible C/Cost gap even before presentation classes are synchronized. */
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-e0ba, .row-85qz, .row-thr8) > .d-column > .w-100 > h3::after,
body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-e0ba, .row-85qz, .row-thr8) > .d-column > .w-100 > .row:last-of-type::after {
  content: "";
  display: block;
  width: calc(100% - 12px);
  height: 1px;
  margin: 8px auto 10px;
  background: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.72) 50%, transparent);
  font-size: 0;
  line-height: 0;
}

body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-e0ba, .row-85qz, .row-thr8) > .d-column > .w-100 > .row:last-of-type::after {
  flex: 0 0 calc(100% - 12px);
}

body.pm-layout-ready :is(.row-e0by, .row-dgh6, .row-pc9y, .row-iaq6, .row-svhc, .row-atpu, .row-e0ba, .row-85qz, .row-thr8) > .d-column > .w-100 > .row p.m-0 > span:first-child {
  margin-inline-end: 0.25em !important;
}

/* Keyword priority uses CSS order, never moving Vue-owned cards or rewriting
   purchase arrays. Display-contents joins the three Star-of-the-City rows. */
body.pm-layout-ready .pm-technique-flow-wrapper { display: contents !important; }
body.pm-layout-ready .pm-technique-order-host > :not(.pm-technique-flow-wrapper) { order: -4; }
body.pm-layout-ready .pm-technique-grade-heading { order: -3; }
.pm-technique-keywords {
  order: -2;
  flex: 0 0 calc(100% - 32px);
  width: calc(100% - 32px);
  margin: 12px 16px 18px;
  padding: 16px 18px;
  border: 1px solid #857964;
  border-radius: 12px 0;
  background: #080807;
  color: #d2c8ae;
  text-align: center;
  font-family: HYSinMyeongJo, serif;
}
.pm-technique-keyword-label { margin: 0 0 10px; font-size: 18px; }
.pm-technique-keyword-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pm-technique-keyword-buttons button {
  min-height: 44px;
  padding: 8px 17px;
  border: 1px solid #857964;
  border-radius: 8px 0;
  background: #121210;
  color: #d2c8ae;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.pm-technique-keyword-buttons button[aria-pressed="true"] { background: #393226; border-color: #e8dbb1; color: #fff0cc; }
.pm-technique-keyword-buttons button:focus-visible { outline: 2px solid #fff0cc; outline-offset: 3px; }
.pm-technique-keyword-status { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: #aaa38f; }
@media (max-width: 560px) {
  .pm-technique-keywords { flex-basis: calc(100% - 16px); width: calc(100% - 16px); margin: 10px 8px 14px; padding: 14px 12px; }
  .pm-technique-keyword-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .pm-technique-keyword-buttons button { padding-inline: 4px; font-size: 15px; }
}

/* Main EGO names only; interpretation cards, instructions, and tool abnormalities stay unchanged. */
body.pm-layout-ready :is(.choice-kk9e, .choice-z6gd, .choice-fncv, .choice-3tbi, .choice-8osd, .choice-lmbv, .choice-x12i, .choice-lupx, .choice-143z, .choice-su9x, .choice-gmx7, .choice-9gl9s, .choice-3o9do, .choice-zbfmn, .choice-53oov, .choice-xq1le, .choice-vxno9, .choice-9npez, .choice-wsf6v, .choice-3v2oq, .choice-pkkv1, .choice-yb92u, .choice-9btrm, .choice-tjz3p, .choice-o5v6e, .choice-75qjj, .choice-z5nxm, .choice-772z4, .choice-9ax49, .choice-eowl7, .choice-6wure, .choice-lw27o, .choice-ysi3g, .choice-cupic, .choice-l2app, .choice-kyo8o, .choice-d61ig, .choice-ldbza, .choice-sx52q, .choice-3xz1x, .choice-bt8qz, .choice-agooi, .choice-qwnuz, .choice-8pq72, .choice-156io, .choice-030nz, .choice-qu3we, .choice-79cvl, .choice-im5po, .choice-0hxb0, .choice-zziw0, .choice-s3zk9, .choice-yrheq, .choice-uw8dt, .choice-wrzlv, .choice-netgq, .choice-15kvk, .choice-bxh8t, .choice-gjt4i, .choice-if1q7, .choice-xyl4u, .choice-loouj, .choice-hftk4, .choice-diac6, .choice-t7nru, .choice-6i6as, .choice-o0lyh) :is(h2, .w-100 > h3) {
  border-bottom: 1px solid rgba(209, 187, 159, 0.72);
  border-image: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.72) 50%, transparent) 1;
  padding-bottom: 6px;
  margin-bottom: 7px !important;
}

/* EGO reading order: title, quote, divider, native cost + requirements,
   divider, effect. Native images, cost controls and interpretation cards stay. */
body.pm-layout-ready .pm-ego-reading-layout > :is(h2, h3) {
  border-bottom: 0 !important;
  border-image: none !important;
  padding-bottom: 0;
  margin-bottom: 6px !important;
}

body.pm-layout-ready .pm-ego-reading-layout > :is(.pm-ego-quote, .pm-ego-condition, .pm-ego-description) {
  padding-block: 0 !important;
  margin-block: 0 !important;
}

body.pm-layout-ready .pm-ego-reading-layout > .pm-ego-condition {
  padding-top: 8px !important;
}

body.pm-layout-ready .pm-ego-reading-layout > :is(.pm-ego-quote, .pm-ego-condition)::after {
  content: "";
  display: block;
  width: calc(100% - 12px);
  height: 1px;
  margin: 12px auto;
  background: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.72) 50%, transparent);
  font-size: 0;
  line-height: 0;
}

/* Paired native affiliation choices share a frame without moving Vue nodes. */
body.pm-layout-ready :is(.pm-affiliation-main-column, .pm-affiliation-passive-column) {
  box-sizing: border-box;
  align-self: stretch;
  min-width: 0;
  margin-block: 16px;
  border: 4px groove #d1bb9f;
  background: #000;
}
body.pm-layout-ready .pm-affiliation-main-column { display: flex; flex: 0 0 66.666667%; width: 66.666667%; max-width: 66.666667%; border-right: 0; border-radius: 20px 0 0 0; }
body.pm-layout-ready .pm-affiliation-passive-column { flex: 0 0 33.333333%; width: 33.333333%; max-width: 33.333333%; border-left: 0; border-radius: 0 0 20px 0; padding: 18px 18px 18px 10px; }
body.pm-layout-ready .pm-affiliation-main-column > .fullHeight { display: flex; flex: 1; min-width: 0; height: auto !important; }
body.pm-layout-ready .pm-affiliation-main-card {
  display: grid;
  grid-template-columns: minmax(0, max-content) 88px minmax(0, 1fr);
  grid-template-rows: auto auto minmax(min-content, 1fr);
  align-content: stretch;
  align-self: stretch;
  filter: var(--pm-affiliation-filter, none) !important;
  gap: 0 12px;
  min-height: 440px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 18px !important;
  border: 0 !important;
  border-radius: 16px 0 0 0 !important;
}
body.pm-layout-ready .pm-affiliation-contents { display: contents !important; }
body.pm-layout-ready .pm-affiliation-title { grid-column: 1; grid-row: 1; align-self: center; min-width: 0; text-align: left !important; overflow-wrap: anywhere; }
body.pm-layout-ready .pm-affiliation-main-card:not(:has(.pm-affiliation-logo)) .pm-affiliation-title { grid-column: 1 / -1; }
body.pm-layout-ready .pm-affiliation-logo { grid-column: 2; grid-row: 1; align-self: center; display: block; width: 88px !important; height: auto !important; max-height: 88px; object-fit: contain; margin: 0 !important; }
body.pm-layout-ready .pm-affiliation-condition { grid-column: 1 / -1; grid-row: 2; text-align: left !important; padding: 12px 0 !important; margin: 12px 0 0 !important; border-top: 1px solid #d1bb9f70; }
body.pm-layout-ready .pm-affiliation-addons { grid-column: 1 / -1; grid-row: 3; display: flex !important; flex-direction: column; min-width: 0; padding: 0; }
body.pm-layout-ready .pm-affiliation-addons p { text-align: left !important; padding: 10px 0 !important; }
body.pm-layout-ready .pm-affiliation-addons .m-0 { display: block; }
body.pm-layout-ready .pm-affiliation-sd { margin-top: auto; padding-top: 22px; }
body.pm-layout-ready .pm-affiliation-sd img { display: block; width: auto !important; height: auto !important; max-width: 100%; max-height: 380px; object-fit: contain; margin: 0 auto !important; }
body.pm-layout-ready .pm-affiliation-passive-card { width: 100% !important; margin: 0 !important; padding-block: 12px !important; }
body.pm-layout-ready .pm-affiliation-passive-card p { text-align: left !important; }
body.pm-layout-ready .pm-affiliation-passive-card h3 { padding-bottom: 10px; border-bottom: 1px solid #d1bb9f70; }
body.pm-layout-ready :is(.pm-affiliation-main-column, .pm-affiliation-passive-column):has(.choice-selected) { border-color: #f5face; }
@media (max-width: 780px) {
  body.pm-layout-ready :is(.pm-affiliation-main-column, .pm-affiliation-passive-column) { flex-basis: 100%; width: 100%; max-width: 100%; }
  body.pm-layout-ready .pm-affiliation-main-column { margin-bottom: 0; border-right: 4px groove #d1bb9f; border-bottom: 0; }
  body.pm-layout-ready .pm-affiliation-passive-column { margin-top: 0; border-left: 4px groove #d1bb9f; border-top: 0; padding: 10px 16px 18px; }
  body.pm-layout-ready .pm-affiliation-main-card { grid-template-columns: minmax(0, 1fr) 64px; gap: 0 8px; min-height: 0 !important; padding: 16px !important; }
  body.pm-layout-ready .pm-affiliation-logo { width: 64px !important; max-height: 64px; }
  body.pm-layout-ready .pm-affiliation-title { font-size: 220% !important; }
  body.pm-layout-ready .pm-affiliation-sd img { max-height: 300px; }
}

/* The main card and its interpretation row share the same centered outer edges.
   Keep the original Vue-owned cards and all special extra choices in place. */
body.pm-layout-ready .pm-ego-main-column {
  width: 92% !important;
  max-width: 92% !important;
  flex: 0 0 92% !important;
}

body.pm-layout-ready .pm-ego-interpretation-column {
  width: 30.6666667% !important;
  max-width: 30.6666667% !important;
  flex: 0 0 30.6666667% !important;
}

body.pm-layout-ready .pm-ego-interpretation-column.pm-ego-four-stages {
  width: 23% !important;
  max-width: 23% !important;
  flex-basis: 23% !important;
}

body.pm-layout-ready .pm-ego-spacer-column {
  display: none !important;
}

body.pm-layout-ready :is(.pm-ego-main-column, .pm-ego-interpretation-column) > .fullHeight > .row {
  margin-inline: 6px !important;
}

@media (min-width: 768px) and (max-width: 1199px) {
  body.pm-layout-ready .pm-ego-main-column {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
  }
  body.pm-layout-ready .pm-ego-interpretation-column {
    width: 33.3333333% !important;
    max-width: 33.3333333% !important;
    flex-basis: 33.3333333% !important;
  }
  body.pm-layout-ready .pm-ego-interpretation-column.pm-ego-four-stages {
    width: 25% !important;
    max-width: 25% !important;
    flex-basis: 25% !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  body.pm-layout-ready .pm-ego-interpretation-column.pm-ego-four-stages {
    width: 50% !important;
    max-width: 50% !important;
    flex-basis: 50% !important;
  }
}

@media (max-width: 767px) {
  body.pm-layout-ready :is(.pm-ego-main-column, .pm-ego-interpretation-column, .pm-ego-interpretation-column.pm-ego-four-stages) {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
  }
}

body.pm-layout-ready .choice-r69n > .d-column > .d-column > .text-center > .row {
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

body.pm-layout-ready .choice-r69n > .d-column > .d-column > .text-center > .row > .col {
  width: 50%;
  max-width: 50% !important;
  flex: 0 0 50%;
}

body.pm-layout-ready .choice-r69n > .d-column > .d-column > .text-center > .row > .col:first-of-type > img {
  width: min(92%, 520px) !important;
  margin-top: 16px !important;
  margin-bottom: 12px !important;
}

body.pm-layout-ready .choice-r69n > .d-column > .d-column > .text-center > .row > .col:first-of-type {
  text-align: center !important;
}

/* Ignore only the trailing blank lines outside the formatted description. */
body.pm-layout-ready .choice-r69n > .d-column > .d-column > .text-center > .row > .col:last-of-type > p {
  white-space: normal !important;
  margin-bottom: 0;
  padding-bottom: 0 !important;
}

body.pm-layout-ready .choice-r69n > .d-column > .d-column > .text-center > .row > .col:last-of-type > p > span {
  white-space: pre-line;
}

body.pm-layout-ready .pm-stat-tier-column,
body.pm-layout-ready .pm-stat-hidden-column {
  display: none !important;
}

body.pm-layout-ready .pm-stat-card-grid {
  align-items: stretch;
}

body.pm-layout-ready .pm-stat-card-column {
  width: 25% !important;
  max-width: 25% !important;
  flex: 0 0 25% !important;
  display: flex;
  align-items: stretch;
}

body.pm-layout-ready .pm-stat-card-column > .fullHeight {
  width: 100%;
  height: 100%;
}

body.pm-layout-ready .pm-stat-card {
  width: calc(100% - 20px) !important;
  min-height: calc(100% - 20px);
  margin: 10px !important;
  cursor: default !important;
}

body.pm-layout-ready .pm-stat-card > .d-column {
  min-height: 100%;
}

/* Only the four replacement value icons share a square image slot.
   Contain preserves each supplied drawing without stretching or cropping. */
body.pm-layout-ready :is(.choice-ewzn, .choice-bxla, .choice-iea1, .choice-aobr) > .d-column > img {
  aspect-ratio: 1 / 1;
  height: auto !important;
  object-fit: contain;
  object-position: center;
}

/* Values have no tier descriptions; don't reserve the other stats' text area. */
body.pm-layout-ready :is(.choice-ewzn, .choice-bxla, .choice-iea1, .choice-aobr) .pm-stat-stepper {
  min-height: 0;
}

body.pm-layout-ready :is(.choice-ewzn, .choice-bxla, .choice-iea1, .choice-aobr) .pm-stat-description:empty {
  display: none;
}

body.pm-layout-ready .pm-stat-secondary-card {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
}

body.pm-layout-ready .pm-stat-secondary-card > :is(.col, .d-column) {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 0;
  flex: 0 0 auto !important;
}

body.pm-layout-ready .pm-stat-secondary-card > .col:first-child img {
  display: block;
  margin-inline: auto !important;
}

body.pm-layout-ready .pm-stat-secondary-card > .col > h2 {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(209, 187, 159, 0.78);
  border-image: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.78) 50%, transparent) 1;
}

body.pm-layout-ready .pm-stat-secondary-card .pm-stat-stepper {
  min-height: 0;
  border-top: 1px solid rgba(209, 187, 159, 0.78);
  border-image: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.78) 50%, transparent) 1;
}

.pm-stat-secondary-card .pm-stat-description {
  display: block;
  white-space: pre-line;
}

.pm-stat-resource-card .pm-stat-description {
  display: block;
  white-space: pre-line;
}

.pm-stat-resource {
  margin-top: 14px;
  padding-block: 12px;
  border-top: 1px solid rgba(209, 187, 159, 0.6);
  border-image: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.6), transparent) 1;
  font-size: 19px;
  line-height: 1.5;
}

.pm-stat-resource[hidden] { display: none; }
.pm-stat-resource strong, .pm-stat-resource small { display: block; }
.pm-stat-resource small { color: #aaa79f; font-size: 14px; }

.pm-stat-secondary-card .pm-stat-description:empty {
  display: none;
}

.pm-ability-rules {
  max-width: 960px;
  margin-inline: auto;
  text-align: left;
  white-space: normal;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

/* Three independent guide panels reuse the original card frame design. */
body.pm-layout-ready .choice-w0iw.pm-compact-choice {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
body.pm-layout-ready .choice-w0iw > .d-column {
  padding: 0 !important;
}
body.pm-layout-ready .choice-w0iw .pm-ability-guide-title {
  display: none !important;
}
body.pm-layout-ready .choice-w0iw > .d-column > .d-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
body.pm-layout-ready .choice-w0iw > .d-column > .d-column > .text-center {
  display: flow-root;
  padding: clamp(18px, 2.2vw, 30px);
  border: 3px groove #d1bb9f;
  border-radius: 20px 20px 0 0;
  background: #000;
  box-shadow: 2px 2px 2px 2px #e6e03753;
}
body.pm-layout-ready .choice-w0iw .row:has(.pm-ability-rules) {
  display: flow-root;
  text-align: left;
}
body.pm-layout-ready .choice-w0iw .row:has(.pm-ability-rules) > .col {
  width: auto;
  max-width: none !important;
  text-align: left !important;
}
body.pm-layout-ready .choice-w0iw .row:has(.pm-ability-rules) > .col:has(img) {
  float: left;
  width: 35%;
  margin: 0 26px 14px 0;
}
body.pm-layout-ready .choice-w0iw .text-center:nth-child(even) > .row:has(.pm-ability-rules) > .col:has(img) {
  float: right;
  margin: 0 0 14px 26px;
}
body.pm-layout-ready .choice-w0iw .row:has(.pm-ability-rules) img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  margin: 0 !important;
}
body.pm-layout-ready .choice-w0iw .pm-ability-rules {
  max-width: none;
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
}
body.pm-layout-ready .choice-w0iw .pm-ability-rules > b:first-child {
  font-size: 24px;
  line-height: 1.35;
}
/* In the third guide, the fourth bold element is the health heading.
   Start it below the floated illustration, together with its explanation. */
body.pm-layout-ready .choice-w0iw .text-center:nth-child(3) .pm-ability-rules > b:nth-of-type(4) {
  display: block;
  clear: both;
}
body.pm-layout-ready .choice-w0iw .text-center:nth-child(3) .pm-ability-rules > b:nth-of-type(4) + br {
  display: none;
}
/* Keep the entire rank explanation beside the image; its final line must not
   fall back to the left edge when it extends below the illustration. */
body.pm-layout-ready .choice-w0iw .text-center:first-child > .row:has(.pm-ability-rules) {
  display: grid;
  grid-template-columns: minmax(0, 35%) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
body.pm-layout-ready .choice-w0iw .text-center:first-child > .row:has(.pm-ability-rules) > .col:has(img) {
  float: none;
  width: auto;
  margin: 0;
}
.pm-ability-category-heading {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  padding: 0 12px;
  margin: 12px 0 20px;
}
.pm-ability-category-heading > h2 {
  max-width: 660px;
  margin: 0 auto;
  padding: 20px 24px;
  border: 3px groove #d1bb9f;
  border-radius: 20px 0;
  background: #000;
  box-shadow: 2px 2px 2px 2px #e6e03753;
  color: #fff;
  font-family: HYSinMyeongJo, serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}
@media (max-width: 650px) {
  body.pm-layout-ready .choice-w0iw .row:has(.pm-ability-rules) > .col:has(img),
  body.pm-layout-ready .choice-w0iw .text-center:nth-child(even) > .row:has(.pm-ability-rules) > .col:has(img) {
    float: none;
    width: min(100%, 340px);
    margin: 0 auto 20px;
  }
  body.pm-layout-ready .choice-w0iw .pm-ability-rules { font-size: 16px; line-height: 1.75; }
  body.pm-layout-ready .choice-w0iw .pm-ability-rules > b:first-child { font-size: 22px; }
  body.pm-layout-ready .choice-w0iw .text-center:first-child > .row:has(.pm-ability-rules) {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  body.pm-layout-ready .choice-w0iw .text-center:first-child > .row:has(.pm-ability-rules) > .col:has(img) {
    width: min(100%, 340px);
    margin: 0 auto 20px;
  }
}

body.pm-layout-ready .pm-stat-card > .d-column > .w-100 > h3 {
  width: calc(100% - 32px);
  margin-inline: auto !important;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(209, 187, 159, 0.78);
  border-image: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.78) 50%, transparent) 1;
}

.pm-stat-stepper {
  width: 100%;
  min-height: 225px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 11px 18px 18px;
  color: #fff;
  text-align: center;
  font-family: HYSinMyeongJo, serif;
}

.pm-stat-level {
  min-height: 28px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(209, 187, 159, 0.78);
  border-image: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.78) 50%, transparent) 1;
  font-size: 20px;
  line-height: 1.25;
}

.pm-stat-cost {
  min-height: 32px;
  margin-top: 1px;
  font-size: 24px;
  line-height: 1.3;
}

.pm-stat-description {
  min-height: 7em;
  flex: 1 1 auto;
  /* Inline emphasis belongs to the same paragraph, not separate flex columns. */
  display: block;
  white-space: pre-line;
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  line-height: 1.52;
  overflow-wrap: anywhere;
}

.pm-stat-description > * {
  margin-block: 0;
}

.pm-stat-adjustment {
  min-height: 18px;
  margin: 9px 0 6px;
  color: rgba(255, 245, 200, 0.74);
  font: 13px/1.3 HYSinMyeongJo, serif;
}

.pm-stat-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pm-stat-step {
  min-height: 42px;
  padding: 0 10px 3px;
  border: 1px solid rgba(209, 187, 159, 0.86);
  border-radius: 10px 0 10px 0;
  color: #fff;
  background: rgba(36, 36, 33, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 245, 200, 0.08);
  font: 30px/1 HYSinMyeongJo, serif;
  cursor: pointer;
  transition: color 120ms ease-out, background-color 120ms ease-out, border-color 120ms ease-out;
}

.pm-stat-step:hover:not(:disabled),
.pm-stat-step:focus-visible:not(:disabled) {
  color: var(--pm-sidebar-gold-bright);
  border-color: var(--pm-sidebar-gold-bright);
  background: #3f3f39;
  outline: 2px solid rgba(255, 245, 200, 0.55);
  outline-offset: 2px;
}

.pm-stat-step:disabled {
  color: rgba(255, 255, 255, 0.28);
  border-color: rgba(209, 187, 159, 0.26);
  background: rgba(20, 20, 19, 0.72);
  cursor: not-allowed;
}

.pm-stat-stepper.is-previewing .pm-stat-description {
  display: block;
  white-space: pre-line;
}

@media (max-width: 960px) {
  body.pm-layout-ready .pm-stat-card-column {
    width: 50% !important;
    max-width: 50% !important;
    flex-basis: 50% !important;
  }
}

.pm-sidebar-shell[hidden],
.pm-sidebar-scrim[hidden] {
  display: none !important;
}

.pm-sidebar-panel {
  position: fixed;
  z-index: 9002;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--pm-sidebar-width);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  background: var(--pm-sidebar-panel);
  border-right: 2px solid var(--pm-sidebar-gold);
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.5);
  transform: translateX(calc(-100% - 12px));
  transition: transform 180ms ease-out;
  font-family: HYSinMyeongJo, serif;
}

.pm-sidebar-shell.is-open .pm-sidebar-panel {
  transform: translateX(0);
}

.pm-sidebar-toggle {
  position: fixed;
  z-index: 9003;
  top: 50%;
  left: 0;
  width: 44px;
  height: 72px;
  padding: 0;
  border: 2px solid var(--pm-sidebar-gold);
  border-left: 0;
  border-radius: 0 14px 14px 0;
  color: #fff;
  background: rgba(5, 5, 5, 0.94);
  box-shadow: 3px 2px 8px rgba(0, 0, 0, 0.55);
  transform: translateY(-50%);
  transition: left 180ms ease-out, color 120ms ease-out, background-color 120ms ease-out;
  font-family: Arial, sans-serif;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.pm-sidebar-shell.is-open .pm-sidebar-toggle {
  left: var(--pm-sidebar-width);
}

.pm-sidebar-toggle:hover,
.pm-sidebar-toggle:focus-visible {
  color: var(--pm-sidebar-gold-bright);
  background: #34342f;
  outline: 2px solid var(--pm-sidebar-gold-bright);
  outline-offset: 2px;
}

.pm-sidebar-scrim {
  position: fixed;
  z-index: 9001;
  inset: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: default;
}

.pm-sidebar-title {
  flex: 0 0 auto;
  padding: 9px 16px 8px;
  color: var(--pm-sidebar-gold-bright);
  border-bottom: 1px solid rgba(209, 187, 159, 0.45);
  text-align: center;
  font-size: 24px;
  line-height: 1.1;
}

.pm-section-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 0 14px;
  container-type: size;
}

.pm-section-button,
.pm-subsection-button,
.pm-submenu-back {
  width: 100%;
  min-height: 27px;
  flex: 1 1 0;
  padding: 2px 11px;
  border: 0;
  border-bottom: 1px solid rgba(209, 187, 159, 0.18);
  border-radius: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  font: 18px/1.1 HYSinMyeongJo, serif;
  cursor: pointer;
}

.pm-section-button {
  min-height: 0;
  padding-block: 0;
  font-size: clamp(11px, 3.5cqh, 17px);
  white-space: nowrap;
  border-bottom-color: rgba(209, 187, 159, 0.3);
}

.pm-section-button[data-choice-id="pm-hidden"] {
  border-bottom-color: transparent;
}

.pm-section-list[hidden],
.pm-difficulty-submenu[hidden] {
  display: none !important;
}

.pm-difficulty-submenu {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  padding: 6px 14px 8px;
}

.pm-submenu-title {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(209, 187, 159, 0.42);
  color: var(--pm-sidebar-gold-bright);
  text-align: center;
  font: 21px/1.3 HYSinMyeongJo, serif;
}

.pm-subsection-button {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 10px 18px;
  text-align: left;
}

.pm-subsection-button > span { color: var(--pm-sidebar-gold); }

/* The workshop's longer list stays compact; short landscape screens can scroll. */
#pm-workshop-submenu,
#pm-technique-submenu,
#pm-affiliation-submenu,
#pm-bond-submenu,
#pm-abnormality-submenu,
#pm-goal-submenu {
  overflow-y: auto;
}

/* Bond addons inherited a literal "undefined" family from the legacy engine.
   Restore prose only; keep music/icon fonts, sizes, colors and borders intact. */
body[data-pm-current-section="M12"] .pm-section-screen-current :is(h2, h3, h4, p),
body[data-pm-current-section="M12"] .pm-section-screen-current :is(h2, h3, h4, p) * {
  font-family: HYSinMyeongJo, serif !important;
}

#pm-bond-submenu .pm-subsection-button { min-height: 40px; padding-block: 8px; }

/* Keep approved content cleanup, but restore the native compact text ledger. */
.pm-bond-profile-stats { display: inline; font: inherit; text-align: inherit; }
.pm-bond-stat-group { display: block; }
.pm-bond-group-title { display: none; }
.pm-bond-stat-items, .pm-bond-stat-item, .pm-bond-stat-note { display: inline; }

/* Reference-style bond dossiers; native affinity/variant controls stay intact. */
body[data-pm-current-section="M12"] :is(.pm-bond-native-source, .pm-bond-detail-source) { display: none !important; }
body.pm-layout-ready :is(.pm-bond-dossier-column, .pm-bond-reward-column) { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; min-width: 0; }
.pm-bond-dossier-column .fullHeight, .pm-bond-reward-column .fullHeight { width: 100%; max-width: 1000px; margin-inline: auto; }
body.pm-layout-ready .pm-bond-choice-grid { justify-content: center !important; }
body.pm-layout-ready .pm-bond-affinity-column { flex: 0 0 50% !important; width: 50% !important; max-width: 500px !important; min-width: 0; padding: 4px 12px !important; margin: 0 !important; }
body.pm-layout-ready .pm-bond-affinity-column .pm-bond-affinity-card.pm-compact-choice { padding: 8px 10px !important; margin: 0 !important; min-height: 0 !important; height: auto !important; }
body.pm-layout-ready .pm-bond-affinity-card h3 { display: none !important; }
body.pm-layout-ready .pm-bond-affinity-card p { font-size: 15px !important; line-height: 1.35 !important; margin-block: 4px !important; padding-block: 0 !important; }
body.pm-layout-ready .pm-bond-affinity-card > .d-column > .w-100 { display: flex; flex-direction: column; }
body.pm-layout-ready .pm-bond-affinity-card > .d-column > .w-100 > p { order: -1; font-size: 24px !important; font-weight: 500; line-height: 1.2 !important; color: #fff !important; margin: 0 0 4px !important; }
body.pm-layout-ready .pm-bond-affinity-card > .d-column > .w-100 > p::after { display: none; }
body.pm-layout-ready .pm-bond-affinity-card .pm-choice-cost-end::after { display: none; }
body.pm-layout-ready .pm-bond-affinity-card .pm-bond-affinity-reward { width: 100%; padding: 0 6px 10px; margin: 0; border: 0; border-radius: 0; background: transparent; text-align: left; color: #e1ded7; font: 16px/1.65 HYSinMyeongJo, Georgia, serif; }
.pm-bond-affinity-reward::before { content: ""; display: block; height: 1px; margin: 10px 0 16px; background: linear-gradient(to right, transparent, rgba(209, 187, 159, 0.72) 50%, transparent); }
body.pm-layout-ready .pm-bond-affinity-reward p { font: inherit !important; }
body.pm-layout-ready .pm-bond-merged-reward-column, .pm-bond-footer[hidden] { display: none !important; }
body.pm-layout-ready .pm-bond-dossier-column { padding-bottom: 0 !important; }
.pm-bond-dossier-column .pm-bond-dossier { margin-bottom: 6px; }
.pm-bond-dossier, .pm-bond-footer { color: #e1ded7; font: 16px/1.65 HYSinMyeongJo, Georgia, serif; text-align: left; margin: 10px 12px; }
.pm-bond-dossier, .pm-bond-footer { background: #222; }
.pm-bond-hero, .pm-bond-panel { box-sizing: border-box; border: 4px groove #d1bb9f; border-radius: 18px 0 18px 0; background-color: #000; }
.pm-bond-hero { display: grid; grid-template-columns: 32% minmax(0, 1fr); gap: 0 24px; padding: 18px; }
.pm-bond-banner { display: block; grid-column: 1 / -1; width: 100%; aspect-ratio: 3.6; object-fit: cover; object-position: center 30%; border: 2px solid #ae713c; box-sizing: border-box; }
.pm-bond-quote { grid-column: 1 / -1; padding: 24px 8px; font-size: clamp(22px, 3vw, 32px); line-height: 1.5; text-align: center; white-space: pre-line; border-bottom: 1px solid #bcb3a580; }
.pm-bond-name { align-self: center; margin: 20px 0 !important; text-align: center; color: #eee9df; font: 400 clamp(28px, 4vw, 46px)/1.3 HYSinMyeongJo, Georgia, serif; overflow-wrap: anywhere; }
.pm-bond-summary { align-self: center; padding: 16px 0; white-space: pre-line; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.pm-bond-summary .pm-bond-stat-group { display: block; }
.pm-bond-panel { padding: 18px; margin-top: 10px; min-width: 0; }
.pm-bond-panel-title { font: 700 18px/1.5 HYSinMyeongJo, Georgia, serif; color: #e1ded7; margin: 0 0 10px; }
.pm-bond-copy { white-space: pre-line; overflow-wrap: anywhere; }
.pm-bond-copy + .pm-bond-panel-title { margin-top: 24px; }
.pm-bond-panel-image { display: block; max-width: 100%; max-height: 160px; width: auto; height: auto; margin: 16px auto 0; object-fit: contain; }
body.pm-layout-ready .pm-bond-reward-column { padding-top: 0 !important; }
body.pm-layout-ready .pm-bond-reward-spacer { height: 0 !important; max-height: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: hidden; }
.pm-bond-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 6px; align-items: start; }
.pm-bond-footer > .pm-bond-panel { grid-column: 1 / -1; margin-top: 0; }
.pm-bond-footer > [data-affinity-level="50"] { grid-column: 1; grid-row: 1; }
.pm-bond-footer > [data-affinity-level="100"] { grid-column: 2; grid-row: 1; }
/* Canonical bonds use the compact portrait/ledger reference, not the OC banner. */
.pm-bond-standard-frame { padding: 18px; border: 4px groove #d1bb9f; border-radius: 18px 0 18px 0; background: #000; }
.pm-bond-standard .pm-bond-hero { grid-template-columns: 30% minmax(0, 1fr); gap: 0 18px; padding: 0; border: 0; border-radius: 0; background: none; }
.pm-bond-portrait { margin: 0; min-width: 0; }
.pm-bond-identity { min-width: 0; }
.pm-bond-standard .pm-bond-banner { aspect-ratio: 4 / 3; object-position: center; }
.pm-bond-standard .pm-bond-name { margin: 6px 0 0 !important; font-size: clamp(28px, 3.5vw, 44px); }
.pm-bond-standard .pm-bond-quote { padding: 0 0 10px; border: 0; text-align: left; font-size: clamp(19px, 2.2vw, 24px); line-height: 1.4; }
.pm-bond-standard .pm-bond-summary { padding: 0; font-size: 14px; }
.pm-bond-standard-frame > .pm-bond-panel { position: relative; padding: 0; margin: 22px 0 0; border: 0; border-radius: 0; background: transparent; }
.pm-bond-standard-frame > .pm-bond-panel:first-of-type { padding-top: 14px; margin-top: 14px; border-top: 1px solid #bcb3a580; }
.pm-bond-standard-frame .pm-bond-panel-title { font-size: 18px; }
@media (max-width: 600px) {
  .pm-bond-dossier, .pm-bond-footer { margin-inline: 6px; font-size: 15px; }
  .pm-bond-hero { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 12px; }
  .pm-bond-banner { aspect-ratio: 2.8; }
  .pm-bond-quote { padding: 18px 0; font-size: 21px; }
  .pm-bond-name { margin: 18px 0 4px !important; font-size: 30px; }
  .pm-bond-summary { padding: 10px 0; font-size: 14px; }
  .pm-bond-panel { padding: 14px; }
  body.pm-layout-ready .pm-bond-affinity-column { padding-inline: 6px !important; }
  body.pm-layout-ready .pm-bond-affinity-card .pm-bond-affinity-reward { padding-inline: 0; font-size: 15px; }
  .pm-bond-footer { gap: 12px; }
  .pm-bond-footer > .pm-bond-panel { padding: 12px 10px; }
  .pm-bond-standard-frame { padding: 12px; }
  .pm-bond-standard .pm-bond-hero { grid-template-columns: 34% minmax(0, 1fr); gap: 12px; }
  .pm-bond-standard .pm-bond-name { font-size: 25px; }
  .pm-bond-standard .pm-bond-quote { font-size: 18px; }
  .pm-bond-standard .pm-bond-summary { font-size: 13px; }
  .pm-bond-standard .pm-bond-summary .pm-bond-stat-group { margin-bottom: 6px; }
}

#pm-workshop-submenu .pm-submenu-title {
  padding: 6px 10px;
}

#pm-workshop-submenu .pm-subsection-button {
  flex: 1 0 25px;
  min-height: 25px;
  padding: 2px 18px;
  font-size: 17px;
}

#pm-workshop-submenu .pm-submenu-back {
  min-height: 34px;
}

.pm-submenu-back {
  flex: 0 0 auto;
  min-height: 42px;
  margin-top: auto;
  border-top: 1px solid rgba(209, 187, 159, 0.42);
  border-bottom: 0;
}

#pm-goal-submenu .pm-subsection-button {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 17px;
}

#pm-goal-submenu .pm-submenu-title,
#pm-goal-submenu .pm-submenu-back {
  position: sticky;
  z-index: 1;
  background: #1a1a19;
}

#pm-goal-submenu .pm-submenu-title { top: -6px; padding: 8px 10px; }
#pm-goal-submenu .pm-submenu-back { bottom: -8px; }

.pm-build-button {
  width: 100%;
  min-height: 42px;
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 2px groove var(--pm-sidebar-gold);
  border-radius: 12px 0 12px 0;
  color: #fff;
  background: var(--pm-sidebar-button);
  box-shadow: 2px 2px 3px rgba(230, 224, 55, 0.16);
  font: 21px/1.15 HYSinMyeongJo, serif;
  cursor: pointer;
}

.pm-section-button:hover,
.pm-subsection-button:hover,
.pm-submenu-back:hover {
  color: var(--pm-sidebar-gold-bright);
  background: transparent;
}

.pm-section-button:focus-visible,
.pm-subsection-button:focus-visible,
.pm-submenu-back:focus-visible {
  color: var(--pm-sidebar-gold-bright);
  background: transparent;
  outline: 1px solid var(--pm-sidebar-gold-bright);
  outline-offset: -2px;
}

.pm-build-button:hover,
.pm-build-button:focus-visible {
  color: var(--pm-sidebar-gold-bright);
  background: #3f3f39;
  outline: 2px solid var(--pm-sidebar-gold-bright);
  outline-offset: 1px;
}

.pm-section-button.is-active,
.pm-subsection-button.is-active {
  color: var(--pm-sidebar-gold-bright);
  background: rgba(255, 245, 200, 0.13);
  box-shadow: inset 3px 0 0 var(--pm-sidebar-gold-bright);
}

.pm-sidebar-footer {
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(209, 187, 159, 0.55);
  background: rgba(8, 8, 8, 0.98);
}

.pm-build-button {
  margin-bottom: 10px;
}

.pm-audio-label {
  margin-bottom: 4px;
  color: var(--pm-sidebar-gold-bright);
  text-align: center;
  font-size: 17px;
  line-height: 1;
}

.pm-audio-host {
  min-height: 44px;
}

.pm-audio-host .music-player {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  width: 100% !important;
  height: auto !important;
  visibility: visible !important;
  color: #fff !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: Roboto, sans-serif;
}

.pm-audio-host .music-player--row {
  width: 100%;
  height: 42px !important;
  min-height: 42px;
}

.pm-audio-host .music-player--row > section {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 !important;
}

.pm-audio-host .music-player--button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: #fff !important;
  font-size: 23px !important;
}

.pm-audio-host .music-player--row > section > div:first-of-type {
  min-width: 72px;
  max-width: none !important;
  flex: 1 1 auto;
}

.pm-audio-host .music-player--row > section > div:nth-of-type(n + 2) {
  display: none !important;
}

.pm-audio-host .mdc-slider {
  max-width: none;
  width: 100%;
}

@media (max-width: 560px) {
  :root {
    --pm-sidebar-width: min(86vw, 310px);
  }

  .pm-sidebar-title {
    padding-block: 7px;
    font-size: 21px;
  }

  .pm-section-list {
    padding: 0 11px;
  }

  .pm-section-button {
    font-size: clamp(11px, 3.5cqh, 16px);
  }

  .pm-build-button {
    min-height: 38px;
    padding-block: 5px;
    font-size: 18px;
  }

  .pm-sidebar-footer {
    padding: 8px 10px 9px;
  }

  .pm-build-button {
    margin-bottom: 7px;
  }

  .pm-sidebar-toggle {
    width: 40px;
    height: 64px;
    font-size: 22px;
  }

  body.pm-layout-ready .pm-stat-card-column {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
  }

  body.pm-layout-ready .pm-stat-card {
    width: calc(100% - 16px) !important;
    margin: 8px !important;
  }

  .pm-stat-stepper {
    min-height: 205px;
    padding: 10px 16px 16px;
  }

  .pm-stat-description {
    min-height: 5.5em;
    font-size: 16px;
  }

  .pm-start-screen {
    padding: 14px;
  }

  .pm-start-frame {
    width: 100%;
    min-height: calc(100dvh - 28px);
    padding: 28px 10px;
  }

  .pm-start-eyebrow {
    max-width: 290px;
    margin-bottom: 12px;
    font-size: 9px;
    line-height: 1.5;
    letter-spacing: 0.28em;
    text-indent: 0.28em;
  }

  .pm-start-title {
    max-width: 350px;
    font-size: clamp(22px, 7.2vw, 38px);
  }

  .pm-start-views {
    min-height: 230px;
    margin-top: 16px;
  }

  .pm-start-choice {
    min-height: 50px;
    font-size: 17px;
  }

  .pm-image-cache {
    width: min(300px, 82vw);
    margin-top: 9px;
  }

  .pm-start-menu-view > .pm-image-cache { margin-top: 64px; }

  .pm-image-cache-status {
    font-size: 10px;
  }

  .pm-start-credits-view dl > div {
    gap: 12px;
  }

  .pm-start-credits-view p {
    max-width: 320px;
    margin-top: 12px;
    padding-inline: 12px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pm-start-screen,
  .pm-start-frame,
  .pm-start-menu-view,
  .pm-start-credits-view,
  .pm-start-choice,
  .pm-start-choice::before,
  .pm-start-choice::after,
  .pm-image-cache-track span {
    transition: none;
  }

  .pm-start-choice.is-activating,
  .pm-start-choice.is-activating::before,
  .pm-start-choice.is-activating::after {
    animation: none;
  }

  .pm-sidebar-panel,
  .pm-sidebar-toggle {
    transition: none;
  }
}

/* Outgoing damage is a derived preview, never an ability or cost mutation. */
.pm-damage-calculator {
  box-sizing: border-box;
  width: min(100% - 24px, 1040px);
  margin: 20px auto 32px;
  padding: 20px 24px;
  border: 1px solid #817658;
  border-radius: 3px;
  background: #11110f;
  color: #eee9dd;
  font-family: HYSinMyeongJo, serif;
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
}

.pm-damage-calculator *,
.pm-damage-calculator *::before,
.pm-damage-calculator *::after {
  box-sizing: border-box;
}

.pm-damage-title {
  margin: 0 0 8px;
  color: #e8dbb1;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.4;
}

.pm-damage-intro,
.pm-damage-note,
.pm-damage-transient-note {
  margin: 8px 0 16px;
  font-size: 14px;
  color: #c3bfb3;
  overflow-wrap: anywhere;
}

.pm-damage-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 20px;
}

.pm-damage-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  margin: 0;
}

.pm-damage-attack-field {
  grid-column: 1 / -1;
}

.pm-damage-label,
.pm-damage-bullet-field {
  color: #e8dbb1;
  font-size: 16px;
}

.pm-damage-input,
.pm-damage-select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #77705d;
  border-radius: 2px;
  background: #22221e;
  color: #f5f2e9;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  color-scheme: dark;
}

.pm-damage-input:focus-visible,
.pm-damage-select:focus-visible,
.pm-damage-bullet:focus-visible {
  outline: 2px solid #e8dbb1;
  outline-offset: 3px;
}

.pm-damage-input:disabled {
  opacity: 1;
  border-color: #454239;
  background: #191916;
  color: #bbb6a7;
  cursor: default;
}

.pm-damage-input::placeholder {
  color: #aaa598;
}

.pm-damage-hint {
  color: #b8b2a5;
  font-size: 12px;
  line-height: 1.5;
}

.pm-damage-bullet-field {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  cursor: pointer;
}

.pm-damage-bullet {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #d6c58f;
}

.pm-damage-result-box {
  margin-top: 16px;
  padding: 16px 0;
  border-block: 1px solid #57513f;
}

.pm-damage-result {
  display: block;
  color: #f4e8c2;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.pm-damage-formula {
  margin: 8px 0 0;
  color: #d3cdbd;
  font-size: 14px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.pm-damage-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 24px;
  margin-top: 16px;
}

.pm-damage-subtitle {
  margin: 0 0 6px;
  color: #e2d8b9;
  font-size: 16px;
  font-weight: 500;
}

.pm-damage-applied,
.pm-damage-pending {
  margin: 0;
  padding-left: 20px;
  color: #bdb8ab;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.pm-damage-applied li,
.pm-damage-pending li {
  margin-bottom: 5px;
}

.pm-damage-pending-group.has-pending .pm-damage-pending {
  color: #e3c58f;
}

.pm-damage-transient-note {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid #353229;
  font-size: 12px;
}

/* Six compact directions share preset/custom amounts; all twelve native
   counters remain available to the engine and legacy saves. */
body.pm-layout-ready .pm-exchange-heading-column {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
}

body.pm-layout-ready .pm-exchange-spacer,
body.pm-layout-ready .pm-exchange-unit-hidden,
body.pm-layout-ready .pm-exchange-native-score,
body.pm-layout-ready .pm-exchange-native-controls,
body.pm-layout-ready .pm-exchange-choice > .d-column > .w-100 > h3 {
  display: none !important;
}

body.pm-layout-ready .pm-exchange-heading {
  width: min(calc(100% - 20px), 948px) !important;
  margin: 14px auto 7px !important;
  padding: 14px 20px !important;
}

body.pm-layout-ready .pm-exchange-heading > .d-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 6px;
}

body.pm-layout-ready .pm-exchange-heading > .d-column > img {
  grid-column: 1;
  grid-row: 1;
  width: clamp(220px, 24vw, 320px) !important;
  max-width: 100%;
  height: auto !important;
  margin: 0 !important;
}

body.pm-layout-ready .pm-exchange-heading > .d-column > :not(img) {
  grid-column: 1;
}

body.pm-layout-ready .pm-exchange-heading h3,
body.pm-layout-ready .pm-exchange-heading h3 span {
  font-size: 30px !important;
}

body.pm-layout-ready .pm-exchange-heading p {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 16px;
}

.pm-exchange-units,
.pm-exchange-hint,
.pm-exchange-rate,
.pm-exchange-panel {
  font-family: HYSinMyeongJo, serif;
}

.pm-exchange-units {
  display: flex;
  justify-self: stretch;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-exchange-units button {
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid #857964;
  border-radius: 9px 0;
  background: #121210;
  color: #d2c8ae;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.pm-exchange-units button[aria-pressed="true"] {
  border-color: #d1bb9f;
  background: #393226;
  color: #fff0cc;
}

.pm-exchange-units button:focus-visible,
.pm-exchange-controls button:focus-visible,
.pm-exchange-input:focus-visible {
  outline: 2px solid #e8dbb1;
  outline-offset: 2px;
}

body.pm-layout-ready .pm-exchange-column {
  width: min(33.333333%, 320px) !important;
  max-width: 320px !important;
  flex: 0 0 min(33.333333%, 320px) !important;
}

/* Keep the six directions in a centered three-column group, even on wide
   screens; these margins do not change the surrounding ability columns. */
body.pm-layout-ready .pm-exchange-column:has(:is(.choice-eo2v, .choice-qp2p)) {
  margin-left: max(0px, calc((100% - 960px) / 2)) !important;
}

body.pm-layout-ready .pm-exchange-column:has(:is(.choice-dauo, .choice-or01)) {
  margin-right: max(0px, calc((100% - 960px) / 2)) !important;
}

body.pm-layout-ready .pm-exchange-choice {
  width: calc(100% - 12px) !important;
  margin: 6px !important;
  padding: 10px 12px !important;
  border-width: 2px !important;
  border-radius: 12px 0 !important;
}

.pm-exchange-rate {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: #e0e0e0;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.pm-exchange-rate > span {
  white-space: nowrap;
}

.pm-exchange-rate small {
  color: #a9a391;
  font-size: 12px;
}

body.pm-layout-ready .pm-exchange-heading .pm-exchange-hint {
  margin-top: 4px !important;
  color: #aaa391;
  font-size: 12px;
}

.pm-exchange-panel {
  margin: 0;
}

.pm-exchange-input-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
  color: #d5d2c8;
  font-size: 14px;
}

.pm-exchange-input-wrap[hidden] {
  display: none;
}

.pm-exchange-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #857964;
  border-radius: 7px;
  background: #121210;
  color: #fff;
  font: 18px/1.3 HYSinMyeongJo, serif;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pm-exchange-input[aria-invalid="true"] {
  border-color: #d29483;
}

/* Currency colors belong to the single letter, never Cost or its amount. */
body.pm-layout-ready .pm-cost-display,
body.pm-layout-ready .pm-cost-display :not(.pm-cost-letter) { color: inherit !important; }
body.pm-layout-ready .pointbar-center--viewer .pm-cost-display { color: #e0e0e0 !important; }
body.pm-layout-ready .pm-cost-letter[data-currency="A"] { color: #ff0e00 !important; }
body.pm-layout-ready .pm-cost-letter[data-currency="B"] { color: #1800ff !important; }
body.pm-layout-ready .pm-cost-letter[data-currency="C"] { color: #fff300 !important; }

/* User-defined keyword palette; only the keyword text receives emphasis. */
/* Rank colors come from the same abilityRanks palette as the ability cards. */
body.pm-layout-ready .pm-rank { color: var(--pm-rank-color) !important; font-weight: 700 !important; }
body.pm-layout-ready .pm-keyword { font-weight: 700 !important; }
body.pm-layout-ready .pm-keyword[data-keyword="화상"] { color: #f05a50 !important; }
body.pm-layout-ready .pm-keyword[data-keyword="출혈"] { color: #f59b45 !important; }
body.pm-layout-ready .pm-keyword[data-keyword="진동"] { color: #f3d45c !important; }
body.pm-layout-ready .pm-keyword[data-keyword="파열"] { color: #71c86c !important; }
body.pm-layout-ready .pm-keyword[data-keyword="침잠"] { color: #72c6ef !important; }
body.pm-layout-ready .pm-keyword[data-keyword="호흡"] { color: #7895db !important; }
body.pm-layout-ready .pm-keyword[data-keyword="충전"] { color: #b78ae8 !important; }

.pm-exchange-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 320px;
  margin-inline: auto;
}

.pm-exchange-controls button {
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  padding: 5px;
  border: 1px solid #857964;
  border-radius: 8px 0;
  background: #1a1813;
  color: #f1ead7;
  font: inherit;
  font-size: 24px;
  cursor: pointer;
}

.pm-exchange-controls button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.pm-exchange-total {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: #dedbd2;
  text-align: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.pm-exchange-total small {
  color: #aaa391;
  font-size: 11px;
}

.is-custom .pm-exchange-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.is-custom .pm-exchange-controls button {
  grid-row: 1;
  font-size: 14px;
}

.is-custom .pm-exchange-total {
  grid-column: 1 / -1;
  grid-row: 2;
  flex-direction: row;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
}

body.pm-layout-ready .pm-exchange-choice .pm-exchange-status {
  margin: 8px 0 0 !important;
  padding: 0 !important;
  color: #c4b99f;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.pm-exchange-status:empty {
  display: none;
}

@media (max-width: 600px) {
  body.pm-layout-ready .pm-exchange-heading {
    width: calc(100% - 16px) !important;
    margin-inline: 8px !important;
    padding: 14px !important;
  }

  body.pm-layout-ready .pm-exchange-heading > .d-column {
    gap: 8px;
  }

  body.pm-layout-ready .pm-exchange-heading > .d-column > .pm-exchange-units {
    grid-column: 1 / -1;
    margin-top: 4px;
  }

  .pm-exchange-units button {
    flex: 1;
    padding-inline: 10px;
    font-size: 14px;
  }

  body.pm-layout-ready .pm-exchange-column {
    width: 50% !important;
    max-width: 50% !important;
    flex-basis: 50% !important;
  }

  body.pm-layout-ready .pm-exchange-choice {
    width: calc(100% - 12px) !important;
    margin-inline: 6px !important;
    padding: 10px 6px !important;
  }

  .pm-exchange-rate {
    gap: 2px;
    flex-direction: column;
    align-items: center;
    font-size: 14px;
  }

  .pm-exchange-arrow {
    display: none;
  }

  .pm-exchange-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .pm-exchange-controls button {
    grid-row: 2;
  }

  .pm-exchange-total {
    grid-column: 1 / -1;
    grid-row: 1;
    flex-direction: row;
    justify-content: center;
    align-items: baseline;
    gap: 5px;
    font-size: 12px;
    white-space: nowrap;
  }

  .pm-exchange-units {
    gap: 5px;
  }

  .pm-exchange-units button {
    white-space: nowrap;
    padding-inline: 7px;
  }
}

@media (max-width: 560px) {
  .pm-damage-calculator {
    width: calc(100% - 16px);
    margin-block: 12px 24px;
    padding: 16px 14px;
  }

  .pm-damage-controls,
  .pm-damage-details {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .pm-damage-title {
    font-size: 23px;
  }
}
/* Revised traits: compact controls, inherited original typography. */
.pm-build-redistribute { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; margin-top: 5px; }
.pm-build-redistribute[hidden] { display: none; }
.pm-build-redistribute button { color: #c6c7c9; background: #191a1c; border: 1px solid #48494c; border-radius: 3px; padding: 3px 7px; font: inherit; font-size: 12px; }
.pm-build-redistribute button:disabled { opacity: .35; cursor: default; }
.pm-build-redistribute small { flex-basis: 100%; color: #a6a7aa; font-size: 11px; }
.pm-build-redistribute-note { color: #bcbec2; font-size: 13px; line-height: 1.7; }
.pm-mentor-affinity { margin: 14px 0 5px; text-align: left; font: 15px/1.6 HYSinMyeongJo, Georgia, serif; }
.pm-mentor-affinity label { display: block; color: #d0d1d3; }
.pm-mentor-affinity select { display: block; width: 100%; margin-top: 8px; padding: 8px; background: #141517; color: #e1e1e3; border: 1px solid #57595d; border-radius: 3px; font: inherit; }
.pm-mentor-affinity-status, .pm-mentor-affinity-notice, .pm-mentor-affinity-bonus { color: #bfc1c5; font: 13px/1.6 HYSinMyeongJo, Georgia, serif; margin-top: 7px; }
.pm-crafted-weapon-error { color: #ee9b9b; font-size: 13px; line-height: 1.6; }
.pm-crafted-weapon-cancel { font: inherit; color: inherit; }
