.py-resources {
    --res-ink: #17130b;
    --res-panel: #2b2415;
    --res-panel-high: #372d18;
    --res-line: #665126;
    --res-gold: #f6cf3c;
    --res-cream: #fff5c8;
    --res-red: #ce594c;
    --res-blue: #51578e;
    --res-green: #79b96c;
    color: #e8d9a7;
}

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

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

.py-resources button {
    cursor: pointer;
}

.py-resources-hero {
    grid-template-columns: minmax(0, 1fr) 330px;
}

.py-resources-wallet-card {
    position: relative;
    min-height: 165px;
    padding: 18px;
    border: 3px solid var(--res-ink);
    border-radius: 7px;
    background:
        linear-gradient(rgba(81, 87, 142, .09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(81, 87, 142, .09) 1px, transparent 1px),
        var(--res-gold);
    background-size: 13px 13px;
    color: var(--res-ink);
    box-shadow: inset 0 0 0 3px #ffe578, 7px 7px 0 #993b10;
}

.py-resources-wallet-card::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(23, 19, 11, .28);
    pointer-events: none;
}

.py-resources-wallet-card > * {
    position: relative;
}

.py-resources-wallet-card > span {
    color: #594514;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .12em;
}

.py-resources-wallet-card > strong {
    display: block;
    margin-top: 7px;
    color: var(--res-blue);
    font-size: 38px;
    font-weight: 950;
    letter-spacing: -.04em;
    line-height: 1;
}

.py-resources-wallet-card > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 9px;
    padding-top: 7px;
    border-top: 1px solid rgba(23, 19, 11, .22);
    color: #5b4818;
    font-size: 9px;
}

.py-resources-wallet-card > div b {
    color: #252959;
    font-size: 10px;
}

.py-resources-wallet-card > small {
    display: block;
    margin-top: 8px;
    color: #72591d;
    font-size: 8px;
}

.py-resources-workbench {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.py-resources-sync-bar,
.py-resources-card {
    border: 1px solid var(--res-line);
    border-radius: 7px;
    background: var(--res-panel);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.py-resources-sync-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 13px;
}

.py-resources-sync-bar > div:first-child {
    display: grid;
    grid-template-columns: auto auto;
    gap: 1px 9px;
    align-items: center;
}

.py-resources-sync-bar > div:first-child span {
    grid-row: 1 / span 2;
    color: var(--res-gold);
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .1em;
}

.py-resources-sync-bar strong {
    color: var(--res-cream);
    font-size: 11px;
}

.py-resources-sync-bar small {
    color: #8d7c4d;
    font-size: 8px;
}

.py-resources-sync-bar > div:last-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.py-resources-sync-bar button,
.py-resources-sync-bar a,
.py-resources-section-head button,
.py-resources-section-head a,
.py-resources-tm-toolbar button {
    padding: 6px 9px;
    border: 1px solid #6c5629;
    border-radius: 4px;
    background: #1a150c;
    color: #d7c68f;
    font-size: 8px;
    font-weight: 850;
}

.py-resources-sync-bar button:hover,
.py-resources-sync-bar a:hover,
.py-resources-section-head button:hover,
.py-resources-section-head a:hover,
.py-resources-tm-toolbar button:hover,
.py-resources-tm-toolbar button.is-active {
    border-color: var(--res-gold);
    color: var(--res-gold);
}

.py-resources-section-head button.is-danger {
    border-color: rgba(206, 89, 76, .48);
    color: #e8958c;
}

.py-resources-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.py-resources-metrics article {
    min-width: 0;
    padding: 10px;
    border: 1px solid #5f4c25;
    border-radius: 6px;
    background: #211a0e;
}

.py-resources-metrics span,
.py-resources-metrics strong,
.py-resources-metrics small {
    display: block;
}

.py-resources-metrics span {
    color: #8f7e4e;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.py-resources-metrics strong {
    margin-top: 4px;
    overflow: hidden;
    color: var(--res-cream);
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-resources-metrics small {
    margin-top: 2px;
    color: #867546;
    font-size: 7px;
    line-height: 1.35;
}

.py-resources-card {
    min-width: 0;
    padding: 14px;
}

.py-resources-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.py-resources-section-head span,
.py-resources-section-head h2 {
    display: block;
    margin: 0;
}

.py-resources-section-head span {
    color: var(--res-gold);
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .11em;
}

.py-resources-section-head h2 {
    margin-top: 2px;
    color: var(--res-cream);
    font-size: 17px;
    line-height: 1.15;
}

.py-resources-primary-grid,
.py-resources-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.py-resources-wallet-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.py-resources-wallet-inputs label:not(.py-resources-check),
.py-resources-shop-toolbar label {
    display: grid;
    gap: 4px;
    color: #988654;
    font-size: 8px;
    font-weight: 850;
}

.py-resources-wallet-inputs input,
.py-resources-shop-toolbar input,
.py-resources-shop-toolbar select {
    width: 100%;
    min-height: 34px;
    padding: 7px 8px;
    border: 1px solid #604d26;
    border-radius: 4px;
    outline: none;
    background: #17130b;
    color: var(--res-cream);
    font-size: 10px;
}

.py-resources-wallet-inputs input:focus,
.py-resources-shop-toolbar input:focus,
.py-resources-shop-toolbar select:focus {
    border-color: var(--res-gold);
}

.py-resources-check {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(246, 207, 60, .14);
    border-radius: 5px;
    background: #211a0e;
}

.py-resources-check input {
    accent-color: var(--res-gold);
}

.py-resources-check span,
.py-resources-check strong,
.py-resources-check small {
    display: block;
}

.py-resources-check strong {
    color: #d8ca98;
    font-size: 9px;
}

.py-resources-check small {
    color: #847445;
    font-size: 7px;
}

.py-resources-income-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.py-resources-income-stats > div,
.py-resources-capacity > article,
.py-resources-corner-card [data-corner-summary] > div,
.py-resources-evolution-card [data-evolution-summary] > div {
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .065);
    border-radius: 5px;
    background: #211a0e;
}

.py-resources-income-stats span,
.py-resources-income-stats strong,
.py-resources-income-stats small {
    display: block;
}

.py-resources-income-stats span {
    color: #887747;
    font-size: 7px;
    text-transform: uppercase;
}

.py-resources-income-stats strong {
    margin-top: 3px;
    color: var(--res-cream);
    font-size: 13px;
}

.py-resources-income-stats small {
    margin-top: 2px;
    color: #7f7043;
    font-size: 7px;
}

.py-resources-location-income {
    display: grid;
    gap: 5px;
    margin-top: 10px;
}

.py-resources-location-income > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border-left: 3px solid var(--res-blue);
    background: #211a0e;
}

.py-resources-location-income strong {
    overflow: hidden;
    color: #cbbc89;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-resources-location-income span {
    color: var(--res-gold);
    font-size: 8px;
    font-weight: 900;
}

.py-resources-capacity {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.py-resources-capacity span,
.py-resources-capacity strong,
.py-resources-capacity small {
    display: block;
}

.py-resources-capacity span {
    color: #8d7b4a;
    font-size: 7px;
    text-transform: uppercase;
}

.py-resources-capacity strong {
    margin-top: 3px;
    color: var(--res-cream);
    font-size: 15px;
}

.py-resources-capacity small {
    margin-top: 3px;
    color: #7e6f42;
    font-size: 7px;
}

.py-resources-capacity i {
    display: block;
    height: 5px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 4px;
    background: #17130b;
}

.py-resources-capacity i b {
    display: block;
    height: 100%;
    background: var(--res-gold);
}

.py-resources-inventory-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 11px;
}

.py-resources-inventory-columns h3 {
    margin: 0 0 6px;
    color: #9a8855;
    font-size: 8px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.py-resources-item-list,
.py-resources-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.py-resources-item-list span,
.py-resources-chip-list span {
    padding: 4px 6px;
    border: 1px solid #55431f;
    border-radius: 4px;
    background: #1b160d;
    color: #c9b987;
    font-size: 7px;
}

.py-resources-item-list span b {
    color: var(--res-gold);
}

.py-resources-empty {
    padding: 10px;
    border: 1px dashed #574722;
    border-radius: 5px;
    color: #857548;
    font-size: 8px;
    line-height: 1.45;
}

.py-resources-pc-note {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid rgba(81, 87, 142, .42);
    border-radius: 5px;
    background: rgba(81, 87, 142, .1);
    color: #aaa6cf;
    font-size: 8px;
    line-height: 1.45;
}

.py-resources-shop-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 240px) 180px;
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}

.py-resources-shop-toolbar > div {
    display: grid;
    gap: 3px;
    min-height: 34px;
    padding: 5px 8px;
    border: 1px solid #604d26;
    border-radius: 4px;
    background: #17130b;
}

.py-resources-shop-toolbar > div span {
    color: #887747;
    font-size: 7px;
}

.py-resources-shop-toolbar > div strong {
    color: var(--res-green);
    font-size: 11px;
}

.py-resources-shop-toolbar > div strong.is-negative {
    color: #e38a80;
}

.py-resources-shopping-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 275px;
    gap: 12px;
    align-items: start;
}

.py-resources-shop-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.py-resources-shop-item {
    min-width: 0;
    padding: 9px;
    border: 1px solid #58461f;
    border-radius: 6px;
    background: #211a0e;
}

.py-resources-shop-item.is-selected {
    border-color: rgba(246, 207, 60, .6);
    box-shadow: inset 0 0 0 1px rgba(246, 207, 60, .12);
}

.py-resources-shop-item > span,
.py-resources-shop-item h3,
.py-resources-shop-item p,
.py-resources-shop-item small {
    display: block;
    margin: 0;
}

.py-resources-shop-item > span {
    color: #8c7a49;
    font-size: 7px;
    font-weight: 900;
    text-transform: uppercase;
}

.py-resources-shop-item h3 {
    margin-top: 3px;
    overflow: hidden;
    color: var(--res-cream);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-resources-shop-item p {
    min-height: 31px;
    margin-top: 5px;
    color: #8e7d4d;
    font-size: 7px;
    line-height: 1.4;
}

.py-resources-shop-item small {
    margin-top: 5px;
    overflow: hidden;
    color: #a7945f;
    font-size: 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-resources-shop-item footer,
.py-resources-cart-row footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    margin-top: 8px;
}

.py-resources-shop-item footer > strong {
    color: var(--res-gold);
    font-size: 10px;
}

.py-resources-quantity {
    display: grid;
    grid-template-columns: 25px 28px 25px;
    align-items: center;
    overflow: hidden;
    border: 1px solid #5b4821;
    border-radius: 4px;
}

.py-resources-quantity button {
    height: 25px;
    padding: 0;
    border: 0;
    background: #17130b;
    color: var(--res-gold);
    font-weight: 950;
}

.py-resources-quantity strong {
    color: #d8ca99;
    font-size: 8px;
    text-align: center;
}

.py-resources-cart {
    position: sticky;
    top: 82px;
    padding: 11px;
    border: 1px solid #725a27;
    border-radius: 6px;
    background: #1b160d;
}

.py-resources-cart > div:first-child {
    padding-bottom: 9px;
    border-bottom: 1px solid #4f3f1d;
}

.py-resources-cart > div:first-child span,
.py-resources-cart > div:first-child strong,
.py-resources-cart > div:first-child small {
    display: block;
}

.py-resources-cart > div:first-child span {
    color: #8f7d4b;
    font-size: 7px;
    font-weight: 950;
    letter-spacing: .09em;
}

.py-resources-cart > div:first-child strong {
    margin-top: 3px;
    color: var(--res-gold);
    font-size: 21px;
}

.py-resources-cart > div:first-child small {
    color: #887848;
    font-size: 7px;
}

.py-resources-cart > div:nth-child(2) {
    display: grid;
    gap: 6px;
    max-height: 430px;
    margin-top: 9px;
    overflow: auto;
}

.py-resources-cart-row {
    padding: 7px;
    border: 1px solid #4f401f;
    border-radius: 4px;
    background: #211a0e;
}

.py-resources-cart-row > strong,
.py-resources-cart-row > span {
    display: block;
}

.py-resources-cart-row > strong {
    color: #d8ca99;
    font-size: 8px;
}

.py-resources-cart-row > span {
    margin-top: 2px;
    color: #897849;
    font-size: 7px;
}

.py-resources-cart-row footer > b {
    color: var(--res-gold);
    font-size: 8px;
}

.py-resources-cart > p {
    margin: 9px 0 0;
    padding-top: 8px;
    border-top: 1px solid #4f3f1d;
    color: #9c8a55;
    font-size: 8px;
    line-height: 1.45;
}

.py-resources-cart > p.is-negative {
    color: #e38a80;
}

.py-resources-tm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.py-resources-tm-toolbar > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.py-resources-tm-toolbar > div:last-child {
    color: #91804f;
    font-size: 8px;
    text-align: right;
}

.py-resources-tm-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.py-resources-tm-row {
    --tm-color: #8b7f63;
    min-width: 0;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--tm-color) 42%, #5a471f);
    border-left: 4px solid var(--tm-color);
    border-radius: 6px;
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--tm-color) 8%, transparent), transparent 54%),
        #211a0e;
}

.py-resources-tm-row.is-conflict {
    border-color: rgba(206, 89, 76, .72);
    border-left-color: var(--res-red);
}

.py-resources-tm-row.is-planned {
    box-shadow: inset 0 0 0 1px rgba(246, 207, 60, .08);
}

.py-resources-tm-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.py-resources-tm-title span,
.py-resources-tm-title strong,
.py-resources-tm-title small {
    display: block;
}

.py-resources-tm-title span {
    color: var(--tm-color);
    font-size: 8px;
    font-weight: 950;
}

.py-resources-tm-title strong {
    margin-top: 1px;
    color: var(--res-cream);
    font-size: 11px;
}

.py-resources-tm-title small {
    margin-top: 2px;
    color: #8b7a4b;
    font-size: 7px;
}

.py-resources-tm-title > b {
    flex: 0 0 auto;
    padding: 4px 6px;
    border: 1px solid #5d4a23;
    border-radius: 3px;
    color: #b9a872;
    font-size: 7px;
}

.py-resources-tm-title > b.is-repeatable {
    border-color: rgba(121, 185, 108, .48);
    color: var(--res-green);
}

.py-resources-tm-title > b.is-conflict {
    border-color: rgba(206, 89, 76, .54);
    color: #e58c82;
}

.py-resources-tm-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 8px;
}

.py-resources-tm-facts div {
    min-width: 0;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 4px;
    background: #17130b;
}

.py-resources-tm-facts span,
.py-resources-tm-facts strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-resources-tm-facts span {
    color: #77683e;
    font-size: 6px;
    text-transform: uppercase;
}

.py-resources-tm-facts strong {
    margin-top: 2px;
    color: #cbbc89;
    font-size: 7px;
}

.py-resources-tm-users,
.py-resources-tm-sources {
    margin-top: 7px;
    color: #8e7d4c;
    font-size: 7px;
    line-height: 1.45;
}

.py-resources-tm-users strong,
.py-resources-tm-sources strong {
    color: #c7b783;
}

.py-resources-tm-sources a {
    color: var(--res-gold);
}

.py-resources-evolution-card [data-evolution-summary],
.py-resources-corner-card [data-corner-summary] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.py-resources-evolution-card [data-evolution-summary] span,
.py-resources-evolution-card [data-evolution-summary] strong,
.py-resources-corner-card [data-corner-summary] span,
.py-resources-corner-card [data-corner-summary] strong {
    display: block;
}

.py-resources-evolution-card [data-evolution-summary] span,
.py-resources-corner-card [data-corner-summary] span {
    color: #837343;
    font-size: 6px;
    text-transform: uppercase;
}

.py-resources-evolution-card [data-evolution-summary] strong,
.py-resources-corner-card [data-corner-summary] strong {
    margin-top: 3px;
    color: var(--res-cream);
    font-size: 11px;
}

.py-resources-evolution-card [data-evolution-list],
.py-resources-corner-card [data-corner-list] {
    display: grid;
    gap: 6px;
    margin-top: 9px;
}

.py-resources-evolution-row,
.py-resources-corner-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid #51411f;
    border-radius: 5px;
    background: #211a0e;
}

.py-resources-evolution-row strong,
.py-resources-evolution-row span,
.py-resources-evolution-row small,
.py-resources-corner-row strong,
.py-resources-corner-row span,
.py-resources-corner-row small {
    display: block;
}

.py-resources-evolution-row strong,
.py-resources-corner-row strong {
    color: #d8ca98;
    font-size: 9px;
}

.py-resources-evolution-row span,
.py-resources-corner-row span {
    margin-top: 2px;
    color: #9b8955;
    font-size: 7px;
}

.py-resources-evolution-row small,
.py-resources-corner-row small {
    margin-top: 2px;
    color: #76683e;
    font-size: 7px;
}

.py-resources-evolution-row button {
    padding: 5px 7px;
    border: 1px solid #6c5629;
    border-radius: 4px;
    background: #17130b;
    color: var(--res-gold);
    font-size: 7px;
}

.py-resources-corner-row > b {
    color: var(--res-gold);
    font-size: 9px;
}

@media (max-width: 1180px) {
    .py-resources-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 900px) {
    .py-resources-hero,
    .py-resources-primary-grid,
    .py-resources-bottom-grid,
    .py-resources-shopping-layout {
        grid-template-columns: 1fr;
    }

    .py-resources-cart {
        position: static;
    }

    .py-resources-shop-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .py-resources-shop-toolbar > div {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .py-resources-sync-bar,
    .py-resources-section-head,
    .py-resources-tm-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .py-resources-sync-bar > div:last-child {
        justify-content: flex-start;
    }

    .py-resources-metrics,
    .py-resources-income-stats,
    .py-resources-capacity,
    .py-resources-inventory-columns,
    .py-resources-shop-toolbar,
    .py-resources-shop-grid,
    .py-resources-tm-list,
    .py-resources-evolution-card [data-evolution-summary],
    .py-resources-corner-card [data-corner-summary] {
        grid-template-columns: 1fr;
    }

    .py-resources-wallet-inputs {
        grid-template-columns: 1fr;
    }

    .py-resources-shop-toolbar > div,
    .py-resources-check {
        grid-column: auto;
    }

    .py-resources-wallet-card > strong {
        font-size: 32px;
    }
}
