.otd-share-open {
    overflow: hidden;
}

.otd-share-modal[hidden] {
    display: none !important;
}

.otd-share-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: clamp(14px, 2.8vw, 32px);
    background: rgba(0, 0, 0, 0.84);
    backdrop-filter: blur(14px);
}

.otd-share-panel {
    width: min(1120px, 100%);
    max-height: calc(100dvh - 28px);
    overflow: auto;
    padding: clamp(18px, 2.6vw, 30px);
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    background: #0a0a0a;
    box-shadow: 0 28px 100px rgba(0, 0, 0, 0.62);
}

.otd-share-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #202020;
}

.otd-share-kicker {
    margin: 0 0 5px;
    color: #e31b23;
    font: 700 0.76rem/1.1 Gobold, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.otd-share-header h2 {
    margin: 0;
    color: #fff;
    font: 700 clamp(1.7rem, 3.6vw, 2.7rem)/0.96 Gobold, sans-serif;
    letter-spacing: 0.015em;
}

.otd-share-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid #303030;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
}

.otd-share-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: clamp(18px, 3vw, 30px);
    align-items: start;
    margin-top: 22px;
}

.otd-share-preview-column,
.otd-share-controls {
    min-width: 0;
}

.otd-share-preview-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 2px 9px;
}

.otd-share-preview-meta strong {
    color: #f3f3f3;
    font: 700 0.82rem/1 Gobold, sans-serif;
    letter-spacing: 0.04em;
}

.otd-share-preview-meta span {
    color: #747474;
    font: 600 0.69rem/1.2 Arial, sans-serif;
}

.otd-share-preview-wrap {
    display: grid;
    place-items: center;
    min-height: 420px;
    padding: clamp(12px, 2vw, 20px);
    border: 1px solid #222;
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 18%, rgba(255,255,255,0.045), transparent 40%),
        #101010;
}

.otd-share-preview {
    display: block;
    width: auto;
    max-width: min(100%, 560px);
    max-height: min(68dvh, 720px);
    height: auto;
    border-radius: 9px;
    background: #080808;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.5);
}

.otd-share-status {
    min-height: 1.35em;
    margin: 10px 2px 0;
    color: #9c9c9c;
    font-size: 0.76rem;
    line-height: 1.4;
}

.otd-share-controls {
    position: sticky;
    top: 0;
    display: grid;
    gap: 12px;
}

.otd-share-formats {
    display: grid;
    gap: 8px;
}

.otd-share-formats button,
.otd-share-action,
.otd-share-platforms button {
    border: 1px solid #2b2b2b;
    background: #121212;
    color: #ededed;
    cursor: pointer;
    transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.otd-share-formats button {
    min-height: 58px;
    padding: 10px 13px;
    border-radius: 12px;
    text-align: left;
}

.otd-share-formats button strong,
.otd-share-formats button span {
    display: block;
}

.otd-share-formats button strong {
    font: 700 0.79rem/1.1 Gobold, sans-serif;
    letter-spacing: 0.03em;
}

.otd-share-formats button span {
    margin-top: 5px;
    color: #858585;
    font: 600 0.68rem/1.1 Arial, sans-serif;
}

.otd-share-formats button[aria-pressed="true"] {
    border-color: #e31b23;
    background: #1b0c0d;
    box-shadow: inset 3px 0 0 #e31b23;
}

.otd-share-formats button[aria-pressed="true"] span {
    color: #b9b9b9;
}

.otd-share-primary-actions,
.otd-share-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.otd-share-action {
    min-height: 46px;
    padding: 0 12px;
    border-radius: 10px;
    font: 700 0.75rem/1 Gobold, sans-serif;
    letter-spacing: 0.025em;
}

.otd-share-action.is-primary {
    border-color: #e31b23;
    background: #e31b23;
    color: #fff;
}

.otd-share-action:disabled {
    cursor: wait;
    opacity: 0.42;
}

.otd-share-action:not(:disabled):hover,
.otd-share-formats button:hover,
.otd-share-platforms button:hover {
    border-color: #555;
}

.otd-share-action.is-primary:not(:disabled):hover {
    border-color: #f03a41;
    background: #f03a41;
}

.otd-share-link-block {
    padding-top: 4px;
    border-top: 1px solid #202020;
}

.otd-share-link-block > span {
    display: block;
    margin: 8px 1px 7px;
    color: #747474;
    font: 700 0.66rem/1.1 Arial, sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.otd-share-platforms {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.otd-share-platforms button {
    min-height: 38px;
    padding: 0 9px;
    border-radius: 9px;
    color: #cfcfcf;
    font: 700 0.68rem/1 Gobold, sans-serif;
}

.otd-share-note {
    margin: 0;
    padding: 11px 12px;
    border: 1px solid #202020;
    border-radius: 10px;
    background: #0d0d0d;
    color: #858585;
    font-size: 0.73rem;
    line-height: 1.45;
}

.otd-entry-media.is-image-ready {
    cursor: pointer;
}

.otd-entry-media.is-image-ready:focus-visible,
.otd-share-formats button:focus-visible,
.otd-share-action:focus-visible,
.otd-share-platforms button:focus-visible,
.otd-share-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

@media (max-width: 860px) {
    .otd-share-workspace {
        grid-template-columns: 1fr;
    }

    .otd-share-controls {
        position: static;
    }

    .otd-share-formats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .otd-share-formats button {
        min-height: 62px;
    }

    .otd-share-preview-wrap {
        min-height: 300px;
    }

    .otd-share-preview {
        max-height: 52dvh;
    }
}

@media (max-width: 700px) {
    .otd-share-modal {
        align-items: end;
        padding: 0;
    }

    .otd-share-panel {
        width: 100%;
        max-height: 95dvh;
        border-radius: 20px 20px 0 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
    }

    .otd-share-header {
        padding-bottom: 13px;
    }

    .otd-share-workspace {
        margin-top: 14px;
        gap: 12px;
    }

    .otd-share-preview-meta {
        margin-bottom: 7px;
    }

    .otd-share-preview-wrap {
        min-height: 220px;
        padding: 9px;
    }

    .otd-share-preview {
        max-height: 43dvh;
    }

    .otd-share-controls {
        gap: 9px;
    }

    .otd-share-formats button {
        min-height: 56px;
        padding: 9px 8px;
        text-align: center;
    }

    .otd-share-formats button[aria-pressed="true"] {
        box-shadow: inset 0 -3px 0 #e31b23;
    }

    .otd-share-platforms {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .otd-share-note {
        font-size: 0.7rem;
    }
}

@media (max-width: 430px) {
    .otd-share-header h2 {
        font-size: 1.55rem;
    }

    .otd-share-formats button strong {
        font-size: 0.69rem;
    }

    .otd-share-formats button span {
        font-size: 0.61rem;
    }

    .otd-share-action {
        min-height: 44px;
        font-size: 0.69rem;
    }

    .otd-share-platforms button {
        font-size: 0.62rem;
    }
}