/* Patch covers use the same editorial type and warm metallic accents as the journal. */
.kb-balance {
  --balance-up: #9fe1b6;
  --balance-down: #ffaaa9;
  --balance-flat: #a2c8ec;
  --balance-line: #453d42;
  container-type: inline-size;
}
.kb-balance [hidden] { display: none !important; }
.kb-balance .balance-cover {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: end;
  min-height: clamp(204px, 22vw, 286px);
  overflow: hidden;
  padding: clamp(22px, 3.1vw, 48px);
  border: 1px solid #60504a;
  border-radius: 10px;
  background: radial-gradient(ellipse at 88% 20%, #58403c, transparent 60%), #211b21;
}
.balance-cover > img, .balance-cover::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.balance-cover > img { object-fit: cover; object-position: 72% 50%; }
.balance-cover::after {
  content: '';
  background: linear-gradient(90deg, #160f17e8, #19111b92 47%, transparent 75%),
              linear-gradient(0deg, #140f1670, transparent 50%);
}
.balance-cover-copy { max-width: min(61%, 680px); }
.kb-balance .balance-byline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: #e6c8a0; }
.kb-refined .kb-balance .balance-byline h2, .balance-byline time {
  margin: 0; padding: 0; border: 0; background: none;
  font: 650 12px/1.4 var(--atlas-ui); letter-spacing: .08em;
}
.kb-refined .kb-balance .balance-byline h2 { color: #efc38f; text-transform: uppercase; }
.balance-byline time { color: #d1c6c4; font-weight: 450; letter-spacing: .01em; }
.balance-byline time:not(:empty)::before { content: ''; display: inline-block; width: 16px; height: 1px; margin-inline-end: 10px; vertical-align: middle; background: #a99075; }
.kb-refined .kb-balance .balance-cover h3 {
  margin: 10px 0 0; color: #fff2dd;
  font: 600 clamp(38px, 4.2vw, 70px)/1.02 var(--book-serif);
  letter-spacing: -.035em; overflow-wrap: anywhere; text-wrap: balance;
}
.kb-refined .kb-balance .balance-cover p {
  max-width: 47ch; margin: 13px 0 0; color: #e4d8d1;
  font: 450 clamp(14px, 1.15vw, 17px)/1.5 var(--atlas-ui);
}
.balance-byline [data-balance-version], .balance-edition-version {
  padding: 3px 8px; border: 1px solid #84694f; border-radius: 4px; color: #ffdbad;
  background: #302522; font: 650 12px/1.35 var(--atlas-ui); font-variant-numeric: tabular-nums;
}
.balance-archive {
  margin: 16px 0 0; border: 1px solid #584a44; border-radius: 8px;
  background: linear-gradient(112deg,#30282a,#211f24 65%); color: #f2e5d7;
}
.balance-archive > summary { display: flex; align-items: center; gap: 13px; padding: 13px 18px; }
.balance-archive-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #695443; border-radius: 5px; color: #e6ba88; font-size: 21px; }
.balance-archive-caption { display: flex; flex: 1; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; font: 600 17px/1.4 var(--atlas-ui); }
.balance-archive-caption > span, .balance-editions time { color: #cfbfaf; font: 500 13px/1.5 var(--atlas-ui); }
.balance-archive-body { padding: 12px 16px 14px; border-top: 1px solid var(--balance-line); }
.balance-order { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.balance-order button, .balance-editions button { font-family: var(--atlas-ui); cursor: pointer; }
.balance-order button { min-height: 34px; padding: 5px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #d7cbc3; font-size: 13px; }
.balance-order button[aria-pressed=true] { border-color: #76604f; background: #3a2f2b; color: #ffdbac; }
.kb-balance .balance-editions { display: grid; gap: 4px; max-height: 280px; overflow: auto; }
.kb-balance .balance-editions li { margin: 0; }
.balance-editions button { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; width: 100%; min-height: 44px; padding: 8px 12px; text-align: start; border: 0; border-inline-start: 2px solid transparent; background: #242126; color: #f6ebdc; }
.balance-editions button[aria-current=true] { border-inline-start-color: #e0b382; background: #332a2c; }
.balance-editions button:hover, .balance-order button:hover { background: #3b3032; }
.balance-editions button span { flex: 1 1 9em; font-size: 15px; font-weight: 600; }
.balance-archive button:focus-visible { outline: 2px solid #e7c299; outline-offset: -2px; }
.kb-balance .balance-category { margin: 24px 0 0; }
.kb-balance summary { cursor: pointer; list-style: none; }
.kb-balance summary::-webkit-details-marker { display: none; }
.balance-category > summary {
  display: flex; align-items: center; gap: 13px; padding: 4px 2px 13px;
  color: #e2c5a3; font: 600 16px/1.45 var(--atlas-ui);
}
.balance-category > summary::after { content: ''; height: 1px; background: var(--balance-line); flex: 1; }
.balance-chevron { display: inline-block; width: 8px; height: 8px; margin: 0 4px; flex: none; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.balance-category .balance-chevron { order: 1; }
.kb-balance details[open] > summary .balance-chevron { transform: rotate(225deg); }
.kb-balance summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.kb-balance .balance-comparison {
  margin: 0 0 12px;
  border: 1px solid var(--balance-line); border-radius: 9px; overflow: hidden;
  background: #201e22;
}
.balance-comparison-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px clamp(16px, 2vw, 30px);
  background: linear-gradient(108deg, #30272a, #252127 65%, #231f24);
}
.kb-balance .balance-comparison h4 { margin: 0; color: #f4e8db; font: 580 clamp(20px, 2vw, 30px)/1.15 var(--book-serif); text-wrap: balance; }
.kb-refined .balance-comparison-head p { margin: 6px 0 0; font-size: 14px; }
.balance-values { display: flex; flex: none; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; }
.balance-values b { min-width: 52px; color: #ded7d1; text-align: center; font: 650 25px/1.1 var(--atlas-ui); overflow-wrap: anywhere; }
.balance-values small { display: block; margin: 0 0 3px; color: #c2b6b5; font: 500 11px/1.4 var(--atlas-ui); }
.balance-values .balance-more { color: var(--balance-up); }
.balance-values .balance-less { color: var(--balance-down); }
.balance-arrow { color: #a09599; font: 400 20px/1 var(--atlas-ui); }
.kb-balance ul { margin: 0; padding: 0; list-style: none; }
.balance-subject-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr));
  gap: 1px; border-top: 1px solid var(--balance-line); background: var(--balance-line);
}
.kb-balance .balance-subject-card {
  --class-accent: #d0b58c;
  margin: 0; min-width: 0; padding: 14px clamp(14px, 1.6vw, 24px) 19px;
  background: linear-gradient(140deg, #29252a, #211f23 75%);
}
.balance-subject-card[data-class="assassin"] { --class-accent: #c7a5e3; }
.balance-subject-card[data-class="ranger"] { --class-accent: #d2b687; }
.balance-subject-card[data-class="summoner"] { --class-accent: #a4c5d9; }
.kb-balance .balance-subject-card h5 { display: flex; gap: 9px; align-items: center; margin: 0 0 11px; color: var(--class-accent); font: 650 13px/1.4 var(--atlas-ui); }
.balance-subject-card h5::before { content: ''; width: 5px; height: 5px; transform: rotate(45deg); background: currentColor; }
.kb-balance .balance-subjects { display: grid; gap: 9px; }
.kb-balance .balance-subjects li { display: flex; align-items: center; gap: 10px; margin: 0; color: #eee8e1; font: 500 14px/1.33 var(--atlas-ui); overflow-wrap: anywhere; }
.balance-subjects img { width: 38px; height: 38px; flex: 0 0 38px; object-fit: contain; border: 1px solid #5d504d; border-radius: 6px; background: #171518; }
.balance-unchanged { margin-top: 16px; padding: 0 16px; color: var(--balance-flat); border: 1px solid #36414b; border-radius: 7px; background: #1b2027; }
.balance-unchanged > summary { display: flex; align-items: center; gap: 9px; padding: 12px 0; font: 550 14px/1.5 var(--atlas-ui); }
.balance-unchanged summary b { min-width: 25px; text-align: center; border: 1px solid #4c5b68; border-radius: 4px; font-size: 12px; }
.balance-unchanged .balance-chevron { margin-inline-start: auto; }
.kb-balance .balance-unchanged ul { display: flex; flex-wrap: wrap; gap: 6px 15px; padding: 0 0 14px; }
.kb-balance .balance-unchanged li { margin: 0; font: 450 13px/1.5 var(--atlas-ui); }
@container (max-width: 680px) {
  .kb-balance .balance-cover { min-height: 230px; padding: 19px; }
  .balance-cover-copy { max-width: 79%; }
  .balance-cover > img { object-position: 76% center; }
  .balance-cover::after { background: linear-gradient(90deg, #160f17f5, #160f17af 60%, #160f1740), linear-gradient(0deg, #171119a6, transparent 80%); }
  .balance-comparison-head { flex-wrap: wrap; padding: 15px; gap: 12px; }
  .balance-values { max-width: 100%; }
  .balance-subject-card { padding: 13px 15px; }
}
@container (max-width: 470px) {
  .balance-subject-grid { grid-template-columns: 1fr; }
  .balance-cover-copy { max-width: 94%; }
  .balance-byline { row-gap: 3px; }
  .balance-byline time:not(:empty)::before { width: 8px; }
  .balance-comparison-head { align-items: start; flex-direction: column; }
  .balance-values { align-self: start; }
}

.balance-aura > header, .balance-aura > section { padding: clamp(14px, 2.4vw, 24px); }
.balance-aura > header small { color: var(--accent); }
.balance-aura h4, .balance-aura h5 { margin: .3rem 0; color: var(--ink); }
.balance-aura h4 { font-size: 1.35rem; }
.balance-aura h5 { font-size: 1.05rem; }
.balance-aura > header p { margin: .5rem 0 0; max-width: 74ch; color: var(--secondary); }
.balance-aura > section { border-top: 1px solid var(--rule); }
.balance-aura summary { cursor: pointer; color: var(--accent); padding: .55rem 0; }
.balance-aura .balance-subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.balance-aura-levels { width: 100%; margin: .65rem 0; border-collapse: collapse; }
.balance-aura-levels caption { text-align: start; color: var(--secondary); margin-bottom: .45rem; }
.balance-aura-levels :is(th, td) { text-align: start; vertical-align: top; padding: .45rem .6rem; border-bottom: 1px solid var(--rule); }
.balance-aura-levels th, .balance-aura-levels td:nth-child(2) { white-space: nowrap; }
.balance-aura-stat { display: inline-block; margin-inline-end: 1rem; }
.balance-aura-stat b { color: var(--balance-more, #a7d6ab); }
@container (max-width: 570px) {
  .balance-aura-levels :is(th, td) { padding: .4rem .28rem; font-size: .83rem; }
  .balance-aura-stat { display: block; margin: 0; }
}

.kb-balance .balance-recipe {
  margin: 0 0 8px; border: 1px solid var(--balance-line); border-radius: 8px;
  overflow: hidden; background: #201e22;
}
.balance-recipe > summary {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px;
  background: linear-gradient(110deg, #30272a, #262226 75%); color: #f2e6d9;
}
.balance-recipe > summary:hover { background: #352d30; }
.balance-recipe > summary strong { font: 600 clamp(16px, 1.5vw, 21px)/1.25 var(--book-serif); overflow-wrap: anywhere; }
.balance-recipe .balance-chevron { margin-inline-start: auto; color: #d8bd97; }
.balance-recipe img { box-sizing: border-box; width: 34px; height: 34px; object-fit: contain; flex: none; border: 1px solid #554b48; background: #19191c; border-radius: 5px; }
.kb-balance .balance-recipe table { width: 100%; margin: 0; border-collapse: collapse; font: 500 14px/1.35 var(--atlas-ui); }
.balance-recipe :is(th, td) { padding: 7px 14px; border: 0; border-top: 1px solid var(--balance-line); }
.balance-recipe thead th { font-size: 12px; font-weight: 600; color: #c7bcb3; background: #262226; }
.balance-recipe th:first-child { text-align: start; }
.balance-recipe th:not(:first-child), .balance-recipe td { width: 16%; text-align: end; }
.balance-recipe td { color: #c4bcb8; white-space: nowrap; font-variant-numeric: tabular-nums; }
.balance-recipe-material { display: flex; align-items: center; gap: 10px; font-weight: 500; overflow-wrap: anywhere; }
.balance-recipe-material img { width: 29px; height: 29px; }
.balance-recipe-material small { display: block; margin-top: 2px; font: 600 11px/1.25 var(--atlas-ui); }
.balance-recipe [data-change="added"], .balance-recipe [data-change="decreased"] { --recipe-ink: var(--balance-up); }
.balance-recipe [data-change="removed"], .balance-recipe [data-change="increased"] { --recipe-ink: var(--balance-down); }
.balance-recipe tr[data-change] small, .balance-recipe tr[data-change] td:last-child,
.balance-recipe tr[data-change="removed"] td:nth-child(2) { color: var(--recipe-ink); font-weight: 650; }
@container (max-width: 520px) {
  .balance-recipe > summary { gap: 8px; padding: 8px; }
  .balance-recipe :is(th, td) { padding: 7px 5px; }
  .balance-recipe-material { gap: 5px; font-size: 12px; }
  .balance-recipe-material img { width: 24px; height: 24px; }
  .balance-recipe thead th { font-size: 11px; }
  .balance-recipe td { font-size: 12px; }
}

/* Patch topics and compact comparisons */
.balance-topic-filters {
  display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-block:18px 6px;
}
.balance-topic-filters button {
  flex:0 0 auto; min-height:36px; padding:6px 13px; border:1px solid var(--balance-line);
  border-radius:5px; background:#201e22; color:#e4dbcf;
  font:580 13px/1.35 var(--atlas-ui); cursor:pointer;
}
.balance-topic-filters button:hover { background:#302a2b; }
.balance-topic-filters button[aria-pressed="true"] { color:#ffe2b7; border-color:#ae8661; background:#3c302a; box-shadow:inset 0 -2px #d6a472; }
.balance-topic-filters button:focus-visible { outline:2px solid #fad5a7; outline-offset:2px; }
.kb-balance [data-balance-rows] > details[hidden] { display:none; }

.balance-topic-card {
  margin-block:0 10px; overflow:hidden; border:1px solid var(--balance-line); border-radius:9px; background:#211f23;
}
.balance-topic-card > header { padding:16px 20px 12px; background:linear-gradient(100deg,#30282a,#242126 75%); }
.kb-refined .kb-balance .balance-topic-card h4 { margin:0; color:#f6e6ce; font:600 clamp(19px,2vw,25px)/1.18 var(--book-serif); }
.kb-refined .kb-balance .balance-topic-card header p { margin:6px 0 0; color:#d9cec3; font:450 14px/1.45 var(--atlas-ui); }
.balance-topic-subject { display:inline-flex; align-items:center; gap:9px; vertical-align:middle; }
.balance-topic-subject img { width:28px; height:28px; flex:none; object-fit:contain; }
.balance-topic-card header img { width:34px; height:34px; }
.kb-balance table.balance-topic-table { width:100%; margin:0; border:0; border-collapse:collapse; font:500 14px/1.4 var(--atlas-ui); font-variant-numeric:tabular-nums; }
.balance-topic-table caption { padding:10px 16px; color:#d3c5b5; text-align:start; font-size:12px; }
.kb-balance .balance-topic-table :is(th,td) { padding:8px 12px; border:0; border-top:1px solid #383339; text-align:end; color:#e7ded6; }
.kb-balance .balance-topic-table thead th { color:#c9b6a1; font-size:12px; font-weight:650; background:#252126; }
.kb-balance .balance-topic-table :is(th,td):first-child { text-align:start; padding-inline-start:18px; }
.kb-balance .balance-topic-table tbody th { font-weight:550; }
.balance-topic-table :is(td,th) b { white-space:nowrap; }
.balance-topic-table .balance-more { color:var(--balance-up); }
.balance-topic-table .balance-less { color:var(--balance-down); }
.balance-pair-arrow,.balance-entry-variant { color:#c3b5aa; }
.balance-entry-variant { display:inline-block; margin-inline-start:7px; font-weight:450; }
.balance-rank-table td { white-space:nowrap; }
.balance-milestone { border-top:1px solid var(--balance-line); }
.balance-milestone > summary { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 18px; color:#eddfce; font:500 14px/1.4 var(--atlas-ui); }
.balance-milestone > summary:hover { background:#302a2d; }
@media (max-width:680px) {
  .balance-topic-filters { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:thin; padding:3px 2px 6px; }
  .balance-topic-filters button { min-height:42px; padding-inline:11px; }
  .balance-topic-card > header { padding:13px 12px 10px; }
  .kb-balance table.balance-topic-table { font-size:13px; }
  .kb-balance .balance-topic-table :is(th,td) { padding:7px 5px; }
  .kb-balance .balance-topic-table :is(th,td):first-child { padding-inline-start:9px; }
  .balance-milestone > summary { min-height:44px; padding:8px 12px; }
  .balance-entry-variant { display:block; margin-inline-start:0; }
  .balance-rank-table .balance-pair-arrow { display:inline-block; font-size:10px; }
}
@media (max-width:450px) {
  .kb-balance .balance-rank-table :is(th,td) { padding:6px 3px; font-size:12px; }
  .balance-rank-table td:has(.balance-pair-arrow) { white-space:normal; }
  .balance-rank-table .balance-pair-arrow { margin-inline:2px; }
}

.balance-topic-link { display:inline-flex; align-items:center; padding:9px 0; color:#efc591; text-underline-offset:3px; }
.kb-balance .balance-chest-drops :is(th,td):not(:last-child) { text-align:start; }
.balance-chest-drops td:last-child { white-space:nowrap; color:#f3d3a8; font-weight:650; }
.balance-chest-group { padding:0; }
.kb-refined .kb-balance .balance-chest-group h5 { margin:0; padding:12px 18px; color:#eedabe; font:600 17px/1.3 var(--book-serif); }
.balance-chest-group + .balance-chest-group { border-top:1px solid var(--balance-line); }
.balance-chest-drops .balance-scroll-icon { position:relative; display:inline-grid; flex:0 0 34px; width:34px; height:34px; place-items:center; overflow:hidden; border-radius:4px; }
.balance-chest-drops .balance-scroll-icon img { display:block; width:100%; height:100%; object-fit:contain; }
