:root {
  color-scheme: dark;
  --page: #07131f;
  --page-deep: #040c15;
  --surface: #0c1b29;
  --surface-raised: #102333;
  --surface-soft: #142b3d;
  --surface-hover: #183449;
  --line: #294254;
  --line-soft: #1c3446;
  --text: #f2f7f9;
  --text-soft: #b6c6d0;
  --text-muted: #8297a6;
  --teal: #35dcc7;
  --teal-dark: #0c9387;
  --teal-soft: rgba(53, 220, 199, .13);
  --blue: #67aee8;
  --green: #5ddd8a;
  --green-soft: rgba(93, 221, 138, .14);
  --amber: #f4bf5f;
  --amber-soft: rgba(244, 191, 95, .14);
  --red: #ff727f;
  --red-soft: rgba(255, 114, 127, .14);
  --grey-soft: rgba(182, 198, 208, .11);
  --button-on-primary: #031816;
  --button-on-danger: #220308;
  --primary-hover: color-mix(in srgb, var(--teal) 86%, white);
  --shadow-accent: #d8a9ff;
  --shadow-border: #9268b9;
  --shadow-soft: rgba(146, 104, 185, .13);
  --shadow: 0 18px 45px rgba(0, 0, 0, .22);
  --radius-sm: .55rem;
  --radius: .85rem;
  --radius-lg: 1.15rem;
  --header-height: 9.6rem;
  --focus: #9df4e8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-theme="light"] {
  color-scheme: light;
  --page: #edf3f5;
  --page-deep: #dce7eb;
  --surface: #ffffff;
  --surface-raised: #f7fafb;
  --surface-soft: #edf4f6;
  --surface-hover: #e4f0f2;
  --line: #c5d4da;
  --line-soft: #d9e4e8;
  --text: #112b38;
  --text-soft: #435e6b;
  --text-muted: #556d78;
  --teal: #007d73;
  --teal-dark: #00655e;
  --teal-soft: rgba(0, 125, 115, .10);
  --blue: #176eac;
  --green: #168447;
  --green-soft: rgba(22, 132, 71, .1);
  --amber: #9b6300;
  --amber-soft: rgba(155, 99, 0, .1);
  --red: #bc3040;
  --red-soft: rgba(188, 48, 64, .1);
  --grey-soft: rgba(67, 94, 107, .08);
  --button-on-primary: #ffffff;
  --button-on-danger: #ffffff;
  --primary-hover: var(--teal-dark);
  --shadow-accent: #70458c;
  --shadow-border: #70458c;
  --shadow-soft: rgba(112, 69, 140, .11);
  --shadow: 0 14px 35px rgba(31, 55, 65, .12);
  --focus: #006f67;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 20rem; scroll-behavior: auto; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 76% -8%, rgba(36, 142, 157, .16), transparent 30rem),
    linear-gradient(180deg, var(--page-deep), var(--page) 12rem);
  color: var(--text);
  font-size: .9375rem;
  line-height: 1.5;
}

button, input, select { font: inherit; }

button, select { cursor: pointer; }

button { color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[role="option"]:focus-visible {
  outline: .2rem solid var(--focus);
  outline-offset: .18rem;
}

a { color: var(--teal); text-underline-offset: .2em; }

svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

img { display: block; max-width: 100%; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: .75rem;
  left: .75rem;
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: #031715;
  font-weight: 800;
  transform: translateY(-180%);
  transition: transform .16s ease;
}

.skip-link:focus { transform: translateY(0); }

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  padding: .8rem clamp(1rem, 2vw, 2.25rem) .9rem;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--page-deep) 92%, transparent);
  box-shadow: 0 .5rem 2rem rgba(0, 0, 0, .13);
  backdrop-filter: blur(18px);
}

.header-topline {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) auto minmax(16rem, 1fr);
  align-items: center;
  gap: 1rem;
  max-width: 118rem;
  margin: 0 auto .7rem;
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .7rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--teal) 0 43%, var(--surface) 43% 57%, var(--surface-soft) 57%);
  box-shadow: 0 0 1.1rem rgba(53, 220, 199, .2);
}

.brand-mark::before {
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--surface);
  content: "";
}

.brand-mark span {
  z-index: 1;
  width: .7rem;
  height: .7rem;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: var(--surface);
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.eyebrow, .section-kicker { color: var(--teal); font-size: .66rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.brand-title { margin-top: .16rem; font-size: clamp(.96rem, 1.3vw, 1.15rem); font-weight: 500; white-space: nowrap; }
.brand-title strong { font-weight: 800; }

.league-summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--text-soft);
  font-size: .78rem;
  font-weight: 650;
}

.status-dot, .pulse-dot {
  width: .48rem;
  height: .48rem;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 .25rem var(--teal-soft);
}

.summary-divider { width: 1px; height: .9rem; background: var(--line); }

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
}

.icon-button,
.small-button,
.help-button,
.search-clear,
.detail-close,
.dialog-close,
.favourite-button,
.card-favourite,
.toast button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface-raised);
}

.icon-button { min-height: 2.25rem; gap: .45rem; padding: .42rem .65rem; border-radius: .65rem; color: var(--text-soft); font-size: .75rem; font-weight: 700; }
.icon-button:hover, .small-button:hover, .detail-close:hover, .dialog-close:hover { border-color: var(--teal); color: var(--teal); }

.button {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .55rem .85rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .14s ease, background .14s ease, transform .14s ease;
}

.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--teal); color: var(--button-on-primary); }
.button--primary:hover { background: var(--primary-hover); }
.button--secondary, .button--quiet { border-color: var(--line); background: var(--surface-raised); color: var(--text-soft); }
.button--secondary:hover, .button--quiet:hover { border-color: var(--teal); background: var(--teal-soft); color: var(--text); }
.button--danger { background: var(--red); color: var(--button-on-danger); }
.button--danger-quiet { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); background: var(--red-soft); color: var(--red); }
.button--full { width: 100%; }

.search-zone {
  display: grid;
  grid-template-columns: minmax(28rem, 55rem) auto;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  max-width: 118rem;
  margin: 0 auto;
}

.search-box { position: relative; }

.search-box input {
  width: 100%;
  height: 3.25rem;
  padding: 0 5.6rem 0 3.15rem;
  border: 1px solid var(--line);
  border-radius: .88rem;
  outline: none;
  background: var(--surface);
  box-shadow: 0 .5rem 1.8rem rgba(0, 0, 0, .14), inset 0 0 0 1px transparent;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.search-box input::placeholder { color: var(--text-muted); font-weight: 450; }
.search-box input:focus { border-color: var(--teal); box-shadow: 0 0 0 .2rem var(--teal-soft), 0 .5rem 1.8rem rgba(0, 0, 0, .14); }
.search-icon { position: absolute; z-index: 1; top: 50%; left: 1.05rem; width: 1.25rem; height: 1.25rem; color: var(--teal); transform: translateY(-50%); }
.search-shortcut { position: absolute; top: 50%; right: 1rem; min-width: 1.65rem; padding: .18rem .35rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: .35rem; background: var(--surface-soft); color: var(--text-muted); text-align: center; transform: translateY(-50%); }
.search-clear { position: absolute; top: 50%; right: 3.45rem; width: 1.85rem; height: 1.85rem; border-radius: 50%; color: var(--text-muted); transform: translateY(-50%); }

.data-freshness { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; color: var(--text-muted); font-size: .7rem; white-space: nowrap; }
.data-freshness time { color: var(--text-soft); font-weight: 750; }
.freshness-separator { color: var(--line); }

.app-layout {
  display: grid;
  grid-template-areas:
    "team details catalogue"
    "tracker details catalogue";
  grid-template-columns: minmax(15.5rem, 17.5rem) minmax(32.5rem, 42.5rem) minmax(22rem, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: .9rem clamp(.8rem, 1.15vw, 1.35rem);
  width: min(100%, 120rem);
  min-height: calc(100vh - var(--header-height));
  margin: 0 auto;
  padding: 1.1rem clamp(.8rem, 1.6vw, 2rem) 2rem;
}

.left-rail { grid-area: team; }
.right-rail { grid-area: details; grid-row: 1 / span 2; }
.catalogue { grid-area: catalogue; grid-row: 1 / span 2; }
.tracker-rail { grid-area: tracker; min-width: 0; margin-top: .9rem; }
.left-rail, .right-rail { position: sticky; top: calc(var(--header-height) + .7rem); display: grid; min-width: 0; gap: .9rem; max-height: calc(100vh - var(--header-height) - 1.4rem); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.panel { border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface) 90%, var(--surface-raised))); box-shadow: var(--shadow); }
.team-panel, .tracker-panel { padding: 1rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.panel-heading h1, .panel-heading h2, .filter-heading-row h2 { margin: .07rem 0 0; font-size: 1rem; line-height: 1.25; }
.section-kicker { margin: 0; }
.small-button { gap: .3rem; min-height: 1.9rem; padding: .25rem .48rem; border-radius: .5rem; color: var(--text-soft); font-size: .68rem; font-weight: 800; }
.small-button svg { width: .85rem; height: .85rem; }

.control-label { display: block; margin: 0 0 .45rem; color: var(--text-muted); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.control-label-row { display: flex; align-items: center; justify-content: space-between; }
.help-button { width: 1.3rem; height: 1.3rem; border-radius: 50%; color: var(--text-muted); font-size: .66rem; font-weight: 900; }
.control-block { margin-top: 1rem; padding-top: .95rem; border-top: 1px solid var(--line-soft); }

.active-team { display: grid; gap: .45rem; }
.team-member {
  display: grid;
  grid-template-columns: 2.35rem 1fr 1.35rem;
  align-items: center;
  gap: .62rem;
  width: 100%;
  min-height: 3.25rem;
  padding: .42rem .55rem;
  border: 1px solid var(--line-soft);
  border-radius: .72rem;
  background: var(--surface-raised);
  text-align: left;
}
.team-member:hover { border-color: var(--line); background: var(--surface-hover); }
.team-member.is-active, .team-member[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset .2rem 0 0 var(--teal); }
.team-member__copy { display: flex; min-width: 0; flex-direction: column; }
.team-member__copy strong { overflow: hidden; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.team-member__copy small { color: var(--text-muted); font-size: .67rem; }
.active-check { display: none; width: 1.25rem; height: 1.25rem; place-items: center; border-radius: 50%; background: var(--teal); color: #03201d; font-size: .72rem; font-weight: 900; }
.team-member.is-active .active-check, .team-member[aria-pressed="true"] .active-check { display: grid; }

.pokemon-avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, var(--surface-hover), var(--surface));
  color: var(--text-soft);
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .02em;
}
.pokemon-avatar img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.avatar--grass { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); background: var(--green-soft); color: var(--green); }
.avatar--water { border-color: color-mix(in srgb, var(--blue) 55%, var(--line)); background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--blue); }

.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: .32rem; }
.segmented-control button { display: flex; min-width: 0; flex-direction: column; align-items: center; padding: .42rem .25rem; border: 1px solid var(--line-soft); border-radius: .58rem; background: var(--surface-raised); }
.segmented-control button:hover { border-color: var(--line); background: var(--surface-hover); }
.segmented-control button.is-selected, .segmented-control button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.segmented-control strong { font-size: .82rem; line-height: 1; }
.segmented-control span { margin-top: .2rem; color: var(--text-muted); font-size: .65rem; }

.assumption-list { display: grid; gap: .22rem; margin: .85rem 0 0; padding: .7rem .75rem; border-radius: .6rem; background: var(--surface-raised); }
.assumption-list div { display: flex; justify-content: space-between; gap: 1rem; font-size: .66rem; }
.assumption-list dt { color: var(--text-muted); }
.assumption-list dd { margin: 0; color: var(--text-soft); font-weight: 700; }

.slot-counter { padding: .2rem .48rem; border: 1px solid var(--line); border-radius: 1rem; color: var(--text-muted); font-size: .65rem; font-weight: 800; }
.tracker-list { display: grid; gap: .42rem; margin: 0 0 .75rem; padding: 0; list-style: none; }
.tracker-slot { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr) auto; align-items: center; gap: .5rem; min-height: 3.1rem; padding: .4rem .45rem; border: 1px solid var(--line-soft); border-radius: .62rem; background: var(--surface-raised); }
.tracker-slot.is-fainted { opacity: .62; }
.tracker-slot.is-fainted [data-field="tracker-name"] { text-decoration: line-through; }
.slot-number { display: grid; width: 1.55rem; height: 1.55rem; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--text-muted); font-size: .67rem; font-weight: 900; }
.tracker-copy { display: flex; min-width: 0; flex-direction: column; }
.tracker-copy strong { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.tracker-label, .tracker-state { color: var(--text-muted); font-size: .65rem; }
.tracker-state { color: var(--text-soft); }
.tracker-actions { display: flex; align-items: center; gap: .2rem; }
.tracker-actions button { min-height: 1.55rem; padding: .2rem .35rem; border: 1px solid var(--line); border-radius: .4rem; background: transparent; color: var(--text-muted); font-size: .65rem; }
.tracker-actions button:hover { color: var(--red); }
.tracker-actions svg { width: .75rem; height: .75rem; }

.catalogue { min-width: 0; }
.filter-region { position: relative; margin-bottom: .9rem; }
.filter-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.result-count { margin: 0; color: var(--text-muted); font-size: .72rem; }
.filter-scroller { display: flex; gap: .42rem; overflow-x: auto; padding: .15rem .15rem .45rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.filter-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .3rem; min-height: 2rem; padding: .36rem .72rem; border: 1px solid var(--line-soft); border-radius: 2rem; background: var(--surface); color: var(--text-soft); font-size: .7rem; font-weight: 750; }
.filter-chip:hover { border-color: var(--line); background: var(--surface-hover); }
.filter-chip.is-selected, .filter-chip[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.filter-chip--danger[aria-pressed="true"] { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.filter-chip svg { width: .8rem; height: .8rem; }
.type-fire::before, .type-electric::before, .type-grass::before, .type-ground::before, .type-ice::before, .type-rock::before, .type-flying::before, .type-poison::before, .type-fighting::before { width: .42rem; height: .42rem; border-radius: 50%; background: var(--chip-colour, var(--text-muted)); content: ""; }
.type-fire { --chip-colour: #ef794b; } .type-electric { --chip-colour: #f1ce4c; } .type-grass { --chip-colour: #6ac46b; } .type-ground { --chip-colour: #c89c62; } .type-ice { --chip-colour: #77d3db; } .type-rock { --chip-colour: #b6a36a; } .type-flying { --chip-colour: #8fabe6; } .type-poison { --chip-colour: #b477c9; } .type-fighting { --chip-colour: #d65664; }

.search-results { margin-bottom: 1rem; padding: .85rem; border: 1px solid color-mix(in srgb, var(--teal) 42%, var(--line)); border-radius: var(--radius); background: var(--teal-soft); }
.subsection-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 .15rem .55rem; }
.subsection-heading h3 { margin: 0; font-size: .82rem; }
.subsection-heading p { margin: 0; color: var(--text-muted); font-size: .68rem; }
.search-result-list { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.search-result { display: grid; grid-template-columns: 2.1rem 2.7rem minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: .2rem .6rem; min-height: 4.15rem; padding: .48rem .55rem; border: 1px solid var(--line-soft); border-radius: .65rem; background: var(--surface); cursor: pointer; }
.search-result:hover, .search-result.is-highlighted, .search-result[aria-selected="true"] { border-color: var(--teal); background: color-mix(in srgb, var(--surface) 90%, var(--teal)); }
.search-result__rank { grid-row: 1 / span 2; color: var(--text-muted); font-size: .66rem; font-weight: 800; text-align: center; }
.search-result__avatar { grid-row: 1 / span 2; width: 2.45rem; height: 2.45rem; }
.search-result__copy { display: flex; min-width: 0; flex-direction: column; grid-column: 3; grid-row: 1; }
.search-result__copy strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.search-result__copy > span { color: var(--text-muted); font-size: .65rem; }
.search-result__response { display: flex; grid-column: 3 / 5; grid-row: 2; align-items: baseline; gap: .35rem; min-width: 0; text-align: left; }
.search-result__response span { color: var(--text-muted); font-size: .65rem; }
.search-result__response strong { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.search-result .threat-badge { grid-column: 4; grid-row: 1; justify-self: end; }

.pokemon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.75rem), 1fr)); gap: .68rem; }
.pokemon-card { position: relative; min-width: 0; min-height: 9.2rem; }
.pokemon-card__select { position: relative; display: grid; grid-template-columns: 3.05rem minmax(0, 1fr); grid-template-rows: auto 1fr auto; align-items: center; gap: .55rem .7rem; width: 100%; height: 100%; padding: .75rem; overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--radius); background: linear-gradient(145deg, var(--surface), var(--surface-raised)); box-shadow: 0 .45rem 1.1rem rgba(0, 0, 0, .09); text-align: left; transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease; }
.pokemon-card__select::after { position: absolute; right: -2rem; bottom: -3rem; width: 7rem; height: 7rem; border: 1px solid var(--line-soft); border-radius: 50%; opacity: .45; content: ""; }
.pokemon-card:hover .pokemon-card__select { z-index: 1; border-color: color-mix(in srgb, var(--teal) 58%, var(--line)); box-shadow: 0 .7rem 1.5rem rgba(0, 0, 0, .16); transform: translateY(-2px); }
.pokemon-card.is-selected .pokemon-card__select { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal), 0 0 1.3rem var(--teal-soft); }
.card-rank { position: absolute; top: .55rem; left: .62rem; color: var(--text-muted); font-size: .65rem; font-weight: 850; }
.card-avatar { grid-row: 1 / span 2; width: 3.05rem; height: 3.05rem; margin-top: .6rem; }
.pokemon-card__body { display: flex; min-width: 0; flex-direction: column; align-self: stretch; padding-top: .25rem; }
.pokemon-card__name-row { display: flex; min-width: 0; align-items: flex-start; gap: .25rem .32rem; padding-right: 1.2rem; flex-wrap: wrap; }
.pokemon-card__name-row > strong { min-width: 3.2rem; flex: 1 1 4.5rem; overflow: visible; font-size: .82rem; line-height: 1.2; overflow-wrap: anywhere; white-space: normal; }
.card-form { margin-top: .1rem; color: var(--text-muted); font-size: .65rem; }
.type-list { display: flex; flex-wrap: wrap; gap: .24rem; margin-top: .35rem; }
.type-badge { padding: .1rem .35rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--grey-soft); color: var(--text-soft); font-size: .65rem; font-weight: 750; }
.response-line { display: flex; flex-direction: column; margin-top: auto; padding-top: .48rem; }
.response-line > span { color: var(--text-muted); font-size: .65rem; text-transform: uppercase; }
.response-line strong { overflow: hidden; color: var(--text); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.shadow-badge, .form-badge { display: inline-flex; width: fit-content; padding: .1rem .32rem; border: 1px solid var(--shadow-border); border-radius: 1rem; background: var(--shadow-soft); color: var(--shadow-accent); font-size: .65rem; font-weight: 850; }
.form-badge { border-color: var(--line); background: var(--grey-soft); color: var(--text-soft); }
.threat-badge { display: inline-flex; z-index: 1; grid-column: 1 / -1; align-items: center; justify-self: start; gap: .3rem; padding: .2rem .42rem; border-radius: 1rem; font-size: .65rem; font-weight: 850; }
.threat-badge i { width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.threat--low, .threat--green { background: var(--green-soft); color: var(--green); }
.threat--medium, .threat--amber { background: var(--amber-soft); color: var(--amber); }
.threat--high, .threat--red { background: var(--red-soft); color: var(--red); }
.threat--unknown, .threat--grey { background: var(--grey-soft); color: var(--text-muted); }
.core-breaker-tag { position: absolute; z-index: 2; right: .45rem; bottom: .5rem; padding: .18rem .4rem; border: 1px solid color-mix(in srgb, var(--red) 42%, transparent); border-radius: 1rem; background: var(--red-soft); color: var(--red); font-size: .65rem; font-weight: 850; }
.card-favourite { position: absolute; z-index: 3; top: .48rem; right: .48rem; width: 1.65rem; height: 1.65rem; border-color: transparent; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 1rem; }
.card-favourite:hover, .card-favourite[aria-pressed="true"] { background: var(--amber-soft); color: var(--amber); }

.loading-card { min-height: 9.2rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: linear-gradient(100deg, var(--surface) 20%, var(--surface-raised) 36%, var(--surface) 54%); background-size: 220% 100%; animation: shimmer 1.35s infinite linear; }
@keyframes shimmer { to { background-position-x: -220%; } }

.empty-state { padding: 4rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius-lg); text-align: center; }
.empty-state__icon { display: grid; width: 3rem; height: 3rem; margin: 0 auto .8rem; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--text-muted); font-size: 1.25rem; font-weight: 900; }
.empty-state h3 { margin: 0; }
.empty-state p { margin: .25rem 0 1rem; color: var(--text-muted); }
.catalogue-status { margin-bottom: .75rem; }
.catalogue-sentinel { display: flex; min-height: 1px; align-items: center; justify-content: center; margin-top: .7rem; color: var(--text-muted); font-size: .72rem; text-align: center; }
.catalogue-sentinel:empty { margin-top: 0; }

.right-rail { scrollbar-gutter: stable; }
.detail-panel { min-height: 34rem; overflow: hidden; }
.detail-empty { display: flex; min-height: min(44rem, calc(100vh - var(--header-height) - 1.5rem)); flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem; text-align: center; }
.detail-empty h2 { margin: .3rem 0 .55rem; font-size: 1.65rem; }
.detail-empty > p:not(.section-kicker, .keyboard-tip) { max-width: 23rem; margin: 0; color: var(--text-muted); font-size: .9rem; }
.radar-mark { position: relative; display: grid; width: 6.4rem; height: 6.4rem; margin-bottom: 1.35rem; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 .9rem, var(--line-soft) .95rem 1rem); }
.radar-mark::before, .radar-mark::after { position: absolute; background: var(--line-soft); content: ""; }
.radar-mark::before { width: 100%; height: 1px; }
.radar-mark::after { width: 1px; height: 100%; }
.radar-mark span { z-index: 1; width: .65rem; height: .65rem; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 .3rem var(--teal-soft), 0 0 1.4rem var(--teal); }
.keyboard-tip { display: flex; align-items: center; gap: .4rem; margin: 1.25rem 0 0; color: var(--text-muted); font-size: .68rem; }
.keyboard-tip kbd { padding: .12rem .35rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: .3rem; background: var(--surface-raised); }
.detail-content { position: relative; }
.detail-close { display: none; position: absolute; z-index: 4; top: .7rem; right: .7rem; width: 2rem; height: 2rem; border-radius: 50%; }

.opponent-header { display: grid; grid-template-columns: 5.75rem minmax(0, 1fr) 2.6rem; align-items: center; gap: 1rem; padding: 1.25rem 1.35rem 1.15rem; border-bottom: 1px solid var(--line-soft); background: radial-gradient(circle at 10% 0, var(--teal-soft), transparent 11rem); }
.opponent-avatar { display: grid; width: 5.75rem; height: 5.75rem; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--text-muted); font-weight: 900; }
.opponent-avatar img { width: 100%; height: 100%; object-fit: contain; }
.opponent-heading-copy { min-width: 0; }
.opponent-rank-line { display: flex; flex-wrap: wrap; gap: .3rem; }
.rank-badge { color: var(--teal); font-size: .65rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.opponent-heading-copy h2 { overflow: hidden; margin: .18rem 0 0; font-size: clamp(1.5rem, 2vw, 1.8rem); line-height: 1.12; text-overflow: ellipsis; white-space: nowrap; }
.favourite-button { width: 2.55rem; height: 2.55rem; border-radius: 50%; color: var(--text-muted); font-size: 1.5rem; }
.favourite-button:hover, .favourite-button[aria-pressed="true"] { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }

.recommendation-hero { padding: 1.35rem 1.45rem; border-bottom: 1px solid var(--line-soft); background: linear-gradient(145deg, color-mix(in srgb, var(--teal-soft) 82%, transparent), transparent); }
.recommendation-label { display: flex; align-items: center; gap: .45rem; }
.recommendation-label h3 { margin: 0; color: var(--text-soft); font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; }
.pulse-dot { width: .4rem; height: .4rem; }
.best-response { display: block; margin: .38rem 0 .85rem; color: var(--teal); font-size: clamp(2.15rem, 3.3vw, 3.2rem); line-height: 1; letter-spacing: -.03em; text-transform: uppercase; }
.response-alternatives { display: flex; flex-wrap: wrap; gap: .45rem 1.4rem; margin: -.3rem 0 .9rem; color: var(--text-muted); font-size: .7rem; text-transform: uppercase; }
.response-alternatives strong { margin-left: .25rem; color: var(--text-soft); font-size: .76rem; }
.action-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.35rem; padding: .82rem 1rem; border: 1px solid color-mix(in srgb, var(--teal) 52%, var(--line)); border-radius: .75rem; background: var(--teal-soft); }
.action-caption { color: var(--text-muted); font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.action-banner strong { font-size: 1.35rem; line-height: 1.12; text-align: right; }
.recommendation-reason { margin: .9rem 0 .65rem; color: var(--text-soft); font-size: .84rem; line-height: 1.55; }
.confidence-line { display: flex; }
.confidence-badge { display: inline-flex; padding: .17rem .42rem; border-radius: 1rem; font-size: .65rem; font-weight: 850; }
.confidence--simulated { background: var(--green-soft); color: var(--green); }
.confidence--partial { background: var(--amber-soft); color: var(--amber); }
.confidence--unavailable { background: var(--grey-soft); color: var(--text-muted); }

.scenario-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line-soft); background: var(--surface-raised); }
.scenario-strip div { display: flex; min-width: 0; flex-direction: column; padding: .78rem .8rem; text-align: center; }
.scenario-strip div + div { border-left: 1px solid var(--line-soft); }
.scenario-strip span { color: var(--text-muted); font-size: .65rem; text-transform: uppercase; }
.scenario-strip strong { overflow: hidden; margin-top: .1rem; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }

.detail-section { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line-soft); }
.detail-section-heading, .warning-heading { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .62rem; }
.detail-section-heading h3, .warning-heading h3, .tracker-mark-section h3, .preserve-section h3 { margin: 0; font-size: .9rem; }
.detail-section-heading p { margin: .12rem 0 0; color: var(--text-muted); font-size: .65rem; }
.source-label { color: var(--text-muted); font-size: .65rem; text-align: right; }
.matchup-order { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; counter-reset: matchup; }
.matchup-order-item { display: grid; grid-template-columns: 1.4rem 2.15rem minmax(5.5rem, 1fr) auto 3rem; align-items: center; gap: .5rem; padding: .5rem .55rem; border-radius: .55rem; background: var(--surface-raised); }
.order-number { color: var(--text-muted); font-size: .65rem; font-weight: 900; text-align: center; }
.order-avatar { width: 2.1rem; height: 2.1rem; font-size: .65rem; }
.order-name { overflow: hidden; font-size: .76rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.order-rating { font-size: .74rem; text-align: right; }
.result-badge { padding: .14rem .35rem; border-radius: 1rem; font-size: .65rem; font-weight: 850; white-space: nowrap; }
.result--strong-win { background: var(--green-soft); color: var(--green); }
.result--narrow-win { background: color-mix(in srgb, var(--green-soft) 55%, var(--grey-soft)); color: color-mix(in srgb, var(--green) 72%, var(--text-soft)); }
.result--neutral { background: var(--grey-soft); color: var(--text-soft); }
.result--narrow-loss { background: var(--amber-soft); color: var(--amber); }
.result--strong-loss { background: var(--red-soft); color: var(--red); }
.result--unavailable { background: var(--grey-soft); color: var(--text-muted); }

.table-wrap { overflow-x: visible; border: 1px solid var(--line-soft); border-radius: .6rem; }
.matchup-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: .7rem; }
.matchup-table th { padding: .55rem .45rem; overflow-wrap: anywhere; background: var(--surface-raised); color: var(--text-muted); font-size: .65rem; letter-spacing: .02em; line-height: 1.3; text-align: left; text-transform: uppercase; }
.matchup-table td { padding: .58rem .45rem; overflow-wrap: anywhere; border-top: 1px solid var(--line-soft); color: var(--text-soft); line-height: 1.4; vertical-align: top; }
.matchup-table td:first-child { color: var(--text); font-weight: 750; }
.matchup-table th:nth-child(1), .matchup-table td:nth-child(1) { width: 15%; }
.matchup-table th:nth-child(2), .matchup-table td:nth-child(2) { width: 8%; }
.matchup-table th:nth-child(3), .matchup-table td:nth-child(3) { width: 15%; }
.matchup-table th:nth-child(4), .matchup-table td:nth-child(4) { width: 25%; }
.matchup-table th:nth-child(5), .matchup-table td:nth-child(5) { width: 17%; }
.matchup-table th:nth-child(6), .matchup-table td:nth-child(6) { width: 20%; }

.fast-move-row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: .5rem; padding: .45rem .55rem; border-radius: .5rem; background: var(--surface-raised); }
.fast-move-row span { color: var(--text-muted); font-size: .65rem; text-transform: uppercase; }
.fast-move-row strong { font-size: .7rem; }
.fast-move-row small { color: var(--text-muted); font-size: .65rem; text-align: right; }
.dangerous-moves { display: grid; gap: .45rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.move-card { padding: .55rem; border: 1px solid var(--line-soft); border-radius: .55rem; background: var(--surface-raised); }
.move-card__top { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.move-card__top strong { font-size: .72rem; }
.move-category { padding: .12rem .32rem; border-radius: 1rem; background: var(--amber-soft); color: var(--amber); font-size: .65rem; font-weight: 850; }
.move-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin: .45rem 0; }
.move-facts span { display: flex; flex-direction: column; padding: .35rem; border-radius: .35rem; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.move-facts small { color: var(--text-muted); font-size: .65rem; }
.move-facts strong { font-size: .68rem; }
.move-card p { margin: 0; color: var(--text-soft); font-size: .68rem; }

.warning-section { border-left: .22rem solid var(--amber); background: var(--amber-soft); }
.warning-heading { justify-content: flex-start; margin-bottom: .35rem; color: var(--amber); }
.warning-heading svg { width: 1rem; height: 1rem; }
.warning-disclaimer { margin: 0 0 .5rem; color: var(--text-soft); font-size: .68rem; font-weight: 650; }
.warning-section ul { margin: 0; padding-left: 1rem; color: var(--text-soft); font-size: .68rem; }
.preserve-section p { margin: .35rem 0 0; color: var(--text-soft); font-size: .67rem; }
.tracker-mark-section { padding: 1.1rem 1.25rem; }
.mark-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin-top: .55rem; }
.mark-buttons .button { min-height: 2.25rem; padding-inline: .35rem; font-size: .68rem; }
.detail-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem 1rem; padding: .8rem 1.25rem; background: var(--surface-raised); color: var(--text-muted); font-size: .68rem; }
.inline-notice { padding: .55rem .65rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--grey-soft); color: var(--text-soft); font-size: .65rem; }
.inline-notice--warning { margin: .55rem 0 0; border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); background: var(--amber-soft); color: var(--amber); }

.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; max-width: 118rem; margin: 0 auto; padding: 1rem clamp(1rem, 2vw, 2.25rem) 1.5rem; border-top: 1px solid var(--line-soft); color: var(--text-muted); font-size: .68rem; }
.app-footer p { margin: 0; }

.app-dialog {
  width: min(calc(100% - 2rem), 64rem);
  max-height: min(52rem, calc(100vh - 2rem));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, .5);
  color: var(--text);
}
.app-dialog::backdrop { background: rgba(1, 7, 12, .75); backdrop-filter: blur(5px); }
.app-dialog[open] { animation: dialog-in .16s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(.6rem) scale(.985); } }
.app-dialog form { display: contents; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.3rem; border-bottom: 1px solid var(--line-soft); background: var(--surface-raised); }
.dialog-header h2 { margin: .12rem 0 .25rem; font-size: 1.2rem; }
.dialog-header p:not(.section-kicker) { max-width: 44rem; margin: 0; color: var(--text-muted); font-size: .72rem; }
.dialog-close { width: 2rem; height: 2rem; flex: 0 0 auto; border-radius: 50%; }
.dialog-body { max-height: calc(100vh - 12rem); overflow-y: auto; padding: 1rem 1.3rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.dialog-actions { display: flex; align-items: center; gap: .55rem; padding: .85rem 1.3rem; border-top: 1px solid var(--line-soft); background: var(--surface-raised); }
.action-spacer { flex: 1; }

.team-editor { display: grid; gap: .85rem; }
.team-editor-card { min-width: 0; margin: 0; padding: .9rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface-raised); }
.team-editor-card legend { padding: 0 .35rem; font-size: .75rem; font-weight: 850; }
.team-editor-card legend span { display: inline-grid; width: 1.3rem; height: 1.3rem; margin-right: .25rem; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: .65rem; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.field { display: flex; min-width: 0; flex-direction: column; gap: .28rem; color: var(--text-soft); font-size: .68rem; font-weight: 700; }
.field > span, .field > span > span { color: var(--text-muted); font-weight: 450; }
.field--wide { grid-column: span 2; }
.field input, .field select { width: 100%; height: 2.25rem; padding: 0 .55rem; border: 1px solid var(--line); border-radius: .48rem; outline: none; background: var(--surface); color: var(--text); font-size: .7rem; }
.field input:focus, .field select:focus { border-color: var(--teal); box-shadow: 0 0 0 .16rem var(--teal-soft); }
.check-field { display: flex; align-items: center; align-self: end; gap: .42rem; height: 2.25rem; padding: 0 .55rem; border: 1px solid var(--line); border-radius: .48rem; background: var(--surface); color: var(--text-soft); font-size: .7rem; font-weight: 700; }
.check-field input { width: 1rem; height: 1rem; accent-color: var(--teal); }
.iv-fieldset > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; }
.form-error { padding: .65rem; border: 1px solid var(--red); border-radius: .55rem; background: var(--red-soft); color: var(--red); font-size: .7rem; }

.data-options { display: grid; gap: .75rem; }
.data-option { display: grid; grid-template-columns: 2.6rem 1fr; gap: .8rem; padding: .85rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface-raised); }
.data-option__icon { display: grid; width: 2.6rem; height: 2.6rem; place-items: center; border-radius: .65rem; background: var(--teal-soft); color: var(--teal); }
.data-option h3, .danger-zone h3 { margin: 0; font-size: .78rem; }
.data-option p, .danger-zone p { margin: .16rem 0 .55rem; color: var(--text-muted); font-size: .67rem; }
.data-option__actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.file-button { cursor: pointer; }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
.file-button:has(+ .visually-hidden-file:focus-visible) { outline: .2rem solid var(--focus); outline-offset: .18rem; }
.import-status { padding: .7rem; border: 1px solid var(--teal); border-radius: .55rem; background: var(--teal-soft); color: var(--text-soft); font-size: .7rem; }
.import-status.is-error { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .25rem; padding: .85rem; border: 1px solid color-mix(in srgb, var(--red) 35%, var(--line)); border-radius: var(--radius); background: var(--red-soft); }
.danger-zone p { margin-bottom: 0; }

.confirm-dialog { width: min(calc(100% - 2rem), 28rem); padding: 1.5rem; text-align: center; }
.confirm-dialog h2 { margin: .7rem 0 .35rem; font-size: 1.15rem; }
.confirm-dialog p { margin: 0 0 1rem; color: var(--text-muted); font-size: .75rem; }
.confirm-icon { display: grid; width: 3.2rem; height: 3.2rem; margin: 0 auto; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red); font-size: 1.35rem; font-weight: 900; }
.dialog-actions--centred { justify-content: center; padding: .8rem 0 0; border: 0; background: transparent; }

.toast { position: fixed; z-index: 100; bottom: 1.2rem; left: 50%; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) 1.8rem; align-items: center; gap: .55rem; width: min(calc(100% - 2rem), 23rem); padding: .7rem; border: 1px solid var(--teal); border-radius: .75rem; background: var(--surface-raised); box-shadow: var(--shadow); font-size: .72rem; transform: translateX(-50%); }
.toast-icon { display: grid; width: 1.55rem; height: 1.55rem; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 900; }
.toast.is-error { border-color: var(--red); }
.toast.is-error .toast-icon { background: var(--red-soft); color: var(--red); }
.toast button { width: 1.7rem; height: 1.7rem; border: 0; border-radius: 50%; color: var(--text-muted); }
.toast button svg { width: .85rem; height: .85rem; }

@media (max-width: 87rem) {
  :root { --header-height: 9.35rem; }
  .app-layout { grid-template-columns: minmax(15.4rem, 16.5rem) minmax(32.5rem, 38rem) minmax(20rem, 1fr); }
  .pokemon-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); }
  .header-actions .button-label { display: none; }
  .icon-button { width: 2.25rem; padding: 0; }
}

@media (max-width: 78rem) {
  :root { --header-height: 9.35rem; }
  .app-layout {
    grid-template-areas:
      "team details"
      "catalogue catalogue"
      "tracker tracker";
    grid-template-columns: minmax(15.5rem, 17rem) minmax(0, 1fr);
    grid-template-rows: minmax(calc(100vh - var(--header-height) - 1.4rem), auto) auto auto;
  }
  .right-rail, .catalogue { grid-row: auto; }
  .tracker-rail { margin-top: 0; }
  .tracker-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tracker-panel { width: 100%; }
}

@media (max-width: 54rem) {
  :root { --header-height: 10.5rem; }
  .header-topline { grid-template-columns: 1fr auto; }
  .league-summary { display: none; }
  .search-zone { grid-template-columns: 1fr; gap: .4rem; }
  .data-freshness { justify-content: center; }
  .app-layout {
    grid-template-areas:
      "team"
      "details"
      "catalogue"
      "tracker";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
  }
  .left-rail, .right-rail { position: relative; top: auto; max-height: none; overflow: visible; }
  .right-rail, .catalogue { grid-row: auto; }
  .detail-panel { min-height: auto; }
  .detail-empty { min-height: 18rem; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 42rem) {
  :root { --header-height: 9rem; }
  .app-header { padding: .65rem .75rem; }
  .header-topline { margin-bottom: .55rem; }
  .brand-title { font-size: .87rem; }
  .brand-title strong { display: block; }
  .brand-mark { width: 2rem; height: 2rem; }
  .header-actions .button--quiet { width: 2.25rem; padding: 0; }
  .header-actions .button--quiet span { display: none; }
  .search-zone { gap: 0; }
  .search-box input { height: 2.85rem; padding-right: 4.7rem; font-size: .86rem; }
  .search-shortcut { display: none; }
  .search-clear { right: .65rem; }
  .data-freshness { display: none; }
  .app-layout { padding: .75rem .65rem 1.5rem; }
  .team-panel, .tracker-panel { padding: .85rem; }
  .tracker-list { grid-template-columns: 1fr; }
  .filter-heading-row { align-items: flex-start; }
  .filter-heading-row h2 { font-size: .9rem; }
  .pokemon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .pokemon-card { min-height: 9.8rem; }
  .pokemon-card__select { grid-template-columns: 2.55rem minmax(0, 1fr); padding: .58rem; }
  .card-avatar { width: 2.5rem; height: 2.5rem; }
  .pokemon-card__name-row > strong { font-size: .73rem; }
  .search-result { grid-template-columns: 1.8rem 2.4rem minmax(0, 1fr) auto; grid-template-rows: auto; }
  .search-result__response { display: none; }
  .search-result__rank, .search-result__avatar { grid-row: 1; }
  .search-result__avatar { width: 2.2rem; height: 2.2rem; }
  .search-result .threat-badge { grid-row: 1; }
  .detail-panel { border-radius: var(--radius); }
  .detail-close { display: inline-flex; }
  .opponent-header { grid-template-columns: 4.5rem minmax(0, 1fr) 2.25rem; padding: 1rem 3rem 1rem 1rem; }
  .opponent-avatar { width: 4.5rem; height: 4.5rem; }
  .best-response { font-size: clamp(2rem, 10vw, 2.75rem); }
  .matchup-order-item { grid-template-columns: 1.2rem 1.7rem minmax(3.8rem, 1fr) auto; }
  .order-rating { display: none; }
  .table-wrap { overflow-x: auto; }
  .matchup-table { min-width: 38rem; table-layout: auto; }
  .move-facts { grid-template-columns: 1fr; }
  .mark-buttons { grid-template-columns: 1fr; }
  .dialog-header, .dialog-body, .dialog-actions { padding-left: .85rem; padding-right: .85rem; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .check-field { align-self: auto; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .button { flex: 1 1 auto; }
  .action-spacer { display: none; }
  .data-option { grid-template-columns: 1fr; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .danger-zone .button { width: 100%; }
  .app-footer { display: block; }
  .app-footer p + p { margin-top: .45rem; }
}

@media (max-width: 25rem) {
  .pokemon-grid { grid-template-columns: 1fr; }
  .brand-copy .eyebrow { display: none; }
  .opponent-header { grid-template-columns: 3.5rem minmax(0, 1fr) 2rem; }
  .opponent-avatar { width: 3.5rem; height: 3.5rem; }
  .scenario-strip { grid-template-columns: 1fr; }
  .scenario-strip div + div { border-top: 1px solid var(--line-soft); border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

html[data-reduced-motion="true"] *,
html[data-reduced-motion="true"] *::before,
html[data-reduced-motion="true"] *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

@media (forced-colors: active) {
  .status-dot, .pulse-dot, .threat-badge i { forced-color-adjust: none; background: CanvasText; }
  .team-member.is-active, .team-member[aria-pressed="true"], .filter-chip.is-selected, .filter-chip[aria-pressed="true"] { outline: 2px solid Highlight; }
}
