.site-share-entry {
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

.site-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.35rem;
    box-sizing: border-box;
    max-width: 100%;
    border: 1px solid #d5a700;
    border-radius: 0.7rem;
    padding: 0.5rem 0.75rem;
    color: #40373b;
    background: var(--color-accent, #ffd232);
    box-shadow: 0 4px 10px rgb(120 82 88 / 16%);
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.site-share-entry button.site-share-button {
    appearance: none;
}

.site-share-button:hover {
    color: #40373b;
    background: #f2c31e;
    box-shadow: 0 7px 14px rgb(120 82 88 / 20%);
    transform: translateY(-1px);
}

.site-share-button:focus-visible,
.site-share-entry:focus-visible .site-share-button {
    outline: 3px solid var(--color-support, #25aaa0);
    outline-offset: 2px;
}

.site-share-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.site-share-button span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-footer .site-share-entry .site-share-button,
.site-footer .site-share-entry .site-share-button:hover {
    color: #40373b;
}

.site-footer .site-share-button {
    overflow: visible;
    overflow-wrap: anywhere;
    white-space: normal;
}

.site-footer .site-share-button span {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
}

.site-header .site-share-entry {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}

.site-header .site-share-button {
    width: 100%;
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
    white-space: normal;
    text-align: center;
}

.site-header .site-share-button span {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
}

.share-status {
    padding: 0.75rem 0;
    color: #183a21;
    background: #eef8f0;
}

.share-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow: auto;
    padding: 2rem 1rem;
    background: rgb(24 34 48 / 48%);
}

.share-dialog {
    width: min(100%, 820px);
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid #dce3ec;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1rem 3rem rgb(24 34 48 / 22%);
}

.share-dialog-header {
    position: sticky;
    top: -2rem;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #edf0f4;
    background: #fff;
}

.share-dialog :is(button, input, textarea, summary, a) {
    scroll-margin-top: 6rem;
}

.share-dialog-eyebrow {
    margin: 0;
    color: #687588;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.share-dialog-header h2 {
    margin: 0.25rem 0;
    color: #182230;
}

.share-reward-note {
    margin: 0.35rem 0 0;
    color: #185adb;
    font-size: 0.9rem;
    font-weight: 700;
}

.share-reward-note > span {
    display: inline-block;
    white-space: nowrap;
}

.share-dialog-close {
    flex: 0 0 auto;
    min-height: 2.25rem;
}

.share-intro {
    margin: 1rem 0;
    color: #526071;
    line-height: 1.7;
}

.share-rules,
.share-extra-answers {
    padding: 0.75rem 1rem;
    border: 1px solid #dce3ec;
    border-radius: 0.6rem;
}

.share-rules summary,
.share-extra-answers summary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
}

.share-rules p {
    margin: 0.75rem 0 0;
    color: #526071;
    font-size: 0.85rem;
    line-height: 1.7;
}

.share-extra-answers {
    margin-top: 1rem;
}

.share-extra-answers[open] .share-form-grid {
    margin-top: 1rem;
}

.share-step-title {
    margin: 1.5rem 0 0.75rem;
    color: #182230;
    font-size: 1rem;
}

.share-form > .share-step-title:first-of-type {
    margin-top: 0;
}

.share-form {
    margin-top: 1.25rem;
}

.share-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.share-form-grid > div {
    min-width: 0;
}

.share-form-grid label {
    display: block;
    margin-bottom: 0.35rem;
    color: #263142;
    font-size: 0.9rem;
    font-weight: 700;
}

.share-form-grid textarea,
.share-form-grid input[type="url"],
.share-form-grid input[type="file"],
.share-dialog [data-share-preview] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem;
    border: 1px solid #bac4d2;
    border-radius: 0.5rem;
    background: #fff;
    font: inherit;
}

.share-form-grid textarea {
    min-height: 110px;
    resize: vertical;
}

.share-form-grid :is(textarea, input):focus-visible,
.share-dialog [data-share-preview]:focus-visible {
    border-color: #25aaa0;
    outline: 3px solid rgb(37 170 160 / 24%);
    outline-offset: 1px;
}

.share-form-grid :is(input, textarea):disabled {
    cursor: not-allowed;
    color: #687588;
    background: #f5f7fb;
}

.share-proof-grid {
    margin-top: 1rem;
}

.share-link-box {
    display: grid;
    gap: 0.35rem;
    margin: 1rem 0;
    padding: 0.75rem;
    overflow-wrap: anywhere;
    border: 1px solid #dce3ec;
    border-radius: 0.6rem;
    background: #f5f7fb;
}

.share-link-label {
    color: #687588;
    font-size: 0.8rem;
    font-weight: 700;
}

.share-dialog [data-share-preview] {
    line-height: 1.7;
    resize: vertical;
}

.share-link-box a {
    color: #185adb;
    font-weight: 700;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.share-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.share-dialog :is(button, .button-link) {
    min-height: 2.5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid #d5a700;
    border-radius: 0.5rem;
    color: #40373b;
    background: var(--color-accent, #ffd232);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.share-dialog :is(button, .button-link):hover {
    background: #f2c31e;
}

.share-dialog .share-form-actions .button-link,
.share-dialog .share-dialog-close {
    border-color: #bac4d2;
    background: #fff;
}

.share-dialog :is(button, .button-link):disabled {
    cursor: wait;
    opacity: 0.58;
}

.share-dialog :is(button, .button-link):focus-visible {
    outline: 3px solid var(--color-support, #25aaa0);
    outline-offset: 2px;
}

.share-js-status {
    min-height: 1.5em;
    color: #526071;
    font-size: 0.85rem;
}

.share-js-status.error,
.share-notice.error {
    color: #b42318;
}

.share-js-status.success,
.share-notice.success {
    color: #067647;
}

.share-notice {
    max-width: 820px;
    margin: 1rem auto;
    padding: 0.8rem 1rem;
    border: 1px solid #dce3ec;
    border-radius: 0.6rem;
    background: #fff;
    line-height: 1.7;
}

.share-notice.error {
    border-color: #f1b9b4;
    background: #fffafa;
}

.share-dialog-close-help {
    margin-top: 1rem;
}

@media (max-width: 680px) {
    .share-dialog-backdrop {
        padding: 1rem 0.5rem;
    }

    .share-dialog-header {
        top: -1rem;
    }

    .share-dialog-header > :first-child {
        min-width: 0;
        flex: 1 1 auto;
    }

    .share-form-grid {
        grid-template-columns: 1fr;
    }

    .share-dialog .share-form :is(button, .button-link) {
        width: 100%;
    }

    .share-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .share-form-actions .share-js-status {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-share-button {
        transition: none;
    }
}
