/* Shared shell for generated detail pages. Keep page-specific content in generators. */
:root {
    --detail-ink: #31405f;
    --detail-muted: #7280a4;
    --detail-line: #e9eefc;
    --detail-pink: #ff78b8;
    --detail-blue: #76c9ff;
}

body.detail-page {
    color: var(--detail-ink);
    background:
        radial-gradient(circle at 8% 12%, #ffd7ec 0 6%, transparent 7%),
        radial-gradient(circle at 92% 14%, #ccecff 0 7%, transparent 8%),
        linear-gradient(135deg, #fff7fb, #f2fff8 48%, #eef7ff);
}

body.detail-page--opus {
    background: linear-gradient(135deg, #fff7fb, #f4fff7 48%, #eef7ff);
}

.detail-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 8px 14px 28px;
}

.detail-shell .back-link {
    display: inline-flex;
    align-items: center;
    margin: 0 0 10px;
    padding: 8px 13px;
    border-radius: 999px;
    background: #ffffffd8;
    border: 1px solid var(--detail-line);
    color: #3687f7;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(76, 100, 151, .08);
}

.detail-shell .hero-card,
.detail-shell .panel {
    background: #ffffffd8;
    border: 1px solid var(--detail-line);
    box-shadow: 0 12px 26px rgba(73, 96, 143, .1);
}

.detail-shell .hero-card {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    padding: 20px;
    background: linear-gradient(120deg, #ffffffdf, #fff0f8df, #ecf9ffdf);
    border: 1px solid rgba(255, 255, 255, .94);
    box-shadow: 0 18px 38px rgba(84, 105, 155, .16);
}

.detail-page--opus .detail-shell .hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 244px;
    align-items: center;
    gap: 16px;
    border-radius: 22px;
    padding: 18px;
    background:
        radial-gradient(circle at 82% 12%, rgba(255, 120, 184, .2), transparent 28%),
        linear-gradient(120deg, rgba(255, 255, 255, .92), rgba(246, 250, 255, .88));
}

.detail-shell .hero-card::before {
    content: "";
    position: absolute;
    width: 210px;
    height: 210px;
    right: -70px;
    top: -70px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffc3e4, #bfeaff);
    opacity: .42;
}

.detail-page--opus .detail-shell .hero-card::before {
    display: none;
}

.detail-shell .hero-content {
    position: relative;
    z-index: 1;
}

.detail-page--opus .detail-shell .hero-title-block {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.detail-shell .hero-card h1 {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.25;
    font-weight: 900;
    letter-spacing: 0;
    color: #2f3c5a;
}

.detail-page--opus .detail-shell .hero-card h1 {
    font-size: 30px;
    line-height: 1.3;
}

.detail-shell .subline,
.detail-shell .desc {
    color: var(--detail-muted);
    line-height: 1.72;
    margin: 0;
}

.detail-shell .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.detail-shell .tag {
    border-radius: 999px;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #ffd4e9;
    color: #e2589f;
    font-size: 13px;
    font-weight: 800;
}

.detail-page--opus .detail-shell .hero-source-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    grid-template-areas:
        "eyebrow icon"
        "title icon"
        "desc icon";
    align-items: center;
    min-height: 108px;
    padding: 15px 14px 15px 16px;
    overflow: hidden;
    border-radius: 18px;
    color: #fff;
    text-decoration: none;
    background:
        radial-gradient(circle at 15% 8%, rgba(46, 232, 255, .5), transparent 26%),
        radial-gradient(circle at 86% 92%, rgba(255, 57, 146, .52), transparent 30%),
        linear-gradient(135deg, #121429, #27114b 52%, #11192e);
    box-shadow: 0 18px 36px rgba(74, 42, 150, .24), inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.detail-page--opus .detail-shell .hero-source-card::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 17px;
    border: 1px solid rgba(255, 255, 255, .16);
    pointer-events: none;
}

.detail-page--opus .detail-shell .hero-source-card::after {
    content: "";
    position: absolute;
    width: 86px;
    height: 170px;
    right: 22px;
    top: -38px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
    transform: rotate(22deg);
    transition: transform .35s ease, opacity .35s ease;
    opacity: .68;
}

.detail-page--opus .detail-shell .hero-source-card span,
.detail-page--opus .detail-shell .hero-source-card b,
.detail-page--opus .detail-shell .hero-source-card small,
.detail-page--opus .detail-shell .hero-source-card i {
    position: relative;
    z-index: 1;
}

.detail-page--opus .detail-shell .hero-source-card span {
    grid-area: eyebrow;
    width: max-content;
    padding: 4px 8px;
    border-radius: 999px;
    color: #aaf5ff;
    background: rgba(255, 255, 255, .1);
    font-size: 12px;
    font-weight: 900;
}

.detail-page--opus .detail-shell .hero-source-card b {
    grid-area: title;
    margin-top: 8px;
    font-size: 21px;
    line-height: 1.15;
    letter-spacing: 0;
}

.detail-page--opus .detail-shell .hero-source-card small {
    grid-area: desc;
    margin-top: 5px;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
    line-height: 1.35;
}

.detail-page--opus .detail-shell .hero-source-card i {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #1a1830;
    background: #fff;
    font-style: normal;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}

.detail-page--opus .detail-shell .hero-source-card:hover {
    transform: translateY(-1px);
}

.detail-page--opus .detail-shell .hero-source-card:hover::after {
    transform: translateX(22px) rotate(22deg);
    opacity: .95;
}

.detail-shell .panel-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 8px;
    align-items: start;
}

.detail-page--opus .detail-shell .panel-grid {
    margin-top: 10px;
    gap: 10px;
}

.detail-shell .main-column,
.detail-shell .side-column {
    display: grid;
    gap: 8px;
    align-items: start;
}

.detail-page--opus .detail-shell .main-column,
.detail-page--opus .detail-shell .side-column {
    gap: 10px;
}

.detail-shell .panel {
    border-radius: 20px;
    padding: 11px 12px;
}

.detail-page--opus .detail-shell .panel {
    border-radius: 16px;
    padding: 13px;
}

.detail-shell .panel h2 {
    margin: 0 0 7px;
    font-size: 18px;
    color: #2f3c5a;
    font-weight: 900;
}

.detail-page--opus .detail-shell .panel h2 {
    margin-bottom: 9px;
    font-size: 19px;
}

.detail-shell .main-column .panel h2 {
    margin-bottom: 9px;
    font-size: 22px;
    line-height: 1.3;
}

.detail-shell .main-column .desc {
    font-size: 15px;
    line-height: 1.86;
    color: #536487;
    text-align: justify;
}

.detail-shell .info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.detail-shell .info-table th,
.detail-shell .info-table td {
    padding: 8px 0;
    border-bottom: 1px solid #edf1fb;
    text-align: left;
    vertical-align: top;
}

.detail-shell .info-table th {
    width: 78px;
    color: #7b88a8;
    font-weight: 600;
}

.detail-page--opus .detail-shell .info-table th {
    width: 76px;
}

.detail-shell .query-grid,
.detail-shell .bullet-list,
.detail-shell .source-list,
.detail-shell .read-link-list,
.detail-shell .related-list,
.detail-shell .relation-list {
    display: grid;
    gap: 5px;
}

.detail-page--opus .detail-shell .relation-list {
    gap: 8px;
}

.detail-shell .related-list-spaced {
    margin-top: 6px;
}

.detail-shell .query-grid a,
.detail-shell .source-list a,
.detail-shell .read-link-list a,
.detail-shell .related-list a,
.detail-shell .relation-link {
    display: block;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid #ddeefe;
    background: linear-gradient(90deg, #fff, #f5fbff);
    color: #3687f7;
    text-decoration: none;
    line-height: 1.5;
    font-weight: 700;
}

.detail-page--opus .detail-shell .relation-link {
    padding: 9px 10px;
    border-radius: 12px;
    border-color: #edf1fb;
    background: linear-gradient(90deg, #fff, #f8fbff);
    line-height: 1.45;
}

.detail-shell .query-grid a:hover,
.detail-shell .source-list a:hover,
.detail-shell .read-link-list a:hover,
.detail-shell .related-list a:hover {
    color: #e2589f;
    border-color: #ffd4e9;
}

.detail-shell .relation-link strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2f3c5a;
}

.detail-shell .relation-link span {
    display: block;
    margin-top: 3px;
    color: #7b88a8;
    font-size: 12px;
}

.detail-shell .side-column .panel {
    font-size: 13px;
}

.detail-shell .side-column .panel h2 {
    font-size: 16px;
    margin-bottom: 6px;
}

.detail-shell .cover-panel {
    overflow: hidden;
    padding: 0;
}

.detail-shell .cover-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #eef3fb;
}

.detail-shell .side-column .info-table {
    font-size: 13px;
}

.detail-shell .side-column .info-table th,
.detail-shell .side-column .info-table td {
    padding: 7px 0;
}

.detail-shell .side-column .query-grid,
.detail-shell .side-column .source-list,
.detail-shell .side-column .read-link-list,
.detail-shell .side-column .related-list {
    gap: 0;
}

.detail-shell .side-column .query-grid a,
.detail-shell .side-column .source-list a,
.detail-shell .side-column .read-link-list a,
.detail-shell .side-column .related-list a {
    padding: 7px 0;
    font-size: 13px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 0;
    border-bottom: 1px solid #edf1fb;
    border-radius: 0;
    background: transparent;
}

.detail-shell .side-column .subline {
    display: none;
}

.detail-shell .info-table .read-address-row td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-shell .info-table .read-address {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #3687f7;
    text-decoration: none;
    font: inherit;
    font-style: normal;
    font-weight: 600;
    line-height: inherit;
}

.detail-shell .info-table .read-address:hover {
    color: #e2589f;
    background: transparent;
    text-decoration: none;
}

.detail-shell .bullet-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.detail-shell .bullet-list li {
    padding: 8px 10px;
    border-radius: 14px;
    background: linear-gradient(90deg, #fff, #fff7fc);
    border: 1px solid #ffe0f1;
    color: #5f6f95;
    line-height: 1.7;
}

.detail-shell .main-column .bullet-list li {
    font-size: 14px;
    line-height: 1.72;
    color: #536487;
}

.detail-shell .hook-list li {
    border-color: #cdeeff;
    background: linear-gradient(90deg, #fff, #f4fbff);
}

.detail-shell .plan-blocks {
    display: grid;
    gap: 8px;
}

.detail-shell .plan-block {
    border: 1px solid #e6eefc;
    border-radius: 14px;
    background: linear-gradient(90deg, #fff, #f8fbff);
    padding: 9px 10px;
}

.detail-shell .plan-block h3 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #2f3c5a;
    font-weight: 900;
}

.detail-shell .plan-block .bullet-list li {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 3px 0;
}

.detail-shell .match-slots {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
}

.detail-shell .match-slot {
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 8px 9px;
    border-radius: 14px;
    border: 1px dashed #ffc8e4;
    background: linear-gradient(135deg, #fff, #fff7fc);
    color: #7b88a8;
    text-decoration: none;
    line-height: 1.35;
}

.detail-shell .match-slot.filled {
    border-style: solid;
    border-color: #cdeeff;
    color: #3687f7;
    background: linear-gradient(135deg, #fff, #f4fbff);
    font-weight: 800;
}

.detail-shell .match-slot strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2f3c5a;
    font-size: 13px;
}

.detail-shell .main-column .match-slot strong {
    font-size: 14px;
}

.detail-shell .match-slot span {
    font-size: 12px;
}

.detail-shell .side-column .match-panel .plan-blocks {
    gap: 7px;
}

.detail-shell .side-column .match-panel .plan-block {
    padding: 8px;
    border-radius: 12px;
}

.detail-shell .side-column .match-panel .plan-block h3 {
    font-size: 13px;
    margin-bottom: 5px;
}

.detail-shell .side-column .match-panel .match-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 0;
}

.detail-shell .side-column .match-panel .match-slot {
    min-height: 42px;
    padding: 6px 4px;
    border-radius: 10px;
    text-align: center;
}

.detail-shell .side-column .match-panel .match-slot strong {
    font-size: 12px;
}

.detail-shell .side-column .match-panel .match-slot span {
    font-size: 11px;
}

.detail-shell .source-link {
    display: inline-block;
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    background: #fff7fc;
    border: 1px solid #ffd4e9;
    color: #d9579b;
    text-decoration: none;
    font-weight: 800;
}

.detail-shell .editorial-note {
    margin-bottom: 10px;
    padding: 9px 11px;
    border-left: 3px solid #76c9ff;
    border-radius: 8px;
    background: #f5fbff;
}

.detail-shell .fact-note {
    margin: 0 0 10px;
    padding: 9px 11px;
    border-left: 3px solid #56b98d;
    border-radius: 8px;
    background: #f3fbf7;
    color: #526f65;
    font-size: 13px;
    line-height: 1.65;
}

.detail-shell .related-list a strong,
.detail-shell .related-list a span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-shell .related-list a strong {
    color: #2f3c5a;
}

.detail-shell .related-list a span {
    margin-top: 2px;
    color: #7b88a8;
    font-size: 12px;
    font-weight: 500;
}

@media (max-width: 820px) {
    .detail-shell .panel-grid {
        grid-template-columns: 1fr;
    }

    .detail-shell .main-column,
    .detail-shell .side-column {
        gap: 8px;
    }

    .detail-shell .match-slots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-shell .side-column .match-panel .match-slots {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .detail-shell .hero-card {
        padding: 18px 14px;
        border-radius: 20px;
    }

    .detail-page--opus .detail-shell .hero-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .detail-page--opus .detail-shell .hero-source-card {
        min-height: 92px;
    }

    .detail-shell .hero-card h1 {
        font-size: 26px;
    }

    .detail-page--opus .detail-shell .hero-card h1 {
        font-size: 24px;
    }
}
