/* V27.7.10.2.9 - canonical entity detail/card geometry.
   Shared rules own title sizing, action placement, relation controls/stats,
   utility controls, and Band/Venue media toolbar sizing. Page-specific CSS
   should style domain content only and must not redefine these structures. */

.rcm-detail-header{
    display:flex;
    flex-direction:column;
    gap:6px;
    width:100%;
    min-width:0;
}

.rcm-detail-title-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:8px;
    width:100%;
    min-width:0;
}


.rcm-detail-back-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:66px;
    min-height:30px;
    padding:5px 9px;
    border:1px solid #64748b;
    border-radius:8px;
    background:#172033;
    color:#fff;
    font-size:11px;
    font-weight:900;
    line-height:1;
    white-space:nowrap;
    cursor:pointer;
    touch-action:manipulation;
}
.rcm-detail-back-button:hover,.rcm-detail-back-button:active{background:#22304a;border-color:#60a5fa}

/* Deliberately more specific than the legacy .content-panel-header h1 rule. */
.content-panel-header .rcm-detail-title{
    display:block;
    width:100%;
    min-width:0;
    margin:0;
    color:#fff;
    font-size:clamp(19px,2.8vw,26px);
    font-weight:900;
    line-height:1.08;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

/* Band/Venue: one compact action line under the title. */
.rcm-detail-actions-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    width:100%;
    min-width:0;
    flex-wrap:nowrap;
}

/* Event and other pages can retain a tools-only line. */
.rcm-detail-tools-row{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    width:100%;
    min-width:0;
}

/* Shared detail utility controls. */
.detail-page-tools{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:5px;
    flex-wrap:nowrap;
    flex:0 0 auto;
    min-width:0;
}
.detail-page-tool{
    min-height:28px;
    height:28px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    padding:4px 8px;
    border:1px solid #334155;
    border-radius:8px;
    background:#172033;
    color:#fff;
    font-size:11px;
    font-weight:900;
    line-height:1;
    text-decoration:none;
    white-space:nowrap;
    box-shadow:0 2px 6px rgba(0,0,0,.22);
    cursor:pointer;
    touch-action:manipulation;
}
.detail-page-tool:hover,.detail-page-tool:active{background:#22304a;border-color:#60a5fa}
.detail-page-tool-list{background:#16a34a;border-color:#86efac;color:#fff}
.detail-page-tool-list:hover,.detail-page-tool-list:active{background:#22c55e;border-color:#bbf7d0}
.detail-page-tool-share{
    min-width:82px;
    background:#0369a1;
    border-color:#38bdf8;
    color:#fff;
    box-shadow:0 2px 8px rgba(3,105,161,.42),0 0 0 1px rgba(56,189,248,.16) inset;
}
.detail-page-tool-share:hover,.detail-page-tool-share:active{background:#075985;border-color:#7dd3fc}
.detail-page-tool-edit{background:#1d4ed8;border-color:#60a5fa}
.detail-page-tool-delete{background:#7f1d1d;border-color:#f87171}
.detail-page-share-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:18px;
    height:18px;
    border-radius:999px;
    background:#facc15;
    color:#111827;
    font-size:11px;
    font-weight:900;
    line-height:1;
}

/* Shared Like / Follow geometry. The combined form is still used on Fan pages. */
.rcm-detail-relations{
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    gap:8px;
    width:100%;
    min-width:0;
}

/* Band/Venue use buttons-only in the header; counts move to the media toolbar. */
.rcm-detail-relations.rcm-detail-relations--buttons-only{
    display:block;
    width:auto;
    flex:0 0 auto;
}

.rcm-detail-relation-buttons{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:5px;
    flex-wrap:nowrap;
    min-width:0;
}

.rcm-detail-relation-button{
    display:inline-flex;
    align-items:center;
    gap:4px;
    min-height:28px;
    height:28px;
    padding:3px 7px;
    border:1px solid #475569;
    border-radius:8px;
    background:#162033;
    color:#dbeafe;
    font-size:10px;
    font-weight:900;
    line-height:1;
    white-space:nowrap;
    cursor:pointer;
    touch-action:manipulation;
}
.rcm-detail-relation-button:hover{background:#1d2a40;border-color:#64748b}
.rcm-detail-relation-button.is-like.is-active{border-color:#ef4444;background:#3a1720;color:#fecaca}
.rcm-detail-relation-button.is-follow.is-active{border-color:#f59e0b;background:#3a2a0d;color:#fde68a}
.rcm-detail-relation-button:disabled{opacity:.48;cursor:not-allowed}
.rcm-detail-relation-callout[hidden]{display:none!important}

.rcm-detail-relation-stats{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    width:auto;
    min-width:0;
    justify-self:end;
    color:#94a3b8;
    font-size:9px;
    font-weight:800;
    white-space:nowrap;
}
.rcm-detail-relation-stats strong{
    color:#dbeafe;
    font-size:12px;
}

/* Counts occupy the previously empty left side of the media/frame toolbar. */
.rcm-detail-media-toolbar{
    width:100%;
    min-height:28px;
    margin:0 0 6px;
    padding:0 2px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
}
.rcm-detail-media-toolbar .rcm-detail-relation-stats{
    justify-content:flex-start;
    justify-self:auto;
    flex:0 1 auto;
}
.rcm-detail-frame-controls{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:5px;
    margin-left:auto;
    flex:0 0 auto;
}

/* Artist detail keeps its legacy POST forms but follows the same visual sizing. */
.rcm-legacy-detail-relation-row{
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    gap:8px;
    width:100%;
    min-width:0;
}
.rcm-legacy-detail-buttons{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:5px;
    min-width:0;
}
.rcm-legacy-detail-stats{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    min-width:0;
    color:#94a3b8;
    font-size:9px;
    font-weight:800;
    white-space:nowrap;
}
.rcm-legacy-detail-stats strong{color:#dbeafe;font-size:12px}
.rcm-legacy-detail-action{
    height:28px;
    min-height:28px;
    padding:3px 7px;
    border:0;
    border-radius:8px;
    color:#fff;
    font-size:10px;
    line-height:1;
    font-weight:900;
    cursor:pointer;
    box-shadow:0 2px 6px rgba(0,0,0,.25);
    white-space:nowrap;
}


/* Vertical-pan priority zone for detail-card bodies.
   V27.7.10.4.6.3: real phone hardware showed that the horizontal tab-swipe
   recognizer could win a gesture when a vertical swipe began with a little
   sideways drift. The body can opt into this shared contract so native
   vertical scrolling owns gestures that start inside entity content. */
.rcm-detail-vertical-pan-zone{
    touch-action:pan-y!important;
    -webkit-overflow-scrolling:touch;
}

/* Shared vertical-pan contract for large interactive media on detail cards.
   Interactive media may still respond to taps, but vertical movement belongs
   to the containing detail card so iOS/Android scrolling stays fluid. */
.rcm-detail-pan-surface{
    touch-action:pan-y!important;
    -webkit-tap-highlight-color:transparent;
}
.rcm-detail-pan-media{
    pointer-events:none!important;
    user-select:none!important;
    -webkit-user-select:none!important;
    -webkit-user-drag:none!important;
}

/* One canonical Band/Venue media stage size. */
.band-scaled-frame-shell,
.venue-scaled-frame-shell,
.band-default-image-card > img,
.venue-card-image-stage{
    height:clamp(220px,38vh,390px)!important;
    min-height:220px!important;
    max-height:390px!important;
}


/* Full detail cards own vertical scrolling. This lived in app_header.css before
   V27.7.10.5; keeping it here prevents header/layout CSS from owning entity
   behavior and gives V27.7.11 one canonical detail layer. */
.rcm-entity-detail-card{
    max-height:calc(100dvh - 205px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:thin!important;
    touch-action:pan-y!important;
}
.rcm-entity-detail-card .event-detail-scroll-box,
.rcm-entity-detail-card .band-detail-scroll-box,
.rcm-entity-detail-card .venue-detail-scroll-box,
.rcm-entity-detail-card .person-profile-scroll-box,
.rcm-entity-detail-card .my-profile-scroll-box,
.rcm-entity-detail-card .musician-profile-container{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:visible!important;
    overflow-x:visible!important;
    overscroll-behavior:auto!important;
}

/* Shared domain-detail primitives. Band/Venue keep their legacy class names as
   compatibility hooks, but common geometry is owned here. */
.rcm-detail-scroll-region{
    overflow-y:auto;
    overscroll-behavior:contain;
    scrollbar-width:thin;
}
.rcm-detail-scroll-content{padding:4px 2px 20px}
.rcm-detail-section-card{
    background:#0f172a;
    border:1px solid #334155;
    border-radius:14px;
    margin:0 0 14px;
    padding:12px;
}
.rcm-detail-frame-control{
    min-width:30px;
    height:28px;
    padding:0 8px;
    border:1px solid #475569;
    border-radius:7px;
    background:#172033;
    color:#dbeafe;
    font-size:12px;
    font-weight:900;
    cursor:pointer;
}
.rcm-detail-frame-fit{min-width:42px}
.rcm-detail-frame-scale{min-width:42px;text-align:right;color:#94a3b8;font-size:10px;font-weight:800}
.rcm-detail-frame-shell{width:100%;overflow:hidden;border-radius:10px;background:#fff;position:relative}
.rcm-detail-scalable-frame{display:block;border:0;background:#fff;transform-origin:top left}
.rcm-detail-frame-fallback-note{margin-top:8px;color:#94a3b8;font-size:11px}
.rcm-detail-section-title{margin:0 0 9px;font-size:19px}

.rcm-detail-link-frame-list{display:grid;grid-template-columns:1fr;gap:7px}
.rcm-detail-link-frame-card{border:1px solid #334155;border-radius:10px;background:#0b1220;overflow:hidden}
.rcm-detail-link-toggle{display:grid;grid-template-columns:minmax(0,1fr) auto 20px;align-items:center;gap:8px;width:100%;min-height:42px;padding:8px 11px;border:0;background:#111b2e;color:#dbeafe;text-align:left;cursor:pointer;touch-action:manipulation}
.rcm-detail-link-toggle:hover,.rcm-detail-link-toggle:focus-visible{background:#17243a;outline:none}
.rcm-detail-link-toggle-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:900}
.rcm-detail-link-toggle-type{color:#94a3b8;font-size:10px;font-weight:800;text-transform:uppercase}
.rcm-detail-link-toggle-arrow{font-size:16px;text-align:center;transition:transform .12s ease}
.rcm-detail-link-frame-card.is-open .rcm-detail-link-toggle-arrow{transform:rotate(90deg)}
.rcm-detail-link-frame-body{padding:9px;border-top:1px solid #263244}
.rcm-detail-link-frame-body[hidden]{display:none}
.rcm-detail-link-status{min-height:0;color:#94a3b8;font-size:11px;font-weight:700}
.rcm-detail-link-status:not(:empty){padding:3px 2px 8px}
.rcm-detail-link-frame-shell{width:100%;height:clamp(260px,48vh,520px);display:flex;align-items:flex-start;justify-content:flex-start;overflow:hidden;border:1px solid #334155;border-radius:9px;background:#05070d;position:relative}
.rcm-detail-link-frame-shell[hidden]{display:none}
.rcm-detail-link-frame-shell.is-video-player{height:auto;aspect-ratio:16/9;align-items:stretch}
.rcm-detail-link-inline-frame{display:block;width:100%;height:100%;border:0;background:#fff}
.rcm-detail-link-frame-shell.is-scaled-website .rcm-detail-link-inline-frame{transform-origin:top left}
.rcm-detail-link-frame-shell.is-spotify-player{height:auto;display:block;overflow:hidden;border:0;border-radius:12px;background:transparent;position:relative}
.rcm-detail-link-inline-frame.rcm-spotify-player-frame{display:block;width:600px;height:352px;border:0;border-radius:12px;background:transparent;transform-origin:top left}
.rcm-detail-link-fallback{padding:10px;border:1px dashed #475569;border-radius:8px;background:#0f172a}
.rcm-detail-link-fallback[hidden]{display:none}
.rcm-detail-link-fallback-note{color:#cbd5e1;font-size:12px;font-weight:700}
.rcm-detail-link-open-button{display:inline-flex;align-items:center;justify-content:center;margin-top:8px;min-height:34px;padding:6px 12px;border:1px solid #60a5fa;border-radius:8px;background:#1d4ed8;color:#fff;font-size:12px;font-weight:900;text-decoration:none;touch-action:manipulation}
.rcm-detail-link-open-button[hidden]{display:none}
.rcm-detail-link-open-button.is-centered{margin:2px 0 0;min-width:150px;box-shadow:0 3px 12px rgba(0,0,0,.35)}
.rcm-detail-link-open-button.is-link-only{width:auto;max-width:100%}


@media(max-width:600px){
    .rcm-entity-detail-card{
        max-height:calc(100dvh - 188px)!important;
        padding:12px!important;
    }
    .rcm-detail-section-card{padding:9px;margin-bottom:10px;border-radius:11px}
    .rcm-detail-frame-control{height:25px;min-width:27px;padding:0 7px;font-size:11px}
    .rcm-detail-frame-fit{min-width:39px}
    .rcm-detail-section-title{font-size:17px}
    .rcm-detail-header{gap:5px}
    .content-panel-header .rcm-detail-title{font-size:20px}
    .rcm-detail-actions-row{gap:6px}
    .detail-page-tools{gap:4px}
    .detail-page-tool{min-height:27px;height:27px;padding:3px 7px;font-size:10px}
    .detail-page-tool-share{min-width:78px;padding-left:8px;padding-right:8px;font-size:11px}
    .detail-page-share-icon{width:18px;height:18px;font-size:11px}
    .rcm-detail-relation-buttons{gap:4px}
    .rcm-detail-relation-button,
    .rcm-legacy-detail-action{height:27px;min-height:27px;padding:3px 6px;font-size:9px}
    .rcm-detail-relation-stats,
    .rcm-legacy-detail-stats{gap:6px;font-size:8px}
    .rcm-detail-relation-stats strong,
    .rcm-legacy-detail-stats strong{font-size:11px}
    .rcm-detail-media-toolbar{min-height:27px;margin-bottom:5px;padding:0 1px}
    .band-scaled-frame-shell,
    .venue-scaled-frame-shell,
    .band-default-image-card > img,
    .venue-card-image-stage{
        height:38vh!important;
        min-height:210px!important;
        max-height:360px!important;
    }
}

@media(max-width:350px){
    .rcm-detail-actions-row{flex-wrap:wrap}
    .detail-page-tools{margin-left:auto}
}

/* V27.7.10.5.11 Fan detail action parity. */
.rcm-fan-detail-action-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-width:0;margin-bottom:6px}
.rcm-fan-detail-action-left{flex:1 1 auto;min-width:0}
.rcm-fan-detail-action-right{flex:0 0 auto;margin-left:auto}
.rcm-fan-detail-action-right .detail-page-tools{justify-content:flex-end}
.rcm-my-fan-profile-button{display:inline-flex;text-decoration:none;background:#1976d2;border-color:#3b82f6;color:#fff}
.my-fan-detail-card{touch-action:pan-y}
@media(max-width:600px){.rcm-fan-detail-action-row{gap:5px}.rcm-my-fan-profile-button{font-size:11px;padding-left:8px;padding-right:8px}}
