.py-ref {
    --ref-bg: #17130b;
    --ref-panel: #2b2415;
    --ref-panel-deep: #211a0e;
    --ref-panel-high: #372c17;
    --ref-line: #604c22;
    --ref-gold: #f6cf3c;
    --ref-cream: #fff6cf;
    --ref-red: #ce5252;
    --ref-navy: #2c2d63;
    --ref-green: #77b769;
    width: min(1540px, 100%);
    margin: 0 auto;
    padding: 22px;
}

.py-ref [hidden] {
    display: none !important;
}

.py-ref button,
.py-ref input,
.py-ref select {
    font: inherit;
}

.py-ref button:disabled,
.py-ref input:disabled,
.py-ref select:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.py-ref button:focus-visible,
.py-ref a:focus-visible,
.py-ref input:focus-visible,
.py-ref select:focus-visible {
    outline: 3px solid var(--ref-gold);
    outline-offset: 2px;
}

.py-ref-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: center;
    gap: 28px;
    min-height: 230px;
    padding: 32px 36px;
    overflow: hidden;
    border: 2px solid #9c7827;
    border-radius: 10px;
    background:
        radial-gradient(circle at 78% 10%, rgba(246, 207, 60, .12), transparent 30%),
        linear-gradient(120deg, rgba(206, 82, 82, .09), transparent 46%),
        repeating-linear-gradient(0deg, rgba(255, 246, 207, .022) 0 2px, transparent 2px 6px),
        #271f10;
    box-shadow: inset 0 0 0 4px #17130b, inset 0 0 0 6px rgba(246, 207, 60, .18), 0 18px 38px rgba(0, 0, 0, .31);
}

.py-ref-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -115px;
    right: 270px;
    width: 270px;
    height: 270px;
    border: 35px solid rgba(44, 45, 99, .2);
    border-radius: 50%;
    box-shadow: inset 0 0 0 12px rgba(206, 82, 82, .08);
}

.py-ref-hero::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 7px;
    background: repeating-linear-gradient(90deg, var(--ref-red) 0 26px, var(--ref-gold) 26px 52px, var(--ref-navy) 52px 78px);
}

.py-ref-eyebrow,
.py-ref-kicker,
.py-ref-save-label {
    color: var(--ref-gold);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.py-ref-eyebrow {
    margin: 0 0 9px;
}

.py-ref-hero h1 {
    margin: 0;
    color: #fffdf0;
    font-size: clamp(38px, 5vw, 64px);
    font-weight: 950;
    letter-spacing: -.045em;
    line-height: .96;
    text-shadow: 4px 4px 0 rgba(23, 19, 11, .8);
}

.py-ref-hero h1 span {
    color: var(--ref-gold);
}

.py-ref-hero-copy > p:not(.py-ref-eyebrow) {
    max-width: 760px;
    margin: 15px 0 0;
    color: #dfd0a1;
    font-size: 14px;
    line-height: 1.6;
}

.py-ref-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}

.py-ref-hero-pills span {
    padding: 5px 8px;
    border: 1px solid rgba(246, 207, 60, .24);
    border-radius: 4px;
    background: rgba(23, 19, 11, .52);
    color: #bfae78;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.py-ref-hero-pills strong {
    color: #fff5ce;
}

.py-ref-save-card {
    position: relative;
    min-height: 151px;
    padding: 16px;
    border: 3px solid #17130b;
    border-radius: 6px;
    background:
        linear-gradient(rgba(44, 45, 99, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(44, 45, 99, .08) 1px, transparent 1px),
        var(--ref-gold);
    background-size: 14px 14px;
    color: #17130b;
    box-shadow: inset 0 0 0 3px #ffe678, 6px 6px 0 #9c3a08;
}

.py-ref-save-card::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(23, 19, 11, .32);
    pointer-events: none;
}

.py-ref-save-card > * {
    position: relative;
}

.py-ref-save-label {
    color: #3f3216;
}

.py-ref-save-card > div:not(.py-ref-save-track) {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 9px;
}

.py-ref-save-card > div strong {
    color: var(--ref-navy);
    font-size: 38px;
    font-weight: 950;
    line-height: 1;
}

.py-ref-save-card > div small {
    color: #5f4114;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.py-ref-save-track {
    height: 8px;
    margin-top: 9px;
    overflow: hidden;
    border: 2px solid #17130b;
    background: rgba(255, 246, 207, .6);
}

.py-ref-save-track span {
    display: block;
    width: 0;
    height: 100%;
    background: repeating-linear-gradient(90deg, var(--ref-navy) 0 12px, #55579b 12px 24px);
    transition: width .2s ease;
}

.py-ref-save-card p {
    margin: 8px 0 0;
    color: #513b13;
    font-size: 9px;
    font-weight: 750;
}

.py-ref-gen-note,
.py-ref-footer-note {
    margin-top: 12px;
    padding: 10px 13px;
    border: 1px solid rgba(246, 207, 60, .22);
    border-radius: 6px;
    background: #211a0e;
    color: #c3b17b;
    font-size: 10px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.py-ref-gen-note strong,
.py-ref-footer-note strong {
    color: var(--ref-gold);
}

.py-ref-load {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 180px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--ref-line);
    border-radius: 8px;
    background: rgba(43, 36, 21, .97);
    color: #e4d5a6;
}

.py-ref-load > span {
    width: 31px;
    height: 31px;
    border: 4px solid #5f4b21;
    border-top-color: var(--ref-gold);
    border-radius: 50%;
    animation: py-ref-spin .72s steps(8) infinite;
}

.py-ref-load.is-error {
    border-color: rgba(206, 82, 82, .75);
}

.py-ref-load.is-error > span {
    border-color: var(--ref-red);
    animation: none;
}

.py-ref-load div strong,
.py-ref-load div small {
    display: block;
}

.py-ref-load div {
    min-width: 0;
}

.py-ref-load div small {
    margin-top: 4px;
    color: #b6a36d;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.py-ref-load button {
    margin-top: 9px;
    padding: 5px 8px;
    border: 1px solid var(--ref-red);
    border-radius: 4px;
    background: #3a1d18;
    color: #fff0d0;
    cursor: pointer;
}

@keyframes py-ref-spin {
    to { transform: rotate(360deg); }
}

.py-ref-workbench {
    display: grid;
    grid-template-columns: 250px minmax(420px, 1fr) 350px;
    align-items: start;
    gap: 13px;
    margin-top: 14px;
}

.py-ref-filters,
.py-ref-catalog,
.py-ref-detail {
    min-width: 0;
    border: 1px solid var(--ref-line);
    border-radius: 8px;
    background: rgba(43, 36, 21, .97);
    box-shadow: 0 13px 28px rgba(0, 0, 0, .21);
}

.py-ref-filters,
.py-ref-detail {
    position: sticky;
    top: 78px;
    max-height: calc(100vh - 94px);
    overflow: auto;
}

.py-ref-filters {
    padding: 14px;
}

.py-ref-catalog {
    padding: 14px;
}

.py-ref-detail:empty::before {
    content: "Select a record to inspect its full data.";
    display: block;
    padding: 24px;
    color: #9c8956;
    text-align: center;
}

.py-ref-filter-heading,
.py-ref-toolbar,
.py-ref-detail-head,
.py-ref-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.py-ref-filter-heading,
.py-ref-toolbar {
    padding-bottom: 10px;
    margin-bottom: 11px;
    border-bottom: 1px solid rgba(246, 207, 60, .16);
}

.py-ref-filter-heading span,
.py-ref-toolbar > div > span {
    color: var(--ref-gold);
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .11em;
}

.py-ref-filter-heading h2,
.py-ref-toolbar h2 {
    margin: 2px 0 0;
    color: #fff6d6;
    font-size: 16px;
}

.py-ref-filter-heading button {
    padding: 3px 6px;
    border: 0;
    border-bottom: 1px solid #8f7b49;
    background: transparent;
    color: #ad9a65;
    font-size: 9px;
    cursor: pointer;
}

.py-ref-search {
    position: relative;
    display: block;
}

.py-ref-search input {
    width: 100%;
    height: 38px;
    padding: 7px 34px 7px 10px;
    border: 1px solid #604c22;
    border-radius: 6px;
    background: #17130b;
    color: #fff5d0;
    outline: none;
}

.py-ref-search input:focus {
    border-color: var(--ref-gold);
    box-shadow: 0 0 0 3px rgba(246, 207, 60, .12);
}

.py-ref-search kbd {
    position: absolute;
    top: 9px;
    right: 9px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1px solid #604c22;
    border-radius: 3px;
    background: #2b2415;
    color: #9d8955;
    font: 9px/1 inherit;
}

.py-ref-filters fieldset {
    padding: 0;
    margin: 14px 0 0;
    border: 0;
}

.py-ref-filters legend,
.py-ref-select > span {
    display: block;
    margin-bottom: 6px;
    color: #b9a66e;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.py-ref-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.py-ref-chip-list button,
.py-ref-type-grid button {
    min-height: 27px;
    padding: 4px 7px;
    border: 1px solid #59461f;
    border-radius: 4px;
    background: #211a0e;
    color: #b6a36d;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}

.py-ref-chip-list button:hover,
.py-ref-type-grid button:hover,
.py-ref-chip-list button.is-active,
.py-ref-type-grid button.is-active {
    border-color: var(--chip-color, var(--ref-gold));
    background: color-mix(in srgb, var(--chip-color, var(--ref-gold)) 20%, #211a0e);
    color: #fff7d9;
}

.py-ref-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.py-ref-type-grid button {
    min-width: 0;
    padding: 4px 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-ref-select {
    display: block;
    margin-top: 13px;
}

.py-ref-select select,
.py-ref-toolbar select {
    width: 100%;
    height: 35px;
    padding: 5px 8px;
    border: 1px solid #604c22;
    border-radius: 5px;
    background: #17130b;
    color: #eadcaf;
    outline: none;
}

.py-ref-select select:focus,
.py-ref-toolbar select:focus {
    border-color: var(--ref-gold);
}

.py-ref-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    cursor: pointer;
}

.py-ref-toggle > span {
    min-width: 0;
}

.py-ref-toggle strong,
.py-ref-toggle small {
    display: block;
}

.py-ref-toggle strong {
    color: #e5d7a9;
    font-size: 10px;
}

.py-ref-toggle small {
    margin-top: 2px;
    color: #aa9865;
    font-size: 8px;
}

.py-ref-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.py-ref-toggle i {
    position: relative;
    display: block;
    width: 31px;
    height: 18px;
    flex: 0 0 auto;
    border: 1px solid #665323;
    border-radius: 999px;
    background: #17130b;
}

.py-ref-toggle i::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9f8b54;
    transition: transform .15s ease, background .15s ease;
}

.py-ref-toggle input:checked + i {
    background: var(--ref-red);
}

.py-ref-toggle input:checked + i::after {
    transform: translateX(13px);
    background: #fff5cf;
}

.py-ref-filter-note {
    margin-top: 15px;
    padding: 9px;
    border: 1px dashed rgba(246, 207, 60, .2);
    border-radius: 6px;
    background: #211a0e;
}

.py-ref-filter-note strong {
    color: var(--ref-gold);
    font-size: 9px;
}

.py-ref-filter-note p {
    margin: 4px 0 0;
    color: #ad9b68;
    font-size: 8px;
    line-height: 1.45;
}

.py-ref-toolbar {
    min-height: 51px;
}

.py-ref-toolbar h2 small {
    margin-left: 5px;
    color: #a18e59;
    font-size: 10px;
    font-weight: 700;
}

.py-ref-toolbar > label {
    display: grid;
    grid-template-columns: auto 160px;
    align-items: center;
    gap: 7px;
    color: #9d8a56;
    font-size: 9px;
}

.py-ref-grid {
    display: grid;
    gap: 8px;
}

.py-ref-trainer-grid,
.py-ref-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.py-ref-move-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.py-ref-card {
    --card-accent: #8b7f63;
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 7px;
    background:
        linear-gradient(130deg, color-mix(in srgb, var(--card-accent) 12%, transparent), transparent 58%),
        #211a0e;
    transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.py-ref-card::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--card-accent);
}

.py-ref-card:hover,
.py-ref-card.is-selected {
    border-color: color-mix(in srgb, var(--card-accent) 62%, #6a5425);
    background:
        linear-gradient(130deg, color-mix(in srgb, var(--card-accent) 18%, transparent), transparent 60%),
        #292112;
}

.py-ref-card:hover {
    transform: translateY(-1px);
}

.py-ref-card.is-selected {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card-accent) 30%, transparent);
}

.py-ref-card-main {
    display: block;
    width: 100%;
    min-height: 100%;
    padding: 10px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.py-ref-card-save {
    position: absolute;
    z-index: 2;
    top: 7px;
    right: 7px;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 1px solid #604c22;
    border-radius: 4px;
    background: rgba(23, 19, 11, .82);
    color: #8f7c4c;
    font-size: 13px;
    cursor: pointer;
}

.py-ref-card-save.is-saved {
    border-color: var(--ref-gold);
    color: var(--ref-gold);
}

.py-ref-trainer-head {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding-right: 24px;
}

.py-ref-trainer-head > img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, .24));
}

.py-ref-card h3 {
    margin: 0;
    color: #fff6d3;
    font-size: 13px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.py-ref-card-kicker,
.py-ref-card-meta,
.py-ref-card-location {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-ref-card-kicker {
    margin-bottom: 3px;
    color: var(--card-accent);
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.py-ref-card-meta {
    margin-top: 4px;
    color: #b5a36c;
    font-size: 9px;
}

.py-ref-card-location {
    margin-top: 5px;
    overflow: visible;
    color: #ad9b66;
    font-size: 8px;
    line-height: 1.35;
    text-overflow: clip;
    white-space: normal;
}

.py-ref-mini-party {
    display: flex;
    align-items: center;
    gap: 3px;
    min-height: 35px;
    margin-top: 8px;
    padding: 4px 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .055);
    border-radius: 5px;
    background: rgba(23, 19, 11, .62);
}

.py-ref-mini-mon {
    position: relative;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

.py-ref-mini-mon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
}

.py-ref-mini-mon span {
    position: absolute;
    right: -1px;
    bottom: -1px;
    padding: 1px 2px;
    border-radius: 2px;
    background: #17130b;
    color: var(--ref-gold);
    font-size: 6px;
    font-weight: 950;
}

.py-ref-item-top,
.py-ref-move-top {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding-right: 24px;
}

.py-ref-item-glyph,
.py-ref-detail-glyph {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 2px solid var(--card-accent);
    border-radius: 50%;
    background:
        radial-gradient(circle, #17130b 0 23%, transparent 24%),
        conic-gradient(from 45deg, color-mix(in srgb, var(--card-accent) 72%, #fff6cf), var(--card-accent), color-mix(in srgb, var(--card-accent) 55%, #17130b), var(--card-accent));
    color: #fff;
    font-size: 10px;
    font-weight: 950;
    text-shadow: 1px 1px 0 #17130b;
    box-shadow: inset 0 0 0 4px #17130b, 3px 4px 0 rgba(0, 0, 0, .25);
}

.py-ref-item-stats,
.py-ref-move-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 9px;
}

.py-ref-item-stats span,
.py-ref-move-stats span {
    min-width: 0;
    padding: 5px 4px;
    border: 1px solid rgba(255, 255, 255, .055);
    border-radius: 4px;
    background: rgba(23, 19, 11, .62);
    color: #827141;
    font-size: 7px;
    text-align: center;
    text-transform: uppercase;
}

.py-ref-item-stats strong,
.py-ref-move-stats strong {
    display: block;
    margin-top: 2px;
    color: #ded0a0;
    font-size: 8px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.py-ref-move-symbol {
    display: grid;
    place-items: center;
    width: 55px;
    height: 55px;
    border: 2px solid var(--card-accent);
    border-radius: 8px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--card-accent) 70%, #fff6cf), var(--card-accent));
    color: #fff;
    font-size: 9px;
    font-weight: 950;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, .5);
    box-shadow: inset 0 0 0 4px #17130b, 3px 4px 0 rgba(0, 0, 0, .24);
}

.py-ref-move-effect {
    min-height: 31px;
    margin: 8px 0 0;
    color: #a99761;
    font-size: 8px;
    line-height: 1.4;
}

.py-ref-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 13px;
}

.py-ref-pagination button,
.py-ref-pagination span {
    min-width: 29px;
    min-height: 29px;
    padding: 4px 7px;
    border: 1px solid #5d4920;
    border-radius: 4px;
    background: #211a0e;
    color: #b19e67;
    font-size: 9px;
}

.py-ref-pagination button {
    cursor: pointer;
}

.py-ref-pagination button:hover,
.py-ref-pagination button.is-active {
    border-color: var(--ref-gold);
    background: var(--ref-gold);
    color: #17130b;
    font-weight: 950;
}

.py-ref-pagination button:disabled {
    opacity: .55;
    cursor: default;
}

.py-ref-empty {
    grid-column: 1 / -1;
    padding: 32px 18px;
    border: 1px dashed rgba(246, 207, 60, .22);
    border-radius: 7px;
    background: #211a0e;
    color: #9b8956;
    text-align: center;
}

.py-ref-detail-shell {
    --detail-accent: #8b7f63;
    min-width: 0;
}

.py-ref-detail-head {
    align-items: flex-start;
    padding: 14px;
    border-bottom: 1px solid rgba(246, 207, 60, .15);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--detail-accent) 18%, transparent), transparent 60%),
        #252011;
}

.py-ref-detail-title {
    min-width: 0;
}

.py-ref-detail-title > span {
    color: var(--detail-accent);
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.py-ref-detail-title h2 {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    color: #fff7d8;
    font-size: 21px;
    line-height: 1.08;
}

.py-ref-detail-title p {
    margin: 5px 0 0;
    color: #aa9862;
    font-size: 9px;
    line-height: 1.4;
}

.py-ref-detail-portrait {
    width: 88px;
    height: 88px;
    flex: 0 0 auto;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(4px 5px 0 rgba(0, 0, 0, .27));
}

.py-ref-detail-body {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.py-ref-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.py-ref-detail-actions button,
.py-ref-detail-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid #604c22;
    border-radius: 5px;
    background: #211a0e;
    color: #cab982;
    font-size: 9px;
    font-weight: 850;
    text-align: center;
    cursor: pointer;
}

.py-ref-detail-actions .is-primary,
.py-ref-detail-actions button.is-saved {
    border-color: var(--detail-accent);
    background: var(--detail-accent);
    color: #17130b;
}

.py-ref-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.page-trainers .py-ref-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-moves .py-ref-detail-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.py-ref-detail-stats > div {
    min-width: 0;
    padding: 7px 5px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 5px;
    background: #211a0e;
    text-align: center;
}

.py-ref-detail-stats span,
.py-ref-detail-stats strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-ref-detail-stats span {
    overflow: visible;
    color: #aa9865;
    font-size: 7px;
    line-height: 1.25;
    text-overflow: clip;
    text-transform: uppercase;
    white-space: normal;
}

.py-ref-detail-stats strong {
    margin-top: 3px;
    color: #eee0b2;
    font-size: 10px;
}

.py-ref-detail-section {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 6px;
    background: #211a0e;
}

.py-ref-section-head {
    margin-bottom: 8px;
}

.py-ref-section-head h3 {
    margin: 0;
    color: #f4e7ba;
    font-size: 11px;
}

.py-ref-section-head span {
    color: #8f7c4b;
    font-size: 8px;
}

.py-ref-detail-section > p {
    margin: 0;
    color: #b5a36d;
    font-size: 10px;
    line-height: 1.5;
}

.py-ref-party-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.py-ref-party-mon {
    --mon-color: #8b7f63;
    min-width: 0;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 5px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--mon-color) 12%, transparent), transparent),
        #17130b;
    text-align: center;
}

.py-ref-party-mon img {
    display: block;
    width: 55px;
    height: 55px;
    margin: 0 auto;
    object-fit: contain;
    image-rendering: pixelated;
}

.py-ref-party-mon strong,
.py-ref-party-mon span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-ref-party-mon strong {
    color: #eadcaf;
    font-size: 9px;
}

.py-ref-party-mon span {
    margin-top: 2px;
    color: var(--ref-gold);
    font-size: 8px;
}

.py-ref-party-mon-link {
    display: block;
    color: inherit;
}

.py-ref-trainer-moves {
    display: grid;
    gap: 3px;
    margin-top: 7px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    text-align: left;
}

.py-ref-trainer-moves > a {
    display: grid;
    grid-template-columns: 5px minmax(0, 1fr) auto;
    gap: 4px;
    align-items: center;
    min-width: 0;
    padding: 3px 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, .2);
    color: #bcae7c;
}

.py-ref-trainer-moves i {
    width: 5px;
    height: 100%;
    min-height: 16px;
    border-radius: 2px;
    background: var(--move-color, #8b7f63);
}

.py-ref-trainer-moves strong,
.py-ref-trainer-moves span {
    margin: 0;
    font-size: 7px;
    text-align: left;
}

.py-ref-trainer-moves strong {
    color: #d8c993;
}

.py-ref-trainer-moves span {
    color: #ad9c69;
}

.py-ref-trainer-moves small {
    color: #a39261;
    font-size: 7px;
    text-align: center;
}

.py-ref-source-list,
.py-ref-tag-list {
    display: grid;
    gap: 5px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.py-ref-source-list li {
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 5px;
    background: #17130b;
    transition: border-color .16s ease, opacity .16s ease;
}

.py-ref-source-list li.is-collected {
    border-color: rgba(119, 183, 105, .42);
    opacity: .72;
}

.py-ref-source-list strong,
.py-ref-source-list span,
.py-ref-source-list small {
    display: block;
}

.py-ref-source-list strong {
    color: #e9dcae;
    font-size: 9px;
}

.py-ref-source-list span {
    margin-top: 2px;
    color: var(--detail-accent);
    font-size: 8px;
}

.py-ref-source-list small {
    margin-top: 4px;
    color: #aa9862;
    font-size: 7px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.py-ref-source-list a {
    display: inline-flex;
    color: var(--ref-gold);
    font-size: 8px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.py-ref-source-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    margin-top: 6px;
}

.py-ref-source-actions button {
    min-height: 24px;
    padding: 4px 7px;
    border: 1px solid rgba(246, 207, 60, .3);
    border-radius: 4px;
    background: #241d0d;
    color: #e6ca69;
    font: inherit;
    font-size: 8px;
    cursor: pointer;
}

.py-ref-source-actions button.is-collected {
    border-color: rgba(119, 183, 105, .55);
    background: rgba(52, 91, 46, .34);
    color: #bfe3b6;
}

.py-ref-tag-list {
    display: flex;
    flex-wrap: wrap;
}

.py-ref-tag-list li,
.py-ref-method-pill,
.py-ref-type-pill {
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 4px;
    background: #17130b;
    color: #b7a46e;
    font-size: 8px;
}

.py-ref-mechanic-notes {
    display: grid;
    gap: 5px;
    padding: 0;
    margin: 8px 0 0;
    list-style: none;
}

.py-ref-mechanic-notes li {
    padding-left: 11px;
    color: #9f8c58;
    font-size: 8px;
    line-height: 1.55;
    position: relative;
}

.py-ref-mechanic-notes li::before {
    content: "◆";
    position: absolute;
    left: 0;
    color: var(--detail-accent);
    font-size: 6px;
}

.py-ref-matchup-grid {
    display: grid;
    gap: 6px;
}

.py-ref-matchup-grid > div {
    display: grid;
    grid-template-columns: minmax(105px, .55fr) 1fr;
    gap: 8px;
    align-items: start;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 5px;
    background: #17130b;
}

.py-ref-matchup-grid strong {
    color: #d6c78f;
    font-size: 8px;
}

.py-ref-matchup-grid span {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.py-ref-matchup-grid i {
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .07);
    color: #bcae7c;
    font-size: 7px;
    font-style: normal;
}

.py-ref-matchup-grid .is-strong i {
    background: rgba(119, 183, 105, .16);
    color: #bfe3b6;
}

.py-ref-matchup-grid .is-none i {
    background: rgba(206, 82, 82, .13);
    color: #db9d91;
}

.py-ref-type-pill {
    border: 0;
    color: #fff;
    font-weight: 900;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, .5);
}

.py-ref-learner-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    max-height: 350px;
    overflow: auto;
}

.py-ref-learner {
    min-width: 0;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 5px;
    background: #17130b;
    text-align: center;
}

.py-ref-learner img {
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto;
    object-fit: contain;
    image-rendering: pixelated;
}

.py-ref-learner strong,
.py-ref-learner span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-ref-learner strong {
    color: #e1d3a4;
    font-size: 7px;
}

.py-ref-learner span {
    margin-top: 2px;
    color: #887644;
    font-size: 6px;
}

.py-ref-detail-glyph {
    --card-accent: var(--detail-accent);
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    font-size: 12px;
}

.py-ref-machine-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
}

.py-ref-machine-disc {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 5px solid var(--detail-accent);
    border-radius: 50%;
    background: #17130b;
    color: #fff;
    font-size: 8px;
    font-weight: 950;
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--detail-accent) 45%, #fff6cf);
}

.py-ref-machine-card strong,
.py-ref-machine-card span {
    display: block;
}

.py-ref-machine-card strong {
    color: #f2e5b7;
    font-size: 11px;
}

.py-ref-machine-card span {
    margin-top: 3px;
    color: #958351;
    font-size: 8px;
}

.py-ref-price-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #9e8b57;
    font-size: 9px;
}

.py-ref-price-line strong {
    color: #f0e1b0;
}

.py-ref-footer-note {
    margin-bottom: 4px;
}

@media (max-width: 1360px) {
    .py-ref-workbench {
        grid-template-columns: 230px minmax(390px, 1fr) 320px;
    }

    .py-ref-trainer-grid,
    .py-ref-item-grid,
    .py-ref-move-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .py-ref-workbench {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .py-ref-detail {
        position: static;
        grid-column: 2;
        max-height: none;
    }

    .py-ref-trainer-grid,
    .py-ref-item-grid,
    .py-ref-move-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .py-ref {
        padding: 12px;
    }

    .py-ref-hero {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 27px 23px 31px;
    }

    .py-ref-save-card {
        width: min(420px, 100%);
    }

    .py-ref-workbench {
        grid-template-columns: 1fr;
    }

    .py-ref-filters,
    .py-ref-detail {
        position: static;
        grid-column: 1;
        max-height: none;
    }

    .py-ref-type-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .py-ref-trainer-grid,
    .py-ref-item-grid,
    .py-ref-move-grid {
        grid-template-columns: 1fr;
    }

    .py-ref-toolbar {
        align-items: flex-end;
        flex-wrap: wrap;
    }

    .py-ref-toolbar > label {
        grid-template-columns: 1fr;
        gap: 2px;
        width: 145px;
    }

    .py-ref-type-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .py-ref-party-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .py-ref-learner-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 430px) {
    .py-ref {
        padding: 8px;
    }

    .py-ref-hero {
        padding: 24px 17px 28px;
    }

    .py-ref-hero h1 {
        font-size: 39px;
    }

    .py-ref-hero-pills span:last-child {
        display: none;
    }

    .py-ref-catalog,
    .py-ref-filters {
        padding: 11px;
    }

    .py-ref-toolbar > label {
        width: 128px;
    }

    .py-ref-party-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .py-ref-learner-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .py-ref-detail-head {
        padding: 11px;
    }

    .py-ref-detail-portrait,
    .py-ref-detail-glyph {
        width: 68px;
        height: 68px;
    }
}

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