.dw-guide-open,
.dw-guide-open *,
.dw-availability-modal,
.dw-availability-modal * { box-sizing: border-box; }

.dw-guide-open {
    width: auto; min-height: 44px; margin: 0 0 0 auto; padding: .55rem .72rem;
    display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: .65rem;
    border: 1px solid #ebc2c0; border-radius: 12px; background: linear-gradient(135deg, #fff8f7, #fff);
    color: #202c3e; text-align: left; font: inherit; cursor: pointer;
    box-shadow: 0 6px 18px rgba(28, 38, 54, .05);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.dw-guide-open:hover,.dw-guide-open:focus-visible { border-color: #cf3a35; transform: translateY(-1px); box-shadow: 0 9px 23px rgba(28, 38, 54, .09); }
.dw-guide-open > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #cf3a35; color: #fff; font-size: .62rem; }
.dw-guide-open strong { max-width: 235px; font-size: .72rem; line-height: 1.2; }
.dw-guide-open b { color: #cf3a35; font-size: 1rem; }

body.dw-modal-open { overflow: hidden; }
.dw-availability-modal[hidden] { display: none; }
.dw-availability-modal { position: fixed; z-index: 2147483000; inset: 0; display: grid; place-items: center; padding: 24px; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.dw-availability-backdrop { position: absolute; inset: 0; background: rgba(13, 22, 36, .72); backdrop-filter: blur(6px); }
.dw-availability-dialog { position: relative; width: min(780px, 100%); max-height: min(780px, calc(100vh - 48px)); overflow: auto; scrollbar-width: thin; scrollbar-color: #a8b3c2 transparent; scrollbar-gutter: stable; border: 1px solid rgba(255, 255, 255, .7); border-radius: 24px; background: #fff; color: #1c2636; box-shadow: 0 30px 90px rgba(8, 16, 29, .35); }
.dw-availability-dialog::-webkit-scrollbar { width: 10px; }
.dw-availability-dialog::-webkit-scrollbar-track { margin: 16px 0; background: transparent; }
.dw-availability-dialog::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: #a8b3c2; background-clip: padding-box; }
.dw-availability-dialog::-webkit-scrollbar-thumb:hover { background: #7e8b9d; background-clip: padding-box; }
.dw-availability-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.45rem 1rem; border-bottom: 1px solid #e7ebf1; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); }
.dw-availability-header p { margin: 0 0 .32rem; color: #cf3a35; font-size: .65rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.dw-availability-header h2 { margin: 0; color: #1c2636; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.05; letter-spacing: -.035em; }
.dw-availability-close { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 1px solid #dce2eb; border-radius: 50%; background: #f7f9fb; color: #1c2636; font: inherit; font-size: 1.45rem; cursor: pointer; }

.dw-availability-movie { min-height: 142px; display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 1rem; padding: 1.15rem 1.45rem; background: #f7f9fc; }
.dw-availability-movie > img,.dw-modal-poster-placeholder { width: 82px; height: 112px; border-radius: 9px; object-fit: cover; background: #dfe5ed; }
.dw-modal-poster-placeholder { display: grid; place-items: center; color: #64748b; font-weight: 900; }
.dw-modal-movie-copy { min-width: 0; }
.dw-modal-movie-copy > strong { display: block; overflow: hidden; color: #1c2636; font-size: 1.12rem; line-height: 1.18; text-overflow: ellipsis; }
.dw-modal-movie-year { display: block; margin-top: .22rem; color: #cf3a35; font-size: .7rem; font-weight: 850; }
.dw-modal-movie-copy dl { margin: .58rem 0 0; display: grid; gap: .27rem; }
.dw-modal-movie-copy dl > div { min-width: 0; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: .45rem; }
.dw-modal-movie-copy dt { color: #8792a4; font-size: .62rem; font-weight: 850; }
.dw-modal-movie-copy dd { min-width: 0; margin: 0; overflow: hidden; color: #46546a; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.dw-modal-rating { display: inline-flex; align-items: center; gap: .38rem; max-width: 100%; vertical-align: middle; }
.dw-modal-stars { position: relative; display: inline-block; color: #d5dce6; font-size: .82rem; line-height: 1; letter-spacing: .045em; white-space: nowrap; }
.dw-modal-stars::after { position: absolute; inset: 0 auto 0 0; width: var(--dw-rating, 0%); overflow: hidden; color: #f0ad24; content: "★★★★★"; white-space: nowrap; }
.dw-modal-rating small { color: #66748a; font-size: .6rem; font-weight: 800; }

.dw-country-tabs { display: flex; gap: .45rem; overflow-x: auto; padding: 1rem 1.45rem .7rem; scrollbar-width: thin; }
.dw-country-tabs button { min-height: 38px; flex: 0 0 auto; padding: 0 .82rem; border: 1px solid #dce2eb; border-radius: 999px; background: #fff; color: #64748b; font: inherit; font-size: .68rem; font-weight: 800; cursor: pointer; }
.dw-country-tabs button.is-active { border-color: #1c2636; background: #1c2636; color: #fff; }

.dw-availability-result { min-height: 190px; padding: .75rem 1.45rem 1.45rem; }
.dw-modal-result-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.dw-modal-result-heading strong { font-size: .88rem; }
.dw-modal-result-heading small { color: #7a8698; font-size: .62rem; }
.dw-modal-provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.dw-modal-provider { min-width: 0; min-height: 58px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: .65rem; padding: .6rem .7rem; border: 1px solid #dfe5ed; border-radius: 12px; background: #fff; color: #344256; text-decoration: none; }
.dw-modal-provider.is-linked { border-color: #efc3c1; background: #fff9f8; }
.dw-modal-provider.is-linked:hover { border-color: #cf3a35; }
.dw-modal-provider.is-linked.is-prime { order: -1; border-color: #9fd4e8; background: linear-gradient(135deg, #e8f7fd, #f8fdff); box-shadow: 0 5px 16px rgba(20, 116, 153, .11); }
.dw-modal-provider.is-linked.is-prime:hover { border-color: #48add3; box-shadow: 0 8px 21px rgba(20, 116, 153, .18); }
.dw-modal-provider.is-linked.is-prime b { color: #1687b5; }
.dw-modal-provider img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.dw-modal-provider > span { min-width: 0; }
.dw-modal-provider strong,.dw-modal-provider small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-modal-provider strong { color: #263348; font-size: .71rem; }
.dw-modal-provider small { margin-top: .12rem; color: #7a8698; font-size: .6rem; }
.dw-modal-provider b { color: #cf3a35; }
.dw-modal-link-note { margin: .85rem 0 0; color: #7a8698; font-size: .61rem; line-height: 1.45; }

.dw-modal-loading,.dw-modal-empty { min-height: 145px; display: grid; place-content: center; justify-items: center; padding: 1rem; text-align: center; }
.dw-modal-loading span { width: 30px; height: 30px; margin-bottom: .7rem; border: 3px solid #e4e8ee; border-top-color: #cf3a35; border-radius: 50%; animation: dw-spin .8s linear infinite; }
.dw-modal-loading strong,.dw-modal-empty strong { color: #263348; font-size: .82rem; }
.dw-modal-empty span { max-width: 420px; margin-top: .4rem; color: #7a8698; font-size: .7rem; line-height: 1.5; }
.dw-modal-empty button { margin-top: .8rem; padding: .6rem .9rem; border: 0; border-radius: 8px; background: #cf3a35; color: #fff; font: inherit; font-size: .7rem; font-weight: 850; cursor: pointer; }
@keyframes dw-spin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
    .guide-movie-actions .dw-guide-open { width: 100%; margin-left: 0; }
    .dw-availability-modal { align-items: end; width: 100vw; height: 100dvh; padding: 0; }
    .dw-availability-dialog { width: 100%; max-width: none; max-height: 96dvh; border: 0; border-radius: 20px 20px 0 0; overscroll-behavior: contain; }
    .dw-availability-header { padding: 1rem; }
    .dw-availability-header h2 { max-width: 285px; font-size: 1.32rem; }
    .dw-availability-close { width: 36px; height: 36px; flex-basis: 36px; }
    .dw-availability-movie { min-height: 124px; grid-template-columns: 68px minmax(0, 1fr); gap: .8rem; padding: .85rem 1rem; }
    .dw-availability-movie > img,.dw-modal-poster-placeholder { width: 68px; height: 96px; }
    .dw-modal-movie-copy dl > div { grid-template-columns: 66px minmax(0, 1fr); }
    .dw-country-tabs { padding: .85rem 1rem .55rem; }
    .dw-availability-result { padding: .65rem 1rem 1.2rem; }
    .dw-modal-result-heading { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .dw-modal-provider-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
    .dw-availability-header h2 { max-width: 245px; font-size: 1.16rem; }
    .dw-availability-movie { grid-template-columns: 58px minmax(0, 1fr); }
    .dw-availability-movie > img,.dw-modal-poster-placeholder { width: 58px; height: 84px; }
    .dw-modal-movie-copy > strong { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .dw-guide-open { transition: none; } }

/* Controlled editorial pilot; the existing private-guide layout is unchanged. */
.metadata-block .dw-review-open { width: 100%; margin: 20px 0 0; }
.metadata-block .dw-review-open strong { max-width: none; }
.guide-movie-actions.dw-pilot-actions { justify-content: flex-end; gap: .75rem; }
.guide-movie-actions.dw-pilot-actions > .guide-movie-affiliate { flex: 0 1 auto; }
.guide-movie-actions.dw-pilot-actions > .dw-guide-open { flex: 0 0 auto; margin-left: 0; }
@media (min-width: 701px) { .guide-movie-actions.dw-pilot-actions { flex-wrap: wrap; } }
.dw-availability-pilot .dw-modal-provider > span { grid-column: 2; }
.dw-availability-pilot .dw-country-note,.dw-availability-pilot .dw-modal-attribution { margin: 0; padding: .3rem 1.45rem .8rem; color: #68758a; font-size: .7rem; line-height: 1.5; }
.dw-availability-pilot .dw-modal-attribution { text-align: right; font-size: .625rem; padding-top: 0; }
.dw-availability-pilot .dw-modal-attribution a,.dw-availability-pilot .dw-modal-link-note a { color: #46566e; text-decoration: underline; text-underline-offset: 2px; }
@media(max-width:620px) { .metadata-block .dw-review-open { width: 100%; }.dw-availability-pilot .dw-country-note,.dw-availability-pilot .dw-modal-attribution { padding-left: 1rem; padding-right: 1rem; } }
