.py-save {
    width: min(1320px, calc(100% - 24px));
    margin: 0 auto;
    padding: 24px 0 38px;
}

.py-save-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 16px;
    margin-bottom: 16px;
}

.py-save-hero-copy,
.py-save-privacy-card,
.py-save-upload-panel,
.py-save-summary-panel,
.py-save-detail-grid > article,
.py-save-apply-panel,
.py-save-complete {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(43, 36, 21, .97);
    box-shadow: var(--shadow);
}

.py-save-hero-copy {
    position: relative;
    overflow: hidden;
    padding: 28px;
    background:
        radial-gradient(circle at 88% 10%, rgba(246, 207, 60, .18), transparent 28%),
        linear-gradient(135deg, rgba(57, 46, 21, .98), rgba(34, 28, 16, .98));
}

.py-save-hero-copy::after {
    content: "";
    position: absolute;
    right: -42px;
    bottom: -58px;
    width: 210px;
    height: 210px;
    border: 16px solid rgba(246, 207, 60, .055);
    border-radius: 50%;
    box-shadow: inset 0 0 0 16px rgba(206, 82, 82, .035);
    pointer-events: none;
}

.py-save-hero h1 {
    position: relative;
    z-index: 1;
    margin: 4px 0 10px;
    color: #fff;
    font-size: clamp(34px, 5vw, 58px);
    line-height: .98;
    letter-spacing: -.045em;
}

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

.py-save-hero-copy > p:not(.py-ref-eyebrow) {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0;
    color: #d8c99a;
    font-size: 14px;
    line-height: 1.65;
}

.py-save-hero code,
.py-save-source-help code {
    padding: 1px 4px;
    border: 1px solid rgba(246, 207, 60, .18);
    border-radius: 4px;
    background: rgba(15, 13, 8, .56);
    color: #ffe678;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .9em;
}

.py-save-hero-pills {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
}

.py-save-hero-pills span {
    padding: 6px 9px;
    border: 1px solid #645127;
    border-radius: 999px;
    background: rgba(25, 21, 12, .62);
    color: #ad9c6e;
    font-size: 10px;
}

.py-save-hero-pills strong {
    color: #ffe678;
}

.py-save-privacy-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    border-color: #725b28;
    background:
        linear-gradient(180deg, rgba(62, 48, 20, .98), rgba(38, 31, 17, .98));
}

.py-save-card-label {
    color: #ce5252;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .16em;
}

.py-save-privacy-card strong {
    margin-top: 8px;
    color: #fff;
    font-size: 18px;
    line-height: 1.2;
}

.py-save-privacy-card p {
    margin: 8px 0 0;
    color: #baaa7d;
    font-size: 11px;
    line-height: 1.55;
}

.py-save-load {
    min-height: 90px;
    margin: 0;
}

.py-save-workbench,
.py-save-preview {
    display: grid;
    gap: 14px;
}

.py-save-workbench[hidden],
.py-save-preview[hidden] {
    display: none;
}

.py-save-upload-panel,
.py-save-summary-panel,
.py-save-detail-grid > article,
.py-save-apply-panel {
    padding: 16px;
}

.py-save-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.py-save-section-heading > div > span {
    display: block;
    color: #ce5252;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .13em;
}

.py-save-section-heading h2 {
    margin: 2px 0 0;
    color: #fff;
    font-size: 17px;
    line-height: 1.2;
}

.py-save-section-heading > small {
    color: #9d8b5c;
    font-size: 10px;
    text-align: right;
}

.py-save-drop-zone {
    display: grid;
    place-items: center;
    min-height: 210px;
    padding: 24px;
    border: 2px dashed #775f28;
    border-radius: 10px;
    background:
        linear-gradient(90deg, rgba(246, 207, 60, .025) 1px, transparent 1px),
        linear-gradient(0deg, rgba(246, 207, 60, .025) 1px, transparent 1px),
        rgba(24, 20, 12, .68);
    background-size: 24px 24px, 24px 24px, auto;
    cursor: pointer;
    text-align: center;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.py-save-drop-zone:hover,
.py-save-drop-zone.is-dragging {
    border-color: var(--gold);
    background-color: rgba(64, 51, 20, .55);
    transform: translateY(-1px);
}

.py-save-drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.py-save-drop-icon {
    display: block;
    width: 58px;
    height: 58px;
    margin-bottom: 10px;
    border: 3px solid #f6cf3c;
    border-radius: 50%;
    background:
        linear-gradient(180deg, #ce5252 0 45%, #17130b 45% 55%, #fff6cf 55% 100%);
    box-shadow: 0 0 0 6px rgba(246, 207, 60, .08), 0 10px 24px rgba(0, 0, 0, .28);
}

.py-save-drop-zone strong {
    color: #fff;
    font-size: 17px;
}

.py-save-drop-zone small {
    margin-top: 5px;
    color: #a99868;
    font-size: 11px;
}

.py-save-source-help {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.py-save-source-help div {
    padding: 10px;
    border: 1px solid #55451f;
    border-radius: 7px;
    background: rgba(25, 21, 13, .66);
}

.py-save-source-help strong,
.py-save-source-help span {
    display: block;
}

.py-save-source-help strong {
    color: #f2dc80;
    font-size: 10px;
}

.py-save-source-help span {
    margin-top: 4px;
    color: #9f8e61;
    font-size: 9px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.py-save-status {
    margin: 10px 0 0;
    padding: 8px 10px;
    border-left: 3px solid #6d83df;
    border-radius: 0 5px 5px 0;
    background: rgba(109, 131, 223, .08);
    color: #bdc8ef;
    font-size: 10px;
}

.py-save-status.is-error {
    border-left-color: #ce5252;
    background: rgba(206, 82, 82, .09);
    color: #efb0a8;
}

.py-save-status.is-success {
    border-left-color: #77b769;
    background: rgba(119, 183, 105, .09);
    color: #b7dcae;
}

.py-save-valid-badge {
    padding: 5px 8px;
    border: 1px solid rgba(119, 183, 105, .5);
    border-radius: 999px;
    background: rgba(119, 183, 105, .1);
    color: #9fd394;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .08em;
}

.py-save-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.py-save-summary-grid article {
    min-width: 0;
    padding: 12px;
    border: 1px solid #5a4822;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(55, 44, 22, .82), rgba(28, 24, 14, .86));
}

.py-save-summary-grid span,
.py-save-summary-grid strong,
.py-save-summary-grid small {
    display: block;
}

.py-save-summary-grid span {
    color: #9f8c5d;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.py-save-summary-grid strong {
    margin-top: 6px;
    overflow: hidden;
    color: #ffe678;
    font-size: 18px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-save-summary-grid small {
    margin-top: 5px;
    overflow: hidden;
    color: #aa9868;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-save-progress-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid #5a4822;
    border-radius: 8px;
    background: #5a4822;
}

.py-save-progress-strip div {
    padding: 10px 7px;
    background: #211b10;
    text-align: center;
}

.py-save-progress-strip strong,
.py-save-progress-strip span {
    display: block;
}

.py-save-progress-strip strong {
    color: #fff;
    font-size: 16px;
}

.py-save-progress-strip span {
    margin-top: 2px;
    color: #9b895b;
    font-size: 8px;
    text-transform: uppercase;
}

.py-save-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(250px, .75fr) minmax(250px, .8fr);
    gap: 14px;
}

.py-save-party-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.py-save-party-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 9px;
    min-width: 0;
    padding: 9px;
    border: 1px solid #584720;
    border-radius: 8px;
    background: rgba(26, 22, 13, .76);
}

.py-save-party-card img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    image-rendering: pixelated;
}

.py-save-party-copy {
    min-width: 0;
}

.py-save-party-copy > span {
    color: #ce5252;
    font-size: 8px;
    font-weight: 900;
}

.py-save-party-copy h3 {
    margin: 1px 0 0;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-save-party-copy h3 small {
    color: #f1d765;
    font-size: 9px;
}

.py-save-hp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: #9f8e60;
    font-size: 8px;
}

.py-save-hp span {
    display: block;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #17130b;
}

.py-save-hp i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #77b769;
}

.py-save-party-moves {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 6px;
}

.py-save-party-moves span {
    max-width: 100%;
    padding: 2px 4px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(109, 131, 223, .12);
    color: #c5cff2;
    font-size: 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-save-empty {
    margin: 0;
    padding: 14px;
    border: 1px dashed #5b4924;
    border-radius: 7px;
    color: #9f8e60;
    font-size: 10px;
    text-align: center;
}

.py-save-bag-list,
.py-save-milestones {
    display: grid;
    gap: 5px;
    max-height: 278px;
    overflow: auto;
}

.py-save-bag-row,
.py-save-milestone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid #51411e;
    border-radius: 6px;
    background: rgba(25, 21, 12, .72);
}

.py-save-bag-row strong,
.py-save-milestone strong {
    color: #e9ddae;
    font-size: 9px;
}

.py-save-bag-row span {
    flex: 0 0 auto;
    color: #ffe678;
    font-size: 9px;
    font-weight: 900;
}

.py-save-milestone::before {
    content: "✓";
    display: inline-grid;
    place-items: center;
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #5f994f;
    color: #10210d;
    font-size: 9px;
    font-weight: 950;
}

.py-save-milestone {
    justify-content: flex-start;
}

.py-save-apply-grid {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
    gap: 12px;
}

.py-save-apply-grid fieldset {
    min-width: 0;
    margin: 0;
    padding: 11px;
    border: 1px solid #5c4922;
    border-radius: 8px;
    background: rgba(25, 21, 12, .58);
}

.py-save-apply-grid legend {
    padding: 0 6px;
    color: #d8c57e;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.py-save-mode-fieldset {
    display: grid;
    gap: 7px;
}

.py-save-choice-card,
.py-save-fields-fieldset label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px;
    border: 1px solid #51411f;
    border-radius: 7px;
    background: rgba(31, 26, 15, .72);
    cursor: pointer;
}

.py-save-choice-card.is-selected,
.py-save-choice-card:has(input:checked) {
    border-color: #c9a432;
    background: rgba(246, 207, 60, .08);
}

.py-save-choice-card input,
.py-save-fields-fieldset input {
    width: 15px;
    height: 15px;
    margin: 1px 0 0;
    accent-color: #ce5252;
}

.py-save-choice-card span,
.py-save-fields-fieldset label span {
    min-width: 0;
}

.py-save-choice-card strong,
.py-save-choice-card small,
.py-save-fields-fieldset strong,
.py-save-fields-fieldset small {
    display: block;
}

.py-save-choice-card strong,
.py-save-fields-fieldset strong {
    color: #fff;
    font-size: 10px;
}

.py-save-choice-card small,
.py-save-fields-fieldset small {
    margin-top: 2px;
    color: #9f8f62;
    font-size: 8px;
    line-height: 1.35;
}

.py-save-profile-name {
    display: grid;
    gap: 5px;
    margin-top: 2px;
}

.py-save-profile-name > span {
    color: #a99766;
    font-size: 8px;
    font-weight: 850;
    text-transform: uppercase;
}

.py-save-profile-name input {
    width: 100%;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #675225;
    border-radius: 6px;
    outline: 0;
    background: #211b10;
    color: #fff2b5;
    font-size: 10px;
}

.py-save-profile-name input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(246, 207, 60, .12);
}

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

.py-save-fields-fieldset label:has(input:checked) {
    border-color: rgba(119, 183, 105, .48);
    background: rgba(119, 183, 105, .07);
}

.py-save-apply-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.py-save-apply-actions p {
    max-width: 760px;
    margin: 0;
    color: #9e8e61;
    font-size: 9px;
    line-height: 1.45;
}

.py-save-apply-actions button {
    flex: 0 0 auto;
    min-width: 190px;
}

.py-save-complete {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-color: rgba(119, 183, 105, .52);
    background: linear-gradient(135deg, rgba(44, 70, 34, .94), rgba(31, 35, 18, .98));
}

.py-save-complete[hidden] {
    display: none;
}

.py-save-complete-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #77b769;
    color: #10210d;
    font-size: 22px;
    font-weight: 950;
}

.py-save-complete strong {
    color: #fff;
    font-size: 14px;
}

.py-save-complete p {
    margin: 3px 0 0;
    color: #b8d5ae;
    font-size: 9px;
}

.py-save-complete nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.py-save-complete a {
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 5px;
    background: rgba(255, 255, 255, .05);
    color: #e3f3dc;
    font-size: 9px;
    font-weight: 800;
}

.py-save-complete a:hover {
    border-color: #c9e1c0;
    background: rgba(255, 255, 255, .1);
}

@media (max-width: 1050px) {
    .py-save-detail-grid {
        grid-template-columns: 1fr 1fr;
    }

    .py-save-party-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .py-save {
        width: min(100% - 20px, 1320px);
        padding-top: 14px;
    }

    .py-save-hero,
    .py-save-apply-grid {
        grid-template-columns: 1fr;
    }

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

    .py-save-source-help {
        grid-template-columns: 1fr;
    }

    .py-save-complete {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .py-save-complete nav {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .py-save-hero-copy,
    .py-save-privacy-card {
        padding: 20px;
    }

    .py-save-drop-zone {
        min-height: 180px;
    }

    .py-save-progress-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .py-save-detail-grid,
    .py-save-party-grid,
    .py-save-fields-fieldset {
        grid-template-columns: 1fr;
    }

    .py-save-party-panel {
        grid-column: auto;
    }

    .py-save-summary-grid strong,
    .py-save-summary-grid small,
    .py-save-party-copy h3,
    .py-save-party-moves span {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .py-save-apply-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .py-save-apply-actions button {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .py-save-summary-grid {
        grid-template-columns: 1fr;
    }

    .py-save-progress-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
