/* Leyra Meta Index: compact, portrait-first tier board */
#content[data-page="tier-list"]{width:min(1800px,calc(100% - 40px))}
.tier-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.tier-heading .eyebrow{margin-bottom:6px}.tier-heading h1{font-size:clamp(2rem,4vw,3.3rem)}
.tier-heading p{margin-top:5px;font-size:.88rem}
.tier-patch{display:grid;gap:2px;text-align:right}.tier-version{color:var(--accent);font-weight:700;font-size:.88rem}.tier-patch small{color:var(--muted);font-size:.72rem}
.tier-board-meta{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:10px 2px 0;font-size:.76rem;color:var(--muted)}.tier-board-meta strong{color:var(--text);font-weight:650}
.tier-board{--tier-label-width:76px;--tier-divider:color-mix(in srgb,var(--accent) 23%,var(--line));display:grid;gap:7px;isolation:isolate}
.tier-column-head,.tier-band{display:grid;grid-template-columns:var(--tier-label-width) repeat(4,minmax(0,1fr));gap:0}
.tier-column-head{position:sticky;top:calc(var(--site-header-height,68px) + 4px);z-index:2;background:var(--bg);border:1px solid var(--line);border-radius:11px;padding:4px;box-shadow:0 4px 12px #100e1666}
.tier-column-label{display:grid;place-items:center;color:var(--muted);font-size:.73rem;font-weight:650}
.tier-role-heading{display:flex;justify-content:center;align-items:center;gap:9px;padding:10px 5px;text-align:left;border-left:2px solid var(--tier-divider);min-width:0}
.tier-role-heading strong{display:block;color:var(--text);font-size:.9rem}.tier-role-heading small{display:block;font-size:.69rem;color:var(--muted)}
.tier-role-icon{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border-radius:8px;background:var(--raised);color:var(--accent)}
.tier-role-heading:nth-child(2) .tier-role-icon{color:#f17b7b}.tier-role-heading:nth-child(3) .tier-role-icon{color:#f5d477}.tier-role-heading:nth-child(5) .tier-role-icon{color:#76d5b8}
.tier-band{border:1px solid var(--line);border-radius:11px;background:var(--surface);padding:4px;align-items:stretch}
.tier-band-ss{--tier-color:#ffb978}.tier-band-splus{--tier-color:#f5d477}.tier-band-s{--tier-color:#c8acfa}.tier-band-a{--tier-color:#88b9f5}.tier-band-b{--tier-color:#86c7b1}.tier-band-c{--tier-color:#a5a9bd}.tier-band-d{--tier-color:#9c8b9b}
.tier-rank{min-height:100px;border-radius:7px;background:linear-gradient(145deg,color-mix(in srgb,var(--tier-color) 20%,var(--surface)),color-mix(in srgb,var(--tier-color) 7%,var(--surface)));border:1px solid color-mix(in srgb,var(--tier-color) 38%,var(--line));color:var(--tier-color);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;text-align:center;padding:10px 4px}
.tier-rank strong{font-size:1.75rem;line-height:1;font-weight:800;letter-spacing:-.04em}.tier-rank small{font-size:.63rem;line-height:1.25}
.tier-role-column{min-width:0;padding:9px 12px;display:flex;flex-direction:column;gap:5px}.tier-role-column{border-left:2px solid var(--tier-divider)}
.tier-role-column h3{display:none}
.tier-character-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:10px;align-items:start;justify-items:center}
.tier-character,.team-tier-members{--tier-portrait-max:94px}
.tier-character{--portrait-width:min(100%,var(--tier-portrait-max));--partner-size:24px;position:relative;width:100%;max-width:112px;min-width:0}
.tier-synergy-overlay{position:absolute;top:0;left:50%;transform:translateX(-50%);z-index:2;width:var(--portrait-width);aspect-ratio:1;pointer-events:none}
.tier-synergy-trigger{position:absolute;right:0;bottom:0;display:flex;align-items:flex-end;justify-content:flex-end;box-sizing:border-box;width:44px;height:44px;padding:3px;border:0;border-radius:10px;-webkit-appearance:none;appearance:none;background:transparent;color:var(--text);cursor:pointer;pointer-events:auto;touch-action:manipulation}
.tier-synergy-chip{display:block;width:var(--partner-size);height:var(--partner-size);flex:none;box-sizing:content-box;border:1px solid color-mix(in srgb,var(--accent) 45%,var(--line));border-radius:50%;overflow:hidden;background:#100e16;box-shadow:0 1px 5px #0009}
.tier-synergy-chip img{display:block;width:100%;height:100%;object-fit:contain;background:var(--raised)}
/* Draw focus on the portrait, not on its larger, transparent touch target. */
.tier-synergy-trigger:focus{outline:none}
.tier-synergy-trigger:focus-visible .tier-synergy-chip{border-color:var(--accent);outline:2px solid var(--accent);outline-offset:1px}
@media(hover:hover){.tier-synergy-trigger:hover .tier-synergy-chip{border-color:var(--accent)}}
.tier-synergy-dialog{padding:0;width:min(420px,calc(100% - 28px));max-width:100%;max-height:calc(100% - 28px);border:1px solid var(--line);border-radius:16px;background:var(--raised);color:var(--text);box-shadow:0 20px 70px #0009}
.tier-synergy-dialog::backdrop{background:#080611ad}
.tier-synergy-dialog [data-tier-synergy-body]{padding:clamp(16px,5vw,24px)}
.tier-synergy-kicker{color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;font-weight:700}
.tier-synergy-dialog h2{margin:.25rem 0 0;font-size:1.25rem}
.tier-synergy-dialog p{color:var(--muted);line-height:1.5;margin:.65rem 0 1rem}
.tier-synergy-actions{display:flex;justify-content:flex-end}
.tier-character.ranking-element--geo,.team-tier-avatar.ranking-element--geo{--element-color:#e4bd6d}
.tier-character-main{display:flex;flex-direction:column;align-items:center;gap:5px;color:var(--text);min-width:0;width:100%;text-align:center}
.tier-avatar{display:block;position:relative;width:var(--portrait-width);aspect-ratio:1;border-radius:10px;overflow:hidden}
:is(.tier-avatar,.team-tier-avatar){border:1px solid color-mix(in srgb,var(--element-color,var(--accent)) 45%,var(--line));background:linear-gradient(145deg,color-mix(in srgb,var(--element-color,var(--accent)) 17%,var(--raised)),#14111c 85%);transition:border-color .15s,background .15s}
.tier-avatar img,.tier-avatar .image-placeholder{width:100%;height:100%;object-fit:contain;display:block}
.tier-character-main:hover .tier-avatar,.team-loadout-toggle:is(:hover,:focus-visible) .team-tier-avatar{border-color:var(--element-color,var(--accent));background:color-mix(in srgb,var(--element-color,var(--accent)) 22%,var(--raised))}
.tier-constellation{position:absolute;bottom:3px;z-index:1;font-size:.64rem;line-height:1.15;font-weight:750;padding:3px 4px;background:#100e16eb;border-radius:4px;font-variant-numeric:tabular-nums}
.tier-constellation{left:3px;color:var(--text)}
.tier-character-name{display:block;max-width:100%;min-height:2.4em;font-size:.8rem;line-height:1.2;font-weight:600;overflow-wrap:normal;word-break:normal;hyphens:none;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.tier-no-role{grid-column:1/-1;color:var(--muted);opacity:.5;align-self:start;justify-self:center;padding:16px 0;font-size:.85rem}
.tier-method{padding:14px 16px;margin-top:18px}.tier-method summary{cursor:pointer;font-weight:650;font-size:.85rem}.tier-method p{font-size:.8rem;margin:10px 0}
@media(min-width:1051px) and (max-width:1250px){.tier-character-grid{grid-template-columns:repeat(auto-fill,minmax(80px,1fr))}.tier-role-heading{gap:5px}.tier-role-icon{width:28px;height:28px;flex-basis:28px}}
@media(max-width:1050px){#content[data-page="tier-list"]{width:calc(100% - 28px)}.tier-board{--tier-label-width:60px}.tier-column-head{display:none}.tier-band{grid-template-columns:var(--tier-label-width) minmax(0,1fr)}.tier-rank{grid-row:1/span 4}.tier-role-column{padding:8px 10px}.tier-role-column+.tier-role-column{border-left:0;border-top:1px solid var(--line)}.tier-role-column h3{display:flex;align-items:center;gap:6px;font-size:.78rem;color:var(--muted);font-weight:650}.tier-role-column h3 svg{width:15px;height:15px;color:var(--accent)}.tier-rank strong{font-size:1.4rem}.tier-rank small{display:none}.tier-character-grid{grid-template-columns:repeat(auto-fill,minmax(78px,1fr))}.tier-role-column:has(.tier-no-role) .tier-character-grid{display:none}.tier-role-column:has(.tier-no-role){padding-block:5px;opacity:.55}}
@media(max-width:480px){.tier-character{--partner-size:20px}.tier-heading{align-items:flex-start}.tier-patch{text-align:left}.tier-board{--tier-label-width:46px}.tier-role-column{padding:7px}.tier-character-grid{grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:6px}.tier-character-name{font-size:.65rem}.tier-constellation{font-size:.59rem;padding:2px 3px}}

/* Continuous, aligned role separators; retain a quieter horizontal treatment on mobile. */
@media(min-width:1051px){.tier-role-heading,.tier-role-column{position:relative;background:color-mix(in srgb,var(--accent) 1.5%,transparent)}.tier-role-heading:nth-child(odd),.tier-role-column:nth-child(odd){background:color-mix(in srgb,var(--accent) 4%,transparent)}.tier-role-heading:nth-child(n+3)::before,.tier-role-column:nth-child(n+3)::before{content:"";position:absolute;left:-2px;top:-4px;bottom:-4px;width:2px;background:var(--tier-divider);pointer-events:none}}
@media(max-width:1050px){.tier-role-column{border-left:0}.tier-role-column+.tier-role-column{border-top:2px solid var(--tier-divider)}}

.tier-view-switch { display: inline-flex; gap: .3rem; padding: .25rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tier-view-switch a { display: grid; place-items: center; padding: .45rem .95rem; min-height: 44px; border-radius: 8px; color: var(--muted); font-weight: 680; text-decoration: none; }
.tier-view-switch a:hover { color: var(--text); background: var(--raised); }
.tier-view-switch a[aria-current="page"] { color: var(--accent); background: var(--raised); }
.team-tier-grid, .team-tier-members { list-style: none; margin: 0; padding: 0; display: grid; }
.team-tier-grid { grid-template-columns: minmax(0,1fr); gap: .65rem; }
.team-tier-card { height: 100%; padding: .85rem; display: grid; gap: .75rem; align-content: start; }
.team-tier-card-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .65rem; justify-content: space-between; }
.team-tier-card h2, .team-tier-card p { margin: 0; }
.team-tier-card h2 { font-size: 1.05rem; }
.team-tier-card-title span { font-size: .79rem; color: var(--accent); }
.team-tier-card p { color: var(--muted); font-size: .86rem; line-height: 1.4; }
.team-tier-members { grid-template-columns: repeat(4,minmax(0,1fr)); gap: .3rem; }
.team-tier-members li { display: grid; justify-items: center; align-content: start; text-align: center; gap: .32rem; min-width: 0; }
.team-tier-members strong { max-width: 100%; overflow-wrap: anywhere; font-size: clamp(.72rem,2.4vw,.88rem); }
.team-tier-avatar { display: grid; place-items: center; width: min(100%,58px); aspect-ratio: 1; border-radius: 8px; overflow: hidden; }
.team-tier-avatar img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }


.team-tier-alternatives { border-top: 1px solid var(--line); }
.team-tier-alternatives summary { min-height: 44px; align-content: center; cursor: pointer; color: var(--accent); font-size: .86rem; font-weight: 650; }
.team-tier-alternatives ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.team-tier-alternatives li { padding: .5rem .65rem; background: var(--raised); border-radius: 7px; }
.team-tier-alternatives li strong { display: block; margin-bottom: .15rem; overflow-wrap: anywhere; font-size: .83rem; }

.team-tier-swap { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: .45rem; margin-bottom: .35rem; }
.team-tier-swap-member { display: flex; align-items: center; gap: .38rem; min-width: 0; }
.team-tier-swap-member .team-tier-avatar { flex: 0 0 28px; width: 28px; border-radius: 6px; }
.team-tier-swap-member strong { min-width: 0; margin: 0; }
.team-tier-swap-arrow { color: var(--accent); }

.team-tier-benchmark-note { margin: .85rem 0 0; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: .85rem; line-height: 1.45; }
.team-tier-benchmark-note strong { color: var(--text); }
.team-tier-benchmark-note a { color: var(--accent); }
.team-tier-card-title .team-tier-rank { margin-inline-end: .12rem; font-variant-numeric: tabular-nums; }
.team-tier-card-title .team-tier-score { align-self: start; white-space: nowrap; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); padding: .2rem .4rem; font-weight: 750; color: var(--text); }

.team-loadout-toggle { position: relative; display: block; width: min(100%,58px); aspect-ratio: 1; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; border-radius: 8px; }
.team-loadout-toggle .team-tier-avatar { width: 100%; }
.team-loadout-constellation { position: absolute; top: -3px; left: -3px; line-height: 1; padding: .18rem .22rem; border: 1px solid var(--line); border-radius: 5px; background: #20192e; color: #f0e2ff; font-size: .62rem; font-weight: 750; }
.team-loadout-weapon { position: absolute; right: -3px; bottom: -3px; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #6b597d; border-radius: 6px; background: #1b1425; }
.team-loadout-weapon img { width: 24px; height: 24px; object-fit: contain; }
.team-loadout-dialog { width: min(430px, calc(100vw - 24px)); }
.team-loadout-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.team-loadout-dialog-head h2 { margin: 0; font-size: 1.15rem; min-width: 0; overflow-wrap: anywhere; }
.team-loadout-dialog-head .button { min-height: 44px; }
.team-loadout-facts { display: grid; gap: .55rem; margin-block: 1rem; }
.team-loadout-facts > div { display: grid; grid-template-columns: minmax(0, .6fr) minmax(0, 1fr); align-items: center; gap: .45rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.team-loadout-facts dt { color: var(--muted); font-size: .85rem; }
.team-loadout-facts dd { margin: 0; display: flex; align-items: center; gap: .45rem; overflow-wrap: anywhere; }
.team-loadout-facts img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
@keyframes tier-view-in { from { opacity: .78; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  #content:not([aria-busy]) > .tier-board-enter { animation: tier-view-in .26s ease-out; }
}

.team-loadout-refinement { position: absolute; right: -2px; bottom: -3px; border-radius: 4px; background: #211a2d; border: 1px solid #6b597d; color: #f0e2ff; padding: .08rem .14rem; font-size: .56rem; font-weight: 750; line-height: 1; }
.team-loadout-weapon.refinement-only { width: auto; height: auto; min-width: 22px; min-height: 17px; }
.team-loadout-weapon.refinement-only .team-loadout-refinement { position: static; border: 0; background: none; font-size: .65rem; }

/* Same layout, headings, cards, and tile counts as the populated view. */
.tier-layout-skeleton .tier-avatar-placeholder { width: 100%; height: 100%; min-height: 100%; border-radius: inherit; }
.tier-layout-skeleton .tier-character-name,
.tier-layout-skeleton .team-tier-members strong { color: transparent; position: relative; }
.tier-layout-skeleton .tier-character-name::after,
.tier-layout-skeleton .team-tier-members strong::after { content: ''; position: absolute; inset: .23em 7%; border-radius: 4px; background: #2a2335; }
.tier-layout-skeleton :is(.tier-constellation,.team-tier-score) { visibility: hidden; }

.tier-layout-skeleton .tier-rank { background: #23202c; border-color: var(--line); }
.tier-layout-skeleton .tier-rank > * { visibility: hidden; }

/* Desktop Team board. The mobile layout and the matching skeleton markup are unchanged. */
@media (min-width: 891px) {
  .team-tier-grid { gap: .85rem; }
  .team-tier-grid > li { min-width: 0; align-self: stretch; }
  .team-tier-grid > li:nth-child(-n+2) .team-tier-card {
    border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  }
  .team-tier-card {
    gap: .76rem; padding: clamp(.85rem, 1.15vw, 1.14rem); border-radius: 14px;
    background: linear-gradient(155deg, color-mix(in srgb, var(--raised) 70%, var(--surface)), var(--surface));
  }
  .team-tier-card-title {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .5rem;
  }
  .team-tier-card-title h2 {
    display: flex; align-items: center; gap: .5rem; line-height: 1.2;
    font-size: clamp(.94rem, 1.18vw, 1.13rem); overflow-wrap: anywhere;
  }
  .team-tier-card-title .team-tier-rank {
    flex-shrink: 0; display: inline-grid; place-items: center; min-width: 2rem; height: 1.65rem;
    margin: 0; padding: 0 .24rem; border-radius: .45rem;
    background: color-mix(in srgb, var(--accent) 12%, transparent); letter-spacing: -.02em;
  }
  .team-tier-card-title .team-tier-score {
    min-height: 1.65rem; display: inline-grid; place-items: center;
    font-weight: 750; font-size: .8rem; line-height: 1.1; font-variant-numeric: tabular-nums;
    background: color-mix(in srgb, var(--accent) 10%, var(--raised));
    color: var(--text); border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  }
  .team-tier-members {
    gap: .45rem; padding: .6rem .45rem .5rem; border-radius: .65rem;
    background: color-mix(in srgb, var(--raised) 46%, transparent);
  }
  .team-tier-members li { gap: .42rem; }
  .team-tier-members .team-loadout-toggle { width: min(100%, var(--tier-portrait-max)); }
  .team-tier-members .team-loadout-toggle .team-tier-avatar { border-radius: .65rem; }
  .team-tier-members strong { font-size: .79rem; line-height: 1.2; }
  .team-tier-alternatives { border-top-color: color-mix(in srgb, var(--line) 75%, transparent); }
  .team-tier-alternatives summary { min-height: 36px; font-size: .79rem; }
}

/* Keep the switch in the same place in both views, including their skeletons. */
.tier-heading {
  display: grid; grid-template-columns: minmax(0, 1fr) max-content;
  align-items: end; gap: .55rem 1rem;
}
.tier-heading h1 { line-height: 1.12; }
.tier-heading-copy { min-width: 0; }
.tier-heading-copy p { margin-bottom: 0; line-height: 1.35; }
@media (max-width: 620px) {
  .tier-heading { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .tier-heading h1 { font-size: clamp(1.7rem, 7vw, 2.5rem); }
  .tier-patch { grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: .45rem; text-align: left; }
}

/* Match the character board width, with two cards on desktop only. */
@media (min-width: 891px) {
  .team-tier-grid, .team-tier-benchmark-note { max-width: none; }
  .team-tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .tier-heading h1 { font-size: clamp(1.35rem, 6vw, 1.55rem); }
}

.tier-filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem; margin-bottom: .75rem; }
.tier-element-filter { display: grid; gap: .2rem; min-width: 0; color: var(--muted); font-size: .75rem; }
.tier-element-filter :is(select,input) {
  min-height: 38px; min-width: 0; max-width: 100%; padding: 0 .55rem; color: var(--text);
  background: var(--raised); border: 1px solid var(--line); border-radius: .55rem; font: inherit; font-size: .87rem;
}

.team-tier-grid { scroll-margin-top: 85px; }
.team-pager { display: flex; align-items: center; justify-content: center; gap: .65rem; margin-top: .75rem; }
.team-pager span { font-size: .8rem; color: var(--muted); }
.team-tier-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; justify-content: end; }
@media (max-width: 530px) {
  .tier-view-switch a { padding-inline: .5rem; font-size: .86rem; }
  .tier-filter-row input[type=search] { font-size: 16px; }
}

.team-element-switch { display: flex; flex-wrap: wrap; gap: .38rem; margin-bottom: .65rem; }
.team-element-option {
  min-height: 36px; border: 1px solid var(--line); color: var(--text); border-radius: .55rem;
  padding: .36rem .62rem; background: var(--surface); font: inherit; font-size: .79rem; cursor: pointer;
}
.team-element-chip, .team-element-option[aria-pressed="true"] {
  --team-element-color: var(--chip-color, var(--accent));
  color: var(--team-element-color);
  background: color-mix(in srgb,var(--team-element-color) 13%,var(--surface));
  border: 1px solid color-mix(in srgb,var(--team-element-color) 43%,var(--line));
}
.team-element-chip { border-radius: .4rem; padding: .14rem .34rem; font-size: .7rem; }
.team-element-option:hover { border-color: var(--chip-color, var(--accent)); }
.rank-element-anemo { --chip-color: #9ce5d2; }
.rank-element-geo { --chip-color: #f7d387; }
.rank-element-electro { --chip-color: #d3b3fa; }
.rank-element-dendro { --chip-color: #b7da87; }
.rank-element-hydro { --chip-color: #a4d5fb; }
.rank-element-pyro { --chip-color: #ffb8a8; }
.rank-element-cryo { --chip-color: #bdedf7; }

.tier-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .85rem; margin-bottom: .85rem; }
.tier-controls .tier-view-switch, .tier-controls .team-element-switch { margin: 0; }
.tier-controls .team-element-switch { gap: .3rem; }
.tier-controls .team-element-option {
  position: relative; display: inline-grid; place-items: center; width: auto; min-width: 40px; min-height: 40px; padding: 0 .4rem;
}
.tier-element-initial { position: absolute; inset: 0; display: none; place-items: center; font-size: .73rem; font-weight: 700; }
.team-element-option:has(img[hidden]) .tier-element-initial { display: grid; }
.team-element-option img { position: relative; display: block; object-fit: contain; }
.tier-element-placeholder { width: 22px; height: 22px; border-radius: 50%; }
.team-element-option img[hidden] { display: none; }
.team-element-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 530px) {
  .tier-controls .team-element-option { min-width: 36px; min-height: 40px; padding-inline: .28rem; }
  .tier-controls .team-element-switch { gap: .22rem; }
}

.tier-toolbar-search { flex: 1 1 11rem; max-width: 20rem; }
.tier-toolbar-search input { width: 100%; min-height: 40px; }
@media (max-width: 530px) {
  .tier-toolbar-search { flex-basis: 100%; max-width: none; }
  .tier-toolbar-search input { font-size: 16px; }
}

/* Match the desktop control heights without changing the mobile toolbar layout. */
.tier-controls { --tier-element-art: 25px; }
.tier-controls .team-element-option > img,
.tier-controls .tier-element-initial svg,
.tier-controls .tier-element-placeholder {
  width: var(--tier-element-art); height: var(--tier-element-art);
}
@media (min-width: 891px) {
  .tier-controls { --tier-control-size: 44px; --tier-element-art: 26px; }
  .tier-controls .tier-view-switch,
  .tier-controls .team-element-option,
  .tier-controls .tier-toolbar-search input { box-sizing: border-box; height: var(--tier-control-size); }
  .tier-controls .tier-view-switch { padding: 0; border: 0; box-shadow: inset 0 0 0 1px var(--line); }
  .tier-controls .tier-view-switch a { min-height: var(--tier-control-size); }
  .tier-controls .team-element-option { width: var(--tier-control-size); min-height: var(--tier-control-size); }
  .tier-controls .tier-toolbar-search { flex-basis: 9rem; min-width: 9rem; }
}

/* Keep the active tab inside the rounded switch, not on top of its outline. */
.tier-controls .tier-view-switch {
  display: inline-grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch; gap: .15rem; padding: 3px; border: 1px solid var(--line); box-shadow: none;
}
.tier-controls .tier-view-switch a { text-align: center; white-space: nowrap; border-radius: 8px; }
@media (min-width: 891px) {
  .tier-controls .tier-view-switch a { min-height: 0; padding-block: 0; }
}

/* Keep both destinations as links, with one marker that slides beneath them. */
@supports selector(.tier-view-switch:has(a[aria-current="page"])) {
  .tier-controls .tier-view-switch {
    --tier-switch-inset: 3px; --tier-switch-gap: .15rem;
    position: relative; isolation: isolate; border-radius: 999px;
    padding: var(--tier-switch-inset); gap: var(--tier-switch-gap);
  }
  .tier-controls .tier-view-switch::before {
    content: ""; pointer-events: none; position: absolute; z-index: 0;
    inset-block: var(--tier-switch-inset); inset-inline-start: var(--tier-switch-inset);
    width: calc((100% - var(--tier-switch-inset) - var(--tier-switch-inset) - var(--tier-switch-gap)) / 2);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 15%, var(--raised));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
  }
  .tier-controls .tier-view-switch:has(a:last-child[aria-current="page"])::before {
    transform: translateX(calc(100% + var(--tier-switch-gap)));
  }
  .tier-controls .tier-view-switch a { position: relative; z-index: 1; background: transparent; border-radius: 999px; }
  .tier-controls .tier-view-switch a:is(:hover,[aria-current="page"]) { background: transparent; }
  .tier-controls .tier-view-switch a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  @media (prefers-reduced-motion: no-preference) {
    .tier-controls .tier-view-switch::before { transition: transform .24s cubic-bezier(.22,.7,.25,1); }
  }
}

/* Keep the real card geometry while using quieter colors and measured-text placeholders. */
.tier-layout-skeleton :is(.tier-avatar,.team-tier-avatar) {
  border-color: var(--line); background: var(--raised);
}
.tier-layout-skeleton :is(.tier-character-name,.team-tier-members strong)::after {
  inset-inline: 8%; background: color-mix(in srgb,var(--muted) 24%,var(--raised));
}
.tier-layout-skeleton .team-tier-score {
  visibility: visible; position: relative; color: transparent;
  background: var(--raised); border-color: var(--line);
}
.tier-layout-skeleton .team-tier-score::after {
  content: ""; position: absolute; inset: .31rem .4rem; border-radius: .24rem;
  background: color-mix(in srgb,var(--muted) 24%,var(--raised));
}
.tier-layout-skeleton .team-element-chip {
  color: var(--muted); background: var(--raised); border-color: var(--line);
}

#content[data-page="tier-list"] .back { min-width: 84px; }

/* Mobile keeps the tab switch, element controls and search on separate rows. */
@media (max-width: 890px) {
  #content[data-page="tier-list"] .tier-controls {
    display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: .55rem;
  }
  #content[data-page="tier-list"] .tier-controls > .tier-view-switch {
    grid-row: 1; grid-column: 1; width: 100%; min-width: 0;
  }
  #content[data-page="tier-list"] .tier-controls > .team-element-switch {
    grid-row: 2; grid-column: 1; display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: .25rem;
  }
  #content[data-page="tier-list"] .tier-controls .team-element-option {
    min-width: 0; width: 100%; min-height: 40px;
  }
  #content[data-page="tier-list"] .tier-controls > .tier-toolbar-search {
    grid-row: 3; grid-column: 1; width: 100%; max-width: none; min-width: 0;
  }
}
