/* Scope the public studio without changing management controls or league tabs. */
.league-share-action, .share-studio {
    --studio-bg: #122238; --studio-field: #0c192b; --studio-line: #2f435b;
    --studio-text: #edf3fb; --studio-muted: #b3c2d4; --studio-green: #66dfb9;
}
.light-theme .league-share-action, .light-theme .share-studio {
    --studio-bg: #fff; --studio-field: #f1f6fa; --studio-line: #c9d7df;
    --studio-text: #172d42; --studio-muted: #506578; --studio-green: #08694f;
}
.share-icon { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.league-detail-header--share { flex-wrap: wrap; align-items: flex-start; gap: 1rem; }
.league-detail-header--share .league-detail-identity { flex: 1 1 20rem; min-width: 0; }
.league-detail-header--share .league-sponsor { order: 3; flex: 0 1 10rem; }
.league-share-action { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px; padding: .6rem 1rem; flex: 0 0 auto; border: 1px solid #3c6d60; border-radius: 10px; background: var(--studio-bg); color: var(--studio-green); text-decoration: none; font-weight: 650; font-size: .95rem; transition: background-color .15s, border-color .15s; }
.league-share-action:hover { color: var(--studio-green); background: var(--studio-field); border-color: var(--studio-green); }
.league-share-action:active { background: #1c493d; color: #fff; }
.league-share-action:focus-visible, .share-studio a:focus-visible, .share-studio button:focus-visible { outline: 3px solid var(--studio-green); outline-offset: 3px; }
.share-studio { max-width: 820px; margin: 0 auto 2rem; color: var(--studio-text); min-width: 0; }
.share-studio *, .share-studio *::before, .share-studio *::after { box-sizing: border-box; }
.share-studio-header { margin-bottom: 1.4rem; }
.share-back { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; color: var(--studio-muted); text-decoration: none; font-size: .9rem; margin-bottom: .65rem; }
.share-back:hover, .share-full-size:hover { color: var(--studio-green); }
.share-eyebrow { display: flex; flex-wrap: wrap; gap: .55rem; font-size: .75rem; font-weight: 750; letter-spacing: .12em; color: var(--studio-green); margin-bottom: .6rem; }
.share-eyebrow span { color: var(--studio-muted); font-weight: 500; }
.share-studio h1 { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 750; letter-spacing: -.025em; line-height: 1.2; margin: 0 0 .65rem; color: var(--studio-text); }
.share-league { color: var(--studio-text); font-size: 1rem; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.share-league span { display: block; color: var(--studio-muted); font-size: .9rem; margin-top: .15rem; }
.share-segments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 5px; gap: 4px; background: var(--studio-field); border: 1px solid var(--studio-line); border-radius: 13px; margin-bottom: 1.5rem; }
.share-segment { min-height: 44px; display: flex; align-items: center; justify-content: center; padding: .55rem .25rem; border-radius: 9px; color: var(--studio-muted); text-decoration: none; font-size: .95rem; font-weight: 650; }
.share-segment:hover { background: var(--studio-bg); color: var(--studio-text); }
.share-segment.is-active { background: #17664f; color: #fff; box-shadow: 0 2px 5px #0002; }
.share-preview-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem; margin-bottom: .7rem; }
.share-preview-heading h2 { font-size: 1rem; font-weight: 650; margin: 0; color: var(--studio-text); }
.share-preview-heading > span { font-size: .85rem; color: var(--studio-muted); }
.share-preview-panel { background: var(--studio-bg); border: 1px solid var(--studio-line); border-radius: 16px; overflow: hidden; margin-bottom: 1.5rem; }
.share-panel-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; padding: .85rem 1.1rem; }
.share-panel-label { font-size: .9rem; font-weight: 650; }
.share-group-label { display: block; color: var(--studio-muted); font-size: .85rem; overflow-wrap: anywhere; }
.share-full-size { display: inline-flex; align-items: center; min-height: 44px; color: var(--studio-green); font-size: .85rem; text-underline-offset: 3px; }
.share-preview-frame { position: relative; background: var(--studio-field); padding: clamp(.5rem, 2vw, 1.25rem); min-height: 160px; }
.share-preview-image { display: block; width: 100%; max-width: 760px; height: auto; margin: auto; border-radius: 8px; }
.share-preview-image.is-loading { opacity: 0; }
.share-preview-state { position: absolute; inset: 0; margin: 0; padding: 2rem 1rem; display: grid; place-content: center; text-align: center; color: var(--studio-muted); background: var(--studio-field); z-index: 1; }
.share-preview-state[hidden] { display: none; }
.share-panel-footer { padding: 1.1rem; }
.share-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.studio-button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 46px; border: 1px solid transparent; border-radius: 10px; padding: .65rem 1rem; font: inherit; font-size: .95rem; font-weight: 650; line-height: 1.35; text-decoration: none; cursor: pointer; }
.studio-button[hidden] { display: none; }
.studio-button-primary { background: #197456; color: #fff; border-color: #2e9571; }
.studio-button-primary:hover { background: #146449; color: #fff; }
.studio-button-secondary { background: transparent; color: var(--studio-text); border-color: var(--studio-line); }
.studio-button-secondary:hover { background: var(--studio-field); color: var(--studio-green); }
.studio-button:active { transform: translateY(1px); }
.studio-button:disabled { opacity: .65; cursor: wait; }
.share-help { color: var(--studio-muted); font-size: .85rem; line-height: 1.55; margin: .85rem 0 0; }
.share-preview-heading + .share-help { margin: 0 0 .9rem; }
.share-empty { text-align: center; border: 1px dashed var(--studio-line); border-radius: 16px; padding: 2rem 1.1rem; background: var(--studio-bg); }
.share-empty > .share-icon { color: var(--studio-green); width: 28px; height: 28px; margin-bottom: 1rem; }
.share-empty h2 { font-size: 1.15rem; font-weight: 650; color: var(--studio-text); }
.share-empty p { color: var(--studio-muted); font-size: .95rem; margin: .65rem 0 1.25rem; }
@media (max-width: 575.98px) {
    .league-detail-header--share { display: grid; grid-template-columns: minmax(0, 1fr) auto; text-align: left; align-items: start; gap: .75rem; }
    .league-detail-header--share .league-detail-identity { flex-direction: row; text-align: left; align-items: flex-start; gap: .65rem; }
    .league-detail-header--share .league-detail-logo { width: 48px; height: 48px; flex: 0 0 48px; }
    .league-detail-header--share .league-detail-info h2 { font-size: 1.25rem; }
    .league-detail-header--share .league-sponsor { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; text-align: left; gap: .65rem; }
    .league-detail-header--share .league-sponsor-logo { width: auto; max-width: 4rem; height: 2rem; }
    .league-share-action { padding: .55rem .7rem; }
    .share-studio-header { margin-bottom: 1rem; }
    .share-panel-toolbar, .share-panel-footer { padding: .85rem; }
    .share-actions .studio-button { flex: 1 1 160px; }
}
@media (max-width: 359px) {
    .league-detail-header--share .league-detail-identity { flex-wrap: wrap; }
    .share-segment { font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) { .league-share-action { transition: none; } .studio-button:active { transform: none; } }
