/* Detail pages only. Existing overview cards and module contents remain intact. */
#main.layout-main:has(#listing.modern-detail) {grid-template-columns:minmax(0,1fr);}
#main:has(#listing.modern-detail) #maininner {width:100%;min-width:0;float:none;margin:0;}
.custom-tree-template #listing.modern-detail {--md-ink:var(--mp-ink);--md-muted:var(--mp-muted);--md-line:var(--mp-line);--md-blue:var(--mp-blue);float:none;width:100%;margin:0;color:var(--md-ink);font:14px/1.65 var(--mp-font);}
#listing.modern-detail *, #listing.modern-detail *::before, #listing.modern-detail *::after {box-sizing:border-box;}
.custom-tree-template #listing.modern-detail a {color:var(--md-blue);text-decoration:none;}
.custom-tree-template #listing.modern-detail a:hover {text-decoration:underline;}
#listing.modern-detail :focus-visible {outline:3px solid var(--mp-focus);outline-offset:4px;}
#listing.modern-detail section {scroll-margin-top:35px;}
.custom-tree-template #listing.modern-detail .modern-hero {display:flex;align-items:flex-start;gap:25px;padding:30px;border:1px solid var(--md-line);border-radius:var(--mp-radius,8px);background:#fff;box-shadow:0 3px 10px #20394a04;}
.custom-tree-template #listing.modern-featured .modern-hero {border-color:#b5c8d5;}
.custom-tree-template #listing.modern-detail .modern-product-image {height:106px;width:120px;flex-shrink:0;border:1px solid var(--md-line);border-radius:var(--mp-radius,8px);padding:10px;background:#f8fafb;display:flex;align-items:center;justify-content:center;margin:0;}
.custom-tree-template #listing.modern-detail .modern-product-image img {width:100%;height:100%;max-width:100%;object-fit:contain;object-position:center;margin:0!important;border:0;padding:0;float:none;}
.modern-hero-copy {flex:1;min-width:0;}
#listing.modern-detail .modern-eyebrow {font-size:10px;letter-spacing:.06em;color:var(--md-muted);margin-bottom:7px;}
#listing.modern-detail .modern-eyebrow a {color:var(--md-muted);}
#listing.modern-detail .modern-eyebrow img {max-width:12px;max-height:12px;}
.custom-tree-template #listing.modern-detail .modern-hero h1 {float:none;display:block;width:auto;padding:0;border:0;margin:6px 0 12px;font-size:36px;line-height:1.2;letter-spacing:-.035em;background:transparent;color:var(--md-ink);font-weight:750;}
.custom-tree-template #listing.modern-detail .modern-hero h1 .btn-group {float:right;margin-left:12px;}
.custom-tree-template #listing.modern-detail .modern-hero h1 .btn {font-size:12px;letter-spacing:0;}
.custom-tree-template #listing.modern-detail .modern-hero h1 .badge, .custom-tree-template #listing.modern-detail .modern-hero h1 .featured {display:inline-block;vertical-align:middle;font-size:10px;letter-spacing:0;border:1px solid #b5c8d5;background:#fff;color:#46697e;border-radius:5px;line-height:1.5;padding:3px 8px;margin:0 0 3px 10px;box-shadow:none;}
.custom-tree-template #listing.modern-detail .modern-lead {font-size:15px;line-height:1.7;color:#566e7f;margin:0 0 15px;padding:0;}
#listing.modern-detail .modern-hero-meta {display:flex;flex-wrap:wrap;gap:18px;font-size:12px;color:var(--md-muted);}
.custom-tree-template #listing.modern-detail .modern-rating-summary {display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:11px;color:var(--md-muted);margin-top:15px;}
#listing.modern-detail .modern-rating-summary strong {color:var(--md-ink);font-size:12px;}
#listing.modern-detail .modern-rating-summary > .rating {display:inline-block;float:none;width:auto;margin:0;border:0;padding:0;}
.modern-hero-actions {min-width:174px;display:flex;flex-direction:column;gap:10px;padding-top:35px;}
.custom-tree-template #listing.modern-detail .modern-primary {display:flex;justify-content:space-between;align-items:center;gap:20px;background:#1179a8;color:#fff;padding:12px 17px;border-radius:7px;font-size:13px;font-weight:650;}
.custom-tree-template #listing.modern-detail .modern-primary:hover {background:#08638d;text-decoration:none;}
.modern-hero-actions small {text-align:center;color:var(--md-muted);font-size:10px;}
#listing.modern-detail .modern-save {text-align:center;border:1px solid var(--md-line);border-radius:7px;padding:9px;font-size:12px;}
.custom-tree-template #listing.modern-detail .modern-save a {color:#506879;display:block;}
.custom-tree-template #listing.modern-detail .modern-section-nav {display:flex;flex-wrap:wrap;gap:12px 28px;margin:23px 0 25px;padding:0 4px 14px;border-bottom:1px solid var(--md-line);}
.custom-tree-template #listing.modern-detail .modern-section-nav a {font-size:12px;font-weight:600;color:#536e80;}
.modern-section-nav a span {font-size:10px;background:#e8eef2;border-radius:4px;padding:2px 5px;margin-left:3px;}
#listing.modern-detail .modern-layout {display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:24px;align-items:start;}
#listing.modern-detail .modern-content, #listing.modern-detail .modern-sidebar {display:flex;flex-direction:column;gap:24px;min-width:0;}
.custom-tree-template #listing.modern-detail .modern-panel {min-width:0;padding:26px;background:#fff;border:1px solid var(--md-line);border-radius:var(--mp-radius,8px);margin:0;}
#listing.modern-detail .modern-kicker {font-size:9px;letter-spacing:.12em;color:var(--md-muted);font-weight:700;line-height:1.5;margin-bottom:7px;}
.custom-tree-template #listing.modern-detail .modern-panel > h2, .custom-tree-template #listing.modern-detail .modern-panel-heading h2 {float:none;width:auto;color:var(--md-ink);font-size:22px;letter-spacing:-.025em;line-height:1.3;font-weight:700;margin:0 0 20px;padding:0;border:0;background:transparent;}
.custom-tree-template #listing.modern-detail .modern-panel-heading h2 {margin-bottom:0;}
#listing.modern-detail .modern-panel-heading {display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:20px;}
.modern-panel-heading > span {font-size:11px;color:var(--md-muted);}
.modern-description, .modern-rich-content {color:#536b7b;overflow-wrap:anywhere;}
.modern-description p, .modern-rich-content p {margin:0 0 16px;}
.modern-description p:last-child, .modern-rich-content p:last-child {margin-bottom:0;}
.modern-description img, .modern-rich-content img, .modern-info img {max-width:100%;height:auto;}
.modern-rich-content iframe {max-width:100%;}
.modern-description pre, .modern-rich-content pre {white-space:pre-wrap;overflow-wrap:anywhere;}
.modern-description table, .modern-rich-content table {max-width:100%;}
#listing.modern-detail .modern-description ul, #listing.modern-detail .modern-rich-content ul {padding-left:22px;}
.custom-tree-template #listing.modern-detail .modern-main-image {display:flex;position:relative;align-items:center;justify-content:center;width:100%;height:340px;border:1px solid var(--md-line);border-radius:var(--mp-radius,8px);background:#f2f5f7;padding:20px;margin:0;}
.custom-tree-template #listing.modern-detail .modern-main-image img {width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center;float:none;padding:0;border:0;margin:0!important;}
.modern-main-image > span {position:absolute;bottom:12px;right:12px;background:#ffffffed;border:1px solid var(--md-line);padding:4px 9px;border-radius:5px;color:#506b7e;font-size:11px;}
#listing.modern-detail .modern-thumbs {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:14px;}
.custom-tree-template #listing.modern-detail .modern-thumbs a {height:84px;background:#f7f9fa;border:1px solid var(--md-line);border-radius:7px;padding:8px;display:flex;align-items:center;justify-content:center;min-width:0;margin:0;}
.custom-tree-template #listing.modern-detail .modern-thumbs img {width:100%;height:100%;max-width:100%;object-fit:contain;object-position:center;float:none;margin:0!important;padding:0;border:0;}
.custom-tree-template #listing.modern-detail .modern-thumbs .is-active {border:2px solid var(--md-blue);padding:7px;background:#fff;}
#listing.modern-detail .modern-gallery-more {display:block;margin-top:15px;font-size:12px;}
.custom-tree-template #listing.modern-detail .modern-info {padding:23px;}
.custom-tree-template #listing.modern-detail .modern-info > h2 {font-size:19px;margin-bottom:16px;}
.modern-info dl {margin:0;}
.modern-info .modern-field {display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid #edf1f4;font-size:11px;}
.modern-info dt {color:var(--md-muted);font-weight:400;flex:1;}
.modern-info dd {margin:0;text-align:right;font-weight:600;max-width:62%;overflow-wrap:anywhere;}
.modern-info dd p {margin:0;}
.modern-info .modern-stats {display:flex;justify-content:space-around;margin-top:22px;gap:15px;text-align:center;}
.modern-stats strong {display:block;font-size:18px;font-weight:700;}
.modern-stats span {font-size:10px;color:var(--md-muted);}
.custom-tree-template .modern-info h3 {font-size:12px;line-height:1.5;font-weight:600;margin:20px 0 9px;padding:0;color:var(--md-ink);background:transparent;border:0;}
#listing.modern-detail .modern-versions {display:flex;flex-wrap:wrap;gap:7px;}
.modern-versions span {border:1px solid var(--md-line);border-radius:4px;padding:3px 8px;font-size:11px;color:#506a7d;}
.modern-resource {font-size:12px;overflow-wrap:anywhere;padding-bottom:5px;}
.modern-resource .caption {float:none;width:auto;margin:0;}
.modern-resource .mfile {display:block;max-width:100%;}
.modern-resource .mfile-desc, .modern-resource .mfile-filename, .modern-resource .mfile-size {font-size:10px;color:var(--md-muted);}
.modern-info .modern-actions {display:flex;flex-direction:column;gap:10px;font-size:12px;}
.modern-info .modern-actions a {margin:0;padding:0;float:none;}
.modern-info .modern-rate {border-top:1px solid var(--md-line);padding-top:18px;margin-top:20px;font-size:11px;}
#listing.modern-detail #total-votes {font-size:10px;color:var(--md-muted);margin-top:6px;}
#listing.modern-detail .modern-count {font-size:14px;color:var(--md-muted);margin-left:5px;}
#listing.modern-detail .modern-review-summary {display:flex;gap:22px;align-items:center;padding:0 0 22px;margin-top:8px;border-bottom:1px solid var(--md-line);}
.modern-review-summary > strong {font-size:32px;line-height:1.2;}
.modern-review-summary strong small {font-size:12px;color:var(--md-muted);font-weight:400;}
.modern-review-summary > span {display:flex;flex-direction:column;gap:5px;}
.modern-review-summary > span > small {font-size:10px;color:var(--md-muted);}
.custom-tree-template .modern-reviews .reviews {margin:0;padding:0;border:0;float:none;width:100%;}
.custom-tree-template .modern-reviews .review {position:relative;display:block;float:none;width:100%;border:0;border-bottom:1px solid #e8eef2;margin:0;padding:24px 0;background:transparent;}
.custom-tree-template .modern-reviews .review .review-head, .custom-tree-template .modern-reviews .review .span10 {float:none;width:100%;margin:0;padding:0;min-height:0;}
.custom-tree-template .modern-reviews .review .review-info {position:relative;padding-left:46px;min-height:38px;font-size:10px;color:var(--md-muted);}
.custom-tree-template .modern-reviews .review .review-info img {position:absolute;top:0;left:0;width:34px;height:34px;object-fit:cover;border-radius:50%;margin:0!important;border:0;padding:0;}
.custom-tree-template #listing.modern-detail .modern-review-initial {position:absolute;top:0;left:0;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#edf3f6;color:#54768c;font-size:13px;font-weight:700;}
.custom-tree-template .modern-reviews .review .review-owner {font-size:12px;font-weight:600;color:var(--md-ink);}
.custom-tree-template .modern-reviews .review .review-date {font-size:10px;margin:0;line-height:1.7;}
.custom-tree-template .modern-reviews .review .found-helpful {margin:8px 0 0 46px;font-size:10px;color:var(--md-muted);}
.custom-tree-template .modern-reviews .review .review-text {margin:16px 0 0;padding:0;line-height:1.7;font-size:13px;color:#536b7b;overflow-wrap:anywhere;}
.custom-tree-template .modern-reviews .review .review-title {color:var(--md-ink);font-size:15px;font-weight:650;margin:0 0 9px;padding:0;border:0;background:transparent;}
.custom-tree-template .modern-reviews .review .review-rating {position:absolute;right:0;top:26px;float:none;width:auto;margin:0;padding:0;}
.custom-tree-template .modern-reviews .review .review-rating img {width:14px;height:14px;}
.custom-tree-template .modern-reviews .review .owners-reply {border-left:2px solid var(--md-line);padding-left:15px;margin-top:18px;font-size:12px;}
.custom-tree-template .modern-reviews .review .ask-helpful, .custom-tree-template .modern-reviews .review .review-reply-report-permalink {font-size:10px;margin-top:12px;color:var(--md-muted);}
.custom-tree-template .modern-reviews .review .review-reply-report-permalink {display:flex;flex-wrap:wrap;gap:14px;justify-content:flex-end;}
.custom-tree-template .modern-reviews .review .review-reply-report-permalink > div {margin:0;float:none;}
.custom-tree-template .modern-reviews .reviews > p {margin:20px 0 0;}
.custom-tree-template .modern-reviews .reviews > p > .btn {background:#f4f7f9;border:1px solid var(--md-line);border-radius:6px;color:#45687e;font-size:11px;padding:8px 11px;box-shadow:none;margin:0 8px 8px 0;}
@media(max-width:1000px) {
  #listing.modern-detail .modern-layout {grid-template-columns:minmax(0,1fr) 250px;gap:20px;}
  .custom-tree-template #listing.modern-detail .modern-hero {padding:25px;gap:20px;}
  .modern-hero-actions {min-width:150px;}
  .custom-tree-template #listing.modern-detail .modern-hero h1 {font-size:31px;}
  .custom-tree-template #listing.modern-detail .modern-panel {padding:22px;}
  .custom-tree-template #listing.modern-detail .modern-info {padding:19px;}
}
@media(max-width:767px) {
  .custom-tree-template #listing.modern-detail .modern-product-image {display:none;}
  #listing.modern-detail .modern-layout {display:flex;flex-direction:column;gap:20px;}
  #listing.modern-detail .modern-content {display:contents;}
  #listing.modern-detail .modern-content > section {width:100%;order:1;}
  #listing.modern-detail .modern-sidebar {width:100%;order:2;}
  #listing.modern-detail .modern-content > .modern-reviews {order:3;}
  .custom-tree-template #listing.modern-detail .modern-hero h1 {font-size:30px;}
  #listing.modern-detail .modern-section-nav {gap:12px 20px;}
}
@media(max-width:520px) {
  .custom-tree-template #listing.modern-detail .modern-hero {display:block;padding:22px;}
  .modern-hero-actions {padding-top:18px;min-width:0;display:grid;grid-template-columns:1fr 1fr;align-items:center;}
  .modern-hero-actions small {grid-column:1/-1;order:3;}
  #listing.modern-detail .modern-primary {font-size:11px;padding:10px 12px;}
  .custom-tree-template #listing.modern-detail .modern-lead {font-size:13px;}
  #listing.modern-detail .modern-hero h1 .featured {margin-left:0;}
  .custom-tree-template #listing.modern-detail .modern-main-image {height:245px;padding:12px;}
  #listing.modern-detail .modern-thumbs {gap:8px;}
  .custom-tree-template #listing.modern-detail .modern-thumbs a {height:62px;padding:6px;}
  .custom-tree-template #listing.modern-detail .modern-thumbs .is-active {padding:5px;}
  .custom-tree-template #listing.modern-detail .modern-panel {padding:20px;}
  .custom-tree-template #listing.modern-detail .modern-panel > h2, .custom-tree-template #listing.modern-detail .modern-panel-heading h2 {font-size:20px;}
  #listing.modern-detail .modern-panel-heading > span {font-size:10px;}
  .custom-tree-template .modern-reviews .review .review-head {padding-right:82px;}
}

/* Override the component's older ID-based heading and link rules. */
.custom-tree-template #listing.modern-detail .modern-panel > h2,
.custom-tree-template #listing.modern-detail .modern-panel-heading h2 {font-size:22px!important;}
.custom-tree-template #listing.modern-detail .modern-info > h2 {font-size:19px!important;}
@media(max-width:520px) {
.custom-tree-template #listing.modern-detail .modern-panel > h2,
.custom-tree-template #listing.modern-detail .modern-panel-heading h2 {font-size:20px!important;}
.custom-tree-template #listing.modern-detail .modern-info > h2 {font-size:19px!important;}
}

/* Adopted sidebar comparison: repository navigation right, product data below hero. */
#main.layout-main:has(#listing.modern-detail){grid-template-columns:minmax(0,1fr) 270px;gap:24px;align-items:start}
#listing.modern-detail .modern-layout{display:block}
#listing.modern-detail .modern-content{display:flex;flex-direction:column;gap:24px}
#listing.modern-detail .modern-content>section{order:initial}
#listing.modern-detail .modern-product-information{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:24px;align-items:start}
.custom-tree-template #listing.modern-detail .modern-product-information>.modern-panel{padding:18px}
.custom-tree-template #listing.modern-detail .modern-product-information .modern-info>h2{font-size:17px!important}
#listing.modern-detail .modern-product-information .modern-field{font-size:10px;padding:7px 0;gap:7px}
#listing.modern-detail .modern-product-information .modern-kicker{font-size:8px;letter-spacing:.07em}
#listing.modern-detail .modern-product-information .modern-versions{gap:5px}
#listing.modern-detail .modern-product-information .modern-versions span{font-size:10px;padding:2px 6px}
.custom-tree-template #listing.modern-detail .modern-hero{display:grid;grid-template-columns:minmax(0,1fr);gap:22px 26px;padding:25px}
.custom-tree-template #listing.modern-detail .modern-hero.modern-has-image{grid-template-columns:minmax(0,1fr) 280px}
#listing.modern-detail .modern-hero-copy{grid-column:1;grid-row:1}
.custom-tree-template #listing.modern-detail .modern-product-image{display:flex;grid-column:2;grid-row:1 / span 2;width:100%;height:230px;padding:14px;align-self:center}
#listing.modern-detail .modern-hero-actions{grid-column:1;grid-row:2;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;min-width:0;padding-top:0}
#listing.modern-detail .modern-hero-actions small{width:100%;text-align:left;order:3}
.custom-tree-template #listing.modern-detail .modern-lead{font-size:14px}
@media(max-width:1100px){
 #main.layout-main:has(#listing.modern-detail){grid-template-columns:minmax(0,1fr) 240px;gap:18px}
 .custom-tree-template #listing.modern-detail .modern-hero.modern-has-image{grid-template-columns:minmax(0,1fr) 200px;gap:18px}
 .custom-tree-template #listing.modern-detail .modern-product-image{height:190px;grid-row:1}
 #listing.modern-detail .modern-hero-actions{grid-column:1 / -1}
 #listing.modern-detail .modern-product-information{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:767px){
 #main.layout-main:has(#listing.modern-detail){grid-template-columns:minmax(0,1fr)}
}
@media(max-width:520px){
 .custom-tree-template #listing.modern-detail .modern-hero.modern-has-image{grid-template-columns:minmax(0,1fr)}
 .custom-tree-template #listing.modern-detail .modern-product-image{grid-column:1;grid-row:2;height:210px}
 #listing.modern-detail .modern-hero.modern-has-image .modern-hero-actions{grid-row:3}
 #listing.modern-detail .modern-product-information{grid-template-columns:minmax(0,1fr)}
}
