/* ==========================
   MELODY FLAG
========================== */

.melody_flag-back{display:block;align-self:flex-start;width:max-content;margin:10px 0 10px 15px;color:var(--theme-text-muted);font-size:13px;font-weight:bold;text-decoration:none}

.melody_flag-back:hover{color:var(--theme-primary)}

.melody_flag-container{width:100%;max-width:1348px;margin:0;padding:6px 16px 40px;box-sizing:border-box}

.melody_flag-card-actions a,.melody_flag-action-button,.listen-toggle,.melody_flag-listen-button,.melody_flag-detail-links a,.melody_flag-detail-link-button,.melody_flag-favorite-button{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:7px 11px;box-sizing:border-box;border:0;border-radius:18px;background:#f5f5f5;color:var(--theme-text-sub);font:inherit;font-size:14px;font-weight:bold;text-decoration:none}

.melody_flag-link-youtube{background:var(--theme-border-soft)!important}

.melody_flag-afterword-button,.melody_flag-detail-link-button{background:#e8f3ff;cursor:pointer}




.melody_flag-detail-card,.melody_flag-detail-section{margin:0 0 12px;padding:18px;border-radius:18px;background:#fff;box-shadow:0 3px 8px rgba(0,0,0,.08)}

.melody_flag-detail-number{color:var(--theme-text);font-size:26px;font-weight:bold;line-height:1.4}

.melody_flag-detail-date{margin-top:6px;color:var(--theme-text-sub);font-size:15px}

.melody_flag-detail-time{margin-top:4px;color:var(--theme-text-muted);font-size:14px}

.melody_flag-detail-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:15px}

.melody_flag-detail-links a,.melody_flag-detail-link-button{background:#f5f5f5}

.melody_flag-detail-links .melody_flag-link-youtube{background:var(--theme-border-soft)!important}

.melody_flag-record-actions{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    margin-top:12px;
}
.melody_flag-record-actions form{
    min-width:0;
    margin:0;
}
.melody_flag-record-button{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-height:40px;
    padding:8px 10px;
    box-sizing:border-box;
    border:1px solid #e5e5e5;
    border-radius:20px;
    background:#f8f8f8;
    color:var(--theme-text-sub);
    font:inherit;
    font-size:13px;
    font-weight:bold;
    line-height:1.25;
    text-align:center;
    cursor:pointer;
    transition:background .15s ease,border-color .15s ease,color .15s ease,transform .1s ease;
}
.melody_flag-record-button:hover{
    transform:translateY(-1px);
}
.melody_flag-record-button:active{
    transform:translateY(0);
}
.melody_flag-listen-button{
    margin-top:0;
    border-color:var(--theme-primary);
    background:var(--theme-blush);
    color:var(--theme-primary);
}
.melody_flag-listen-button.is-selected{
    border-color:var(--theme-primary);
    background:var(--theme-primary);
    color:#fff;
}
.melody_flag-letter-toggle{
    margin-top:0;
    border-color:#e5b7c7;
    background:#fff8fb;
    color:#c56a89;
}
.melody_flag-letter-toggle.is-selected{
    border-color:#e5b7c7;
    background:var(--theme-blush);
    color:#c56a89;
}
.melody_flag-best-flag-toggle{
    margin-top:0;
    border-color:#e8d49b;
    background:#fffdf3;
    color:#9d7b2b;
}
.melody_flag-best-flag-toggle.is-selected{
    border-color:#e8c77b;
    background:#fff3c9;
    color:#9a7216;
}
.melody_flag-record-button:disabled{
    opacity:.5;
    cursor:default;
    transform:none;
}
.melody_flag-detail-favorite-button{
    color:var(--theme-primary)!important;
    cursor:pointer;
}
.melody_flag-detail-favorite-button.is-favorite{
    background:var(--theme-blush)!important;
}

.melody_flag-description{margin:15px 0 0;color:var(--theme-text-sub);font-size:14px;line-height:1.8;white-space:pre-wrap}

.melody_flag-detail-section h2{margin:0 0 10px;color:var(--theme-text-sub);font-size:17px}

.melody_flag-detail-section ul,.melody_flag-detail-section ol{margin:0;padding-left:22px}

.melody_flag-detail-section li{padding:5px 0;color:var(--theme-text-sub);font-size:14px;line-height:1.6}

.melody_flag-detail-section li span{display:block;color:var(--theme-text-muted);font-size:13px}

@media(min-width:601px){
.melody_flag-container{padding:0 30px 40px}
}

@media(max-width:600px){
.melody_flag-back{margin-left:12px}
.melody_flag-container{padding:6px 16px 40px}
.melody_flag-detail-card,.melody_flag-detail-section{padding:17px}
}

.melody_flag-detail-youtube-description{
    display:flex;
    flex:1 1 230px;
    flex-direction:column;
    width:100%;
    min-height:230px;
    max-height:none;
    margin-top:14px;
    padding:13px 14px;
    box-sizing:border-box;
    border:1px solid var(--theme-border-soft);
    border-radius:10px;
    background:var(--theme-blush);
    overflow:hidden;
}

.melody_flag-detail-youtube-description .melody_flag-youtube-description{
    flex:1 1 auto;
    min-height:0;
    max-height:none;
    margin-top:4px;
    overflow-y:auto;
    color:var(--theme-text-sub);
    font-size:14px;
    line-height:1.75;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    scrollbar-width:none;
}

.melody_flag-detail-youtube-description .melody_flag-youtube-description::-webkit-scrollbar{
    display:none;
}

.melody_flag-detail-youtube-description .melody_flag-youtube-description.is-loading{
    color:var(--theme-text-muted);
}

.melody_flag-detail-youtube-description .melody_flag-youtube-description.is-error{
    color:var(--theme-text-muted);
}

@media(max-width:600px){
    .melody_flag-detail-youtube-description{
        flex:0 0 190px;
        height:190px;
        min-height:190px;
        max-height:190px;
        padding:12px 13px;
    }

    .melody_flag-detail-youtube-description .melody_flag-youtube-description{
        font-size:12px;
        line-height:1.65;
    }
}


.melody_flag-detail-main{
    min-width:0;
    display:flex;
    flex-direction:column;
}

.melody_flag-detail-main > .melody_flag-detail-card{
    display:flex;
    flex:1 1 auto;
    flex-direction:column;
    min-height:0;
}

.melody_flag-detail-main > .melody_flag-detail-section{
    flex:0 0 auto;
}

.melody_flag-detail-side{
    min-width:0;
    align-self:stretch;
}

.melody_flag-detail-side-card{
    display:flex;
    flex-direction:column;
    padding:16px;
    box-sizing:border-box;
    border-radius:18px;
    background:#fff;
    box-shadow:0 3px 8px rgba(0,0,0,.08);
}

.melody_flag-detail-side-card h2{
    margin:0 0 12px;
    color:var(--theme-text-sub);
    font-size:16px;
}

.melody_flag-detail-nearby{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.melody_flag-detail-nearby a{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    min-height:38px;
    padding:6px 9px;
    box-sizing:border-box;
    border-radius:8px;
    color:var(--theme-text-sub);
    text-decoration:none;
    font-size:13px;
}

.melody_flag-detail-nearby a:hover{
    background:#fff2f6;
    color:var(--theme-primary);
}

.melody_flag-detail-nearby a.is-current{
    background:var(--theme-primary);
    color:#fff;
    font-weight:bold;
}

.melody_flag-detail-nearby small{
    color:var(--theme-text-muted);
    font-size:11px;
}

.melody_flag-detail-nearby a.is-current small{
    color:#fff;
    opacity:.9;
}

.melody_flag-detail-side-divider{
    flex:0 0 auto;
    height:1px;
    margin:14px 0;
    background:#f0f0f0;
}

.melody_flag-detail-youtube-title{
    position:relative;
    display:flex;
    flex-direction:column;
    gap:5px;
    padding:11px 12px;
    border-radius:11px;
    background:#fff3f7;
    color:var(--theme-text-sub);
    text-decoration:none;
}

.melody_flag-detail-youtube-thumbnail{
    display:block;
    width:100%;
    aspect-ratio:16 / 9;
    border-radius:8px;
    background:var(--theme-border-soft);
    object-fit:cover;
}

.melody_flag-detail-youtube-title .melody_flag-youtube-duration{
    position:static;
    align-self:flex-end;
    padding:2px 5px;
    border-radius:4px;
    background:rgba(0,0,0,.78);
    color:#fff;
    font-size:11px;
    font-weight:700;
    line-height:1.35;
}

.melody_flag-detail-youtube-title:hover{
    background:#ffe8f0;
}

.melody_flag-youtube-stats{margin:6px 0 0;color:var(--theme-text-muted);font-size:12px;line-height:1.5}

.melody_flag-detail-youtube-title span{
    color:var(--theme-primary);
    font-size:12px;
    font-weight:bold;
}

.melody_flag-detail-youtube-title strong{
    font-size:14px;
    line-height:1.55;
    overflow-wrap:anywhere;
}

.melody_flag-detail-related-group + .melody_flag-detail-related-group{
    margin-top:12px;
    padding-top:12px;
    border-top:1px solid #f0f0f0;
}

.melody_flag-detail-related-group h3{
    margin:0 0 6px;
    color:var(--theme-text-muted);
    font-size:13px;
    line-height:1.4;
}

.melody_flag-detail-related-broadcasts{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.melody_flag-detail-related-broadcast{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    min-height:30px;
    padding:5px 8px;
    box-sizing:border-box;
    border-radius:8px;
    background:#fafafa;
    color:var(--theme-text-sub);
    text-decoration:none;
    font-size:13px;
}

.melody_flag-detail-related-broadcast:hover{
    background:#fff2f6;
    color:var(--theme-primary);
}

.melody_flag-detail-related-broadcast small{
    color:var(--theme-text-muted);
    font-size:11px;
}

@media(min-width:900px){
    .melody_flag-detail-container{
        width:100%;
        max-width:none;
        margin:0;
        padding:20px 30px 40px;
        box-sizing:border-box;
        display:grid;
        grid-template-columns:minmax(0,1fr) minmax(420px,40%);
        gap:18px;
        align-items:stretch;
    }

    .melody_flag-detail-side{
        position:sticky;
        top:15px;
    }
}

@media(max-width:899px){
    .melody_flag-detail-side{
        display:none;
    }
}

@media(max-width:600px){
    .melody_flag-record-actions{
        gap:6px;
    }

    .melody_flag-record-button{
        min-height:38px;
        padding:7px 5px;
        font-size:12px;
        border-radius:19px;
    }
}


/* 放送詳細：コーナー名の横に初登場マーク、下にお便り採用者 */
.melody_flag-letter-section{display:flex;flex-direction:column;gap:12px}
.melody_flag-letter-group{min-width:0;padding:12px 14px;border:1px solid rgba(220,110,155,.18);border-radius:12px;background:rgba(255,248,251,.72)}
.melody_flag-corner-name h3{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:0 0 8px;font-size:14px;font-weight:700;color:var(--theme-heading);overflow-wrap:anywhere}
.melody_flag-corner-first-badge{display:inline-flex;align-items:center;padding:3px 7px;border-radius:999px;background:#ffe4ef;color:var(--theme-heading);font-size:10px;font-weight:700;white-space:nowrap}
.melody_flag-corner-adopters{min-width:0;margin-top:10px}
.melody_flag-corner-adopters h4{margin:0 0 7px;font-size:12px;font-weight:700;color:var(--theme-heading)}
.melody_flag-letter-list{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}
.melody_flag-letter-list li{padding:7px 10px;border-radius:8px;background:#fff;font-size:13px;overflow-wrap:anywhere}
.melody_flag-letter-award{margin-right:5px}
.melody_flag-letter-empty,.melody_flag-letter-note{margin:0;color:var(--theme-text-muted);font-size:12px;overflow-wrap:anywhere}
.melody_flag-corner-name .melody_flag-letter-note{margin-top:6px}
@media(max-width:600px){.melody_flag-letter-group{padding:10px}.melody_flag-letter-list li{padding:8px;font-size:13px}}


/* 放送後旗：別タブではなく画面内ポップアップで表示 */
body.melody_flag-modal-open{overflow:hidden}
.melody_flag-afterword-modal[hidden]{display:none!important}
.melody_flag-afterword-modal{position:fixed;inset:0;z-index:12000;display:flex;align-items:center;justify-content:center;padding:20px}
.melody_flag-afterword-backdrop{position:absolute;inset:0;background:rgba(30,20,35,.62);backdrop-filter:blur(3px)}
.melody_flag-afterword-dialog{position:relative;display:flex;flex-direction:column;width:min(960px,96vw);height:min(820px,90vh);background:#fff;border-radius:16px;box-shadow:0 18px 60px rgba(0,0,0,.3);overflow:hidden}
.melody_flag-afterword-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;border-bottom:1px solid var(--theme-border-soft)}
.melody_flag-afterword-header h2{margin:0;font-size:16px;color:var(--theme-heading);overflow-wrap:anywhere}
.melody_flag-afterword-close{flex:0 0 auto;width:36px;height:36px;border:0;border-radius:50%;background:var(--theme-blush);color:var(--theme-heading);font-size:26px;line-height:1;cursor:pointer}
.melody_flag-afterword-frame-wrap{flex:1;min-height:0;background:#fff}
.melody_flag-afterword-frame-wrap iframe{display:block;width:100%;height:100%;border:0}
.melody_flag-afterword-footer{display:flex;justify-content:flex-end;padding:10px 16px;border-top:1px solid var(--theme-border-soft)}
.melody_flag-afterword-open-original{padding:8px 12px;border-radius:999px;background:var(--theme-blush);color:var(--theme-heading);text-decoration:none;font-size:12px}
@media(max-width:600px){.melody_flag-afterword-modal{padding:8px}.melody_flag-afterword-dialog{width:100%;height:92vh;border-radius:12px}.melody_flag-afterword-header{padding:10px 12px}.melody_flag-afterword-header h2{font-size:14px}}

.melody_flag-afterword-content{flex:1;min-height:0;overflow:auto;padding:18px;background:#fff}
.melody_flag-afterword-content[hidden]{display:none!important}
.melody_flag-afterword-external-note{margin:0 auto 14px;max-width:620px;padding:12px 14px;border-radius:10px;background:var(--theme-blush);color:var(--theme-text-sub);font-size:13px;line-height:1.7}
.melody_flag-afterword-content .twitter-tweet{margin:12px auto!important}


/* 放送詳細レイアウト調整 */
.melody_flag-letter-list .melody_flag-letter-award{
    display:inline!important;
    margin:0 5px 0 0;
    color:inherit;
    font-size:inherit;
    line-height:inherit;
    vertical-align:baseline;
}
.melody_flag-detail-side-songs h2{
    margin:0 0 8px;
}
.melody_flag-detail-side-songs ol{
    margin:0;
    padding-left:22px;
}
.melody_flag-detail-side-songs li{
    padding:3px 0;
    color:var(--theme-text-sub);
    font-size:13px;
    line-height:1.5;
    overflow-wrap:anywhere;
}
.melody_flag-detail-side-songs p{
    margin:0;
    color:var(--theme-text-muted);
    font-size:12px;
}
@media(min-width:900px){
    .melody_flag-detail-side{
        position:static;
        display:flex;
        min-height:100%;
    }
    .melody_flag-detail-side-card{
        width:100%;
        min-height:100%;
        height:100%;
    }
}


/* OA曲と放送検索は独立カード。スマホでもOA曲を表示する */
.melody_flag-detail-side{
    display:flex;
    flex-direction:column;
    gap:12px;
    min-width:0;
    align-self:stretch;
}
.melody_flag-detail-side-card{
    width:100%;
    box-sizing:border-box;
    min-width:0;
}
.melody_flag-detail-songs-card ol{
    margin:0;
    padding-left:22px;
}
.melody_flag-detail-songs-card li{
    padding:3px 0;
    color:var(--theme-text-sub);
    font-size:13px;
    line-height:1.5;
    overflow-wrap:anywhere;
}
.melody_flag-detail-songs-card p{
    margin:0;
    color:var(--theme-text-muted);
    font-size:12px;
}
@media(min-width:900px){
    .melody_flag-detail-side{
        position:static;
        height:100%;
    }
    .melody_flag-detail-side-card{
        flex:0 0 auto;
    }
    .melody_flag-detail-broadcasts-card{
        flex:1 1 auto;
    }
}
@media(max-width:899px){
    .melody_flag-detail-container{
        display:flex;
        flex-direction:column;
        gap:12px;
    }
    .melody_flag-detail-side{
        display:flex;
        order:2;
    }
    .melody_flag-detail-main{
        order:1;
    }
}


/* PCは独立した2列、各カードは独立。列の下端だけを揃える */
@media(min-width:900px){
    .melody_flag-detail-container{
        display:grid!important;
        grid-template-columns:minmax(0,1fr) minmax(320px,40%)!important;
        align-items:stretch!important;
        gap:18px!important;
    }
    .melody_flag-detail-main{
        min-width:0;
        height:100%;
    }
    .melody_flag-detail-side{
        display:flex!important;
        flex-direction:column;
        gap:12px;
        min-width:0;
        min-height:100%;
        height:100%;
        align-self:stretch;
        position:static!important;
    }
    .melody_flag-detail-side-card{
        width:100%;
        min-height:0!important;
        height:auto!important;
        flex:0 0 auto!important;
    }
    .melody_flag-detail-broadcasts-card{
        flex:1 0 auto!important;
    }
}
@media(max-width:899px){
    .melody_flag-detail-container{
        display:flex!important;
        flex-direction:column!important;
        align-items:stretch;
        gap:12px;
    }
    .melody_flag-detail-main,
    .melody_flag-detail-side{
        width:100%;
        min-width:0;
        order:initial;
    }
    .melody_flag-detail-side{
        display:flex!important;
        flex-direction:column;
        gap:12px;
        position:static!important;
        height:auto;
        min-height:0;
    }
    .melody_flag-detail-side-card{
        height:auto!important;
        min-height:0!important;
        flex:0 0 auto!important;
    }
}


.melody_flag-futsuota-note{
    margin:4px 0 8px;
    color:#98758a;
    font-size:11px;
    line-height:1.5;
}
.melody_flag-movie-button,
.melody_flag-broadcast-link.afterword-movie{
    cursor:pointer;
}


/* AI放送概要：長文を読みやすく表示する専用モーダル */
body.melody_flag-ai-summary-open{overflow:hidden}
.melody_flag-ai-summary-modal[hidden]{display:none!important}
.melody_flag-ai-summary-modal{position:fixed;inset:0;z-index:2147483001;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}
.melody_flag-ai-summary-backdrop{position:absolute;inset:0;background:rgba(30,20,35,.72);backdrop-filter:blur(3px)}
.melody_flag-ai-summary-dialog{position:relative;z-index:1;display:flex;flex-direction:column;width:min(760px,96vw);height:min(760px,88vh);margin:auto;border-radius:16px;background:#fff;box-shadow:0 18px 60px rgba(0,0,0,.35);overflow:hidden;box-sizing:border-box}
.melody_flag-ai-summary-header{display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;border-bottom:1px solid var(--theme-border-soft);background:#fff}
.melody_flag-ai-summary-header h2{margin:0;color:var(--theme-heading);font-size:17px;line-height:1.5;overflow-wrap:anywhere}
.melody_flag-ai-summary-close{flex:0 0 auto;width:38px;height:38px;border:0;border-radius:50%;background:var(--theme-blush);color:var(--theme-heading);font-size:27px;line-height:1;cursor:pointer}
.melody_flag-ai-summary-content{flex:1 1 auto;min-width:0;min-height:0;padding:20px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;color:var(--theme-text-sub);font-size:15px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere}
.melody_flag-ai-summary-footer{display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-top:1px solid var(--theme-border-soft);background:#fff}
.melody_flag-ai-summary-footer p{margin:0;color:var(--theme-text-muted);font-size:12px;line-height:1.6}
.melody_flag-ai-summary-close-button{flex:0 0 auto;padding:8px 15px;border:0;border-radius:999px;background:var(--theme-blush);color:var(--theme-heading);font:inherit;font-size:13px;font-weight:bold;cursor:pointer}
.melody_flag-ai-summary-open{background:#f4e8ff!important;color:#7650a5!important}
@media(max-width:600px){
 .melody_flag-ai-summary-modal{padding:8px}
 .melody_flag-ai-summary-dialog{width:100%;height:92vh;height:92dvh;border-radius:12px}
 .melody_flag-ai-summary-header{padding:10px 12px}
 .melody_flag-ai-summary-header h2{font-size:15px}
 .melody_flag-ai-summary-content{padding:14px;font-size:14px;line-height:1.8}
 .melody_flag-ai-summary-footer{align-items:flex-start;padding:10px 12px}
 .melody_flag-ai-summary-footer p{font-size:11px}
 .melody_flag-ai-summary-close-button{padding:8px 12px}
}
@media(max-height:600px){
 .melody_flag-ai-summary-dialog{height:calc(100dvh - 16px);max-height:calc(100dvh - 16px)}
}


/* AI放送概要：Markdown表示 */
.melody_flag-ai-summary-content > :first-child{margin-top:0}
.melody_flag-ai-summary-content > :last-child{margin-bottom:0}
.melody_flag-ai-summary-content p{margin:0 0 1em}
.melody_flag-ai-summary-content h1,
.melody_flag-ai-summary-content h2,
.melody_flag-ai-summary-content h3,
.melody_flag-ai-summary-content h4,
.melody_flag-ai-summary-content h5,
.melody_flag-ai-summary-content h6{margin:1.15em 0 .55em;color:var(--theme-heading);font-weight:700;line-height:1.5}
.melody_flag-ai-summary-content h1{font-size:1.45em}
.melody_flag-ai-summary-content h2{font-size:1.3em}
.melody_flag-ai-summary-content h3{font-size:1.15em}
.melody_flag-ai-summary-content ul,
.melody_flag-ai-summary-content ol{margin:.5em 0 1em;padding-left:1.6em}
.melody_flag-ai-summary-content li{padding:.12em 0}
.melody_flag-ai-summary-content blockquote{margin:.8em 0;padding:.5em .9em;border-left:3px solid #e7a5bd;background:var(--theme-blush);color:var(--theme-text-sub)}
.melody_flag-ai-summary-content a{color:var(--theme-brand);text-decoration:underline;overflow-wrap:anywhere}
.melody_flag-ai-summary-content code{padding:.12em .35em;border-radius:4px;background:#f5f0f3;font-family:ui-monospace,monospace;font-size:.9em}
.melody_flag-ai-summary-content pre{max-width:100%;padding:12px;border-radius:8px;background:#f7f5f6;overflow:auto;white-space:pre}
.melody_flag-ai-summary-content pre code{padding:0;background:transparent}
.melody_flag-ai-summary-content hr{margin:1em 0;border:0;border-top:1px solid var(--theme-border-soft)}
.melody_flag-ai-summary-content table{display:block;width:100%;max-width:100%;margin:1em 0;border-collapse:collapse;overflow-x:auto;white-space:normal}
.melody_flag-ai-summary-content th,
.melody_flag-ai-summary-content td{padding:8px 10px;border:1px solid var(--theme-border-soft);text-align:left;vertical-align:top}
.melody_flag-ai-summary-content th{background:var(--theme-blush);color:#96506d;font-weight:700}
.melody_flag-ai-summary-content td{background:#fff}


/* YouTube公式アイコン（ブランド素材） */
.melody_flag-youtube-icon{display:inline-block;width:20px;height:20px;flex:0 0 20px;object-fit:contain;vertical-align:middle}
.melody_flag-detail-side-card h2 .melody_flag-youtube-icon{margin-right:4px}
.melody_flag-link-youtube .melody_flag-youtube-icon{margin-right:5px}


/* YouTubeアーカイブ：公式フルカラーロゴのみを表示 */
.melody_flag-link-youtube-logo{
    min-width:104px;
    min-height:36px;
    padding:5px 12px!important;
}
.melody_flag-youtube-logo{
    display:block;
    width:96px;
    height:auto;
    max-height:31px;
    object-fit:contain;
}


/* 放送後旗・アナザーショットのSNSアイコン */
.melody_flag-detail-links .melody_flag-afterword-x-button,
.melody_flag-detail-links .melody_flag-instagram-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 13px;
    background: #f5f5f5;
    color: var(--theme-text);
    cursor: pointer;
}

.melody_flag-social-icon {
    display: block;
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
}

.melody_flag-x-icon {
    fill: currentColor;
}

.melody_flag-instagram-icon {
    color: #c13584;
}


/* YouTube配信ロゴボタン：ブランド背景と画像サイズを統一 */
.melody_flag-detail-links .melody_flag-link-youtube-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 36px;
    height: 36px;
    padding: 5px 9px !important;
    border: 0;
    border-radius: 8px;
    background: #fff !important;
    box-sizing: border-box;
}
.melody_flag-detail-links .melody_flag-link-youtube-logo .melody_flag-youtube-logo {
    display: block;
    width: 68px;
    height: 22px;
    max-width: none;
    max-height: 22px;
    margin: 0;
    object-fit: contain;
    transform: none;
}
@media (max-width: 600px) {
    .melody_flag-detail-links .melody_flag-link-youtube-logo {
        min-height: 34px;
        height: 34px;
        padding: 4px 7px !important;
    }
    .melody_flag-detail-links .melody_flag-link-youtube-logo .melody_flag-youtube-logo {
        height: 20px;
        max-height: 20px;
    }
}

/* 刷新追補：見出し・カード・受賞バッジ */
.melody_flag-detail-section h2,
.melody_flag-detail-side-card h2{
    display:flex;
    align-items:center;
    gap:9px;
    color:var(--theme-heading);
    font-size:19px;
    font-weight:bold;
    line-height:1.45;
}

.melody_flag-detail-section h2::before,
.melody_flag-detail-side-card h2::before{
    content:"";
    flex:0 0 auto;
    width:5px;
    height:22px;
    border-radius:3px;
    background:linear-gradient(180deg,var(--theme-btn-from),var(--theme-primary));
}

.melody_flag-detail-card,
.melody_flag-detail-side-card,
.melody_flag-corner-card{
    border:1px solid var(--theme-border-soft);
    border-radius:18px;
    background:#fff;
    box-shadow:0 6px 18px rgba(61,44,46,.06);
}

.melody_flag-letter-award{
    display:inline-block;
    margin-left:6px;
    padding:2px 9px;
    border-radius:999px;
    background:linear-gradient(135deg,#ffd76e,#f5a623);
    box-shadow:0 2px 6px rgba(245,166,35,.45);
    color:#7a4a00;
    font-size:11px;
    font-weight:bold;
    letter-spacing:.02em;
    vertical-align:1px;
}
