.pokemon-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(145px, 1fr));

    align-content: start;
    gap: 12px;

    padding: 14px;

    min-height: 0;
    overflow-y: auto;
}

.pokemon-card {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;

    min-width: 0;
    min-height: 220px;
    padding: 10px;

    font: inherit;
    color: inherit;
    text-align: center;

    background: #ffffff;
    border: 1px solid #dadada;
    border-radius: 8px;

    cursor: pointer;

    transition:
        border-color 120ms ease,
        box-shadow 120ms ease,
        transform 120ms ease;
}

.pokemon-card:hover {
    transform: translateY(-2px);

    border-color: #9f9f9f;
    box-shadow: 0 5px 14px rgb(0 0 0 / 10%);
}

.pokemon-card-selected {
    border-color: #3b4cca;
    box-shadow:
        0 0 0 2px rgb(59 76 202 / 18%),
        0 5px 14px rgb(0 0 0 / 10%);
}

.pokemon-card-number {
    align-self: flex-start;

    font-size: 11px;
    color: #777777;
}

.pokemon-card-image {
    display: block;

    width: 112px;
    height: 112px;
    margin: 2px auto 4px;

    object-fit: contain;
}

.pokemon-card-name {
    display: block;
    width: 100%;
    margin-bottom: 8px;

    overflow: hidden;

    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pokemon-card-types,
.pokemon-detail-types {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 54px;
    padding: 4px 8px;

    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;

    background: #777777;
    border-radius: 999px;
}

.type-normal   { background: #8a8a72; }
.type-fire     { background: #e76f36; }
.type-water    { background: #4f83d1; }
.type-electric { background: #d8ad21; }
.type-grass    { background: #5e9f45; }
.type-ice      { background: #56aeb0; }
.type-fighting { background: #aa3932; }
.type-poison   { background: #914791; }
.type-ground   { background: #b79143; }
.type-flying   { background: #7d6fc3; }
.type-psychic  { background: #d94f7c; }
.type-bug      { background: #8b9726; }
.type-rock     { background: #95813a; }
.type-ghost    { background: #62507c; }
.type-dragon   { background: #6542b9; }
.type-dark     { background: #594b43; }
.type-steel    { background: #8888a0; }
.type-fairy    { background: #d57991; }

.pokemon-detail-panel {
    min-width: 0;
    height: 100%;
    overflow-y: auto;

    background: #ffffff;
}

.pokemon-detail {
    padding: 24px;
}

.pokemon-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;

    padding-bottom: 22px;
    border-bottom: 1px solid #e3e3e3;
}

.pokemon-detail-number {
    font-size: 13px;
    color: #777777;
}

.pokemon-detail-name {
    margin: 4px 0 12px;
    font-size: 28px;
    line-height: 1.15;
}

.pokemon-detail-image {
    flex: 0 0 auto;

    width: 190px;
    height: 190px;

    object-fit: contain;
}

.pokemon-detail-types {
    justify-content: flex-start;
}

.pokemon-variant-selector {
    display: grid;
    gap: 16px;

    padding: 20px 0;
    border-bottom: 1px solid #e8e8e8;
}

.pokemon-variant-group h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.pokemon-variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pokemon-variant-button {
    min-height: 36px;
    padding: 7px 12px;

    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #26358e;

    background: #eef0ff;
    border: 1px solid #c7ccef;
    border-radius: 999px;

    cursor: pointer;
}

.pokemon-variant-button:hover {
    background: #dfe3ff;
}

.pokemon-variant-button:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

.pokemon-variant-button[aria-pressed="true"] {
    color: #ffffff;
    background: #3b4cca;
    border-color: #3b4cca;
    cursor: pointer;
}

.pokemon-detail-section {
    padding: 20px 0;
    border-bottom: 1px solid #e8e8e8;
}

.pokemon-detail-section:last-child {
    border-bottom: 0;
}

.pokemon-detail-section h3 {
    margin: 0 0 12px;
}

.pokemon-detail-category {
    margin: 0 0 8px;
    font-weight: 700;
}

.pokemon-detail-description {
    margin: 0;
    line-height: 1.6;
}

.pokemon-detail-team-action {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-bottom: 1px solid #e8e8e8;
}

.pokemon-detail-team-action button {
    min-height: 44px;
    padding: 9px 16px;
    color: #ffffff;
    font-weight: 700;
    background: #3b4cca;
    border: 1px solid #3b4cca;
    border-radius: 6px;
    cursor: pointer;
}

.pokemon-detail-team-action button:hover {
    background: #2f3ca8;
}

.pokemon-detail-team-action button:focus-visible {
    outline: 3px solid rgba(59, 76, 202, 0.32);
    outline-offset: 2px;
}

.pokemon-detail-team-action button:disabled {
    color: #5e6476;
    background: #e3e5eb;
    border-color: #c8cbd5;
    cursor: not-allowed;
}

.pokemon-detail-team-feedback {
    flex: 1 1 240px;
    margin: 0;
    line-height: 1.45;
}

.pokemon-detail-team-feedback--error {
    color: #a12622;
}

.pokemon-detail-list {
    margin: 0;
    padding: 0;

    list-style: none;
}

.pokemon-detail-list-item {
    padding: 9px 11px;
    margin-bottom: 6px;

    background: #f3f3f3;
    border-radius: 6px;
}

.pokemon-stats {
    display: grid;
    gap: 9px;
}

.pokemon-stat {
    display: grid;
    grid-template-columns:
        minmax(76px, 110px)
        3ch
        minmax(0, 1fr)
        3ch;

    align-items: center;
    gap: 8px;
}

.pokemon-stat-label {
    font-size: 13px;
}

.pokemon-stat-value {
    width: 3ch;

    font-variant-numeric:
        tabular-nums;
    text-align: center;
}

.pokemon-stat-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;

    min-width: 0;
}

.pokemon-stat-dot {
    flex: 0 0 10px;

    width: 10px;
    height: 10px;

    border-radius: 50%;
}

.pokemon-stat-dot-base {
    background: #3b4cca;
}

.pokemon-stat-dot-reachable {
    background: #dedede;
}

.pokemon-stat-dot-unreachable {
    background: #3a3a3a;
}

.pokemon-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 100%;
    padding: 40px;

    color: #777777;
    text-align: center;
}

.pokemon-detail-empty-icon {
    display: grid;
    place-items: center;

    width: 76px;
    height: 76px;
    margin-bottom: 18px;

    font-size: 34px;
    font-weight: 700;

    background: #eeeeee;
    border-radius: 50%;
}

@media (max-width: 680px) {
    .pokemon-detail-header {
        flex-direction: column-reverse;
    }

    .pokemon-detail-image {
        margin: 0 auto;
    }

    .pokemon-stat {
        grid-template-columns:
            minmax(70px, 90px)
            3ch
            minmax(0, 1fr)
            3ch;

        gap: 6px;
    }

    .pokemon-card-name {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}


.pokemon-search {
    display: grid;
    gap: 6px;
}

.pokemon-search-label,
.pokemon-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: #555555;
}

.pokemon-search-input,
.pokemon-filter-select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;

    font: inherit;
    color: #222222;

    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;
}

.pokemon-search-input:focus,
.pokemon-filter-select:focus {
    outline: 2px solid rgb(59 76 202 / 22%);
    border-color: #3b4cca;
}

.pokemon-filters {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(170px, 220px)
        auto;
    grid-template-areas:
        "types generation reset"
        "types rarity reset"
        "summary summary summary";

    align-items: end;
    gap: 12px;

    margin-top: 12px;
}


.pokemon-filter-group {
    display: grid;
    gap: 6px;
}

.pokemon-generation-filter {
    grid-area: generation;
}

.pokemon-rarity-filter {
    grid-area: rarity;
}

.pokemon-rarity-and-lower {
    display: inline-flex;
    gap: 7px;
    align-items: center;

    width: fit-content;

    font-size: 12px;
    color: #444444;
}

.pokemon-rarity-and-lower input {
    margin: 0;
}

.pokemon-rarity-and-lower:has(input:disabled) {
    color: #888888;
}

.pokemon-filters-reset {
    grid-area: reset;
    align-self: end;

    min-height: 42px;
    padding: 9px 14px;

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    background: #eeeeee;
    border: 1px solid #cccccc;
    border-radius: 6px;

    cursor: pointer;
}

.pokemon-filters-reset:hover {
    background: #e3e3e3;
}

.pokemon-type-filter {
    grid-area: types;

    min-width: 0;
    margin: 0;
    padding: 0;

    border: 0;
}

.pokemon-filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    grid-area: summary;
}

.pokemon-filter-summary[hidden] {
    display: none;
}

.pokemon-filter-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;

    min-height: 30px;
    padding: 4px 9px;

    font: inherit;
    font-size: 12px;
    color: #26358e;

    background: #eef0ff;
    border: 1px solid #c7ccef;
    border-radius: 999px;

    cursor: pointer;
}

.pokemon-filter-chip:hover {
    background: #dfe3ff;
}

.pokemon-filter-chip:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

.pokemon-filter-chip span {
    font-size: 16px;
    line-height: 1;
}



.pokemon-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin-top: 6px;
}

.pokemon-type-option {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 30px;
    padding: 5px 10px;

    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;

    border: 2px solid transparent;
    border-radius: 999px;

    cursor: pointer;
    opacity: 0.45;

    transition:
        opacity 120ms ease,
        transform 120ms ease,
        box-shadow 120ms ease;
}

.pokemon-type-option:hover {
    opacity: 0.75;
    transform: translateY(-1px);
}

.pokemon-type-option:has(
    .pokemon-type-checkbox:checked
) {
    opacity: 1;

    border-color: #ffffff;
    box-shadow:
        0 0 0 2px #333333,
        0 3px 8px rgb(0 0 0 / 18%);
}

.pokemon-type-option:has(
    .pokemon-type-checkbox:focus-visible
) {
    outline: 3px solid rgb(59 76 202 / 35%);
    outline-offset: 2px;
}

.pokemon-type-checkbox {
    position: absolute;

    width: 1px;
    height: 1px;

    margin: 0;
    opacity: 0;
}



.pokemon-results-empty {
    grid-column: 1 / -1;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 260px;
    padding: 30px;

    color: #777777;
    text-align: center;
}

.pokemon-results-empty strong {
    color: #333333;
}

.pokemon-results-empty p {
    margin: 8px 0 0;
}

@media (max-width: 760px) {
    .pokemon-filters {
        grid-template-columns: 1fr;
        grid-template-areas:
            "types"
            "generation"
            "rarity"
            "summary"
            "reset";
    }
}

.pokemon-reference-list {
    display: grid;
    gap: 8px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.pokemon-reference-item {
    overflow: hidden;

    border: 1px solid #dddddd;
    border-radius: 8px;
}

.pokemon-reference-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    width: 100%;
    padding: 10px 12px;

    color: inherit;
    text-align: left;

    background: #ffffff;
    border: 0;

    cursor: pointer;
}

.pokemon-reference-trigger:hover,
.pokemon-reference-trigger[aria-expanded="true"] {
    background: #f4f5fb;
}

.pokemon-reference-trigger:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: -3px;
}

.pokemon-reference-role {
    color: #666666;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pokemon-reference-name {
    font-weight: 700;
    text-align: right;
}

.pokemon-reference-detail {
    padding: 14px;

    background: #f8f8f8;
    border-top: 1px solid #dddddd;
}

.pokemon-reference-detail h4,
.pokemon-reference-detail h5,
.pokemon-reference-detail p {
    margin-top: 0;
}

.pokemon-reference-detail h4 {
    margin-bottom: 12px;
}

.pokemon-reference-detail h5 {
    margin-bottom: 5px;
}

.pokemon-reference-detail p:last-child {
    margin-bottom: 0;
}

.pokemon-reference-detail-error {
    color: #7a2020;
    background: #fff4f4;
}

.pokemon-reference-retry {
    padding: 7px 12px;

    font-weight: 700;

    background: #ffffff;
    border: 1px solid currentColor;
    border-radius: 6px;

    cursor: pointer;
}

.pokemon-reference-fields,
.pokemon-reference-data {
    margin: 0;
}

.pokemon-reference-field,
.pokemon-reference-data > div {
    display: grid;
    grid-template-columns:
        minmax(90px, 0.4fr)
        minmax(0, 1fr);
    gap: 10px;

    padding: 5px 0;
}

.pokemon-reference-field dt,
.pokemon-reference-data dt {
    color: #666666;
    font-weight: 700;
}

.pokemon-reference-field dd,
.pokemon-reference-data dd {
    min-width: 0;
    margin: 0;
}

.pokemon-reference-section {
    margin-top: 14px;
}

.pokemon-reference-data-list {
    margin: 0;
    padding-left: 20px;
}

.reference-catalog {
    width: min(100%, 980px);
    margin: 0 auto;
}

.reference-catalog-search-label {
    display: block;
    margin-bottom: 6px;

    color: #444444;
    font-size: 13px;
    font-weight: 700;
}

.reference-catalog-search {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;

    font: inherit;

    background: #ffffff;
    border: 1px solid #cfcfcf;
    border-radius: 7px;
}

.reference-catalog-search:focus {
    border-color: #3b4cca;
    outline: 3px solid rgb(59 76 202 / 20%);
}

.reference-catalog-move .reference-catalog-main-search {
    position: sticky;
    z-index: 1;
    top: 0;

    grid-area: search;
    min-width: 0;
    padding-bottom: 10px;

    background: #ffffff;
}

.reference-catalog-move .reference-catalog-sidebar {
    position: sticky;
    top: 0;

    grid-area: sidebar;
    align-self: start;
    min-width: 0;
    max-height: calc(100vh - 16px);
    overflow-y: auto;

    scrollbar-gutter: stable;
}

.reference-catalog-move .reference-catalog-sidebar-details > summary {
    display: none;
}

.reference-catalog-move .reference-catalog-sidebar-content {
    padding: 12px;

    background: #f8f8fb;
    border: 1px solid #d8dbea;
    border-radius: 9px;
}

.reference-catalog-move .reference-catalog-sidebar-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;

    margin-bottom: 10px;
}

.reference-catalog-move .reference-catalog-sidebar-header h2 {
    margin: 0;

    font-size: 18px;
}

.reference-catalog-move .reference-catalog-filter-reset {
    min-height: 34px;
    padding: 6px 10px;

    font: inherit;
    font-size: 12px;
    font-weight: 700;

    background: #ffffff;
    border: 1px solid #bfc3d9;
    border-radius: 7px;

    cursor: pointer;
}

.reference-catalog-move .reference-catalog-filter-reset:disabled {
    color: #888888;
    background: #f3f3f3;
    border-color: #dddddd;

    cursor: not-allowed;
}

.reference-catalog-move .reference-catalog-filter-reset:focus-visible,
.reference-catalog-move .reference-catalog-filter-chip:focus-visible,
.reference-catalog-move .reference-catalog-filter-option input:focus-visible,
.reference-catalog-move .reference-catalog-sidebar-details > summary:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

.reference-catalog-move .reference-catalog-filter-grid {
    display: grid;
    gap: 9px;
}

.reference-catalog-move .reference-catalog-filter-group {
    min-width: 0;
    margin: 0;
    padding: 0;

    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 7px;
}

.reference-catalog-move details.reference-catalog-filter-group > summary {
    padding: 9px 11px;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.reference-catalog-move .reference-catalog-filter-group fieldset {
    min-width: 0;
    margin: 0;
    padding: 0 10px 10px;

    border: 0;
}

.reference-catalog-move .reference-catalog-filter-legend {
    position: absolute;

    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;

    clip: rect(0 0 0 0);
    white-space: nowrap;

    border: 0;
}

.reference-catalog-move .reference-catalog-filter-options {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 5px 9px;
}

.reference-catalog-move .reference-catalog-filter-option {
    display: flex;
    gap: 7px;
    align-items: flex-start;

    min-width: 0;
    padding: 4px 2px;

    font-size: 13px;

    cursor: pointer;
}

.reference-catalog-move .reference-catalog-filter-option input {
    flex: 0 0 auto;
    margin: 2px 0 0;
}

.reference-catalog-move .reference-catalog-filter-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.reference-catalog-move .reference-catalog-filter-group-single,
.reference-catalog-move .reference-catalog-filter-group-boolean {
    padding: 9px 11px;
}

.reference-catalog-move .reference-catalog-filter-group-single legend,
.reference-catalog-move .reference-catalog-filter-group-boolean legend {
    margin-bottom: 5px;

    font-size: 13px;
    font-weight: 700;
}

.reference-catalog-move .reference-catalog-filter-group-single
    .reference-catalog-filter-options {
    grid-template-columns: 1fr;
}

.reference-catalog-move .reference-catalog-filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    grid-area: chips;
    min-width: 0;
    margin: 0 0 8px;
}

.reference-catalog-move .reference-catalog-filter-summary[hidden] {
    display: none;
}

.reference-catalog-move .reference-catalog-filter-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;

    min-height: 30px;
    padding: 4px 9px;

    font: inherit;
    font-size: 12px;
    color: #26358e;

    background: #eef0ff;
    border: 1px solid #c7ccef;
    border-radius: 999px;

    cursor: pointer;
}

.reference-catalog-move .reference-catalog-filter-chip:hover {
    background: #dfe3ff;
}

.reference-catalog-move .reference-catalog-filter-chip span {
    font-size: 16px;
    line-height: 1;
}

.reference-catalog-move .reference-catalog-filter-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.reference-catalog-move
    .reference-catalog-filter-grid
    > :not(.reference-catalog-filter-group--move-role) {
    grid-column: 1 / -1;
}

.reference-catalog-move
    .reference-catalog-filter-group--move-role {
    min-width: 0;
}

.reference-catalog-move
    .reference-catalog-filter-group-text {
    display: grid;
    gap: 7px;
    padding: 9px 11px 11px;
}

.reference-catalog-move
    .reference-catalog-filter-text-label {
    font-size: 13px;
    font-weight: 700;
}

.reference-catalog-move
    .reference-catalog-filter-text-input {
    width: 100%;
    min-width: 0;
}

.reference-catalog-count {
    margin: 8px 0 0;

    color: #666666;
    font-size: 13px;
}

.reference-catalog-results {
    min-width: 0;
}

.reference-catalog-list {
    display: grid;
    gap: 9px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.reference-catalog-item {
    min-width: 0;
    overflow: hidden;

    background: #ffffff;
    border: 1px solid #d8d8d8;
    border-radius: 9px;
}

.reference-catalog-trigger {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 44px;
    padding: 10px 13px;

    font: inherit;
    color: inherit;
    text-align: left;

    background: #ffffff;
    border: 0;

    cursor: pointer;
}

.reference-catalog-trigger:hover {
    background: #f4f5fb;
}

.reference-catalog-trigger:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: -3px;
}

.reference-catalog-record-name {
    min-width: 0;

    font-weight: 700;
    overflow-wrap: anywhere;
}

.reference-catalog-record-detail {
    min-width: 0;
}

.reference-catalog-empty {
    padding: 28px 16px;

    color: #666666;
    text-align: center;

    background: #f8f8f8;
    border: 1px solid #dddddd;
    border-radius: 8px;
}

.reference-catalog-record-not-found {
    padding: 14px;

    color: #7a2020;
    background: #fff4f4;
}

.reference-catalog-record-not-found p {
    margin-bottom: 0;
}

.reference-catalog-relations {
    padding: 16px 14px;

    background: #ffffff;
    border-top: 1px solid #d8d8d8;
}

.reference-catalog-relations h4 {
    margin: 0 0 12px;
}

.reference-catalog-relations-status {
    margin: 0;
    color: #666666;
}

.reference-catalog-relations-error {
    padding: 12px;

    color: #7a2020;
    background: #fff4f4;
    border: 1px solid #edcaca;
    border-radius: 7px;
}

.reference-catalog-relations-error p {
    margin: 7px 0 12px;
}

.reference-catalog-relations-retry {
    padding: 7px 12px;

    font: inherit;
    font-weight: 700;
    color: inherit;

    background: #ffffff;
    border: 1px solid currentColor;
    border-radius: 6px;

    cursor: pointer;
}

.reference-catalog-relations-retry:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

.reference-catalog-pokemon-list {
    display: grid;
    gap: 8px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.reference-catalog-pokemon-item {
    display: grid;
    grid-template-columns:
        52px
        minmax(120px, 0.7fr)
        minmax(160px, 1.3fr);
    align-items: center;
    gap: 10px;

    min-width: 0;
    padding: 8px 10px;

    background: #f8f8f8;
    border: 1px solid #e3e3e3;
    border-radius: 7px;
}

.reference-catalog-pokemon-sprite {
    width: 52px;
    height: 52px;

    object-fit: contain;
}

.reference-catalog-pokemon-link {
    display: grid;
    grid-column: 1 / 3;
    grid-template-columns:
        52px
        minmax(0, 1fr);
    align-items: center;
    gap: 10px;

    min-width: 0;

    color: inherit;
    text-decoration: none;
    border-radius: 5px;
}

.reference-catalog-pokemon-link:hover
    .reference-catalog-pokemon-name {
    text-decoration: underline;
}

.reference-catalog-pokemon-link:focus-visible {
    outline: 2px solid #1f5f8f;
    outline-offset: 3px;
}

.reference-catalog-pokemon-identity,
.reference-catalog-pokemon-relation {
    min-width: 0;
}

.reference-catalog-pokemon-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reference-catalog-pokemon-number {
    color: #666666;
    font-size: 12px;
}

.reference-catalog-pokemon-name {
    overflow-wrap: anywhere;
}

.reference-catalog-pokemon-relation {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.reference-catalog-pokemon-relation-label {
    color: #666666;
    font-size: 12px;
    font-weight: 700;
}

.reference-catalog-pokemon-relation-value {
    padding: 3px 7px;

    font-size: 12px;

    background: #eeeeee;
    border-radius: 999px;
}

@media (min-width: 761px) and (max-width: 900px) {
    .reference-catalog-move .reference-catalog-filter-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .reference-catalog-move .reference-catalog-sidebar {
        position: static;

        max-height: none;
        margin-bottom: 8px;
        overflow: visible;

        scrollbar-gutter: auto;
    }

    .reference-catalog-move
        .reference-catalog-sidebar-details
        > summary {
        display: block;
        padding: 10px 12px;

        font-size: 14px;
        font-weight: 700;

        background: #f8f8fb;
        border: 1px solid #d8dbea;
        border-radius: 9px;

        cursor: pointer;
    }

    .reference-catalog-move
        .reference-catalog-sidebar-details[open]
        > summary {
        border-radius: 9px 9px 0 0;
    }

    .reference-catalog-move .reference-catalog-sidebar-content {
        border-top: 0;
        border-radius: 0 0 9px 9px;
    }

    .reference-catalog-move .reference-catalog-filter-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .reference-catalog-move .reference-catalog-filter-options {
        grid-template-columns:
            repeat(
                auto-fit,
                minmax(105px, 1fr)
            );
    }

    .reference-catalog-move
        .reference-catalog-filter-group-single
        .reference-catalog-filter-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .reference-catalog {
        width: 100%;
    }

    .reference-catalog-pokemon-item {
        grid-template-columns:
            46px
            minmax(0, 1fr);
    }

    .reference-catalog-pokemon-sprite {
        width: 46px;
        height: 46px;
    }

    .reference-catalog-pokemon-link {
        grid-column: 1 / -1;
        grid-template-columns:
            46px
            minmax(0, 1fr);
    }

    .reference-catalog-pokemon-relation {
        grid-column: 1 / -1;
    }

    .pokemon-reference-trigger {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .pokemon-reference-name {
        text-align: left;
        overflow-wrap: anywhere;
    }

    .pokemon-reference-field,
    .pokemon-reference-data > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
    }
}

.team-page {
    width: min(100%, 980px);
    margin: 0 auto;
}

.pokemon-card-rank-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.pokemon-card-rank-icon {
    width: 1.125rem;
    height: 1.125rem;
}

.pokemon-detail-rank {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pokemon-detail-rank__label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.team-page-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.team-page-header p {
    margin-bottom: 0;
}

.team-transfer {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.team-transfer-group {
    display: grid;
    gap: 5px;
}

.team-transfer-group--pokemon {
    padding-top: 9px;
    border-top: 1px solid #e0e0e0;
}

.team-transfer-label {
    color: #555d6b;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.team-transfer-actions {
    display: flex;
    gap: 8px;
}

.team-transfer-actions button {
    min-height: 38px;
    padding: 8px 12px;

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;

    cursor: pointer;
}

.team-transfer-actions button:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

.team-transfer small {
    max-width: 260px;
    color: #666666;
    text-align: right;
}

.team-page-status {
    padding: 10px 12px;

    background: #f4f5fb;
    border: 1px solid #d8dbea;
    border-radius: 7px;
}

.team-page-status-error {
    color: #7a2020;
    background: #fff4f4;
    border-color: #edcaca;
}

.team-section {
    margin-top: 24px;
    padding: 18px;

    border: 1px solid #dddddd;
    border-radius: 9px;
}

.team-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;

    margin-bottom: 14px;
}

.team-section-heading h2 {
    margin: 0;
}

.team-empty,
.team-picker-help,
.team-picker-selection {
    margin: 0;
    color: #666666;
}

.team-active-list,
.team-roster-list {
    display: grid;
    gap: 10px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.team-active-member,
.team-roster-member {
    padding: 12px;

    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.team-active-member {
    display: grid;
    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;
    gap: 12px;
    align-items: center;
}

.team-member-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    font-weight: 700;

    background: #eeeeee;
    border-radius: 50%;
}

.team-member-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.team-member-identity span {
    color: #666666;
    font-size: 13px;
}

.team-pokemon-picker {
    display: grid;
    gap: 8px;
}

.team-pokemon-picker .team-section-heading {
    margin-bottom: 4px;
}

.team-pokemon-picker label {
    font-size: 13px;
    font-weight: 700;
}

.team-pokemon-picker input,
.team-pokemon-picker select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;

    font: inherit;

    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;
}

.team-pokemon-picker
    select[size] {
    min-height: 210px;
}

.team-pokemon-picker input:focus,
.team-pokemon-picker select:focus {
    outline: 2px solid rgb(59 76 202 / 22%);
    border-color: #3b4cca;
}

.team-picker-count {
    margin: 0;

    color: #666666;
    font-size: 12px;
}

.team-pokemon-picker
    #team-variant-control {
    display: grid;
    gap: 8px;

    margin-top: 6px;
}

.team-add-member {
    justify-self: start;
    margin-top: 6px;
}

.team-roster-member {
    display: grid;
    gap: 12px;
}

.team-member-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.team-member-state {
    font-size: 12px;
    font-weight: 700;
}

.team-active-member button,
.team-add-member,
.team-member-actions button {
    min-height: 38px;
    padding: 8px 12px;

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;

    cursor: pointer;
}

.team-active-member button:disabled,
.team-add-member:disabled,
.team-member-actions button:disabled {
    color: #888888;
    background: #eeeeee;

    cursor: not-allowed;
}

.team-active-member button:focus-visible,
.team-add-member:focus-visible,
.team-member-actions button:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

@media (max-width: 620px) {
    .team-section {
        padding: 14px;
    }

    .team-active-member {
        grid-template-columns:
            auto
            minmax(0, 1fr);
    }

    .team-active-member button {
        grid-column: 1 / -1;
    }

    .team-member-actions {
        align-items: stretch;
        flex-direction: column;
    }

}

.team-member-editor {
    display: grid;
    gap: 18px;

    margin-top: 24px;
}

.team-editor-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.team-editor-transformations {
    display: grid;
    gap: 12px;

    padding: 14px 18px;

    background: #f8f8f8;
    border: 1px solid #dddddd;
    border-radius: 9px;
}

.team-editor-profile-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.team-editor-profile-heading h3,
.team-editor-profile-heading p {
    margin: 0;
}

.team-editor-profile-heading p {
    color: #666666;
    font-size: 13px;
}

.team-editor-profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.team-editor-profile-tabs button {
    min-height: 38px;
    padding: 8px 14px;

    color: #333333;
    font: inherit;
    font-size: 13px;
    font-weight: 700;

    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;

    cursor: pointer;
}

.team-editor-profile-tabs
    .team-editor-profile-tab-active {
    color: #ffffff;
    background: #3b4cca;
    border-color: #3b4cca;
}

.team-editor-profile-tabs button:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

.team-editor-profile-fields {
    display: grid;
    gap: 18px;
}

.team-editor-transformation-warning {
    margin: 0;
    padding: 10px 12px;

    color: #7a2020;
    background: #fff4f4;
    border: 1px solid #edcaca;
    border-radius: 7px;
}

.team-editor-section {
    padding: 18px;

    border: 1px solid #dddddd;
    border-radius: 9px;
}

.team-editor-section h3 {
    margin-top: 0;
}

.team-editor-grid,
.team-editor-resource-grid {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(180px, 1fr)
        );
    gap: 14px;
}

.team-editor-field {
    display: grid;
    gap: 6px;
    align-content: start;
}

.team-editor-field > span,
.team-editor-resource > span {
    font-size: 13px;
    font-weight: 700;
}

.team-editor-field input,
.team-editor-field select,
.team-editor-field textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;

    font: inherit;

    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;
}

.team-editor-field textarea {
    min-height: 130px;
    resize: vertical;
}

.team-editor-field input:focus,
.team-editor-field select:focus,
.team-editor-field textarea:focus {
    outline: 2px solid rgb(59 76 202 / 22%);
    border-color: #3b4cca;
}

.team-editor-field small {
    color: #666666;
}

.team-editor-resource {
    display: grid;
    gap: 6px;
    align-content: start;

    min-height: 72px;
    padding: 10px 12px;

    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
}

.team-editor-resource output {
    font-size: 20px;
    font-weight: 700;
}

.team-editor-errors {
    padding: 14px;

    color: #7a2020;
    background: #fff4f4;
    border: 1px solid #edcaca;
    border-radius: 7px;
}

.team-editor-errors ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.team-editor-actions {
    justify-content: flex-end;
}

.team-editor-actions button {
    min-height: 38px;
    padding: 8px 12px;

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;

    cursor: pointer;
}

.team-editor-actions button:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

.team-editor-actions-bottom {
    padding-top: 4px;
}

.team-editor-moves-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.team-editor-moves-heading h3 {
    margin-bottom: 0;
}

.team-editor-move-count-error,
.team-editor-move-limit-status,
.team-editor-move-feedback-error,
.team-editor-move-catalog-error {
    color: #7a2020;
}

.team-editor-move-limit-status,
.team-editor-move-feedback,
.team-editor-move-catalog-error {
    padding: 10px 12px;

    background: #f8f8f8;
    border: 1px solid #dddddd;
    border-radius: 7px;
}

.team-editor-move-limit-status,
.team-editor-move-feedback-error,
.team-editor-move-catalog-error {
    background: #fff4f4;
    border-color: #edcaca;
}

.team-editor-assigned-moves,
.team-editor-move-catalog {
    margin-top: 18px;
}

.team-editor-assigned-moves h4,
.team-editor-move-catalog h4 {
    margin: 0 0 10px;
}

.team-editor-move-list,
.team-editor-move-search-list {
    display: grid;
    gap: 8px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.team-editor-move-search-list {
    max-height: 420px;
    overflow-y: auto;
}

.team-editor-move-item,
.team-editor-move-search-item {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    gap: 12px;
    align-items: center;

    padding: 10px 12px;

    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
}

.team-editor-move-identity {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.team-editor-move-identity small,
.team-editor-move-result-count,
.team-editor-moves-empty,
.team-editor-move-catalog-status {
    color: #666666;
}

.team-editor-move-result-count {
    margin: 10px 0;
    font-size: 12px;
}

.team-editor-moves-empty,
.team-editor-move-catalog-status {
    margin: 0;
}

.team-editor-move-item button,
.team-editor-move-search-item button,
.team-editor-move-catalog-error button {
    min-height: 36px;
    padding: 7px 11px;

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;

    cursor: pointer;
}

.team-editor-move-search-item button:disabled {
    color: #888888;
    background: #eeeeee;

    cursor: not-allowed;
}

.team-editor-move-item button:focus-visible,
.team-editor-move-search-item button:focus-visible,
.team-editor-move-catalog-error button:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

.team-editor-move-results {
    margin-top: 10px;
}

.team-editor-reference-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.team-editor-reference-heading h3 {
    margin-bottom: 0;
}

.team-editor-reference-required,
.team-editor-reference-optional {
    font-size: 12px;
    font-weight: 700;
}

.team-editor-reference-required,
.team-editor-reference-feedback-error,
.team-editor-reference-catalog-error {
    color: #7a2020;
}

.team-editor-reference-optional,
.team-editor-reference-empty,
.team-editor-reference-unavailable,
.team-editor-reference-result-count,
.team-editor-reference-catalog-status {
    color: #666666;
}

.team-editor-reference-feedback,
.team-editor-reference-catalog-error {
    padding: 10px 12px;

    background: #f8f8f8;
    border: 1px solid #dddddd;
    border-radius: 7px;
}

.team-editor-reference-feedback-error,
.team-editor-reference-catalog-error {
    background: #fff4f4;
    border-color: #edcaca;
}

.team-editor-reference-selected,
.team-editor-reference-catalog {
    margin-top: 18px;
}

.team-editor-reference-selected h4,
.team-editor-reference-catalog h4 {
    margin: 0 0 10px;
}

.team-editor-reference-selection,
.team-editor-reference-search-item {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    gap: 12px;
    align-items: start;
}

.team-editor-reference-selection {
    padding: 10px 12px;

    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
}

.team-editor-reference-record {
    min-width: 0;
}

.team-editor-reference-record
    .pokemon-reference-detail {
    margin: 0;
}

.team-editor-reference-record
    .pokemon-reference-detail h4 {
    margin-top: 0;
}

.team-editor-reference-search-list {
    display: grid;
    gap: 8px;

    max-height: 420px;
    margin: 0;
    padding: 0;
    overflow-y: auto;

    list-style: none;
}

.team-editor-reference-search-item {
    align-items: center;
    padding: 10px 12px;

    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
}

.team-editor-reference-result-count {
    margin: 10px 0;
    font-size: 12px;
}

.team-editor-reference-empty,
.team-editor-reference-catalog-status {
    margin: 0;
}

.team-editor-reference-selection button,
.team-editor-reference-search-item button,
.team-editor-reference-catalog-error button {
    min-height: 36px;
    padding: 7px 11px;

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;

    cursor: pointer;
}

.team-editor-reference-search-item button:disabled {
    color: #888888;
    background: #eeeeee;

    cursor: not-allowed;
}

.team-editor-reference-selection button:focus-visible,
.team-editor-reference-search-item button:focus-visible,
.team-editor-reference-catalog-error button:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

.team-editor-reference-results {
    margin-top: 10px;
}

@media (max-width: 620px) {
    .team-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .team-transfer {
        justify-items: stretch;
    }

    .team-transfer-actions {
        flex-direction: column;
    }

    .team-transfer-actions button {
        width: 100%;
    }

    .team-transfer small {
        max-width: none;
        text-align: left;
    }

    .team-editor-profile-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .team-editor-profile-tabs button {
        flex: 1 1 140px;
    }

    .team-editor-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .team-editor-section {
        padding: 14px;
    }

    .team-editor-grid,
    .team-editor-resource-grid {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .team-editor-move-item,
    .team-editor-move-search-item,
    .team-editor-reference-selection,
    .team-editor-reference-search-item {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .team-editor-move-item button,
    .team-editor-move-search-item button,
    .team-editor-reference-selection button,
    .team-editor-reference-search-item button {
        width: 100%;
    }

    .team-editor-moves-heading,
    .team-editor-reference-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-editor-move-search-list,
    .team-editor-reference-search-list {
        max-height: none;
        overflow: visible;
    }

    .team-editor-actions button,
    .team-editor-move-item button,
    .team-editor-move-search-item button,
    .team-editor-reference-selection button,
    .team-editor-reference-search-item button,
    .team-member-actions button,
    .team-transfer-actions button {
        min-height: 44px;
    }
}

@media (max-width: 420px) {
    .reference-catalog-move
        .reference-catalog-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .reference-catalog-move
        .reference-catalog-filter-group--move-role {
        grid-column: 1;
    }
}

/* Team Member Editor (UI-8) */
.team-member-workspace .team-member-editor {
    gap: 22px;
    margin: 0;
}

/* TEAM-UI-1: scoped member character sheet */
.team-member-sheet__toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.65rem;
    margin: 0.75rem 0 1rem;
}

.team-member-sheet__wiki-action,
.team-member-sheet__edit-action {
    min-height: 2.25rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--border-color, #c8cdd5);
    border-radius: 999px;
    background: var(--surface-color, #fff);
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.team-member-sheet__edit-action {
    border-color: #245fa7;
    background: #245fa7;
    color: #fff;
}

.team-member-sheet {
    display: grid;
    grid-template-columns:
        minmax(15rem, 1.2fr)
        minmax(12rem, 0.85fr)
        minmax(13rem, 0.9fr);
    grid-template-areas:
        "profile stats skills"
        "profile trainer trainer"
        "moves moves moves"
        "notes notes notes";
    gap: 1rem;
    align-items: stretch;
}

.team-member-sheet__panel,
.team-member-editor--edit .team-editor-section {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #cfd6df;
    border-radius: 0.85rem;
    background: linear-gradient(145deg, #fff, #f6f8fb);
    box-shadow: 0 0.2rem 0.65rem rgb(24 39 58 / 8%);
}

.team-member-sheet__panel > h3,
.team-member-editor--edit .team-editor-section > h3 {
    margin: 0 0 0.85rem;
    color: #193f70;
    font-size: 1rem;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.team-member-sheet__profile {
    grid-area: profile;
}

.team-member-sheet__stats {
    grid-area: stats;
}

.team-member-sheet__skills {
    grid-area: skills;
}

.team-member-sheet__trainer {
    grid-area: trainer;
}

.team-member-sheet__moves {
    grid-area: moves;
}

.team-member-sheet__notes {
    grid-area: notes;
}

.team-member-sheet__facts {
    display: grid;
    gap: 0.55rem;
    margin: 0;
}

.team-member-sheet__facts > div {
    display: grid;
    grid-template-columns: minmax(6rem, 0.8fr) minmax(0, 1.2fr);
    gap: 0.6rem;
    align-items: center;
    padding-block: 0.45rem;
    border-bottom: 1px solid #e3e7ed;
}

.team-member-sheet__facts dt {
    color: #5b6470;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.team-member-sheet__facts dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.team-member-sheet__facts dd .team-member-sheet__wiki-action {
    display: block;
    width: max-content;
    max-width: 100%;
    margin-top: 0.35rem;
    font-size: 0.75rem;
}

.team-member-sheet__unavailable {
    display: inline-block;
    margin-left: 0.25rem;
    color: #8b2635;
    font-size: 0.75rem;
}

.team-member-resource {
    margin-bottom: 0.8rem;
}

.team-member-resource > div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
}

.team-member-resource__track {
    display: block;
    height: 0.7rem;
    overflow: hidden;
    border-radius: 999px;
    background: #d9dee5;
}

.team-member-resource__track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #2878c8;
}

.team-member-resource:nth-of-type(2) .team-member-resource__track > span {
    background: #7856bd;
}

.team-member-sheet__ratings,
.team-member-sheet__rating-grid {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.team-member-sheet__stats,
.team-member-sheet__skills {
    padding: 0.8rem;
}

.team-member-sheet__stats > h3,
.team-member-sheet__skills > h3 {
    margin-bottom: 0.65rem;
}

.team-member-sheet__stats .team-member-sheet__rating-grid,
.team-member-sheet__skills .team-member-sheet__rating-grid {
    gap: 0.3rem;
    margin-top: 0.6rem;
}

.team-member-sheet__stats > h3:not(:first-child) {
    margin-top: 0.85rem;
}

.team-member-sheet__trainer-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.85fr)
        minmax(0, 0.9fr);
    gap: 1rem;
}

.team-member-sheet__trainer {
    padding: 0.7rem 0.8rem;
}

.team-member-sheet__trainer > h3 {
    margin-bottom: 0.5rem;
}

.team-member-sheet__trainer-ratings {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.team-member-sheet__trainer-points {
    min-width: 0;
    padding-left: 1rem;
    border-left: 1px solid #dfe4ea;
}

.team-member-sheet__trainer .team-member-sheet__facts > div {
    padding-block: 0.25rem;
}

.team-rating {
    display: grid;
    grid-template-columns: minmax(5.75rem, 1fr) auto 1.5rem;
    gap: 0.45rem;
    align-items: center;
    min-width: 0;
}

.team-rating__label {
    overflow-wrap: anywhere;
    font-size: 0.8rem;
    font-weight: 700;
}

.team-rating__pips,
.team-rating-control__pips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.22rem;
    align-items: center;
}

.team-rating__pip,
.team-rating-control__pip {
    width: 0.7rem;
    height: 0.7rem;
    flex: 0 0 0.7rem;
    padding: 0;
    border: 1px solid #758090;
    border-radius: 50%;
    background: #e3e7ec;
}

.team-rating__pip--filled,
.team-rating-control__pip--filled {
    border-color: #226eb8;
    background: #3187d7;
}

.team-rating__value,
.team-rating-control__value {
    font-weight: 800;
    text-align: right;
}

.team-rating-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
    min-width: 0;
    margin: 0;
    padding: 0.65rem;
    border: 1px solid #d7dce4;
    border-radius: 0.65rem;
}

.team-rating-control legend {
    width: 100%;
    padding: 0;
    font-size: 0.82rem;
    font-weight: 800;
}

.team-rating-control__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    min-width: 0;
}

.team-rating-control__pip {
    width: 1rem;
    height: 1rem;
    flex-basis: 1rem;
    cursor: pointer;
}

.team-rating-control__pip--zero {
    display: grid;
    width: 1.25rem;
    height: 1.25rem;
    flex-basis: 1.25rem;
    place-items: center;
    border-radius: 0.3rem;
    font-size: 0.65rem;
}

.team-rating-control__pip:focus-visible,
.team-member-sheet__wiki-action:focus-visible,
.team-member-sheet__edit-action:focus-visible,
.team-move-card__toggle:focus-visible,
.team-move-card__remove:focus-visible,
.team-move-card__add-trigger:focus-visible {
    outline: 3px solid #f0a626;
    outline-offset: 2px;
}

.team-member-editor--edit .team-editor-profile-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.team-member-editor--edit .team-editor-moves,
.team-member-editor--edit .team-editor-attributes,
.team-member-editor--edit .team-editor-skills,
.team-member-editor--edit .team-editor-socials,
.team-member-editor--edit .team-editor-trainer-related,
.team-member-editor--edit .team-editor-section-profile-options,
.team-member-editor--edit .team-editor-section:last-child {
    grid-column: 1 / -1;
}

.team-editor-move-list {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(min(100%, 14rem), 1fr)
        );
    gap: 0.75rem;
    padding: 0;
    list-style: none;
}

.team-move-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #cbd2dc;
    border-radius: 0.8rem;
    background: #fff;
}

.team-move-card__toggle {
    width: 100%;
    padding: 0.75rem 2.65rem 0.75rem 0.75rem;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.team-member-editor
    .team-move-card__toggle
    .move-catalog-row {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
}

.team-member-editor
    .team-move-card__toggle
    .move-catalog-row__header {
    display: block;
    min-width: 0;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #e3e7ed;
}

.team-member-editor
    .team-move-card__toggle
    .move-catalog-row__name {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.95rem;
    font-weight: 850;
    line-height: 1.2;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.team-member-editor
    .team-move-card__toggle
    .move-catalog-row__selected {
    display: none;
}

.team-member-editor
    .team-move-card__toggle
    .move-catalog-row__badges,
.team-member-editor
    .team-move-card__toggle
    .move-catalog-row__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    min-width: 0;
}

.team-member-editor
    .team-move-card__toggle
    .move-category-indicator {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    color: #30364a;
    font-size: 0.78rem;
    font-weight: 700;
}

.team-member-editor
    .team-move-card__toggle
    .move-catalog-row__target {
    width: 1.4rem;
    height: 1.4rem;
}

.team-member-editor
    .team-move-card__toggle
    .move-catalog-row__metrics {
    color: #4f5868;
    font-size: 0.78rem;
    line-height: 1.35;
}

.team-member-editor
    .team-move-card__toggle
    .move-catalog-row__metric {
    min-width: 0;
    overflow-wrap: anywhere;
}

.team-member-editor
    .team-move-card__toggle
    .move-catalog-row__metric
    + .move-catalog-row__metric::before {
    content: "·";
    margin-right: 0.4rem;
    color: #7a8290;
}

.team-move-card__icons {
    padding: 0 0.75rem 0.7rem;
}

.team-member-editor
    .team-move-card__icons:not(:has(.move-icon-composition)) {
    display: none;
}

.team-member-editor
    .team-move-card__icons:has(.move-icon-composition) {
    padding-top: 0.55rem;
    border-top: 1px solid #e3e7ed;
}

.team-member-editor .team-move-card__icons .move-icon-composition > h5 {
    display: none;
}

.team-member-editor .team-move-card__icons .move-icon-composition {
    margin: 0;
}

.team-member-editor
    .team-move-card__icons
    .move-icon-composition__list {
    gap: 0.3rem;
}

.team-member-editor
    .team-move-card__icons
    .move-icon-composition__list
    > :is(
        .move-icon-composition__item,
        .move-icon-composition__semantic
    ) {
    margin: -0.2rem;
    transform: scale(0.86);
    transform-origin: center;
}

.team-move-card__icons:empty {
    display: none;
}

.team-move-card__remove {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 2;
    display: grid;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    place-items: center;
    border: 1px solid #a32e3e;
    border-radius: 50%;
    background: #fff;
    color: #8b2635;
    font-size: 1.2rem;
    cursor: pointer;
}

.team-move-card__legacy-summary--hidden {
    display: none;
}

.team-move-card__detail {
    padding: 0.85rem;
    border-top: 1px solid #dfe4ea;
    background: #f7f9fc;
}

.team-editor-move-list--editable > .team-move-card {
    display: block;
    min-height: 7rem;
    padding: 0;
}

.team-editor-move-list--editable > .team-move-card--expanded {
    grid-column: 1 / -1;
}

.team-move-card__detail .move-icon-composition {
    display: none;
}

.team-move-card--add {
    border: 2px dashed #8c98a8;
    color: #245fa7;
}

.team-move-card__add-trigger {
    display: grid;
    width: 100%;
    min-height: 7rem;
    padding: 0.75rem;
    place-items: center;
    align-content: center;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.team-move-card__add-trigger > span {
    font-size: 2rem;
    line-height: 1;
}

.team-move-card__search {
    padding: 0.75rem !important;
}

.team-move-card__search .team-editor-field input {
    min-width: 0;
}

.team-move-card__search .team-editor-move-search-list {
    gap: 0.45rem;
}

.team-move-card__search .team-editor-move-search-item {
    display: block;
    padding: 0;
    overflow: hidden;
}

.team-editor-move-search-select {
    display: grid;
    width: 100%;
    gap: 0.4rem;
    padding: 0.55rem !important;
    text-align: left;
}

.team-editor-move-search-action {
    color: #245fa7;
    font-size: 0.75rem;
    font-weight: 800;
}

@media (max-width: 78rem) {
    .team-member-sheet {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "profile stats"
            "profile skills"
            "trainer trainer"
            "moves moves"
            "notes notes";
    }
}

@media (max-width: 48rem) {
    .team-member-sheet,
    .team-member-editor--edit .team-editor-profile-fields,
    .team-editor-move-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .team-member-sheet {
        grid-template-areas:
            "profile"
            "stats"
            "skills"
            "trainer"
            "moves"
            "notes";
    }

    .team-member-sheet__trainer-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .team-member-sheet__trainer-points {
        padding-top: 0.8rem;
        padding-left: 0;
        border-top: 1px solid #dfe4ea;
        border-left: 0;
    }

    .team-member-editor--edit .team-editor-moves,
    .team-member-editor--edit .team-editor-attributes,
    .team-member-editor--edit .team-editor-skills,
    .team-member-editor--edit .team-editor-socials,
    .team-member-editor--edit .team-editor-trainer-related,
    .team-member-editor--edit .team-editor-section-profile-options,
    .team-member-editor--edit .team-editor-section:last-child {
        grid-column: 1;
    }

    .team-member-sheet__toolbar {
        flex-wrap: wrap;
    }

}

.team-member-editor__header {
    display: grid;
    grid-template-columns:
        96px
        minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 20px;

    background: #f6f7fc;
    border: 1px solid #d8dbea;
    border-radius: 10px;
}

.team-member-editor__sprite {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.team-member-editor__identity {
    min-width: 0;
}

.team-member-editor__identity h2,
.team-member-editor__identity p {
    margin: 0;
}

.team-member-editor__identity h2 {
    overflow-wrap: anywhere;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
}

.team-member-editor__identity > p:not(.team-member-editor__eyebrow) {
    margin-top: 5px;
    color: #5f636f;
}

.team-member-editor__eyebrow {
    margin-bottom: 5px !important;

    color: #3b4cca;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.team-member-editor__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.team-member-editor__badges > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 4px 9px;

    color: #34394a;
    font-size: 12px;
    font-weight: 700;

    background: #ffffff;
    border: 1px solid #d8dbea;
    border-radius: 999px;
}

.team-member-workspace .team-editor-profile-fields {
    gap: 20px;
}

.team-member-workspace .team-editor-section {
    padding: 20px;

    background: #ffffff;
    border-color: #dfe1e8;
    box-shadow: 0 1px 2px rgb(20 25 45 / 5%);
}

.team-editor-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: baseline;
    margin-bottom: 16px;
}

.team-editor-section-heading h3,
.team-editor-section-heading p {
    margin: 0;
}

.team-editor-section-heading p {
    max-width: 52ch;
    color: #666a75;
    font-size: 13px;
}

.team-member-workspace .team-editor-section > h3 {
    margin-bottom: 16px;
}

.team-member-workspace .team-editor-grid {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(150px, 1fr)
        );
}

.team-editor-section-identity .team-editor-grid {
    grid-template-columns:
        minmax(220px, 2fr)
        minmax(170px, 1fr);
}

.team-editor-section-progression .team-editor-grid {
    grid-template-columns:
        repeat(2, minmax(150px, 1fr));
}

.team-editor-field {
    position: relative;
}

.team-editor-field > span {
    color: #3f4350;
}

.team-member-workspace .team-editor-field input,
.team-member-workspace .team-editor-field select,
.team-member-workspace .team-editor-field textarea {
    background: #fbfbfd;
    border-color: #cfd2dc;
}

.team-member-workspace .team-editor-field input:hover,
.team-member-workspace .team-editor-field select:hover,
.team-member-workspace .team-editor-field textarea:hover {
    border-color: #9ba1b4;
}

.team-member-workspace .team-editor-field [aria-invalid="true"] {
    border-color: #b33a3a;
    box-shadow: 0 0 0 1px rgb(179 58 58 / 12%);
}

.team-editor-field-error {
    color: #922d2d !important;
    font-weight: 700;
}

.team-editor-resource-grid {
    grid-template-columns:
        repeat(2, minmax(220px, 1fr));
}

.team-editor-resource-card {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    gap: 12px 18px;
    align-items: end;
    padding: 16px;

    background: #f8f9fc;
    border: 1px solid #dfe1e8;
    border-radius: 8px;
}

.team-editor-resource-card h4 {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 15px;
}

.team-editor-resource-maximum {
    display: grid;
    gap: 6px;
    align-self: stretch;
    min-width: 92px;
    padding: 8px 12px;

    text-align: center;

    background: #ffffff;
    border: 1px solid #d8dbea;
    border-radius: 7px;
}

.team-editor-resource-maximum span {
    color: #5f636f;
    font-size: 12px;
    font-weight: 700;
}

.team-editor-resource-maximum output {
    color: #273a91;
    font-size: 24px;
    font-weight: 800;
}

.team-editor-profile-options-grid {
    display: grid;
    gap: 16px;
}

.team-editor-nature {
    max-width: 360px;
}

.team-member-workspace .team-editor-reference {
    padding: 16px;

    background: #f8f9fc;
    border: 1px solid #dfe1e8;
    border-radius: 8px;
}

.team-member-workspace .team-editor-reference-heading h4 {
    margin: 0;
}

.team-editor-socials .team-editor-grid {
    grid-template-columns:
        repeat(auto-fit, minmax(120px, 1fr));
}

.team-editor-trainer-related__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.team-editor-trainer-related__ratings {
    display: grid;
    gap: 12px;
}

.team-editor-trainer-related__points {
    min-width: 0;
}

.team-editor-skills .team-editor-grid {
    grid-template-columns:
        repeat(auto-fit, minmax(135px, 1fr));
}

.team-member-workspace .team-editor-moves {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px 18px;
}

.team-member-workspace .team-editor-moves-heading,
.team-member-workspace .team-editor-move-limit-source,
.team-member-workspace .team-editor-move-limit-status,
.team-member-workspace .team-editor-move-feedback {
    grid-column: 1 / -1;
}

.team-editor-move-limit-source {
    margin: -8px 0 0;
    color: #666a75;
    font-size: 13px;
}

.team-member-workspace .team-editor-assigned-moves,
.team-member-workspace .team-editor-move-catalog {
    min-width: 0;
    margin: 0;
    padding: 16px;

    background: #f8f9fc;
    border: 1px solid #dfe1e8;
    border-radius: 8px;
}

.team-member-editor--edit .team-editor-move-list--editable {
    grid-column: 1 / -1;
}

.team-member-workspace .team-editor-move-item,
.team-member-workspace .team-editor-move-search-item {
    background: #ffffff;
}

.team-editor-validation-summary {
    padding: 16px 18px;
    scroll-margin-top: 16px;
}

.team-editor-validation-summary h3 {
    margin: 0;
    font-size: 16px;
}

.team-member-workspace .team-editor-actions-bottom {
    justify-content: flex-end;
    padding-top: 18px;

    border-top: 1px solid #dfe1e8;
}

.team-member-workspace .team-editor-actions button[type="submit"] {
    color: #ffffff;
    background: #3b4cca;
    border-color: #3b4cca;
}

.team-member-workspace .team-editor-actions button[type="submit"]:hover {
    background: #2f3eaa;
    border-color: #2f3eaa;
}

@media (max-width: 900px) {
    .team-member-editor__header {
        grid-template-columns:
            78px
            minmax(0, 1fr);
    }

    .team-member-editor__sprite {
        width: 78px;
        height: 78px;
    }

    .team-member-workspace .team-editor-moves {
        grid-template-columns: minmax(0, 1fr);
    }

    .team-member-workspace .team-editor-assigned-moves,
    .team-member-workspace .team-editor-move-catalog {
        grid-column: 1;
    }
}

@media (max-width: 620px) {
    .team-member-editor__header {
        grid-template-columns: minmax(0, 1fr);
        text-align: center;
    }

    .team-member-editor__sprite {
        justify-self: center;
    }

    .team-member-editor__badges {
        justify-content: center;
    }

    .team-member-workspace .team-editor-actions-bottom {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .team-editor-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .team-editor-section-identity .team-editor-grid,
    .team-editor-section-progression .team-editor-grid,
    .team-editor-trainer-related__grid,
    .team-editor-resource-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .team-editor-resource-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .team-editor-resource-card h4 {
        grid-column: 1;
    }
}

/* Team workspace (UI-7) */
.team-workspace {
    width: 100%;
    max-width: none;
    margin: 0;
}

.team-workspace__grid {
    display: grid;
    grid-template-columns:
        minmax(320px, 420px)
        minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.team-roster-panel,
.team-member-workspace {
    min-width: 0;
    padding: 20px;

    background: #ffffff;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
}

.team-roster-panel {
    display: grid;
    gap: 20px;
}

.team-roster-panel .team-page-header,
.team-roster-panel .team-section {
    margin: 0;
}

.team-roster-panel .team-section {
    padding: 0;
    border: 0;
}

.team-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;

    color: #666666;
    font-size: 13px;
}

.team-column-separator {
    width: 100%;
    margin: 0;

    border: 0;
    border-top: 1px solid #e0e0e0;
}

.team-active-slot {
    min-height: 86px;
}

.team-active-slot-empty {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;

    color: #777777;
    background: #fafafa;
    border: 1px dashed #cccccc;
    border-radius: 8px;
}

.team-member-select {
    appearance: none;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 4px;

    color: inherit;
    font: inherit;
    text-align: left;

    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.team-member-select:hover {
    background: #f0f2fb;
}

.team-member-select:focus-visible {
    outline: 3px solid rgb(59 76 202 / 30%);
    outline-offset: 2px;
}

.team-member-sprite {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.team-member-identity small {
    color: #777777;
    font-size: 12px;
}

.team-editor-rank-label,
.team-member-rank,
#team-member-editor-rank-badge .rank-presentation {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.team-editor-rank-label {
    justify-content: space-between;
}

#team-editor-rank-control-icon {
    display: inline-flex;
}

.team-member-selected {
    background: #f2f4ff;
    border-color: #3b4cca;
}

.team-active-member .team-member-actions,
.team-roster-member .team-member-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.team-active-member {
    grid-template-columns:
        auto
        minmax(0, 1fr);
}

.team-active-member .team-member-actions {
    grid-column: 2;
}

.team-active-member > .team-member-state {
    grid-column: 2;
}

.team-roster-member {
    padding: 12px;
}

.team-action-help {
    color: #777777;
}

.team-column-tools {
    padding-top: 18px;
    border-top: 1px solid #e0e0e0;
}

.team-column-tools .team-transfer {
    justify-items: start;
}

.team-column-tools .team-transfer small {
    max-width: none;
    text-align: left;
}

.team-member-workspace {
    min-height: 560px;
}

.team-member-empty-state {
    display: grid;
    justify-items: center;
    align-content: center;
    min-height: 510px;
    padding: 32px;

    color: #666666;
    text-align: center;
}

.team-member-empty-state h2 {
    margin: 14px 0 6px;
    color: #222222;
}

.team-member-empty-state p {
    margin: 0;
}

.team-member-empty-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;

    color: #3b4cca;
    font-size: 34px;
    line-height: 1;

    background: #f2f4ff;
    border: 1px solid #d8dbea;
    border-radius: 50%;
}

.team-member-workspace .team-member-editor {
    margin-top: 12px;
}

@media (max-width: 1100px) {
    .team-workspace__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .team-member-workspace {
        min-height: 420px;
    }

    .team-member-empty-state {
        min-height: 370px;
    }
}

@media (max-width: 620px) {
    .team-roster-panel,
    .team-member-workspace {
        padding: 14px;
    }

    .team-member-workspace {
        min-height: 0;
    }

    .team-member-empty-state {
        min-height: 18rem;
        padding: 20px;
    }

    .team-active-member .team-member-actions {
        grid-column: 1 / -1;
    }

    .team-member-actions button {
        flex: 1 1 100px;
    }
}

.team-member-workspace .team-member-editor {
    margin: 0;
}
.team-persistence-conflict {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-block: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--color-danger, #b42318);
    border-radius: 0.5rem;
}

.team-persistence-conflict p {
    margin: 0;
}

@media (max-width: 40rem) {
    .team-persistence-conflict {
        align-items: stretch;
        flex-direction: column;
    }
}
