.boss-guide-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.boss-guide-controls label { min-width: 0; }
.boss-guide-mode-row, .boss-guide-opponents { display: contents; }
.boss-guide-mode-row select, .boss-guide-opponents :is(select,input) { width: 100%; height: 36px; margin: 4px 0 0; }
.boss-guide-search-field { grid-column: span 2; }
.boss-guide-toggles { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.boss-guide-toggles label { display: inline-flex; align-items: center; gap: 6px; }
.boss-guide-picker { grid-column: 1 / -1; min-width: 0; }
.boss-guide-boss-list {
  max-height: 284px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.boss-guide-picker-group + .boss-guide-picker-group { margin-top: 10px; }
.boss-guide-picker-group h3 { margin: 0 0 5px; color: var(--muted); font-size: 13px; }
.boss-guide-boss-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(76px,1fr)); gap: 6px; }
.boss-guide-boss-tile {
  --boss-guide-art-size: 46px;
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  min-height: 72px;
  padding: 5px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.boss-guide-boss-tile .boss-guide-portrait { width: var(--boss-guide-art-size); margin-inline: auto; }
.boss-guide-boss-tile:hover { border-color: var(--accent); }
.boss-guide-boss-tile[aria-pressed=true] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #f0ebf8;
  color: var(--accent);
  font-weight: 650;
}
.boss-guide-variants { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.boss-guide-variants[hidden] { display: none; }
.boss-guide-variants button { padding: 4px 9px; font-size: 12px; }
.boss-guide-variants button[aria-pressed=true] { background: var(--accent); color: white; }
.boss-guide-target {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.boss-guide-target img { object-fit: contain; image-rendering: pixelated; }
.boss-guide-target .rec-types { margin-top: 4px; }
.boss-guide-name {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  text-align: left;
  overflow-wrap: anywhere;
}
.boss-guide-name:hover { text-decoration: underline; }
.boss-guide-total { color: var(--accent); font-variant-numeric: tabular-nums; }
.boss-guide-status { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.boss-guide-status h3 { margin: 0 0 12px; }
.boss-guide-status h3 small { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.boss-guide-status-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.boss-guide-status-metrics > div { padding: 10px 12px; background: #f8f5fc; border-radius: 8px; }
.boss-guide-status-metrics span { display: block; color: var(--muted); font-size: 12px; }
.boss-guide-status-metrics strong { display: block; color: var(--accent); font-size: 23px; font-variant-numeric: tabular-nums; }
.boss-guide-status-metrics small { display: block; color: var(--muted); font-size: 11px; }
.boss-guide-status p { margin: 10px 0 0; font-size: 13px; }
.boss-guide-status summary { margin-top: 10px; color: var(--accent); cursor: pointer; }
.boss-guide-status .boss-guide-warning { color: #a45800; }
.boss-guide-move { display: block; }
.boss-guide-damage small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.boss-guide-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.boss-guide-table :is(th,td) { padding: 9px 12px; text-align: left; overflow-wrap: anywhere; }
.boss-guide-table th { color: var(--muted); background: #f8f5fc; }
.boss-guide-table tr + tr td { border-top: 1px solid var(--line); }
.boss-guide-table th:first-child { width: 10%; }
.boss-guide-table th:nth-child(2) { width: 27%; }
.boss-guide-table th:nth-child(3) { width: 21%; }
.boss-guide-table th:nth-child(4) { width: 13%; }
.boss-guide-table .boss-guide-damage { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.boss-guide-table td.boss-guide-damage { font-weight: 650; }
.boss-guide-member > td { padding-block: 4px; }
.boss-guide-pokemon {
  --boss-guide-art-size: 44px;
  display: grid;
  grid-template-columns: var(--boss-guide-art-size) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}
.boss-guide-portrait {
  position: relative;
  display: block;
  height: var(--boss-guide-art-size);
  overflow: hidden;
}
.boss-guide-portrait img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.boss-guide-portrait .boss-guide-art-fitted {
  --art-fit: calc(var(--boss-guide-art-size) - 2px);
  position: absolute;
  width: calc(var(--art-fit) * var(--art-width));
  max-width: none;
  height: auto;
  top: calc(50% - var(--art-fit) * var(--art-offset-y));
  left: calc(50% - var(--art-fit) * var(--art-offset-x));
}
.boss-guide-member-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; }
.boss-guide-access-toggle {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}
.boss-guide-access-toggle::before { content: '▸'; margin-inline-end: 4px; }
.boss-guide-access-toggle[aria-expanded=true]::before { content: '▾'; }
.boss-guide-access-toggle:hover { color: var(--accent); }
.boss-guide-reason small { display: block; color: var(--muted); }
.boss-guide-acquisition td { background: #f8f5fc; color: var(--muted); font-size: 12px; }
.boss-guide-acquisition ul { margin: 0; padding-inline-start: 16px; }
.boss-guide-acquisition li + li { margin-top: 4px; }
.boss-guide-table tbody + tbody > tr:first-child > td { border-top: 1px solid var(--line); }
.boss-guide-position {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
  padding: 1px 5px;
  border-radius: 5px;
  background: #f4f0fa;
  color: #675881;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.boss-guide-backup-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  border: 0;
  border-radius: 5px;
  background: #f4f0fa;
  color: var(--accent);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.boss-guide-backup-toggle::after { content: '▸'; }
.boss-guide-backup-toggle[aria-expanded=true]::after { content: '▾'; }
.boss-guide-backup-toggle:is(:hover,[aria-expanded=true]) { background: #e9e0f6; }
.boss-guide-backup-member { background: #fbf9fe; }
.boss-guide-backup-member > td:first-child { position: relative; }
.boss-guide-backup-member > td:first-child::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 23px;
  width: 2px;
  background: #ddd2ee;
}
.boss-guide-wild { margin-inline-start: 5px; color: #36734a; font-size: 10px; white-space: nowrap; }
.boss-guide-output {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.boss-guide-output summary { cursor: pointer; padding: 10px 14px; color: var(--accent); font-weight: 650; }
.boss-guide-output summary small { margin-inline-start: 7px; color: var(--muted); font-weight: 400; }
.boss-guide-output .boss-guide-table { border-width: 1px 0 0; border-radius: 0; }
.boss-guide-eff { margin-inline-start: 6px; color: var(--accent); white-space: nowrap; }
@media (max-width: 560px) {
  .boss-guide-status { padding: 12px; }
  .boss-guide-status-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .boss-guide-table th.boss-guide-damage { white-space: normal; }
  .boss-guide-controls { padding: 12px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .boss-guide-search-field { grid-column: 1 / -1; }
  .boss-guide-boss-list { max-height: 238px; padding: 9px; }
  .boss-guide-boss-grid { grid-template-columns: repeat(auto-fill,minmax(54px,1fr)); }
  .boss-guide-boss-tile { --boss-guide-art-size: 42px; min-height: 68px; }
  .boss-guide-target { grid-template-columns: 76px minmax(0,1fr); }
  .boss-guide-target img { width: 76px; height: 76px; }
  .boss-guide-table { font-size: 12px; }
  .boss-guide-table :is(thead,tbody) { display: block; }
  .boss-guide-table tr {
    display: grid;
    grid-template-columns: 3.9em minmax(0, 1.4fr) minmax(0, .8fr) minmax(5em, .6fr);
    align-items: center;
  }
  .boss-guide-table :is(th,td) { width: auto !important; padding: 5px; }
  .boss-guide-member td:first-child { white-space: nowrap; }
  .boss-guide-table tr + tr td { border-top: 0; }
  .boss-guide-table tbody + tbody > tr:first-child > td { border-top: 0; }
  .boss-guide-table tbody tr:not(:first-child), .boss-guide-table tbody + tbody > tr:first-child { border-top: 1px solid var(--line); }
  .boss-guide-table .boss-guide-reason-heading { display: none; }
  .boss-guide-table .boss-guide-reason { grid-column: 2 / -1; padding-top: 0; color: var(--muted); font-size: 11px; }
  .boss-guide-reason small { display: inline; margin-inline-start: 7px; }
  .boss-guide-pokemon { --boss-guide-art-size: 38px; gap: 5px; }
  .boss-guide-acquisition td { grid-column: 1 / -1; padding-inline: 8px; }
  .boss-guide-member-actions { column-gap: 5px; }
  .boss-guide-position { padding-inline: 3px; font-size: 10px; }
  .boss-guide-backup-member > td:first-child { grid-row: 1 / span 2; align-self: stretch; }
  .boss-guide-backup-member > td:first-child::before { inset-inline-start: 16px; }
  .boss-guide-eff { margin-inline-start: 3px; }
}
.elite-guide-controls { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:end; gap:14px 18px; padding:16px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.elite-guide-controls label, .elite-guide-tier-field > span { display:block; color:var(--muted); font-size:13px; font-weight:600; }
.elite-guide-controls :is(select,input) { display:block; margin-top:5px; min-height:42px; color:var(--ink); }
.elite-guide-choice { display:flex; gap:6px; }
.elite-guide-choice button { flex:1; min-height:42px; padding-inline:6px; white-space:nowrap; }
.elite-guide-choice button[aria-pressed=true] { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:650; }
.elite-guide-tier-field, #elite-guide-boss-field { grid-column:1/-1; min-width:0; }
.elite-guide-tier-field .elite-guide-choice { max-width:460px; margin-top:5px; }
#elite-guide-boss-field { padding-top:13px; border-top:1px solid var(--line); }
#elite-guide-search { max-width:460px; }
.elite-guide-bosses { margin-top:10px; grid-template-columns:repeat(auto-fill,minmax(82px,1fr)); }
.elite-guide-bosses img { display:block; width:45px; height:45px; object-fit:contain; margin-inline:auto; }
.elite-guide-roster { margin:15px 0; }
.elite-guide-roster-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
.elite-guide-roster-head h2 { margin:0; font-size:20px; }
.elite-guide-roster-head > strong { color:var(--accent); }
.elite-guide-caption, .elite-guide-method { color:var(--muted); font-size:13px; }
.elite-guide-caption { margin:4px 0 11px; }
.elite-guide-caution { padding:8px 12px; border-radius:8px; background:#fff5e1; color:#714815; font-size:13px; }
.elite-guide-team { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin:0; padding:0; list-style:none; }
.elite-guide-member { min-width:0; display:flex; flex-direction:column; gap:8px; padding:10px; background:#fff; border:1px solid var(--line); border-radius:10px; }
.elite-guide-member-identity { display:grid; grid-template-columns:46px minmax(0,1fr); align-items:center; gap:8px; }
.elite-guide-member-identity img { width:46px; height:46px; object-fit:contain; }
.elite-guide-member-head { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:6px; }
.elite-guide-member-head strong { overflow-wrap:anywhere; }
.elite-guide-member p { margin:0; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.elite-guide-member .elite-guide-member-moves { padding-top:7px; border-top:1px solid var(--line); color:var(--ink); }
.elite-guide-member .elite-guide-member-unlock { color:#714815; }
.elite-guide-rank { flex:none; padding:2px 7px; border-radius:5px; background:var(--wash); color:var(--accent); font-size:13px; font-weight:700; }
.elite-guide-rank[data-rank="0"] { background:#f0eef3; color:var(--muted); }
.elite-guide-method li + li { margin-top:5px; }
.elite-guide-method a { color:var(--accent); }
@media(max-width:620px) {
  .elite-guide-controls { grid-template-columns:minmax(0,1fr); gap:10px; padding:12px; }
  .elite-guide-choice button, .elite-guide-controls :is(select,input) { min-height:44px; }
  .elite-guide-team { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .elite-guide-member { padding:8px; }
  .elite-guide-member-identity { grid-template-columns:34px minmax(0,1fr); gap:5px; }
  .elite-guide-member-identity img { width:34px; height:34px; }
  .elite-guide-member-head { gap:4px; }
  .elite-guide-bosses { grid-template-columns:repeat(auto-fill,minmax(67px,1fr)); }
}
