.progress-trophy-dialog.has-trophy-share {
    max-height: calc(100dvh - 24px);
    overflow: visible;
    overscroll-behavior: contain;
}
.progress-trophy-dialog .trophy-share-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    margin-top: 16px;
    font-size: 15px;
}
.trophy-share-trigger img { width: 28px; height: 28px; object-fit: contain; }
.progress-trophy-dialog.has-trophy-share .progress-trophy-dialog-action {
    min-height: 44px;
    margin-top: 10px;
    border: 1px solid #dfd9d2;
    background: #fffdfa;
    color: #4f4b47;
    box-shadow: none;
    text-shadow: none;
}
.progress-trophy-dialog .trophy-share-status {
    margin: 10px 0 0;
    color: var(--muted, #68615c);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}
.trophy-share-status:empty { display: none; }
.trophy-share-trigger:disabled { opacity: .55; cursor: wait; }

/* Shared compact trophy card: artwork and title above a single action row. */
#progress-trophy-dialog {
    box-sizing: border-box;
    width: min(400px, calc(100% - 40px));
    max-height: calc(100dvh - 24px);
    overflow: visible;
    overscroll-behavior: contain;
    padding: 14px 12px 16px;
}
#progress-trophy-dialog[open] { display: grid; gap: 10px; justify-items: stretch; }
#progress-trophy-dialog .progress-trophy-dialog-close {
    top: -16px;
    right: -16px;
    width: 32px;
    height: 32px;
    min-height: 0;
    padding: 0;
    font-size: 22px;
    line-height: 1;
    background: #fffaf0;
    box-shadow: 0 2px 4px #60401f26;
    z-index: 1;
}
#progress-trophy-dialog .trophy-dialog-header {
    display: grid;
    grid-template-columns: minmax(80px, 30%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding-top: 0;
}
#progress-trophy-dialog-image { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
#progress-trophy-dialog .trophy-dialog-summary { min-width: 0; }
#progress-trophy-dialog h2 {
    margin: 0 0 7px;
    font-size: clamp(19px, 5vw, 24px);
    line-height: 1.12;
    text-align: left;
    overflow-wrap: anywhere;
}
#progress-trophy-dialog .trophy-dialog-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#progress-trophy-dialog .progress-trophy-dialog-status,
#progress-trophy-dialog .trophy-dialog-tier {
    margin: 0;
    padding: 6px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
}
#progress-trophy-dialog .trophy-dialog-tier { background: #fff0c9; color: #91610c; }
#progress-trophy-dialog .progress-trophy-dialog-status { gap: 5px; }
#progress-trophy-dialog .progress-trophy-dialog-status strong { font-size: 12px; }
#progress-trophy-dialog .progress-trophy-earned-check { width: 19px; height: 19px; flex-shrink: 0; }
#progress-trophy-dialog #progress-trophy-dialog-requirement { margin: 0; font-size: 13px; line-height: 1.4; text-align: center; }
#progress-trophy-dialog .trophy-dialog-actions { display: flex; align-items: stretch; gap: 8px; }
#progress-trophy-dialog .trophy-dialog-actions .button {
    box-sizing: border-box;
    flex: 1;
    width: auto;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 10px 8px;
    gap: 5px;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
}
#progress-trophy-dialog .trophy-share-trigger img { width: 22px; height: 22px; flex-shrink: 0; }
#progress-trophy-dialog .trophy-share-status { margin: 0; }

/* Keep the cabinet on the left, including older cached share modules. */
#progress-trophy-dialog .trophy-dialog-actions .progress-trophy-dialog-action {
    order: -1;
    border: 1px solid #cbb69e;
    background: linear-gradient(180deg, #fffdf5, #f2e4d0);
    color: #654731;
    box-shadow: inset 0 1px 0 #fff, 0 4px 0 #baa084, 0 6px 9px #60401f1a;
    text-shadow: 0 1px 0 #ffffffb3;
}
#progress-trophy-dialog .trophy-dialog-actions .progress-trophy-dialog-action:active {
    transform: translateY(3px);
    box-shadow: inset 0 1px 0 #fff, 0 1px 0 #baa084;
}
@media (max-height: 450px) {
    #progress-trophy-dialog { padding: 10px 12px 12px; }
    #progress-trophy-dialog[open] { gap: 7px; }
    #progress-trophy-dialog .trophy-dialog-header { grid-template-columns: 72px minmax(0, 1fr); }
    #progress-trophy-dialog h2 { font-size: 18px; }
}
