.cast-profile-button{display:block;width:100%;background:none;border:0;padding:0;cursor:pointer;border-radius:18px}
.cast-profile-button:focus-visible{outline:3px solid var(--purple);outline-offset:4px}
.cast-profile-dialog::backdrop{background:#241726bb}
.cast-media-layout{display:grid;gap:20px;align-items:start}
.cast-media-layout [hidden]{display:none}
.cast-media-image img{width:100%;max-height:52vh;object-fit:contain;border-radius:14px}
.cast-media-text{min-width:0;overflow-wrap:anywhere}
[data-profile-message]{white-space:pre-wrap;margin-top:0}
[data-profile-link]{text-decoration:underline;color:var(--purple)}
@media(min-width:600px){.cast-media-layout.has-image{grid-template-columns:minmax(0,2fr) minmax(0,3fr)}}
[data-profile-video]{display:block;width:100%;max-height:50vh;margin-top:12px;background:#211923;border-radius:10px}

.cast-profile-dialog{width:min(92%,880px);max-height:88dvh;padding:0;border:1px solid #eadce7;border-radius:24px;background:var(--paper);color:var(--ink);box-shadow:0 28px 90px #29142955}
.cast-profile-dialog>.cast-media-layout{padding:clamp(18px,4vw,30px)}

.cast-profile-dialog .cast-media-text p:last-child{margin-bottom:0}
[data-profile-link]{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border:1px solid var(--line);border-radius:24px;text-decoration:none}
[data-profile-link]:hover{text-decoration:underline}
.cast-x-icon{flex:none}
@media(min-width:600px){.cast-media-layout.has-image.no-video .cast-media-text{align-self:center}}
/* Compact profile card with gallery controls inside the photo. */
.cast-profile-dialog{width:min(94%,760px);border-radius:20px}
.cast-profile-dialog>.cast-media-layout{padding:16px;gap:16px}
.cast-profile-dialog .cast-media-image{position:relative;min-width:0;max-width:100%;width:fit-content;justify-self:center}
.cast-profile-dialog .cast-media-image img{width:auto;height:auto;max-width:100%;max-height:min(52dvh,440px);border-radius:13px}
.cast-profile-dialog .cast-media-text{padding:4px 6px;line-height:1.7}
.cast-profile-dialog [data-profile-message]{margin:0}
.cast-profile-dialog [data-profile-link-row]{margin:10px 0 0}
.cast-profile-dialog [data-profile-link]{padding:4px 10px}
@media(min-width:600px){
  .cast-profile-dialog .cast-media-layout.has-image{grid-template-columns:auto minmax(0,1fr)}
  .cast-profile-dialog .cast-media-image img{max-width:min(36vw,320px)}
  .cast-profile-dialog .cast-media-layout.has-image.no-video{align-items:center}
}
@media(max-width:599px){
  .cast-profile-dialog>.cast-media-layout{padding:12px;gap:12px}
  .cast-profile-dialog .cast-media-image img{max-height:42dvh}
}
.cast-profile-dialog .cast-media-image{isolation:isolate}
.cast-profile-dialog .cast-image-nav{z-index:2}
.cast-media-image{position:relative}
.cast-image-nav{position:absolute;inset:0;z-index:2;pointer-events:none}
.cast-image-nav button{position:absolute;top:50%;transform:translateY(-50%);width:36px;height:36px;padding:0;border:1px solid #fff7;border-radius:50%;background:#27162999;color:white;font-size:24px;line-height:1;cursor:pointer;pointer-events:auto}
.cast-image-nav button:hover,.cast-image-nav button:focus-visible{background:#271629dd}
.cast-image-nav [data-gallery-step="-1"]{left:8px}
.cast-image-nav [data-gallery-step="1"]{right:8px}
@media(hover:hover) and (pointer:fine){
  .cast-image-nav button{opacity:0;pointer-events:none}
  .cast-media-image:hover .cast-image-nav button,.cast-image-nav button:focus-visible{opacity:1;pointer-events:auto}
}
.cast-profile-close{position:absolute;top:10px;right:10px;margin:0;z-index:3}
.cast-profile-close button{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--line);border-radius:50%;background:var(--paper);color:var(--purple);font:inherit;font-size:22px;line-height:1;cursor:pointer}
.cast-profile-dialog>.cast-media-layout{padding-top:24px}
.cast-profile-dialog .cast-media-text{margin-right:30px}
.cast-profile-name{margin:0 0 10px;color:var(--purple);font-size:clamp(23px,3vw,29px);line-height:1.35}
.cast-profile-tags{display:flex;flex-wrap:wrap;gap:6px;list-style:none;margin:12px 0 0;padding:0}
.cast-profile-tags li{padding:2px 8px;border-radius:14px;background:#f4e8f1;color:#69416a;font-size:13px;overflow-wrap:anywhere}
@media(max-width:599px){.cast-profile-dialog>.cast-media-layout{padding-top:46px}.cast-profile-dialog .cast-media-text{margin-right:0}}
.cast-profile-dialog .cast-media-image::after{content:"";position:absolute;inset:-5px;pointer-events:none;border:16px solid transparent;border-image:url("/assets/cast-photo-frame.svg") 30 stretch;z-index:1}
.cast-profile-dialog .cast-media-text{border:16px solid transparent;border-image:url("/assets/cast-text-frame.svg") 30 stretch;background:none}